/* ============================================================
   The Greenhouse — Founders OS shared components.
   Everything here reads the shell's semantic tokens (greenhouse.css),
   so both moods work without a second palette. No hex in this file.
   Sections: topbar · scope · ask bar · drawers · popover · modal ·
   layout + rail · badges · info · tables · kpi · sections · forms ·
   states · tabs · matrix · charts · timeline · responsive.
   ============================================================ */

/* ===== topbar ===== */
.os-top{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:14px;
  margin:-44px -52px 30px;padding:14px 52px;background:var(--side-bg);backdrop-filter:blur(9px) saturate(1.05);
  border-bottom:1px solid var(--border)}
/* The reminders bar became a bell in round 3, so the ask bar has its room
   back: 240px is enough for "Ask the Greenhouse" without crowding. */
.os-top .os-ask{flex:0 1 240px;min-width:0}
@media (max-width:1180px){.os-top .os-ask{flex:0 1 220px}}
@media (max-width:860px){
  .os-top{margin:-26px -20px 22px;padding:10px 20px;flex-wrap:wrap;gap:10px}
  /* the ask bar takes its own line; the bell stays up with the toggle */
  .os-top .os-ask{order:1;flex-basis:100%}
  .os-top .os-rem{order:0}
}

/* ===== reminders bell =====
   Danielle 2026-09-03: "just a bell with a number on it… very similar to the
   modern teachers notification button." Same shape as the portal's
   .notif-btn (36px circle, 1.5px border, 18px bell, badge top-right), built
   from the Greenhouse's own tokens. The slack in the topbar sits after the
   bell, so the ask bar and the two buttons stay grouped on the right. */
.os-rem{flex:0 0 auto;display:flex;position:relative;margin-right:auto}
.os-bell{position:relative;width:36px;height:36px;display:flex;align-items:center;justify-content:center;
  border:1.5px solid var(--border);border-radius:var(--radius-pill);background:var(--surface);
  color:var(--fg-subtle);cursor:pointer;transition:all var(--t)}
.os-bell:hover{border-color:var(--border-strong);color:var(--fg);box-shadow:var(--shadow-xs)}
.os-bell:focus-visible{outline:2px solid var(--brand-400);outline-offset:2px}
.os-bell[aria-expanded="true"]{border-color:var(--brand-400);color:var(--fg);box-shadow:0 0 0 3px var(--brand-100)}
.os-bell > svg.gh{width:18px;height:18px;stroke-width:1.8}
.os-bell-n{position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;padding:0 5px;
  display:flex;align-items:center;justify-content:center;border:2px solid var(--side-bg);
  border-radius:var(--radius-pill);background:var(--brand-600);color:var(--nav-on-ink);
  font-size:10.5px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}
.os-bell-n.late{background:var(--err-fg)}
/* the rule above sets display:flex, which beats the user agent's [hidden] */
.os-bell-n[hidden]{display:none}

/* the popover body — the shared #osPop surface holds it */
.os-rem-list{display:flex;flex-direction:column;gap:2px;margin-bottom:12px}
.os-rem-row{padding:8px 0;border-bottom:1px dashed var(--border)}
.os-rem-row:last-child{border-bottom:none}
.os-rem-row-t{font-size:13.5px;font-weight:600;color:var(--fg);text-wrap:pretty}
.os-rem-row-d{font-size:12px;color:var(--fg-subtle);margin-top:1px}
.os-rem-row-d.late{color:var(--brand-600);font-weight:700}
.os-rem-row-a{display:flex;align-items:center;gap:12px;margin-top:5px}
.os-rem-row-a a,.os-rem-row-a button{font-size:12.5px;font-weight:700;color:var(--brand-700);
  text-decoration:underline;text-underline-offset:2px}
.os-rem-row-a button:hover,.os-rem-row-a a:hover{color:var(--brand-800)}
.os-rem-add{display:flex;flex-direction:column;gap:7px;padding-top:10px;border-top:1px solid var(--border)}
.os-rem-add .os-input{min-height:36px;font-size:13px}
.os-rem-chk{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--fg-muted)}
.os-rem-chk input{width:15px;height:15px;accent-color:var(--brand-600)}
@media (max-width:767px){.os-bell{width:44px;height:44px}.os-rem-row-a a,.os-rem-row-a button{min-height:44px}}

/* ===== scope toggle (ALL · MPC · TMT) ===== */
.os-scope{display:inline-flex;gap:2px;padding:3px;border-radius:var(--radius-pill);background:var(--bg-sunk);border:1px solid var(--border);flex-shrink:0}
.os-scope button{padding:7px 14px;border-radius:var(--radius-pill);font-size:12.5px;font-weight:700;color:var(--fg-muted);
  transition:all var(--t);white-space:nowrap;min-height:34px}
