/* ══════════════════════════════════════════════════════════════
   CaseFlow Progress — Cream & Blue, Light Mode
   Typography: Instrument Serif (display), Plus Jakarta Sans (body),
               Geist Mono (data/code)
══════════════════════════════════════════════════════════════ */

:root {
  --bg:          #FAF9F6;
  --bg-warm:     #FFFFFF;
  --bg-raised:   #FFFFFF;
  --surface:     #F3F2EE;

  --border:      #E5E2DB;
  --border-soft: #EEECE7;
  --border-hover:#CBC7BD;

  --text:        #3B3A36;
  --text-2:      #6B6A63;
  --text-muted:  #9C9A92;
  --ink:         #1A1918;

  --blue:        #2563EB;
  --blue-dark:   #1D4ED8;
  --blue-light:  #DBEAFE;
  --blue-b:      #BFDBFE;

  --emerald:     #16A34A;
  --emerald-fg:  #16A34A;
  --emerald-bg:  #F0FDF4;
  --emerald-b:   #BBF7D0;

  --amber:       #D97706;
  --amber-fg:    #D97706;
  --amber-bg:    #FFFBEB;
  --amber-b:     #FDE68A;

  --red:         #DC2626;
  --red-fg:      #DC2626;
  --red-bg:      #FEF2F2;
  --red-b:       #FECACA;

  --slate:       #9C9A92;
  --slate-bg:    #F5F4F1;
  --slate-b:     #E5E2DB;

  --accent:      #2563EB;
  --accent-soft: rgba(37, 99, 235, 0.08);

  --radius:      6px;
  --radius-lg:   10px;
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.03);
  --shadow-lg:   0 4px 24px rgba(0,0,0,0.08);

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { position: relative; }


/* ── TOP BAR ── */
.top-bar {
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 26px; height: 26px;
  background: var(--blue);
  border-radius: 5px;
  display: grid;
  place-items: center;
}
.logo-mark svg { width: 14px; height: 14px; }
.logo-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  color: var(--ink);
}
.top-meta {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}


/* ── CONTAINER ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 32px 100px;
}

/* hero (removed from HTML but keeping minimal styles in case re-added) */
.hero { margin-bottom: 32px; }
.hero h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.hero-sub { font-size: 14px; color: var(--text-muted); }


/* ── METRICS ── */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
}
@media (max-width: 680px) { .metrics { grid-template-columns: repeat(3, 1fr); } }

.metric {
  background: var(--bg-warm);
  padding: 20px 22px;
}
.metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.metric-value {
  font-family: 'Geist Mono', monospace;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1.5px;
  color: var(--ink);
  line-height: 1;
}
.metric-value.c-emerald { color: var(--emerald); }
.metric-value.c-amber   { color: var(--amber); }
.metric-value.c-red     { color: var(--red); }
.metric-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}


/* ── PROGRESS BAR ── */
.progress-section { margin-bottom: 40px; }
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.progress-pct {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
}
.progress-track {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}
.progress-done {
  background: var(--emerald);
  border-radius: 3px 0 0 3px;
  transition: width 1s var(--ease-out);
}
.progress-wip {
  background: var(--amber);
  transition: width 1s var(--ease-out);
}
.progress-blocked {
  background: var(--red);
  transition: width 1s var(--ease-out);
}
.progress-legend { display: flex; gap: 20px; margin-top: 12px; }
.progress-legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
}
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; }
.legend-swatch.done    { background: var(--emerald); }
.legend-swatch.wip     { background: var(--amber); }
.legend-swatch.blocked { background: var(--red); }
.legend-swatch.ns      { background: var(--slate); }


/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-chip {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-warm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.filter-chip.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}


