/* MDIS Physical AI Paper Studio — Obsidian Research Aesthetic */
:root {
  --bg: #080c12;
  --bg-elev: #0e141f;
  --bg-card: #121a27;
  --bg-card-hi: #172233;
  --border: rgba(148, 163, 184, 0.14);
  --border-hi: rgba(56, 189, 248, 0.42);
  --text: #e6edf7;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.12);
  --violet: #a855f7;
  --violet-soft: rgba(168, 85, 247, 0.14);
  --emerald: #34d399;
  --emerald-soft: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);
  --rose: #fb7185;
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "IBM Plex Sans KR", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Plus Jakarta Sans", "IBM Plex Sans KR", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(56, 189, 248, 0.08), transparent 60%),
              radial-gradient(900px 500px at 90% -15%, rgba(168, 85, 247, 0.07), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(8, 12, 18, 0.86);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1580px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--cyan); font-size: 18px; }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.engine-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}
.engine-pill.ollama .dot { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.engine-pill.gemini .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.engine-pill.offline .dot { background: var(--rose); }

.top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.top-nav a { color: var(--text-dim); font-weight: 500; }
.top-nav a:hover { color: var(--text); text-decoration: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--text); }

/* ── Main Shell ───────────────────────────────────────────────────────────── */
.shell {
  max-width: 1580px;
  margin: 0 auto;
  padding: 18px 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Context Drawer ───────────────────────────────────────────────────────── */
.context-drawer {
  background: linear-gradient(180deg, rgba(18, 26, 39, 0.92), rgba(14, 20, 31, 0.85));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.context-drawer.collapsed .tracks-strip { display: none; }

.context-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  font-weight: 600;
}

.hero-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hw-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hw-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(8, 12, 18, 0.65);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 99px;
}

.tracks-strip {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.track-card {
  background: rgba(8, 12, 18, 0.56);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.track-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-1px);
}
.track-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.track-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.track-stage {
  font-size: 11.5px;
  color: var(--cyan);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.track-pain {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.track-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-mini {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--cyan); color: var(--text); }
.btn-mini.accent {
  background: var(--cyan-soft);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--cyan);
  font-weight: 600;
}

/* ── Command Bar ──────────────────────────────────────────────────────────── */
.command-bar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.cmd-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 11px;
}
.cmd-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.cmd-tab.active {
  background: var(--bg-card-hi);
  border-color: var(--border-hi);
  color: var(--text);
}

.cmd-input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cmd-input {
  flex: 1;
  min-width: 240px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  outline: none;
}
.cmd-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14); }
.cmd-input-sub { flex: 0.85; }

.cmd-select, .cmd-select-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }

.preset-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.preset-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-right: 4px;
}
.preset-chip {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #bae6fd;
  font-family: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.preset-chip:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan);
}

