/* APR WarRoom — dark technical / robotics-HUD design system.
   One accent (electric cyan) + amber for deadlines/warnings. Mono readouts,
   grotesk prose, layered near-black surfaces, faint grid texture. */

:root {
  --bg:        #07090b;
  --surface-1: #0d1114;
  --surface-2: #131a1f;
  --surface-3: #1a232a;
  --line:      #223038;
  --line-soft: #18232a;
  --text:      #d7e2e6;
  --text-dim:  #8399a3;
  --text-faint:#5a6d76;
  --cyan:      #2ee6d6;
  --cyan-dim:  #1a9a90;
  --amber:     #ffb020;
  --amber-dim: #a8741a;
  --red:       #ff5470;
  --green:     #46e08a;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(46,230,214,.05), transparent 60%),
    linear-gradient(0deg, var(--bg), var(--bg));
  /* Anchor the corner glow to the viewport and never tile it. Without this the
     root-element gradient repeats down the canvas in Firefox (once per viewport),
     which reads as a banded artifact on the left as you scroll. */
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before { /* faint grid */
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .22;
  pointer-events: none;
  z-index: 0;
}

.wrap { position: relative; z-index: 1; max-width: 1220px; margin: 0 auto; padding: 0 24px 64px; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}
.brand {
  font-family: var(--mono);
  font-weight: 700; letter-spacing: .16em;
  font-size: 15px;
}
.brand .slash { color: var(--cyan); }
.brand .dim { color: var(--text-faint); }
.status-chip {
  margin-left: auto;
  font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
  color: var(--green);
  display: flex; align-items: center; gap: 7px;
}
.status-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.clock { font-family: var(--mono); font-size: 12px; color: var(--text-dim); letter-spacing: .08em; }

/* ---- layout ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-1));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  position: relative;
}
.panel::before { /* corner tick */
  content:""; position:absolute; top:-1px; left:22px; width:34px; height:2px;
  background: var(--cyan); box-shadow: 0 0 12px var(--cyan-dim);
}
.panel h2 {
  margin: 0 0 14px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim);
  display: flex; align-items: baseline; gap: 10px;
}
.panel h2 .tag { color: var(--text-faint); font-weight: 400; }

