:root{
  --navy:#0E2D4D; --brand-green:#31A26B;
  --bg:#F4F6F9; --surface:#FFFFFF; --surface-2:#EDF2F8; --surface-3:#E6F0FA;
  --line:#DBE3ED; --line-strong:#C3CFDE;
  --ink:#0E2D4D; --ink-2:#44576F; --ink-3:#7B8CA2;
  --accent:#1C8B55; --accent-fill:#31A26B; --accent-soft:#E2F3EA; --accent-line:#A9DBBF;
  --good:#1C8B55; --good-soft:#E2F3EA;
  --warn:#A96500; --warn-soft:#FCF0DC;
  --crit:#B3372A; --crit-soft:#FBE7E4;
  --info:#1F5FCB; --info-soft:#E4EDFC;
  --rail:#0E2D4D; --rail-2:#173C63; --rail-ink:#C8D8E8; --rail-line:#22456E;
  --shadow-sm:0 1px 2px rgba(14,45,77,.07);
  --shadow:0 6px 20px -8px rgba(14,45,77,.22);
  --shadow-lg:0 24px 60px -20px rgba(14,45,77,.4);
  --r:10px; --r-sm:7px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#081726; --surface:#0F2942; --surface-2:#153351; --surface-3:#1A3D5E;
    --line:#22415F; --line-strong:#31597C;
    --ink:#E9F1F8; --ink-2:#A8BDD3; --ink-3:#7A92AC;
    --accent:#5CC68B; --accent-fill:#31A26B; --accent-soft:#12352A; --accent-line:#2A6146;
    --good:#5CC68B; --good-soft:#12352A;
    --warn:#E5A63F; --warn-soft:#3A2A0E;
    --crit:#F0837A; --crit-soft:#3B1815;
    --info:#7BA9F5; --info-soft:#122844;
    --rail:#061320; --rail-2:#102b46; --rail-ink:#A8BDD3; --rail-line:#1B3A58;
    --shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --shadow:0 6px 20px -8px rgba(0,0,0,.6);
    --shadow-lg:0 24px 60px -20px rgba(0,0,0,.75);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#081726; --surface:#0F2942; --surface-2:#153351; --surface-3:#1A3D5E;
  --line:#22415F; --line-strong:#31597C;
  --ink:#E9F1F8; --ink-2:#A8BDD3; --ink-3:#7A92AC;
  --accent:#5CC68B; --accent-fill:#31A26B; --accent-soft:#12352A; --accent-line:#2A6146;
  --good:#5CC68B; --good-soft:#12352A;
  --warn:#E5A63F; --warn-soft:#3A2A0E;
  --crit:#F0837A; --crit-soft:#3B1815;
  --info:#7BA9F5; --info-soft:#122844;
  --rail:#061320; --rail-2:#102b46; --rail-ink:#A8BDD3; --rail-line:#1B3A58;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow:0 6px 20px -8px rgba(0,0,0,.6);
  --shadow-lg:0 24px 60px -20px rgba(0,0,0,.75);
  color-scheme:dark;
}
*{box-sizing:border-box}

/* ---------- how big the interface draws itself ----------
   Every size below is a fixed pixel value, chosen against a laptop-sized
   window. Left alone that means a 27" monitor shows the same layout as a
   13" one with a lot of empty desk around it, and a half-width window shows
   the same layout with no room at all.

   Rather than carry a second set of sizes through a thousand lines of CSS,
   the whole shell is drawn at one scale factor and the browser does the
   multiplying. `zoom` affects layout, not just painting, so text, spacing,
   borders, icons and hit targets all grow in step and stay crisp — and the
   breakpoints further down still measure real pixels, so a scaled-up 2560px
   window reflows like the ~1950px of room it now behaves as.

   The factor is the SMALLER of what the width allows and what the height
   allows. A wide but shallow window — half a big monitor, or a laptop with
   the dock and a browser bar eating the screen — would otherwise scale up
   and push rows off the bottom, which is the opposite of useful. */
