/* llm-fit — facilitator wizard. Dark, meeting-projector-friendly. */
* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #12151c; --panel: #1a1f2a; --panel2: #202636; --line: #2c3447;
  --text: #e6e9f0; --dim: #8b93a7; --accent: #d98a9c; --accent2: #7aa2f7;
  --good: #6fbf8f; --warn: #e0af68; --bad: #e06c75;
  --on-accent: #1a1016; --on-accent2: #10131a; --tooltip-bg: #262d3f;
  --line-strong: #5a6478; /* 3.1:1 on --bg: field boundaries must survive a projector */
  scrollbar-color: var(--line) transparent;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select, textarea { transition: border-color .15s ease-out, background-color .15s ease-out, color .15s ease-out; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
::placeholder { color: var(--dim); opacity: 1; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Helvetica, sans-serif;
}
.layout { display: grid; grid-template-columns: 240px 1fr 380px; grid-template-areas: "rail main result"; height: 100vh; }
#rail { grid-area: rail; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px; }
#main { grid-area: main; overflow-y: auto; padding: 22px 28px; min-width: 0; }
#result { grid-area: result; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; }

/* tablet: result pane drops below the form, rail narrows */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 210px 1fr; grid-template-rows: 1fr auto;
    grid-template-areas: "rail main" "rail result"; }
  #result { border-left: none; border-top: 1px solid var(--line); max-height: 45vh; }
  #main { padding: 18px 20px; }
}
/* phone: single column, rail becomes a top strip */
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto;
    grid-template-areas: "rail" "main" "result"; height: 100dvh; }
  #rail { border-right: none; border-bottom: 1px solid var(--line); max-height: 38vh; }
  #result { max-height: 40vh; }
  .form-grid { grid-template-columns: 1fr; }
  .barrow { grid-template-columns: 1fr; gap: 3px; }
}
/* real touch devices: 44px minimum targets */
@media (pointer: coarse) {
  button, .nav-item, select, input:not([type=range]) { min-height: 44px; }
  .est-chips button, button.small { min-height: 36px; }
  .tip { width: 22px; height: 22px; font-size: 13px; }
}

h1 { font-size: 19px; margin-bottom: 4px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 16px 0 6px; }
.sub { color: var(--dim); font-size: 12.5px; margin-bottom: 14px; }

/* rail */
.brand { font-weight: 700; font-size: 15px; }
.brand span { color: var(--accent); }
.brand-by { color: var(--accent); font-size: 12px; letter-spacing: .04em; margin-bottom: 4px; }
.client-line { color: var(--dim); font-size: 12px; margin-bottom: 12px; }
.rail-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 16px 0 6px; font-weight: 700; }
.presenter-line { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--dim); cursor: pointer; }
.presenter-line input { width: auto; }
.amt.pending { color: var(--dim); }
.nav-item { display: flex; justify-content: space-between; gap: 6px; align-items: center; width: 100%;
  text-align: left; font-size: 13px; background: none; color: var(--text);
  padding: 7px 9px; border-radius: 7px; cursor: pointer; margin-bottom: 3px; border: 1px solid transparent; }
.nav-item:hover { background: var(--panel2); }
.nav-item.active { background: var(--panel2); border-color: var(--line); }
.nav-item .amt { color: var(--good); font-size: 12px; white-space: nowrap; }
.nav-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--panel2); color: var(--dim);
  border: 1px solid var(--line); text-transform: lowercase; }