.os-scope button:hover{color:var(--fg)}
.os-scope button.on{background:var(--brand-600);color:var(--nav-on-ink);box-shadow:var(--shadow-xs)}
.os-scope button[disabled]{opacity:.4;cursor:default}
.os-scope button[disabled]:hover{color:var(--fg-muted)}
.os-scope .sm{display:none}
@media (max-width:1180px){.os-scope .lg{display:none}.os-scope .sm{display:inline}}

/* ===== ask bar ===== */
.os-ask{display:flex;align-items:center;gap:8px;padding:0 6px 0 14px;height:42px;border-radius:var(--radius-pill);
  background:var(--surface);border:1px solid var(--border-strong);box-shadow:var(--shadow-xs);transition:border-color var(--t),box-shadow var(--t)}
.os-ask:focus-within{border-color:var(--brand-400);box-shadow:0 0 0 3px var(--brand-100)}
.os-ask svg.gh{color:var(--brand-600);width:17px;height:17px}
.os-ask input{flex:1;min-width:0;border:none;background:none;outline:none;font:inherit;font-size:14px;color:var(--fg)}
.os-ask input::placeholder{color:var(--fg-subtle)}
/* The circle was doing nothing Enter did not already do, so it is gone.
   The button stays in the markup, hidden, so the form still has a submit. */
.os-ask-go{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%)}
.os-top-btn{display:inline-flex;align-items:center;gap:7px;padding:8px 13px;min-height:40px;border-radius:var(--radius-pill);
  border:1px solid var(--border-strong);background:var(--surface);font-size:12.5px;font-weight:700;color:var(--fg-muted);transition:all var(--t);flex-shrink:0}
.os-top-btn:hover{border-color:var(--brand-400);color:var(--fg)}
.os-top-btn svg{width:15px;height:15px}
.os-top-btn .dot{width:7px;height:7px;border-radius:50%;background:var(--terra);display:none}
.os-top-btn.busy .dot{display:block}
@media (max-width:640px){.os-top-btn span.lbl{display:none}.os-top-btn{padding:8px 10px}}

/* ===== drawers (ask + generic) ===== */
.os-scrim{position:fixed;inset:0;z-index:150;background:rgba(45,36,26,.42);opacity:0;transition:opacity var(--t)}
.os-scrim.on{opacity:1}
.os-drawer{position:fixed;top:0;right:0;bottom:0;z-index:160;width:min(460px,100vw);display:flex;flex-direction:column;
  background:var(--bg-soft);border-left:1px solid var(--border);box-shadow:var(--shadow-xl);transform:translateX(102%);
  transition:transform .22s var(--ease)}
.os-drawer.wide{width:min(720px,100vw)}
.os-drawer.on{transform:none}
.os-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid var(--border)}
.os-drawer-head h3{font-size:18px}
.os-drawer-head .sub{font-size:12.5px;color:var(--fg-subtle);margin-top:2px}
.os-x{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--fg-muted);transition:all var(--t)}
.os-x:hover{background:var(--brand-50);color:var(--fg)}
.os-x svg{width:16px;height:16px}
.os-drawer-body{flex:1;overflow-y:auto;padding:16px 20px 24px;min-height:0}
.os-drawer-foot{padding:12px 20px 16px;border-top:1px solid var(--border);display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
/* ask thread */
.ask-form{display:flex;gap:8px;padding:12px 20px;border-top:1px solid var(--border);background:var(--bg-soft)}
.ask-form input{flex:1;min-width:0;padding:10px 14px;border-radius:var(--radius-pill);border:1px solid var(--border-strong);background:var(--surface);color:var(--fg);font:inherit;font-size:14px;outline:none}
.ask-form input:focus{border-color:var(--brand-400)}
.ask-q{margin-bottom:14px}
.ask-q .q{font-weight:600;font-size:14.5px;color:var(--fg)}
.ask-q .when{font-size:11.5px;color:var(--fg-subtle);margin:2px 0 8px}
.ask-q .a{white-space:pre-wrap;font-size:14px;line-height:1.6;color:var(--fg-muted);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:12px 14px}
.ask-q .wait{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--fg-muted)}
.ask-q .props{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.ask-q .props-note{font-size:11.5px;color:var(--fg-subtle);margin-top:6px}
.ask-hint{font-size:12.5px;color:var(--fg-subtle);line-height:1.55;margin-bottom:14px}
.ask-hint b{color:var(--fg-muted)}
.ask-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px}
.ask-chip{padding:6px 11px;border-radius:var(--radius-pill);background:var(--brand-50);border:1px solid var(--brand-200);color:var(--brand-800);font-size:12px;font-weight:600;transition:all var(--t)}
.ask-chip:hover{background:var(--brand-100)}

/* ===== popover (info icon) ===== */
.os-info{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;
  color:var(--fg-subtle);vertical-align:middle;margin-left:4px;transition:all var(--t);flex-shrink:0}
