/* Nodus web demo — dark-theme replica of the app shell. */
:root {
  --bg: #0a0a0a;
  --bg-soft: #171717;
  --card: #141414;
  --card-2: #1c1c1e;
  --border: #262626;
  --border-soft: rgba(64, 64, 64, 0.6);
  --text: #f5f5f5;
  --text-2: #a3a3a3;
  --text-3: #737373;
  --indigo: #6366f1;
  --indigo-soft: rgba(99, 102, 241, 0.16);
  --violet: #8b5cf6;
  --orange: #f97316;
  --green: #34d399;
  --cyan: #22d3ee;
  --amber: #fbbf24;
  --red: #f87171;
  --pink: #f472b6;
  --radius: 12px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
html { color-scheme: dark; scrollbar-width: thin; scrollbar-color: rgba(139,92,246,0.45) transparent; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
/* framed demo page: nav on top, app inside a macOS-style window */
body.demo-page {
  overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-rows: auto 1fr; min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(124,58,237,0.14), transparent),
    var(--bg);
}
.site-nav {
  display: flex; align-items: center; gap: 20px; align-self: start;
  padding: 12px max(24px, calc((100% - 1440px) / 2));
}
.site-nav .site-logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; }
.site-nav .site-logo img { width: 26px; height: 26px; }
.site-nav .site-links { margin-left: auto; display: flex; gap: 20px; align-items: center; font-size: 14px; font-weight: 500; }
.site-nav .site-links > a { color: var(--text-2); text-decoration: none; }
.site-nav .site-links > a:hover { color: var(--text); }
.site-gh {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 11px;
  border: 1px solid var(--border-soft); background: var(--card); color: var(--text) !important; font-size: 13px; font-weight: 600;
}
.site-gh:hover { border-color: rgba(167,139,250,0.5); }
.site-gh svg { width: 15px; height: 15px; fill: currentColor; }
.site-gh .stars { display: inline-flex; align-items: center; gap: 4px; padding-left: 9px; border-left: 1px solid var(--border-soft); color: var(--amber); }
.site-gh .stars svg { width: 12px; height: 12px; fill: var(--amber); }
.demo-frame {
  width: min(1500px, calc(100% - 40px)); justify-self: center; align-self: center;
  margin: 12px 0; border: 1px solid var(--border-soft);
  border-radius: 14px; overflow: hidden; background: var(--bg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(139,92,246,0.06);
}
.mac-titlebar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: #0e0e12; border-bottom: 1px solid var(--border); position: relative;
}
.mac-dots { display: inline-flex; gap: 7px; }
.mac-dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.mac-dots i:nth-child(1) { background: #ff5f57; }
.mac-dots i:nth-child(2) { background: #febc2e; }
.mac-dots i:nth-child(3) { background: #28c840; }
.mac-title { position: absolute; left: 0; right: 0; text-align: center; font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.demo-frame .shell { height: min(87vh, 1040px); }
@media (max-width: 720px) {
  .site-nav .site-links .hideS { display: none; }
  .demo-frame { margin: 8px 10px; border-radius: 12px; }
  .demo-frame .shell { height: 88vh; }
}
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.35); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(167,139,250,0.6); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: rgba(10,10,10,0.92); z-index: 5;
}
.topbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.topbar .brand img { width: 24px; height: 24px; }
.topbar .spacer { flex: 1; }
.topbar .tb-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: 13px;
}
.topbar .tb-btn svg { width: 14px; height: 14px; }
.topbar .tb-btn:hover { color: var(--text); background: var(--bg-soft); }
.topbar .tb-btn.primary { background: var(--indigo); color: #fff; font-weight: 600; }
.topbar .tb-btn.primary:hover { background: #575af0; }

.demo-banner {
  display: flex; align-items: center; gap: 10px; padding: 7px 16px; font-size: 12.5px;
  background: rgba(251, 191, 36, 0.08); color: #fcd34d; border-bottom: 1px solid rgba(251,191,36,0.18);
}
.demo-banner a { color: #fde68a; font-weight: 600; text-decoration: none; margin-left: auto; white-space: nowrap; }
.demo-banner a:hover { text-decoration: underline; }

.body { display: flex; flex: 1; min-height: 0; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 218px; flex-shrink: 0; overflow-y: auto; padding: 10px 8px 20px;
  border-right: 1px solid var(--border); background: rgba(12,12,12,0.7);
}
.nav-group-label {
  padding: 14px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-3);
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 7px 12px; margin: 1px 0; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); font-size: 13.5px;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active {
  background: var(--indigo-soft); color: #c7d2fe; border-color: rgba(99,102,241,0.35); font-weight: 600;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 30px 90px; }
.view-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.view-title svg { width: 20px; height: 20px; color: #a5b4fc; }
.view-sub { color: var(--text-2); margin: 0 0 22px; font-size: 13.5px; max-width: 760px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.card + .card { margin-top: 14px; }
/* inside a grid the gap already spaces cards — the sibling margin would
   push every card after the first out of alignment */
.grid > .card + .card { margin-top: 0; }
.grid > .card, .card { min-width: 0; }
.card h3 { margin: 0 0 6px; font-size: 14.5px; }
h3 svg, .nav-group-label svg, .modal-head svg { width: 15px; height: 15px; flex-shrink: 0; vertical-align: -2px; }
.card.click { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.card.click:hover { border-color: rgba(99,102,241,0.5); background: #17171c; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--border-soft); color: var(--text-2);
  background: var(--bg-soft); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chip.link { cursor: pointer; }
.chip.link:hover { border-color: var(--indigo); color: #c7d2fe; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }

.stat { font-size: 26px; font-weight: 700; }
.progress { height: 5px; border-radius: 3px; background: #262626; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; border-radius: 3px; background: var(--indigo); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 8px;
  border: 1px solid var(--border-soft); background: var(--bg-soft); color: var(--text);
  font-size: 12.5px; font-weight: 600;
}
.btn svg { width: 13px; height: 13px; }
.btn:hover { border-color: #525252; }
.btn.primary { background: var(--indigo); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #575af0; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* pill filter rows */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill {
  padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border-soft);
  background: var(--bg-soft); color: var(--text-2); font-size: 12.5px; font-weight: 600;
}
.pill:hover { color: var(--text); }
.pill.active { background: var(--indigo); border-color: transparent; color: #fff; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 8px 10px; color: var(--text-3); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border);
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid #1d1d1d; vertical-align: top; }
table.tbl tr:hover td { background: rgba(255,255,255,0.02); }
tr.rowlink { cursor: pointer; }

/* graph */
.graph-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: #0d0d10; overflow: hidden; }
#graph-canvas { display: block; width: 100%; height: 560px; cursor: grab; }
.legend {
  position: absolute; left: 14px; bottom: 14px; background: rgba(14,14,16,0.9);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 11.5px;
  color: var(--text-2); backdrop-filter: blur(6px);
}
.legend .row { display: flex; align-items: center; gap: 7px; margin: 2px 0; }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.legend .line { width: 14px; height: 2px; border-radius: 1px; }
.node-panel {
  position: absolute; right: 14px; top: 14px; width: 280px; background: rgba(16,16,20,0.96);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(8px);
  display: none;
}
.node-panel.open { display: block; }
.node-panel h4 { margin: 0 0 6px; font-size: 13.5px; }

/* debate */
.debate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.debate-col { border-radius: var(--radius); padding: 16px 18px; border: 1px solid; }
.debate-col.a { background: rgba(52, 211, 153, 0.05); border-color: rgba(52,211,153,0.25); }
.debate-col.b { background: rgba(248, 113, 113, 0.05); border-color: rgba(248,113,113,0.25); }
.timeline { margin-top: 14px; border-left: 2px solid var(--border); padding-left: 16px; }
.timeline .tl-item { position: relative; padding: 6px 0; }
.timeline .tl-item::before {
  content: ''; position: absolute; left: -21px; top: 13px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--violet);
}

/* immersion gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gallery .tile { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.gallery .tile:hover { border-color: rgba(99,102,241,0.5); transform: translateY(-2px); }
.gallery .tile img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.gallery .tile .meta { padding: 12px 14px; }

/* detail views (immersion session / report reader) */
.back-btn { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--text-2); background: none; border: none; font-size: 13px; font-weight: 600; padding: 4px 0; }
.back-btn:hover { color: var(--text); }
.back-btn svg { width: 14px; height: 14px; }

.session-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.session-head img { width: 300px; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.scope-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.scope-stat { padding: 8px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--border); text-align: center; }
.scope-stat b { display: block; font-size: 17px; }
.scope-stat span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

.step-item { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; margin-top: 10px; background: var(--card); }
.step-item.clickable { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.step-item.clickable:hover { border-color: rgba(99,102,241,0.5); background: #17171c; }
.step-item .step-chev { align-self: center; color: var(--text-3); flex-shrink: 0; }
.step-item .step-chev svg { width: 15px; height: 15px; }
.step-item.clickable:hover .step-chev { color: var(--violet-2); }
.station-body p { color: #d4d4d4; margin: 0 0 6px; }
.step-item.done { opacity: 0.75; }
.step-item .st-ic { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--indigo-soft); color: #a5b4fc; }
.step-item.done .st-ic { background: rgba(52,211,153,0.15); color: var(--green); }
.step-item .st-ic svg { width: 15px; height: 15px; }
.quote-block { margin: 8px 0 4px; padding: 10px 14px; border-left: 3px solid var(--violet); background: rgba(139,92,246,0.07); border-radius: 0 8px 8px 0; font-style: italic; font-size: 13px; }
.quote-block .src { display: block; margin-top: 4px; font-style: normal; font-size: 11.5px; color: #a5b4fc; }

/* quiz */
.quiz-opt { display: block; width: 100%; text-align: left; padding: 10px 14px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg-soft); color: var(--text); font-size: 13px; }
.quiz-opt:hover { border-color: var(--indigo); }
.quiz-opt.correct { border-color: var(--green); background: rgba(52,211,153,0.1); }
.quiz-opt.wrong { border-color: var(--red); background: rgba(248,113,113,0.08); }

/* report reader — a centred reading column, like the app's full-screen reader */
.report { max-width: 760px; margin: 0 auto; }
.report .back-btn { margin-bottom: 14px; }
.report .cover { width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); display: block; }
.report-title { text-align: center; margin: 22px 0 4px; }
.report-title h2 { font-size: 22px; margin: 0 0 6px; line-height: 1.25; }
.report-body { margin-top: 8px; }
.report-body h2 { font-size: 18px; margin: 28px 0 10px; }
.report h2 { font-size: 18px; }
.report p { color: #d4d4d4; margin: 0 0 4px; }
.cite-row { margin: 6px 0 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.cite { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--indigo-soft); color: #c7d2fe; font-size: 11.5px; cursor: pointer; border: 1px solid transparent; }
.cite:hover { border-color: var(--indigo); }
.reader-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; justify-content: center; }
.page-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; justify-content: center; }
.page-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

/* full-width list rows (Ideas / Argument routes) + toolbars */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 15px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer;
}
.list-row + .list-row { margin-top: 10px; }
.list-row:hover { border-color: rgba(99,102,241,0.5); background: #17171c; }
.list-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.list-main { flex: 1; min-width: 0; }
.list-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-title b { font-size: 14.5px; }
.list-desc { color: var(--text-2); font-size: 12.5px; margin: 5px 0 8px; }
.list-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.list-meta b { color: var(--text-2); font-weight: 600; }

.route-block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.route-block + .route-block { margin-top: 10px; }
.route-block:hover { border-color: rgba(99,102,241,0.35); }
.route-block.open { border-color: rgba(99,102,241,0.5); }
.route-row {
  display: flex; gap: 14px; align-items: flex-start; padding: 15px 18px; cursor: pointer;
}
.route-row:hover { background: #17171c; }
.route-chev { align-self: center; color: var(--text-3); transition: transform 0.2s ease; }
.route-chev svg { width: 15px; height: 15px; }
.route-block.open .route-chev { transform: rotate(90deg); color: var(--violet-2); }
.route-num { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--border); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }
.route-conn { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin: 5px 0; }
.route-neigh { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-detail { display: none; padding: 0 18px 14px 60px; border-top: 1px solid var(--border); background: rgba(255,255,255,0.015); }
.route-block.open .route-detail { display: block; animation: fadeIn 0.22s ease; }
.route-conn-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.route-conn-row:hover { background: var(--bg-soft); }
.route-conn-row .rc-idea { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; }
.route-conn-row .rc-open { flex-shrink: 0; display: inline-flex; align-items: center; gap: 3px; opacity: 0; }
.route-conn-row .rc-open svg { width: 12px; height: 12px; }
.route-conn-row:hover .rc-open { opacity: 1; }

/* gap cards (full-width, badge + actions, like the app) */
.gap-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px 18px; }
.gap-card + .gap-card { margin-top: 12px; }
.gap-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.gap-text { margin: 0; font-size: 14px; font-weight: 500; flex: 1; min-width: 0; }
.gap-type { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.gap-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.mentioned { margin: 0; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* writing */
.write-grid { display: grid; grid-template-columns: 220px 1fr 290px; gap: 16px; align-items: start; }
.draft-item { padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-size: 12.5px; }
.draft-item:hover { background: var(--bg-soft); }
.draft-item.active { background: var(--indigo-soft); border-color: rgba(99,102,241,0.35); }
.editor {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; min-height: 320px; font-size: 14.5px; line-height: 1.75; color: #e5e5e5;
}
.editor:focus { outline: 1px solid var(--indigo); }
.editor .cited { color: #a5b4fc; border-bottom: 1px dotted #6366f1; }
.editor .fresh { background: rgba(52,211,153,0.12); border-radius: 3px; animation: freshIn 0.6s ease; }
@keyframes freshIn { from { background: rgba(52,211,153,0.4); } }

/* argument map */
.arg-col { border-radius: var(--radius); border: 1px solid var(--border); padding: 14px 16px; background: var(--card); }
.arg-item { padding: 9px 12px; margin: 8px 0; border-radius: 9px; font-size: 13px; border: 1px solid; cursor: pointer; }
.arg-item:hover { filter: brightness(1.25); }
.arg-item.support { background: rgba(52,211,153,0.06); border-color: rgba(52,211,153,0.3); }
.arg-item.objection { background: rgba(248,113,113,0.06); border-color: rgba(248,113,113,0.3); }
.arg-item.rebuttal { background: rgba(251,191,36,0.06); border-color: rgba(251,191,36,0.3); }
.arg-item.plain { background: var(--bg-soft); border-color: var(--border); cursor: default; }
.thesis-box {
  padding: 14px 18px; border-radius: var(--radius); font-weight: 600; text-align: center;
  background: var(--indigo-soft); border: 1px solid rgba(99,102,241,0.4); margin-bottom: 16px;
}

/* search */
.search-input {
  width: 100%; padding: 11px 16px; border-radius: 11px; border: 1px solid var(--border-soft);
  background: var(--bg-soft); color: var(--text); font-size: 14px; font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--indigo); }
textarea.search-input { resize: vertical; min-height: 74px; line-height: 1.5; }

/* notes two-pane */
.notes-grid { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.note-item { padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.note-item svg { width: 13px; height: 13px; flex-shrink: 0; }
.note-item:hover { background: var(--bg-soft); color: var(--text); }
.note-item.active { background: var(--indigo-soft); color: #c7d2fe; }
.note-body { white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: #d4d4d4; }
.note-link { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; background: var(--indigo-soft); color: #c7d2fe; font-size: 12px; cursor: pointer; border: 1px solid transparent; }
.note-link:hover { border-color: var(--indigo); }
.note-link svg { width: 12px; height: 12px; flex-shrink: 0; }

/* settings */
.settings-grid { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.set-tab { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 12px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--text-2); font-size: 13px; }
.set-tab svg { width: 14px; height: 14px; }
.set-tab:hover { background: var(--bg-soft); color: var(--text); }
.set-tab.active { background: var(--indigo-soft); color: #c7d2fe; border-color: rgba(99,102,241,0.35); font-weight: 600; }
.settings-grid .card h3 { display: flex; align-items: center; gap: 8px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid #1d1d1d; }
.set-row:last-child { border-bottom: none; }
.set-row .lbl b { display: block; font-size: 13.5px; }
.set-row .lbl span { font-size: 12px; color: var(--text-3); }
.set-prov { display: flex; align-items: center; gap: 11px; min-width: 0; }
.prov-badge { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.switch { width: 36px; height: 20px; border-radius: 999px; background: #333; border: none; position: relative; transition: background 0.2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #999; transition: all 0.2s; }
.switch.on { background: var(--indigo); }
.switch.on::after { left: 18px; background: #fff; }
.select {
  padding: 6px 10px; border-radius: 8px; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border-soft); font-size: 12.5px; font-family: inherit;
}
.keymask { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-3); }
.danger-zone { border-color: rgba(248,113,113,0.35) !important; }

/* flashcards */
.flashcard {
  min-height: 190px; border-radius: 16px; border: 1px solid rgba(99,102,241,0.4);
  background: linear-gradient(140deg, rgba(99,102,241,0.1), rgba(139,92,246,0.04));
  display: grid; place-items: center; text-align: center; padding: 26px; font-size: 15.5px;
  cursor: pointer; user-select: none;
}
.flashcard .hint { display: block; margin-top: 12px; font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 60; padding: 24px; animation: fadeIn 0.18s ease;
}
.modal {
  width: min(640px, 100%); max-height: 84vh; overflow-y: auto; background: #131316;
  border: 1px solid var(--border-soft); border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6); animation: modalIn 0.22s cubic-bezier(0.2,0.9,0.3,1);
}
.modal.wide { width: min(860px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-x { background: none; border: none; color: var(--text-3); padding: 4px; border-radius: 6px; }
.modal-x:hover { color: var(--text); background: var(--bg-soft); }
.modal-x svg { width: 15px; height: 15px; }

/* bottom player (global, like the app) */
#bottom-player {
  position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 80px); opacity: 0;
  width: min(560px, calc(100vw - 32px)); z-index: 55;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px;
  background: rgba(22,22,26,0.96); border: 1px solid var(--border-soft);
  box-shadow: 0 14px 50px rgba(0,0,0,0.55); backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.2,0.9,0.3,1);
}
#bottom-player.open { transform: translate(-50%, 0); opacity: 1; }
#bottom-player .play {
  width: 36px; height: 36px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--indigo); color: #fff; display: grid; place-items: center;
}
#bottom-player .play svg { width: 15px; height: 15px; }
#bottom-player .bar { flex: 1; height: 4px; border-radius: 2px; background: #333; position: relative; cursor: pointer; }
#bottom-player .bar > div { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 2px; background: var(--violet); }
#bottom-player .time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
#bottom-player .tinfo { min-width: 0; flex: 1.4; }
#bottom-player .tinfo b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bottom-player .tinfo span { font-size: 11px; color: var(--text-3); }
#bottom-player .close { background: none; border: none; color: var(--text-3); padding: 4px; }
#bottom-player .close:hover { color: var(--text); }
#bottom-player .close svg { width: 13px; height: 13px; }

/* inline play button on list items */
.play-inline {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(99,102,241,0.4); background: var(--indigo-soft); color: #c7d2fe;
  font-size: 12px; font-weight: 600;
}
.play-inline svg { width: 11px; height: 11px; }
.play-inline:hover { background: rgba(99,102,241,0.28); }

/* assistant chat */
#chat-root .modal-overlay { z-index: 58; }
.chat-modal { display: flex; flex-direction: column; height: min(640px, 86vh); padding: 0; width: min(600px, 100%); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); }
.chat-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.chat-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-3); }
.chat-tools { display: flex; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--indigo); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.ai .tag-row { margin-top: 9px; }
.msg.hint { align-self: center; background: none; border: 1px dashed var(--border-soft); color: var(--text-3); font-size: 12px; text-align: center; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: tblink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes tblink { 0%, 60%, 100% { opacity: 0.25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.chat-input input {
  flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--bg-soft); color: var(--text); font-size: 13px; font-family: inherit;
}
.chat-input input:focus { outline: none; border-color: var(--indigo); }
.conv-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); margin-bottom: 8px; cursor: pointer;
}
.conv-row:hover { border-color: rgba(99,102,241,0.5); }
.conv-row .cv-t { flex: 1; min-width: 0; }
.conv-row .cv-t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row .cv-t span { font-size: 11px; color: var(--text-3); }

/* toast */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0;
  background: #1e1e22; border: 1px solid var(--border-soft); color: var(--text);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; pointer-events: none;
  transition: all 0.25s ease; z-index: 70; box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  max-width: min(480px, 90vw); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .write-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .set-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
  .notes-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { width: 62px; }
  /* Collapse only the SIDEBAR's group labels — content-area labels (e.g. the
     People view's generation headings, modal section titles) must stay visible. */
  .sidebar .nav-item span, .sidebar .nav-group-label { display: none; }
  .debate-grid { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 100px; }
}

/* ============================================================
   Visible vault switcher in the topbar
   ============================================================ */
.vault-tabs {
  display: flex; align-items: center; gap: 5px; flex: 1 1 auto; min-width: 0;
  padding: 2px; overflow-x: auto; scrollbar-width: none;
}
.vault-tabs::-webkit-scrollbar { display: none; }
.vault-tab {
  --vault-color: #6366f1;
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 30px;
  padding: 5px 9px; border: 1px solid var(--border-soft); border-radius: 999px;
  background: rgba(255,255,255,0.025); color: var(--text-2); text-decoration: none;
  font-size: 11.5px; font-weight: 650; line-height: 1; transition: border-color .18s, background .18s, color .18s, transform .18s;
}
.vault-tab::before {
  content: ''; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%;
  background: var(--vault-color); box-shadow: 0 0 8px color-mix(in srgb, var(--vault-color) 55%, transparent);
}
.vault-tab:hover {
  color: var(--text); border-color: color-mix(in srgb, var(--vault-color) 62%, var(--border-soft));
  background: color-mix(in srgb, var(--vault-color) 11%, transparent); transform: translateY(-1px);
}
.vault-tab:focus-visible { outline: 2px solid var(--vault-color); outline-offset: 2px; }
.vault-tab[aria-current="page"] {
  color: color-mix(in srgb, var(--vault-color) 32%, white); border-color: var(--vault-color);
  background: color-mix(in srgb, var(--vault-color) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vault-color) 30%, transparent), 0 0 14px color-mix(in srgb, var(--vault-color) 16%, transparent);
}
.vault-tab[aria-current="page"]::before { box-shadow: 0 0 10px var(--vault-color); }
.vault-tab.academic { --vault-color: #6366f1; }
.vault-tab.teach { --vault-color: #ea580c; }
.vault-tab.st { --vault-color: #0f766e; }
.vault-tab.gen { --vault-color: #ca8a04; }
.vault-tab.db { --vault-color: #b30333; }
.vault-tab.world { --vault-color: #8b5cf6; }
.vault-active-label {
  padding-left: 6px; border-left: 1px solid color-mix(in srgb, currentColor 38%, transparent);
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; }
  .vault-tabs { order: 3; flex: 1 0 100%; flex-wrap: wrap; overflow: visible; padding-left: 33px; }
}
@media (max-width: 720px) {
  .topbar { gap: 7px; padding: 8px 10px; }
  .topbar .tb-btn { padding: 6px 8px; font-size: 0; }
  .topbar .tb-btn svg { width: 15px; height: 15px; }
  .vault-tabs { padding-left: 0; gap: 4px; }
  .vault-tab { min-height: 28px; padding: 5px 8px; font-size: 10.5px; }
  .vault-active-label { display: none; }
}

/* ============================================================
   Genealogy demo — golden accent theme + record components
   ============================================================ */
.gen .nav-item.active { background: rgba(202,138,4,0.16); color: #fde68a; border-color: rgba(202,138,4,0.4); }
.gen .nav-item svg { opacity: 0.9; }
.gen .btn.primary, .gen .topbar .tb-btn.primary { background: #ca8a04; }
.gen .btn.primary:hover, .gen .topbar .tb-btn.primary:hover { background: #eab308; }
.gen .set-tab.active, .gen .note-item.active { background: rgba(202,138,4,0.16); color: #fde68a; border-color: rgba(202,138,4,0.4); }
.gen .card.click:hover, .gen .list-row:hover, .gen .step-item.clickable:hover { border-color: rgba(202,138,4,0.5); }
.gen .chip.link:hover { border-color: #ca8a04; color: #fde68a; }
.gen .view-title svg { color: #fbbf24; }
.gen .cite { background: rgba(202,138,4,0.16); color: #fde68a; }
.gen .cite:hover { border-color: #ca8a04; }
.gen .note-link { background: rgba(202,138,4,0.16); color: #fde68a; }
.gen .quote-block { border-left-color: #ca8a04; background: rgba(202,138,4,0.06); }
.gen .quote-block .src { color: #fcd34d; }
.gen .switch.on { background: #ca8a04; }
.gen .editor:focus, .gen .search-input:focus { outline-color: #ca8a04; border-color: #ca8a04; }
.gen ::selection { background: rgba(202,138,4,0.3); }
.gen .report .cover { max-height: 240px; filter: sepia(0.15); }

/* Safety net: any raw inline icon dropped into a modal/report text flow is capped,
   so an un-sized SVG can never blow up. The known-large SVGs are exempted. */
.modal svg:not(.gp-portrait):not(.gp-tree):not(.gp-fr),
.report svg:not(.gp-tree) { max-width: 20px; max-height: 20px; }

/* size the raw inline icons that sit outside the pre-sized contexts */
.gp-statlabel { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.gp-statlabel svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.gen .chip svg { width: 12px; height: 12px; flex-shrink: 0; }
.gen .list-meta svg { width: 13px; height: 13px; flex-shrink: 0; vertical-align: -2px; }
.gen .page-nav svg { width: 14px; height: 14px; flex-shrink: 0; }
.gen .gp-rel .chip svg { width: 12px; height: 12px; }
.gp-repo { display: flex; align-items: center; gap: 6px; }
.gp-repo svg { width: 14px; height: 14px; flex-shrink: 0; }

.gp-portrait { flex-shrink: 0; }
.gp-portrait.faded { opacity: 0.65; }
.gp-person { display: flex; align-items: center; gap: 12px; }
.gp-name { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-q { color: var(--amber); font-weight: 700; }
.gp-doc { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: rgba(202,138,4,0.12); color: #fcd34d; }
.gp-doc svg { width: 16px; height: 16px; }

/* person dossier events */
.gp-event { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.gp-event:hover { border-color: rgba(202,138,4,0.5); background: #17140d; }
.gp-event-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.gp-event .gp-src { color: var(--text-3); flex-shrink: 0; }
.gp-event .gp-src svg { width: 15px; height: 15px; }
.gp-fact { display: flex; align-items: flex-start; gap: 9px; padding: 6px 2px; font-size: 13px; color: #d4d4d4; }
.gp-fact svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: #86efac; }
.gp-conflict { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.28); font-size: 12.5px; color: #fcd34d; margin: 10px 0; }
.gp-conflict svg { width: 16px; height: 16px; flex-shrink: 0; }
.gp-kin { padding: 11px 13px; border-radius: 10px; border: 1px solid rgba(202,138,4,0.28); background: rgba(202,138,4,0.06); margin-top: 8px; }
.gp-strength { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid; margin-left: 6px; }
.gp-strength.baja, .gp-strength.low { color: var(--text-3); border-color: var(--border); }
.gp-strength.media { color: var(--amber); border-color: rgba(251,191,36,0.4); }
.gp-strength.alta { color: var(--green); border-color: rgba(52,211,153,0.4); }

/* social relations rows */
.gp-rel { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #1d1d1d; font-size: 13px; }
.gp-rel:last-child { border-bottom: none; }
.gp-rel > .chip { flex-shrink: 0; }
.gp-rel b { flex-shrink: 0; }
.gp-rel .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-icon-btn { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--text-3); }
.gp-icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.gp-icon-btn.danger:hover { color: var(--red); }
.gp-icon-btn svg { width: 15px; height: 15px; }

/* family tree */
.gp-tree-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: #0e0c09; padding: 10px; overflow-x: auto; }
.gp-tree { width: 100%; min-width: 760px; height: auto; display: block; }
.gp-tnode { cursor: pointer; }
.gp-tnode.contact { cursor: default; }
.gp-tnode:not(.contact):hover rect { filter: brightness(1.35); }

/* timeline */
.gp-timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 0; }
.gp-tl-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 12px 12px 20px; position: relative; cursor: pointer; border-radius: 0 10px 10px 0; }
.gp-tl-item:hover { background: rgba(202,138,4,0.05); }
.gp-tl-dot { position: absolute; left: -7px; top: 18px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg); }
.gp-tl-year { font-size: 15px; font-weight: 700; color: #fcd34d; width: 46px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* map */
.gp-map { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: start; }
.gp-map-frame {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius); border: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 35% 20%, rgba(202,138,4,0.06), transparent),
    linear-gradient(160deg, #12100b, #0c0b08);
  overflow: hidden;
}
.gp-map-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.gp-map-lines polyline { fill: none; stroke: rgba(202,138,4,0.5); stroke-width: 0.5; stroke-dasharray: 2 2; }
.gp-pin { position: absolute; transform: translate(-50%, -100%); background: none; border: none; color: #fbbf24; display: flex; flex-direction: column; align-items: center; }
.gp-pin svg { width: 26px; height: 26px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5)); }
.gp-pin.origin svg { color: #34d399; }
.gp-pin.emigration svg { color: #f59e0b; }
.gp-pin-label { font-size: 11px; color: var(--text); background: rgba(14,12,9,0.85); border: 1px solid var(--border-soft); border-radius: 7px; padding: 1px 7px; margin-top: 2px; display: inline-flex; gap: 5px; white-space: nowrap; }
.gp-pin-label b { color: #fcd34d; }
.gp-pin:hover svg { transform: scale(1.12); }

@media (max-width: 860px) {
  .gp-map { grid-template-columns: 1fr; }
}

/* ============================================================
   Genealogy demo v2.0.3 — views rebuilt to mirror the real app
   (Serrano family). These append after the earlier .gp-* rules
   and intentionally override them where names are reused.
   ============================================================ */
.gen .main { padding: 0; display: flex; flex-direction: column; }
.gp-viewroot { flex: 1; min-height: 0; }
.gp-viewroot.gp-scroll { overflow-y: auto; padding: 24px 30px 90px; }
.gp-viewroot.gp-full { overflow: hidden; display: flex; flex-direction: column; }
.gp-viewroot.gp-full > .gp-people, .gp-viewroot.gp-full > .gp-archive { flex: 1; min-height: 0; }
.gp-viewroot.gp-full > .gp-tree-head { flex-shrink: 0; }
.gp-viewroot.gp-full > .gp-tree-canvas { flex: 1; min-height: 0; }

/* People two-pane */
.gp-people, .gp-archive, .gp-tree-full { height: 100%; min-height: 0; }
.gp-people { display: grid; grid-template-columns: 340px 1fr; }
.gp-people-list { border-right: 1px solid var(--border); padding: 20px 16px; overflow-y: auto; }
.gp-plist { margin-top: 10px; }
.gp-prow { padding: 9px 8px; border-bottom: 1px solid #1d1d1d; cursor: pointer; border-radius: 6px; }
.gp-prow:hover { background: var(--bg-soft); }
.gp-prow.active { background: rgba(202,138,4,0.14); }
.gp-prow b { display: block; font-size: 14px; }
.gp-people-detail { overflow-y: auto; }
.gp-empty { height: 100%; display: grid; place-items: center; color: var(--text-2); font-size: 14px; padding: 40px; text-align: center; }

.gp-ficha-portrait { flex-shrink: 0; }
.gp-ficha-portrait svg { display: block; }

/* dossier / detail events (override earlier) */
.gp-event { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; }
.gp-event[onclick] { cursor: pointer; }
.gp-event[onclick]:hover { border-color: rgba(202,138,4,0.5); background: #17140d; }
.gp-event-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.gp-src { color: var(--text-3); flex-shrink: 0; }
.gp-src svg { width: 15px; height: 15px; }
.gp-source { padding: 10px 13px; border-radius: 8px; background: rgba(202,138,4,0.08); border: 1px solid rgba(202,138,4,0.25); font-size: 13px; color: #fcd34d; margin: 4px 0; }
.gp-meta { display: flex; gap: 10px; padding: 5px 2px; font-size: 13px; border-bottom: 1px solid #1d1d1d; }
.gp-meta-k { color: var(--text-3); min-width: 120px; flex-shrink: 0; }

/* home */
.gp-next { border-color: rgba(202,138,4,0.3) !important; background: rgba(202,138,4,0.05); }
.gp-mini { display: flex; gap: 10px; margin-top: 8px; }
.gp-mini span { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; color: var(--text-2); }
.gp-mini b { color: var(--text); font-size: 15px; }
.gp-amber { color: #fde68a; border-color: rgba(202,138,4,0.4); background: rgba(202,138,4,0.14); }

/* tree */
.gp-tree-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gp-tree-canvas { padding: 16px; overflow: auto; background: rgba(10,10,10,0.4); }
.gp-tnode { cursor: pointer; }
.gp-tnode:hover > rect:first-of-type { filter: brightness(1.08); }

/* timeline (override earlier) */
.gp-timeline { border-left: 2px solid var(--border); margin-left: 8px; }
.gp-tl-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 12px 12px 20px; position: relative; border-radius: 0 10px 10px 0; }
.gp-tl-item[onclick] { cursor: pointer; }
.gp-tl-item[onclick]:hover { background: rgba(202,138,4,0.05); }
.gp-tl-dot { position: absolute; left: -7px; top: 18px; width: 11px; height: 11px; border-radius: 50%; background: #d4a017; border: 2px solid var(--bg); }
.gp-tl-year { font-size: 14px; font-weight: 700; color: #fcd34d; min-width: 130px; width: auto; flex-shrink: 0; }
.gp-fakeselect { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.gp-fakeselect svg { width: 13px; height: 13px; }

/* archive */
.gp-archive { display: grid; grid-template-columns: 240px 1fr; }
.gp-arch-folders { border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; }
.gp-folder { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.gp-folder svg { width: 15px; height: 15px; flex-shrink: 0; }
.gp-folder:hover { background: var(--bg-soft); color: var(--text); }
.gp-folder.active { background: rgba(202,138,4,0.14); color: #fde68a; }
.gp-arch-main { padding: 18px 20px; overflow: auto; min-width: 0; }
.gp-arch-tbl { margin-top: 6px; }
.gp-arch-tbl b { font-weight: 600; }
.gp-doc-i { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(202,138,4,0.12); color: #fcd34d; flex-shrink: 0; }
.gp-doc-i svg { width: 15px; height: 15px; }

/* map */
.gp-leaflet { height: 600px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.leaflet-container { background: #0d0d10 !important; font-family: var(--sans); }
.gp-pin-wrap { position: relative; }
.gp-pin2 { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fbbf24; border: 2px solid #78350f; box-shadow: 0 0 0 4px rgba(251,191,36,0.22); }
.gp-pin-lab { position: absolute; left: 14px; top: -9px; white-space: nowrap; background: rgba(14,12,9,0.92); border: 1px solid var(--border-soft); border-radius: 8px; padding: 3px 9px; font-size: 12px; color: var(--text); }
.gp-pin-lab b { color: #fcd34d; }

/* relations node graph */
.gp-relwrap { position: relative; height: 600px; border-radius: var(--radius); border: 1px solid var(--border); background: #0d0d10; overflow: hidden; }
.gp-relwrap canvas { width: 100%; height: 100%; display: block; }
.gp-leg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }

/* suggestions (override earlier) */
.gp-kin { padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(202,138,4,0.28); background: rgba(202,138,4,0.06); margin-top: 10px; }
.gp-strength { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid; margin-left: 6px; }
.gp-strength.high { color: var(--green); border-color: rgba(52,211,153,0.4); }
.gp-fact { display: flex; gap: 9px; padding: 6px 2px; font-size: 13px; color: #d4d4d4; }
.gp-fact svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: #fcd34d; }

@media (max-width: 860px) {
  .gp-people, .gp-archive { grid-template-columns: 1fr; }
  .gen .main > .gp-viewroot > * { margin-left: 14px; margin-right: 14px; }
}

/* home card title icons (keep the bulb etc. from blowing up) */
.gp-cardt { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.gp-cardt svg { width: 16px; height: 16px; flex-shrink: 0; }
/* genealogy settings tabs use inline icons like the academic demo */
.gen .set-tab svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ============================================================
   Databases demo — crimson accent theme + typed-table components
   ============================================================ */
.db { --db: #B30333; --db-2: #d81f4f; --db-soft: rgba(179,3,51,0.16); }
.db .nav-item.active { background: var(--db-soft); color: #f9a8b8; border-color: rgba(179,3,51,0.4); }
.db .nav-item svg { opacity: 0.9; }
.db .btn.primary, .db .topbar .tb-btn.primary { background: var(--db); }
.db .btn.primary:hover, .db .topbar .tb-btn.primary:hover { background: var(--db-2); }
.db .set-tab.active, .db .note-item.active { background: var(--db-soft); color: #f9a8b8; border-color: rgba(179,3,51,0.4); }
.db .card.click:hover, .db .list-row:hover { border-color: rgba(179,3,51,0.5); background: #17171c; }
.db .pill.active { background: var(--db); border-color: transparent; }
.db .switch.on { background: var(--db); }
.db .search-input:focus { outline-color: var(--db); border-color: var(--db); }
.db .view-title svg { color: var(--db-2); }
.db .note-link { background: var(--db-soft); color: #f9a8b8; }
.db ::selection { background: rgba(179,3,51,0.32); }
.db .main { padding: 0; display: flex; flex-direction: column; }
.db-viewroot.db-scroll { padding: 24px; overflow-y: auto; }
.db-viewroot.db-full { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.db-cardt { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.db-cardt svg { width: 16px; height: 16px; flex-shrink: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* home cards */
.db-hcard-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.db-hcard-top b { font-size: 15px; }
.db-hicon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--db-soft); color: #f9a8b8; flex-shrink: 0; }
.db-hicon svg { width: 15px; height: 15px; }
.db-hicon.sm { width: 20px; height: 20px; } .db-hicon.sm svg { width: 12px; height: 12px; }
.db-sid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; color: var(--text-3); background: var(--card-2); border-radius: 5px; padding: 1px 6px; margin-left: auto; }
.db-hcard, .db-wcard { min-height: 74px; }

/* ---- table header + head bar ---- */
.db-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.db-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.db-head-l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.db-head-title { font-size: 18px; }
.db-head-r { margin-left: auto; }
.db-head-r .pill { display: inline-flex; align-items: center; gap: 5px; }
.db-head-r .pill svg { width: 13px; height: 13px; }
.db-toggle { display: inline-flex; border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.db-toggle button { background: transparent; border: none; color: var(--text-2); padding: 5px 9px; display: inline-flex; align-items: center; cursor: pointer; }
.db-toggle button svg { width: 14px; height: 14px; }
.db-toggle button.on { background: var(--db); color: #fff; }
.db-toggle.sm button { padding: 3px 10px; font-size: 12px; font-weight: 600; }
.db-tabs { display: flex; align-items: center; gap: 6px; padding: 7px 18px; border-bottom: 1px solid var(--border); }
.db-tab { font-size: 12px; padding: 3px 10px; border-radius: 7px; background: var(--card-2); color: var(--text); }
.db-tab-add { color: var(--text-3); display: inline-flex; cursor: pointer; } .db-tab-add svg { width: 13px; height: 13px; }

/* ---- table grid ---- */
.db-tablewrap { flex: 1; min-height: 0; overflow: auto; }
.db-trow { display: flex; align-items: stretch; }
.db-thead { position: sticky; top: 0; z-index: 5; background: #121215; border-bottom: 1px solid var(--border); }
.db-brow { border-bottom: 1px solid #1a1a1a; min-height: 40px; }
.db-brow:hover { background: rgba(255,255,255,0.02); }
.db-gutter { width: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 2px; }
.db-rowbtn { opacity: 0; background: none; border: none; color: var(--text-3); padding: 2px; cursor: pointer; transition: opacity 0.12s, color 0.12s; }
.db-rowbtn svg { width: 13px; height: 13px; }
.db-brow:hover .db-rowbtn { opacity: 1; }
.db-rowbtn:hover { color: #f9a8b8; } .db-rowbtn.del:hover { color: var(--red); }
.db-cell { flex-shrink: 0; padding: 8px 10px; display: flex; align-items: center; gap: 4px; overflow: hidden; border-right: 1px solid #171717; }
.db-hcell { color: var(--text-2); font-size: 12px; font-weight: 600; }
.db-tico { display: inline-flex; align-items: center; color: var(--text-3); } .db-tico svg { width: 13px; height: 13px; }
.db-th { font-weight: 800; font-size: 12px; color: var(--text-3); font-family: Georgia, serif; }
.db-hname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-addcol { width: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.db-addcol svg { width: 14px; height: 14px; }
.db-tcell { font-size: 13px; }
.db-tcell b { font-weight: 600; }
.db-t-number { justify-content: flex-end; } .db-t-number .db-num { font-variant-numeric: tabular-nums; }
.db-t-checkbox { justify-content: center; }
.db-txt { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-date { color: var(--text-2); font-variant-numeric: tabular-nums; }
.db-chip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }
.db-rel { color: #f9a8b8; background: rgba(179,3,51,0.12); border: 1px solid rgba(179,3,51,0.4); }
.db-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.db-check.on { background: var(--db); border-color: var(--db); }
.db-check svg { width: 11px; height: 11px; color: #fff; }
.db-att-empty, .db-ai-empty { color: var(--text-3); } .db-att-empty svg, .db-ai-empty svg { width: 14px; height: 14px; }

/* ---- gallery ---- */
.db-gallery-bar { display: flex; align-items: center; gap: 8px; padding: 10px 18px; }
.db-colnum { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 2px 8px; color: var(--text-2); }
.db-colnum svg { width: 12px; height: 12px; }
.db-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0 18px 18px; overflow-y: auto; }
.db-gcard { border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; transition: border-color 0.12s; }
.db-gcard:hover { border-color: rgba(179,3,51,0.5); }
.db-gthumb { height: 74px; border-radius: 8px; background: var(--card-2); display: flex; align-items: center; justify-content: center; color: #3f3f46; margin-bottom: 10px; }
.db-gthumb svg { width: 26px; height: 26px; }
.db-gtitle { display: block; font-size: 14px; margin-bottom: 8px; }

/* ---- record ficha ---- */
.db-ficha-title { font-size: 22px; margin: 4px 0 14px; }
.db-fields { display: flex; flex-direction: column; }
.db-frow { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid #1c1c1c; }
.db-flabel { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.db-flabel svg { width: 14px; height: 14px; color: var(--text-3); } .db-flabel .db-th { color: var(--text-3); }
.db-field-in { background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; font-size: 13.5px; }
.db-field-chips { padding: 4px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.db-drop { height: 68px; border: 1.5px dashed var(--border-soft); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.db-drop svg { width: 18px; height: 18px; }
.db-ai-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; }
.db-wand { background: none; border: none; color: #f9a8b8; cursor: pointer; padding: 3px; } .db-wand svg { width: 16px; height: 16px; }

/* ---- analysis ---- */
.db-profile { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 18px; }
.db-pcard { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: var(--card); }
.db-pname { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 6px; }
.db-pname svg { width: 13px; height: 13px; color: var(--text-3); } .db-pname .db-th { color: var(--text-3); }
.db-pfill { font-size: 12px; color: var(--text-2); }
.db-psub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.db-dist { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.db-dist > .card { margin-top: 0; }
.db-barcard { padding: 14px 16px; }
.db-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.db-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.db-bar-l { width: 92px; flex-shrink: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.db-bar-track { flex: 1; height: 15px; background: #1e1e22; border-radius: 4px; overflow: hidden; }
.db-bar-fill { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.db-bar-n { width: 22px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.db-hist .db-bar-l { width: 96px; }
.db-suggest { margin-bottom: 14px; }
.db-manual { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.db-manual label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-2); }
.db-manual .select { min-width: 190px; }
.db-ancard { margin-top: 14px; }
.db-statscroll { overflow-x: auto; margin-top: 6px; }
.db-stattbl th, .db-stattbl td { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.db-stattbl th:first-child, .db-stattbl td:first-child { text-align: left; }
.db-box { margin-top: 12px; max-width: 560px; }
.db-cor-wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; margin-top: 8px; }
.db-cortbl th, .db-cortbl td { text-align: center; }
.db-cor-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.db-scatter { border: 1px solid var(--border); border-radius: 10px; background: var(--card); }

/* ---- search rows ---- */
.db-srow { cursor: pointer; }
.db-srow .list-title { display: flex; align-items: center; gap: 8px; }

/* ---- data chat ---- */
.db-chat-view { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 20px 24px 0; }
.db-chat-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.db-cpill { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border-soft); background: transparent; color: var(--text-2); cursor: pointer; }
.db-cpill.active { background: var(--db); border-color: transparent; color: #fff; }
.db-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 2px; }
.db-chat-empty { margin: auto; text-align: center; max-width: 520px; }
.db-chat-icon { display: inline-flex; color: #3f3f46; } .db-chat-icon svg { width: 30px; height: 30px; }
.db-chat-sugs { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.db-sug { text-align: center; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 13.5px; cursor: pointer; }
.db-sug:hover { border-color: rgba(179,3,51,0.5); }
.db .msg.user { background: var(--db); }
.db-chat-input { display: flex; gap: 8px; padding: 12px 0 18px; }
.db-chat-input input { flex: 1; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; font-family: inherit; }
.db-chat-input input:focus { outline: none; border-color: var(--db); }

@media (max-width: 860px) {
  .db-frow { grid-template-columns: 1fr; gap: 6px; }
  .db .main > .db-viewroot.db-scroll { padding: 16px; }
}

/* ============================================================
   Study demo — teal accent theme + study components.
   Teal (#0f766e) is the colour the app itself gives the study
   vault (VAULT_TYPE_COLOR.estudio), so the demo matches it.
   ============================================================ */
.st { --teal: #0f766e; --teal-2: #2dd4bf; --teal-soft: rgba(45,212,191,0.14); }
.st .nav-item.active { background: var(--teal-soft); color: #99f6e4; border-color: rgba(45,212,191,0.4); }
.st .nav-item svg { opacity: 0.9; }
.st .btn.primary, .st .topbar .tb-btn.primary { background: var(--teal); }
.st .btn.primary:hover, .st .topbar .tb-btn.primary:hover { background: #0d9488; }
.st .pill.active { background: var(--teal); border-color: transparent; }
.st .set-tab.active, .st .note-item.active { background: var(--teal-soft); color: #99f6e4; border-color: rgba(45,212,191,0.4); }
.st .card.click:hover, .st .list-row:hover { border-color: rgba(45,212,191,0.45); background: #12181a; }
.st .chip.link:hover { border-color: var(--teal-2); color: #99f6e4; }
.st .view-title svg { color: var(--teal-2); }
.st .cite { background: var(--teal-soft); color: #99f6e4; }
.st .cite:hover { border-color: var(--teal-2); }
.st .note-link { background: var(--teal-soft); color: #99f6e4; }
.st .quote-block { border-left-color: var(--teal); background: rgba(45,212,191,0.06); }
.st .quote-block .src { color: #5eead4; }
.st .switch.on { background: var(--teal); }
.st .search-input:focus { outline-color: var(--teal-2); border-color: var(--teal-2); }
.st .msg.user { background: var(--teal); }
.st ::selection { background: rgba(45,212,191,0.3); }
.st .progress > div { background: var(--teal-2); }

.st .main { padding: 0; display: flex; flex-direction: column; }
.st-viewroot { flex: 1; min-height: 0; }
.st-viewroot.st-scroll { overflow-y: auto; padding: 24px 30px 90px; }
.st-viewroot.st-full { overflow: hidden; display: flex; flex-direction: column; }
.st-kicker { margin: 0 0 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal-2); }
.st-cardt { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.st-cardt svg { width: 16px; height: 16px; flex-shrink: 0; }
.st-mark { display: grid; place-items: center; border-radius: 8px; flex-shrink: 0; }
.st-mark svg { width: 55%; height: 55%; }
.st-mini { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.st-mini b { color: var(--text-2); }
.st .chip.st-teal { border-color: rgba(45,212,191,0.4); color: #5eead4; }
.st .chip.st-amber { border-color: rgba(251,191,36,0.4); color: #fcd34d; }
.st .chip.st-index { border-color: rgba(45,212,191,0.35); color: #5eead4; }
.st .chip.st-index svg { width: 12px; height: 12px; }

/* home */
.st-hero { border: 1px solid rgba(45,212,191,0.28); border-radius: 16px; padding: 18px 22px; margin-bottom: 14px;
  background: linear-gradient(140deg, rgba(15,118,110,0.18), rgba(45,212,191,0.03)); }
.st-hero-t { font-size: 22px; font-weight: 700; margin: 0; }
.st-hero-b { margin: 6px 0 0; color: var(--text-2); font-size: 13.5px; max-width: 720px; }
.st-next { border-color: rgba(45,212,191,0.3); }
.st-dest { display: block; }
.st-dest-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--teal-soft); color: #5eead4; }
.st-dest-ic svg { width: 17px; height: 17px; }
.st-recent { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #1d1d1d; cursor: pointer; }
.st-recent:hover { color: #99f6e4; }
.st-recent > svg { width: 15px; height: 15px; color: #5eead4; flex-shrink: 0; }
.st-recent-t { flex: 1; min-width: 0; }
.st-recent-t b { display: block; font-size: 13px; }

/* browser rows */
.st-crumbs { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.st-crumb { background: none; border: none; color: var(--text-2); font-size: 13px; font-weight: 600; padding: 2px 0; }
.st-crumb:hover, .st-crumb.active { color: #99f6e4; }
.st-crumb-sep { color: var(--text-3); }
.st-row-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-row-txt { min-width: 0; }
.st-row-txt b { display: block; font-size: 13.5px; }
.st-doc-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: var(--teal-soft); color: #5eead4; }
.st-doc-ic svg { width: 15px; height: 15px; }
.st-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.st-ib { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--text-3); }
.st-ib:hover { background: var(--bg-soft); color: var(--text); }
.st-ib.danger:hover { color: var(--red); }
.st-ib svg { width: 13px; height: 13px; }

/* schedule grid */
.st-grid { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
.st-grid th, .st-grid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.st-grid th:last-child, .st-grid td:last-child { border-right: none; }
.st-grid thead th { padding: 12px 10px; font-size: 12.5px; font-weight: 600; background: rgba(23,23,23,0.6); }
.st-period-h { width: 230px; text-align: left !important; font-size: 10.5px !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.st-period { width: 230px; padding: 12px; text-align: left; vertical-align: top; background: rgba(23,23,23,0.45); display: flex; gap: 8px; align-items: flex-start; }
.st-secbadge { flex-shrink: 0; margin-top: 2px; font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.st-secbadge.morning { background: rgba(251,191,36,0.15); color: #fcd34d; }
.st-secbadge.afternoon { background: rgba(129,140,248,0.15); color: #a5b4fc; }
.st-period-t b { display: block; font-size: 13px; }
.st-sec-break > th, .st-sec-break > td { border-top: 3px solid #3f3f46; }
.st-cell { width: 100%; min-height: 62px; display: flex; align-items: center; gap: 8px; padding: 8px; margin: 6px; width: calc(100% - 12px);
  border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-3); font-size: 12px; text-align: left; }
.st-cell:hover { border-color: rgba(45,212,191,0.5); color: var(--text); }
.st-cell svg { width: 12px; height: 12px; }
.st-cell.has { color: var(--text); font-weight: 600; border-color: color-mix(in srgb, var(--sc) 45%, transparent); background: color-mix(in srgb, var(--sc) 12%, transparent); }
.st-cell.has span:last-child { min-width: 0; }
.st-style { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--sc) 7%, transparent); }
.st-swatch { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border-soft); flex-shrink: 0; }

/* calendar */
.st-calbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.st-caltitle { margin: 0 0 0 6px; font-size: 16px; text-transform: capitalize; }
.st-segments { margin-left: auto; display: inline-flex; padding: 2px; border-radius: 10px; border: 1px solid var(--border); }
.st-seg { padding: 5px 12px; border-radius: 8px; border: none; background: none; color: var(--text-2); font-size: 12px; }
.st-seg.active { background: var(--teal); color: #fff; }
.st-calhead { display: grid; grid-template-columns: repeat(7, 1fr); background: rgba(23,23,23,0.6); border-bottom: 1px solid var(--border); }
.st-calhead span { padding: 8px; text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-3); }
.st-calgrid { display: grid; grid-template-columns: repeat(7, 1fr); }
.st-calcell { min-height: 92px; min-width: 0; overflow: hidden; padding: 6px; text-align: left; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.st-calcell:hover { background: rgba(45,212,191,0.05); }
.st-calcell.off { background: rgba(10,10,10,0.5); color: var(--text-3); }
.st-caldate { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; flex-shrink: 0; }
.st-caldate.today { background: var(--teal); color: #fff; font-weight: 700; }
.st-calevs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-evchip { display: flex; align-items: center; gap: 5px; width: 100%; max-width: 100%; padding: 2px 6px; border-radius: 6px; border: none; background: var(--bg-soft);
  color: var(--text-2); font-size: 10px; text-align: left; overflow: hidden; }
.st-evchip:hover { color: var(--text); }
.st-evchip .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.st-evchip-t { min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Safety net: raw inline icons dropped into study text flow must stay small. */
.st .list-meta svg { width: 13px; height: 13px; flex-shrink: 0; vertical-align: -2px; }
.st .muted svg { width: 14px; height: 14px; flex-shrink: 0; vertical-align: -2px; }
.st .chip svg { width: 12px; height: 12px; flex-shrink: 0; vertical-align: -2px; }
.st-week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); min-width: 900px; }
.st-week section { border-right: 1px solid var(--border); min-height: 380px; }
.st-week section:last-child { border-right: none; }
.st-weekhead { padding: 10px; text-align: center; border-bottom: 1px solid var(--border); }
.st-weekhead strong { display: grid; place-items: center; width: 30px; height: 30px; margin: 4px auto 0; border-radius: 50%; }
.st-weekhead strong.today { background: var(--teal); color: #fff; }
.st-weekbody { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.st-weekev { text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.st-weekev:hover { border-color: rgba(45,212,191,0.5); }
.st-weekev b { display: block; font-size: 12px; }

/* search */
.st-searchbar { position: relative; }
.st-searchic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.st-searchic svg { width: 16px; height: 16px; }
.st-searchinput { padding-left: 40px; }
.st-empty { padding: 8px 0; }
.st-hit { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--card); cursor: pointer; margin-bottom: 8px; }
.st-hit:hover { border-color: rgba(45,212,191,0.45); background: #12181a; }
.st-hit-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; background: var(--teal-soft); color: #5eead4; }
.st-hit-ic svg { width: 14px; height: 14px; }
.st-hit-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.st-hit-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-hit-k { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #5eead4; }
.st-hit-s { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.st-hit-s mark { background: rgba(45,212,191,0.25); color: #ccfbf1; border-radius: 3px; padding: 0 2px; }

/* chat (three-pane, like the app) */
.st-chat { display: grid; grid-template-columns: 230px 1fr 260px; height: 100%; min-height: 0; }
.st-chat-hist { border-right: 1px solid var(--border); padding: 14px 12px; overflow-y: auto; }
.st-chat-histhead { margin-bottom: 10px; font-size: 13px; }
.st-conv { padding: 9px 11px; border-radius: 10px; margin-top: 8px; cursor: pointer; }
.st-conv:hover { background: var(--bg-soft); }
.st-conv.active { background: var(--teal-soft); }
.st-conv b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-chat-main { display: flex; flex-direction: column; min-width: 0; }
.st-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.st-chat-head b { font-size: 13.5px; }
.st-chat-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; background: var(--teal-soft); color: #5eead4; }
.st-chat-ic svg { width: 16px; height: 16px; }
.st-chat-head .chip svg { width: 12px; height: 12px; }
.st-chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.st-chat-msgs > .msg, .st-chat-msgs > article { max-width: 720px; }
.st-chat-msgs .msg.user { align-self: flex-end; }
.st-chat-ai { align-self: flex-start; padding: 14px 16px; }
.st-chat-ai p { margin: 0 0 8px; font-size: 13px; line-height: 1.65; }
.st-chat-ai p:last-child { margin-bottom: 0; }
.st-cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.st-cites .cite { border: 1px solid rgba(45,212,191,0.3); }
#st-chat-live { display: contents; }
#st-chat-live .msg.user { align-self: flex-end; }
#st-chat-live .msg.ai { align-self: flex-start; max-width: 720px; }
#st-chat-live .msg.ai p { margin: 0 0 8px; font-size: 13px; line-height: 1.65; }
#st-chat-live .msg.ai p:last-child { margin-bottom: 0; }
.st-chat-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.st-chat-input input { flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--bg-soft); color: var(--text); font-size: 13px; font-family: inherit; }
.st-chat-input input:focus { outline: none; border-color: var(--teal-2); }
.st-chat-ctx { border-left: 1px solid var(--border); padding: 14px; overflow-y: auto; }
.st-ctx-t { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.st-ctx-l { display: block; margin: 14px 0 4px; font-size: 10px; color: var(--text-3); }
.st-ctx-scope { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-soft); background: var(--bg-soft); font-size: 12.5px; }
.st-ctx-src { display: flex; gap: 8px; align-items: flex-start; padding: 8px 9px; border: 1px solid var(--border); border-radius: 9px; margin-top: 6px; }
.st-ctx-cb { color: #5eead4; flex-shrink: 0; }
.st-ctx-cb svg { width: 12px; height: 12px; }
.st-ctx-txt { min-width: 0; }
.st-ctx-txt b { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-ctx-note { margin: 14px 0 0; padding: 10px; border-radius: 9px; background: rgba(255,255,255,0.03); font-size: 10.5px; line-height: 1.6; color: var(--text-3); }

/* editor / reader */
.st-editor { border: 1px solid var(--border); border-radius: 12px; background: #101014; padding: 18px 22px; margin-top: 4px; }
.st-md-h1 { font-size: 18px; margin: 0 0 10px; }
.st-md-h2 { font-size: 14px; margin: 16px 0 6px; color: #99f6e4; }
.st-editor p { margin: 0 0 8px; color: #d4d4d4; font-size: 13.5px; line-height: 1.7; }
.st-md-list { margin: 0 0 8px; padding-left: 20px; color: #d4d4d4; font-size: 13.5px; line-height: 1.8; }
.st-annot { border-left: 3px solid var(--ac); border-radius: 0 10px 10px 0; padding: 10px 14px; background: color-mix(in srgb, var(--ac) 8%, transparent); }
.st-annot b { display: block; font-size: 13px; }
.st-meta { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid #1d1d1d; font-size: 12.5px; }
.st-meta:last-of-type { border-bottom: none; }
.st-meta-k { width: 130px; flex-shrink: 0; color: var(--text-3); }
.st-rel { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1d1d1d; font-size: 12.5px; }
.st-rel:last-of-type { border-bottom: none; }
.st-rel-name { flex-shrink: 0; }
.st-rel-basis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* recordings */
.st-player { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); margin: 4px 0 12px; }
.st-play { width: 36px; height: 36px; border-radius: 50%; border: none; flex-shrink: 0; background: var(--teal); color: #fff; display: grid; place-items: center; }
.st-play svg { width: 14px; height: 14px; }
.st-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 34px; }
.st-wave i { flex: 1; border-radius: 2px; background: linear-gradient(180deg, #2dd4bf, #0f766e); opacity: 0.8; }
.st-marker { border-left: 3px solid var(--ac); border-radius: 0 10px 10px 0; padding: 8px 12px; margin-bottom: 10px; background: color-mix(in srgb, var(--ac) 8%, transparent); }
.st-marker b { display: block; font-size: 12.5px; }
.st-seg-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 10px; background: transparent; color: var(--text); margin-bottom: 6px; font-size: 12.5px; }
.st-seg-row:hover { border-color: rgba(45,212,191,0.45); background: #12181a; }
.st-seg-t { color: #5eead4; font-variant-numeric: tabular-nums; font-weight: 600; flex-shrink: 0; }
.st-seg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-seg-sp { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.st-seg-c { color: var(--text-3); font-size: 11px; flex-shrink: 0; }

/* question bank + review */
.st-opts { margin: 10px 0 4px; }
.st .quiz-opt.correct { border-color: rgba(45,212,191,0.5); background: rgba(45,212,191,0.1); }
.st .quiz-opt svg { width: 13px; height: 13px; vertical-align: -2px; color: #5eead4; }
.st-attempt { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(129,140,248,0.35); border-radius: 12px; background: rgba(129,140,248,0.06); }
.st-fc { border: 1px solid var(--border); border-radius: 16px; padding: 26px; text-align: center; background: linear-gradient(140deg, rgba(15,118,110,0.12), rgba(45,212,191,0.02)); }
.st-fc-side { margin: 0; font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #5eead4; }
.st-fc-side.back { color: #6ee7b7; }
.st-fc-front { margin: 12px 0 0; font-size: 20px; }
.st-fc-back { margin: 12px 0 0; font-size: 16px; color: #6ee7b7; }
.st-fc-div { height: 1px; max-width: 320px; margin: 20px auto; background: var(--border); }
.st-wizard { max-width: 640px; margin: 0 auto; }
.st-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.st-step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--teal-soft); color: #99f6e4; font-size: 12px; font-weight: 700; }
.st-field { display: block; font-size: 11.5px; color: var(--text-3); }
.st-field .select { display: block; width: 100%; margin-top: 5px; }
.st-session { max-width: 640px; margin: 0 auto; }
.st-progress { display: flex; align-items: center; }
.st-card { display: block; width: 100%; min-height: 260px; margin-top: 12px; padding: 34px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); text-align: center; }
.st-card-front { font-size: 19px; margin: 0; line-height: 1.5; }
.st-card-back { font-size: 17px; margin: 0; color: #6ee7b7; }
.st-rates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.st-done { max-width: 460px; margin: 0 auto; text-align: center; padding: 34px; border-color: rgba(45,212,191,0.4); }
.st-done > svg { width: 30px; height: 30px; color: #2dd4bf; }

@media (max-width: 1180px) {
  .st-chat { grid-template-columns: 1fr 250px; }
  .st-chat-hist { display: none; }
}
@media (max-width: 900px) {
  .st-chat { grid-template-columns: 1fr; }
  .st-chat-ctx { display: none; }
  .st-viewroot.st-scroll { padding: 18px 16px 100px; }
}

#st-graph { display: block; width: 100%; height: 560px; cursor: pointer; }

/* ========================================================================== */
/* TEACHING MODE — modelled on the real orange-accented teaching workspace.   */
/* ========================================================================== */
.teach { --teach: #ea580c; --teach-2: #fb923c; --teach-soft: rgba(234,88,12,.15); }
.shell.teach .topbar .tb-btn.primary, .teach .btn.primary { background: var(--teach); }
.shell.teach .topbar .tb-btn.primary:hover, .teach .btn.primary:hover { background: #c2410c; }
.teach .nav-item.active { color: #fed7aa; border-color: rgba(234,88,12,.42); background: var(--teach-soft); }
.teach .nav-item.active svg, .teach .view-title svg { color: var(--teach-2); }
.teach-kicker { margin: 0 0 5px; color: var(--teach-2); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.teach-head { margin-bottom: 18px; }
.teach-head .view-sub { margin-bottom: 0; }
.teach-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; color: var(--teach-2); background: var(--teach-soft); }
.teach-mark svg { width: 17px; height: 17px; }
.teach .list-row > svg { width: 16px; height: 16px; align-self: center; flex: 0 0 16px; color: var(--text-3); }
.teach-section-title { margin: 22px 0 10px; font-size: 14px; }
.teach-planned { border: 1px dashed rgba(251,146,60,.35); }
.teach-planned small { margin-left: auto; color: #fdba74; font-size: 9px; text-transform: uppercase; }
.teach-hero { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border: 1px solid rgba(234,88,12,.34); border-radius: 16px; background: linear-gradient(135deg, rgba(234,88,12,.2), rgba(234,88,12,.03)); }
.teach-hero > div { flex: 1; }
.teach-hero-icon { float: left; display: grid; place-items: center; width: 48px; height: 48px; margin-right: 14px; border-radius: 13px; color: #fdba74; background: rgba(234,88,12,.18); }
.teach-hero-icon svg { width: 24px; height: 24px; }
.teach-hero p, .teach-hero span { margin: 0; color: var(--text-2); font-size: 12px; }
.teach-hero h2 { margin: 1px 0 2px; font-size: 20px; }
.teach-stats { grid-template-columns: repeat(4, minmax(140px, 1fr)); margin-top: 14px; }
.teach-stats .card { display: flex; align-items: baseline; gap: 10px; }
.teach-stats .stat { color: #fdba74; }
.teach-stats p { margin: 0; color: var(--text-2); font-size: 12px; }
.teach-dest { display: grid; grid-template-columns: 38px 1fr 16px; align-items: start; gap: 10px; }
.teach-dest > svg { width: 16px; color: var(--text-3); align-self: center; }
.teach-dest h3, .teach-dest p { margin: 0; }
.teach-dest p { margin-top: 4px; color: var(--text-2); font-size: 12px; }
.teach-recent { padding: 0; overflow: hidden; }
.teach-recent button { display: grid; grid-template-columns: 34px 1fr 16px; align-items: center; gap: 11px; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; }
.teach-recent button:last-child { border-bottom: 0; }
.teach-recent button:hover { background: rgba(234,88,12,.05); }
.teach-recent button > span:nth-child(2) { display: flex; flex-direction: column; }
.teach-recent small { color: var(--text-3); }
.teach-recent button > svg { width: 15px; color: var(--text-3); }
.teach-course-title { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.teach-course-title h2, .teach-course-title p { margin: 0; }
.teach-course-title p { color: var(--text-3); font-size: 12px; }
.teach-subject { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--border); }
.teach-subject:last-child { border-bottom: 0; }
.teach-subject > span:first-child { width: 8px; height: 32px; border-radius: 6px; background: var(--subject); }
.teach-subject div { display: flex; flex-direction: column; }
.teach-subject small { color: var(--text-3); }
.teach-table-wrap { padding: 0; overflow: auto; }
.teach-table td:first-child { min-width: 260px; }
.teach-table td:first-child .teach-mark { float: left; margin-right: 9px; }
.teach-table td:first-child b, .teach-table td:first-child small { display: block; }
.teach-table td:first-child small { color: var(--text-3); font-size: 10px; }
.teach-table tr.rowlink:hover td { background: rgba(234,88,12,.05); }
.teach-privacy { display: flex; align-items: center; gap: 11px; width: 100%; margin-bottom: 14px; padding: 11px 14px; border: 1px solid rgba(52,211,153,.35); border-radius: 11px; background: rgba(52,211,153,.07); color: #a7f3d0; text-align: left; }
.teach-privacy:not(.on) { color: #fecaca; border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.07); }
.teach-privacy > svg { width: 18px; flex-shrink: 0; }
.teach-privacy > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.teach-privacy small { color: var(--text-2); }
.teach-switch { width: 34px; padding: 3px; border-radius: 999px; background: #404040; }
.teach-switch i { display: block; width: 14px; height: 14px; border-radius: 50%; background: white; transition: transform .18s; }
.teach-privacy.on .teach-switch { background: #059669; }
.teach-privacy.on .teach-switch i { transform: translateX(14px); }
.teach-code { padding: 4px 8px; border: 0; border-radius: 7px; background: var(--teach-soft); color: #fdba74; font: 600 11px/1 var(--sans); }
.teach-schedule { width: 100%; min-width: 850px; border-collapse: collapse; }
.teach-schedule th, .teach-schedule td { padding: 9px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.teach-schedule th { color: var(--text-3); font-size: 11px; text-align: left; }
.teach-schedule td { min-width: 130px; }
.teach-class, .teach-empty { width: 100%; min-height: 46px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--text); font-weight: 600; }
.teach-class { display: flex; flex-direction: column; align-items: flex-start; padding: 7px 9px; }
.teach-class small { color: var(--text-3); font-weight: 400; }
.teach-class.history { border-color: rgba(234,88,12,.4); background: var(--teach-soft); }
.teach-class.geography { border-color: rgba(14,165,233,.4); background: rgba(14,165,233,.12); }
.teach-empty { color: var(--text-3); }
.teach-event { display: flex; gap: 12px; align-items: center; }
.teach-event > span { display: grid; place-items: center; width: 48px; height: 48px; padding: 5px; border-radius: 10px; color: #fdba74; background: var(--teach-soft); font-size: 10px; font-weight: 700; text-align: center; }
.teach-event div { display: flex; flex-direction: column; }
.teach-event small { color: var(--text-3); }
.teach-recording { display: flex; align-items: center; gap: 14px; }
.teach-recording > div { flex: 1; }
.teach-recording h3, .teach-recording p { margin: 0; }
.teach-recording p { color: var(--text-3); font-size: 12px; }
.teach-play { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; color: white; background: var(--teach); }
.teach-wave { display: flex; align-items: center; gap: 2px; height: 34px; margin-top: 9px; }
.teach-wave i { flex: 1; max-width: 8px; border-radius: 3px; background: linear-gradient(#fb923c,#c2410c); }
.teach-rubric-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.teach-rubric { width: 100%; min-width: 1080px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.teach-rubric th, .teach-rubric td { padding: 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); vertical-align: top; }
.teach-rubric thead th { background: var(--bg-soft); text-align: left; }
.teach-rubric thead th:first-child { width: 245px; }
.teach-rubric thead th b, .teach-rubric thead th span { display: block; }
.teach-rubric thead th span { margin-top: 5px; color: #fdba74; }
.teach-rubric tbody th { text-align: left; }
.teach-rubric tbody th b, .teach-rubric tbody th small, .teach-rubric tbody th span { display: block; }
.teach-rubric tbody th small { margin: 4px 0 9px; color: var(--text-3); font-weight: 400; }
.teach-rubric tbody th span { width: fit-content; padding: 2px 7px; border-radius: 6px; color: #fdba74; background: var(--teach-soft); }
.teach-rubric td { color: #d4d4d4; line-height: 1.55; }
.teach-quality { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 11px 14px; border: 1px solid rgba(52,211,153,.3); border-radius: 10px; color: #a7f3d0; background: rgba(52,211,153,.06); }
.teach-quality > svg { width: 18px; }
.teach-quality div { display: flex; flex-direction: column; }
.teach-quality span { color: var(--text-2); font-size: 12px; }
.teach-exam-card { display: flex; align-items: center; justify-content: space-between; max-width: 520px; }
.teach-exam-card > div { display: flex; gap: 10px; align-items: center; }
.teach-exam-card h3, .teach-exam-card p { margin: 0; }
.teach-exam-card small, .teach-exam-card p { color: var(--text-3); }
.teach-exam-layout { display: grid; grid-template-columns: minmax(480px,1fr) minmax(400px,.86fr); gap: 14px; align-items: start; }
.teach-exam-head h3 { margin-bottom: 12px; }
.teach-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.teach-form label { color: var(--text-3); font-size: 11px; }
.teach-form input, .teach-form textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft); color: var(--text); font: inherit; }
.teach-form textarea { min-height: 68px; resize: none; }
.teach-form .span-2 { grid-column: span 2; }
.teach-question-list { display: grid; gap: 8px; margin-top: 12px; }
.teach-question { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 12px 14px; }
.teach-question > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #fdba74; background: var(--teach-soft); font-weight: 700; }
.teach-question > div { display: flex; flex-direction: column; }
.teach-question small { color: #fdba74; text-transform: uppercase; }
.teach-question button { width: fit-content; margin-top: 5px; padding: 0; border: 0; background: none; color: #fdba74; font-size: 11px; }
.teach-question > em { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.teach-question.section { border-color: rgba(234,88,12,.35); }
.teach-preview { position: sticky; top: 0; max-height: 720px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: #202024; }
.teach-preview > div { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.teach-preview > div button { border: 0; background: none; color: #fdba74; font-size: 11px; }
.teach-paper { margin: 18px; padding: 28px 32px; min-height: 650px; background: white; color: #18181b; box-shadow: 0 8px 28px rgba(0,0,0,.35); font-family: Georgia,serif; font-size: 11px; }
.teach-paper header small { text-transform: uppercase; letter-spacing: .05em; }
.teach-paper header h2 { margin: 3px 0; font-size: 20px; }
.teach-paper header p { margin: 0 0 12px; }
.teach-instructions { padding: 8px; background: #f4f4f5; border-left: 3px solid #71717a; }
.teach-paper-q { position: relative; padding: 10px 58px 10px 0; border-top: 1px solid #d4d4d8; }
.teach-paper-q > b { display: block; }
.teach-paper-q > span { position: absolute; top: 10px; right: 0; }
.teach-paper-q i { display: block; height: 17px; border-bottom: 1px solid #d4d4d8; }
.teach-paper-q ul { list-style: none; padding: 0; line-height: 1.65; }
.teach-paper-q em { display: block; margin-top: 7px; color: #166534; }
.teach-paper-q.section { font-size: 12px; }
.teach-published { color: #a7f3d0; border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.08); }
.teach-grade-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.teach-grades { min-width: 1280px; width: 100%; border-collapse: collapse; font-size: 12px; }
.teach-grades th, .teach-grades td { padding: 8px 9px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
.teach-grades th { background: var(--bg-soft); color: var(--text-3); text-align: left; }
.teach-grades th small { display: block; color: #fdba74; }
.teach-grade-cell, .teach-final { min-width: 48px; min-height: 30px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 7px; background: transparent; color: var(--text); }
.teach-grade-cell:hover, .teach-final:hover { border-color: var(--teach); }
.teach-final { color: #fdba74; font-weight: 700; background: var(--teach-soft); }
.grade-status { font-size: 10px; }
.grade-status.exempt { color: #67e8f9; }
.grade-status.pending { color: #fde68a; }
.grade-status.missing { color: #fca5a5; }
.teach-grade-note { margin-top: 10px; }
.teach-design { border-style: dashed; }
.teach-design > span { color: #fdba74; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.teach-design p { color: var(--text-2); }
.teach-answer { margin-top: 14px; padding: 14px; border-left: 3px solid var(--teach); border-radius: 0 8px 8px 0; background: var(--teach-soft); }
.teach-status-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.teach-status-options button { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-soft); color: var(--text); }
.teach-status-options button:hover { border-color: var(--teach); }
.teach-breakdown { margin-top: 10px; }
.teach-breakdown > div { display: grid; grid-template-columns: 1fr 60px 45px; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.teach-breakdown span { display: flex; flex-direction: column; }
.teach-breakdown small { color: var(--text-3); text-transform: capitalize; }
.teach-breakdown em { color: var(--text-3); }
.teach-breakdown > strong { display: flex; justify-content: space-between; margin-top: 12px; font-size: 15px; }
.teach-analysis { margin-top: 14px; }
.teach-analysis .card span { color: #fdba74; font-size: 24px; font-weight: 700; }
.teach-analysis .card p { margin: 0; color: var(--text-3); }
.teach-plan { display: grid; gap: 9px; margin-top: 12px; }
.teach-plan > div { display: grid; grid-template-columns: 1fr auto; gap: 3px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; }
.teach-plan > div > span { color: #fdba74; font-weight: 700; }
.teach-plan small { grid-column: span 2; color: var(--text-3); }
@media (max-width: 1100px) {
  .teach-stats { grid-template-columns: repeat(2,1fr); }
  .teach-exam-layout { grid-template-columns: 1fr; }
  .teach-preview { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .teach-hero { align-items: flex-start; flex-direction: column; }
  .teach-form { grid-template-columns: 1fr; }
  .teach-form .span-2 { grid-column: auto; }
  .teach-rubric-wrap, .teach-grade-wrap, .teach-table-wrap { margin-right: -14px; }
}