/* ── SECTIONS ── */
.section-block {
  margin-bottom: 6px;
  animation: fadeUp 0.4s var(--ease-out) both;
}
.section-block:nth-child(1)  { animation-delay: 0s; }
.section-block:nth-child(2)  { animation-delay: 0.03s; }
.section-block:nth-child(3)  { animation-delay: 0.06s; }
.section-block:nth-child(4)  { animation-delay: 0.09s; }
.section-block:nth-child(5)  { animation-delay: 0.12s; }
.section-block:nth-child(6)  { animation-delay: 0.15s; }
.section-block:nth-child(7)  { animation-delay: 0.18s; }
.section-block:nth-child(8)  { animation-delay: 0.21s; }
.section-block:nth-child(9)  { animation-delay: 0.24s; }
.section-block:nth-child(10) { animation-delay: 0.27s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  text-align: left;
}
.section-trigger:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}
.section-trigger.open {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom-color: var(--border-soft);
}
.section-left  { display: flex; align-items: center; gap: 12px; }
.section-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 13px; flex-shrink: 0;
}
.section-name {
  font-size: 13px; font-weight: 700;
  color: var(--ink);
}
.section-right { display: flex; align-items: center; gap: 14px; }
.section-fraction {
  font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--text-muted);
}
.section-minibar {
  display: flex; width: 80px; height: 4px;
  border-radius: 2px; overflow: hidden;
  background: var(--surface);
}
.section-minibar .seg-done    { background: var(--emerald); }
.section-minibar .seg-wip     { background: var(--amber); }
.section-minibar .seg-blocked { background: var(--red); }
.section-chevron {
  font-size: 14px; color: var(--text-muted);
  transition: transform 0.25s var(--ease-out);
  width: 18px; text-align: center;
}
.section-trigger.open .section-chevron { transform: rotate(180deg); }

.section-body {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s var(--ease-out);
}
.section-body.open { max-height: 30000px; }
.section-body-inner { padding: 4px 12px 16px; }
.subsection-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); padding: 14px 8px 6px;
}


/* ── TASK ROW ── */
.task {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  gap: 14px; align-items: center;
  padding: 7px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.task:hover { background: var(--surface); }
.task-pip { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.task-pip.done    { background: var(--emerald); }
.task-pip.wip     { background: var(--amber); }
.task-pip.blocked { background: var(--red); }
.task-pip.ns      { background: var(--slate); }
.task-label { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.task.is-done .task-label {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--border);
}
.task-status {
  font-family: 'Geist Mono', monospace;
  font-size: 10px; font-weight: 600;
  padding: 3px 10px; border-radius: 4px;
  white-space: nowrap; letter-spacing: 0.3px;
}
.task-status.done    { background: var(--emerald-bg); color: var(--emerald); border: 1px solid var(--emerald-b); }
.task-status.wip     { background: var(--amber-bg);   color: var(--amber);   border: 1px solid var(--amber-b); }
.task-status.blocked { background: var(--red-bg);     color: var(--red);     border: 1px solid var(--red-b); }
.task-status.ns      { background: var(--slate-bg);   color: var(--text-muted); border: 1px solid var(--slate-b); }


/* ── LOADING / ERROR ── */
.loading-state { text-align: center; padding: 100px 20px; }
.loading-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; color: var(--text-muted); }
.error-state { text-align: center; padding: 100px 20px; color: var(--red); font-size: 14px; }


/* ── FOOTER ── */
.footer {
  margin-top: 64px; padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-muted);
}