.os-info:hover,.os-info.on{background:var(--brand-100);color:var(--brand-700)}
.os-info svg{width:14px;height:14px}
.os-pop{position:fixed;z-index:170;width:min(340px,calc(100vw - 24px));background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-xl);box-shadow:var(--shadow-xl);padding:16px 18px;opacity:0;transform:translateY(4px);transition:opacity var(--t),transform var(--t);pointer-events:none}
.os-pop.on{opacity:1;transform:none;pointer-events:auto}
.os-pop .pk{font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--brand-700);margin-bottom:4px}
.os-pop .pt{font-family:var(--font-serif);font-size:16px;font-weight:600;margin-bottom:8px}
.os-pop p{font-size:13.5px;line-height:1.55;color:var(--fg-muted);margin-bottom:10px;text-wrap:pretty}
.os-pop .ev{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;color:var(--brand-700);text-decoration:underline;text-underline-offset:2px}
.os-pop .ev svg{width:14px;height:14px}
@media (max-width:640px){.os-pop{left:12px!important;right:12px;bottom:12px;top:auto!important;width:auto}}

/* ===== modal (confirm) ===== */
.os-modal{position:fixed;inset:0;z-index:180;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(45,36,26,.5)}
.os-modal[hidden]{display:none}
.os-modal-card{width:min(440px,100%);background:var(--bg-soft);border:1px solid var(--border);border-radius:var(--radius-2xl);box-shadow:var(--shadow-xl);padding:24px 26px}
.os-modal-card h3{font-size:20px;margin-bottom:8px}
.os-modal-card p{font-size:14px;color:var(--fg-muted);line-height:1.6;margin-bottom:18px;text-wrap:pretty}
.os-modal-card .acts{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.btn-quiet.danger{border-color:var(--err-fg);color:var(--err-fg)}
.btn-quiet.danger:hover{background:var(--err-bg)}

/* ===== room layout + manual rail ===== */
/* Sections live in the shell's left nav (see .nav-subs in greenhouse.css).
   What is left here is the column the room paints into. */
.os-content{min-width:0}

/* Visually hidden, still read aloud and still queryable. */
.gh-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
}

/* ===== truth badges (value labels + integration states) ===== */
.os-badge{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:var(--radius-pill);font-size:10.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;
  background:var(--bg-sunk);color:var(--fg-subtle);border:1px solid transparent;vertical-align:middle;white-space:nowrap}
.os-badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.7}
.os-badge.actual,.os-badge.synced{background:var(--brand-100);color:var(--brand-800);border-color:var(--brand-200)}
.os-badge.sample,.os-badge.imported{background:var(--bg-sunk);color:var(--fg-muted)}
.os-badge.estimate{background:var(--warn-bg);color:var(--warn-fg)}
.os-badge.target{background:var(--surface);color:var(--fg-muted);border-color:var(--border-strong)}
.os-badge.unavailable,.os-badge.not-connected{background:var(--bg-sunk);color:var(--fg-subtle);border-style:dashed;border-color:var(--border-strong)}
.os-badge.error{background:var(--err-bg);color:var(--err-fg)}
.os-badge.manual{background:var(--surface);color:var(--fg-muted);border-color:var(--border)}

/* status pills for records */
.os-pill{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:var(--radius-pill);font-size:11.5px;font-weight:700;background:var(--bg-sunk);color:var(--fg-muted)}
.os-pill.hot{background:var(--err-bg);color:var(--err-fg)}
.os-pill.warm{background:var(--warn-bg);color:var(--warn-fg)}
.os-pill.calm{background:var(--brand-100);color:var(--brand-800)}
.os-pill.cool{background:var(--bg-sunk);color:var(--fg-muted)}
.os-pill.done{background:var(--ok-bg);color:var(--ok-fg);border:1px solid var(--ok-border)}

/* ===== data tables ===== */
.os-table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface)}
.os-table{width:100%;border-collapse:collapse;font-size:13.5px;min-width:420px}
.os-table th{font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-subtle);text-align:left;padding:10px 12px;border-bottom:1px solid var(--border);white-space:nowrap;background:var(--surface-alt)}
.os-table td{padding:9px 12px;border-top:1px solid var(--border-subtle);color:var(--fg-muted);vertical-align:top}
.os-table tr:first-child td{border-top:none}
.os-table td b,.os-table td strong{color:var(--fg);font-weight:600}
.os-table .num,.os-table th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.os-table tr.click{cursor:pointer}
.os-table tr.click:hover td{background:var(--brand-50)}
.os-table input,.os-table select{width:100%;min-width:90px}
.os-table-cap{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:11.5px;color:var(--fg-subtle);padding:8px 12px;border-top:1px solid var(--border-subtle);background:var(--surface-alt)}