:root{
  --ui-w:1;        /* what the width can take */
  --ui-h:1.6;      /* what the height can take: starts above every rung */
  --ui-wall:1;     /* the floor wallboard, read from across the room */
  --ui-user:1;     /* the one nudge a person can make, from the topbar */
  --ui:min(var(--ui-w), var(--ui-h));
}
@media (min-width:1500px){ :root{--ui-w:1.05; --ui-wall:1.15} }
@media (min-width:1700px){ :root{--ui-w:1.12; --ui-wall:1.26} }
@media (min-width:1900px){ :root{--ui-w:1.20; --ui-wall:1.38} }
@media (min-width:2200px){ :root{--ui-w:1.30; --ui-wall:1.52} }
@media (min-width:2600px){ :root{--ui-w:1.40; --ui-wall:1.68} }
@media (min-width:3200px){ :root{--ui-w:1.55; --ui-wall:1.9} }
/* descending, so the shallowest window that matches has the last word */
@media (max-height:1000px){ :root{--ui-h:1.20} }
@media (max-height:900px) { :root{--ui-h:1.12} }
@media (max-height:820px) { :root{--ui-h:1.05} }
@media (max-height:740px) { :root{--ui-h:1} }

body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:'Poppins','Segoe UI',system-ui,-apple-system,sans-serif;
  font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased;
  /* --vh / --vw are a viewport in the shell's own scaled units. Viewport
     units themselves ignore zoom, so anything that wants "one screenful"
     has to divide, or it overshoots by exactly the scale factor. */
  --scale:calc(var(--ui) * var(--ui-user));
  --vh:calc(100vh / var(--scale));
  --vw:calc(100vw / var(--scale));
  zoom:var(--scale);
}
h1,h2,h3,h4{margin:0; text-wrap:balance; letter-spacing:-.01em; font-weight:600}
button{font:inherit; color:inherit; cursor:pointer}
input,select,textarea{font:inherit; color:inherit}
a{color:var(--accent)}
.mono{font-family:'IBM Plex Mono',ui-monospace,monospace; font-size:.92em; letter-spacing:-.02em}
.num{font-variant-numeric:tabular-nums}
svg.ico{width:15px; height:15px; flex:0 0 auto}
:focus-visible{outline:2px solid var(--accent-fill); outline-offset:2px; border-radius:4px}
@media (prefers-reduced-motion:reduce){*{animation:none!important; transition:none!important}}

