﻿:root {
      --bg: #08111f;
      --panel: rgba(12, 20, 34, 0.82);
      --panel-2: rgba(15, 24, 40, 0.96);
      --line: rgba(148, 163, 184, 0.18);
      --text: #e5eefb;
      --muted: #95a6bf;
      --accent: #7dd3fc;
      --accent-2: #34d399;
      --warn: #fbbf24;
      --danger: #fb7185;
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
      --radius: 22px;
      --font: "Aptos", "Segoe UI", Arial, sans-serif;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      font-family: var(--font);
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(125, 211, 252, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(52, 211, 153, 0.16), transparent 24%),
        linear-gradient(160deg, #07101d 0%, #0b1323 45%, #0c1629 100%);
    }
    .shell {
      max-width: 1320px;
      margin: 0 auto;
      padding: 32px 24px 48px;
    }
    .hero {
      display: grid;
      grid-template-columns: 1.3fr 0.9fr;
      gap: 20px;
      align-items: stretch;
      margin-bottom: 20px;
    }
    .brand, .status-card, .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      backdrop-filter: blur(18px);
    }
    .brand {
      padding: 28px;
      position: relative;
      overflow: hidden;
    }
    .brand-header {
      display: flex;
      align-items: center;
      gap: 18px;
      flex-wrap: wrap;
    }
    .brand-logo-wrap {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 114px;
      min-height: 55px;
      padding: 7px 10px;
      border-radius: 12px;
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid rgba(15, 23, 42, 0.08);
      box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
    }
    .brand-logo {
      display: block;
      width: auto;
      height: clamp(34px, 3.6vw, 43px);
      max-width: 100%;
      object-fit: contain;
      filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.22));
    }
    .brand::after {
      content: "";
      position: absolute;
      inset: auto -60px -70px auto;
      width: 220px;
      height: 220px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(125, 211, 252, 0.22), transparent 70%);
      pointer-events: none;
    }
    .eyebrow {
      display: inline-flex;
      gap: 8px;
      align-items: center;
      padding: 8px 12px;
      border-radius: 999px;
      color: var(--accent);
      background: rgba(125, 211, 252, 0.08);
      border: 1px solid rgba(125, 211, 252, 0.18);
      font-size: 12px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    h1 {
      margin: 18px 0 12px;
      font-size: clamp(2.1rem, 4vw, 4rem);
      line-height: 1.02;
      letter-spacing: -0.04em;
    }
    .lede {
      margin: 0;
      max-width: 68ch;
      color: var(--muted);
      font-size: 1.02rem;
      line-height: 1.65;
    }
    .status-card {
      padding: 24px;
      display: grid;
      gap: 14px;
    }
    .metric {
      display: grid;
      gap: 4px;
      padding: 16px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(148, 163, 184, 0.12);
    }
    .metric span {
      color: var(--muted);
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .metric strong {
      font-size: 1.1rem;
      font-weight: 650;
    }
    .grid {
      display: grid;
      grid-template-columns: 0.95fr 1.05fr;
      gap: 20px;
    }
    .panel {
      padding: 22px;
    }
    .panel h2 {
      margin: 0 0 14px;
      font-size: 1.05rem;
      letter-spacing: -0.02em;
    }
    label {
      display: block;
      margin: 0 0 8px;
      color: var(--muted);
      font-size: 0.9rem;
    }
    textarea, input, select {
      width: 100%;
      color: var(--text);
      background: var(--panel-2);
      border: 1px solid rgba(148, 163, 184, 0.18);
      border-radius: 16px;
      padding: 14px 16px;
      font: inherit;
      outline: none;
      transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
    }
    textarea:focus, input:focus, select:focus {
      border-color: rgba(125, 211, 252, 0.55);
      box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.12);
    }
    textarea {
      min-height: 160px;
      resize: vertical;
      line-height: 1.55;
    }
    .row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-top: 14px;
    }
    .actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 16px;
    }
    button {
      border: 0;
      border-radius: 14px;
      padding: 12px 16px;
      color: #07101d;
      background: linear-gradient(135deg, var(--accent), #a7f3d0);
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 14px 30px rgba(52, 211, 153, 0.18);
    }
    button.secondary {
      color: var(--text);
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(148, 163, 184, 0.16);
      box-shadow: none;
    }
    .examples {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 16px;
    }
    .chip {
      padding: 10px 12px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.14);
      background: rgba(255, 255, 255, 0.03);
      color: var(--text);
      cursor: pointer;
      font-size: 0.9rem;
    }
    .answer {
      min-height: 220px;
      white-space: pre-wrap;
      line-height: 1.65;
      color: #eff6ff;
    }
    .response-head {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 12px;
    }
    .pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(148, 163, 184, 0.14);
      color: var(--text);
      font-size: 0.88rem;
      white-space: nowrap;
    }
    .pill strong {
      color: var(--accent);
      font-weight: 650;
    }
    .sidebar-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 16px;
    }
    .mini-panel {
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, 0.12);
      background: rgba(255, 255, 255, 0.025);
      padding: 16px;
    }
    .mini-panel h3 {
      margin: 0 0 10px;
      font-size: 0.84rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .prompt-list, .history-list, .citation-list {
      display: grid;
      gap: 10px;
    }
    .prompt-card, .history-card, .citation-card, .summary-card, .step-card, .kg-card {
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, 0.14);
      background: rgba(255, 255, 255, 0.03);
      padding: 16px;
    }
    .prompt-card {
      display: block;
      width: 100%;
      text-align: left;
      color: var(--text);
      font: inherit;
      cursor: pointer;
      transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
    }
    .prompt-card {
      cursor: pointer;
      transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
    }
    .history-card {
      display: block;
      width: 100%;
      text-align: left;
      color: var(--text);
      font: inherit;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
    }
    .prompt-card:hover, .history-card:hover {
      transform: translateY(-1px);
      border-color: rgba(125, 211, 252, 0.35);
      background: rgba(255, 255, 255, 0.05);
    }
    .prompt-title, .history-title, .citation-title {
      font-weight: 650;
      line-height: 1.28;
      margin-bottom: 8px;
      font-size: 0.98rem;
    }
    .prompt-meta, .history-meta, .citation-meta, .summary-meta, .step-meta, .kg-meta {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.55;
    }
    .summary-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }
    .summary-card strong, .step-card strong, .kg-card strong {
      display: block;
      margin-bottom: 6px;
      font-size: 0.96rem;
      line-height: 1.35;
    }
    .badge-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 8px;
    }
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(125, 211, 252, 0.08);
      border: 1px solid rgba(125, 211, 252, 0.18);
      color: var(--accent);
      font-size: 0.8rem;
    }
    .badge.secondary {
      background: rgba(52, 211, 153, 0.08);
      border-color: rgba(52, 211, 153, 0.16);
      color: #a7f3d0;
    }
    .badge.warn {
      background: rgba(251, 191, 36, 0.1);
      border-color: rgba(251, 191, 36, 0.2);
      color: #fde68a;
    }
    .section-label {
      margin-bottom: 10px;
      color: var(--muted);
      font-size: 0.82rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .response-stack {
      display: grid;
      gap: 14px;
    }
    .answer-rich {
      display: grid;
      gap: 12px;
      line-height: 1.7;
    }
    .answer-rich p {
      margin: 0;
    }
    .answer-rich ul {
      margin: 0;
      padding-left: 18px;
    }
    .answer-rich li + li {
      margin-top: 6px;
    }
    .subtle {
      color: var(--muted);
      font-size: 0.9rem;
    }
    .empty-state {
      color: var(--muted);
      font-style: italic;
      line-height: 1.5;
    }
    .status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(148, 163, 184, 0.12);
      font-size: 0.88rem;
      color: var(--muted);
    }
    .dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--warn);
      box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.12);
    }
    .dot.ok { background: var(--accent-2); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12); }
    .dot.err { background: var(--danger); box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.12); }
    .results {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 22px;
      margin-top: 20px;
    }
    .block {
      margin-top: 14px;
      padding: 18px;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(148, 163, 184, 0.12);
    }
    .section-row {
      display: grid;
      grid-template-columns: 1fr;
      gap: 18px;
      margin-top: 14px;
    }
    pre {
      margin: 0;
      overflow: auto;
      white-space: pre-wrap;
      word-break: break-word;
      font-size: 0.92rem;
      line-height: 1.55;
    }
    .list {
      margin: 0;
      padding-left: 20px;
    }
    .list li + li { margin-top: 8px; }
    .lineage-list {
      margin: 0;
      padding: 0;
      list-style: none;
      display: grid;
      gap: 12px;
    }
    .lineage-list li {
      border-radius: 18px;
      border: 1px solid rgba(148, 163, 184, 0.12);
      background: rgba(255, 255, 255, 0.03);
      padding: 16px;
    }
    .lineage-list li strong {
      display: block;
      margin-bottom: 6px;
      font-size: 1rem;
      line-height: 1.35;
    }
    .citation-card, .kg-card, .summary-card, .step-card {
      display: grid;
      gap: 8px;
    }
    .citation-card .badge-row, .kg-card .badge-row, .summary-card .badge-row, .step-card .badge-row {
      margin-top: 2px;
    }
    .empty-state {
      font-size: 0.92rem;
    }
    @media (max-width: 1100px) {
      .hero, .grid, .results, .sidebar-grid, .section-row { grid-template-columns: 1fr; }
      .row { grid-template-columns: 1fr; }
    }
