:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #667085; --line: #e3e6eb;
  --brand: #13233f; --brand-ink: #fff; --link: #1f5fbf; --signal: #c62828; --reflect: #f2b705;
  --expired-bg: #fde7e6; --expired: #a3160d;
  --critical-bg: #fff0dc; --critical: #9a4a00;
  --warning-bg: #fff8d6; --warning: #7a5d00;
  --notice-bg: #e8f1fd; --notice: #1d4e94;
  --ok-bg: #e3f5e8; --ok: #1d6b35;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --card: #1b1f27; --text: #e7e9ee; --muted: #98a0ae; --line: #2b313c;
    --brand: #1c3358; --link: #7fb0ff; --signal: #e0574f; --reflect: #f2b705;
    --expired-bg: #4a1714; --expired: #ffb4ad;
    --critical-bg: #47300f; --critical: #ffc98a;
    --warning-bg: #403710; --warning: #f3dd7a;
    --notice-bg: #172b48; --notice: #a9c8ff;
    --ok-bg: #163222; --ok: #93dcaa;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #12151b; --card: #1b1f27; --text: #e7e9ee; --muted: #98a0ae; --line: #2b313c;
    --brand: #1c3358; --link: #7fb0ff; --signal: #e0574f; --reflect: #f2b705;
    --expired-bg: #4a1714; --expired: #ffb4ad;
    --critical-bg: #47300f; --critical: #ffc98a;
    --warning-bg: #403710; --warning: #f3dd7a;
    --notice-bg: #172b48; --notice: #a9c8ff;
    --ok-bg: #163222; --ok: #93dcaa;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; display: flex; gap: .5rem; align-items: center; }
.muted, small.muted { color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 1rem; }

.topbar { border-bottom: 3px solid var(--signal); background: var(--brand); color: var(--brand-ink); display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; padding: .5rem 1rem; }
.topbar a { color: var(--brand-ink); }
.brand { font-weight: 800; font-size: 1.15rem; display: grid; grid-template-columns: auto auto; column-gap: .55rem; align-items: center; line-height: 1.1; letter-spacing: .01em; }
.brand img { grid-row: span 2; width: 34px; height: 34px; }
.brand b { color: var(--reflect); font-weight: 800; }
.brand small { font-weight: 400; font-size: .75rem; opacity: .85; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .15rem; flex: 1; }
.topbar nav a { padding: .4rem .65rem; border-radius: 6px; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.18); text-decoration: none; }
.who { display: flex; gap: .6rem; align-items: center; font-size: .85rem; margin: 0; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; overflow-x: auto; }
.card.narrow { max-width: 520px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; }
.page-h { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; color: var(--text); display: flex; flex-direction: column; }
.tile:hover { text-decoration: none; border-color: var(--muted); }
.tile b { font-size: 1.8rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: .85rem; }
.tile.expired b { color: var(--expired); } .tile.critical b { color: var(--critical); }
.tile.warning b { color: var(--warning); } .tile.notice b { color: var(--notice); }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.tbl th, .tbl td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl.compact td { padding: .3rem .4rem; }
.tbl tr.inactive td { opacity: .5; text-decoration: line-through; }
.empty { color: var(--muted); font-style: italic; padding: .75rem .5rem; }