/* ===== kpi tiles ===== */
.os-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.os-kpi{background:var(--panel-bg);backdrop-filter:blur(7px);border:1px solid var(--border);border-radius:var(--radius-xl);padding:14px 16px;box-shadow:var(--shadow-xs);min-width:0}
.os-kpi .k{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-subtle);margin-bottom:6px;min-height:22px}
.os-kpi .k .os-info{margin-left:auto}
.os-kpi .v{font-family:var(--font-serif);font-size:28px;font-weight:600;color:var(--num);line-height:1.05;letter-spacing:-.01em;overflow-wrap:anywhere}
.os-kpi .v.sm{font-size:20px}
.os-kpi .d{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--fg-subtle);margin-top:6px}
.os-kpi .delta{font-weight:700;color:var(--fg-muted)}
.os-kpi .delta.up{color:var(--brand-700)}
.os-kpi .delta.down{color:var(--err-fg)}
.os-kpi.lead{background:var(--brand-600);border-color:var(--brand-600);color:var(--nav-on-ink)}
.os-kpi.lead .k,.os-kpi.lead .v,.os-kpi.lead .d,.os-kpi.lead .delta{color:inherit}
.os-kpi.lead .k{opacity:.85}.os-kpi.lead .d{opacity:.85}
.os-kpi.lead .os-badge{background:rgba(255,255,255,.2);color:inherit;border-color:transparent}
.os-kpi.lead .os-info{color:inherit;opacity:.8}

/* ===== sections + cards ===== */
.os-sec{margin-bottom:26px}
.os-sec-h{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.os-sec-h>div:first-child{min-width:0;max-width:100%}
.os-sec-h h3{font-size:20px}
.os-sec-h .acts{display:flex;gap:8px;flex-wrap:wrap}
.os-grid{display:grid;gap:14px}
.os-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.os-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.os-grid.auto{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
@media (max-width:980px){.os-grid.two,.os-grid.three{grid-template-columns:1fr}}
.card.os-card{padding:18px 20px}
.card .card-t{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-subtle);margin-bottom:12px}
.card .card-t svg{width:15px;height:15px;color:var(--brand-600)}
.card .card-t .os-badge{margin-left:auto}
.os-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.os-row.between{justify-content:space-between}
.os-muted{color:var(--fg-muted)}.os-subtle{color:var(--fg-subtle)}
.os-small{font-size:12.5px}
.os-p{font-size:14px;line-height:1.6;color:var(--fg-muted);text-wrap:pretty;max-width:68ch}
.os-eyebrow{font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--brand-700)}
.os-link{color:var(--brand-700);font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer}
.os-hr{border:none;border-top:1px dashed var(--border);margin:14px 0}
.os-list{list-style:none;display:flex;flex-direction:column;gap:6px}
.os-list li{display:flex;align-items:flex-start;gap:9px;font-size:13.5px;color:var(--fg-muted);line-height:1.5}
.os-list li svg{width:15px;height:15px;flex-shrink:0;margin-top:3px;color:var(--brand-600)}
.os-list.plain li::before{content:"";width:5px;height:5px;border-radius:50%;background:var(--brand-400);margin-top:9px;flex-shrink:0}

/* five-part decision card */
.os-decision{display:flex;flex-direction:column;gap:10px}
.os-decision .dh{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex-wrap:wrap}
.os-decision .dh h4{font-family:var(--font-serif);font-size:17px;font-weight:600;line-height:1.25}
.os-part{display:grid;grid-template-columns:118px 1fr;gap:10px;font-size:13.5px;line-height:1.5;color:var(--fg-muted)}
.os-part .pk{font-size:10.5px;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--brand-700);padding-top:3px}
.os-part ul{margin:0;padding-left:18px}
@media (max-width:520px){.os-part{grid-template-columns:1fr;gap:2px}}
.os-decision .dacts{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}

/* ===== forms ===== */
.os-field{display:flex;flex-direction:column;gap:5px;margin-bottom:12px;min-width:0}
.os-field label,.os-lbl{font-size:11.5px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-subtle)}
.os-field .help{font-size:12px;color:var(--fg-subtle);line-height:1.5}
.os-input,.os-field input:not([type=checkbox]):not([type=radio]),.os-field select,.os-field textarea,.os-table input,.os-table select{
  width:100%;padding:9px 12px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--surface);color:var(--fg);
  font-family:var(--font-sans);font-size:14px;outline:none;transition:border-color var(--t),box-shadow var(--t);min-height:40px}
.os-field textarea{min-height:92px;resize:vertical;line-height:1.5}
.os-input:focus,.os-field input:focus,.os-field select:focus,.os-field textarea:focus,.os-table input:focus,.os-table select:focus{border-color:var(--brand-400);box-shadow:0 0 0 3px var(--brand-100)}
/* The native arrow sits hard against the border. Drawn here instead — two
   gradients rather than an SVG so it inherits currentColor and needs no hex —
   at least 14px in from the edge, with the text stopped well short of it. */
select.os-input,.os-field select,.os-table select{
  appearance:none;-webkit-appearance:none;padding-right:40px;cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:right 19px center,right 14px center;
  background-size:5px 5px,5px 5px;background-repeat:no-repeat}
