/* Main Street Office: the one look (the library look, ROUND1-SPEC, Zach's yes 26 Oct 2026; it replaces Dispatch Desk).
   Source: products/field-platform/design-directions/library-ideas.html and site-map-tools/mock-round1.mjs.
   Every page links this file and one Google Fonts link (Inter + Fraunces); a page's own <style> only arranges its own
   parts, using these tokens. Red appears only where something is late, green only where it is done or paid. */

:root {
  --ivory: #FFF9EF; --surface: #FFFDF8; --white: #fff; --paper: #F6EEDC; --plain-bg: #F1EBDE; --tint: #F7EFD9;
  --line: #E6DCC6; --line-2: #D6CAB0;
  --ink: #2E2E2E; --soft: #5C6577;
  --navy: #0B1E2D; --navy-2: #13293B; --navy-line: #23394C; --rail-text: #C9D1D9;
  --brass: #D4A24C; --gold: #8F6410;
  --late: #9E3B2C; --late-bg: #F6E3DE;
  --ok: #2F6B47; --ok-bg: #E2EEE5;
  --move: #2C5A7A; --move-bg: #E1EAF1;
  --r: 10px; --r-btn: 9px; --r-big: 14px; --r-pill: 99px; --r-tag: 5px;
  --shadow-card: 0 18px 32px -26px rgba(11,30,45,.45);
  --shadow-float: 0 30px 60px -20px rgba(0,0,0,.55);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: var(--font); /* no monospace face: numbers line up through tabular-nums (.mono) */
  --brand-font: 'Fraunces', Georgia, serif;
  --rail-w: 208px; --tabbar-h: 0px; --o-off: 0px;
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 15px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
.o-rail [hidden], .o-tabbar [hidden], .o-more [hidden], .o-k[hidden], .o-k [hidden], .o-tiles[hidden], .o-undo[hidden], .o-setup[hidden], .o-island[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
kbd { font: 600 11px var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r-tag); padding: 0 5px; color: var(--soft); background: var(--surface); white-space: nowrap; }
.mono, .money { font-family: var(--font); font-variant-numeric: tabular-nums; }
.soft { color: var(--soft); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- pieces any page may use ---------- */
.o-btn { height: 34px; padding: 0 14px; border-radius: var(--r-btn); border: 1px solid var(--line-2); background: var(--white); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-weight: 700; text-decoration: none; }
.o-btn:hover { border-color: var(--soft); }
.o-btn.pri { background: var(--navy); color: var(--ivory); border-color: var(--navy); box-shadow: 3px 3px 0 var(--brass); }
.o-btn.new { background: var(--brass); color: var(--navy); border-color: var(--brass); box-shadow: 3px 3px 0 var(--navy); }
.o-btn.danger { color: var(--late); }
.o-btn:disabled { opacity: .5; cursor: default; }
.o-tag { display: inline-flex; align-items: center; gap: 4px; font: 800 10.5px/1.3 var(--font); letter-spacing: .09em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--r-tag); color: var(--soft); background: var(--plain-bg); white-space: nowrap; }
.o-tag.late { color: var(--late); background: var(--late-bg); }
.o-tag.ok { color: var(--ok); background: var(--ok-bg); }
.o-tag.move { color: var(--move); background: var(--move-bg); }
.o-tag.gold { color: var(--gold); background: var(--tint); }
.o-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-big); box-shadow: var(--shadow-card); }
.o-h { font-weight: 700; font-size: 12.5px; color: var(--soft); display: flex; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.o-title { font: 800 26px/1.15 var(--brand-font); color: var(--navy); margin: 0; letter-spacing: -.01em; }
.o-input, .o-app input:not([type=checkbox]):not([type=radio]):not([type=range]), .o-app select, .o-app textarea {
  border: 1px solid var(--line-2); border-radius: var(--r-btn); background: var(--white); padding: 6px 10px; min-height: 34px; box-sizing: border-box; }
.o-table { width: 100%; border-collapse: collapse; }
.o-table th { text-align: left; font-weight: 700; font-size: 12.5px; color: var(--soft); padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.o-table td { height: 38px; padding: 0 8px; border-bottom: 1px solid var(--line); }

/* ---------- money tiles (/office/office.js OfficeTiles) ---------- */
.o-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 16px 4px; }
.o-tile { background: var(--white); border: 1px solid var(--line-2); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.o-tile.navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.o-tile-k { font: 800 11.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.o-tile.navy .o-tile-k { color: var(--brass); }
.o-tile-n { font: 800 38px/1.1 var(--brand-font); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-tile-n .o-d { display: inline-block; }
.o-tile-n .o-roll { color: var(--gold); border-bottom: 4px solid var(--brass); }
.o-tile.navy .o-tile-n .o-roll { color: var(--brass); }
.o-tile-n .o-roll.o-rolling { animation: o-roll .4s ease-out; }
@keyframes o-roll { from { transform: translateY(70%); opacity: 0; } to { transform: none; opacity: 1; } }
.o-tile-s { font-size: 13px; color: var(--soft); margin-top: 2px; }
.o-tile.navy .o-tile-s { color: var(--rail-text); }
.o-tile-s.ok { color: var(--ok); font-weight: 700; }

/* ---------- undo bar (/office/office.js OfficeUndo) ---------- */
.o-undo { position: fixed; z-index: 200; left: calc(50% + var(--o-off)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  transform: translateX(-50%); width: min(480px, calc(100vw - 24px)); box-sizing: border-box; display: flex; align-items: center; gap: 14px;
  background: var(--navy); color: var(--white); border-radius: 14px; padding: 12px 14px 12px 16px; box-shadow: var(--shadow-float); }
.o-undo-ring { flex: none; width: 34px; height: 34px; }
.o-undo-ring .bg { stroke: #2B4357; }
.o-undo-ring .fg { stroke: var(--brass); transition: stroke-dashoffset 1s linear; }
.o-undo-ring text { fill: var(--white); font: 800 13px var(--font); }
.o-undo-t { flex: 1; min-width: 0; }
.o-undo-t b { display: block; font-weight: 700; }
.o-undo-t small { display: block; font-size: 12.5px; color: var(--rail-text); }
.o-undo-btn { margin-left: auto; flex: none; border: 0; cursor: pointer; background: var(--brass); color: var(--navy); font-weight: 800; border-radius: var(--r-btn); padding: 9px 16px; }
.o-undo.failed { background: var(--late); }
.o-undo.failed .o-undo-t small { color: var(--white); }

/* ---------- Set up your shop (/office/office.js OfficeSetup) ---------- */
.o-setup { background: var(--white); border: 1px solid var(--line-2); border-radius: 16px; padding: 20px 22px; margin: 16px; max-width: 640px;
  box-shadow: 0 24px 46px -30px rgba(11,30,45,.5); }
.o-setup-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.o-setup h3 { font: 800 24px/1.2 var(--brand-font); margin: 0; color: var(--navy); }
.o-setup-n { font-weight: 700; color: var(--gold); white-space: nowrap; }
.o-setup-bar { height: 8px; background: var(--tint); border-radius: 9px; margin: 12px 0 14px; }
.o-setup-bar i { display: block; height: 100%; background: var(--brass); border-radius: 9px; }
.o-step { display: flex; gap: 12px; align-items: center; padding: 10px; font-size: 15px; color: var(--ink); text-decoration: none; border-radius: var(--r); }
a.o-step:hover { background: var(--surface); }
.o-step.done { color: var(--soft); }
.o-step.done span:last-child { text-decoration: line-through; }
.o-dot { width: 24px; height: 24px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; font-size: 13px; }
.o-step.done .o-dot { background: var(--ok); border-color: var(--ok); color: var(--white); }
.o-now { border: 1.5px solid var(--brass); background: var(--tint); border-radius: 12px; padding: 12px; }
.o-now .o-step { padding: 0; font-weight: 700; }
.o-now .o-dot { border-color: var(--brass); }
.o-now p { margin: 8px 0 0 36px; font-size: 13.5px; color: var(--soft); }
.o-setup-btns { margin: 10px 0 0 36px; display: flex; gap: 8px; flex-wrap: wrap; }
.o-setup-go { display: inline-flex; align-items: center; background: var(--navy); color: var(--white); border-radius: var(--r-btn); padding: 8px 14px;
  font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: 3px 3px 0 var(--brass); }
.o-setup-later { display: inline-flex; align-items: center; background: var(--white); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: none; }

/* ---------- status island (/office/office.js OfficeIsland, library idea 01) ----------
   Its own row at the top centre of the page area (rail.js places it before the page), so it never covers the rail,
   a page's top bar or the Ask box. The colours on black are the drawing's: late #E58A78, paid #8FD0A3, minutes brass. */
.o-island { display: flex; justify-content: center; padding: 10px 16px 0; }
.o-isl { background: #0A0A0A; color: var(--white); border-radius: var(--r-pill); max-width: 100%; box-sizing: border-box;
  box-shadow: 0 14px 28px -18px rgba(0,0,0,.6); transition: opacity .4s; }
.o-isl.rest { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 150px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; }
.o-isl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); flex: none; }
.o-isl-pill { display: flex; align-items: center; gap: 14px; width: 100%; min-width: 250px; max-width: 420px; box-sizing: border-box; min-height: 34px;
  padding: 7px 16px; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; font-size: 12.5px; font-weight: 600; }
.o-isl-tx { flex: 1; min-width: 0; }
.o-isl-tx b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-isl-tx small { display: block; font-size: 12px; color: #AAB; font-weight: 500; overflow-wrap: anywhere; }
.o-isl-n { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brass); }
.o-isl-n.late { color: #E58A78; }
.o-isl-n.paid { color: #8FD0A3; }
.o-isl.open { border-radius: 30px; width: 420px; padding: 8px 2px 16px; }
.o-isl.open .o-isl-pill, .o-isl-row { min-width: 0; font-size: 14px; }
.o-isl.open .o-isl-tx b { font-weight: 700; white-space: normal; }
.o-isl.open .o-isl-n { font: 800 26px/1 var(--brand-font); }
.o-isl.open .o-isl-n small { font: 600 11px var(--font); margin-left: 2px; }
.o-isl-av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--brass); color: var(--navy); }
.o-isl-av.late { background: #E58A78; color: #0A0A0A; }
.o-isl-av.paid { background: #8FD0A3; color: #0A0A0A; }
.o-isl-btns { display: flex; gap: 8px; margin: 10px 16px 0; }
.o-isl-btns a { flex: 1; text-align: center; background: #222; color: var(--white); border-radius: 12px; padding: 8px; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.o-isl-btns a:hover { background: #333; }
.o-isl-more { border-top: 1px solid #2A2A2A; margin: 14px 0 0; padding-top: 12px; }
.o-isl-row { display: flex; align-items: center; gap: 14px; padding: 0 16px; }
.o-isl.o-isl-grow { animation: o-isl-grow .35s ease-out; }
@keyframes o-isl-grow { from { transform: scale(.9); opacity: .6; } to { transform: none; opacity: 1; } }
.o-isl.o-isl-fade { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .o-isl, .o-isl.o-isl-grow { animation: none; transition: none; } }

/* ---------- Find anything (/office/rail.js) ---------- */
.o-find { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 9px 10px; border: 0;
  border-radius: var(--r-btn); background: var(--navy-2); color: var(--rail-text); font-size: 14px; white-space: nowrap; cursor: pointer; text-align: left; }
.o-find:hover { color: var(--ivory); }
.o-find svg { width: 16px; height: 16px; flex: 0 0 16px; }
.o-find kbd { margin-left: auto; background: transparent; border-color: #2B4357; color: var(--rail-text); font-size: 10px; padding: 1px 4px; }
.o-k-scrim { position: fixed; inset: 0; z-index: 150; background: rgba(11,30,45,.38); }
.o-k-box { position: fixed; z-index: 160; top: 84px; left: calc(50% + var(--o-off)); transform: translateX(-50%); width: min(600px, calc(100vw - 24px));
  max-height: calc(100vh - 120px); display: flex; flex-direction: column; background: var(--white); border-radius: 16px; box-shadow: var(--shadow-float); overflow: hidden; }
.o-k-in { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 18px; }
.o-k-in svg { width: 18px; height: 18px; flex: none; color: var(--soft); }
/* !important: a page's own field rule (.o-app input:not(...)) outranks a plain class here. */
.o-k-in input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: none !important; font-size: 18px !important; color: var(--ink);
  padding: 0 !important; min-height: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.o-k-kbd { margin-left: auto; font: 800 10.5px var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--gold); background: var(--tint);
  border-radius: var(--r-tag); padding: 3px 7px; white-space: nowrap; }
.o-k-x { display: none; flex: none; border: 0; background: none; color: var(--soft); font-size: 26px; line-height: 1; padding: 0 4px; cursor: pointer; }
.o-k-list { padding: 8px; overflow-y: auto; }
.o-k-list:empty { display: none; }
.o-k-grp { font: 800 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); padding: 10px 10px 4px; }
.o-k-row { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r); color: var(--ink); text-decoration: none; cursor: pointer; }
.o-k-row.sel { background: var(--tint); }
.o-k-row > div { min-width: 0; }
.o-k-row b { font-weight: 700; }
.o-k-row small { display: block; font-size: 12.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-k-av { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--white); font-weight: 800; font-size: 11px; display: grid; place-items: center; flex: none; }
.o-k-av.inv { background: var(--move); }
.o-k-av.job { background: var(--navy); }
.o-k-av.act { background: var(--brass); color: var(--navy); }
.o-k-row .o-tag { margin-left: auto; }
.o-k-enter { margin-left: auto; font-size: 12px; color: var(--soft); flex: none; }
.o-k-row .o-tag + .o-k-enter { margin-left: 8px; }

/* ---------- the rail (drawn by /office/rail.js) ---------- */
body.o-has-rail { padding-left: var(--rail-w); --o-off: calc(var(--rail-w) / 2); }
.o-rail { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: var(--rail-w); box-sizing: border-box;
  background: var(--navy); color: var(--rail-text); display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; }
.o-brand { font: 800 18px/1.1 var(--brand-font); color: var(--ivory); padding: 4px 8px 2px; text-decoration: none; }
.o-shop { padding: 2px 8px 16px; font-size: 12.5px; opacity: .8; min-height: 16px; }
.o-nav a, .o-nav button { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; padding: 9px 10px; border: 0; border-radius: var(--r-btn);
  background: none; color: var(--rail-text); text-decoration: none; text-align: left; cursor: pointer; font-size: 14px; }
.o-nav a:hover, .o-nav button:hover { background: var(--navy-2); color: var(--ivory); }
.o-nav a.on { background: var(--navy-2); color: var(--ivory); box-shadow: inset 2px 0 0 var(--brass); }
.o-nav svg { width: 16px; height: 16px; flex: 0 0 16px; }
.o-rail .o-foot { margin-top: auto; border-top: 1px solid var(--navy-line); padding-top: 10px; }
.o-who { padding: 4px 8px; font-size: 12.5px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-tabbar, .o-more { display: none; }

/* phone: the rail becomes a bottom tab bar; More opens the whole menu */
@media (max-width: 760px) {
  .o-app input, .o-app select, .o-app textarea, .o-input { font-size: 16px; } /* under 16px, iPhone zooms the page */
  .o-btn { height: 42px; }
  :root { --tabbar-h: 62px; }
  body.o-has-rail { padding-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); --o-off: 0px; }
  .o-rail { display: none; }
  .o-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box;
    background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px -24px rgba(11,30,45,.5); }
  .o-tabbar a, .o-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none;
    font-size: 11px; color: var(--soft); text-decoration: none; cursor: pointer; }
  .o-tabbar svg { width: 22px; height: 22px; }
  .o-tabbar .on { color: var(--navy); font-weight: 700; }
  .o-more.open { display: block; position: fixed; z-index: 70; inset: 0; background: rgba(11,30,45,.45); }
  .o-more .o-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--navy); color: var(--rail-text);
    border-radius: 18px 18px 0 0; padding: 16px 12px calc(14px + env(safe-area-inset-bottom)); }
  .o-more .o-nav a, .o-more .o-nav button { min-height: 44px; font-size: 15px; }

  .o-tiles { grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px; }
  .o-tiles .o-tile:last-child { grid-column: 1 / -1; }
  .o-tile { padding: 14px; }
  .o-tile-n { font-size: 28px; }
  .o-undo { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  .o-setup { margin: 12px; padding: 18px; }
  .o-k-box { top: 12px; bottom: 12px; max-height: none; }
  .o-k-kbd { display: none; }
  .o-k-x { display: block; }
  .o-island { padding: 8px 12px 0; }
  .o-isl-pill { min-height: 40px; min-width: 0; }
  .o-isl-btns a { padding: 12px 8px; }
}
@media print { .o-rail, .o-tabbar, .o-more, .o-undo, .o-k, .o-island { display: none !important; } body.o-has-rail { padding: 0; } }