/* ── VIEW TABS ── */
.view-toggle {
  display: flex; gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.view-tab {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 600;
  padding: 10px 20px;
  border: none; background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.view-tab:hover  { color: var(--text); }
.view-tab.active { color: var(--blue); border-bottom-color: var(--blue); }


/* ── GRAPH ── */
.graph-legend {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-bottom: 16px; font-size: 12px; font-weight: 500; color: var(--text-muted);
}
.gl-item { display: flex; align-items: center; gap: 6px; }
.gl-dot { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid; display: inline-block; }
.gl-ready {
  color: var(--emerald); font-weight: 600;
  background: var(--emerald-bg); padding: 2px 10px;
  border-radius: 4px; border: 1px solid var(--emerald-b);
}
.graph-hint {
  background: var(--amber-bg); border: 1px solid var(--amber-b);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 12px; color: var(--amber); margin-bottom: 16px;
}
.graph-hint code {
  font-family: 'Geist Mono', monospace;
  background: rgba(217,119,6,0.08); padding: 1px 5px; border-radius: 3px;
}
.chart-wrap {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-warm); overflow: auto; max-height: 68vh;
}
.graph-node .node-rect { transition: stroke 0.15s, stroke-width 0.15s; }
.graph-node { cursor: pointer; }
.graph-edge { fill: none; stroke: rgba(37,99,235,0.2); stroke-width: 1.5; }


/* ── DETAIL / EDIT PANEL ── */
.detail-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 199; opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}
.detail-backdrop.open { opacity: 1; pointer-events: auto; }
.detail-panel {
  position: fixed; right: 0; top: 0;
  width: 33vw; min-width: 340px; max-width: 520px; height: 100vh;
  background: var(--bg-warm);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-out);
  z-index: 200; overflow-y: auto;
  padding: 24px 28px 44px;
}
.detail-panel.open { transform: translateX(0); }
.detail-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  font-size: 13px; color: var(--text-muted);
  padding: 4px 8px; transition: all 0.15s; font-family: inherit;
}
.detail-close:hover { color: var(--ink); border-color: var(--border-hover); }
.detail-task-status { margin-top: 44px; }
.detail-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px; font-weight: 400; color: var(--ink);
  line-height: 1.25; margin: 8px 0 4px;
}
.detail-section-label { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.detail-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.detail-heading {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted); margin-bottom: 8px;
}
.detail-dep-row {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border-radius: 4px; padding: 6px 4px; transition: background 0.1s;
}
.detail-dep-row:hover { background: var(--surface); }
.detail-dep-icon { font-size: 11px; font-weight: 700; width: 16px; text-align: center; flex-shrink: 0; }
.detail-dep-icon.done    { color: var(--emerald); }
.detail-dep-icon.wip     { color: var(--amber); }
.detail-dep-icon.blocked { color: var(--red); }
.detail-dep-icon.ns      { color: var(--slate); }
.detail-dep-name {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-empty { font-size: 12px; color: var(--text-muted); font-style: italic; padding: 4px 0 8px; }
.detail-downstream {
  font-size: 11px; color: var(--text-muted);
  font-family: 'Geist Mono', monospace; margin-top: 8px; padding: 6px 0;
}
.detail-id-label {
  font-family: 'Geist Mono', monospace;
  font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
}


/* ── EDIT FORM ── */
.edit-field { margin-bottom: 16px; }
.edit-label {
  display: block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 6px;
}
.edit-select, .edit-input {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 500; color: var(--ink);
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); outline: none;
  transition: border-color 0.15s;
}
.edit-select:focus, .edit-input:focus, .edit-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.edit-textarea {
  font-family: 'Geist Mono', monospace;
  font-size: 12px; line-height: 1.6; color: var(--ink);
  width: 100%; min-height: 90px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); outline: none; resize: vertical;
  transition: border-color 0.15s;
}
.edit-save-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 700;
  width: 100%; padding: 10px 0;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius);
  cursor: pointer; transition: background 0.15s;
}
.edit-save-btn:hover { background: var(--blue-dark); }