.chip.live { color: var(--good); } .chip.planned { color: var(--accent2); } .chip.latent { color: var(--warn); }
.total-box { margin-top: 12px; padding: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.total-box .big { font-size: 18px; font-weight: 700; color: var(--good); }
.total-box .lbl { font-size: 12px; color: var(--dim); }
button, .btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 12px; cursor: pointer; font-size: 13px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--on-accent); border: none; font-weight: 600; }
button.small { padding: 3px 8px; font-size: 12px; }
.rail-add { width: 100%; margin: 10px 0 4px; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; max-width: 860px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--dim); }
.field .why { font-size: 12px; color: var(--dim); }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 7px 9px; font-size: 13.5px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); }
/* number spinners jitter the field on focus; the estimator chips replace them */
input[type=number] { appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { appearance: none; margin: 0; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:disabled:hover { border-color: var(--line); }
button.danger-armed { border-color: var(--bad); color: var(--bad); }
.danger-row { margin-top: 26px; }
.danger-row button { color: var(--dim); }
.seg { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; width: fit-content; }
.seg button { border: none; border-radius: 0; background: var(--bg); font-size: 12.5px; padding: 6px 10px; white-space: nowrap; }
.seg button.on { background: var(--accent2); color: var(--on-accent2); font-weight: 600; }
.tip { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border-radius: 50%; border: 1px solid var(--dim); color: var(--dim); font-size: 10px; cursor: help;
  position: relative; vertical-align: 1px; margin-left: 3px; }
.tip:hover, .tip:focus { border-color: var(--accent2); color: var(--accent2); }
.tip:hover::after, .tip:focus::after {
  content: attr(data-tip); position: absolute; left: 0; top: calc(100% + 7px); z-index: 30;
  width: min(300px, 78vw); padding: 9px 11px; border-radius: 8px; background: var(--tooltip-bg); color: var(--text);
  border: 1px solid var(--accent2); font-size: 12px; line-height: 1.45; white-space: normal;
  box-shadow: 0 6px 20px rgba(0,0,0,.45); }
.est-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.est-chips button { font-size: 12px; padding: 2px 8px; color: var(--dim); }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkline input { width: auto; }
.filter-effect { margin: 12px 0; padding: 9px 12px; border: 1px solid var(--line);
  background: color-mix(in oklab, var(--accent2) 8%, var(--panel)); border-radius: 7px; font-size: 13px; }

/* result pane */
.route { border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin-bottom: 10px; background: var(--panel2); }
.route.top { border-color: var(--accent); }
.route .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.route .mname { font-weight: 600; font-size: 13.5px; }
.route .cost { font-size: 14px; font-weight: 600; color: var(--good); white-space: nowrap; }
.route .meta { color: var(--dim); font-size: 12px; margin-top: 3px; }
.route .savings { font-size: 12px; margin-top: 4px; }
.savings .pct { color: var(--good); font-weight: 700; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.flag { font-size: 10px; padding: 1px 6px; border-radius: 4px; border: 1px solid; }
.flag.EVAL_GATE { color: var(--warn); border-color: var(--warn); }
.flag.PROMO_PRICE, .flag.UNVERIFIED, .flag.PEAK_SURCHARGE { color: var(--bad); border-color: var(--bad); }
.flag.COMPLIANCE_NOTE, .flag.ESCALATION { color: var(--accent2); border-color: var(--accent2); }
.flag.THIN_MARGIN, .flag.FREE_TIER { color: var(--dim); border-color: var(--dim); }

/* The sales moment: one loud number per pane, staged. */
.pane-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 16px 0 6px; font-weight: 700; }
.delta-line { display: flex; align-items: baseline; gap: 9px; margin: 6px 0 2px; flex-wrap: wrap; }
.delta-from { font-size: 16px; color: var(--dim); text-decoration: line-through; text-decoration-color: color-mix(in oklab, var(--bad) 60%, transparent); }
.delta-arrow { font-size: 12px; color: var(--dim); }
.delta-to { font-size: 26px; font-weight: 700; color: var(--good); letter-spacing: -0.01em; }
.delta-line.lone .delta-to { font-size: 22px; }
.delta-sub { font-size: 13px; margin-bottom: 4px; }
.delta-sub b { color: var(--good); }
.ghost { color: var(--dim); font-size: 12px; margin-left: 8px; text-decoration: line-through; }
@keyframes llmfit-pulse { 0% { background: color-mix(in oklab, var(--good) 22%, transparent); } 100% { background: transparent; } }
.delta-line.pulse { animation: llmfit-pulse 600ms ease-out 1; border-radius: 6px; }

.baseline-line { font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
.result-note { font-size: 11.5px; color: var(--dim); margin-top: 10px; }
.chain { font-size: 11.5px; color: var(--dim); margin-top: 8px; }
.dropped-toggle { color: var(--accent2); cursor: pointer; font-size: 11.5px; }

/* dashboard */
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.dash-card .big { font-size: 17px; font-weight: 700; }
.dash-card .lbl { font-size: 11.5px; color: var(--dim); }
.dash-card.savings .big { color: var(--good); }
.dash-card.hero { border-color: color-mix(in oklab, var(--good) 40%, var(--line)); }
.dash-card.hero .big { font-size: 26px; }
.muted-item { color: var(--dim); }
.dash-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.warn.sub, .sub.warn { color: var(--warn); }
.why.warn { color: var(--warn); }

/* On-screen proposal preview: the printed document, reviewable before it prints */
.proposal-preview { background: #f4f2ee; color: #1b1b1b; border-radius: 10px; padding: 26px 30px; margin: 14px 0;
  font: 13px/1.5 Georgia, serif; max-width: 900px; }
.proposal-preview h1 { font-size: 22px; color: #1b1b1b; margin-bottom: 2px; }
.proposal-preview h2 { font-size: 15px; margin: 16px 0 6px; border-bottom: 1px solid #9a958c; color: #1b1b1b; }
.proposal-preview table { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.proposal-preview th, .proposal-preview td { border: 1px solid #9a958c; padding: 4px 6px; text-align: left; }
.proposal-preview .fine { font-size: 10.5px; color: #444; }
.proposal-preview ol { padding-left: 20px; }
.barrow { display: grid; grid-template-columns: 180px 1fr 120px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12.5px; }
.barrow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: flex; flex-direction: column; gap: 2px; }
.bar { height: 9px; border-radius: 3px; }
.bar.cur { background: var(--bad); opacity: .75; }
.bar.opt { background: var(--good); }
.risk-item { padding: 6px 10px; border: 1px solid color-mix(in oklab, var(--warn) 45%, var(--line));
  background: color-mix(in oklab, var(--warn) 7%, var(--panel)); border-radius: 6px; margin-bottom: 6px; font-size: 12.5px; }
.action-item { padding: 7px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; margin-bottom: 6px; font-size: 13px; }
.action-item b { color: var(--accent2); }
.sens { display: flex; gap: 24px; flex-wrap: wrap; margin: 10px 0 16px; }
.sens .field { min-width: 180px; }
.sens output { font-size: 12px; color: var(--accent2); }
details { margin: 14px 0; }
summary { cursor: pointer; color: var(--dim); }
table.mini { border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
table.mini td, table.mini th { border: 1px solid var(--line); padding: 4px 9px; text-align: left; }
.export-row { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }

.muted { color: var(--dim); }
.danger { color: var(--bad); }
.ok { color: var(--good); }
.warn { color: var(--warn); }
a { color: var(--accent2); }

/* print proposal */
#proposal { display: none; }
@media print {
  .layout { display: none; }
  #proposal { display: block; color: #111; background: #fff; font: 12px/1.5 Georgia, serif; padding: 0 8mm; }
  #proposal h1 { font-size: 22px; margin-bottom: 2px; }
  #proposal h2 { font-size: 15px; margin: 16px 0 6px; border-bottom: 1px solid #999; }
  #proposal table { border-collapse: collapse; width: 100%; font-size: 11px; }
  #proposal th, #proposal td { border: 1px solid #999; padding: 4px 6px; text-align: left; }
  #proposal .fine { font-size: 9.5px; color: #444; }
  #proposal .pagebreak { page-break-before: always; }
  body { background: #fff; }
}