.os-table select{padding-right:34px}
/* A room that dropped a bare <select> in without the shared class still gets
   the shared chevron — :not([class]) so a room's own styling is never
   overridden by this id-specificity rule. */
#room select:not([class]){
  width:auto;max-width:100%;padding:9px 40px 9px 12px;border:1px solid var(--border-strong);border-radius:var(--radius-md);
  background-color:var(--surface);color:var(--fg);font-family:var(--font-sans);font-size:14px;min-height:40px;
  appearance:none;-webkit-appearance:none;cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:right 19px center,right 14px center;
  background-size:5px 5px,5px 5px;background-repeat:no-repeat}
.os-field.inline{flex-direction:row;align-items:center;gap:10px}
.os-field.inline label{text-transform:none;letter-spacing:0;font-size:13.5px;font-weight:600;color:var(--fg-muted)}
.os-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}
.os-form-grid .span{grid-column:1/-1}
@media (max-width:640px){.os-form-grid{grid-template-columns:1fr}}
.os-toggle{position:relative;width:40px;height:22px;border-radius:var(--radius-pill);background:var(--border-strong);transition:background var(--t);flex-shrink:0}
.os-toggle::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:var(--surface);box-shadow:var(--shadow-xs);transition:transform var(--t)}
.os-toggle.on{background:var(--brand-600)}
.os-toggle.on::after{transform:translateX(18px)}
.os-tags{display:flex;flex-wrap:wrap;gap:6px}
.os-tag{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:var(--radius-pill);background:var(--bg-sunk);font-size:12px;font-weight:600;color:var(--fg-muted)}
.os-tag.on{background:var(--brand-100);color:var(--brand-800)}
.os-tag button{display:inline-flex;color:inherit;opacity:.6}
.os-tag button:hover{opacity:1}
.btn-quiet.sm{padding:6px 11px;font-size:12px;min-height:32px}
.btn-quiet svg{width:14px;height:14px}
.btn-quiet.icon{padding:8px;width:36px;justify-content:center}
.btn-quiet[aria-busy=true]{opacity:.7;pointer-events:none}
@media (max-width:767px){.btn-quiet,.nav-sub,.os-tab,.os-scope button,.os-info,.os-x,.ask-chip,.os-toggle,.os-matrix-legend button{min-height:44px}.os-x{min-width:44px}.os-dot::before{content:'';position:absolute;inset:-9px;border-radius:50%}.os-info{min-width:44px}.btn-quiet.sm{min-height:44px}}

/* ===== honest states ===== */
.os-state{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px 20px;border-radius:var(--radius-xl);border:1px dashed var(--border-strong);background:var(--bg-soft)}
.os-state .st{display:flex;align-items:center;gap:8px;font-family:var(--font-serif);font-size:16px;font-weight:600;color:var(--fg)}
.os-state .st svg{width:17px;height:17px;color:var(--brand-600)}
.os-state p{font-size:13.5px;color:var(--fg-muted);line-height:1.55;max-width:56ch;text-wrap:pretty}
.os-state.error{border-color:var(--err-fg);background:var(--err-bg)}
.os-state.error .st svg{color:var(--err-fg)}
.os-state ol{margin:0;padding-left:18px;font-size:13px;color:var(--fg-muted);line-height:1.6}
.os-state code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:var(--surface);border:1px solid var(--border);border-radius:4px;padding:1px 5px}
.os-skel{display:flex;flex-direction:column;gap:8px}
.os-skel span{display:block;height:12px;border-radius:6px;background:var(--bg-sunk);animation:os-pulse 1.2s ease-in-out infinite}
.os-skel span:nth-child(2){width:70%}.os-skel span:nth-child(3){width:45%}
@keyframes os-pulse{0%,100%{opacity:.55}50%{opacity:1}}

/* ===== add buttons =====
   Every "Add …" / "New …" button wears the same peachy the selected nav item
   wears, so the one thing that makes something new reads the same everywhere. */
.btn-add{background:var(--brand-600);border-color:var(--brand-600);color:var(--nav-on-ink)}
.btn-add:hover{background:var(--brand-500);border-color:var(--brand-500);color:var(--nav-on-ink)}
.btn-add svg{color:var(--nav-on-ink)}