/* ── DOCS ── */
.docs-layout {
  display: grid; grid-template-columns: 220px 1fr;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--bg-warm); min-height: 62vh;
}
.docs-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
}
.docs-sidebar-header {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-muted); padding: 16px 16px 10px;
}
.docs-file-list { flex: 1; }
.docs-file-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: background 0.1s; border-left: 2px solid transparent;
}
.docs-file-item:hover  { background: rgba(0,0,0,0.03); }
.docs-file-item.active {
  background: var(--bg-warm); color: var(--ink);
  font-weight: 600; border-left-color: var(--blue);
}
.docs-file-icon { font-size: 12px; flex-shrink: 0; color: var(--text-muted); }
.docs-sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.docs-action-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-warm);
  color: var(--text-2); cursor: pointer; text-align: left;
  transition: all 0.15s; width: 100%;
}
.docs-action-btn:hover { border-color: var(--border-hover); color: var(--ink); }
.docs-action-btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.docs-content-area { display: flex; flex-direction: column; min-height: 0; }
.docs-content-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0;
}
.docs-content-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 18px; font-weight: 400; color: var(--ink);
}
.docs-content-actions { display: flex; gap: 8px; }
.docs-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-warm);
  color: var(--text-2); cursor: pointer; transition: all 0.15s;
}
.docs-btn:hover { border-color: var(--border-hover); color: var(--ink); }
.docs-btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.docs-btn.danger  { color: var(--red); border-color: var(--red-b); }
.docs-body { padding: 28px 32px; overflow-y: auto; flex: 1; }
.docs-textarea {
  flex: 1; font-family: 'Geist Mono', monospace;
  font-size: 13px; line-height: 1.75; color: var(--ink);
  border: none; outline: none; resize: none;
  padding: 28px 32px; background: transparent;
  min-height: 480px; width: 100%;
}
.docs-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 60px 24px;
  color: var(--text-muted); height: 100%;
}
.docs-empty-icon { font-size: 24px; margin-bottom: 12px; opacity: 0.4; }
.docs-empty h3   { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.docs-empty p    { font-size: 13px; max-width: 340px; margin: 0 auto 20px; line-height: 1.5; }
.docs-fsa-note   { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.docs-save-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 8px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 300;
  opacity: 0; transition: opacity 0.2s, transform 0.2s var(--ease-out);
  pointer-events: none;
}
.docs-save-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ── SETTINGS ── */
.settings-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 8px;
  cursor: pointer; font-size: 14px; color: var(--text-muted);
  transition: all 0.15s; line-height: 1;
  display: flex; align-items: center; gap: 6px;
}
.settings-btn:hover { border-color: var(--border-hover); color: var(--ink); }
.settings-btn .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.settings-btn .dot.connected    { background: var(--emerald); }
.settings-btn .dot.disconnected { background: var(--slate); }
.settings-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--bg-warm); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 16px; width: 320px; z-index: 110; display: none;
}
.settings-dropdown.open { display: block; }
.settings-dropdown h4 { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.settings-dropdown p { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.settings-token-input {
  font-family: 'Geist Mono', monospace; font-size: 12px;
  width: 100%; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); outline: none; color: var(--ink);
  transition: border-color 0.15s;
}
.settings-token-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--accent-soft); }
.settings-save-btn {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  margin-top: 8px; padding: 6px 14px; border-radius: var(--radius);
  border: none; background: var(--blue); color: #fff;
  cursor: pointer; transition: background 0.15s;
}
.settings-save-btn:hover { background: var(--blue-dark); }
.settings-status { font-size: 11px; margin-top: 8px; color: var(--text-muted); }
.settings-status.ok { color: var(--emerald); }
.settings-wrap { position: relative; }


/* ── MARKDOWN ── */
.md-content { color: var(--text); line-height: 1.8; }
.md-content h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 28px; font-weight: 400; color: var(--ink);
  margin: 0 0 20px; letter-spacing: -0.5px; line-height: 1.15;
}
.md-content h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 20px; font-weight: 400; color: var(--ink);
  margin: 36px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.md-content h3 {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  margin: 24px 0 8px; text-transform: uppercase; letter-spacing: 1px;
}
.md-content h4 { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 16px 0 6px; }
.md-content p  { margin: 0 0 14px; font-size: 14px; }
.md-content ul, .md-content ol { margin: 0 0 14px; padding-left: 22px; }
.md-content li { font-size: 14px; margin-bottom: 5px; }
.md-content code {
  font-family: 'Geist Mono', monospace; font-size: 12px;
  background: var(--surface); padding: 2px 6px;
  border-radius: 3px; border: 1px solid var(--border-soft);
}
.md-content pre {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  overflow-x: auto; margin: 0 0 16px;
}
.md-content pre code { background: none; border: none; color: var(--text); font-size: 12px; padding: 0; }
.md-content blockquote {
  border-left: 2px solid var(--blue);
  padding: 2px 0 2px 16px; margin: 0 0 14px;
  color: var(--text-muted); font-style: italic;
}
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.md-content a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.md-content a:hover { color: var(--blue-dark); }
.md-content strong { font-weight: 700; color: var(--ink); }
.md-content em  { font-style: italic; }
.md-content del { text-decoration: line-through; color: var(--text-muted); }
.md-content table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 13px; }
.md-content th {
  background: var(--surface); font-weight: 600; text-align: left;
  padding: 8px 12px; border: 1px solid var(--border); color: var(--text-2);
}
.md-content td { padding: 7px 12px; border: 1px solid var(--border); }
.md-content tr:hover td { background: var(--surface); }
.md-content input[type=checkbox] { margin-right: 6px; }


/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .container { padding: 20px 16px 80px; }
  .top-bar-inner { padding: 12px 16px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .section-minibar { display: none; }
  .progress-legend { flex-wrap: wrap; gap: 12px; }
  .footer { flex-direction: column; gap: 8px; text-align: center; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  .detail-panel { width: 100vw; min-width: unset; max-width: unset; }
}
