    :root {
      color-scheme: light;
      --bg: #f6f8fb;
      --panel: #ffffff;
      --panel-soft: #f1f5f7;
      --text: #172126;
      --muted: #66727a;
      --line: #dce5e8;
      --primary: #0f766e;
      --primary-dark: #0b5f59;
      --accent: #2f6feb;
      --amber: #b7791f;
      --rose: #be123c;
      --ok: #15803d;
      --shadow: 0 18px 48px rgba(24, 35, 42, 0.12);
      --radius: 8px;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    html, body {
      margin: 0;
      padding: 0;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      min-height: 100vh;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 251, 0.94)),
        url("https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1800&q=80") center top / cover fixed;
      color: var(--text);
    }

    button,
    input,
    textarea,
    select {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    button:disabled {
      cursor: not-allowed;
      opacity: 0.62;
    }

    .app-shell {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      background: rgba(246, 248, 251, 0.88);
    }

    .topbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 0 20px;
      height: 56px;
      background: var(--navy);
      color: #fff;
    }
    .topbar-start { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .brand { display: flex; align-items: center; gap: 10px; }
    .brand-link { color: inherit; text-decoration: none; }
    .brand-mark {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      background: rgba(255,255,255,.15);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
      letter-spacing: .04em;
      flex-shrink: 0;
    }
    .brand-title { font-size: 15px; font-weight: 600; line-height: 1.2; }
    .brand-subtitle { font-size: 11px; opacity: .7; line-height: 1.2; }
    .status-strip {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      opacity: .85;
      margin-left: auto;
    }
    .dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--amber);
      flex-shrink: 0;
    }
    .dot.ok { background: var(--ok); }
    .dot.warn { background: var(--amber); }
    .dot.error { background: var(--rose); }
    .top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
    .top-actions .btn { padding-left: 12px; padding-right: 12px; }

    .topbar .btn.secondary {
      background: rgba(255,255,255,.12);
      color: #fff;
      border-color: transparent;
      box-shadow: none;
    }
    .topbar .btn.secondary:hover:not(:disabled) {
      background: rgba(255,255,255,.2);
    }
    .topbar .icon-btn {
      width: 34px;
      height: 34px;
      min-width: auto;
      padding: 7px;
      justify-content: center;
    }
    .topbar .btn {
      min-height: auto;
      padding: 7px 16px;
      border: none;
      font-weight: 500;
      gap: 6px;
      justify-content: flex-start;
    }
    .topbar .btn.icon-btn {
      align-items: center;
      justify-content: center;
    }
    .topbar .btn:hover {
      transform: none;
      box-shadow: none;
    }

    .layout {
      display: grid;
      flex: 1;
      grid-template-columns: 230px minmax(430px, 1fr) 360px;
      gap: 18px;
    }

    .sidebar,
    .config-panel {
      align-self: start;
      position: sticky;
      top: 90px;
      max-height: calc(100vh - 112px);
      overflow: auto;
    }

    .panel {
      background: rgba(255, 255, 255, 0.94);
      border: 1px solid rgba(220, 229, 232, 0.92);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
    }

    .sidebar,
    .config-panel {
      align-self: start;
      position: sticky;
      top: 90px;
      max-height: calc(100vh - 112px);
      overflow: auto;
    }

    .panel-section {
      padding: 18px;
      border-bottom: 1px solid var(--line);
    }

    .panel-section:last-child {
      border-bottom: 0;
    }

    .section-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .section-heading h2,
    .section-heading h3 {
      margin: 0;
      font-size: 15px;
      line-height: 1.2;
    }

    .section-heading p {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 38px;
      padding: 0 14px;
      border: 1px solid transparent;
      border-radius: var(--radius);
      background: var(--primary);
      color: #ffffff;
      font-weight: 700;
      font-size: 13px;
      text-decoration: none;
      transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
    }

    .btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
      background: var(--primary-dark);
    }

    .btn.secondary {
      background: #ffffff;
      color: var(--text);
      border-color: var(--line);
    }

    .btn.secondary:hover {
      border-color: #b9c7cc;
      box-shadow: 0 10px 22px rgba(24, 35, 42, 0.08);
      background: #f8fafb;
    }

    .btn.ghost {
      min-height: 32px;
      padding: 0 10px;
      background: transparent;
      color: var(--primary-dark);
      border-color: transparent;
      font-weight: 700;
    }

    .btn.ghost:hover {
      background: #e9f7f5;
      box-shadow: none;
    }

    .icon-btn {
      width: 42px;
      min-width: 42px;
      padding: 0;
    }

    .icon-btn svg {
      width: 18px;
      height: 18px;
      display: block;
    }

    .btn.full {
      width: 100%;
    }

    .field {
      display: grid;
      gap: 7px;
      margin-bottom: 14px;
    }

    .field:last-child {
      margin-bottom: 0;
    }

    .field-action {
      align-self: auto;
    }

    .field label,
    .field-title {
      color: #263238;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.25;
    }

    .hint {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .input,
    .textarea,
    .select {
      width: 100%;
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
      color: var(--text);
      outline: 0;
      transition: border-color 140ms ease, box-shadow 140ms ease;
    }

    .input,
    .select {
      padding: 0 12px;
    }

    .textarea {
      min-height: 112px;
      padding: 11px 12px;
      resize: vertical;
      line-height: 1.55;
    }

    .input:focus,
    .textarea:focus,
    .select:focus {
      border-color: rgba(15, 118, 110, 0.72);
      box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
    }

    .inline-input-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
    }

    .inline-confirm-btn {
      min-width: 76px;
      white-space: nowrap;
    }

    .micro-input,
    .micro-input::placeholder,
    .micro-hint {
      font-size: 12px;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
    }

    .switch-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #fbfcfd;
    }

    .switch {
      position: relative;
      display: inline-flex;
      width: 46px;
      height: 26px;
      flex: 0 0 auto;
    }

    .switch input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .slider {
      width: 100%;
      border-radius: 999px;
      background: #c9d3d8;
      transition: background 160ms ease;
    }

    .slider::after {
      content: "";
      position: absolute;
      top: 3px;
      left: 3px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: #ffffff;
      box-shadow: 0 2px 5px rgba(24, 35, 42, 0.24);
      transition: transform 160ms ease;
    }

    .switch input:checked + .slider {
      background: var(--primary);
    }

    .switch input:checked + .slider::after {
      transform: translateX(20px);
    }

    .check-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .check-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 36px;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
      color: #28363d;
      font-size: 12px;
      font-weight: 700;
    }

    .check-chip input {
      accent-color: var(--primary);
    }

    .project-list {
      display: grid;
      gap: 6px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .project-current {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 6px 10px;
      align-items: center;
      margin-bottom: 14px;
      padding: 12px 14px;
      border: 1px solid rgba(37, 99, 235, 0.16);
      border-radius: var(--radius);
      background: #f8fbff;
    }

    .project-current-main {
      min-width: 0;
    }

    .project-current-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }

    .project-current-label {
      color: #475569;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .project-current-name {
      color: #111827;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.4;
    }

    .project-current-meta,
    .project-id-line {
      color: #64748b;
      font-size: 11.5px;
      line-height: 1.5;
      word-break: break-all;
    }

    .subsection-heading {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: nowrap;
      gap: 10px;
      margin: 2px 0 12px;
    }

    .subsection-heading > div {
      min-width: 0;
      flex: 1 1 160px;
    }

    .subsection-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
      flex-shrink: 0;
    }

    .subsection-actions .icon-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      min-width: 36px;
      min-height: 36px;
      height: 36px;
      padding: 0;
    }

    .subsection-actions .icon-btn svg {
      width: 18px;
      height: 18px;
      flex: 0 0 auto;
    }

    .subsection-heading h3 {
      margin: 0;
      font-size: 13px;
      font-weight: 800;
    }

    .subsection-heading p {
      margin: 3px 0 0;
      color: var(--muted);
      font-size: 11.5px;
      line-height: 1.5;
    }

    #refreshProjectListBtn {
      flex: 0 0 auto;
    }

    .project-card {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 4px 8px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
      align-items: center;
    }
    .project-card-head,
    .project-id-line {
      grid-column: 1 / -1;
    }
    .project-meta {
      grid-column: 1;
    }
    .project-card-actions {
      grid-column: 2;
    }

    .project-card.active {
      border-color: rgba(15, 118, 110, 0.38);
      background: #f0fbf8;
    }

    .project-name {
      margin: 0;
      color: #18262b;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .project-meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }

    .project-card-head,
    .status-title-row,
    .preview-head,
    .result-headline {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
    }

    .status-title-row {
      min-width: 0;
      flex-wrap: wrap;
    }

    .project-status-badge,
    .result-badge {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 9px;
      border: 1px solid rgba(15, 23, 42, 0.08);
      border-radius: 999px;
      background: #f8fafc;
      color: #475569;
      font-size: 11px;
      font-weight: 800;
      white-space: nowrap;
    }

    .project-card .btn[disabled] {
      opacity: 1;
      color: #0f766e;
      background: #ecfdf5;
      border-color: rgba(16, 185, 129, 0.24);
    }

    .project-card .btn.action-icon-btn[disabled] {
      color: var(--ok) !important;
      background: transparent;
      border-color: transparent;
    }

    .main {
      display: grid;
      gap: 18px;
      min-width: 0;
    }

    .workspace-visual {
      position: relative;
      overflow: hidden;
      min-height: 168px;
      padding: 22px;
      border-radius: var(--radius);
      background:
        linear-gradient(90deg, rgba(10, 34, 42, 0.72), rgba(15, 118, 110, 0.22)),
        url("https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=1400&q=80") center / cover;
      color: #ffffff;
      box-shadow: var(--shadow);
    }

    .workspace-visual::after {
      content: "";
      position: absolute;
      inset: auto 0 0;
      height: 5px;
      background: linear-gradient(90deg, var(--primary), #2f6feb, #d97706);
    }

    .workspace-visual h1 {
      position: relative;
      max-width: 720px;
      margin: 0;
      font-size: 28px;
      line-height: 1.2;
      letter-spacing: 0;
    }

    .workspace-visual p {
      position: relative;
      max-width: 720px;
      margin: 12px 0 0;
      color: rgba(255, 255, 255, 0.84);
      font-size: 14px;
      line-height: 1.7;
    }

    .quick-row {
      position: relative;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }

    .quick-pill {
      display: inline-flex;
      align-items: center;
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid rgba(255, 255, 255, 0.28);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.13);
      color: #ffffff;
      font-size: 12px;
      font-weight: 800;
    }

    .chat-card {
      overflow: hidden;
    }

    .chat-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 16px 18px;
      border-bottom: 1px solid var(--line);
    }

    .chat-header h2 {
      margin: 0;
      font-size: 17px;
    }

    .chat-header p {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }

    .timeline {
      display: flex;
      flex-direction: column;
      gap: 14px;
      max-height: 430px;
      overflow: auto;
      padding: 18px;
      background: linear-gradient(180deg, #ffffff, #f8fafb);
    }

    .message {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr);
      gap: 10px;
      animation: rise 220ms ease both;
    }

    .avatar {
      display: grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
      color: var(--primary-dark);
      font-size: 12px;
      font-weight: 900;
    }

    .bubble {
      min-width: 0;
      padding: 12px 13px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
    }

    .message.user .avatar {
      color: #ffffff;
      background: var(--accent);
      border-color: var(--accent);
    }

    .message.user .bubble {
      border-color: rgba(47, 111, 235, 0.22);
      background: #f1f6ff;
    }

    .message.system .avatar {
      color: #ffffff;
      background: var(--primary);
      border-color: var(--primary);
    }

    .message.processing .avatar {
      color: #ffffff;
      background: linear-gradient(135deg, #2563eb, #0ea5e9);
      border-color: transparent;
    }

    .message.processing {
      display: none;
    }

    .message.processing.is-visible {
      display: grid;
    }

    .message.processing .bubble {
      background: linear-gradient(180deg, #f8fbff, #eef6ff);
      border-color: rgba(37, 99, 235, 0.18);
      box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.06), 0 10px 20px rgba(37, 99, 235, 0.08);
    }

    .bubble-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 5px;
      color: #223139;
      font-size: 13px;
      font-weight: 800;
    }

    .bubble-time {
      color: var(--muted);
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }

    .processing-copy {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .processing-dots {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .processing-dots span {
      width: 6px;
      height: 6px;
      border-radius: 999px;
      background: #3b82f6;
      opacity: 0.24;
      animation: processingPulse 1.1s ease-in-out infinite;
    }

    .processing-dots span:nth-child(2) {
      animation-delay: 0.16s;
    }

    .processing-dots span:nth-child(3) {
      animation-delay: 0.32s;
    }

    @keyframes processingPulse {
      0%, 100% {
        opacity: 0.24;
        transform: translateY(0);
      }

      50% {
        opacity: 1;
        transform: translateY(-1px);
      }
    }

    .bubble p {
      margin: 0;
      color: #34444c;
      font-size: 13px;
      line-height: 1.6;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .timeline-markdown {
      color: #34444c;
      font-size: 13px;
      line-height: 1.6;
      overflow-wrap: anywhere;
    }

    .timeline-markdown > :last-child {
      margin-bottom: 0;
    }

    .timeline-message-view[hidden] {
      display: none;
    }

    .message-expand-toggle {
      margin-top: 10px;
      min-height: 30px;
      padding: 0;
      color: var(--accent);
      font-size: 12px;
    }

    .message-expand-toggle:hover {
      background: transparent;
      color: #1d4ed8;
    }

    .input-request {
      display: none;
      padding: 16px 18px 18px;
      border-top: 1px solid var(--line);
      background: #fbfcfd;
    }

    .input-request.active {
      display: block;
      animation: rise 220ms ease both;
    }

    .input-request-alert {
      display: flex;
      gap: 10px;
      margin-bottom: 12px;
      padding: 10px 12px;
      border: 1px solid rgba(183, 121, 31, 0.28);
      border-radius: var(--radius);
      background: #fff8e8;
      color: #5f4210;
      font-size: 13px;
      line-height: 1.55;
    }

    .input-request-alert strong {
      display: block;
      color: #4a320a;
    }

    .input-request-meta {
      display: grid;
      gap: 8px;
      margin-bottom: 12px;
      padding: 12px;
      border: 1px solid #dbe5f0;
      border-radius: var(--radius);
      background: #ffffff;
    }

    .input-request-meta[hidden] {
      display: none;
    }

    .input-request-progress {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      font-size: 12px;
      color: #526173;
    }

    .input-request-progress strong {
      color: #0f172a;
      font-size: 14px;
    }

    .input-request-question {
      font-size: 14px;
      color: #1e293b;
      line-height: 1.6;
    }

    .input-request-options {
      display: grid;
      gap: 10px;
    }

    .input-request-option {
      display: grid;
      gap: 6px;
      width: 100%;
      padding: 12px 14px;
      border: 1px solid #dbe5f0;
      border-radius: 14px;
      background: #f8fbff;
      color: #14304d;
      text-align: left;
      cursor: pointer;
      transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
    }

    .input-request-option:hover {
      border-color: #6aa5d7;
      background: #eef6ff;
      transform: translateY(-1px);
    }

    .input-request-option.is-selected {
      border-color: #2563eb;
      background: #e8f0ff;
      box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
    }

    .input-request-option-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      font-size: 13px;
      font-weight: 600;
    }

    .input-request-option-desc {
      font-size: 12px;
      color: #526173;
      line-height: 1.5;
    }

    .input-request-badge {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 999px;
      background: #dbeafe;
      color: #1d4ed8;
      font-size: 11px;
      font-weight: 600;
      white-space: nowrap;
    }

    .input-request-nav {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .composer {
      display: grid;
      gap: 10px;
      padding: 16px 18px;
      border-top: 1px solid var(--line);
      background: #ffffff;
    }

    .composer-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .composer-primary-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      margin-left: auto;
      flex: 0 0 auto;
    }

    .status-item {
      display: grid;
      grid-template-columns: 8px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
      padding: 10px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
    }

    .status-rail {
      width: 8px;
      height: 100%;
      min-height: 36px;
      border-radius: 999px;
      background: #c9d3d8;
    }

    .status-item.running .status-rail {
      background: var(--accent);
    }

    .status-item.done .status-rail {
      background: var(--ok);
    }

    .status-item.need-input .status-rail {
      background: var(--amber);
    }

    .status-title {
      margin: 0;
      min-width: 0;
      flex: 1 1 150px;
      font-size: 13px;
      font-weight: 800;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .status-desc {
      margin: 4px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      overflow-wrap: anywhere;
    }

    .status-content {
      min-width: 0;
    }

    .status-time {
      flex: 0 0 auto;
      margin-left: auto;
      color: #94a3b8;
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }

    .status-time.collapsed {
      visibility: hidden;
    }

    .tabs {
      display: flex;
      gap: 6px;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #f4f7f8;
    }

    .tab {
      flex: 1;
      min-height: 32px;
      border: 0;
      border-radius: var(--radius);
      background: transparent;
      color: var(--muted);
      font-weight: 800;
      font-size: 12px;
    }

    .tab.active {
      background: #ffffff;
      color: var(--text);
      box-shadow: 0 1px 3px rgba(24, 35, 42, 0.08);
    }

    .tab-panel {
      display: none;
      margin-top: 10px;
    }

    .tab-panel.active {
      display: block;
      animation: none;
    }

    #tab-result .grid-2 {
      align-items: end;
    }

    #tab-result .grid-2,
    #tab-status .composer-actions {
      margin-bottom: 14px;
    }

    #tab-result .field {
      margin-bottom: 0;
    }

    #tab-result .field-action {
      display: grid;
      align-content: end;
    }

    #tab-result .field-action .btn {
      min-height: 40px;
    }

    .file-list {
      display: grid;
      gap: 10px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .file-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #ffffff;
      color: #2a3940;
      font-size: 12.5px;
      font-weight: 700;
      box-shadow: none;
    }

    .file-item span {
      min-width: 0;
      overflow-wrap: break-word;
    }

    .project-card-actions,
    .file-item-actions {
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: end;
      gap: 6px;
      min-width: 0;
    }

    .project-card-actions .btn,
    .file-item-actions .btn {
      position: relative;
      z-index: 1;
    }

    .file-item-main {
      min-width: 0;
      display: grid;
      gap: 4px;
      overflow: hidden;
    }

    .file-item-main span {
      font-size: 13px;
      line-height: 1.45;
    }

    #fileList .file-item {
      grid-template-columns: minmax(0, 1fr);
      align-items: start;
    }

    #fileList .file-item span {
      overflow-wrap: anywhere;
    }

    #fileList .file-item-actions {
      justify-content: flex-start;
      flex-wrap: wrap;
      gap: 8px;
    }

    #fileList .file-item-actions .btn {
      min-height: 30px;
      padding: 0 6px;
    }

    .log-box,
    .result-box {
      min-height: 180px;
      height: 240px;
      max-height: none;
      overflow: auto;
      resize: vertical;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #10181c;
      color: #dceeed;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      font-size: 12px;
      line-height: 1.55;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .result-box {
      background: #ffffff;
      color: #263238;
      font-family: inherit;
    }

    .render-box,
    #resultBox,
    #projectStatusBox {
      min-height: 0;
      height: auto;
      overflow: visible;
      resize: none;
      padding: 14px 16px 16px;
      white-space: normal;
      font-family: inherit;
      font-size: 14px;
      line-height: 1.6;
    }

    #projectStatusBox {
      border: 0;
      border-radius: 0;
      background: transparent;
      padding: 0;
    }

    .result-headline {
      margin-bottom: 12px;
    }

    .preview-head {
      margin-bottom: 10px;
    }

    .result-headline h3 {
      margin: 0;
      font-size: 18px;
      line-height: 1.3;
      letter-spacing: -0.01em;
    }

    .result-headline p,
    .preview-head span,
    .file-item-main small {
      margin: 4px 0 0;
      color: #64748b;
      font-size: 12px;
      line-height: 1.5;
    }

    .result-badges,
    .artifact-list {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .kv-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      line-height: 1.45;
    }

    .kv-table th,
    .kv-table td {
      padding: 7px 0;
      text-align: left;
      vertical-align: top;
      border-bottom: 1px solid #e2e8f0;
    }

    .kv-table th {
      width: 120px;
      color: #64748b;
      font-weight: 600;
      font-size: 12px;
      white-space: nowrap;
    }

    .kv-table td {
      color: #0f172a;
      font-weight: 500;
      word-break: break-word;
    }

    .kv-table tr:last-child th,
    .kv-table tr:last-child td {
      border-bottom: none;
    }

    .preview-section,
    .artifact-section {
      margin-top: 14px;
      padding: 14px 16px;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      background: linear-gradient(180deg, #ffffff, #fbfdff);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }

    .preview-editor-shell {
      display: grid;
      gap: 12px;
    }

    .preview-code-editor {
      display: grid;
      gap: 8px;
    }

    .preview-code-editor-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: #64748b;
      font-size: 12px;
      line-height: 1.4;
    }

    .preview-code-editor-status {
      margin-left: auto;
      color: #b45309;
    }

    .preview-code-editor.is-mounted .preview-code-editor-fallback {
      display: none;
    }

    .preview-code-editor-host:empty {
      display: none;
    }

    .preview-editor-textarea {
      width: 100%;
      min-height: 360px;
      padding: 14px 16px;
      border: 1px solid #dbe4ef;
      border-radius: 14px;
      background: #fcfdff;
      color: #1f2937;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      font-size: 13px;
      line-height: 1.7;
      resize: vertical;
      outline: none;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .preview-editor-textarea:focus {
      border-color: rgba(37, 99, 235, 0.42);
      box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.42);
    }

    .preview-editor-hint {
      color: #64748b;
      font-size: 12px;
      line-height: 1.55;
    }

    .compiled-tex-preview {
      display: grid;
      grid-template-rows: var(--compiled-source-height, 180px) auto minmax(420px, 1fr);
      gap: 0;
    }

    .compiled-pdf-preview .compiled-pdf-host {
      min-height: 560px;
    }

    .compiled-preview-split-handle {
      position: relative;
      width: 100%;
      height: 14px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: #e8eef2;
      cursor: ns-resize;
      touch-action: none;
    }

    .compiled-preview-split-handle::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 72px;
      height: 4px;
      border-radius: 999px;
      background: #bac6cf;
      transform: translate(-50%, -50%);
      opacity: 0.82;
    }

    .compiled-preview-split-handle:hover,
    .compiled-tex-preview.is-resizing .compiled-preview-split-handle {
      background: #dde7ed;
    }

    .compiled-tex-preview.is-resizing {
      user-select: none;
    }

    .compiled-source-text {
      height: 100%;
      min-height: 0;
      margin: 0;
      padding: 14px 18px;
      overflow: auto;
      background: #ffffff;
      color: #1f2937;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      font-size: 13px;
      line-height: 1.68;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }

    .markdown-body {
      color: #1f2937;
      font-size: 14px;
      line-height: 1.9;
      overflow-wrap: anywhere;
    }

    .markdown-body h1,
    .markdown-body h2,
    .markdown-body h3,
    .markdown-body h4 {
      margin: 0 0 8px;
      color: #0f172a;
      font-size: 15px;
      line-height: 1.5;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .markdown-body p,
    .markdown-body ul,
    .markdown-body pre {
      margin: 0 0 10px;
    }

    .markdown-body ul {
      padding-left: 18px;
    }

    .markdown-body blockquote {
      margin: 0 0 12px;
      padding: 10px 14px;
      border-left: 3px solid #bfdbfe;
      border-radius: 0 10px 10px 0;
      background: #f8fbff;
      color: #475569;
    }

    .markdown-body .markdown-table-wrap {
      width: 100%;
      margin: 12px 0 14px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .markdown-body table {
      width: max-content;
      min-width: 100%;
      border-collapse: collapse;
      border-spacing: 0;
      font-size: 13px;
      line-height: 1.55;
      background: #ffffff;
    }

    .markdown-body th,
    .markdown-body td {
      padding: 8px 10px;
      border: 1px solid #dbe4ef;
      vertical-align: top;
      text-align: left;
    }

    .markdown-body thead th {
      background: #f5f9ff;
      color: #334155;
      font-weight: 800;
    }

    .markdown-body tbody tr:nth-child(even) {
      background: #fafcff;
    }

    .markdown-body code {
      padding: 1px 5px;
      border-radius: 6px;
      background: #eff6ff;
      color: #1d4ed8;
      font-family: "SFMono-Regular", Consolas, monospace;
      font-size: 12px;
    }

    .markdown-body pre {
      padding: 12px;
      border-radius: 10px;
      border: 1px solid #dbe4ef;
      background: #f8fbff;
      color: #334155;
      overflow: auto;
    }

    .markdown-body .katex-display {
      margin: 1em 0;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 2px 0;
    }

    .markdown-body .katex {
      font-size: 1.02em;
    }

    .artifact-entry {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .artifact-chip {
      display: inline-flex;
      align-items: center;
      min-height: 36px;
      padding: 0 13px;
      border: 1px solid #dbe4ef;
      border-radius: 999px;
      background: #f8fbff;
      color: #1d4ed8;
      font-size: 12.5px;
      font-weight: 700;
      text-decoration: none;
    }

    button.artifact-chip {
      cursor: pointer;
    }

    button.artifact-chip[disabled] {
      opacity: 0.56;
      cursor: not-allowed;
    }

    .artifact-chip.is-success {
      border-color: rgba(21, 128, 61, 0.18);
      background: #f0fdf4;
      color: #166534;
    }

    .artifact-chip.is-accent {
      border-color: rgba(29, 78, 216, 0.18);
      background: #eff6ff;
      color: #1d4ed8;
    }

    .artifact-chip.is-muted {
      color: #475569;
    }

    .template-upload {
      display: none;
    }

    .template-upload.active {
      display: block;
    }

    .upload-drop-card {
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid #dbe4ef;
      border-radius: 12px;
      background: #f8fbff;
    }

    .source-key-field.is-hidden {
      display: none;
    }

    .notice {
      display: none;
      position: fixed;
      right: 18px;
      top: 88px;
      bottom: auto;
      z-index: 180;
      width: min(620px, calc(100vw - 36px));
      max-height: min(50vh, 420px);
      overflow: auto;
      padding: 14px 16px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #ffffff;
      box-shadow: var(--shadow);
      color: #263238;
      font-size: 13px;
      line-height: 1.5;
      white-space: pre-wrap;
    }

    .notice.active {
      display: block;
      animation: rise 180ms ease both;
    }

    .notice.error {
      border-color: rgba(190, 18, 60, 0.28);
      color: #75142a;
    }

    .notice.success {
      border-color: rgba(21, 128, 61, 0.28);
      color: #14532d;
    }

    .empty {
      padding: 18px;
      border: 1px dashed var(--line);
      border-radius: var(--radius);
      color: var(--muted);
      font-size: 13px;
      line-height: 1.55;
      text-align: center;
      background: #fbfcfd;
    }

    .kbd {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 0 7px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #ffffff;
      color: #38474f;
      font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
      font-size: 11px;
    }

    @keyframes rise {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @media (max-width: 1180px) {
      .layout {
        grid-template-columns: 230px minmax(0, 1fr);
      }

      .config-panel {
        position: static;
        grid-column: 1 / -1;
        max-height: none;
      }
    }

    @media (max-width: 820px) {
      

      

      

      .layout {
        width: min(100vw - 20px, 720px);
        grid-template-columns: 1fr;
        padding-top: 10px;
      }

      .sidebar,
      .config-panel {
        position: static;
        max-height: none;
      }

      .workspace-visual {
        min-height: 190px;
        padding: 18px;
      }

      .workspace-visual h1 {
        font-size: 24px;
      }

      .grid-2,
      .check-grid,
      .metric-grid {
        grid-template-columns: 1fr;
      }

      .chat-header,
      .composer-actions,
      .upload-line {
        align-items: stretch;
        flex-direction: column;
      }

      .btn {
        width: 100%;
      }
    }

    /* Tech console redesign */
    :root {
      --bg: #eef4f4;
      --panel: rgba(255, 255, 255, 0.88);
      --panel-soft: #edf7f6;
      --text: #10191b;
      --muted: #66757a;
      --line: rgba(108, 132, 137, 0.22);
      --primary: #0b7f78;
      --primary-dark: #075e59;
      --accent: #2364d8;
      --cyan: #10a7b5;
      --amber: #c47a19;
      --rose: #c3264d;
      --ok: #198754;
      --shadow: 0 22px 56px rgba(18, 33, 36, 0.14);
      --shadow-soft: 0 10px 28px rgba(19, 37, 39, 0.08);
      --radius: 8px;
    }

    body {
      background:
        linear-gradient(115deg, rgba(238, 244, 244, 0.95), rgba(248, 251, 250, 0.88) 44%, rgba(232, 242, 240, 0.96)),
        linear-gradient(rgba(13, 111, 106, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(35, 100, 216, 0.06) 1px, transparent 1px),
        url("https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1800&q=82") center / cover fixed;
      background-size: auto, 34px 34px, 34px 34px, cover;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(238, 244, 244, 0.92)),
        repeating-linear-gradient(90deg, transparent 0 118px, rgba(16, 167, 181, 0.07) 118px 119px);
    }

    .app-shell {
      background: rgba(239, 246, 245, 0.76);
      backdrop-filter: blur(18px) saturate(1.08);
    }

    .layout {
      grid-template-columns: 230px minmax(440px, 1fr) 390px;
      gap: 20px;
      width: min(1540px, calc(100vw - 36px));
      padding: 22px 0 34px;
    }

    .panel {
      position: relative;
      overflow: hidden;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 252, 251, 0.86)),
        rgba(255, 255, 255, 0.82);
      border: 1px solid rgba(255, 255, 255, 0.78);
      box-shadow: var(--shadow);
      backdrop-filter: blur(20px) saturate(1.12);
    }

    .panel::before {
      content: "";
      position: absolute;
      inset: 0 0 auto;
      height: 3px;
      background: linear-gradient(90deg, var(--primary), var(--cyan), var(--amber));
      opacity: 0.78;
    }

    .sidebar,
    .config-panel {
      top: 100px;
    }

    .panel-section {
      position: relative;
      padding: 20px;
      border-bottom: 1px solid rgba(108, 132, 137, 0.18);
    }

    .section-heading {
      margin-bottom: 16px;
    }

    .section-heading h2,
    .section-heading h3 {
      color: #10191b;
      font-size: 15px;
      font-weight: 850;
    }

    .section-heading p {
      color: #6a787d;
    }

    .btn {
      min-height: 40px;
      padding: 0 15px;
      border-radius: 7px;
      background: linear-gradient(135deg, #0b7f78, #0f9f9a);
      box-shadow: 0 10px 24px rgba(11, 127, 120, 0.22);
      font-weight: 800;
    }

    .btn:hover {
      background: linear-gradient(135deg, #075e59, #0b7f78);
      box-shadow: 0 14px 30px rgba(11, 127, 120, 0.28);
    }

    .btn.secondary {
      background: rgba(255, 255, 255, 0.82);
      color: #142326;
      border-color: rgba(105, 128, 133, 0.28);
      box-shadow: var(--shadow-soft);
    }

    .btn.secondary:hover {
      background: #ffffff;
      border-color: rgba(16, 167, 181, 0.42);
    }

    .btn.ghost {
      color: #08706b;
      background: transparent;
      box-shadow: none;
    }

    .btn.ghost:hover {
      background: rgba(11, 127, 120, 0.09);
    }

    .field {
      gap: 8px;
    }

    .field label,
    .field-title {
      color: #18292d;
      font-weight: 800;
    }

    .hint {
      color: #66777c;
    }

    .input,
    .textarea,
    .select {
      border-color: rgba(92, 118, 122, 0.26);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 249, 0.94));
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }

    .textarea {
      min-height: 118px;
    }

    .input:focus,
    .textarea:focus,
    .select:focus {
      border-color: rgba(16, 167, 181, 0.8);
      box-shadow: 0 0 0 4px rgba(16, 167, 181, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .switch-row,
    .project-card,
    .metric,
    .status-item,
    .file-item,
    .empty {
      border-color: rgba(108, 132, 137, 0.22);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 251, 250, 0.78));
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .project-card {
      transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
    }

    .project-card:hover {
      transform: translateY(-1px);
      border-color: rgba(16, 167, 181, 0.42);
      box-shadow: 0 12px 26px rgba(19, 37, 39, 0.1);
    }

    .project-card.active {
      border-color: rgba(11, 127, 120, 0.5);
      background: linear-gradient(180deg, rgba(232, 251, 248, 0.96), rgba(247, 252, 250, 0.9));
    }

    .metric {
      position: relative;
      padding: 14px;
    }

    .metric::after {
      content: "";
      position: absolute;
      right: 12px;
      top: 12px;
      width: 22px;
      height: 4px;
      border-radius: 999px;
      background: linear-gradient(90deg, var(--cyan), var(--amber));
      opacity: 0.82;
    }

    .metric strong {
      color: #0a4542;
      font-size: 25px;
      font-weight: 900;
    }

    .check-chip {
      border-color: rgba(108, 132, 137, 0.24);
      background: rgba(255, 255, 255, 0.76);
      transition: border-color 140ms ease, background 140ms ease;
    }

    .check-chip:has(input:checked) {
      border-color: rgba(11, 127, 120, 0.46);
      background: #eefbf8;
    }

    .slider {
      background: #becbce;
    }

    .switch input:checked + .slider {
      background: linear-gradient(90deg, var(--primary), var(--cyan));
    }

    .workspace-visual {
      min-height: 220px;
      padding: 26px 28px;
      border: 1px solid rgba(255, 255, 255, 0.24);
      background:
        linear-gradient(105deg, rgba(7, 18, 18, 0.88), rgba(7, 55, 52, 0.76) 52%, rgba(16, 37, 31, 0.42)),
        linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1500&q=82") center / cover;
      background-size: auto, 28px 28px, 28px 28px, cover;
      box-shadow: 0 22px 54px rgba(8, 25, 25, 0.22);
    }

    .workspace-visual::before {
      content: "RESEARCH WORKFLOW";
      position: absolute;
      right: 22px;
      top: 18px;
      padding: 6px 9px;
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 6px;
      background: rgba(255, 255, 255, 0.08);
      color: rgba(235, 255, 253, 0.7);
      font-size: 11px;
      font-weight: 850;
      letter-spacing: 0;
    }

    .workspace-visual::after {
      height: 4px;
      background: linear-gradient(90deg, var(--primary), var(--cyan), var(--accent), var(--amber));
    }

    .workspace-visual h1 {
      max-width: 780px;
      padding-top: 28px;
      font-size: 31px;
      font-weight: 900;
      text-wrap: balance;
      text-shadow: 0 3px 22px rgba(0, 0, 0, 0.3);
    }

    .workspace-visual p {
      max-width: 780px;
      color: rgba(239, 252, 250, 0.83);
    }

    .quick-pill {
      min-height: 32px;
      border-color: rgba(142, 236, 224, 0.28);
      background: rgba(7, 18, 18, 0.34);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .chat-card {
      border-color: rgba(255, 255, 255, 0.8);
    }

    .chat-header {
      padding: 18px 20px;
      background: linear-gradient(90deg, rgba(247, 252, 251, 0.96), rgba(236, 247, 246, 0.72));
      border-bottom-color: rgba(108, 132, 137, 0.18);
    }

    .chat-header h2 {
      font-size: 18px;
      font-weight: 900;
    }

    .timeline {
      max-height: 500px;
      min-height: 380px;
      padding: 22px;
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(246, 250, 249, 0.92)),
        linear-gradient(rgba(11, 127, 120, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(35, 100, 216, 0.05) 1px, transparent 1px);
      background-size: auto, 32px 32px, 32px 32px;
    }

    .message {
      grid-template-columns: 38px minmax(0, 1fr);
      gap: 12px;
    }

    .avatar {
      width: 38px;
      height: 38px;
      border-color: rgba(11, 127, 120, 0.28);
      background: #f5fbfa;
      color: #075e59;
      box-shadow: 0 8px 18px rgba(19, 37, 39, 0.08);
    }

    .message.system .avatar {
      background: linear-gradient(135deg, #0b7f78, #10a7b5);
      border-color: transparent;
    }

    .message.user .avatar {
      background: linear-gradient(135deg, #2364d8, #10a7b5);
      border-color: transparent;
    }

    .bubble {
      padding: 13px 14px;
      border-color: rgba(108, 132, 137, 0.2);
      background: rgba(255, 255, 255, 0.86);
      box-shadow: 0 12px 28px rgba(18, 33, 36, 0.08);
    }

    .message.user .bubble {
      border-color: rgba(35, 100, 216, 0.22);
      background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(247, 251, 252, 0.9));
    }

    .bubble-title {
      color: #152529;
      font-weight: 900;
    }

    .bubble p {
      color: #34474d;
    }

    .input-request {
      background:
        linear-gradient(180deg, rgba(255, 249, 236, 0.8), rgba(255, 255, 255, 0.9));
      border-top-color: rgba(196, 122, 25, 0.18);
    }

    .input-request-alert {
      border-color: rgba(196, 122, 25, 0.34);
      background: linear-gradient(90deg, rgba(255, 248, 232, 0.96), rgba(255, 255, 255, 0.88));
    }

    .composer {
      padding: 18px 20px 20px;
      background: rgba(255, 255, 255, 0.9);
    }

    .status-item {
      grid-template-columns: 6px minmax(0, 1fr);
      padding: 11px;
    }

    .status-rail {
      width: 6px;
    }

    .tabs {
      padding: 5px;
      border-color: rgba(108, 132, 137, 0.18);
      background: rgba(234, 243, 242, 0.78);
    }

    .tab {
      border-radius: 7px;
      color: #607177;
    }

    .tab.active {
      color: #0f2428;
      box-shadow: 0 8px 20px rgba(19, 37, 39, 0.09);
    }

    .log-box,
    .result-box {
      border-color: rgba(108, 132, 137, 0.22);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .log-box {
      background:
        linear-gradient(180deg, rgba(8, 19, 19, 0.98), rgba(16, 28, 26, 0.98)),
        linear-gradient(rgba(16, 167, 181, 0.14) 1px, transparent 1px);
      color: #d8fffb;
    }

    .result-box {
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 250, 0.9));
      color: #25373c;
    }

    .notice {
      border-color: rgba(108, 132, 137, 0.24);
      background: rgba(255, 255, 255, 0.94);
      box-shadow: 0 20px 52px rgba(18, 33, 36, 0.18);
      backdrop-filter: blur(18px);
    }

    .kbd {
      border-color: rgba(108, 132, 137, 0.24);
      background: rgba(255, 255, 255, 0.82);
    }

    @media (max-width: 1180px) {
      .layout {
        grid-template-columns: 290px minmax(0, 1fr);
      }
    }

    @media (max-width: 820px) {
      

      .layout {
        width: min(100vw - 20px, 760px);
        padding-top: 12px;
      }

      .workspace-visual {
        min-height: 238px;
        padding: 20px;
      }

      .workspace-visual::before {
        position: relative;
        display: inline-flex;
        right: auto;
        top: auto;
        margin-bottom: 14px;
      }

      .workspace-visual h1 {
        padding-top: 0;
        font-size: 24px;
      }
    }

    /* Discovery / shadcn inspired final pass */
    :root {
      --background: #f8fafc;
      --foreground: #0f1720;
      --card: #ffffff;
      --card-muted: #f3f7f8;
      --border: #dfe7ea;
      --ring: rgba(16, 147, 141, 0.2);
      --primary: #087a75;
      --primary-dark: #065f5b;
      --accent: #246bfe;
      --cyan: #0ea5b7;
      --amber: #d48a19;
      --rose: #e11d48;
      --ok: #16a34a;
      --text: var(--foreground);
      --muted: #667784;
      --line: var(--border);
      --shadow: 0 18px 42px rgba(16, 24, 32, 0.08);
      --shadow-soft: 0 8px 22px rgba(16, 24, 32, 0.06);
      --radius: 8px;
    }

    html {
      background: var(--background);
    }

    body {
      background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.97), rgba(244, 248, 249, 0.98)),
        linear-gradient(90deg, rgba(36, 107, 254, 0.045) 1px, transparent 1px),
        linear-gradient(rgba(8, 122, 117, 0.045) 1px, transparent 1px);
      background-size: auto, 40px 40px, 40px 40px;
      color: var(--foreground);
    }

    body::before {
      display: none;
    }

    .app-shell {
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(248, 250, 252, 0.94)),
        linear-gradient(110deg, rgba(14, 165, 183, 0.08), transparent 38%, rgba(212, 138, 25, 0.05));
      backdrop-filter: none;
    }

    .layout {
      grid-template-columns: 306px minmax(520px, 1fr) 390px;
      gap: 22px;
      width: min(1540px, calc(100vw - 44px));
      padding: 24px 0 38px;
    }

    .panel {
      border: 1px solid rgba(223, 231, 234, 0.92);
      background: rgba(255, 255, 255, 0.92);
      box-shadow: var(--shadow);
      backdrop-filter: blur(14px);
    }

    .panel::before {
      height: 0;
    }

    .sidebar,
    .config-panel {
      top: 98px;
    }

    .panel-section {
      padding: 20px;
      border-bottom-color: rgba(223, 231, 234, 0.78);
    }

    .section-heading h2,
    .section-heading h3 {
      color: #111827;
      font-weight: 850;
    }

    .section-heading p,
    .hint,
    .project-meta,
    .metric span,
    .status-desc,
    .bubble-time {
      color: #667784;
    }

    .btn {
      min-height: 38px;
      padding: 0 15px;
      border: 1px solid transparent;
      background: #111827;
      color: #ffffff;
      box-shadow: 0 10px 20px rgba(17, 24, 39, 0.14);
    }

    .btn:hover {
      background: #0b1220;
      box-shadow: 0 12px 26px rgba(17, 24, 39, 0.18);
    }

    .btn.secondary {
      background: #ffffff;
      color: #111827;
      border-color: rgba(223, 231, 234, 0.95);
      box-shadow: var(--shadow-soft);
    }

    .btn.secondary:hover {
      background: #f8fafc;
      border-color: rgba(8, 122, 117, 0.34);
    }

    .btn.ghost {
      color: var(--primary);
      background: transparent;
      box-shadow: none;
    }

    .btn.ghost:hover {
      color: var(--primary-dark);
      background: rgba(8, 122, 117, 0.08);
    }

    .input,
    .textarea,
    .select {
      min-height: 40px;
      border-color: rgba(203, 213, 219, 0.9);
      background: #ffffff;
      box-shadow: 0 1px 2px rgba(16, 24, 32, 0.03);
    }

    .input:hover,
    .textarea:hover,
    .select:hover {
      border-color: rgba(148, 163, 174, 0.9);
    }

    .input:focus,
    .textarea:focus,
    .select:focus {
      border-color: rgba(8, 122, 117, 0.7);
      box-shadow: 0 0 0 4px var(--ring);
    }

    .workspace-visual {
      display: grid;
      align-content: end;
      min-height: 286px;
      padding: 30px;
      border: 1px solid rgba(17, 24, 39, 0.08);
      background:
        linear-gradient(105deg, rgba(6, 18, 22, 0.82), rgba(10, 59, 57, 0.7) 54%, rgba(255, 255, 255, 0.08)),
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        url("https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1600&q=84") center / cover;
      background-size: auto, 36px 36px, 36px 36px, cover;
      box-shadow: 0 24px 58px rgba(8, 20, 24, 0.18);
    }

    .workspace-visual::before {
      display: none;
    }

    .workspace-visual::after {
      height: 1px;
      inset: 0 30px auto;
      background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(83, 238, 226, 0.72), rgba(255, 255, 255, 0.02));
    }

    .eyebrow {
      position: relative;
      display: inline-flex;
      align-items: center;
      width: fit-content;
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      color: rgba(236, 253, 250, 0.86);
      font-size: 12px;
      font-weight: 800;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .workspace-visual h1 {
      max-width: 760px;
      padding-top: 18px;
      font-size: 32px;
      line-height: 1.22;
      font-weight: 900;
      text-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    }

    .workspace-visual p {
      max-width: 790px;
      color: rgba(238, 252, 250, 0.82);
    }

    .quick-row {
      gap: 8px;
    }

    .quick-pill {
      border-color: rgba(255, 255, 255, 0.18);
      background: rgba(255, 255, 255, 0.12);
      color: #f6fffe;
      backdrop-filter: blur(10px);
    }

    .chat-header,
    .composer {
      background: #ffffff;
    }

    .chat-header {
      padding: 18px 20px;
    }

    .chat-header h2 {
      color: #111827;
      font-size: 18px;
      font-weight: 850;
    }

    .timeline {
      min-height: 410px;
      max-height: 520px;
      padding: 22px;
      background:
        linear-gradient(180deg, #fbfdff, #f7fafb),
        linear-gradient(rgba(8, 122, 117, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 107, 254, 0.035) 1px, transparent 1px);
      background-size: auto, 34px 34px, 34px 34px;
    }

    .avatar {
      border-color: rgba(203, 213, 219, 0.9);
      background: #ffffff;
      color: var(--primary);
      box-shadow: var(--shadow-soft);
    }

    .message.system .avatar {
      background: #111827;
      color: #ffffff;
    }

    .message.user .avatar {
      background: var(--accent);
      color: #ffffff;
    }

    .bubble {
      border-color: rgba(223, 231, 234, 0.92);
      background: #ffffff;
      box-shadow: 0 8px 20px rgba(16, 24, 32, 0.05);
    }

    .message.user .bubble {
      border-color: rgba(36, 107, 254, 0.2);
      background: #f6f9ff;
    }

    .input-request {
      background: #fffdf8;
      border-top-color: rgba(212, 138, 25, 0.2);
    }

    .input-request-alert {
      border-color: rgba(212, 138, 25, 0.24);
      background: #fff7e8;
    }

    .switch-row,
    .project-card,
    .metric,
    .status-item,
    .file-item,
    .empty,
    .check-chip {
      border-color: rgba(223, 231, 234, 0.92);
      background: #ffffff;
      box-shadow: none;
    }

    .metric {
      padding: 15px;
    }

    .metric::after {
      width: 26px;
      height: 3px;
      background: linear-gradient(90deg, var(--primary), var(--accent));
    }

    .metric strong {
      color: #111827;
    }

    .project-card:hover,
    .project-card.active {
      border-color: rgba(8, 122, 117, 0.36);
      box-shadow: 0 12px 28px rgba(16, 24, 32, 0.08);
    }

    .project-card.active {
      background: #f0fdfa;
    }

    .status-item {
      transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    }

    .status-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 20px rgba(16, 24, 32, 0.06);
    }

    .tabs {
      border-color: rgba(223, 231, 234, 0.92);
      background: #f3f6f7;
    }

    .tab.active {
      background: #ffffff;
      color: #111827;
      box-shadow: 0 6px 16px rgba(16, 24, 32, 0.07);
    }

    .result-box {
      background: #ffffff;
      border-color: rgba(223, 231, 234, 0.92);
    }

    .log-box {
      border-color: rgba(17, 24, 39, 0.2);
      background:
        linear-gradient(180deg, rgba(8, 13, 18, 0.98), rgba(13, 24, 25, 0.98)),
        linear-gradient(rgba(14, 165, 183, 0.12) 1px, transparent 1px);
      background-size: auto, 26px 26px;
    }

    .notice {
      border-color: rgba(223, 231, 234, 0.92);
      background: rgba(255, 255, 255, 0.96);
    }

    @media (max-width: 1280px) {
      

      .layout {
        grid-template-columns: 296px minmax(0, 1fr);
      }
    }

    @media (max-width: 820px) {
      

      

      .layout {
        width: min(100vw - 20px, 760px);
      }

      .workspace-visual {
        min-height: 270px;
        padding: 22px;
      }

      .workspace-visual h1 {
        font-size: 25px;
      }
    }

    /* Video reference adaptation: dark discovery hero + minimal workspace */
    :root {
      --space: #06183d;
      --space-deep: #03112f;
      --space-line: rgba(176, 216, 255, 0.16);
      --paper: #ffffff;
      --paper-soft: #f6f9fc;
      --paper-blue: #eef5ff;
      --ink: #132033;
      --ink-soft: #657286;
      --stroke: #e5ebf2;
      --brand: #1fd7d0;
      --brand-dark: #0c7c86;
      --primary: #2563eb;
      --primary-dark: #1d4ed8;
      --accent: #1fd7d0;
      --amber: #e99a20;
      --rose: #e11d48;
      --ok: #16a34a;
      --text: var(--ink);
      --muted: var(--ink-soft);
      --line: var(--stroke);
      --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
      --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    }

    body {
      background:
        linear-gradient(180deg, var(--space-deep) 0 610px, #f7fbff 610px 100%),
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(31, 215, 208, 0.04) 1px, transparent 1px);
      background-size: auto, 44px 44px, 44px 44px;
      color: var(--ink);
    }

    .app-shell {
      background:
        linear-gradient(180deg, rgba(3, 17, 47, 0.18), rgba(247, 251, 255, 0) 590px),
        linear-gradient(120deg, rgba(31, 215, 208, 0.08), transparent 34%, rgba(255, 255, 255, 0.04));
    }

    .layout {
      grid-template-columns: 306px minmax(0, 1fr) 390px;
      grid-auto-rows: auto;
      align-items: start;
      gap: 22px;
      width: min(1540px, 100%);
      padding: 0 24px 44px;
    }

    .main {
      display: contents;
    }

    .workspace-visual {
      grid-column: 1 / -1;
      display: grid;
      align-content: center;
      min-height: 530px;
      margin: 0 -24px 0;
      padding: 72px 24px 70px;
      border: 0;
      border-radius: 0;
      text-align: center;
      background:
        linear-gradient(180deg, rgba(3, 17, 47, 0.22), rgba(3, 17, 47, 0.92)),
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(115deg, transparent 0 4%, rgba(31, 215, 208, 0.52) 13%, rgba(53, 232, 184, 0.38) 22%, transparent 36%),
        linear-gradient(180deg, #08245a, #06183d 55%, #03112f);
      background-size: auto, 60px 60px, 60px 60px, auto, auto;
      box-shadow: none;
      isolation: isolate;
    }

    .workspace-visual::before {
      content: "";
      position: absolute;
      left: -120px;
      bottom: 24px;
      z-index: 0;
      display: block;
      width: min(780px, 58vw);
      height: 210px;
      border-radius: 44% 56% 0 0;
      background:
        linear-gradient(105deg, transparent 6%, rgba(17, 241, 220, 0.74), rgba(103, 255, 204, 0.34), transparent 76%);
      filter: blur(10px);
      opacity: 0.92;
      transform: skewY(-11deg) rotate(-5deg);
    }

    .workspace-visual::after {
      content: "";
      position: absolute;
      inset: auto 0 0;
      z-index: 1;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(31, 215, 208, 0.8), rgba(255, 255, 255, 0.32), transparent);
      pointer-events: none;
    }

    .workspace-visual > * {
      position: relative;
      z-index: 2;
    }

    .eyebrow {
      justify-self: center;
      min-height: 28px;
      margin-bottom: 18px;
      padding: 0 12px;
      border-color: rgba(255, 255, 255, 0.18);
      background: rgba(255, 255, 255, 0.1);
      color: rgba(232, 246, 255, 0.82);
      font-size: 12px;
      font-weight: 800;
    }

    .workspace-visual h1 {
      max-width: 840px;
      margin: 0 auto;
      padding: 0;
      color: #ffffff;
      font-size: 40px;
      line-height: 1.18;
      font-weight: 900;
      text-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    }

    .workspace-visual p {
      max-width: 840px;
      margin: 18px auto 0;
      color: rgba(229, 241, 255, 0.82);
      font-size: 15px;
      line-height: 1.75;
    }

    .hero-composer {
      position: relative;
      z-index: 2;
      width: min(760px, calc(100vw - 40px));
      margin: 30px auto 0;
      padding: 14px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 24px 70px rgba(3, 17, 47, 0.28);
      text-align: left;
    }

    .hero-composer .field {
      margin-bottom: 10px;
    }

    .hero-composer .field label {
      color: #25324a;
    }

    .hero-composer .textarea {
      min-height: 86px;
      border-color: transparent;
      background: #f8fbff;
      box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.88);
    }

    .hero-composer .textarea:focus {
      border-color: transparent;
      box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.42), 0 0 0 4px rgba(31, 215, 208, 0.14);
    }

    .hero-composer .hint {
      color: #6b7280;
    }

    .quick-row {
      position: relative;
      z-index: 2;
      justify-content: center;
      margin-top: 18px;
    }

    .quick-pill {
      min-height: 28px;
      border-color: rgba(255, 255, 255, 0.2);
      background: rgba(255, 255, 255, 0.1);
      color: rgba(240, 253, 255, 0.9);
    }

    .sidebar,
    .chat-card,
    #resultsPanel,
    .config-panel {
      margin-top: -44px;
    }

    .sidebar {
      grid-column: 1;
      grid-row: 2 / span 2;
    }

    .config-panel {
      grid-column: 3;
      grid-row: 2 / span 2;
    }

    .panel {
      border-color: rgba(226, 232, 240, 0.96);
      background: rgba(255, 255, 255, 0.96);
      box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
      backdrop-filter: blur(12px);
    }

    .sidebar,
    .config-panel {
      top: 82px;
      max-height: calc(100vh - 104px);
    }

    .panel-section {
      border-bottom-color: rgba(226, 232, 240, 0.82);
    }

    .section-heading h2,
    .section-heading h3,
    .chat-header h2 {
      color: #14213d;
      font-weight: 850;
    }

    .section-heading p,
    .hint,
    .project-meta,
    .metric span,
    .status-desc,
    .bubble-time {
      color: #657286;
    }

    .btn {
      min-height: 38px;
      background: #2563eb;
      color: #ffffff;
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    }

    .btn:hover {
      background: #1d4ed8;
      box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
    }

    .btn.secondary {
      background: #ffffff;
      color: #14213d;
      border-color: #dfe7f1;
      box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
    }

    .btn.secondary:hover {
      background: #f8fbff;
      border-color: rgba(37, 99, 235, 0.28);
    }

    .btn.ghost {
      color: #2563eb;
    }

    .btn.ghost:hover {
      background: #eef5ff;
      color: #1d4ed8;
    }

    .input,
    .textarea,
    .select {
      border-color: #dfe7f1;
      background: #ffffff;
      color: #14213d;
    }

    .input:focus,
    .textarea:focus,
    .select:focus {
      border-color: rgba(37, 99, 235, 0.64);
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    .project-card,
    .metric,
    .status-item,
    .file-item,
    .switch-row,
    .check-chip,
    .empty {
      border-color: #e5ebf2;
      background: #ffffff;
    }

    .project-card.active,
    .project-card:hover {
      border-color: rgba(37, 99, 235, 0.28);
      background: #f6f9ff;
    }

    .metric {
      background: linear-gradient(180deg, #ffffff, #f7fbff);
    }

    .metric::after {
      background: linear-gradient(90deg, #2563eb, #1fd7d0);
    }

    .metric strong {
      color: #14213d;
    }

    .chat-header,
    .composer {
      background: #ffffff;
    }

    .chat-card .chat-header {
      border-bottom-color: #e5ebf2;
    }

    .timeline {
      min-height: 420px;
      background:
        linear-gradient(180deg, #ffffff, #f7fbff),
        linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 215, 208, 0.032) 1px, transparent 1px);
      background-size: auto, 36px 36px, 36px 36px;
    }

    .avatar {
      border-color: #dfe7f1;
      color: #2563eb;
    }

    .message.system .avatar {
      background: #14213d;
      color: #ffffff;
    }

    .message.user .avatar {
      background: #2563eb;
    }

    .bubble {
      border-color: #e5ebf2;
      box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    }

    .message.user .bubble {
      background: #f4f8ff;
      border-color: rgba(37, 99, 235, 0.16);
    }

    .tabs {
      border-color: #e5ebf2;
      background: #f3f7fb;
    }

    .tab.active {
      color: #14213d;
    }

    .log-box {
      background:
        linear-gradient(180deg, #08111f, #0a1a2d),
        linear-gradient(rgba(31, 215, 208, 0.12) 1px, transparent 1px);
      background-size: auto, 28px 28px;
      color: #dffcff;
    }

    .result-box {
      background: #ffffff;
    }

    .switch input:checked + .slider {
      background: linear-gradient(90deg, #2563eb, #1fd7d0);
    }

    .check-chip:has(input:checked) {
      border-color: rgba(37, 99, 235, 0.34);
      background: #f4f8ff;
    }

    @media (max-width: 1280px) {
      body {
        background:
          linear-gradient(180deg, var(--space-deep) 0 600px, #f7fbff 600px 100%);
      }

      .layout {
        grid-template-columns: 296px minmax(0, 1fr);
        padding-inline: 18px;
      }

      .workspace-visual {
        margin-inline: -18px;
      }

      .config-panel {
        grid-column: 1 / -1;
        grid-row: 4;
        margin-top: 0;
        max-height: none;
      }
    }

    @media (max-width: 860px) {
      body {
        background:
          linear-gradient(180deg, var(--space-deep) 0 650px, #f7fbff 650px 100%);
      }

      

      

      .layout {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 0 12px 28px;
      }

      .main {
        display: contents;
      }

      .workspace-visual {
        grid-column: 1;
        min-height: 560px;
        margin-inline: -12px;
        padding: 46px 16px 56px;
      }

      .workspace-visual h1 {
        font-size: 28px;
      }

      .workspace-visual p {
        font-size: 14px;
      }

      .hero-composer {
        width: min(100%, calc(100vw - 24px));
      }

      .sidebar,
      .chat-card,
      #resultsPanel,
      .config-panel {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
        max-height: none;
      }
    }

    /* Alignment repair: stable product workspace */
    :root {
      --page-bg: #f5f7fb;
      --shell-bg: #ffffff;
      --card-bg: #ffffff;
      --ink: #111827;
      --ink-muted: #667085;
      --border: #e4e9f1;
      --blue: #2563eb;
      --blue-dark: #1d4ed8;
      --teal: #14b8a6;
      --navy: #06183d;
      --navy-2: #0b2559;
      --amber: #d97706;
      --rose: #e11d48;
      --ok: #16a34a;
      --radius: 8px;
      --shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
      --shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.05);
      --text: var(--ink);
      --muted: var(--ink-muted);
      --line: var(--border);
      --primary: var(--blue);
      --primary-dark: var(--blue-dark);
      --accent: var(--teal);
    }

    html,
    body {
      width: 100%;
      min-width: 0;
      overflow-x: hidden;
      background: var(--page-bg);
      color: var(--ink);
    }

    body {
      background:
        linear-gradient(180deg, #eef4ff 0, #f8fbff 420px, var(--page-bg) 421px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px),
        linear-gradient(rgba(20, 184, 166, 0.03) 1px, transparent 1px);
      background-size: auto, 40px 40px, 40px 40px;
    }

    .app-shell {
      min-height: 100vh;
      background: transparent;
      backdrop-filter: none;
    }

    .layout {
      display: grid;
      grid-template-columns: 230px minmax(0, 1fr) 380px;
      gap: 20px;
      width: min(1480px, calc(100vw - 40px));
      margin: 0 auto;
      padding: 22px 0 34px;
      align-items: start;
    }

    .main {
      display: contents;
    }

    .workspace-visual {
      grid-column: 1 / -1;
      position: relative;
      display: grid;
      justify-items: center;
      align-content: center;
      min-height: 420px;
      margin: 0;
      padding: 42px 28px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: var(--radius);
      overflow: hidden;
      text-align: center;
      background:
        radial-gradient(circle at 12% 82%, rgba(31, 215, 208, 0.52), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(37, 99, 235, 0.4), transparent 22%),
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(135deg, rgba(3, 17, 47, 0.96), rgba(8, 36, 90, 0.92) 48%, rgba(3, 17, 47, 0.98));
      background-size: auto, auto, 60px 60px, 60px 60px, auto;
      box-shadow: 0 18px 38px rgba(6, 24, 61, 0.15);
      isolation: isolate;
    }

    .workspace-visual::before {
      content: "";
      position: absolute;
      left: -120px;
      bottom: 32px;
      z-index: 0;
      width: min(760px, 60vw);
      height: 220px;
      border-radius: 48% 52% 0 0;
      background: linear-gradient(105deg, transparent 4%, rgba(31, 215, 208, 0.74), rgba(103, 255, 204, 0.38), transparent 76%);
      filter: blur(12px);
      opacity: 0.94;
      transform: skewY(-10deg) rotate(-4deg);
      pointer-events: none;
    }

    .workspace-visual::after {
      content: "";
      position: absolute;
      inset: auto 28px 0;
      z-index: 1;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(31, 215, 208, 0.65), transparent);
      pointer-events: none;
    }

    .workspace-visual > * {
      position: relative;
      z-index: 2;
    }

    .eyebrow {
      justify-self: center;
      margin: 0 0 14px;
      min-height: 28px;
      padding: 0 12px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.1);
      color: rgba(240, 249, 255, 0.86);
      font-size: 12px;
      font-weight: 800;
    }

    .workspace-visual h1 {
      width: min(860px, 100%);
      margin: 0 auto;
      padding: 0;
      color: #ffffff;
      font-size: 34px;
      line-height: 1.2;
      font-weight: 900;
      text-align: center;
      text-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    }

    .workspace-visual p {
      width: min(820px, 100%);
      margin: 14px auto 0;
      color: rgba(226, 242, 255, 0.8);
      font-size: 14px;
      line-height: 1.72;
      text-align: center;
    }

    .hero-composer {
      width: min(760px, 100%);
      margin: 24px auto 0;
      padding: 14px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.97);
      box-shadow: 0 20px 48px rgba(2, 12, 32, 0.22);
      text-align: left;
    }

    .hero-composer .field {
      margin-bottom: 10px;
    }

    .hero-composer .textarea {
      min-height: 84px;
      background: #f8fbff;
      border-color: #e4e9f1;
      box-shadow: none;
    }

    .hero-composer .hint {
      color: #667085;
    }

    .quick-row {
      justify-content: center;
      margin-top: 16px;
    }

    .quick-pill {
      min-height: 28px;
      border: 1px solid rgba(255, 255, 255, 0.18);
      background: rgba(255, 255, 255, 0.1);
      color: rgba(240, 249, 255, 0.9);
      box-shadow: none;
    }

    .sidebar,
    .chat-card,
    #resultsPanel,
    .config-panel {
      margin-top: 0;
    }

    .sidebar {
      grid-column: 1;
      grid-row: 2 / span 2;
    }

    .chat-card {
      grid-column: 2;
      grid-row: 2;
    }

    #resultsPanel {
      grid-column: 2;
      grid-row: 3;
    }

    .config-panel {
      grid-column: 3;
      grid-row: 2 / span 2;
    }

    @keyframes softEnter {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .panel {
      position: relative;
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--card-bg);
      box-shadow: var(--shadow);
      backdrop-filter: none;
      animation: softEnter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .workspace-visual {
      animation: softEnter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .sidebar {
      animation-delay: 40ms;
    }

    .chat-card {
      animation-delay: 90ms;
    }

    #resultsPanel {
      animation-delay: 130ms;
    }

    .config-panel {
      animation-delay: 170ms;
    }

    .panel::before {
      display: none;
    }

    .sidebar,
    .config-panel {
      position: sticky;
      top: 88px;
      max-height: calc(100vh - 110px);
      overflow: auto;
    }

    .panel-section {
      padding: 18px;
      border-bottom: 1px solid var(--border);
    }

    .section-heading {
      margin-bottom: 14px;
    }

    .section-heading h2,
    .section-heading h3,
    .chat-header h2 {
      color: var(--ink);
      font-size: 15px;
      font-weight: 850;
    }

    .section-heading p,
    .hint,
    .project-meta,
    .metric span,
    .status-desc,
    .bubble-time {
      color: var(--ink-muted);
    }

    .btn,
    .btn:not(.secondary):not(.ghost) {
      min-height: 38px;
      border-radius: 7px;
      background: var(--blue);
      color: #ffffff;
      box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
    }

    .btn:hover,
    .btn:not(.secondary):not(.ghost):hover {
      background: var(--blue-dark);
      box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    }

    .btn.secondary {
      background: #ffffff;
      color: var(--ink);
      border-color: var(--border);
      box-shadow: var(--shadow-soft);
    }

    .btn.secondary:hover {
      background: #f8fbff;
      border-color: rgba(37, 99, 235, 0.28);
    }

    .btn.ghost {
      color: var(--blue);
      background: transparent;
      box-shadow: none;
    }

    .btn.ghost:hover {
      background: #eef5ff;
      color: var(--blue-dark);
    }

    .input,
    .textarea,
    .select {
      min-height: 40px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: #ffffff;
      color: var(--ink);
      box-shadow: none;
    }

    .input:focus,
    .textarea:focus,
    .select:focus {
      border-color: rgba(37, 99, 235, 0.58);
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    .switch-row,
    .project-card,
    .metric,
    .status-item,
    .file-item,
    .empty,
    .check-chip {
      border: 1px solid var(--border);
      background: #ffffff;
      box-shadow: none;
    }

    .project-card.active,
    .project-card:hover {
      border-color: rgba(37, 99, 235, 0.3);
      background: #f6f9ff;
    }

    .metric {
      padding: 14px;
      background: linear-gradient(180deg, #ffffff, #f8fbff);
    }

    .metric::after {
      background: linear-gradient(90deg, var(--blue), var(--teal));
    }

    .metric strong {
      color: var(--ink);
    }

    .chat-header,
    .composer {
      background: #ffffff;
      border-color: var(--border);
    }

    .timeline {
      min-height: 420px;
      max-height: 520px;
      background:
        linear-gradient(180deg, #ffffff, #f8fbff),
        linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, 0.025) 1px, transparent 1px);
      background-size: auto, 36px 36px, 36px 36px;
    }

    .avatar {
      border-color: var(--border);
      background: #ffffff;
      color: var(--blue);
      box-shadow: var(--shadow-soft);
    }

    .message.system .avatar {
      background: var(--navy);
      color: #ffffff;
    }

    .message.agent .avatar {
      background: linear-gradient(135deg, #0f766e, #14b8a6);
      border-color: transparent;
      color: #ffffff;
    }

    .message.user .avatar {
      background: var(--blue);
      color: #ffffff;
    }

    .bubble {
      border-color: var(--border);
      background: #ffffff;
      box-shadow: var(--shadow-soft);
    }

    .message.user .bubble {
      background: #f4f8ff;
      border-color: rgba(37, 99, 235, 0.16);
    }

    .message.agent .bubble {
      background: linear-gradient(180deg, #f2fffc, #ecfffb);
      border-color: rgba(20, 184, 166, 0.2);
    }

    .tabs {
      border-color: var(--border);
      background: linear-gradient(180deg, #eef3f8, #e8eef5);
    }

    .tab {
      min-height: 40px;
      color: #5f6d80;
      font-size: 13px;
      letter-spacing: 0.01em;
    }

    .tab.active {
      color: var(--ink);
      background: #ffffff;
      box-shadow: 0 8px 18px rgba(24, 35, 49, 0.08);
    }

    .log-box {
      border-color: rgba(15, 23, 42, 0.14);
      background:
        linear-gradient(180deg, #08111f, #0b1d34),
        linear-gradient(rgba(20, 184, 166, 0.1) 1px, transparent 1px);
      background-size: auto, 28px 28px;
      color: #dffcff;
    }

    .result-box {
      background: #ffffff;
      border-color: var(--border);
      color: var(--ink);
    }

    .switch input:checked + .slider {
      background: linear-gradient(90deg, var(--blue), var(--teal));
    }

    .check-chip:has(input:checked) {
      border-color: rgba(37, 99, 235, 0.28);
      background: #f4f8ff;
    }

    @media (max-width: 1240px) {
      

      

      .layout {
        grid-template-columns: 290px minmax(0, 1fr);
      }

      .config-panel {
        grid-column: 1 / -1;
        grid-row: 4;
        position: static;
        max-height: none;
      }
    }

    @media (max-width: 860px) {
      body {
        background: #f5f7fb;
      }

      

      

      

      

      .layout {
        grid-template-columns: 1fr;
        width: calc(100vw - 20px);
        padding: 12px 0 28px;
      }

      .workspace-visual,
      .sidebar,
      .chat-card,
      #resultsPanel,
      .config-panel {
        grid-column: 1;
        grid-row: auto;
      }

      .workspace-visual {
        min-height: auto;
        padding: 28px 16px;
      }

      .workspace-visual h1 {
        font-size: 26px;
      }

      .hero-composer {
        width: 100%;
      }

      .sidebar,
      .config-panel {
        position: static;
        max-height: none;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .panel,
      .workspace-visual {
        animation: none !important;
      }
    }

    .app-shell {
      padding-top: calc(var(--shell-topbar-height) + 8px);
    }

    .layout {
      width: 100%;
      max-width: none;
      scroll-margin-top: var(--shell-topbar-height);
      min-height: calc(100vh - 68px);
      padding: 20px clamp(16px, 1.4vw, 30px) 32px;
      grid-template-columns: minmax(230px, 16vw) minmax(0, 1fr);
      gap: clamp(16px, 1.2vw, 24px);
      row-gap: 24px;
    }

    .workspace-visual {
      width: 100%;
      min-height: clamp(480px, 62vh, 760px);
    }

    .main-stack {
      grid-column: 2;
      display: grid;
      gap: 24px;
      align-content: start;
      min-width: 0;
    }

    .hero-composer {
      width: min(1180px, 100%);
      min-width: 0;
    }

    .chat-card,
    #resultsPanel {
      min-width: 0;
    }

    .sidebar {
      min-width: 0;
      min-height: 0;
      height: auto;
      max-height: none;
      overflow: visible;
    }

    .chat-card,
    #resultsPanel {
      display: flex;
      flex-direction: column;
      min-width: 0;
      position: relative;
      background: #ffffff;
      box-shadow: var(--shadow), inset 0 -1px 0 rgba(220, 229, 232, 0.96);
      overflow: visible;
      grid-column: auto;
      grid-row: auto;
      margin: 0;
    }

    .chat-card {
      min-height: 0;
    }

    #resultsPanel {
      min-height: 620px;
    }

    #resultsPanel > .panel-section {
      flex: 1 1 auto;
    }

    .timeline {
      min-height: 0;
      height: auto;
      max-height: 420px;
      resize: none;
      overflow: auto;
      align-content: start;
      flex: 0 0 auto;
    }

    .status-desc,
    .project-meta {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    #healthText {
      display: block;
      font-size: 14px;
      max-width: min(520px, 34vw);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .input,
    .textarea,
    .select {
      font-size: 14.5px;
    }

    .input::placeholder,
    .textarea::placeholder {
      font-size: 12px;
      color: #94a3b8;
    }

    #apiBase,
    #numKeywords,
    #numPapers,
    #latexTemplate,
    #outputFormat,
    #reviewMode {
      font-size: 14.5px;
    }

    #researchQuestion::placeholder {
      font-size: 15px;
    }

    .hero-composer .textarea,
    #humanInput {
      min-height: 178px;
    }

    .hero-config {
      display: grid;
      gap: 14px;
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid #e2e8f0;
    }

    .hero-config[hidden] {
      display: none;
    }

    .hero-config-toggle-btn {
      min-width: 80px;
      background: #f1f5f9 !important;
      border: none !important;
      color: #475569 !important;
      padding: 8px 16px !important;
      border-radius: 10px;
      font-size: 14px;
      line-height: 1.5;
      box-shadow: none !important;
      transform: none !important;
    }
    .hero-config-toggle-btn:hover {
      background: #e2e8f0 !important;
      box-shadow: none !important;
      transform: none !important;
    }

    .hero-config-row {
      display: grid;
      gap: 12px;
      align-items: start;
    }

    .hero-config-fields {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .field-pair {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      grid-column: span 2;
    }

    .hero-config-credentials {
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .hero-config .section-heading,
    .hero-config .field,
    .hero-config .template-upload,
    .hero-config .hero-config-block {
      margin-bottom: 0;
    }

    .hero-config .field,
    .hero-config .hero-config-block {
      padding: 12px;
      border: 1px solid #dbe4ef;
      border-radius: 12px;
      background: #f8fbff;
    }

    .hero-config .field,
    .hero-config .check-chip {
      min-width: 0;
    }

    .hero-config .input,
    .hero-config .select,
    .hero-config .textarea {
      display: block;
    }

    .hero-config .field .input,
    .hero-config .field .select,
    .hero-config .field .textarea {
      margin-top: 6px;
    }

    .hero-config .check-grid {
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 10px;
    }

    .hero-config .check-chip {
      display: grid;
      grid-template-columns: 14px minmax(0, 1fr);
      align-items: center;
      min-height: 42px;
      background: rgba(255, 255, 255, 0.96);
    }

    .hero-config .check-chip input {
      width: 14px;
      height: 14px;
      margin: 0;
    }

    .tab-panel {
      margin-top: 14px;
    }

    .render-box {
      padding: 20px;
    }

    @media (min-width: 1800px) {
      .layout {
        grid-template-columns: minmax(230px, 17vw) minmax(760px, 1fr);
      }

      .workspace-visual {
        min-height: clamp(520px, 64vh, 820px);
      }
    }

    @media (max-width: 1180px) {
      

      

      .layout {
        grid-template-columns: minmax(260px, 30vw) minmax(0, 1fr);
      }

      .hero-composer {
        width: 100%;
      }
    }

    @media (max-width: 760px) {
      .app-shell {
        padding-top: calc(var(--shell-topbar-height) + 8px);
      }

      

      

      .layout {
        grid-template-columns: 1fr;
        padding: 12px 10px 28px;
      }

      .workspace-visual,
      .sidebar,
      .main-stack,
      .chat-card,
      #resultsPanel {
        grid-column: 1;
        grid-row: auto;
      }

      .workspace-visual {
        min-height: auto;
        padding: 28px 16px;
      }

      .hero-composer {
        width: 100%;
        min-width: 0;
      }

      .hero-config-fields,
      .hero-config-credentials,
      .hero-config .check-grid,
      .field-pair {
        grid-template-columns: 1fr;
      }
      .field-pair {
        grid-column: auto;
      }
    }

    @media (max-width: 820px) {
      .inline-input-row,
      .composer-primary-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
      }

      .project-card-actions {
        flex-direction: column;
        align-items: stretch;
      }

      .sidebar,
      .chat-card,
      #resultsPanel,
      .timeline,
      .result-box,
      .log-box {
        min-height: auto;
        height: auto;
        resize: none;
      }

      #healthText {
        max-width: none;
      }

      .notice {
        left: 12px;
        right: 12px;
        top: 88px;
        width: auto;
      }
    }

    @media (max-width: 760px) {
      .notice {
        top: 12px;
      }
    }

    /* Resource input modal additions */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 90;
      align-items: flex-start !important;
      justify-content: center;
      padding: 24px !important;
      background: rgba(15, 23, 42, 0.42);
      backdrop-filter: blur(8px);
    }

    .modal-card {
      width: min(880px, calc(100vw - 32px));
      max-height: calc(100vh - 96px);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #dbe4ef;
      border-radius: 16px;
      background: #ffffff;
      box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
      margin: auto 0;
    }

    .modal-card.compact {
      width: min(640px, calc(100vw - 32px));
    }

    #batchUrlModalBackdrop {
      z-index: 92;
    }

    #batchUrlTextarea {
      min-height: 220px;
    }

    .modal-header,
    .modal-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 18px 20px;
      border-bottom: 1px solid #e2e8f0;
    }

    .modal-footer {
      border-top: 1px solid #e2e8f0;
      border-bottom: 0;
    }

    .modal-header h3 {
      margin: 0;
      font-size: 17px;
    }

    .modal-header p {
      margin: 4px 0 0;
      color: #64748b;
      font-size: 12px;
      line-height: 1.6;
    }

    .modal-body {
      display: grid;
      gap: 16px;
      padding: 20px;
      overflow-y: auto;
      flex: 1 1 auto;
      min-height: 0;
    }

    .archived-session-list {
      display: grid;
      gap: 10px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .archived-session-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: start;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #ffffff;
    }

    .archived-session-main {
      min-width: 0;
      display: grid;
      gap: 4px;
    }

    .archived-session-main strong,
    .archived-session-main span,
    .archived-session-main small {
      overflow-wrap: anywhere;
    }

    .archived-session-main strong {
      color: #18262b;
      font-size: 13px;
    }

    .archived-session-main span,
    .archived-session-main small {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }

    .upload-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .upload-card-head > div {
      min-width: 0;
      flex: 1 1 220px;
    }

    .resource-entry-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .upload-dropzone {
      display: grid;
      gap: 4px;
      justify-items: center;
      width: 100%;
      padding: 20px 16px;
      border: 1px dashed #bfd1ea;
      border-radius: 12px;
      background: linear-gradient(180deg, #ffffff, #f8fbff);
      color: #475569;
      text-align: center;
      cursor: pointer;
      transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
    }

    .upload-dropzone:hover,
    .upload-dropzone.is-dragover {
      border-color: #2f6feb;
      background: #eef5ff;
      transform: translateY(-1px);
    }

    .upload-dropzone strong {
      color: #0f172a;
      font-size: 13px;
      font-weight: 800;
    }

    .upload-dropzone span {
      font-size: 12px;
      line-height: 1.55;
    }

    .template-file-state {
      padding: 10px 12px;
      border: 1px solid #dbe4ef;
      border-radius: 10px;
      background: #ffffff;
      color: #475569;
      font-size: 12px;
      line-height: 1.6;
      word-break: break-word;
    }

    .source-url-list {
      display: grid;
      gap: 10px;
    }

    .source-url-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 10px;
      align-items: center;
    }

    .source-file-list .empty {
      margin: 0;
    }

    .source-file-note-preview {
      color: #64748b;
      font-size: 11.5px;
      line-height: 1.5;
    }

    .source-file-note-badge {
      display: inline-flex;
      align-items: center;
      min-height: 22px;
      padding: 0 8px;
      border: 1px solid #dbe4ef;
      border-radius: 999px;
      background: #eef5ff;
      color: #1d4ed8;
      font-size: 11px;
      font-weight: 700;
    }

    .source-note-target {
      padding: 10px 12px;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      background: #f8fafc;
      color: #334155;
      font-size: 12px;
      line-height: 1.6;
      word-break: break-word;
    }

    .result-empty {
      margin: 0;
    }


    @media (max-width: 820px) {
      .source-url-row,
      .modal-header,
      .modal-footer,
      .upload-card-head,
      .resource-entry-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
      }
    }

    .app-shell {
      --shell-topbar-height: 56px;
    }

    .layout {
      grid-template-columns: minmax(0, 1fr);
      padding-left: clamp(16px, 1.6vw, 28px);
      padding-right: clamp(16px, 1.6vw, 28px);
    }

    .main {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 24px;
      min-width: 0;
    }

    .workspace-visual,
    .main-stack,
    #resultsPanel {
      margin-inline: auto;
    }

    .workspace-visual,
    .main-stack,
    #resultsPanel {
      grid-column: auto !important;
      grid-row: auto !important;
    }

    .workspace-visual {
      width: 100%;
      max-width: none;
      margin-inline: 0;
    }

    .main-stack {
      width: 100%;
    }

    #resultsPanel {
      width: min(1180px, 100%);
    }

    .sidebar {
      position: fixed !important;
      top: var(--shell-topbar-height);
      left: 0;
      z-index: 50;
      width: min(360px, calc(100vw - 18px));
      height: calc(100vh - var(--shell-topbar-height));
      max-height: none !important;
      overflow: auto !important;
      border-radius: 0;
      margin: 0 !important;
      animation: none !important;
      transform: translateX(calc(-100% - 16px));
      transition: transform 220ms ease, box-shadow 220ms ease;
      box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    }

    .app-shell.sidebar-open .sidebar {
      transform: translateX(0);
    }

    .sidebar-backdrop {
      position: fixed;
      inset: 0;
      z-index: 45;
      border: 0;
      padding: 0;
      background: rgba(15, 23, 42, 0.32);
      opacity: 0;
      transition: opacity 220ms ease;
    }

    .app-shell.sidebar-open .sidebar-backdrop {
      opacity: 1;
    }

    .sidebar-header {
      position: sticky;
      top: 0;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 16px 18px 14px;
      border-bottom: 1px solid var(--line);
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(12px);
    }

    .sidebar-header h2 {
      margin: 4px 0 0;
      font-size: 16px;
      line-height: 1.2;
    }

    .sidebar-kicker {
      margin: 0;
      color: #64748b;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .sidebar .panel-section {
      padding: 16px 18px;
    }

    .sidebar .subsection-actions {
      align-items: center;
    }

    .debug-details {
      margin: 0 0 18px;
      border-top: 1px solid var(--line);
    }

    .debug-details summary {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 16px 18px;
      cursor: pointer;
      list-style: none;
      color: #24323b;
      font-size: 13px;
      font-weight: 800;
    }

    .debug-details summary::-webkit-details-marker {
      display: none;
    }

    .debug-summary-icon {
      display: inline-flex;
      width: 18px;
      height: 18px;
      color: #475569;
    }

    .debug-summary-icon svg {
      width: 100%;
      height: 100%;
    }

    .debug-content {
      display: grid;
    }

    .debug-section .section-heading {
      margin-bottom: 12px;
    }

    .debug-section .subsection-actions {
      justify-content: flex-end;
    }

    .hero-toggle-btn {
      position: relative;
      width: 38px;
      height: 38px;
      min-width: 38px;
      padding: 0;
      border-radius: 999px;
      border-color: rgba(148, 163, 184, 0.28);
      background: rgba(255, 255, 255, 0.9);
      color: #64748b;
      box-shadow: none;
    }

    .hero-toggle-btn svg {
      width: 22px;
      height: 22px;
    }

    .hero-toggle-btn:hover {
      border-color: rgba(37, 99, 235, 0.22);
      background: #ffffff;
      color: #334155;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    }

    .hero-toggle-btn.is-active {
      border-color: rgba(37, 99, 235, 0.24);
      background: linear-gradient(180deg, #eff6ff, #e0f2fe);
      color: #2563eb;
      box-shadow: 0 10px 20px rgba(37, 99, 235, 0.14);
    }

    .hero-toggle-btn::after {
      content: attr(data-tooltip);
      position: absolute;
      left: 50%;
      bottom: calc(100% + 10px);
      transform: translateX(-50%) translateY(4px);
      min-width: max-content;
      max-width: 260px;
      padding: 8px 10px;
      border: 1px solid rgba(15, 23, 42, 0.12);
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.92);
      color: #f8fafc;
      font-size: 12px;
      line-height: 1.45;
      white-space: normal;
      text-align: center;
      pointer-events: none;
      opacity: 0;
      transition: opacity 140ms ease, transform 140ms ease;
      box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
      z-index: 8;
    }

    .hero-toggle-btn:hover::after,
    .hero-toggle-btn:focus-visible::after {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .model-config-grid {
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      align-items: end;
    }

    .model-config-grid .field {
      min-width: 0;
    }

    .model-config-grid .field[hidden] {
      display: none !important;
    }

    .hero-config .field.is-hidden,
    .hero-config .template-upload:not(.active) {
      display: none !important;
    }

    .layout {
      padding-top: 0;
    }

    .workspace-visual {
      transition: min-height 220ms ease, padding 220ms ease, transform 220ms ease, box-shadow 220ms ease;
    }

    .app-shell.workflow-active .workspace-visual {
      min-height: auto;
      padding: 28px 30px 30px;
      transform: translateY(-8px);
      box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
    }

    .app-shell.workflow-active .workspace-visual h1 {
      font-size: clamp(28px, 3.1vw, 42px);
    }

    .app-shell.workflow-active .hero-composer .textarea {
      min-height: 128px;
    }

    .workflow-hub {
      display: grid;
      gap: 18px;
      justify-items: center;
      min-width: 0;
    }

    .workflow-hub > * {
      width: min(1180px, 100%);
      min-width: 0;
      margin-inline: auto;
    }

    .workflow-status-box,
    .flow-artifact-block,
    .flow-preview-block {
      border: 1px solid #dbe4ef;
      border-radius: 24px;
      background: linear-gradient(180deg, #ffffff, #f8fbff);
      box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
    }

    .workflow-status-box {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) minmax(220px, 360px) auto;
      align-items: center;
      gap: 16px;
      padding: 18px 20px;
    }

    .workflow-status-icon {
      display: grid;
      place-items: center;
      width: 46px;
      height: 46px;
      border-radius: 16px;
      background: linear-gradient(135deg, #1d4ed8, #38bdf8);
      color: #ffffff;
      font-size: 18px;
      font-weight: 800;
      box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
    }

    .workflow-status-copy {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .workflow-status-copy strong {
      color: #0f172a;
      font-size: 16px;
      line-height: 1.2;
    }

    .workflow-status-copy span {
      color: #64748b;
      font-size: 13px;
      line-height: 1.6;
    }

    .workflow-step-rail {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      overflow-x: auto;
      scrollbar-width: thin;
    }

    .flow-step-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 34px;
      padding: 0 14px;
      border: 1px solid #dbe4ef;
      border-radius: 999px;
      background: #ffffff;
      color: #64748b;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .flow-step-chip.is-active {
      border-color: rgba(37, 99, 235, 0.24);
      background: linear-gradient(180deg, #eff6ff, #dbeafe);
      color: #1d4ed8;
    }

    .flow-step-chip.is-complete {
      border-color: rgba(14, 116, 144, 0.2);
      background: linear-gradient(180deg, #ecfeff, #cffafe);
      color: #0f766e;
    }

    .flow-artifact-block,
    .flow-preview-block {
      padding: 20px 22px 22px;
      overflow: hidden;
      transition: opacity 220ms ease, filter 220ms ease;
    }

    .flow-artifact-block.is-stale,
    .flow-preview-block.is-stale {
      opacity: 0.58;
      filter: grayscale(0.26) saturate(0.84);
    }

    .flow-artifact-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .flow-artifact-head h3 {
      margin: 0;
      color: #0f172a;
      font-size: 18px;
      line-height: 1.2;
    }

    .flow-artifact-head p {
      margin: 6px 0 0;
      color: #64748b;
      font-size: 13px;
      line-height: 1.6;
    }

    .flow-artifact-carousel {
      overflow-x: auto;
      scrollbar-width: thin;
      padding-bottom: 4px;
      width: 100%;
    }

    .flow-artifact-carousel.has-static-lead {
      overflow: visible;
      padding-bottom: 0;
    }

    .flow-artifact-stack {
      display: grid;
      gap: 14px;
      min-width: 100%;
    }

    .final-artifact-table {
      display: grid;
      width: 100%;
      border: 0;
      border-radius: 6px;
      overflow: hidden;
      background: #ffffff;
    }

    .final-artifact-row {
      display: grid;
      grid-template-columns: minmax(210px, 0.92fr) minmax(118px, 0.34fr) minmax(280px, 0.95fr) minmax(240px, auto);
      align-items: center;
      gap: 0;
      min-height: 56px;
      padding: 0;
      border-top: 0;
    }

    .final-artifact-row > div {
      display: grid;
      place-items: center;
      min-height: 56px;
      padding: 10px 14px;
      text-align: center;
    }

    .final-artifact-row > div + div {
      border-left: 0;
    }

    .final-artifact-row:first-child {
      border-top: 0;
    }

    .final-artifact-row.is-head {
      min-height: 38px;
      background: #f7f8fa;
      color: #1f2937;
      font-size: 16px;
      font-weight: 900;
      letter-spacing: 0;
    }

    .final-artifact-row.is-head > div {
      min-height: 38px;
      padding-block: 9px;
    }

    .final-artifact-row.is-generated {
      background: #ffffff;
    }

    .final-artifact-row.is-generating {
      background: #eaf6ff;
    }

    .final-artifact-row.is-not-planned {
      color: #7b8791;
      background: #fbfcfd;
    }

    .final-artifact-name,
    .final-artifact-status,
    .final-artifact-meta,
    .final-artifact-actions {
      min-width: 0;
    }

    .final-artifact-row > .final-artifact-name {
      display: grid;
      justify-items: center;
      gap: 3px;
    }

    .final-artifact-name strong {
      color: #111827;
      font-size: 14px;
      line-height: 1.28;
      font-weight: 900;
    }

    .final-artifact-name span {
      color: #738191;
      font-size: 12px;
      line-height: 1.35;
      word-break: break-word;
      font-weight: 400;
    }

    .final-artifact-row > .final-artifact-status {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      color: #27343b;
      font-size: 13px;
      font-weight: 400;
      white-space: nowrap;
    }

    .artifact-status-lamp {
      position: relative;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #94a3b8;
      box-shadow: none;
      flex: 0 0 auto;
    }

    .artifact-status-lamp::after {
      content: none;
    }

    .artifact-status-lamp.is-planned {
      background: #94a3b8;
      box-shadow: none;
    }

    .artifact-status-lamp.is-generating {
      background: var(--accent);
      box-shadow: 0 0 0 2px rgba(47, 111, 235, 0.16);
    }

    .artifact-status-lamp.is-generating::after {
      content: "";
      position: absolute;
      inset: -6px;
      border-radius: 50%;
      background: rgba(47, 111, 235, 0.22);
      animation: artifactLampPulse 1.55s ease-out infinite;
    }

    .artifact-status-lamp.is-generated {
      background: var(--ok);
      box-shadow: none;
    }

    .artifact-status-lamp.is-not-planned {
      background: #cbd5e1;
      box-shadow: none;
    }

    @keyframes artifactLampPulse {
      0% {
        transform: scale(0.35);
        opacity: 0.42;
      }
      100% {
        transform: scale(1.35);
        opacity: 0;
      }
    }

    .final-artifact-row > .final-artifact-meta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      color: #64748b;
      font-size: 12px;
      line-height: 1.45;
      white-space: nowrap;
    }

    .final-artifact-meta span {
      color: #334155;
      font-size: 14px;
      font-weight: 400;
    }

    .final-artifact-meta small {
      color: #718096;
      font-size: 12px;
      font-weight: 400;
      white-space: nowrap;
    }

    .final-artifact-row > .final-artifact-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
      flex-wrap: nowrap;
      white-space: nowrap;
    }

    .final-artifact-icon-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      padding: 0;
      border: 0;
      background: transparent;
      color: #334155;
      text-decoration: none;
      box-shadow: none;
      transition: color 150ms ease, transform 150ms ease, opacity 150ms ease;
    }

    .final-artifact-icon-btn svg {
      width: 19px;
      height: 19px;
    }

    .final-artifact-icon-btn:hover:not(:disabled) {
      color: var(--paper-accent);
      transform: translateY(-1px);
    }

    .final-artifact-icon-btn:disabled {
      color: #cbd5e1;
      cursor: not-allowed;
      opacity: 0.62;
    }

    .paper-feed {
      display: grid;
      gap: 16px;
      width: 100%;
      max-width: none;
      margin: 0;
    }

    .paper-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(220px, 248px);
      gap: 18px;
      min-height: 244px;
      padding: 18px 16px 16px;
      border: 1px solid #d5e1e4;
      border-radius: 8px;
      background: #ffffff;
      box-shadow: none;
      cursor: pointer;
      transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    }

    .paper-card:hover,
    .paper-card:focus-visible {
      border-color: rgba(15, 118, 110, 0.38);
      box-shadow: none;
      transform: translateY(-1px);
      outline: 0;
    }

    .paper-card-main {
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr) auto;
      gap: 10px;
      min-width: 0;
      min-height: 100%;
    }

    .paper-card-main h4 {
      margin: 0;
      color: #111827;
      font-size: clamp(20px, 2vw, 25px);
      line-height: 1.16;
      font-weight: 850;
      letter-spacing: 0;
    }

    .paper-card-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      color: #4b5960;
      font-size: 13px;
      line-height: 1.4;
      font-weight: 650;
    }

    .paper-card-source {
      color: var(--primary-dark);
      font-weight: 800;
    }

    .paper-card-abstract {
      display: -webkit-box;
      margin: 0;
      color: #5d6a72;
      font-size: 13px;
      line-height: 1.55;
      overflow: hidden;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: var(--abstract-lines, 8);
    }

    .paper-card-tags {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      min-height: 26px;
    }

    .paper-card-bottom {
      align-self: end;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      gap: 12px;
      min-width: 0;
    }

    .paper-card-tags span {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 0 9px;
      border-radius: 999px;
      background: #eef2ff;
      color: #1d4ed8;
      font-size: 12px;
      font-weight: 760;
    }

    .paper-card-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 0;
      padding-top: 4px;
    }

    .paper-icon-action,
    .paper-pill-action,
    .reader-icon-btn,
    .shared-icon-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border: 1px solid #dce5e8;
      border-radius: 999px;
      background: #f8fafb;
      color: #263238;
      text-decoration: none;
      transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
    }

    .reader-icon-btn.is-danger {
      color: #be123c;
    }

    .reader-icon-btn.is-danger:hover {
      background: rgba(190, 18, 60, 0.08);
      border-color: rgba(190, 18, 60, 0.22);
      color: #be123c;
    }

    .paper-icon-action:hover,
    .paper-pill-action:hover,
    .reader-icon-btn:hover,
    .shared-icon-btn:hover {
      border-color: rgba(47, 111, 235, 0.26);
      background: #eff6ff;
      color: #1d4ed8;
      transform: translateY(-1px);
    }

    .paper-icon-action.is-disabled,
    .paper-icon-action.is-disabled:hover {
      border-color: #dce5e8;
      background: #f3f5f6;
      color: #9aa5aa;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .paper-icon-action svg,
    .paper-pill-action svg,
    .reader-icon-btn svg,
    .shared-icon-btn svg {
      width: 18px;
      height: 18px;
    }

    .paper-pill-action {
      width: auto;
      gap: 7px;
      padding: 0 12px;
      color: #1d4ed8;
      font-size: 13px;
      font-weight: 760;
    }

    .paper-card-actions .paper-icon-action:first-child {
      margin-left: auto;
      background: var(--primary);
      border-color: var(--primary);
      color: #ffffff;
    }

    .paper-card-thumb {
      align-self: stretch;
      display: grid;
      grid-template-rows: auto auto 1fr;
      gap: 12px;
      min-height: 224px;
      padding: 16px 14px;
      border: 1px solid #d7e0e3;
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.92), rgba(249,252,252,0.94)),
        repeating-linear-gradient(0deg, rgba(37, 99, 235, 0.08) 0 1px, transparent 1px 18px);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
      overflow: hidden;
    }

    .paper-card-thumb-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: #2563eb;
      font-size: 11px;
      font-weight: 850;
    }

    .paper-card-thumb-bar strong {
      padding: 2px 7px;
      border: 1px solid rgba(37, 99, 235, 0.2);
      border-radius: 999px;
      background: #ffffff;
      color: #2563eb;
    }

    .paper-card-thumb-title {
      color: #1d4ed8;
      font-size: 11px;
      line-height: 1.35;
      font-weight: 760;
    }

    .paper-card-thumb-lines {
      display: grid;
      align-content: start;
      gap: 9px;
      margin-top: 6px;
    }

    .paper-card-thumb-lines span {
      display: block;
      height: 6px;
      border-radius: 999px;
      background: #cbd5da;
    }

    .paper-card-thumb-lines span:nth-child(2n) {
      width: 78%;
      background: #dbeafe;
    }

    .paper-card-thumb-lines span:nth-child(3n) {
      width: 58%;
      background: #bfdbfe;
    }

    .paper-card-thumb.is-loading {
      opacity: 0.76;
    }

    .paper-card-thumb.has-pdf-preview {
      display: block;
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
      min-height: auto;
    }

    .paper-card-thumb-canvas {
      display: block;
      min-height: 0;
      overflow: hidden;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .paper-card-thumb-canvas canvas {
      display: block;
      max-width: 100%;
      height: auto !important;
      margin: 0 auto;
    }

    .paper-reader-block {
      padding: 0;
      border-radius: 8px;
      background: #ffffff;
    }

    .paper-reader-block .flow-artifact-head {
      display: none;
    }

    .paper-reader-block .render-box {
      min-height: calc(100vh - 112px);
    }

    .paper-reader {
      --reader-side-width: 390px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 8px minmax(320px, var(--reader-side-width));
      min-height: calc(100vh - 112px);
      background: #ffffff;
      overflow: hidden;
    }

    .paper-reader-overlay {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: #ffffff;
    }

    .paper-reader-overlay[hidden] {
      display: none;
    }

    .paper-reader-overlay-content,
    .paper-reader-overlay .paper-reader {
      width: 100%;
      height: 100vh;
      min-height: 100vh;
    }

    html.paper-reader-open,
    body.paper-reader-open {
      overflow: hidden;
    }

    .paper-reader-overlay .paper-reader-top {
      top: 0;
    }

    .paper-reader-overlay .paper-reader-content {
      overflow: visible;
    }

    .paper-reader-main {
      display: grid;
      grid-template-rows: auto auto minmax(0, 1fr);
      min-width: 0;
      height: 100vh;
      min-height: 0;
      overflow-y: auto;
      overscroll-behavior: contain;
      border-right: 1px solid #dce5e8;
    }

    .paper-reader.is-pdf-mode .paper-reader-main {
      grid-template-rows: auto minmax(0, 1fr);
      overflow: hidden;
    }

    .paper-reader-top {
      position: sticky;
      top: 72px;
      z-index: 2;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      min-height: 56px;
      padding: 8px 18px;
      border-bottom: 1px solid #dce5e8;
      background: rgba(255, 255, 255, 0.94);
      backdrop-filter: blur(16px);
    }

    .reader-back-btn {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-height: 34px;
      border: 0;
      background: transparent;
      color: #4b5960;
      font-size: 13px;
      font-weight: 760;
    }

    .reader-back-btn svg {
      width: 16px;
      height: 16px;
      transform: rotate(180deg);
    }

    .reader-tabs,
    .assistant-tabs {
      display: flex;
      justify-content: center;
      gap: 4px;
      min-width: 0;
    }

    .reader-tab,
    .assistant-tabs button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      min-height: 40px;
      padding: 0 14px;
      border: 0;
      border-bottom: 2px solid transparent;
      background: transparent;
      color: #66727a;
      font-size: 14px;
      font-weight: 800;
    }

    .reader-tab.active,
    .assistant-tabs button.active {
      color: var(--primary-dark);
      border-bottom-color: var(--primary);
    }

    .reader-tab svg {
      width: 17px;
      height: 17px;
    }

    .reader-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .paper-reader-title {
      max-width: 900px;
      width: 100%;
      margin: 0 auto;
      padding: 58px 26px 34px;
    }

    .paper-reader-title h3 {
      margin: 0;
      color: #111827;
      font-size: clamp(30px, 4vw, 42px);
      line-height: 1.13;
      font-weight: 850;
      letter-spacing: 0;
    }

    .paper-reader-title p {
      margin: 18px 0 0;
      color: #5d6a72;
      font-size: 14px;
      line-height: 1.6;
      font-weight: 650;
    }

    .paper-reader-content {
      min-width: 0;
      padding: 0 26px 42px;
      overflow: visible;
    }

    .paper-reader.is-pdf-mode .paper-reader-content {
      height: calc(100vh - 56px);
      padding: 0;
      overflow: hidden;
      background: #eef3f5;
    }

    .reader-pdf-host,
    .standalone-pdf-preview {
      min-height: 520px;
    }

    .standalone-pdf-frame {
      display: block;
      width: 100%;
      min-height: 520px;
      border: 0;
      background: #ffffff;
    }

    .paper-reader.is-pdf-mode .reader-pdf-host,
    .paper-reader.is-pdf-mode .reader-pdf-host .shared-pdf-viewer {
      height: 100%;
      min-height: 0;
    }

    .paper-reader.is-pdf-mode .reader-pdf-host .shared-pdf-viewer {
      border: 0;
      border-radius: 0;
    }

    .paper-reader.is-pdf-mode .reader-pdf-host .shared-pdf-stage {
      height: 100%;
      max-height: none;
    }

    .artifact-reader .artifact-reader-content {
      height: calc(100vh - 56px);
      padding: 16px 20px 18px;
      overflow: hidden;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0)),
        #eef3f5;
    }

    .artifact-reader.is-markdown-preview .artifact-reader-content {
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .artifact-reader.is-markdown-preview .preview-section {
      height: auto;
      min-height: 100%;
      overflow: visible;
    }

    .artifact-reader-top-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .artifact-reader .preview-section {
      width: 100%;
      height: 100%;
      max-width: none;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .artifact-reader .preview-head {
      display: none;
    }

    .artifact-reader .preview-editor-shell {
      gap: 10px;
      height: 100%;
      min-height: 0;
      grid-template-rows: minmax(0, 1fr) auto;
    }

    .artifact-reader .preview-code-editor {
      height: 100%;
      min-height: 0;
      grid-template-rows: auto minmax(0, 1fr);
      border: 1px solid #dbe4ef;
      border-radius: 8px;
      background: #ffffff;
      overflow: hidden;
      box-shadow: 0 18px 48px rgba(24, 35, 42, 0.08);
    }

    .artifact-reader .preview-code-editor-toolbar {
      min-height: 42px;
      padding: 0 14px;
      border-bottom: 1px solid #e5edf1;
      background: #f8fafc;
    }

    .artifact-reader .preview-section {
      width: 100%;
      height: 100%;
      max-width: none;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .artifact-reader .preview-head {
      display: none;
    }

    .artifact-reader .preview-editor-shell {
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
      gap: 10px;
      height: 100%;
      min-height: 0;
    }

    .artifact-reader .preview-code-editor {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      height: 100%;
      min-height: 0;
      border: 1px solid #dbe4ef;
      border-radius: 8px;
      background: #ffffff;
      overflow: hidden;
      box-shadow: 0 18px 48px rgba(24, 35, 42, 0.08);
    }

    .artifact-reader .preview-code-editor-toolbar {
      min-height: 42px;
      padding: 0 14px;
      border-bottom: 1px solid #e5edf1;
      background: #f8fafc;
    }

    .artifact-reader .preview-code-editor-host {
      min-height: 0;
      overflow: hidden;
    }

    .artifact-reader .preview-code-editor .cm-editor {
      height: 100%;
      min-height: 0;
    }

    .artifact-reader .preview-code-editor .cm-scroller {
      height: 100%;
      min-height: 0;
      overflow: auto;
      align-items: flex-start;
    }

    .artifact-reader .preview-code-editor .cm-content {
      min-height: 0;
    }

    .artifact-reader .preview-code-editor .cm-gutters {
      min-height: 0;
    }

    .artifact-reader .preview-editor-hint {
      padding: 0 2px;
    }

    .artifact-reader .preview-editor-textarea {
      height: 100%;
      min-height: 0;
      resize: none;
      border: 0;
      border-radius: 0;
      background: #ffffff;
    }

    .artifact-reader.has-compiled-tex-preview .artifact-reader-content {
      overflow: hidden;
    }

    .artifact-reader.has-compiled-tex-preview .compiled-tex-preview {
      display: grid;
      grid-template-rows: var(--compiled-source-height, 190px) auto minmax(0, 1fr);
      gap: 0;
      width: 100%;
      height: 100%;
      min-height: 0;
    }

    .artifact-reader.has-compiled-tex-preview .preview-section {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      height: auto;
      min-height: 0;
      overflow: hidden;
      border: 1px solid #dbe4ef;
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 18px 48px rgba(24, 35, 42, 0.08);
    }

    .artifact-reader.has-compiled-tex-preview .preview-head {
      display: flex;
      min-height: 40px;
      padding: 0 14px;
      border-bottom: 1px solid #e5edf1;
      background: #f8fafc;
    }

    .artifact-reader.has-compiled-tex-preview .preview-head strong,
    .artifact-reader.has-compiled-tex-preview .preview-head span {
      align-self: center;
    }

    .artifact-reader.has-compiled-tex-preview .compiled-pdf-preview {
      grid-template-rows: minmax(0, 1fr);
    }

    .artifact-reader.has-compiled-tex-preview .markdown-body {
      display: grid;
      grid-template-rows: minmax(0, 1fr);
      padding: 0;
      line-height: normal;
      min-height: 0;
      overflow: hidden;
    }

    .artifact-reader.has-compiled-tex-preview .compiled-source-text {
      height: 100%;
      min-height: 0;
      border: 0;
      border-radius: 0;
    }

    .artifact-reader.has-compiled-tex-preview .tex-source-preview .preview-code-editor {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      height: 100%;
      min-height: 0;
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }

    .artifact-reader.has-compiled-tex-preview .tex-source-preview .preview-code-editor-host {
      height: 100%;
      min-height: 0;
      overflow: hidden;
    }

    .artifact-reader.has-compiled-tex-preview .tex-source-preview .preview-code-editor .cm-editor {
      height: 100%;
      min-height: 0;
    }

    .artifact-reader.has-compiled-tex-preview .tex-source-preview .preview-code-editor .cm-scroller {
      height: 100%;
      min-height: 0;
      overflow: auto;
      align-items: flex-start;
    }

    .artifact-reader.has-compiled-tex-preview .tex-source-preview .preview-code-editor .cm-content {
      min-height: 0;
      padding-top: 10px;
      padding-bottom: 10px;
    }

    .artifact-reader.has-compiled-tex-preview .tex-source-preview .preview-code-editor .cm-gutters {
      min-height: 0;
    }

    .artifact-reader.has-compiled-tex-preview .compiled-pdf-preview .compiled-pdf-host,
    .artifact-reader.has-compiled-tex-preview .compiled-pdf-preview .shared-pdf-viewer {
      width: 100%;
      height: 100%;
      min-height: 0;
      border: 0;
      border-radius: 0;
    }

    .artifact-reader.has-compiled-tex-preview .compiled-pdf-preview .shared-pdf-stage {
      height: 100%;
      min-height: 0;
      max-height: none;
    }

    .artifact-reader.has-compiled-tex-preview .compiled-pdf-preview .shared-pdf-height-handle {
      display: none;
    }

    .artifact-reader.is-pdf-mode .paper-reader-main {
      overflow-y: auto;
    }

    .artifact-reader.is-pdf-mode .paper-reader-content {
      height: auto;
      min-height: calc(100vh - 56px);
      padding: 0;
      overflow: visible;
    }

    .artifact-reader.is-pdf-mode .standalone-pdf-preview,
    .artifact-reader.is-pdf-mode .reader-pdf-host,
    .artifact-reader.is-pdf-mode .standalone-pdf-frame {
      width: 100%;
      height: calc(100vh - 56px);
      min-height: 0;
      border: 0;
      border-radius: 0;
    }

    .reader-markdown,
    .reader-metadata {
      max-width: 860px;
      margin: 0 auto;
      padding: 24px 26px;
      border: 1px solid #e6edf0;
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 12px 32px rgba(24, 35, 42, 0.06);
    }

    .reader-markdown {
      overflow: hidden;
    }

    .reader-markdown img,
    .reader-markdown svg,
    .reader-markdown video,
    .reader-markdown canvas {
      display: block;
      max-width: 100% !important;
      height: auto !important;
      margin: 16px auto;
      object-fit: contain;
    }

    .reader-markdown p,
    .reader-markdown li {
      overflow-wrap: anywhere;
    }

    .reader-markdown pre,
    .reader-markdown .markdown-table-wrap {
      max-width: 100%;
      overflow-x: auto;
    }

    .reader-metadata h4 {
      margin: 0 0 12px;
      color: #111827;
      font-size: 22px;
      line-height: 1.3;
    }

    .reader-metadata p {
      color: #4b5960;
      font-size: 15px;
      line-height: 1.75;
    }

    .reader-split-handle {
      width: 8px;
      background: linear-gradient(180deg, #f8fafb, #eef4f5);
      cursor: col-resize;
      border-right: 1px solid #dce5e8;
    }

    .paper-assistant-panel {
      position: relative;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      min-width: 0;
      min-height: 0;
      background: #fbfcfd;
    }

    .assistant-tabs {
      min-height: 56px;
      align-items: stretch;
      border-bottom: 1px solid #dce5e8;
      background: #ffffff;
    }

    .assistant-tabs button {
      min-height: 56px;
      padding: 0 12px;
      font-size: 13px;
    }

    .paper-assistant-section {
      display: grid;
      min-height: 0;
      overflow: hidden;
    }

    .paper-assistant-section [data-ai-assistant] {
      min-height: 0;
    }

    .shared-pdf-viewer {
      position: relative;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      height: var(--shared-pdf-height, clamp(680px, 78vh, 920px));
      min-height: 640px;
      border: 0;
      border-radius: 0;
      background: #f3f7f8;
      overflow: hidden;
    }

    .shared-pdf-viewer:fullscreen {
      width: 100vw;
      height: 100vh;
      min-height: 0;
      background: #e9eff1;
    }

    .shared-pdf-viewer:-webkit-full-screen {
      width: 100vw;
      height: 100vh;
      min-height: 0;
      background: #e9eff1;
    }

    .shared-pdf-toolbar {
      position: sticky;
      top: 0;
      z-index: 5;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto max-content;
      align-items: center;
      gap: 12px;
      min-height: 52px;
      min-width: 0;
      padding: 7px 18px;
      border-bottom: 1px solid #dce5e8;
      background: rgba(255, 255, 255, 0.94);
      backdrop-filter: blur(12px);
    }

    .shared-pdf-title {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      color: #263238;
      font-size: 13px;
      font-weight: 800;
    }

    .shared-pdf-title span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .shared-pdf-title svg {
      width: 18px;
      height: 18px;
      color: var(--primary-dark);
      flex: 0 0 auto;
    }

    .shared-pdf-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      min-width: 0;
    }

    .shared-pdf-toolbar .shared-icon-btn {
      border-color: transparent;
      border-radius: 6px;
      background: transparent;
      box-shadow: none;
    }

    .shared-pdf-toolbar .shared-icon-btn:hover {
      border-color: rgba(47, 111, 235, 0.2);
      background: #eff6ff;
    }

    .shared-pdf-page-count {
      color: #334155;
      font-size: 13px;
      font-weight: 800;
      white-space: nowrap;
    }

    .shared-pdf-scale {
      min-width: 48px;
      color: #4b5960;
      font-size: 12px;
      font-weight: 800;
      text-align: center;
      white-space: nowrap;
    }

    .shared-pdf-stage {
      display: grid;
      gap: 18px;
      justify-items: center;
      align-content: start;
      min-height: 0;
      max-height: none;
      overflow: auto;
      padding: 22px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.4), rgba(255,255,255,0)),
        #e9eff1;
    }

    .shared-pdf-height-handle {
      position: absolute;
      right: 10px;
      bottom: 10px;
      z-index: 7;
      width: 28px;
      height: 28px;
      border: 0;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.56);
      box-shadow: none;
      cursor: ns-resize;
      touch-action: none;
    }

    .shared-pdf-height-handle::before,
    .shared-pdf-height-handle::after {
      content: "";
      position: absolute;
      border-right: 2px solid #718096;
      border-bottom: 2px solid #718096;
      border-radius: 0 0 3px 0;
      opacity: 0.82;
    }

    .shared-pdf-height-handle::before {
      right: 7px;
      bottom: 7px;
      width: 11px;
      height: 11px;
    }

    .shared-pdf-height-handle::after {
      right: 12px;
      bottom: 12px;
      width: 6px;
      height: 6px;
    }

    .shared-pdf-height-handle:hover {
      background: rgba(255, 255, 255, 0.86);
    }

    .shared-pdf-viewer.is-page .shared-pdf-height-handle,
    .shared-pdf-viewer:fullscreen .shared-pdf-height-handle,
    .shared-pdf-viewer:-webkit-full-screen .shared-pdf-height-handle {
      display: none;
    }

    .shared-pdf-viewer.is-page .shared-pdf-toolbar {
      top: 0;
      min-height: 48px;
      padding-inline: 18px;
      background: rgba(255, 255, 255, 0.96);
    }

    .shared-pdf-page {
      position: relative;
      width: max-content;
      max-width: none;
      padding: 12px;
      border-radius: 8px;
      background: #ffffff;
      box-shadow: 0 12px 34px rgba(24, 35, 42, 0.18);
    }

    .shared-pdf-page canvas {
      display: block;
      max-width: none;
      height: auto !important;
    }

    .shared-pdf-page-label {
      position: absolute;
      top: 10px;
      right: 10px;
      padding: 3px 7px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.88);
      color: #4b5960;
      font-size: 11px;
      font-weight: 800;
      box-shadow: 0 4px 12px rgba(24, 35, 42, 0.12);
      z-index: 2;
    }

    .shared-pdf-loading,
    .shared-pdf-empty {
      display: grid;
      gap: 8px;
      place-items: center;
      min-height: 220px;
      color: #66727a;
      font-size: 14px;
      text-align: center;
    }

    .shared-pdf-empty a {
      color: var(--primary-dark);
      font-weight: 800;
    }

    .flow-preview-block .render-box {
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .flow-empty {
      padding: 18px;
      border: 1px dashed #dbe4ef;
      border-radius: 16px;
      color: #64748b;
      font-size: 13px;
      line-height: 1.6;
      text-align: center;
      background: #fbfdff;
    }

    .artifact-progress-panel {
      display: grid;
      gap: 10px;
      padding: 16px 18px;
      border: 1px solid #dbe4ef;
      border-radius: 16px;
      background: linear-gradient(180deg, #f8fbff, #eef6ff);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    .artifact-progress-panel.is-complete {
      border-color: rgba(21, 128, 61, 0.18);
      background: linear-gradient(180deg, #f5fff7, #ebf9ef);
    }

    .artifact-progress-panel.is-error {
      border-color: rgba(190, 24, 93, 0.18);
      background: linear-gradient(180deg, #fff7fa, #fff0f5);
    }

    .artifact-progress-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }

    .artifact-progress-copy {
      flex: 1;
      min-width: 0;
      display: grid;
      gap: 6px;
    }

    .artifact-progress-title {
      color: #0f172a;
      font-size: 14px;
      font-weight: 800;
      line-height: 1.4;
    }

    .artifact-progress-pill {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      background: rgba(37, 99, 235, 0.1);
      color: #1d4ed8;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .artifact-progress-panel.is-complete .artifact-progress-pill {
      background: rgba(21, 128, 61, 0.12);
      color: #166534;
    }

    .artifact-progress-panel.is-error .artifact-progress-pill {
      background: rgba(190, 24, 93, 0.12);
      color: #be123c;
    }

    .artifact-progress-indicator {
      --artifact-progress: 0;
      --artifact-indicator-color: #2563eb;
      position: relative;
      flex: 0 0 auto;
      width: 56px;
      height: 56px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background:
        conic-gradient(
          var(--artifact-indicator-color) 0 calc(var(--artifact-progress) * 1%),
          rgba(191, 219, 254, 0.72) calc(var(--artifact-progress) * 1%) 100%
        );
      box-shadow:
        inset 0 0 0 1px rgba(148, 163, 184, 0.18),
        0 8px 18px rgba(148, 163, 184, 0.16);
    }

    .artifact-progress-panel.is-complete .artifact-progress-indicator {
      --artifact-indicator-color: #16a34a;
      background:
        conic-gradient(
          var(--artifact-indicator-color) 0 calc(var(--artifact-progress) * 1%),
          rgba(187, 247, 208, 0.78) calc(var(--artifact-progress) * 1%) 100%
        );
    }

    .artifact-progress-panel.is-error .artifact-progress-indicator {
      --artifact-indicator-color: #e11d48;
      background:
        conic-gradient(
          var(--artifact-indicator-color) 0 calc(var(--artifact-progress) * 1%),
          rgba(255, 228, 239, 0.92) calc(var(--artifact-progress) * 1%) 100%
        );
    }

    .artifact-progress-indicator::after {
      content: "";
      position: absolute;
      inset: 8px;
      border-radius: inherit;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(6px);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    }

    .artifact-progress-indicator-value {
      position: relative;
      z-index: 1;
      color: #1d4ed8;
      font-size: 11px;
      font-weight: 800;
      line-height: 1;
    }

    .artifact-progress-panel.is-complete .artifact-progress-indicator-value {
      color: #166534;
    }

    .artifact-progress-panel.is-error .artifact-progress-indicator-value {
      color: #be123c;
    }

    .artifact-progress-bar {
      position: relative;
      height: 8px;
      border-radius: 999px;
      overflow: hidden;
      background: #dbeafe;
    }

    .artifact-progress-panel.is-complete .artifact-progress-bar {
      background: #d1fae5;
    }

    .artifact-progress-panel.is-error .artifact-progress-bar {
      background: #ffe4ef;
    }

    .artifact-progress-bar > span {
      display: block;
      width: 0;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, #38bdf8, #2563eb);
      transition: width 220ms ease;
    }

    .artifact-progress-panel.is-complete .artifact-progress-bar > span {
      background: linear-gradient(90deg, #4ade80, #16a34a);
    }

    .artifact-progress-panel.is-error .artifact-progress-bar > span {
      background: linear-gradient(90deg, #fb7185, #e11d48);
    }

    .artifact-progress-meta {
      color: #334155;
      font-size: 13px;
      line-height: 1.6;
    }

    .artifact-progress-detail {
      color: #64748b;
      font-size: 12px;
      line-height: 1.55;
    }

    .chat-card {
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      overflow: visible;
    }

    .chat-card .timeline,
    .chat-card .input-request {
      border: 1px solid #dbe4ef;
      border-radius: 24px;
      background: #ffffff;
      box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
    }

    .chat-card .timeline {
      max-height: none;
      min-height: 360px;
      padding: 22px;
    }

    .chat-card .input-request {
      margin-top: 16px;
      padding: 20px 22px 22px;
    }

    .project-download-btn {
      min-width: 0;
    }

    #stopRunBtn {
      flex: 0 0 auto;
    }

    #stopRunBtn svg {
      pointer-events: none;
    }

    @media (max-width: 760px) {
      .app-shell {
        --shell-topbar-height: 56px;
      }

      .sidebar {
        top: var(--shell-topbar-height);
        width: min(360px, calc(100vw - 12px));
        height: calc(100vh - var(--shell-topbar-height));
      }

      .sidebar-backdrop {
        inset: 0;
      }

      
    }

    @media (max-width: 1180px) {
      .workflow-status-box {
        grid-template-columns: auto minmax(0, 1fr) auto;
      }

      .workflow-step-rail {
        grid-column: 1 / -1;
      }

      .paper-reader {
        grid-template-columns: minmax(0, 1fr);
      }

      .reader-split-handle {
        display: none;
      }

      .paper-assistant-panel {
        min-height: 520px;
        border-top: 1px solid #dce5e8;
      }
    }

    @media (max-width: 760px) {
      .workflow-status-box {
        grid-template-columns: 1fr;
        justify-items: start;
      }

      .final-artifact-row {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .final-artifact-row.is-head {
        display: none;
      }

      .final-artifact-row > .final-artifact-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      .final-artifact-row > .final-artifact-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
        white-space: normal;
      }

      .final-artifact-meta small {
        white-space: normal;
      }

      .paper-card {
        grid-template-columns: 1fr;
        min-height: 0;
      }

      .paper-card-bottom {
        grid-template-columns: 1fr;
      }

      .paper-card-actions {
        justify-content: flex-start;
      }

      .paper-card-thumb {
        min-height: 156px;
      }

      .paper-reader-top {
        position: static;
        grid-template-columns: 1fr;
      }

      .reader-tabs {
        justify-content: flex-start;
        overflow-x: auto;
      }

      .reader-actions {
        justify-content: flex-start;
      }

      .paper-reader-title {
        padding: 28px 18px 22px;
      }

      .paper-reader-content {
        padding: 0 14px 28px;
      }

      .shared-pdf-toolbar {
        grid-template-columns: 1fr;
        justify-items: start;
      }

      .shared-pdf-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      .app-shell.workflow-active .workspace-visual {
        transform: none;
        padding: 24px 18px 22px;
      }

      .hero-toggle-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
      }
    }

    /* Global progress bar - segmented style */
    .global-progress-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 9999;
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 12px 20px;
      background: var(--panel);
      border-top: 1px solid var(--line);
      box-shadow: 0 -4px 20px rgba(24, 35, 42, 0.08);
      transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .global-progress-bar[hidden] {
      display: none;
    }

    .global-progress-bar.hiding {
      opacity: 0;
      transform: translateY(100%);
    }

    .progress-segments {
      display: flex;
      gap: 12px;
      flex: 1;
    }

    .progress-segment {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }

    .progress-segment-label {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .progress-segment.active .progress-segment-label {
      color: var(--text);
      font-weight: 500;
    }

    .progress-segment.completed .progress-segment-label {
      color: var(--ok);
    }

    .progress-segment-track {
      height: 6px;
      background: var(--panel-soft);
      border-radius: 3px;
      overflow: hidden;
    }

    .progress-segment-fill {
      height: 100%;
      width: 0%;
      background: var(--muted);
      border-radius: 3px;
      transition: width 0.4s ease, background 0.3s ease;
    }

    .progress-segment.active .progress-segment-fill {
      background: var(--primary);
    }

    .progress-segment.completed .progress-segment-fill {
      background: var(--ok);
    }

    .progress-segment-percent {
      font-size: 11px;
      color: var(--muted);
      text-align: right;
    }

    .progress-segment.active .progress-segment-percent {
      color: var(--primary);
      font-weight: 500;
    }

    .progress-segment.completed .progress-segment-percent {
      color: var(--ok);
    }

    .progress-segment.marker .progress-segment-track {
      display: none;
    }

    .progress-segment.marker .progress-segment-percent {
      text-align: center;
      color: var(--muted);
    }

    .progress-segment.marker .progress-segment-percent::before {
      content: "●";
      font-size: 10px;
    }

    .progress-segment.marker.completed .progress-segment-percent::before {
      content: "✓";
      color: var(--ok);
    }

    .progress-overall {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 140px;
    }

    .progress-overall-label {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
    }

    .progress-overall-track {
      flex: 1;
      height: 8px;
      background: var(--panel-soft);
      border-radius: 4px;
      overflow: hidden;
    }

    .progress-overall-fill {
      height: 100%;
      width: 0%;
      background: var(--accent);
      border-radius: 4px;
      transition: width 0.4s ease;
    }

    .progress-overall-percent {
      font-size: 12px;
      color: var(--text);
      font-weight: 500;
      min-width: 36px;
      text-align: right;
    }

    .global-progress-close {
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      font-size: 18px;
      line-height: 1;
      padding: 2px 6px;
    }

    .global-progress-close:hover {
      color: var(--text);
    }

    /* Hero fills viewport */
    .app-shell .workspace-visual,
    .app-shell.workflow-active .workspace-visual {
      min-height: calc(100vh - 90px);
    }

    /* Toggle switch */
    .toggle-switch {
      position: relative;
      display: inline-block;
      width: 44px;
      height: 24px;
      flex-shrink: 0;
    }
    .toggle-switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #cbd5e1;
      transition: .2s;
      border-radius: 24px;
    }
    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 18px;
      width: 18px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .2s;
      border-radius: 50%;
    }
    .toggle-switch input:checked + .toggle-slider {
      background-color: #0f172a;
    }
    .toggle-switch input:checked + .toggle-slider:before {
      transform: translateX(20px);
    }
    .debug-toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .debug-toggle-label {
      font-size: 14px;
      color: #334155;
    }