/* ===== tabs (horizontal steps / status tabs) ===== */
.os-tabs{display:flex;gap:4px;flex-wrap:wrap;padding:3px;border-radius:var(--radius-pill);background:var(--bg-sunk);border:1px solid var(--border);width:max-content;max-width:100%;margin-bottom:16px}
.os-tab{display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border-radius:var(--radius-pill);font-size:12.5px;font-weight:700;color:var(--fg-muted);transition:all var(--t);white-space:nowrap;min-height:34px}
.os-tab:hover{color:var(--fg)}
.os-tab.on{background:var(--surface);color:var(--fg);box-shadow:var(--shadow-xs)}
.os-tab .n{font-size:10.5px;font-weight:800;color:var(--fg-subtle);background:var(--bg-sunk);border-radius:var(--radius-pill);padding:1px 6px}
.os-tab .stp{width:18px;height:18px;border-radius:50%;background:var(--brand-100);color:var(--brand-800);font-size:10.5px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
.os-tab.on .stp{background:var(--brand-600);color:var(--nav-on-ink)}
@media (max-width:640px){.os-tabs{width:100%;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin}}

/* ===== readiness gates ===== */
.os-gates{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
@media (max-width:560px){.os-gates{grid-template-columns:repeat(2,minmax(0,1fr))}}
.os-gate{padding:10px 11px;border-radius:var(--radius-lg);background:var(--bg-soft);border:1px solid var(--border);min-width:0}
.os-gate .gk{font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-subtle);margin-bottom:6px;display:flex;justify-content:space-between;gap:6px}
.os-gate .gb{height:6px;border-radius:3px;background:var(--bg-sunk);overflow:hidden}
.os-gate .gb i{display:block;height:100%;background:var(--brand-600);border-radius:3px}
.os-gate.blocked .gb i{background:var(--err-fg)}
.os-gate.ready .gb i{background:var(--brand-600)}
.os-gate .gs{font-size:11.5px;color:var(--fg-muted);margin-top:6px;line-height:1.4}

/* ===== 2×2 matrix ===== */
.os-matrix{position:relative;aspect-ratio:1.25;min-height:0;width:100%;max-width:100%;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);overflow:hidden;touch-action:none;user-select:none}
.os-matrix .ax{position:absolute;font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-subtle);pointer-events:none}
.os-matrix .ax.x{bottom:6px;left:50%;transform:translateX(-50%)}
.os-matrix .ax.y{top:50%;left:6px;transform:rotate(-90deg) translateX(-50%);transform-origin:left top;white-space:nowrap}
.os-matrix .ql{position:absolute;font-size:10.5px;font-weight:700;color:var(--fg-subtle);opacity:.8;pointer-events:none}
.os-matrix .ql.tl{top:8px;left:26px}.os-matrix .ql.tr{top:8px;right:10px}.os-matrix .ql.bl{bottom:22px;left:26px}.os-matrix .ql.br{bottom:22px;right:10px}
.os-matrix .mid-v,.os-matrix .mid-h{position:absolute;background:var(--border);pointer-events:none}
.os-matrix .mid-v{left:50%;top:0;bottom:0;width:1px}.os-matrix .mid-h{top:50%;left:0;right:0;height:1px}
.os-dot{position:absolute;transform:translate(-50%,-50%);width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:var(--brand-100);border:1px solid var(--brand-300);color:var(--brand-800);font-size:11px;font-weight:800;cursor:grab;box-shadow:var(--shadow-xs);line-height:1}
.os-dot:focus-visible{outline:2px solid var(--brand-600);outline-offset:2px}
.os-dot .lbl{display:none;position:absolute;left:30px;top:50%;transform:translateY(-50%);max-width:180px;padding:4px 9px;border-radius:var(--radius-pill);
  background:var(--surface);border:1px solid var(--brand-300);color:var(--brand-800);font-size:11.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:var(--shadow-sm);pointer-events:none;z-index:2}