.activity-banner {
  margin-top: 11px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e0f2fe;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.activity-banner.error {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
}
.activity-banner.ok {
  background: var(--emerald-soft);
  border-color: rgba(52, 211, 153, 0.38);
  color: #d1fae5;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Split Workspace ──────────────────────────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: 375px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* Left Feed Rail */
.feed-rail {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 90px);
  position: sticky;
  top: 64px;
}

.feed-controls {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pill {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 99px;
  cursor: pointer;
}
.pill.active {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: #e0f2fe;
  font-weight: 600;
}

.feed-subfilters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.feed-subfilters select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
}

.feed-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-search-wrap input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 6px;
}
.feed-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.feed-list {
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.paper-card:hover { border-color: rgba(56, 189, 248, 0.35); background: var(--bg-card-hi); }
.paper-card.active {
  border-color: var(--cyan);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(18, 26, 39, 0.96));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.card-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.score-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.score-badge.mid {
  background: var(--cyan-soft);
  color: var(--cyan);
  border-color: rgba(56, 189, 248, 0.3);
}
.card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.card-title-ko {
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
}
.card-oneliner {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mini-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-dim);
}
.mini-tag.robot { background: var(--violet-soft); color: #e9d5ff; }
.mini-tag.code { background: var(--emerald-soft); color: #a7f3d0; }
.mini-tag.status { background: var(--amber-soft); color: #fde68a; }

/* ── Detail Pane ──────────────────────────────────────────────────────────── */
.detail-pane {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px 32px;
  min-height: 680px;
}

.empty-detail {
  display: grid;
  place-items: center;
  min-height: 400px;
  color: var(--text-muted);
}

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

.detail-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.detail-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.detail-title-ko {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.02em;
}
.detail-title-en {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.detail-authors {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.detail-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.link-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.ext-btn:hover { border-color: var(--cyan); text-decoration: none; }
.ext-btn.github { border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
.ext-btn.project { border-color: rgba(168, 85, 247, 0.4); color: #e9d5ff; }

.status-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.status-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
}
.status-btn.active {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: #fef3c7;
  font-weight: 600;
}

/* Section Blocks */
.section-block {
  margin-top: 24px;
}
.section-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Easy 3-min Summary */
.oneliner-hero {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.65;
  color: #f0f9ff;
  margin-bottom: 12px;
}

.analogy-box {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 15px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: #fef3c7;
  line-height: 1.65;
}
.analogy-box strong { color: var(--amber); }

.tri-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tri-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
}
.tri-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tri-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.tri-card ul, .tri-card ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13.2px;
  line-height: 1.65;
  color: var(--text);
}
.tri-card li { margin-bottom: 6px; }

.vs-prev {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-dim);
}
.vs-prev strong { color: var(--text); }

/* Tables (Observation & Reward) */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tech-table th {
  background: rgba(8, 12, 18, 0.72);
  color: var(--text-dim);
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tech-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: top;
  line-height: 1.55;
}
.tech-table tr:last-child td { border-bottom: none; }
.mono-cell { font-family: var(--font-mono); font-size: 12px; color: #bae6fd; }

.arch-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.arch-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.arch-item .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.arch-item .val { font-size: 12.8px; color: var(--text); }

/* Mini-PC Proposal Blueprint */
.proposal-box {
  background: linear-gradient(180deg, rgba(16, 29, 44, 0.92), rgba(12, 19, 30, 0.96));
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.proposal-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.prop-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--emerald-soft);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.prop-badge.violet { background: var(--violet-soft); color: #e9d5ff; border-color: rgba(168, 85, 247, 0.35); }
.prop-badge.amber { background: var(--amber-soft); color: #fde68a; border-color: rgba(251, 191, 36, 0.35); }

.proposal-why {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
  color: #ecfdf5;
}

.files-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.file-chip {
  font-family: var(--font-mono);
  font-size: 11.8px;
  background: rgba(8, 12, 18, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  padding: 3px 8px;
  border-radius: 6px;
}

.steps-list {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.7;
}
.steps-list li { margin-bottom: 6px; }

.caution-note {
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 12.8px;
  color: #fecdd3;
  margin-bottom: 14px;
}

.code-card {
  background: #06090f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: rgba(18, 26, 39, 0.85);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}
.code-pre {
  margin: 0;
  padding: 13px 15px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.2px;
  line-height: 1.62;
  color: #dbeafe;
}

/* Q&A & Notes */
.qa-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 14px;
}
.qa-panel, .note-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.qa-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.qa-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.qa-chip:hover { border-color: var(--cyan); color: var(--text); }

.chat-log {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chat-msg {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.chat-msg.user {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  align-self: flex-end;
  max-width: 88%;
}
.chat-msg.assistant {
  background: rgba(8, 12, 18, 0.72);
  border: 1px solid var(--border);
  align-self: stretch;
}
.chat-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chat-form {
  display: flex;
  gap: 8px;
}
.chat-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 7px;
}

.note-textarea {
  width: 100%;
  min-height: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 7px;
  resize: vertical;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1220px) {
  .tracks-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 320px minmax(0, 1fr); }
  .tri-grid { grid-template-columns: 1fr; }
  .arch-strip { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .tracks-strip { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .feed-rail { position: static; max-height: 460px; }
  .detail-pane { padding: 16px; }
}