/* ---- runway instrument ---- */
.runway { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.runway-num { display: flex; align-items: baseline; gap: 10px; }
.runway-num .big {
  font-family: var(--mono); font-weight: 700; font-size: 72px; line-height: .9;
  color: var(--text);
  text-shadow: 0 0 30px rgba(255,176,32,.18);
}
.runway-num .unit { font-family: var(--mono); font-size: 15px; letter-spacing:.2em; color: var(--text-dim); }
.runway-meta { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin-top: 8px; letter-spacing:.06em; }
.runway-bar { height: 12px; border-radius: 3px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.runway-bar > span { display:block; height:100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  box-shadow: 0 0 16px rgba(255,176,32,.4);
}
.runway.warn .runway-num .big { color: var(--amber); }

/* ---- stat readouts ---- */
.readout-row { display: flex; gap: 28px; flex-wrap: wrap; }
.readout .k { font-family: var(--mono); font-size: 10px; letter-spacing:.2em; color: var(--text-faint); text-transform: uppercase; }
.readout .v { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--cyan); text-shadow: 0 0 22px rgba(46,230,214,.18); }

/* ---- funnel bars ---- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; }
.bar-row .lbl { font-size: 13px; color: var(--text-dim); }
.bar-track { height: 22px; background: var(--surface-3); border-radius: 4px; overflow: hidden; position: relative; border: 1px solid var(--line-soft); }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); border-radius: 3px 0 0 3px; min-width: 3px; }
.bar-row .amt { font-family: var(--mono); font-size: 12px; color: var(--text); min-width: 74px; text-align: right; }
.bar-row .amt .n { color: var(--text-faint); }

/* track chips */
.tracks { display: flex; flex-wrap: wrap; gap: 10px; }
.track-chip {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px;
  background: var(--surface-2); min-width: 128px;
}
.track-chip .t { font-size: 12px; color: var(--text-dim); }
.track-chip .m { font-family: var(--mono); font-size: 19px; color: var(--cyan); margin-top: 3px; }
.track-chip .c { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* ---- deadlines ---- */
.deadlines { display: flex; flex-direction: column; gap: 2px; }
.dl {
  display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 4px; border-bottom: 1px solid var(--line-soft);
}
.dl:last-child { border-bottom: 0; }
.dl .tminus { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--text-dim); text-align: center;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 0; }
.dl.urgent .tminus { color: var(--amber); border-color: var(--amber-dim); box-shadow: 0 0 14px rgba(255,176,32,.15); }
.dl.overdue .tminus { color: var(--red); border-color: var(--red); }
.dl .title { font-size: 14px; }
.dl .detail { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.dl .due { font-family: var(--mono); font-size: 12px; color: var(--text-dim); text-align: right; }
.dl .badge { font-family: var(--mono); font-size: 9px; letter-spacing:.14em; text-transform: uppercase;
  color: var(--text-faint); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; margin-left: 8px; }

/* ---- next actions ---- */
.tasks { display: flex; flex-direction: column; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 0; }
.task .pri { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-faint); }
.task .pri.high { background: var(--amber); box-shadow: 0 0 8px var(--amber-dim); }
.task .pri.medium { background: var(--cyan-dim); }
.task .txt { font-size: 14px; flex: 1; }
.task .trk { font-family: var(--mono); font-size: 10px; letter-spacing:.12em; text-transform: uppercase; color: var(--text-faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }
.task .t { font-family: var(--mono); font-size: 11px; color: var(--amber); }

/* ---- decision rules ---- */
.rules { display: flex; flex-direction: column; gap: 9px; }
.rule { display: flex; gap: 11px; font-size: 13px; color: var(--text-dim); }
.rule .mk { color: var(--cyan); font-family: var(--mono); flex: none; }

.footer { margin-top: 30px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--text-faint); letter-spacing: .1em; }
.footer .warn { color: var(--amber-dim); }

/* =========================================================================
   Phase 1 — app shell, auth, forms, CRUD views
   ========================================================================= */

/* ---- auth pages ---- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 380px;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px;
  padding: 30px 30px 22px;
}
.auth-card::before { content:""; position:absolute; top:-1px; left:28px; width:44px; height:2px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan-dim); }
.auth-brand { font-family: var(--mono); font-weight: 700; letter-spacing: .16em; font-size: 18px; }
.auth-brand .slash { color: var(--cyan); }
.auth-sub { color: var(--text-dim); font-size: 13px; margin: 6px 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.auth-form .hint { text-transform: none; letter-spacing: 0; color: var(--text-faint); }
input, select, textarea {
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-family: var(--sans); font-size: 14px; padding: 9px 11px; width: 100%;
}
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan-dim); box-shadow: 0 0 0 3px rgba(46,230,214,.1); }
button { cursor: pointer; font-family: var(--sans); }
.auth-form button, .btn.primary {
  background: linear-gradient(180deg, var(--cyan), var(--cyan-dim)); color: #041014;
  border: 0; border-radius: 6px; padding: 11px; font-weight: 700; letter-spacing: .04em; font-size: 14px;
}
.auth-form button:hover { filter: brightness(1.08); }
.auth-err { background: rgba(255,84,112,.12); border: 1px solid rgba(255,84,112,.4); color: #ffb3c0;
  border-radius: 6px; padding: 9px 12px; font-size: 13px; margin-bottom: 16px; }
.auth-foot { margin-top: 20px; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--text-faint); }
.auth-foot a { color: var(--cyan-dim); }

/* ---- nav shell ---- */
.nav { display: flex; gap: 4px; margin-left: 26px; }
.navlink {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none; padding: 7px 12px; border-radius: 6px; border: 1px solid transparent;
}
.navlink:hover { color: var(--text); background: var(--surface-2); }
.navlink.active { color: var(--cyan); border-color: var(--line); background: var(--surface-2); }
.usermenu { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.usermenu .who { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.usermenu .logout { font-family: var(--mono); font-size: 11px; color: var(--text-faint); text-decoration: none; }
.usermenu .logout:hover { color: var(--amber); }

.loading, .err-panel { font-family: var(--mono); color: var(--text-dim); padding: 40px 4px; }
.err-panel { color: #ffb3c0; }

/* ---- section header ---- */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sec-title { font-family: var(--mono); font-size: 20px; letter-spacing: .04em; margin: 0; }
.btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 6px;
  padding: 8px 13px; font-size: 13px; font-weight: 600; }
.btn:hover { border-color: var(--cyan-dim); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255,84,112,.4); color: #ffb3c0; }
.btn.danger:hover { background: rgba(255,84,112,.12); }
.btn.primary { color: #041014; border: 0; }

.pill { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; color: var(--text-dim); }
.pill.trk { color: var(--cyan); border-color: var(--cyan-dim); }
.pill.role { color: var(--amber); border-color: var(--amber-dim); }

/* ---- kanban ---- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
/* Persistent thin scrollbar so off-screen stages (Won/Deferred/Lost) are discoverable. */
.kanban::-webkit-scrollbar { height: 9px; }
.kanban::-webkit-scrollbar-track { background: var(--surface-1); border-radius: 6px; }
.kanban::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.kanban::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }
.kcol { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 120px; }
.kcol-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.kcol-head .kstage { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.kcol-head .kmeta { font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.kcards { display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--text-faint); border-radius: 7px; padding: 10px 11px; cursor: pointer; }
.kcard:hover { border-color: var(--cyan-dim); }
.kcard.pr-high { border-left-color: var(--amber); }
.kcard.pr-medium { border-left-color: var(--cyan-dim); }
.kcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.kcard .kname { font-size: 13px; font-weight: 600; }
.kcard .kval { font-family: var(--mono); font-size: 12px; color: var(--cyan); white-space: nowrap; }
.kcard-sub { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.kcard .trk { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--cyan-dim); border-radius: 3px; padding: 1px 5px; }
.kcard .muted { font-size: 11px; color: var(--text-faint); }
.kcard .knext { margin-top: 7px; font-size: 12px; color: var(--text-dim); }

/* ---- card lists (projects) ---- */
.cardlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.docard { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 15px 16px; cursor: pointer; }
.docard:hover { border-color: var(--cyan-dim); }
.docard-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.docard-title { font-size: 15px; font-weight: 700; margin-right: auto; }
.docard-sum { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.pill.st { color: var(--text-faint); }

/* ---- generic table ---- */
.tbl { width: 100%; border-collapse: collapse; background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; font-size: 13px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.trow-click { cursor: pointer; }
.trow-click:hover td { background: var(--surface-2); }

/* ---- task list ---- */
.tasklist { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; }
.trow { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); }
.trow:last-child { border-bottom: 0; }
.trow.done .ttitle { color: var(--text-faint); text-decoration: line-through; }
.check { width: 20px; height: 20px; flex: none; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-3); color: var(--cyan); font-size: 12px; line-height: 1; padding: 0; }
.check.on { background: var(--cyan-dim); color: #041014; border-color: var(--cyan-dim); }
.ttitle { flex: 1; font-size: 14px; cursor: pointer; }
.trow .trk { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; }
.trow .tdue { font-family: var(--mono); font-size: 11px; color: var(--amber); }
.list-sep { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); padding: 14px 2px 6px; }

.deadlines.big .dl { cursor: pointer; }
.deadlines.big .dl:hover { background: var(--surface-2); }
.dl .verify { font-family: var(--mono); font-size: 11px; color: var(--cyan-dim); margin-top: 3px; display: inline-block; text-decoration: none; }

/* ---- drawer form ---- */
.scrim { position: fixed; inset: 0; background: rgba(4,7,9,.6); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; z-index: 40; }
.scrim.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 94vw); background: var(--surface-1);
  border-left: 1px solid var(--line); z-index: 50; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .2s ease; box-shadow: -20px 0 60px rgba(0,0,0,.5); }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-title { font-family: var(--mono); font-size: 15px; letter-spacing: .08em; }
.x { background: transparent; border: 0; color: var(--text-dim); font-size: 16px; padding: 4px 8px; }
.x:hover { color: var(--text); }
.drawer-fields { padding: 18px 22px; overflow-y: auto; flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.flabel { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.flabel .hint { text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-top: 1px solid var(--line); gap: 10px; }
.drawer-foot > div { display: flex; gap: 10px; }
.drawer-err { margin: 14px 22px -4px; background: rgba(255,84,112,.12); border: 1px solid rgba(255,84,112,.4); color: #ffb3c0; border-radius: 6px; padding: 8px 11px; font-size: 13px; }

/* ---- doc / contact modal ---- */
.docmodal { position: relative; z-index: 1; width: min(820px, 94vw); max-height: 88vh; margin: 6vh auto; background: var(--surface-1);
  border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.scrim.on .docmodal { animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(8px); opacity: .6; } }
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); gap: 16px; }
.doc-title { font-size: 18px; font-weight: 700; }
.doc-meta { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 4px; letter-spacing: .06em; }
.doc-head > div:last-child { display: flex; gap: 8px; align-items: center; flex: none; }
.doc-body { padding: 22px 24px; overflow-y: auto; }
.md-raw { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--text-dim); margin: 0; }
.doc-body .sub { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px; }
.logadd { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: 8px; margin-bottom: 16px; }
.log { display: flex; flex-direction: column; gap: 2px; }
.logrow { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.logmethod { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.logsubj { font-size: 13px; }
.lognotes { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.logdate { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.muted { color: var(--text-faint); font-size: 13px; }

@media (max-width: 640px) { .drawer-fields { grid-template-columns: 1fr; } .logadd { grid-template-columns: 1fr; } }

/* =========================================================================
   Phase 2 — inline SVG charts + rendered markdown
   ========================================================================= */

.chart { display: block; width: 100%; height: auto; font-family: var(--mono); }

/* timeline */
.chart.timeline { margin-top: 4px; }
.chart.timeline .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart.timeline .gridlbl { fill: var(--text-faint); font-size: 10px; letter-spacing: .08em; }
.chart.timeline .axis { stroke: var(--line); stroke-width: 1.5; }
.chart.timeline .today { stroke: var(--cyan); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart.timeline .todaylbl { fill: var(--cyan); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.chart.timeline .runwayline { stroke: var(--amber-dim); stroke-width: 1.5; stroke-dasharray: 3 3; }
.chart.timeline .runwaylbl { fill: var(--amber); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.chart.timeline .mk { stroke-width: 1.5; stroke-dasharray: 2 3; }
.chart.timeline .mk.ok { stroke: var(--cyan-dim); }
.chart.timeline .mk.urgent { stroke: var(--amber); }
.chart.timeline .mk.past { stroke: var(--red); }
.chart.timeline .mk.runway { stroke: var(--amber-dim); }
.chart.timeline .mkdot { stroke: var(--bg); stroke-width: 1.5; }
.chart.timeline .mkdot.ok { fill: var(--cyan); }
.chart.timeline .mkdot.urgent { fill: var(--amber); }
.chart.timeline .mkdot.past { fill: var(--red); }
.chart.timeline .mkdot.runway { fill: var(--amber); }
.chart.timeline .mklink { cursor: pointer; }
.chart.timeline .mklink:hover .mklbl { text-decoration: underline; filter: brightness(1.25); }
.chart.timeline .mklbl { font-size: 12px; font-weight: 600; }
.chart.timeline .mklbl.ok { fill: var(--text); }
.chart.timeline .mklbl.urgent { fill: var(--amber); }
.chart.timeline .mklbl.past { fill: var(--red); }
.chart.timeline .mklbl.runway { fill: var(--amber); letter-spacing: .12em; }
.chart.timeline .mksub { fill: var(--text-faint); font-size: 10px; letter-spacing: .04em; }

/* funnel */
.chart.funnel .flabel-svg { fill: var(--text-dim); font-size: 12px; font-family: var(--sans); }
.chart.funnel .ftrack { fill: var(--surface-3); stroke: var(--line-soft); stroke-width: 1; }
.chart.funnel .fbar { fill: var(--cyan); opacity: .82; }
.chart.funnel .fcount { fill: #041014; font-size: 12px; font-weight: 700; }
.chart.funnel .fval { fill: var(--text); font-size: 12px; }

/* rendered markdown */
.md-rendered { font-size: 14px; line-height: 1.65; color: var(--text); }
.md-rendered h1, .md-rendered h2, .md-rendered h3 { font-family: var(--mono); letter-spacing: .02em; margin: 1.4em 0 .5em; line-height: 1.25; }
.md-rendered h1 { font-size: 20px; color: #fff; border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.md-rendered h2 { font-size: 16px; color: var(--cyan); }
.md-rendered h3 { font-size: 14px; color: var(--text); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.md-rendered h1:first-child, .md-rendered h2:first-child { margin-top: 0; }
.md-rendered p { margin: .6em 0; }
.md-rendered a { color: var(--cyan); }
.md-rendered strong { color: #fff; }
.md-rendered ul, .md-rendered ol { padding-left: 1.4em; margin: .5em 0; }
.md-rendered li { margin: .3em 0; }
.md-rendered code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); border: 1px solid var(--line-soft); border-radius: 4px; padding: 1px 5px; color: var(--cyan); }
.md-rendered pre { background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; }
.md-rendered pre code { background: none; border: 0; padding: 0; color: var(--text-dim); }
.md-rendered blockquote { border-left: 3px solid var(--cyan-dim); margin: .8em 0; padding: .2em 0 .2em 14px; color: var(--text-dim); }
.md-rendered hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.md-rendered table { border-collapse: collapse; margin: 1em 0; width: 100%; }
.md-rendered th, .md-rendered td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; font-size: 13px; }
.md-rendered th { background: var(--surface-2); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }

/* =========================================================================
   Phase 3 — pitch decks: cards, studio (editor/shares/analytics), present
   ========================================================================= */

/* deck cards */
.deckcard-meta { display: flex; gap: 12px; font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.deckcard-meta .dim { color: var(--text-faint); }
.pill.live { color: var(--green); border-color: rgba(70,224,138,.4); }
.pill.gone { color: var(--red); border-color: rgba(255,84,112,.4); }

/* studio shell (wider than docmodal, fixed tall) */
.studio { position: relative; z-index: 1; width: min(1180px, 96vw); height: 90vh; margin: 5vh auto;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden; }
.scrim.on .studio { animation: pop .18s ease; }
.studio-tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.studio-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-dim);
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 12px 14px; cursor: pointer; }
.studio-tab:hover { color: var(--text); }
.studio-tab.on { color: var(--cyan); border-bottom-color: var(--cyan); }
.studio-body { flex: 1; overflow: hidden; display: flex; }
.studio-body > .analytics-pane, .studio-body > .shares-pane { overflow-y: auto; }
.studio-body > .muted { padding: 24px; }

/* editor split */
.editor-split { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: 100%; }
.editor-col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.editor-col:last-child { border-right: 0; }
.editor-bar { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-1); min-height: 42px; }
.editor-bar .hint { font-size: 11px; color: var(--text-faint); margin-right: auto; }
.editor-bar .sublabel, .sublabel { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); }
.save-status { font-family: var(--mono); font-size: 11px; color: var(--amber); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.deck-src { flex: 1; resize: none; border: 0; background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.6; padding: 16px 18px; outline: none; }
.deck-preview { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface-1); }
.deck-thumb { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; min-height: 120px; }
.deck-thumb-n { position: absolute; top: 8px; right: 12px; font-family: var(--mono); font-size: 10px; color: var(--text-faint); }
.deck-thumb-body { font-size: 13px; }
.deck-thumb-body h1 { font-size: 22px; }
.deck-thumb-body h2 { font-size: 16px; }
.deck-thumb-notes { margin-top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--amber); }

/* shares */
.shares-pane { padding: 20px 24px; width: 100%; }
.mint-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; margin-bottom: 18px; }
.mint-in { background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; color: var(--text);
  font-family: var(--sans); font-size: 13px; padding: 9px 11px; }
.share-list { display: flex; flex-direction: column; gap: 10px; }
.share-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.share-row.revoked { opacity: .55; }
.share-who { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.share-name { font-size: 14px; font-weight: 600; }
.share-org { font-size: 12px; color: var(--text-dim); }
.share-link { display: flex; gap: 6px; }
.share-url { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px;
  color: var(--cyan); font-family: var(--mono); font-size: 11px; padding: 6px 9px; }
.share-stats { display: flex; gap: 14px; }
.statchip { text-align: center; }
.statchip .sv { font-family: var(--mono); font-size: 16px; font-weight: 700; color: var(--cyan); }
.statchip .sk { font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }

/* analytics */
.analytics-pane { padding: 22px 24px; width: 100%; }
.readout-row { display: flex; gap: 28px; }
.readout-row.big { margin-bottom: 8px; }
.readout-row.big .readout .v { font-size: 34px; }
.analytics-pane .sub, .shares-pane .sub { font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-faint); margin: 26px 0 12px; }
.heat { display: flex; flex-direction: column; gap: 7px; }
.heat-row { display: grid; grid-template-columns: 80px 1fr 64px; gap: 12px; align-items: center; }
.heat-lbl { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.heat-track { background: var(--surface-3); border: 1px solid var(--line-soft); border-radius: 5px; height: 22px; overflow: hidden; }
.heat-bar { height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 14px var(--cyan-dim); }
.heat-val { font-family: var(--mono); font-size: 11px; color: var(--text); text-align: right; }
.an-share { background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; margin-bottom: 10px; }
.an-share-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.an-summary { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.an-opens { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.an-open { display: flex; gap: 14px; align-items: center; font-size: 12px; }
.an-open-n { font-family: var(--mono); font-size: 10px; color: var(--cyan); }
.an-open .dim, .muted.sm { color: var(--text-faint); }
.muted.sm { font-size: 12px; margin-top: 8px; }

/* present overlay (untracked rehearsal) */
.present { position: fixed; inset: 0; z-index: 80; background:
  radial-gradient(1200px 700px at 70% -10%, rgba(46,230,214,.06), transparent 60%), var(--bg); }
.present-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--surface-3); z-index: 2; }
.present-prog-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  box-shadow: 0 0 12px var(--cyan-dim); transition: width .25s ease; }
.present-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 7vh clamp(24px, 8vw, 140px) 12vh; }
.present-slide { width: min(1000px, 100%); font-size: clamp(16px, 2.1vw, 24px); line-height: 1.5; }
.present-slide h1 { font-size: clamp(30px, 5.2vw, 60px); color: #fff; border: 0; padding: 0; }
.present-slide h2 { font-size: clamp(22px, 3.4vw, 38px); }
.present-slide strong { color: #fff; }
.present-slide em { color: var(--amber); font-style: normal; }
.present-ctl { position: fixed; bottom: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 4vw, 40px); background: linear-gradient(0deg, rgba(7,9,11,.92), transparent); }
.present-title { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--text-faint); margin-right: auto; }
.present-counter { font-family: var(--mono); font-size: 13px; color: var(--text-dim); min-width: 68px; text-align: center; }
.present .navbtn { background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-family: var(--mono); font-size: 15px; width: 40px; height: 34px; border-radius: 8px; cursor: pointer; }
.present .navbtn:hover { border-color: var(--cyan-dim); color: var(--cyan); }
.present-notes { position: fixed; right: 0; bottom: 58px; z-index: 3; width: min(420px, 92vw); max-height: 42vh;
  overflow-y: auto; background: rgba(13,17,20,.97); border: 1px solid var(--line); border-radius: 12px 0 0 0;
  padding: 16px 20px; box-shadow: -18px -10px 60px rgba(0,0,0,.5); font-size: 14px; line-height: 1.55; color: var(--text-dim); }
.present-notes h4 { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 8px; }
.present-notes .empty { color: var(--text-faint); font-style: italic; }

@media (max-width: 820px) {
  .editor-split { grid-template-columns: 1fr; }
  .editor-col:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .mint-row { grid-template-columns: 1fr; }
  .share-row { grid-template-columns: 1fr; }
}