.os-dot.flip .lbl{left:auto;right:30px}
.os-dot:hover .lbl,.os-dot:focus-visible .lbl,.os-dot.dragging .lbl{display:block}
.os-dot:hover,.os-dot.dragging{z-index:3}
.os-matrix-legend{list-style:none;margin:10px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:4px 14px}
.os-matrix-legend li{display:flex;align-items:center;gap:8px;min-width:0}
.os-matrix-legend b{flex-shrink:0;width:20px;height:20px;border-radius:50%;background:var(--brand-100);border:1px solid var(--brand-300);color:var(--brand-800);font-size:10.5px;font-weight:800;display:inline-flex;align-items:center;justify-content:center}
.os-matrix-legend button{min-width:0;flex:1;text-align:left;font-size:12.5px;color:var(--fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 0}
.os-matrix-legend button:hover{color:var(--fg);text-decoration:underline;text-underline-offset:2px}
.os-dot.hot{background:var(--err-bg);border-color:var(--err-fg);color:var(--err-fg)}
.os-dot.dragging{cursor:grabbing;box-shadow:var(--shadow-md);z-index:2}

/* ===== charts ===== */
.os-chart{position:relative;min-width:0}
.os-chart svg{width:100%;height:auto;display:block;overflow:visible}
.os-chart text{font-family:var(--font-sans);font-size:11px;fill:var(--fg-subtle)}
.os-chart .grid{stroke:var(--border);stroke-dasharray:2 4}
.os-chart .axis{stroke:var(--border-strong)}
.os-c1{color:var(--brand-600)}.os-c2{color:var(--brand-300)}.os-c3{color:var(--brand-800)}.os-c4{color:var(--warn-fg)}.os-c5{color:var(--fg-subtle)}
.os-chart .line{fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.os-chart .area{fill:currentColor;opacity:.08}
.os-chart .pt{fill:currentColor;stroke:var(--surface);stroke-width:2}
.os-chart .bar{fill:currentColor;rx:3}
.os-chart .bar.target{fill:none;stroke:currentColor;stroke-dasharray:3 3}
.os-chart .hit{fill:transparent;cursor:crosshair}
.os-chart .hit:hover{fill:var(--brand-50)}
.os-tip{position:fixed;z-index:175;pointer-events:none;background:var(--fg);color:var(--bg);font-size:12px;line-height:1.45;padding:6px 10px;border-radius:var(--radius-md);box-shadow:var(--shadow-md);max-width:240px;opacity:0;transition:opacity .1s}
.os-tip.on{opacity:1}
.os-tip b{font-weight:700;color:inherit}
.os-legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;color:var(--fg-muted);margin-top:8px}
.os-legend span{display:inline-flex;align-items:center;gap:6px}
.os-legend i{width:10px;height:10px;border-radius:3px;background:currentColor}
.os-chart-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:8px;font-size:11.5px;color:var(--fg-subtle)}
.os-chart-foot .os-link{font-size:12px}
.os-chart-table{margin-top:10px}
/* funnel */
.os-funnel{display:flex;flex-direction:column;gap:6px}
.os-fstage{display:grid;grid-template-columns:118px 1fr auto;gap:10px;align-items:center;font-size:13px}
.os-fstage .fl{font-weight:700;color:var(--fg)}
.os-fstage .fb{height:22px;border-radius:var(--radius-md);background:var(--bg-sunk);overflow:hidden}
.os-fstage .fb i{display:block;height:100%;background:var(--brand-600);border-radius:var(--radius-md);min-width:2px}
.os-fstage .fv{font-family:var(--font-serif);font-size:16px;font-weight:600;color:var(--num);white-space:nowrap;display:flex;align-items:center;gap:6px}
.os-fstage .fr{font-size:11px;color:var(--fg-subtle);grid-column:2;margin-top:-2px}
@media (max-width:520px){.os-fstage{grid-template-columns:1fr auto}.os-fstage .fl{grid-column:1/-1}.os-fstage .fr{grid-column:1}}
/* bars (how the market narrows) */
.os-bars{display:flex;flex-direction:column;gap:9px}
.os-bar{display:grid;grid-template-columns:minmax(120px,200px) 1fr auto;gap:10px;align-items:center;font-size:13px}
.os-bar .bl{color:var(--fg);font-weight:600;line-height:1.3}
.os-bar .bl small{display:block;font-weight:500;color:var(--fg-subtle);font-size:11.5px}
.os-bar .bb{height:14px;border-radius:7px;background:var(--bg-sunk);overflow:hidden}
.os-bar .bb i{display:block;height:100%;border-radius:7px;background:var(--brand-600);min-width:3px}
.os-bar.c2 .bb i{background:var(--brand-300)}.os-bar.c3 .bb i{background:var(--brand-800)}.os-bar.c4 .bb i{background:var(--warn-fg)}
.os-bar .bv{font-variant-numeric:tabular-nums;font-weight:700;color:var(--num);white-space:nowrap;display:flex;align-items:center;gap:6px}
@media (max-width:520px){.os-bar{grid-template-columns:1fr auto}.os-bar .bb{grid-column:1/-1}}

/* ===== timeline (roadmap / next posts) ===== */
.os-tl{display:flex;flex-direction:column;gap:0;position:relative}
.os-tl::before{content:"";position:absolute;left:9px;top:8px;bottom:8px;width:1px;background:var(--border-strong)}
.os-tl-i{display:grid;grid-template-columns:20px 1fr;gap:12px;padding:6px 0;position:relative}
.os-tl-i .td{width:11px;height:11px;border-radius:50%;background:var(--surface);border:2px solid var(--brand-400);margin:5px 0 0 4px}
.os-tl-i.done .td{background:var(--brand-600);border-color:var(--brand-600)}
.os-tl-i.hot .td{border-color:var(--err-fg)}
.os-tl-i .tw{font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--fg-subtle)}
.os-tl-i .tt{font-size:14px;font-weight:600;color:var(--fg);line-height:1.35}
.os-tl-i .ts{font-size:12.5px;color:var(--fg-muted);margin-top:1px}

/* ===== history / revisions ===== */
.os-hist{display:flex;flex-direction:column;gap:8px}
.os-hist-i{padding:9px 12px;border-radius:var(--radius-lg);background:var(--bg-soft);border:1px solid var(--border);font-size:12.5px}
.os-hist-i .hw{font-weight:700;color:var(--fg-subtle);font-size:11px;margin-bottom:2px}
.os-hist-i .hs{color:var(--fg);font-weight:600}
.os-hist-i .hc{color:var(--fg-muted);margin-top:4px;line-height:1.5}
.os-hist-i .hc code{font-family:inherit;background:var(--surface);border-radius:4px;padding:0 4px}