.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--line); color: var(--text); white-space: nowrap; }
.pill.expired, td.expired, span.expired { background: var(--expired-bg); color: var(--expired); }
.pill.critical, td.critical, span.critical { background: var(--critical-bg); color: var(--critical); }
.pill.warning, td.warning, span.warning { background: var(--warning-bg); color: var(--warning); }
.pill.notice, td.notice, span.notice { background: var(--notice-bg); color: var(--notice); }
span.expired, span.critical, span.warning, span.notice { padding: 0 .3rem; border-radius: 4px; }
.pill.ok, .pill.st-in_service { background: var(--ok-bg); color: var(--ok); }
.pill.st-reserve, .pill.st-spare { background: var(--notice-bg); color: var(--notice); }
.pill.st-out_of_service, .pill.st-in_repair { background: var(--expired-bg); color: var(--expired); }
.pill.cs { background: #5b2a86; color: #fff; }

.unitlist { list-style: none; padding: 0; margin: 0; }
.unitlist li { display: flex; gap: .6rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.unitlist li > :first-child { flex: 1; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; align-items: center; }
input, select, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); max-width: 100%; }
.field { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .75rem; font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea { font-weight: 400; }
.field small { font-weight: 400; }
.err { color: var(--expired); }
.chk { display: flex; gap: .3rem; align-items: center; }

.btn { display: inline-block; font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.sm { padding: .1rem .5rem; font-size: .8rem; font-weight: 400; }

.flash { padding: .6rem .8rem; border-radius: 8px; margin-bottom: .75rem; background: var(--notice-bg); color: var(--notice); }
.flash.success { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--expired-bg); color: var(--expired); }
.flash.warn { background: var(--critical-bg); color: var(--critical); }

.login { max-width: 360px; margin: 10vh auto; }
.login label { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .75rem; }
.login button { width: 100%; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

/* Phones: stack table rows into cards so nothing scrolls sideways. */
@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .tbl td { display: block; border: 0; padding: .1rem .25rem; }
  .topbar nav { order: 3; flex-basis: 100%; }
}

/* Scheduling */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: .25rem 0 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .45rem .8rem; border-radius: 6px 6px 0 0; color: var(--muted); }
.tabs a.on { color: var(--text); border-bottom: 2px solid var(--signal); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); }
.cal-d { background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 92px; padding: .35rem; display: flex; flex-direction: column; gap: .2rem; color: var(--text); overflow: hidden; }
.cal-d:hover { text-decoration: none; border-color: var(--muted); }
.cal-d.dim { opacity: .45; }
.cal-d.today { outline: 2px solid var(--signal); }
.cal-d.short { background: var(--expired-bg); }
.cal-d .num { font-weight: 700; font-size: .85rem; }
.plt { display: inline-block; border-left: 4px solid var(--c); padding: 0 .35rem; font-size: .78rem; font-weight: 600; background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shortnote { color: var(--expired); font-weight: 600; }
@media (max-width: 640px) {
  .cal-d { min-height: 64px; padding: .2rem; }
  .cal-d small { display: none; }
  .plt { font-size: .65rem; padding: 0 .2rem; }
}

/* Requirement checklists */
.tbl.req tr.sect td { background: var(--bg); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding-top: .6rem; }

/* SOP text */
.policy-body { max-width: 72ch; }
.policy-body p { margin: 0 0 .8em; }

.login-mark { width: 64px; height: 64px; }
.login h1 b { color: var(--signal); }
.login h1 { display: block; }

/* Riding board */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.btn.big { min-height: 48px; padding: .6rem 1.1rem; font-weight: 700; font-size: 1rem; }
.cmd { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; background: var(--card); border: 2px solid var(--brand); border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; }
.cmd .k, .seatbox .k { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cmd b { font-size: 1.25rem; }
.cmd form.inline { display: flex; gap: .4rem; align-items: center; }
.cmd .pills { margin-left: auto; display: flex; gap: .4rem; }
.amb-order h2 { margin-bottom: .2rem; }
.due-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .5rem; }
.due-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .6rem .8rem; border-radius: 10px; background: var(--bg); }
.due-list li:first-child { background: var(--notice-bg); }
.due-list .pos { font-weight: 800; min-width: 4.5rem; color: var(--brand); }
.due-list b { font-size: 1.15rem; flex: 1; }
.rigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.rig h2 { margin-bottom: .5rem; }
.seatrow { display: grid; gap: .3rem; padding: .55rem .6rem; border-radius: 10px; background: var(--bg); margin-bottom: .45rem; }
.seatrow label { font-weight: 700; display: flex; justify-content: space-between; gap: .5rem; }
.seatrow label small { font-weight: 600; color: var(--muted); }
.seatrow select { min-height: 44px; font-size: 1rem; }
.seatrow.open, .seatrow.warn { background: var(--expired-bg); }
.seatrow .why { color: var(--expired); font-size: .85rem; font-weight: 600; }
.seatbox { display: flex; justify-content: space-between; align-items: stretch; gap: 1rem; border: 2px solid var(--brand); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; background: var(--card); color: var(--text); }
.seatbox:hover { text-decoration: none; }
.seatbox b { display: block; font-size: 1.3rem; }
.seatbox .s { color: var(--muted); font-size: .9rem; }
.seatbox .due { background: var(--brand); color: #fff; border-radius: 10px; padding: .5rem .9rem; display: grid; align-content: center; text-align: center; }
.seatbox .due .k { color: #c9d3e2; }
.seatbox .due b { color: var(--reflect); }

/* Light / Auto / Dark switch */
.theme { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; margin: 0; }
.theme button { background: transparent; border: 0; color: inherit; font: 600 .8rem/1 inherit; padding: .45rem .7rem; min-height: 34px; cursor: pointer; }
.theme button[aria-pressed="true"] { background: var(--reflect); color: #14202f; }
.theme button:focus-visible { outline: 2px solid var(--reflect); outline-offset: 1px; }

/* ===== Simple design: Home, hubs, big buttons ===== */
.topbar .mainnav a { font-size: 1.02rem; padding: .55rem .8rem; }
.agency-logo { object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.home { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.hello { margin: 0; color: var(--muted); font-weight: 600; }
.seatbox.plain { border-style: dashed; }
.bigstatus { display: flex; gap: 14px; align-items: center; border-radius: 14px; padding: 14px 16px; color: var(--text); }
.bigstatus:hover { text-decoration: none; filter: brightness(.98); }
.bigstatus svg { width: 36px; height: 36px; flex: none; }
.bigstatus b { display: block; font-size: 1.3rem; }
.bigstatus span { font-size: .95rem; }
.bigstatus.fix, .row.fix, .unitcard.fix { background: var(--expired-bg); } .bigstatus.fix svg, .unitcard.fix svg { color: var(--expired); } .bigstatus.fix b { color: var(--expired); }
.bigstatus.soon, .row.soon, .unitcard.soon { background: var(--critical-bg); } .bigstatus.soon svg, .unitcard.soon svg { color: var(--critical); } .bigstatus.soon b { color: var(--critical); }
.bigstatus.ok, .unitcard.ok { background: var(--ok-bg); } .bigstatus.ok svg, .unitcard.ok svg { color: var(--ok); } .bigstatus.ok b { color: var(--ok); }
.bigbtns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .bigbtns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bigbtn { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 104px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 1.1rem; }
.bigbtn:hover { text-decoration: none; border-color: var(--brand); }
.bigbtn:focus-visible, .hubbtn:focus-visible, .row:focus-visible { outline: 3px solid var(--reflect); outline-offset: 2px; }
.bigbtn svg { width: 32px; height: 32px; color: var(--brand); }
.bigbtn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.bigbtn.primary svg { color: var(--reflect); }
.block h2, .sectiontitle { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 8px; }
.rows { display: grid; gap: 8px; }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 52px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); }
a.row:hover { text-decoration: none; border-color: var(--brand); }
.row b { text-align: right; }
.row.info { background: var(--notice-bg); }
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hubbtn { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: 1.05rem; }
.hubbtn:hover { text-decoration: none; border-color: var(--brand); }
.hubbtn svg { width: 28px; height: 28px; color: var(--brand); flex: none; }
.unitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.unitcard { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; color: var(--text); min-height: 72px; }
.unitcard:hover { text-decoration: none; filter: brightness(.97); }
.unitcard svg { width: 28px; height: 28px; flex: none; }
.unitcard b { display: block; font-size: 1.15rem; }
.managegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mcard { display: grid; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); min-height: 92px; }
.mcard:hover { text-decoration: none; border-color: var(--brand); }
.mcard b { font-size: 1.1rem; }
.mcard span { color: var(--muted); font-size: .92rem; }
.approve { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.approve span { display: block; color: var(--muted); }
.approve form { display: flex; gap: 8px; }
.settings { display: grid; gap: 14px; max-width: 980px; }
.swatchpick { display: flex; flex-wrap: wrap; gap: 10px; }
.swatchpick .sw { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; }
.swatchpick .chip { width: 28px; height: 28px; border-radius: 6px; display: inline-block; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks.col { flex-direction: column; }
.chk.big { font-size: 1.05rem; font-weight: 600; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } }

/* ===== Phone: home-screen app, bottom tabs, rig checks ===== */
.tabbar { display: none; }
@media (max-width: 760px) {
  body.signed-in { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: max(.5rem, env(safe-area-inset-top)); }
  .topbar .mainnav, .topbar .theme, .topbar .who { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px;
    color: var(--muted); font-size: .78rem; font-weight: 700; border-radius: 12px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a svg { width: 26px; height: 26px; }
  .tabbar a.on { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
  :root:not([data-theme="light"]) .tabbar a.on { color: var(--text); }
  main { padding-left: 12px; padding-right: 12px; }
  .foot { display: none; }
}
@media (max-width: 760px) and (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tabbar a.on { color: var(--brand); } }
.back { display: inline-block; font-weight: 700; padding: 6px 0; min-height: 44px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 999px; background: var(--brand); color: #fff; vertical-align: middle; }
.tag.fix { background: var(--expired); }
.muted { color: var(--muted); }
.steps { margin: 0; padding-left: 1.4rem; display: grid; gap: 6px; font-size: 1.05rem; }
.theme.big { border-color: var(--line); }
.theme.big button { min-height: 52px; padding: 0 18px; font-size: 1rem; color: var(--text); }

.checkrow { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 16px; border-radius: 14px; color: var(--text); }
.checkrow:hover { text-decoration: none; filter: brightness(.97); }
.checkrow svg { width: 30px; height: 30px; flex: none; }
.checkrow div { flex: 1; }
.checkrow b { display: block; font-size: 1.2rem; }
.checkrow i { font-style: normal; font-size: 1.8rem; color: var(--muted); }
.checkrow.fix { background: var(--expired-bg); } .checkrow.fix svg { color: var(--expired); }
.checkrow.soon { background: var(--critical-bg); } .checkrow.soon svg { color: var(--critical); }
.checkrow.ok { background: var(--ok-bg); } .checkrow.ok svg { color: var(--ok); }

.check { max-width: 640px; margin: 0 auto; }
.check-head { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 6px 0 10px; margin-bottom: 6px; }
.check-head h1 { margin: 0; font-size: 1.6rem; }
.check-head p { margin: 2px 0 8px; color: var(--muted); font-weight: 600; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.check-sec { margin-bottom: 18px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 8px; }
.sec-head h2 { margin: 0; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.allok { min-height: 44px; font-weight: 700; }
.line { border: 2px solid var(--line); border-radius: 14px; background: var(--card); padding: 12px; margin: 0 0 10px; }
.line legend { float: left; width: 100%; padding: 0; font-weight: 700; font-size: 1.08rem; margin-bottom: 10px; }
.line legend + * { clear: both; }
.line.err { border-color: var(--expired); background: var(--expired-bg); }
.oos { display: block; font-size: .78rem; font-weight: 700; color: var(--expired); margin-top: 2px; }
.already { margin: 0 0 8px; font-size: .9rem; color: var(--critical); font-weight: 600; clear: both; }
.choices { display: grid; grid-template-columns: 1fr 1fr 64px; gap: 8px; clear: both; }
.c { position: relative; }
.c input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.c span { display: flex; align-items: center; justify-content: center; min-height: 56px; border-radius: 12px; border: 2px solid var(--line);
  font-weight: 800; font-size: 1.1rem; background: var(--bg); color: var(--text); cursor: pointer; user-select: none; }
.c.na span { font-size: .9rem; color: var(--muted); }
.c input:focus-visible + span { outline: 3px solid var(--reflect); outline-offset: 2px; }
.c.ok input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.c.problem input:checked + span { background: var(--expired); border-color: var(--expired); color: #fff; }
.c.na input:checked + span { background: var(--muted); border-color: var(--muted); color: #fff; }
.line .what { display: none; margin-top: 10px; font-weight: 700; }
.line:has(input[value=problem]:checked) .what { display: grid; gap: 4px; }
.line .what input, .endnote input, .fixform input[type=text] { min-height: 48px; font-size: 1rem; width: 100%; }
.endnote { display: grid; gap: 4px; font-weight: 700; margin: 8px 0 16px; }
.finish { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.finish .btn { width: 100%; min-height: 60px; font-size: 1.15rem; }
@media (min-width: 761px) { .finish { bottom: 0; } }
.fixform { display: grid; gap: 8px; width: 100%; }
.oosbox { border-color: var(--expired); background: var(--expired-bg); }

/* Schedule by group */
.daynav { display: flex; gap: 6px; }
.daynav .btn.big { min-width: 52px; justify-content: center; text-align: center; }
.staffing { margin-bottom: 14px; }
.grp { border: 1px solid var(--line); border-left: 6px solid var(--c); border-radius: 14px; background: var(--card); margin-bottom: 14px; overflow: hidden; }
.grp header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 14px;
  background: color-mix(in srgb, var(--c) 12%, transparent); }
.grp h2 { margin: 0; font-size: 1.15rem; } .grp h2 span { font-weight: 600; font-size: .85rem; color: var(--muted); }
.grp header small { color: var(--muted); font-weight: 700; }
.duty { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); min-height: 56px; }
.duty .who b, .duty .hrs b { display: block; font-size: 1.05rem; }
.duty .who small, .duty .hrs small { color: var(--muted); }
.duty .hrs { text-align: right; display: grid; justify-items: end; align-content: center; gap: 2px; }
.duty.isoff { background: var(--critical-bg); } .duty.isoff .who b { text-decoration: line-through; text-decoration-thickness: 1px; }
.duty.split { background: color-mix(in srgb, var(--critical-bg) 55%, transparent); }
.offnote { font-weight: 700; color: var(--critical); font-size: .9rem; }
.cover { font-weight: 700; color: var(--ok); font-size: .9rem; }
.offgrp { padding: 8px 0; border-top: 1px solid var(--line); line-height: 1.6; }
.wkwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.wk { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .92rem; }
.wk th, .wk td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.wk tbody th { text-align: left; font-weight: 600; position: sticky; left: 0; background: var(--card); }
.wk thead th { font-size: .8rem; color: var(--muted); } .wk thead th.td { color: var(--text); background: var(--notice-bg); }
.wk .wkgrp th { text-align: left; background: color-mix(in srgb, var(--c) 14%, var(--card)); border-left: 5px solid var(--c); font-weight: 800; }
.wkc { display: inline-block; padding: 2px 6px; border-radius: 6px; font-weight: 700; background: var(--ok-bg); color: var(--ok); }
.wkc.off { background: var(--critical-bg); color: var(--critical); }
.wkc.split { background: linear-gradient(90deg, var(--ok-bg) 50%, var(--critical-bg) 50%); color: var(--text); }
.wkc.extra { background: var(--notice-bg); color: var(--notice); }
.wk .tot { font-weight: 800; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .88rem; color: var(--muted); }
/* Month view lists people on wide screens (like a printed schedule); phones keep the compact view. */
.cal-people { display: none; }
@media (min-width: 1100px) {
  main:has(.cal) { max-width: none; }
  .cal-people { display: grid; gap: 1px; margin-bottom: 3px; }
  .cp { font-size: .74rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cp i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
  .cp.off { color: var(--critical); text-decoration: line-through; }
  .cp.split { color: var(--critical); }
  .cp.extra { color: var(--notice); font-weight: 600; }
  .cal-d { min-height: 120px; }
}
/* Arrange sections */
.arrange { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.arrange li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.arrange li b { flex: 1; font-size: 1.05rem; }
.arrange li small { color: var(--muted); font-weight: 700; }
.arrange .pos { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; }
.arrange form { display: flex; gap: 6px; }
.arrange .btn.big { min-width: 52px; justify-content: center; }
.arrange .btn[disabled] { opacity: .35; }
.arrange li.hidden-sec { opacity: .7; border-style: dashed; }
.arrange-link { text-align: center; margin: 4px 0 0; }
/* Check setup */
.home.wide { max-width: 980px; }
.assignrow select { min-height: 48px; font-size: 1rem; min-width: 12rem; }
.pickpeople { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.pickpeople .chk { display: flex; gap: 8px; align-items: center; min-height: 40px; }
.pickpeople input { width: 22px; height: 22px; }
.pickpeople small { color: var(--muted); }
.stockpanel { border: 2px solid var(--brand); border-radius: 14px; padding: 12px; margin-bottom: 14px; background: var(--card); display: grid; gap: 6px; }
.stockpanel h2 { margin: 0 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stockpanel .sp { display: grid; padding: 8px 10px; border-radius: 10px; }
.stockpanel .sp span { font-size: .9rem; color: var(--muted); }
.stockpanel .sp.fix { background: var(--expired-bg); } .stockpanel .sp.fix b { color: var(--expired); }
.stockpanel .sp.soon { background: var(--critical-bg); }
.okline { margin: 0; color: var(--ok); font-weight: 700; }
.setupsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setupsteps li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.setupsteps .num { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; flex: none; }
.setupsteps li.done .num { background: var(--ok); }
.setupsteps li > div:nth-child(2) { flex: 1; min-width: 200px; display: grid; }
.setupsteps b { font-size: 1.08rem; } .setupsteps span { color: var(--muted); } .setupsteps small { color: var(--ok); font-weight: 700; }
.setupsteps .acts { display: flex; gap: 8px; }
/* QuartersReady editing screens */
.findbox { width: 100%; max-width: 420px; min-height: 48px; font-size: 1rem; margin-bottom: 10px; }
.tblwrap { overflow-x: auto; }
.editlist td.r { text-align: right; }
.emptybox { padding: 18px; border: 2px dashed var(--line); border-radius: 14px; background: var(--card); }
.editform .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.fld { display: grid; gap: 4px; align-content: start; }
.fld > label { font-weight: 700; }
.fld .req { font-style: normal; font-weight: 600; font-size: .75rem; color: var(--muted); }
.fld input:not([type=checkbox]):not([type=radio]), .fld select, .fld textarea { width: 100%; min-height: 48px; font-size: 1rem; }
.fld input[type=color] { padding: 2px; min-height: 48px; }
.fld textarea { min-height: 90px; }
.fld:has(textarea) { grid-column: 1 / -1; }
.fld small { color: var(--muted); font-size: .85rem; }
.fld.err input, .fld.err select, .fld.err textarea { border-color: var(--expired); }
.ferr { color: var(--expired); font-size: .9rem; }
.chkfld label { display: flex; gap: 10px; align-items: center; min-height: 48px; font-weight: 700; }
.chkfld input[type=checkbox] { width: 24px; height: 24px; }
.fld ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.fld ul label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.inlineset { margin-top: 18px; }
.inlineset h2 { margin: 0 0 4px; font-size: 1.1rem; }
.inrows { display: grid; gap: 8px; }
.inrow { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.inrow .fld { flex: 1 1 160px; }
.inrow.blank { border-style: dashed; background: transparent; }
.inrow.err { border-color: var(--expired); }
.inrow .rm { display: flex; gap: 6px; align-items: center; min-height: 48px; color: var(--expired); font-weight: 700; }
.formbtns { display: flex; flex-wrap: wrap; gap: 10px; }
.formbtns .btn { width: auto; flex: 1 1 160px; justify-content: center; text-align: center; }
.deleteform { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn.danger { border-color: var(--expired); color: var(--expired); background: transparent; }
.intbl { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.intbl th { text-align: left; font-size: .85rem; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.intbl td { padding: 4px 6px; vertical-align: top; background: var(--card); }
.intbl tr td:first-child { border-radius: 10px 0 0 10px; } .intbl tr td:last-child { border-radius: 0 10px 10px 0; }
.intbl tr.blank td { background: transparent; }
.intbl tr.err td { background: var(--expired-bg); }
.intbl input:not([type=checkbox]), .intbl select { width: 100%; min-width: 7rem; min-height: 46px; font-size: 1rem; }
.intbl input[type=checkbox] { width: 24px; height: 24px; margin-top: 11px; }
.intbl .rmcell { white-space: nowrap; }
@media (max-width: 760px) {
  .intbl thead { display: none; }
  .intbl tr { display: grid; gap: 6px; padding: 10px; margin-bottom: 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
  .intbl tr.blank { border-style: dashed; background: transparent; }
  .intbl td { display: grid; gap: 2px; background: transparent; padding: 0; }
  .intbl td::before { content: attr(data-label); font-weight: 700; font-size: .85rem; }
  .intbl td.rmcell::before { content: none; }
}
/* Public demo */
.demobar { background: var(--reflect, #f2b705); color: #14202f; text-align: center; font-weight: 700; padding: 6px 12px; font-size: .9rem; }
.demobar a { color: #14202f; text-decoration: underline; }
.demobox { display: grid; gap: 10px; text-align: left; }
.demobox p { margin: 0; color: var(--muted); }
.demobox form { display: grid; gap: 2px; }
.demobox .btn { width: 100%; }
.demobox small { color: var(--muted); }
.invlink { width: 100%; margin-top: 6px; font: .85rem ui-monospace, monospace; min-height: 40px; }
.approve.offinv { opacity: .6; }
/* Sign-offs */
.checkrow.plain { background: var(--card); border: 1px solid var(--line); }
.checkrow .bar { margin-top: 6px; }
.line.sign { display: grid; gap: 10px; }
.line.sign.signed { border-color: var(--ok); background: var(--ok-bg); }
.stxt { display: grid; gap: 4px; }
.stxt b { font-size: 1.05rem; }
.stxt .sig { color: var(--ok); font-weight: 700; font-size: .92rem; }
.stxt .two { color: var(--muted); font-size: .85rem; font-weight: 700; }
.signform { display: flex; flex-wrap: wrap; gap: 8px; }
.signform input { flex: 1 1 180px; min-height: 48px; font-size: 1rem; }
.signform .btn { flex: 0 0 auto; min-width: 130px; }
.undo .link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px 0; font-size: .9rem; }
.approvebox { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--ok-bg); border: 2px solid var(--ok); margin-bottom: 12px; }
.approvebox span { color: var(--text); }
/* Vehicle */
.vehiclebox { border: 2px solid var(--brand); border-radius: 14px; padding: 12px; margin-bottom: 14px; background: var(--card); display: grid; gap: 10px; }
.vehiclebox h2 { margin: 0; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.vrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.vrow .fld input { min-height: 56px; font-size: 1.25rem; font-weight: 700; }
.fuelline { margin: 0; }
.fuelchoices { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fuelchoices .c span { min-height: 52px; font-size: 1rem; }
.vcard { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 8px; }
.vcard > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; }
.vcard span { color: var(--muted); font-size: .85rem; } .vcard b { font-size: 1.2rem; }
.vcard .warnv { background: var(--critical-bg); } .vcard .badv { background: var(--expired-bg); } .vcard .badv b { color: var(--expired); }
.preview14 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.preview14 > div { display: grid; gap: 2px; padding: 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); min-height: 78px; }
.preview14 > div.on { background: var(--ok-bg); border-color: var(--ok); }
.preview14 small { color: var(--muted); } .preview14 span { font-size: .85rem; font-weight: 600; }
@media (max-width: 760px) { .preview14 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.deptswitch select { min-height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: inherit; font-weight: 700; padding: 0 10px; max-width: 220px; }
.deptswitch option { color: #14202f; }
@media (max-width: 760px) { .topbar .deptswitch { order: 2; margin-left: auto; } .deptswitch select { max-width: 150px; } }
