/* FLG Forecast additions on top of the shared FLG styles (styles.css, copied from FLG Comp). */
[hidden] { display: none !important; }
.small { font-size: 12px; }
.note { background: #eef4ff; border: 1px solid #b9d3f5; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.note.err { background: var(--err-bg); border-color: #f3b8b2; color: var(--err); }
.localbar { background: #fff6e6; border: 1px solid #f0c9a3; border-radius: 8px; padding: 7px 12px; margin: 0 0 14px; font-size: 13px; }
.viewas { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #c9d2e3; margin-bottom: 6px; }
.viewas select { font-size: 13px; padding: 4px 6px; }
#whoami { margin-bottom: 10px; color: #c9d2e3; font-size: 13px; }
.signout { color: #f2c14e !important; padding: 2px 0 !important; }
.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
ul.next { margin: 6px 0 0; padding-left: 18px; } ul.next li { margin: 6px 0; }
.d0 { color: var(--ink-3); } .dup { color: var(--ok); font-weight: 600; } .ddn { color: var(--err); font-weight: 600; }
.row-acts { white-space: nowrap; } .row-acts button.ghost { padding: 0 2px; font-weight: 600; }

/* Controls panel + results */
.panel-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.ctl-panel { background: #172033; color: #e6ebf4; border-radius: 10px; padding: 14px 14px 10px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.ctl-head { font-weight: 700; font-size: 16px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.ctl-head .muted { font-weight: 400; font-size: 12px; color: #8f9bb3; }
.ctl-head.sm { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #f2c14e; margin: 14px 0 6px; }
.ctl-sec { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #f2c14e; margin: 12px 0 6px; padding-top: 8px; border-top: 1px solid #2a3652; }
.ctl-sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.ctl { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label label" "input shows"; gap: 3px 10px; padding: 6px 6px; border-radius: 6px; align-items: center; }
.ctl.changed { background: #22304d; }
.ctl-label { grid-area: label; font-size: 13px; color: #c9d2e3; }
.ctl .chg { display: none; width: 7px; height: 7px; border-radius: 50%; background: #f2c14e; margin-left: 6px; vertical-align: 1px; }
.ctl.changed .chg { display: inline-block; }
.ctl-input { grid-area: input; display: flex; align-items: center; gap: 4px; }
.ctl-input input { width: 92px; text-align: right; font-variant-numeric: tabular-nums; padding: 5px 7px; background: #fff6c8; border-color: #e6d27a; color: #1c2430; font-weight: 600; }
.ctl-input button { width: 30px; height: 30px; padding: 0; border-radius: 6px; background: #2a3652; border-color: #3a4766; color: #fff; font-size: 17px; line-height: 1; }
.ctl-input button:hover { background: #34436a; border-color: #f2c14e; }
.ctl-input .unit { color: #8f9bb3; font-size: 13px; min-width: 10px; }
.ctl-shows { grid-area: shows; color: #6fd08c; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Notes that follow the inputs (PANEL_HINTS): a section note, and inputs that have no effect right now */
.psec-hint { margin: 2px 4px 8px; padding: 8px 10px; border-left: 3px solid #f2c14e; background: rgba(242, 193, 78, .10); color: #e9edf5; font-size: 12.5px; line-height: 1.45; border-radius: 4px; }
.ctl.inert { opacity: .55; }
.ctl-why { display: block; margin-top: 2px; font-size: 11.5px; font-style: italic; color: #c9d2e3; white-space: normal; }
.ctl-why:empty { display: none; }
.ctl .switch { color: #c9d2e3; grid-area: input; }
.seg-btns { grid-area: input; display: inline-flex; border: 1px solid #3a4766; border-radius: 6px; overflow: hidden; }
.seg-btns button { border: 0; border-radius: 0; background: #2a3652; color: #c9d2e3; padding: 5px 12px; }
.seg-btns button + button { border-left: 1px solid #3a4766; }
.seg-btns button.on { background: #f2c14e; color: #172033; }
.ctl-panel .seg-btns + .ctl-shows { white-space: normal; }
.out { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 4px 6px; font-size: 13px; border-bottom: 1px solid #2a3652; }
.out span { color: #c9d2e3; } .out b { color: #fff; font-variant-numeric: tabular-nums; text-align: right; }
.out small { grid-column: 1 / -1; color: #8f9bb3; text-align: right; }
.ctl-foot { color: #8f9bb3 !important; margin-top: 10px !important; }
.res { min-width: 0; display: grid; gap: 14px; }
.res .kpis { margin: 0; }
.res-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.res-bar h3 { margin: 0; }
tr.tot td { font-weight: 700; background: #f3f6fb; }
tr.hid td { color: var(--ink-3); font-style: italic; }
tr.changed td.line { box-shadow: inset 3px 0 0 #eb6834; }
.chg-cell { background: #fff1e6; box-shadow: 0 0 0 2px #fff1e6; border-radius: 2px; color: #8a3a00; font-weight: 600; }
.in-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #0000ff; margin-right: 6px; vertical-align: 1px; }
td.line { min-width: 240px; }

/* Grouped column chart (handles negatives) */
.gcols { position: relative; height: 240px; margin: 4px 0 26px 56px; }
.gcols-plot { position: absolute; inset: 0; display: flex; }
.gcol { position: relative; flex: 1; height: 100%; }
.gcol:hover { background: rgba(28, 36, 48, .04); }
.gbar { position: absolute; border-radius: 3px 3px 0 0; min-height: 1px; }
.vcols-grid .tick.zero { border-top: 1.5px solid var(--ink-3); }
.gcol .vcol-label { left: 50%; transform: translateX(-50%); }

/* Compare */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chips .chip { cursor: default; } .chips .chip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.pick-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-bottom: 8px; }
.pick-list label { display: flex; gap: 8px; align-items: center; }
form.dlg { display: grid; gap: 12px; }

/* Model page */
.upload { margin: 18px 0; }
.check { border-radius: 8px; padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.check.ok { background: var(--ok-bg); border: 1px solid #b9e0c6; } .check.bad { background: var(--err-bg); border: 1px solid #f3b8b2; }
.bad-list { color: var(--err); font-weight: 600; }

/* Chat drawer (every page) */
.ask-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; border-radius: 999px; padding: 12px 20px; background: var(--accent); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(23, 32, 51, .3); }
.ask-fab:hover { background: #17407f; }
.drawer { position: fixed; right: 16px; bottom: 76px; width: min(460px, calc(100vw - 32px)); height: min(640px, calc(100vh - 100px)); z-index: 45; box-shadow: 0 12px 40px rgba(23, 32, 51, .28); border-radius: 10px; }
.drawer[hidden] { display: none; }
.chat-main.in-drawer { height: 100%; min-height: 0; }
.chat-main.in-drawer .chat-log { max-height: none; min-height: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.chat-msg code { background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 3px; }

@media (max-width: 1100px) { .panel-grid { grid-template-columns: minmax(0, 1fr); } .ctl-panel { position: static; max-height: none; } }
@media (max-width: 760px) {
  .rail { flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 2px; }
  .rail a { padding: 6px 10px; border-left: 0; border-bottom: 2px solid transparent; font-size: 14px; }
  .rail a.active { border-bottom-color: #f2c14e; }
  .rail .brand { width: 100%; font-size: 18px; margin: 0 0 4px; padding: 0 10px 6px; }
  .rail .brand br { display: none; } .rail .brand .bl span::before { content: " "; }
  .rail .ri, .rail-collapse { display: none !important; }   /* on a phone the menu is a row of words; no icon mode */
  .rail-top { width: 100%; }
  .rail-foot { width: 100%; padding: 6px 10px; }
  .tabletools input[type=search] { width: 100%; }
  .kpi.hero .v { font-size: 30px; }
  .gcols { margin-left: 44px; }
  .ask-fab { right: 12px; bottom: 12px; }
  .ctl-input input { width: 84px; }
}
@media print { .ctl-panel { position: static; max-height: none; } .panel-grid { grid-template-columns: 300px 1fr; } .localbar, .ask-fab, .drawer { display: none !important; } }
details.inline-list { display: inline; } details.inline-list summary { display: inline; cursor: pointer; color: var(--accent); }
/* Keep wide tables scrolling inside their box instead of stretching the page (phones) */
main { min-width: 0; }
.panel.scroll, .viz-card, .res, .chat-main { max-width: 100%; min-width: 0; }
.topbar > div:first-child { min-width: 0; }
h1 { overflow-wrap: anywhere; }
@media (max-width: 760px) { .ctl-shows { white-space: normal; } .ctl-panel { min-width: 0; } }
.res { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 700px) { .viz-grid { grid-template-columns: minmax(0, 1fr); } }
.inline { flex-wrap: wrap; max-width: 100%; } .inline select, .res-bar select { max-width: 100%; min-width: 0; }
.seg-btns { justify-self: start; }

/* ===== Floating Controls panel (stays on top of every page) ===== */
.fpanel { position: fixed; z-index: 44; background: #172033; color: #e6ebf4; display: flex; flex-direction: column; box-shadow: -8px 0 28px rgba(23, 32, 51, .28); font-size: 14px; }
.fpanel.dock { top: 0; right: 0; bottom: 0; width: var(--panel-w, 400px); }
.fpanel.float { border-radius: 10px; resize: both; overflow: hidden; min-width: 320px; min-height: 220px; max-width: 96vw; max-height: 96vh; box-shadow: 0 14px 40px rgba(23, 32, 51, .38); }
.fpanel.float .fp-head { cursor: move; }
.fpanel.min { right: 16px; bottom: 76px; width: 340px; border-radius: 10px; }
.fpanel.min .fp-body, .fpanel.min .fp-actions, .fpanel.min .fp-resize { display: none; }
.fpanel.in-pip { position: static; width: 100% !important; height: 100vh !important; resize: none; box-shadow: none; border-radius: 0; }
.fpanel.in-pip .fp-resize, .fpanel.in-pip [data-mode], .fpanel.in-pip [data-pop] { display: none; }
body.pip-body { display: block; margin: 0; background: #172033; min-height: 100vh; }
body.panel-docked main { padding-right: calc(var(--panel-w, 400px) + 28px); }
body.panel-docked .ask-fab { right: calc(var(--panel-w, 400px) + 20px); }
body.panel-docked .drawer { right: calc(var(--panel-w, 400px) + 16px); }
.fp-resize { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 2; }
.fpanel:not(.dock) .fp-resize { display: none; }
.fp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #2a3652; user-select: none; }
.fp-title { display: flex; flex-direction: column; min-width: 0; }
.fp-title b { font-size: 15px; color: #fff; }
.fp-ver { font-size: 12px; color: #9fb0cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-ver .badge { margin-left: 6px; font-size: 11px; padding: 0 6px; }
.fp-btns { display: flex; gap: 2px; flex: none; }
.fp-btns button { width: 28px; height: 28px; padding: 0; border-radius: 6px; background: transparent; border: 1px solid transparent; color: #c9d2e3; font-size: 15px; line-height: 1; }
.fp-btns button:hover { border-color: #3a4766; background: #22304d; }
.fp-btns button.on { background: #2a3652; color: #f2c14e; }
.fp-body { flex: 1; overflow: auto; padding: 8px 12px 4px; min-height: 0; }
.fp-tools { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; flex-wrap: wrap; }
.fp-tools .ghost { color: #8fb3ff; padding: 2px 6px; font-size: 13px; }
.ghost-link { color: #8fb3ff; font-size: 13px; margin-left: auto; }
body.on-projection .to-proj { display: none; }
.fp-actions { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid #2a3652; background: #1b2640; flex-wrap: wrap; }
.fp-actions button { padding: 7px 12px; }
.fp-foot { color: #8f9bb3 !important; margin: 10px 0 6px !important; }
/* years strip */
.pyears { background: #22304d; border-radius: 8px; padding: 6px 8px 8px; }
.pyears-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #f2c14e; margin-bottom: 4px; }
.pyears-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; }
.pyears-row div { display: flex; flex-direction: column; background: #172033; border-radius: 6px; padding: 4px 2px; }
.pyears-row span { font-size: 11px; color: #9fb0cc; }
.pyears-row b { font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }
/* collapsible sections: the title bar always stays visible */
.psec { margin-top: 8px; border: 1px solid #2a3652; border-radius: 7px; overflow: hidden; }
.psec-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #22304d; cursor: pointer; user-select: none; border-bottom: 1px solid #2a3652; }
.psec-head:hover { background: #283860; }
.psec-head:focus-visible { outline: 2px solid #f2c14e; outline-offset: -2px; }
.psec-title { flex: 1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #f2c14e; }
.psec-caret { color: #f2c14e; transition: transform .12s; display: inline-block; width: 12px; }
.psec.collapsed .psec-caret { transform: rotate(-90deg); }
.psec.collapsed .psec-head { border-bottom: 0; }
.psec.collapsed .psec-body, .psec.collapsed .phelp.sec { display: none; }
.psec-count { font-size: 11px; color: #172033; background: #f2c14e; border-radius: 999px; padding: 0 7px; }
.psec-count:empty { display: none; }
.psec.has-bad .psec-count { background: #e34948; color: #fff; }
.psec-body { padding: 4px 6px 8px; }
.pinfo { border: 0; background: transparent; color: #8fb3ff; padding: 0 3px; font-size: 13px; line-height: 1; cursor: pointer; }
.pinfo:hover { color: #fff; }
.phelp { font-size: 12.5px; line-height: 1.4; background: #22304d; color: #dfe6f3; padding: 7px 9px; border-radius: 6px; margin: 4px 2px; border-left: 3px solid #8fb3ff; }
.phelp.sec { margin: 0; border-radius: 0; }
.ctl .phelp { grid-column: 1 / -1; }
.ctl { grid-template-areas: "label label" "input shows" "help help"; }
/* grid sections (Compensation, Revenue tiers) */
.pgrid { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 13px; }
.fpanel .pgrid th, .fpanel .pgrid td { background: transparent; border: 0; padding: 3px 3px; color: #c9d2e3; vertical-align: middle; }
.fpanel .pgrid thead th { font-size: 11.5px; font-weight: 600; color: #9fb0cc; text-align: right; border-bottom: 1px solid #2a3652; }
.fpanel .pgrid tbody th { font-weight: 400; text-align: left; font-size: 12.5px; line-height: 1.25; }
.pgrid tr.spare { opacity: .55; }
.pgrid tr.spare th { font-style: italic; }
.gcell { display: flex; align-items: center; gap: 2px; }
.gcell input { flex: 1; width: 0; min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; padding: 4px 5px; font-size: 13px; background: #fff6c8; border-color: #e6d27a; color: #1c2430; font-weight: 600; }
.gcell input:disabled { background: #2a3652; border-color: #3a4766; }
.gcell .unit { color: #8f9bb3; font-size: 11px; min-width: 8px; }
.gstep { display: flex; flex-direction: column; }
.gstep button { width: 18px; height: 13px; padding: 0; font-size: 8px; line-height: 1; border-radius: 3px; background: #2a3652; border: 1px solid #3a4766; color: #fff; }
.gstep button:hover { border-color: #f2c14e; }
.gcell.changed input { box-shadow: 0 0 0 2px #f2c14e; }
.gcell.bad input, .ctl.bad input { background: #fde3e1; border-color: #e34948; color: #b42318; }
/* left-menu toggle */
.rail a.rail-toggle { margin-top: 6px; color: #f2c14e; }
.rail a.rail-toggle.on { background: #202b45; }
/* phones: the panel becomes a sheet at the bottom of the screen */
@media (max-width: 760px) {
  .fpanel, .fpanel.dock, .fpanel.float { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: auto !important; height: auto !important; max-height: 72vh; border-radius: 12px 12px 0 0; resize: none; }
  .fpanel.min { left: 0; right: 0; width: auto; bottom: 0; border-radius: 12px 12px 0 0; }
  .fp-btns [data-mode="dock"], .fp-btns [data-mode="float"], .fp-btns [data-pop] { display: none; }
  body.panel-docked main { padding-right: 18px; }
}
@media print { .fpanel { display: none !important; } body.panel-docked main { padding-right: 0; } }
.fp-title b .badge { margin-left: 6px; font-size: 11px; padding: 0 6px; vertical-align: 2px; }
/* Grouped tables (5-Yr Projection lines): a title bar per section that collapses its lines but always stays visible */
tr.grp td { background: #22304d; color: #f2c14e; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 7px 10px; cursor: pointer; border-color: #22304d; user-select: none; }
tr.grp:hover td { background: #283860; }
tr.grp:focus-visible td { outline: 2px solid #f2c14e; outline-offset: -2px; }
tr.grp .grp-caret { display: inline-block; width: 16px; transition: transform .12s; }
tr.grp.closed .grp-caret { transform: rotate(-90deg); }
tr.grp .grp-n { color: #c9d2e3; text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 10px; font-size: 12px; }
tr.grp .grp-chg { background: #f2c14e; color: #172033; border-radius: 999px; padding: 0 8px; margin-left: 8px; text-transform: none; letter-spacing: 0; font-size: 11.5px; font-weight: 600; }
@media print { tr.grp td { background: #e9eef5 !important; color: #172033 !important; } }

tr.archived td { color: var(--ink-3); background: #fafafa; }
tr.archived td a { color: var(--ink-2); }
.pick-search { width: 100%; margin-bottom: 8px; }

/* ---------- Model Detail: the sheet as in Excel ---------- */
.grp-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sheet-wrap { overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
table.sheet { border-collapse: collapse; table-layout: fixed; width: max-content; font-size: 12px; }
table.sheet th.cl, table.sheet th.corner { position: sticky; top: 0; z-index: 3; background: #eef1f6; color: #5a6475; font-weight: 500; font-size: 11px; text-align: center; border: 1px solid #dde2ea; padding: 2px 0; }
table.sheet th.corner { left: 0; z-index: 4; }
table.sheet th.rn { position: sticky; left: 0; z-index: 2; background: #eef1f6; color: #5a6475; font-weight: 400; font-size: 11px; text-align: right; padding: 0 6px; border: 1px solid #dde2ea; }
table.sheet td { border: 1px solid #eef1f5; padding: 1px 4px; height: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1c2430; }
table.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.sheet td.h-center, table.sheet td.h-centerContinuous { text-align: center; }
table.sheet td.h-right { text-align: right; }
table.sheet td.h-left { text-align: left; }
table.sheet td.chg { box-shadow: inset 0 0 0 2px #f2c14e; background-color: #fff6d6 !important; }
table.sheet tr.blank td { height: 6px; padding: 0; border-left-color: transparent; border-right-color: transparent; }
table.sheet tr.sgroup td { background: #e9f0fb; color: #1f4e9c; cursor: pointer; font-size: 12px; padding-top: 3px; padding-bottom: 3px; border-color: #d9e3f3; }
table.sheet tr.sgroup.open td { background: #f6f8fc; color: #5a6475; }
table.sheet tr.sgroup:hover td { background: #dce7f8; }
table.sheet .gtog { display: inline-block; width: 14px; }
.why-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.why-table { overflow-x: auto; }
table.why td, table.why th { white-space: nowrap; }
table.why tr.subh th { font-size: 11px; color: var(--ink-2); font-weight: 400; }
table.why tr.star td { background: #fff4e5; font-weight: 600; }
table.why tr.tot td { font-weight: 600; border-top: 1px solid var(--rule); }
table.why tr.net td { font-weight: 700; }
table.why .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
@media print { .sheet-wrap { max-height: none; overflow: visible; } .grp-tools, #hidCols { display: none; } }
table.sheet tr.sgroup .glabel { position: sticky; left: 54px; }
/* Panel tables with more than two columns (Capital investment: five years) */
.fpanel .pgrid.many th, .fpanel .pgrid.many td { padding: 2px 1px; }
.fpanel .pgrid.many tbody th { font-size: 11.5px; width: 58px; }
.fpanel .pgrid.many thead th { text-align: center; }
.pgrid.many .gcell { gap: 1px; }
.pgrid.many .gcell input { min-width: 30px; padding: 4px 2px; font-size: 12px; }
.pgrid.many .gcell .unit { display: none; }
.fpanel .pgrid.many thead th.gcorner { text-align: left; color: #f2c14e; font-weight: 600; }
.pgrid.many .gstep button { width: 13px; }
/* A long version name in "Open another version…" must not make the page wider than a phone */
.topbar, .topbar > div { min-width: 0; }
.actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.actions select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
/* "Why Flat Fee" table: lines nest like the workbook's expense groups */
table.why tr.wh { display: none; }
table.why .wtog { border: 0; background: none; padding: 0 4px 0 0; cursor: pointer; color: #1f4e9c; font-size: 12px; width: 16px; }

/* ---------- Left menu: icons, and « to collapse it to a thin strip of icons with tooltips ---------- */
.rail-top { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #2a3652; margin-bottom: 20px; }
.rail-top .brand { border-bottom: 0 !important; margin-bottom: 0 !important; flex: 1; }
.rail .bm { display: none; }
.rail-collapse { margin: 2px 10px 0 0; width: 26px; height: 26px; border-radius: 6px; border: 1px solid #2a3652; background: transparent; color: #9fb0cc; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.rail-collapse:hover { color: #fff; border-color: #f2c14e; }
.rail .ri { display: inline-flex; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; flex: none; }
.rail .ri svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 761px) {
  body.rail-mini { grid-template-columns: 58px 1fr; }
  body.rail-mini .rail .rl, body.rail-mini .rail .bl, body.rail-mini .rail-foot { display: none; }
  body.rail-mini .rail-top { flex-direction: column; align-items: center; gap: 8px; padding-bottom: 10px; }
  body.rail-mini .rail .bm { display: block; text-align: center; font-size: 22px; color: #f2c14e; }
  body.rail-mini .rail .brand { padding: 0 0 4px; }
  body.rail-mini .rail-collapse { margin: 0; }
  body.rail-mini .rail a:not(.brand) { padding: 11px 0; text-align: center; }
  body.rail-mini .rail .ri { margin: 0; width: 20px; height: 20px; }
  body.rail-mini .rail .ri svg { width: 20px; height: 20px; }
}
/* Sign out sits at the bottom of the menu, above the name, in both the full and the icon-only menu */
.rail a.rail-signout { margin-top: auto; border-top: 1px solid #2a3652; }
.rail a.rail-signout + .rail-foot { margin-top: 0; }
@media (max-width: 760px) { .rail a.rail-signout { margin-top: 0; border-top: 0; } }

/* v03: people beside each personnel line (5-Yr Projection "Show people") */
.ppl { font-size: 11.5px; color: var(--ink-3); font-weight: 400; white-space: nowrap; margin-top: 1px; }
/* v03: deficits in red, losses covered by capital in amber (Lennie: "make it red highlighting so it is obvious as a cash warning") */
.flag-red { background: var(--err-bg); color: var(--err); font-weight: 700; box-shadow: 0 0 0 3px var(--err-bg); border-radius: 2px; }
.flag-amber { background: var(--warn-bg); color: #8a5a00; font-weight: 600; box-shadow: 0 0 0 3px var(--warn-bg); border-radius: 2px; }
.kpi.flag-red-card { background: var(--err-bg); border-color: var(--err); }
.kpi.flag-red-card .v, .kpi.flag-red-card .l { color: var(--err); }
.kpi.flag-amber-card { background: var(--warn-bg); border-color: var(--warn); }
.kpi.flag-amber-card .l { color: #8a5a00; }
.year-pick select { font-weight: 600; }

/* ---------- 2026-10-05 (Lennie): a tighter panel, draggable sections, 5-year Live results in $M ---------- */
.fp-head { padding: 6px 10px; }
.fp-title b { font-size: 14px; }
.fp-btns button { width: 24px; height: 24px; font-size: 14px; }
.fp-body { padding: 6px 8px 4px; }
.fp-tools { margin: 4px 0 0; gap: 2px; }
.fp-tools .ghost { padding: 1px 5px; font-size: 12px; }
.fp-actions { padding: 6px 10px; gap: 6px; }
.fp-actions button { padding: 4px 10px; }
.fp-foot { margin: 6px 0 2px !important; font-size: 11.5px; }
.psec { margin-top: 4px; border-radius: 6px; }
.psec-head { padding: 3px 6px; gap: 5px; }
.psec-title { font-size: 11.5px; }
.psec-body { padding: 2px 4px 3px; }
.psec-unit { font-size: 11px; color: #9fb0cc; font-weight: 600; }
.psec-grip { cursor: grab; color: #6f7f9f; font-size: 13px; line-height: 1; padding: 0 1px; user-select: none; }
.psec-grip:hover { color: #f2c14e; }
.psec-grip:active { cursor: grabbing; }
.psec.dragging { opacity: .45; outline: 2px dashed #f2c14e; outline-offset: -2px; }
.psec-hint { margin: 2px 2px 4px; padding: 5px 8px; font-size: 12px; line-height: 1.35; }
/* single controls: label and box on one line */
.fpanel .ctl { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label input" "shows shows" "help help"; gap: 0 6px; padding: 1px 4px; border-radius: 4px; }
.fpanel .ctl-label { font-size: 12.5px; line-height: 1.2; }
.fpanel .ctl-shows { font-size: 11.5px; line-height: 1.2; }
.fpanel .ctl-shows:empty { display: none; }
.fpanel .ctl-input { gap: 2px; }
.fpanel .ctl-input input { width: 82px; padding: 2px 5px; font-size: 13px; height: 24px; }
.fpanel .ctl-input button { width: 22px; height: 22px; font-size: 14px; border-radius: 4px; }
.fpanel .ctl-input .unit { font-size: 12px; }
.fpanel .seg-btns button { padding: 2px 10px; }
.fpanel .ctl-why { font-size: 11px; margin-top: 0; }
.fpanel .phelp { margin: 2px 1px; padding: 5px 7px; font-size: 12px; }
/* grids */
.fpanel .pgrid { margin-top: 2px; font-size: 12.5px; }
.fpanel .pgrid th, .fpanel .pgrid td { padding: 1px 2px; }
.fpanel .pgrid thead th { font-size: 11px; padding-bottom: 2px; }
.fpanel .pgrid tbody th { font-size: 12px; line-height: 1.15; }
.fpanel .gcell input { padding: 2px 4px; font-size: 12.5px; height: 22px; }
.fpanel .gstep button { height: 10px; font-size: 7px; }
.fpanel .pgrid.many th, .fpanel .pgrid.many td { padding: 1px 1px; }
.fpanel .pgrid.many .gcell input { padding: 2px 2px; font-size: 12px; }
/* the deals-and-people strip at the top, and the Live results table */
.pyears { padding: 3px 4px 4px; border-radius: 6px; }
.pytab, .ltab { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.pytab th, .pytab td, .ltab th, .ltab td { padding: 1px 2px; border: 0; background: transparent; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pytab thead th, .ltab thead th { font-size: 10.5px; color: #9fb0cc; font-weight: 600; }
.pytab tbody th, .ltab tbody th { text-align: left; font-weight: 400; color: #c9d2e3; font-size: 11.5px; }
.pytab thead th:first-child { width: 52px; }
.ltab thead th:first-child { width: 92px; }
.pytab td { font-size: 12.5px; color: #fff; font-weight: 600; }
.ltab td { font-size: 12px; color: #fff; }
.ltab tr.b td, .ltab tr.b th { font-weight: 700; }
.ltab tbody tr + tr th, .ltab tbody tr + tr td { border-top: 1px solid #22304d; }
.ltab td.neg { color: #ffb4ad; background: rgba(227, 73, 72, .28); font-weight: 700; }
.out.tie { margin-top: 4px; border-top: 1px solid #2a3652; border-bottom: 0; font-size: 11.5px; padding: 3px 2px 0; }
.out.tie span { color: #8f9bb3; }
.out.tie b { color: #6fd08c; font-weight: 600; }
/* Model Detail: the year picker right above each table */
.why-year { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.year-pick { font-weight: 600; }
.year-pick select { font-weight: 700; border-color: #1f4e9c; }
/* the v03 test copy (fork) is labelled NEXT */
.next-tag { background: #f2c14e; color: #172033; border-radius: 4px; padding: 0 5px; font-size: 11px; letter-spacing: .04em; vertical-align: 2px; }

/* ---------- 2026-10-05 (Lennie, 32-inch screens): the page uses the full width up to the panel ---------- */
main { max-width: none !important; }
/* 5-Yr Projection / Compare: sub-sections inside a section, and section bars that can be dragged into another order */
tr.grp.sub td { background: #e9eef6; color: #1f4e9c; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12.5px; padding: 4px 10px 4px 28px; border-color: #dfe6f1; }
tr.grp.sub:hover td { background: #dce6f5; }
tr.grp.sub .grp-n { color: #5a6475; }
tr.grp .grp-grip { cursor: grab; color: #8f9bb3; margin-right: 6px; font-size: 13px; }
tr.grp .grp-grip:hover { color: #f2c14e; }
tr.grp.dragging td { opacity: .5; }
tr.grp.dropto-before td { box-shadow: inset 0 3px 0 #f2c14e; }
tr.grp.dropto-after td { box-shadow: inset 0 -3px 0 #f2c14e; }
/* Model Detail sheet: Excel-like outline (⊞ / ⊟ per group, level buttons) with its toolbar right above the sheet */
.sheet-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; padding: 6px 8px; background: #f3f6fb; border: 1px solid #dde4ef; border-radius: 6px; }
.sheet-tools button { padding: 3px 10px; font-size: 13px; }
.sheet-tools .lvl { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: #5a6475; margin-right: 6px; }
.sheet-tools .lvlbtn { width: 26px; padding: 2px 0; font-weight: 700; border: 1px solid #9fb3d6; background: #fff; color: #1f4e9c; }
.sheet-tools .lvlbtn:hover { background: #e9f0fb; }
table.sheet tr.sgroup td { background: #e3ecfa; color: #17366e; border-color: #cfdcf2; padding-top: 3px; padding-bottom: 3px; }
table.sheet tr.sgroup.open td { background: #f4f7fc; color: #3b4a63; }
table.sheet tr.sgroup .gbox { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border: 1px solid #5a77a8; border-radius: 2px; background: #fff; color: #17366e; font-size: 12px; line-height: 1; font-weight: 700; margin-right: 7px; vertical-align: -1px; }
table.sheet tr.sgroup .gcount { color: #6b7a93; font-weight: 400; font-size: 11.5px; margin-left: 4px; }
table.sheet tr.sgroup.lv1 b { font-weight: 700; }
table.sheet tr.sgroup.lv2 b, table.sheet tr.sgroup.lv3 b { font-weight: 600; }
/* chat history */
.chat-hist { border: 1px solid var(--rule); border-radius: 8px; background: #f7f9fc; padding: 8px 10px; margin-bottom: 8px; max-height: 320px; overflow: auto; }
.chat-hist .ch-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.chat-hist ul { list-style: none; margin: 0; padding: 0; }
.chat-hist li { display: flex; align-items: center; gap: 6px; border-top: 1px solid #e3e8f0; padding: 4px 0; }
.chat-hist li.on .ch-open b { color: #1f4e9c; }
.chat-hist .ch-open { flex: 1; text-align: left; border: 0; background: transparent; padding: 4px 6px; display: flex; flex-direction: column; gap: 1px; cursor: pointer; border-radius: 6px; }
.chat-hist .ch-open:hover { background: #e9f0fb; }
.chat-hist .ch-open span { color: var(--ink-3); font-size: 12px; }
/* v03.1: cash runway, month by month */
.runway { margin-top: 4px; }
.rw-plot { position: relative; display: flex; align-items: stretch; height: 150px; gap: 1px; border-bottom: 1px solid var(--rule); }
.rw-col { flex: 1; position: relative; }
.rw-bar { position: absolute; left: 0; right: 0; background: #2a78d6; border-radius: 1px; }
.rw-bar.neg { background: #d93025; }
.rw-zero { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #5a6475; pointer-events: none; }
.rw-axis { position: relative; height: 16px; font-size: 11px; color: var(--ink-3); }
.rw-axis span { position: absolute; top: 2px; padding-left: 2px; border-left: 1px solid var(--rule); }
.neg-txt { color: var(--err); }

/* runway: range switch and y labels */
.rw-range { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 4px; }
.rw-range button { font: inherit; font-size: 11px; padding: 2px 8px; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); border-radius: 10px; cursor: pointer; }
.rw-range button.on { background: #2a78d6; border-color: #2a78d6; color: #fff; }
.rw-wrap { position: relative; padding-left: 46px; }
.rw-y { position: absolute; left: 0; width: 42px; text-align: right; font-size: 10px; color: var(--ink-3); }
.rw-y.top { top: 0; } .rw-y.bot { top: 138px; }
.rw-axis span.q { color: var(--ink-3); opacity: .7; border-left-style: dotted; }

/* every page follows the panel: the Dashboard's "Showing" picker, the live panel row on Saved versions */
.dash-show { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.dash-show label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dash-show select { font: inherit; font-weight: 400; padding: 5px 8px; border: 1px solid var(--rule); border-radius: 6px; max-width: min(560px, 80vw); background: var(--card, #fff); color: inherit; }
.dash-show .hint { margin: 0; }
button.linkish { background: none; border: 0; padding: 0; color: #2a78d6; text-decoration: underline; cursor: pointer; font: inherit; }
.badge.info { background: #e6f4ea; color: #1e7e34; }
tr.live-row td { background: rgba(0, 131, 0, .05); }

/* 2.5: the app's code release under the name; drag-and-drop Dashboard charts */
.app-ver { display: block; width: 100%; margin: -2px 0 10px; padding: 0 10px; background: none; border: 0; text-align: left; font: inherit; font-size: 11px; color: #9fb0cc; cursor: pointer; }
.app-ver:hover { color: #fff; text-decoration: underline; }
.app-ver .av-short { display: none; }
body.rail-mini .app-ver { text-align: center; padding: 0; } body.rail-mini .app-ver .av-long { display: none; } body.rail-mini .app-ver .av-short { display: inline; }
.rel-notes { max-height: 60vh; overflow: auto; max-width: 620px; }
.rel-notes h4 { margin: 12px 0 4px; } .rel-notes h4:first-child { margin-top: 0; } .rel-notes ul { margin: 0 0 6px; padding-left: 20px; } .rel-notes li { margin: 2px 0; }
.card-grip { cursor: grab; color: var(--ink-3); margin-right: 8px; user-select: none; font-weight: 400; border-radius: 3px; padding: 0 2px; }
.card-grip:hover, .card-grip:focus { color: #2a78d6; background: var(--rule-2); outline: none; }
.viz-card.dragging { opacity: .45; outline: 2px dashed #2a78d6; outline-offset: 2px; }
.dash-show .reset-cards { margin-left: auto; font-size: 12px; }

.upd-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2000; background: #1f2a44; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); flex-wrap: wrap; }
.upd-bar button { white-space: nowrap; }

/* 2.6: choices shown as words (How the market share is set): one per line, full width */
.seg-btns.words { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.seg-btns.words button { width: 100%; text-align: left; padding: 5px 10px; white-space: normal; }

/* 2.8: Compare sections open and close from their headings */
details.cmp-sec { margin: 6px 0 4px; }
details.cmp-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.cmp-sec > summary::-webkit-details-marker { display: none; }
details.cmp-sec > summary::before { content: "▾"; color: var(--ink-3); font-size: 14px; width: 14px; }
details.cmp-sec:not([open]) > summary::before { content: "▸"; }
details.cmp-sec > summary h2 { margin: 14px 0 8px; display: inline; }
details.cmp-sec:not([open]) { border-bottom: 1px solid var(--rule); padding-bottom: 6px; }

/* 2.9: the panel says what it is working on, and can switch it */
.fp-working { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: #9fb0cc; min-width: 0; }
.fp-working b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-working span { color: #f2c14e; text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; }
.fp-meta { font-size: 11px; color: #9fb0cc; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 2.12: every table can group its rows ("Group by", Expand all / Collapse all) */
.tabletools .gby { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tabletools .gby select { font-size: 13px; padding: 4px 6px; max-width: 220px; }