/* ---------- shell ---------- */
#app{display:grid; grid-template-columns:250px 1fr; min-height:var(--vh)}
.rail{
  background:var(--rail); color:var(--rail-ink); display:flex; flex-direction:column;
  position:sticky; top:0; height:var(--vh); overflow-y:auto; overflow-x:hidden;
  border-right:1px solid var(--rail-line);
}
.rail::-webkit-scrollbar{width:8px}
.rail::-webkit-scrollbar-thumb{background:#20456d; border-radius:8px}
.brand{display:flex; align-items:center; gap:10px; padding:18px 16px 14px}
.brand .mark{flex:0 0 auto}
.brand .wordmark{display:flex; flex-direction:column; line-height:1}
.brand .wordmark b{color:#fff; font-size:19px; font-weight:600; letter-spacing:-.02em}
.brand .wordmark span{color:var(--brand-green); font-size:9px; font-weight:600; letter-spacing:.26em; margin-top:3px}
.brand-rule{height:2px; background:var(--brand-green); margin:0 16px 14px; opacity:.85}

.navgroup{border-bottom:1px solid var(--rail-line)}
.navgroup > button.grouphead{
  width:100%; display:flex; align-items:center; gap:9px; background:none; border:0;
  padding:11px 16px; text-align:left; color:#8FA6BE; font-size:10.5px; font-weight:600;
  letter-spacing:.13em; text-transform:uppercase;
}
.navgroup > button.grouphead:hover{color:#fff}
.grouphead .chev{margin-left:auto; transition:transform .16s ease; opacity:.7}
.navgroup[data-open="false"] .chev{transform:rotate(-90deg)}
.navgroup[data-open="false"] .grouplist{display:none}
.grouplist{padding:0 8px 9px; display:flex; flex-direction:column; gap:1px}
.navitem{
  display:flex; align-items:center; gap:9px; width:100%; background:none; border:0;
  padding:7px 9px; border-radius:var(--r-sm); color:var(--rail-ink); font-size:12.9px;
  text-align:left; font-weight:400;
}
.navitem:hover{background:var(--rail-2); color:#fff}
.navitem[aria-current="true"]{background:var(--rail-2); color:#fff; font-weight:500; box-shadow:inset 2px 0 0 var(--brand-green)}
.navitem .ico{width:15px; height:15px; flex:0 0 auto; opacity:.8}
.navitem[aria-current="true"] .ico{opacity:1; color:var(--brand-green)}
.navitem .count{
  margin-left:auto; font-size:10.5px; font-weight:600; padding:1px 6px; border-radius:20px;
  background:#1d456e; color:#D8E6F3; font-variant-numeric:tabular-nums;
}
.navitem .count.hot{background:var(--brand-green); color:#04281a}
.navitem .count.crit{background:#B3372A; color:#fff}
.railfoot{margin-top:auto; padding:12px 16px 16px; font-size:11px; color:#6C86A2}

/* ---------- topbar ---------- */
main{min-width:0; display:flex; flex-direction:column}
.topbar{
  position:sticky; top:0; z-index:30; background:color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter:blur(10px); border-bottom:1px solid var(--line);
  display:flex; align-items:center; gap:12px; padding:10px 22px;
}
.crumb{display:flex; align-items:baseline; gap:9px; min-width:0; flex:1 1 auto}
/* the title holds its ground — the search box and the strapline beside it are
   what give way — and truncates rather than sliding under anything if the
   window gets narrow enough that even that is not enough */
.crumb h1{font-size:16px; font-weight:600; white-space:nowrap; flex:0 0 auto;
  overflow:hidden; text-overflow:ellipsis}
.crumb .sub{font-size:12px; color:var(--ink-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0}
.searchbox{margin-left:auto; flex:0 0 auto; position:relative; display:flex; align-items:center}
.searchbox input{
  width:250px; padding:7px 10px 7px 30px; border-radius:20px; border:1px solid var(--line);
  background:var(--bg); font-size:13px;
}
.searchbox svg{position:absolute; left:10px; color:var(--ink-3); width:14px; height:14px}
.whoami{display:flex; align-items:center; gap:8px; padding-left:4px}
.whoami select{
  border:1px solid var(--line); background:var(--surface); border-radius:20px;
  padding:6px 8px; font-size:12.5px; font-weight:500;
}
.avatar{
  width:30px; height:30px; border-radius:50%; background:var(--navy); color:#fff;
  display:grid; place-items:center; font-size:11.5px; font-weight:600; flex:0 0 auto;
}
.iconbtn{background:var(--surface); border:1px solid var(--line); border-radius:8px; width:32px; height:32px; display:grid; place-items:center; color:var(--ink-2)}
.iconbtn:hover{border-color:var(--line-strong); color:var(--ink)}

/* ---------- layout primitives ---------- */
/* no width cap: a page fills whatever room the window gives it, and the
   scale factor above is what stops that reading as "everything is tiny" on
   a big monitor. */
.page{padding:20px 22px 56px; display:flex; flex-direction:column; gap:18px; width:100%; min-width:0}
.banner{
  display:flex; gap:10px; align-items:flex-start; padding:10px 13px; border-radius:var(--r);
  background:var(--warn-soft); color:var(--warn); border:1px solid color-mix(in srgb,var(--warn) 30%, transparent);
  font-size:12.5px;
}
.banner.ok{background:var(--accent-soft); color:var(--accent); border-color:var(--accent-line)}
.banner .btn{color:inherit}
.grid{display:grid; gap:14px}
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-sm)}
.card > header{
  display:flex; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--line);
}
/* an icon in a card header is decoration — it never sets the height of the row,
   whether or not whoever added it remembered the size class */
.card > header > svg{width:15px; height:15px; flex:0 0 auto; color:var(--ink-3)}
.card > header h2{font-size:13.5px; font-weight:600}
.card > header .hint{font-size:11.5px; color:var(--ink-3); margin-left:auto}
.card .body{padding:16px}
.card .body.flush{padding:0}

.tiles{display:grid; grid-template-columns:repeat(auto-fit,minmax(178px,1fr)); gap:12px}
.tile{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:14px 15px;
  display:flex; flex-direction:column; gap:3px; box-shadow:var(--shadow-sm); text-align:left;
}
.tile .lbl{font-size:10.5px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3)}
.tile .val{font-size:25px; font-weight:600; letter-spacing:-.03em; font-variant-numeric:tabular-nums}
.tile .foot{font-size:11.5px; color:var(--ink-3)}
.tile.click:hover{border-color:var(--accent-line); box-shadow:var(--shadow)}
.tile.alert{border-color:color-mix(in srgb,var(--crit) 35%, transparent)}
.tile.alert .val{color:var(--crit)}

/* ---------- table ---------- */
.tablewrap{overflow-x:auto}
table.list{width:100%; border-collapse:collapse; font-size:13px}
table.list th{
  text-align:left; padding:9px 14px; font-size:10.5px; font-weight:600; letter-spacing:.09em;
  text-transform:uppercase; color:var(--ink-3); background:var(--surface-2);
  border-bottom:1px solid var(--line); white-space:nowrap; position:sticky; top:0;
}
table.list td{padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:middle}
table.list tr:last-child td{border-bottom:0}
table.list tbody tr{cursor:pointer}
table.list tbody tr:hover td{background:var(--surface-2)}
td.r,th.r{text-align:right}
.co{display:flex; flex-direction:column; gap:1px; min-width:150px}
.co b{font-weight:500}
.co small{color:var(--ink-3); font-size:11.5px}
.empty{padding:40px 20px; text-align:center; color:var(--ink-3); font-size:13px}
.empty b{display:block; color:var(--ink-2); font-size:14px; font-weight:500; margin-bottom:4px}

/* ---------- chips ---------- */
.chip{
  display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:20px;
  font-size:11px; font-weight:500; white-space:nowrap; border:1px solid transparent;
}
.chip .dot{width:6px; height:6px; border-radius:50%; background:currentColor}
.chip.sales{background:var(--info-soft); color:var(--info)}
.chip.admin{background:var(--warn-soft); color:var(--warn)}
.chip.pricing{background:#EFE7FA; color:#6B3FA0}
.chip.manager{background:var(--surface-3); color:var(--ink-2)}
.chip.finance{background:var(--accent-soft); color:var(--accent)}
.chip.good{background:var(--good-soft); color:var(--good)}
.chip.crit{background:var(--crit-soft); color:var(--crit)}
.chip.warn{background:var(--warn-soft); color:var(--warn)}
.chip.muted{background:var(--surface-2); color:var(--ink-3)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .chip.pricing{background:#26183A; color:#C4A5EE}}
:root[data-theme="dark"] .chip.pricing{background:#26183A; color:#C4A5EE}
.stagepill{
  display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:500;
  padding:3px 9px 3px 7px; border-radius:20px; background:var(--surface-2); color:var(--ink-2);
  border:1px solid var(--line);
}
.stagepill .bar{width:3px; height:11px; border-radius:2px; background:currentColor}

/* ---------- buttons ---------- */
.btn{
  text-decoration:none; white-space:nowrap; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:7px 13px;
  border-radius:8px; border:1px solid var(--line); background:var(--surface); color:var(--ink);
  font-size:13px; font-weight:500; box-shadow:var(--shadow-sm);
}
.btn:hover{border-color:var(--line-strong)}
.btn.primary{background:var(--accent-fill); border-color:var(--accent-fill); color:#fff}
.btn.primary:hover{background:#2A9060; border-color:#2A9060}
.btn.dark{background:var(--navy); border-color:var(--navy); color:#fff}
.btn.dark:hover{background:#17395C; border-color:#17395C}
.btn.ghost{background:transparent; box-shadow:none}
.btn.danger{background:var(--surface); border-color:color-mix(in srgb,var(--crit) 40%,transparent); color:var(--crit)}
.btn.sm{padding:4px 9px; font-size:12px}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btnrow{display:flex; flex-wrap:wrap; gap:8px}

/* ---------- deal workspace ---------- */
.dealhead{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
  box-shadow:var(--shadow-sm); overflow:hidden;
}
.dealhead .top{display:flex; gap:16px; align-items:flex-start; padding:16px 18px; flex-wrap:wrap}
.dealhead h1{font-size:20px; letter-spacing:-.02em}
.dealhead .meta{display:flex; gap:14px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-2); margin-top:6px}
.dealhead .meta span{display:flex; align-items:center; gap:5px}
.dealhead .figs{margin-left:auto; display:flex; gap:22px; text-align:right}
.dealhead .figs div{display:flex; flex-direction:column}
.dealhead .figs .l{font-size:10px; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); font-weight:600}
.dealhead .figs .v{font-size:17px; font-weight:600; font-variant-numeric:tabular-nums}

/* ---------- click to call ---------- */
.callstrip{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px;
  padding:8px 10px; border:1px solid var(--accent-line); border-radius:var(--r);
  background:var(--accent-soft)}
.callstrip > svg{color:var(--accent); flex:0 0 auto}
.callstrip.none{background:var(--surface-2); border-color:var(--line)}
.callstrip.none > svg{color:var(--ink-3)}
.callstrip .csl{font-size:10px; font-weight:600; letter-spacing:.11em; text-transform:uppercase;
  color:var(--accent)}
.callstrip .csbtn{
  display:flex; flex-direction:column; gap:0; text-decoration:none; padding:5px 11px;
  border-radius:8px; border:1px solid var(--accent-line); background:var(--surface);
  color:var(--ink); box-shadow:var(--shadow-sm); min-width:0;
}
.callstrip .csbtn:hover{border-color:var(--accent-fill); background:var(--accent-soft)}
.callstrip .csbtn.first{border-color:var(--accent-fill); box-shadow:0 0 0 2px var(--accent-soft)}
.callstrip .csbtn b{font-size:13.5px; font-weight:600; letter-spacing:-.02em; white-space:nowrap}
.callstrip .csbtn i{font-style:normal; font-size:10.5px; color:var(--ink-3); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; max-width:190px}
.callstrip .csbtn.off{background:var(--surface-2); box-shadow:none; cursor:default}
.callstrip .csbtn.off b{color:var(--ink-2)}
.callstrip .csdnc{
  display:flex; flex-direction:column; padding:5px 11px; border-radius:8px;
  border:1px solid color-mix(in srgb,var(--crit) 35%,transparent); background:var(--crit-soft); color:var(--crit);
}
.callstrip .csdnc b{font-size:13.5px; font-weight:600; text-decoration:line-through}
.callstrip .csdnc i{font-style:normal; font-size:10px; font-weight:600; letter-spacing:.08em; text-transform:uppercase}
.callstrip .csend{margin-left:auto; display:flex; align-items:center; gap:7px; flex-wrap:wrap}
@media (max-width:700px){
  .callstrip .csend{margin-left:0; width:100%}
  .callstrip .csbtn i{max-width:130px}
}

.track{display:flex; gap:0; padding:0 18px 14px; overflow-x:auto}
.track .seg{flex:1 1 0; min-width:96px; display:flex; flex-direction:column; gap:5px}
.track .seg .rule{height:4px; border-radius:3px; background:var(--surface-2)}
.track .seg.done .rule{background:var(--accent-fill)}
.track .seg.now .rule{background:var(--accent-fill); box-shadow:0 0 0 3px var(--accent-soft)}
.track .seg.lost .rule{background:var(--crit)}
.track .seg .t{font-size:10.5px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); padding-right:8px}
.track .seg.now .t{color:var(--accent)}
.track .seg.done .t{color:var(--ink-2)}

.tabs{display:flex; gap:2px; border-bottom:1px solid var(--line); padding:0 18px; overflow-x:auto; background:var(--surface)}
.tab{
  background:none; border:0; padding:10px 12px; font-size:13px; color:var(--ink-3); font-weight:500;
  border-bottom:2px solid transparent; white-space:nowrap;
}
.tab:hover{color:var(--ink)}
.tab[aria-selected="true"]{color:var(--ink); border-bottom-color:var(--accent-fill)}
.tab .b{
  display:inline-block; margin-left:6px; font-size:10px; font-weight:600; padding:0 5px;
  border-radius:20px; background:var(--surface-2); color:var(--ink-2);
}
.tab .b.hot{background:var(--accent-soft); color:var(--accent)}
.tab .b.crit{background:var(--crit-soft); color:var(--crit)}

.split{display:grid; grid-template-columns:minmax(0,1fr) 316px; gap:16px; align-items:start}
@media (max-width:1080px){ .split{grid-template-columns:1fr} }
/* squeezed but not yet narrow: claw back the room the rail and the page
   margins are taking, so the content keeps the width instead */
@media (min-width:861px) and (max-width:1180px){
  #app{grid-template-columns:206px 1fr}
  .page{padding:16px 16px 48px}
  .topbar{padding:9px 16px}
  .searchbox input{width:180px}
  /* the strapline under the page title is the first thing to go: the title
     itself has to stay legible */
  .crumb .sub{display:none}
}
@media (max-width:860px){
  #app{grid-template-columns:1fr}
  .rail{position:fixed; left:0; top:0; z-index:60; transform:translateX(-100%); transition:transform .2s ease; width:250px}
  body[data-nav="open"] .rail{transform:none; box-shadow:var(--shadow-lg)}
  .searchbox input{width:130px}
  .navtoggle{display:grid!important}
  .page{padding:15px 14px 46px}
  .topbar{padding:9px 14px}
  /* the topbar is the one row that cannot wrap, so on a narrow window it
     sheds the parts that are decoration and squeezes the rest */
  .crumb .sub{display:none}
  .whoami .avatar{display:none}
  .whoami select{max-width:104px; padding:6px}
  #newco span{display:none}
  #newco{padding-left:9px; padding-right:9px}
}
@media (max-width:600px){
  .page{padding:13px 11px 44px; gap:14px}
  .topbar{padding:8px 11px; gap:8px}
  .card > header{padding:11px 13px}
  #uibtn{display:none}          /* the window is already choosing the size */
  .whoami{gap:5px; padding-left:0}
  .whoami select{max-width:86px}
  /* the page title gives up its width rather than sliding under the search */
  .crumb h1{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; font-size:15px}
}
@media (max-width:430px){
  .crumb{display:none}          /* the sidebar already says where you are */
  .whoami select{max-width:76px}
}
.navtoggle{display:none}

.nextstep{background:var(--surface); border:1px solid var(--accent-line); border-radius:var(--r); box-shadow:var(--shadow)}
.nextstep header{padding:12px 15px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:8px}
.nextstep header h2{font-size:12.5px; letter-spacing:.04em; text-transform:uppercase; color:var(--accent); font-weight:600}
.nextstep .body{padding:14px 15px; display:flex; flex-direction:column; gap:10px}
.nextstep p{margin:0; font-size:12.5px; color:var(--ink-2)}
.nextstep .btn{width:100%}
.gate{
  font-size:12px; padding:8px 10px; border-radius:var(--r-sm); background:var(--warn-soft);
  color:var(--warn); border:1px solid color-mix(in srgb,var(--warn) 28%, transparent);
}
.gate ul{margin:5px 0 0; padding-left:16px}

.kv{display:grid; grid-template-columns:132px minmax(0,1fr); gap:8px 12px; font-size:13px}
.kv dt{color:var(--ink-3); font-size:12px}
.kv dd{margin:0; font-weight:500; word-break:break-word}

.timeline{display:flex; flex-direction:column}
.tl{display:grid; grid-template-columns:20px minmax(0,1fr); gap:12px; padding:0 0 14px}
.tl .rail2{display:flex; flex-direction:column; align-items:center; gap:4px}
.tl .pip{width:9px; height:9px; border-radius:50%; background:var(--line-strong); margin-top:5px; flex:0 0 auto}
.tl .line{flex:1; width:2px; background:var(--line)}
.tl:last-child .line{display:none}
.tl.acc .pip{background:var(--accent-fill)}
.tl.crit .pip{background:var(--crit)}
.tl .who{font-size:11.5px; color:var(--ink-3); display:flex; gap:8px; flex-wrap:wrap}
.tl .txt{font-size:13px; margin-top:2px}
.tl .txt b{font-weight:500}

.meter{border:1px solid var(--line); border-radius:var(--r); overflow:hidden}
.meter + .meter{margin-top:10px}
.meter .mh{display:flex; gap:10px; align-items:center; padding:10px 13px; background:var(--surface-2); flex-wrap:wrap}
.meter .mh b{font-weight:500; font-size:13px}
.meter .mb{padding:12px 13px}
/* a contract card: the supplies it covers, listed compactly */
.meter.pack .mh{background:var(--surface-3)}
.packms{display:flex; flex-direction:column; gap:5px}
.packm{display:flex; align-items:center; gap:9px; flex-wrap:wrap; font-size:12.5px;
  padding:5px 8px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2)}
.packm .mono{font-size:12.5px; font-weight:500}
.packm.dim{opacity:.58}
.packm.dim .mono{text-decoration:line-through}
.fuel{display:inline-grid; place-items:center; width:22px; height:22px; border-radius:6px; font-size:10px; font-weight:700; color:#fff; flex:0 0 auto}
.fuel.e{background:#1F5FCB}
.fuel.g{background:#C77700}

.optrow{border:1px solid var(--line); border-radius:var(--r-sm); padding:10px 12px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center}
.optrow + .optrow{margin-top:8px}
.optrow.sel{border-color:var(--accent-line); background:var(--accent-soft)}
.optrow .om{display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--ink-2); margin-top:3px}
.optrow .om b{color:var(--ink); font-weight:500; font-variant-numeric:tabular-nums}
.optrow.comp{border-style:dashed; background:var(--surface-2)}
.optrow.dim{opacity:.55}
/* the commission adjuster: one line, wraps on a narrow screen */
.upl{display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px;
  padding:7px 9px; border:1px solid var(--line); border-radius:var(--r-sm);
  background:var(--surface-2); font-size:12px; color:var(--ink-2)}
.upl .ul{text-transform:uppercase; letter-spacing:.05em; font-size:10.5px; font-weight:600;
  color:var(--ink-3, var(--ink-2))}
.upl .ub{width:26px; height:26px; border:1px solid var(--line); border-radius:6px; cursor:pointer;
  background:var(--surface); color:var(--ink); font-size:15px; line-height:1; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center}
.upl .ub:hover{border-color:var(--accent-line); color:var(--accent)}
.upl .ui{width:76px; height:26px; padding:0 7px; border:1px solid var(--line); border-radius:6px;
  background:var(--surface); color:var(--ink); font:inherit; font-variant-numeric:tabular-nums;
  text-align:right}
.upl .uu{font-size:11px}
.upl .ur{margin-left:2px; color:var(--ink-2)}
.upl .ur b{color:var(--ink); font-variant-numeric:tabular-nums}
.upl.locked{background:transparent}
@media (max-width:640px){ .upl .ur{width:100%; margin-left:0} }

/* ---------- forms / modal ---------- */
.field{display:flex; flex-direction:column; gap:5px}
.field > label{font-size:11.5px; font-weight:600; letter-spacing:.04em; color:var(--ink-2)}
.field > label .req{color:var(--crit)}
.field input,.field select,.field textarea{
  padding:8px 10px; border-radius:var(--r-sm); border:1px solid var(--line-strong);
  background:var(--surface); font-size:13px; width:100%;
}
.field textarea{min-height:74px; resize:vertical; font-family:inherit}
.field .help{font-size:11.5px; color:var(--ink-3)}
.row2{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.row3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px}
@media (max-width:640px){.row2,.row3{grid-template-columns:1fr}}
.checks{display:flex; flex-wrap:wrap; gap:8px}
.checks label{
  display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border:1px solid var(--line-strong);
  border-radius:20px; font-size:12.5px; cursor:pointer; white-space:nowrap; line-height:1.3;
}
.checks label:hover{border-color:var(--accent-fill); background:var(--surface-2)}
.checks label:has(input:checked){background:var(--accent-soft); border-color:var(--accent-line); color:var(--accent); font-weight:500}
.checks input{accent-color:var(--accent-fill)}

.scrim{
  position:fixed; inset:0; background:rgba(8,23,38,.55); backdrop-filter:blur(3px);
  display:grid; place-items:center; padding:20px; z-index:80;
}
.modal{
  background:var(--surface); border-radius:14px; box-shadow:var(--shadow-lg); width:min(660px,100%);
  max-height:calc(var(--vh) * .92); display:flex; flex-direction:column; border:1px solid var(--line);
}
.modal header{padding:16px 20px 13px; border-bottom:1px solid var(--line)}
.modal header .eyebrow{font-size:10.5px; font-weight:600; letter-spacing:.13em; text-transform:uppercase; color:var(--accent)}
.modal header h2{font-size:17px; margin-top:3px}
.modal header p{margin:5px 0 0; font-size:12.5px; color:var(--ink-3)}
.modal .mbody{padding:18px 20px; overflow-y:auto; display:flex; flex-direction:column; gap:14px}
.modal footer{padding:13px 20px; border-top:1px solid var(--line); display:flex; gap:9px; justify-content:flex-end; background:var(--surface-2); border-radius:0 0 13px 13px}
.err{font-size:12.5px; color:var(--crit); background:var(--crit-soft); padding:8px 10px; border-radius:var(--r-sm)}
.toast{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:100;
  background:var(--navy); color:#fff; padding:11px 18px; border-radius:24px; font-size:13px;
  box-shadow:var(--shadow-lg); display:flex; align-items:center; gap:9px;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .toast{background:#153351; border:1px solid var(--line-strong)}}
:root[data-theme="dark"] .toast{background:#153351; border:1px solid var(--line-strong)}

/* ---------- board ---------- */
.board{display:flex; gap:12px; overflow-x:auto; padding-bottom:8px; align-items:flex-start}
.col{flex:0 0 246px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); display:flex; flex-direction:column}
.col > h3{
  padding:10px 12px; font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  color:var(--ink-2); display:flex; align-items:center; gap:7px; border-bottom:1px solid var(--line);
}
.col > h3 .n{margin-left:auto; font-size:11px; color:var(--ink-3); font-variant-numeric:tabular-nums}
.col .stack{padding:8px; display:flex; flex-direction:column; gap:7px}
.mini{
  background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--line-strong);
  border-radius:var(--r-sm); padding:9px 10px; text-align:left; width:100%; box-shadow:var(--shadow-sm);
}
.mini:hover{box-shadow:var(--shadow)}
.mini b{display:block; font-size:12.7px; font-weight:500}
.mini .m2{display:flex; gap:8px; flex-wrap:wrap; font-size:11px; color:var(--ink-3); margin-top:4px}
.mini.flag{border-left-color:var(--crit)}
.mini.due{border-left-color:var(--warn)}
.mini.ok{border-left-color:var(--accent-fill)}

.legend{display:flex; gap:14px; flex-wrap:wrap; font-size:11.5px; color:var(--ink-3)}
.legend span{display:flex; align-items:center; gap:5px}
.legend i{width:9px; height:9px; border-radius:2px; display:block}

.diary{display:flex; flex-direction:column; gap:0}
.dayrow{display:grid; grid-template-columns:78px minmax(0,1fr); gap:14px; padding:12px 0; border-bottom:1px solid var(--line)}
.dayrow:last-child{border-bottom:0}
.dayrow .d{font-size:12px; color:var(--ink-3)}
.dayrow .d b{display:block; font-size:16px; color:var(--ink); font-weight:600}
.slot{display:flex; gap:10px; align-items:center; padding:8px 10px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface)}
.slot + .slot{margin-top:6px}
.slot .tm{font-weight:600; font-size:13px; font-variant-numeric:tabular-nums; min-width:46px}
.slot .who2{font-size:11.5px; color:var(--ink-3)}
.hr{height:1px; background:var(--line); border:0; margin:2px 0}
.subtle{color:var(--ink-3); font-size:12.5px}
.sectitle{font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); margin-bottom:8px}