/* ===== brand marks inside content ===== */
.os-persona{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-subtle)}
.os-persona i{width:8px;height:8px;border-radius:50%;background:var(--brand-500)}
.os-persona.tmt i{background:var(--brand-800)}

/* ===== room head extras ===== */
.room-head .os-headrow{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}
/* The blurb is one nowrap line, so the column holding it asks for its full
   620px. Without min-width:0 that flex item refuses to shrink and pushes the
   head past a phone viewport instead of ellipsising. */
.room-head .os-headrow > *{min-width:0}
.room-head .os-headrow .acts{display:flex;gap:8px;flex-wrap:wrap;padding-top:6px}

/* reduced motion */
@media (prefers-reduced-motion:reduce){.os-drawer,.os-scrim,.os-pop,.os-toggle::after{transition:none}}

/* hidden attribute must win over the component display rules */
.os-drawer[hidden],.os-scrim[hidden],.os-pop[hidden],.os-modal[hidden]{display:none}

/* ===== Porch OS blocks (rooms/porch-os.js) ===== */
/* What needs attention: one calm list. No row backgrounds, no severity
   word — a small level label, the title, when it is due, and an accordion
   that opens onto the record's own five parts (Danielle 2026-09-02:
   "the colours and titles give me anxiety"). */
.att-list{display:flex;flex-direction:column}
.att-i{border-top:1px solid var(--border-subtle)}
.att-i:first-child{border-top:none}
.att-i>summary{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:12px;align-items:center;
  padding:11px 2px;cursor:pointer;list-style:none;min-width:0}
.att-i>summary::-webkit-details-marker{display:none}
.att-i>summary:hover b{color:var(--brand-800)}
.att-i>summary:focus-visible{outline:2px solid var(--brand-600);outline-offset:2px;border-radius:var(--radius-sm)}
.att-i .att-lv{font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-subtle)}
.att-i .att-lv::before{content:'';display:inline-block;vertical-align:middle;width:8px;height:8px;border-radius:50%;margin-right:6px;background:currentColor}
.att-i .att-lv.high::before{background:var(--priority-high)}
.att-i .att-lv.medium::before{background:var(--priority-medium)}
.att-i .att-lv.low::before{background:var(--priority-low)}
.po-daily-links{display:grid;gap:4px}
.po-daily-links a{display:flex;align-items:center;gap:14px;padding:16px 0;color:var(--fg-muted);text-decoration:none;border-bottom:1px solid var(--border-subtle)}
.po-daily-links a:last-child{border-bottom:0}
.po-daily-links a:hover{color:var(--brand-700)}
.po-daily-links a:focus-visible{outline:2px solid var(--brand-600);outline-offset:3px}
.po-daily-links span{flex:1;min-width:0}
.po-daily-links b{display:block;font-family:var(--font-serif);font-size:17px;color:var(--fg)}
.po-daily-links small{display:block;font-size:13px;margin-top:3px}
.att-i b{min-width:0;font-size:14px;font-weight:600;color:var(--fg);line-height:1.35;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.att-i .att-when{font-size:12px;color:var(--fg-subtle);white-space:nowrap}
.att-i[open]>summary b{white-space:normal}
.att-body{padding:2px 0 14px}
.att-body .os-decision{gap:10px}
.att-body .os-part{font-size:12.5px}
.att-body .dacts{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.att-more{margin-top:10px}
@media (max-width:600px){
  .att-i>summary{grid-template-columns:minmax(0,1fr) auto}
  .att-i .att-lv{grid-column:1 / -1}
}

/* My next 3 posts: a thumbnail and a title, nothing else. */
.po-posts{display:flex;flex-direction:column;gap:10px}
.po-post{display:grid;grid-template-columns:56px minmax(0,1fr);gap:12px;align-items:center;min-width:0}
.po-post .pth{display:block;width:56px;height:56px;border-radius:var(--radius-md);object-fit:cover;
  background:var(--bg-sunk);border:1px solid var(--border-subtle)}
.po-post .pth.blank{background:linear-gradient(140deg,var(--brand-50),var(--bg-sunk))}
.po-post .pmeta{min-width:0}
.po-post .pt{font-size:13.5px;font-weight:600;color:var(--fg);line-height:1.35;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.po-post .pd{font-size:12px;color:var(--fg-subtle);margin-top:2px}
.po-post:hover .pt{color:var(--brand-800)}

/* Effort and value: bigger, MoSCoW quadrants, one-line key under the board. */
.po-matrix-card .os-matrix{aspect-ratio:1.35}
.po-key{margin-top:10px}

/* narrow phones: the matrix stays inside its column (aspect-ratio + a min-height inflated its width past 320) */
@media (max-width:480px){.os-matrix{aspect-ratio:1}}

/* 44px targets on phones — this block sits last on purpose: .os-tab's own padding rule above would otherwise win */
@media (max-width:767px){.os-tab{min-height:44px}}
