/* Job Progressor. Layout: one-screen site tool. A slim top bar (drawing picker, progress, status key), the drawing
   fills the rest, and the tapped item opens in a bottom sheet (a side panel on wide screens). */
:root {
  --bg: #eef0ee; --surface: #ffffff; --fg: #1a1e21; --muted: #5a636a; --line: #d5dad7;
  --accent: #e8590c; --accent-ink: #1a1e21; --paper: #ffffff; --mk-bg: #ffffff; --mk-ink: #1a1e21;
  /* status highlight colours (Okabe-Ito, colour-blind safe) live in app.js: they sit on the white drawing in both themes */
  --font-display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 6px 24px rgba(16, 24, 32, .18);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #121618; --surface: #1c2226; --fg: #e7ebe9; --muted: #9ba5ab; --line: #2e373c;
  --accent: #ff7a2f; --accent-ink: #121618; --shadow: 0 6px 24px rgba(0, 0, 0, .5); color-scheme: dark } }

* { box-sizing: border-box }
/* Pinch-zooming the whole page (outside the drawing) knocked the layout sideways on phones; the drawing has its own
   zoom (Leaflet handles its own pinch), and lists still scroll. Double-tap zoom is off too. */
html, body { touch-action: pan-x pan-y }
html, body { height: 100%; margin: 0; overflow: hidden; width: 100% }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px) }
[hidden] { display: none !important }
.app { height: 100%; display: flex; flex-direction: column }
button { font: inherit; color: inherit; cursor: pointer }
button:focus-visible, textarea:focus-visible, .tag:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }

.bar { min-width: 0; grid-template-columns: minmax(0, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 8px; display: grid; gap: 8px; z-index: 2 }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0 }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .01em; margin-right: auto }
.brand span { color: var(--accent) }
/* drawing picker: one line, swipe sideways if it doesn't fit (never widens the page) */
.pick { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; min-width: 0; scrollbar-width: none }
.pick::-webkit-scrollbar { display: none }
.pick .seg { flex: none }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-weight: 600 }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink) }
.ghost { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 12px; font-weight: 500 }
.ghost[aria-pressed="true"] { border: 2px solid var(--accent); padding: 5px 11px; background: color-mix(in srgb, var(--accent) 14%, transparent) }
#map.selecting { cursor: crosshair; touch-action: none !important }
.pacts { margin-top: 10px }
.pacts:empty { display: none }
.where { font-weight: 600 }
.prog { font-variant-numeric: tabular-nums; font-weight: 600 }
.prog small { color: var(--muted); font-weight: 400; margin-left: 6px }
.key { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none }
.key::-webkit-scrollbar { display: none }
.chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 10px 3px 4px; font-size: 13px; font-variant-numeric: tabular-nums }
.chip b { font-weight: 600 }
.chip svg { width: 20px; height: 20px }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.35 }

.stage { position: relative; flex: 1; min-height: 0 }
#map { position: absolute; inset: 0; background: var(--paper) }
.msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted) }

/* Status = a see-through highlight BEHIND the drawn symbol (drawn on the map, no outline) plus a small letter tag
   beside it (never on it), so the symbol stays readable and status never relies on colour alone. */
.tag { background: none; border: 0 }
.tag-in { display: inline-block; font: 700 11px/14px var(--font-display); padding: 0 4px; border-radius: 4px; border: 1.5px solid;
  background: var(--mk-bg); color: var(--mk-ink); white-space: nowrap }
.far .tag { display: none }
.tag-rev { display: inline-block; min-width: 13px; margin: -1px 3px -1px -3px; padding: 0 3px; border-radius: 3px 0 0 3px; text-align: center; font-weight: 800 }
.tag-rev.solo { margin: -1px -3px; border-radius: 3px }
.chip.rev svg { width: 20px; height: 20px }

.panel { position: absolute; z-index: 1100; left: 0; right: 0; bottom: 0; max-height: 62%; overflow: auto;
  background: var(--surface); color: var(--fg); border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow); padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility .22s }
.panel.open { transform: none; visibility: visible }
@media (min-width: 760px) {
  .panel { left: auto; top: 12px; right: 12px; bottom: 12px; width: 340px; max-height: none; border: 1px solid var(--line);
    border-radius: 12px; transform: translateX(110%) }
}
.ph { display: flex; align-items: flex-start; gap: 12px }
.pt { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1 }
.ps { color: var(--muted); font-size: 13px; margin-top: 2px }
.x { margin-left: auto; border: 1px solid var(--line); background: transparent; border-radius: 8px; width: 36px; height: 36px; font-size: 20px; line-height: 1 }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 14px }
.sbtn { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; background: transparent; font-size: 13px; font-weight: 600 }
.sbtn svg { width: 26px; height: 26px }
.sbtn[aria-pressed="true"] { border: 2px solid var(--accent); padding: 9px 3px; background: color-mix(in srgb, var(--accent) 12%, transparent) }
.sbtn[aria-pressed="true"]::after { content: "Current"; font-size: 11px; font-weight: 500; color: var(--muted) }
.lbl { display: block; font-weight: 600; margin: 16px 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted) }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; background: var(--bg); color: var(--fg); resize: vertical }
.nrow { display: flex; gap: 8px; margin-top: 8px; align-items: center }
.primary { border: 0; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px 14px; font-weight: 600 }
.saved { color: var(--muted); font-size: 13px }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.hist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 13.5px }
.hist svg { width: 20px; height: 20px }
.hist time { color: var(--muted); font-variant-numeric: tabular-nums }
.hist q { display: block; quotes: none; color: var(--fg); margin-top: 2px; overflow-wrap: anywhere }
@media (max-width: 600px) {  /* phone: keep the drawing big */
  .bar { padding: 8px 12px 6px; gap: 6px }
  .bar .row { column-gap: 8px }
  .brand { font-size: 17px }
  .seg button { padding: 6px 11px }
  .ghost { padding: 5px 10px }
  .note { display: none }
}
/* ---------------------------------------------------------------- home: blocks, wheel, floor stack */
.home { position: fixed; inset: 0; z-index: 2000; background: var(--bg); color: var(--fg); display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(env(safe-area-inset-bottom, 0px) + 12px); overflow: hidden;
  transition: opacity .35s ease }
.home.gone { opacity: 0; pointer-events: none }
.h-top { display: flex; align-items: center; gap: 12px; min-height: 44px }
.h-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.1 }
.h-sub { color: var(--muted); font-size: 13px; margin-top: 2px }
.h-view { position: relative; flex: 1; min-height: 0 }
.prog-line { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted) }
.prog-line b { color: var(--fg) }
.bar-mini { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px }
.bar-mini i { display: block; height: 100%; background: var(--accent) }

.blocks { position: absolute; inset: 0; display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; align-content: center }
.bcard { width: min(40vw, 300px); min-height: 180px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: left; box-shadow: var(--shadow);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .45s ease }
.bcard .big { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1 }
.bcard.out-l { transform: translateX(-120vw); opacity: 0 }
.bcard.out-r { transform: translateX(120vw); opacity: 0 }
@media (max-width: 600px) { .bcard { width: 100%; min-height: 140px } .bcard .big { font-size: 36px } }

/* drawing types: flat row (up to 4 visible, swipe for more) on wide screens; a wheel on phones */
.cols { position: absolute; inset: 0; display: flex; gap: 16px; align-items: center; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 4px; scrollbar-width: none }
.cols::-webkit-scrollbar { display: none }
.ccard { flex: 0 0 calc((100% - 48px) / 4); min-width: 200px; height: min(70%, 460px); scroll-snap-align: start; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 8px;
  text-align: left; overflow: hidden }
.ccard .name { font-family: var(--font-display); font-weight: 700; font-size: 26px }
.ccard .pv { flex: 1; min-height: 0; background: #fff; border-radius: 8px; display: grid; place-items: center; overflow: hidden }
.ccard .pv img { max-width: 100%; max-height: 100%; object-fit: contain }
.wheel { position: absolute; inset: 0; perspective: 900px; touch-action: none; overflow: hidden }
.ring { position: absolute; left: 50%; top: 50%; width: 42vw; height: min(62vh, 440px); margin: calc(min(62vh, 440px) / -2) 0 0 -21vw;
  transform-style: preserve-3d; will-change: transform }
.ring.snap { transition: transform .35s cubic-bezier(.2, .8, .2, 1) }
.wheel .ccard { position: absolute; inset: 0; min-width: 0; backface-visibility: hidden }

/* floors floating in 3D, ground floor at the bottom */
.floors { position: absolute; inset: 0 }
.stack { position: absolute; left: 50%; top: 52%; width: min(78vw, 620px, 90%); aspect-ratio: 2384 / 1684; transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(56deg) rotateZ(-32deg); transition: transform .65s cubic-bezier(.2, .8, .2, 1) }
.layer { position: absolute; inset: 0; background: #fff; border-radius: 4px; border: 1px solid #c9cfcc;
  box-shadow: 0 18px 30px rgba(0, 0, 0, .28); transition: transform .65s cubic-bezier(.2, .8, .2, 1), opacity .4s ease; cursor: pointer }
.layer img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none }
.flist { position: absolute; left: 0; right: 0; bottom: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 220px)); justify-content: center }
.flist button { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 10px }
.flist b { display: block; font-family: var(--font-display); font-size: 17px }
.flist .prog-line, .bcard .prog-line, .ccard .prog-line { display: block }
.bar-mini { display: block }
@media (max-width: 600px) { .flist { grid-template-columns: repeat(3, minmax(0, 1fr)) }
  .stack { top: 42% } .flist .prog-line { font-size: 11.5px } }
/* floor tags: "G block · Level 1 · Lighting", each with a line to its drawing (placed by app.js) */
.pin { position: absolute; width: 0; height: 0 }
.leads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .3s }
.leads polyline { fill: none; stroke: var(--muted); stroke-width: 1.5 }
.leads circle { fill: var(--surface); stroke: var(--fg); stroke-width: 1.5 }
.ftags { position: absolute; inset: 0; pointer-events: none }
.ftag { position: absolute; right: 2px; top: 0; max-width: var(--tag-w, 220px); pointer-events: auto; text-align: left; border: 1px solid var(--line);
  background: var(--surface); border-radius: 8px; padding: 5px 9px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.3; opacity: 0;
  transition: opacity .3s }
.floors.tagged .ftag, .floors.tagged .leads { opacity: 1 }
.ftag b { font-family: var(--font-display); font-size: 16px }
.ftag span { color: var(--muted) }
.floors:not(.narrow) .ftag > * + *::before { content: "·"; margin: 0 6px; color: var(--muted); font-weight: 400 }
.floors.narrow .ftag > * { display: block }
.stack.flat { transform: translate(-50%, -50%) rotateX(0deg) rotateZ(0deg) scale(1.12) }
.stack.flat .layer:not(.chosen) { opacity: 0; pointer-events: none }
/* opening a floor: no more taps until the drawing is up (they used to open another floor hidden behind it) */
.floors.opening { pointer-events: none }
.floors.opening .ftag, .floors.opening .leads { opacity: 0 }
.floors.opening .flist { opacity: .45 }
.stack.flat .layer.chosen { transform: translateZ(0) }

@media (prefers-reduced-motion: reduce) { .panel, .home, .bcard, .stack, .layer, .ring.snap { transition: none } }

/* ---------------------------------------------------------------- hours screens, menu, sign-off panel */
.h-menu { margin-left: auto }
.screen { position: fixed; inset: 0; z-index: 2500; background: var(--bg); color: var(--fg); display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0 }
.scr-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 0 calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: grid; align-content: start; grid-auto-rows: max-content; gap: 12px; max-width: 760px; width: 100%; margin: 0 auto }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; min-width: 0 }
.ctitle { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.2 }
.ctitle .small { font-family: var(--font-body); font-weight: 400; margin-left: 6px }
.small { color: var(--muted); font-size: 12.5px }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 0 }
.flash { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); font-size: 14px }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted) }
.field > span { font-weight: 600 }
input[type=text], input[type=number], input[type=date], select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; min-width: 0; width: 100% }
input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px }
input:disabled, select:disabled { opacity: .6 }
.seg.wrap { flex-wrap: wrap }
.dayrow { display: flex; gap: 8px; align-items: center }
.dayrow input[type=date] { flex: 1 }
.quick { display: flex; flex-wrap: wrap; gap: 6px }
.quick .ghost { padding: 6px 10px }
.ok { color: #00694c } .wait { color: var(--muted) } .bad { color: #b03a00 }
@media (prefers-color-scheme: dark) { .ok { color: #3fc79a } .bad { color: #ff8a4c } }
.tagw { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line) }
.tlist, .alist, .week, .plist, .blist, .areas, .facts, .stg { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.tlist li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line) }
.tlist li.editing { border-left: 4px solid var(--accent); padding-left: 8px }
.tlist q, .alist q { display: block; quotes: none; color: var(--fg); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere }
.tacts { display: flex; gap: 6px; flex: none }
.week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px }
.wday { width: 100%; display: grid; gap: 2px; justify-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; padding: 6px 2px; font-size: 12px }
.wday b { font-size: 14px; white-space: nowrap } .wday small { color: var(--muted); font-size: 10.5px; text-align: center; line-height: 1.25 }
.wday span { white-space: nowrap; font-size: 11.5px }
.wday.on { border: 2px solid var(--accent); padding: 5px 1px }
.dhead { font-weight: 700; margin-top: 4px }
.alist li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px }
.alist label { display: flex; gap: 10px; align-items: flex-start; flex: 1 }
.alist input[type=checkbox] { width: 22px; height: 22px; margin: 0; flex: none }
.alist em { display: block; font-style: normal }
.headline { font-size: 15px } .headline .big { font-family: var(--font-display); font-weight: 700; font-size: 30px }
.vs { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: 13px }
.vs i { display: block; height: 12px; border-radius: 6px; min-width: 2px }
.vs .b-earn { background: #009E73 } .vs .b-work { background: repeating-linear-gradient(45deg, #56B4E9 0 6px, #2f8cc4 6px 9px) }
.facts li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 6px }
.facts b { font-variant-numeric: tabular-nums; white-space: nowrap }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 6px 4px 0 }
.tbl td { border-top: 1px solid var(--line); padding: 6px 6px 6px 0; vertical-align: top }
.areas li { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 3px }
.aname { font-weight: 600 }
.plist li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center }
.addrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.addrow input, .addrow select { flex: 1 1 140px; width: auto }
.filebtn { display: inline-block; cursor: pointer }
.blist li { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px }
.bname { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline }
.bgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px }
.bgrid label { display: grid; gap: 2px; font-size: 11.5px; color: var(--muted) }
.bgrid.four { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.btot { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted) }
.menu { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 14, 18, .45); display: flex; align-items: flex-end; justify-content: center }
.menu-in { background: var(--surface); color: var(--fg); width: min(100%, 460px); max-height: 88%; overflow-y: auto; border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 10px; box-shadow: var(--shadow) }
@media (min-width: 760px) { .menu { align-items: flex-start; justify-content: flex-end; padding: 60px 16px 0 } .menu-in { border-radius: 14px } }
.mhead { display: flex; align-items: center } .mhead b { font-family: var(--font-display); font-size: 20px }
.mlist { display: grid; gap: 6px }
.who { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 14px }
.who b { color: var(--fg) }
.mi { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); background: transparent; border-radius: 10px; padding: 10px 12px }
.mi span { color: var(--muted); font-size: 13px }
.mi .count { font-style: normal; font-size: 12px; font-weight: 600; border: 1px solid var(--accent); border-radius: 999px; padding: 0 7px; margin-left: 6px }
.stg li, .hist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 13.5px }
.stg svg { width: 20px; height: 20px }
.hist .mk { font-weight: 700; text-align: center }
.key .seg { flex: none } .key .seg button { padding: 3px 10px; font-size: 13px }
@media (max-width: 600px) {
  .bar .brand { display: none }
  .plist li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) }
  .plist li input[type=text] { grid-column: 1 / -1 }
  .bgrid.four { grid-template-columns: minmax(0, 1fr) }
  .tlist li { flex-direction: column }
}
.pill { display: inline-block; vertical-align: middle; font: 600 12px/1.6 var(--font-body); padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); margin-left: 6px }
.pill.ok { border-color: #00694c } .pill.todo { border-color: var(--accent) }
.setup-banner { margin-top: 8px; text-align: left; border: 1px solid var(--accent); border-left-width: 4px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); padding: 10px 12px; font-weight: 600 }
input[type=time], input[type=tel], input[type=email], input[type=search], .field textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; min-width: 0; width: 100% }

/* Hosted sign-in (db.js): over everything until signed in */
.signin { position: fixed; inset: 0; z-index: 5000; background: var(--bg); display: grid; place-items: center; padding: 24px 16px; overflow-y: auto }
.si-in { width: min(100%, 380px) }
.si-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px }
.si-brand img { width: 40px; height: 40px }
.si-brand b { font-family: var(--font-display); font-weight: 800; font-size: 30px }
.si-brand small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase }
#si-form { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 16px }
#si-form h1 { margin: 0; font-size: 20px }
#si-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px }
#si-form input { font: inherit; font-size: 16px; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100% }
#si-form input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
#si-go { padding: 12px; font-weight: 700 }
.si-msg { margin: 0; color: #c2410c; font-weight: 600; font-size: 14px }
.si-msg::before { content: "! " }
.si-note { color: var(--muted); font-size: 13px; margin: 14px 2px 0 }

/* ---------------------------------------------------------------- side panel (nav.js): docked from 1000px wide, a drawer below */
:root { --nav-w: 0px }
@media (min-width: 1000px) { body:not(.nav-closed) { --nav-w: 280px } }
.app { margin-left: var(--nav-w) }
.home, .screen { left: var(--nav-w) }
.side { position: fixed; z-index: 2600; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); background: var(--surface); color: var(--fg);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); box-shadow: var(--shadow);
  transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility .22s }
.side.open { transform: none; visibility: visible }
.side-bg { position: fixed; inset: 0; z-index: 2550; background: rgba(10, 14, 18, .45) }
@media (min-width: 1000px) {
  .side { width: 280px; box-shadow: none }
  body:not(.nav-closed) .side { transform: none; visibility: visible }
}
.s-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line) }
.s-head img { width: 28px; height: 28px }
.s-brand { font-family: var(--font-display); font-weight: 800; font-size: 21px; margin-right: auto }
.s-brand span { color: var(--accent) }
.s-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 16px; display: grid; align-content: start; gap: 6px }
.s-proj { display: grid; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); margin-bottom: 4px }
.s-pname { font-family: var(--font-display); font-size: 20px; line-height: 1.15; overflow-wrap: anywhere }
.s-change { margin-top: 8px; justify-self: start; border: 2px solid var(--accent); padding: 6px 12px; font-weight: 600 }
.s-lbl { display: block; margin: 12px 2px 2px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted) }
.s-proj .s-lbl { margin: 0 }
.s-lbl .count { font-style: normal; border: 1px solid var(--accent); border-radius: 999px; padding: 0 7px; margin-left: 4px; color: var(--fg); letter-spacing: 0 }
.s-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin: 4px 2px 0 }
.s-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px }
.s-list li { display: flex; align-items: stretch; gap: 2px; min-width: 0 }
.s-row { flex: 1; min-width: 0; display: grid; gap: 1px; text-align: left; border: 1px solid transparent; background: transparent;
  border-radius: 10px; padding: 7px 10px; min-height: 44px; align-content: center }
.s-row:hover, .s-star:hover, .s-radio:hover { background: color-mix(in srgb, var(--fg) 6%, transparent) }
.s-row b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere }
.s-row span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums }
.s-row[aria-current] { border-color: var(--line); border-left: 4px solid var(--accent); padding-left: 7px; background: color-mix(in srgb, var(--accent) 10%, transparent) }
.s-star { flex: none; width: 44px; border: 0; background: transparent; border-radius: 10px; font-size: 18px; color: var(--accent) }
.s-prob { grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start }
.s-prob svg { width: 22px; height: 22px; margin-top: 1px }
.s-pt { display: grid; gap: 1px; min-width: 0 }
.s-pt q { quotes: none; color: var(--fg); font-size: 13px; overflow-wrap: anywhere }
.s-more { justify-self: start; font-size: 13px; margin-left: 4px }
.s-empty { margin: 0 2px; color: var(--muted); font-size: 13px; line-height: 1.4 }
.s-hide { display: grid; gap: 1px }
.s-radio { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; font-size: 14px; cursor: pointer; min-height: 40px }
.s-radio input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent) }
.s-radio svg, .s-g { width: 20px; height: 20px; flex: none }
.s-radio:has(input:checked) { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600 }
.s-radio input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
.s-foot { border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px }
.s-foot .who { margin: 0 2px }
.s-foot .hint { margin: 0 2px; font-size: 12.5px }
.side .x { width: 40px; height: 40px }

/* ☰, Change project, Favourite */
.nav-btn { font-size: 18px; line-height: 1; padding: 6px 11px; min-width: 40px; min-height: 36px }
.h-head { min-width: 0 }
.h-proj { margin-left: auto; flex: none; border: 2px solid var(--accent); padding: 6px 12px; font-weight: 600 }
@media (max-width: 600px) { .home:not([data-level="blocks"]) .h-proj { display: none } }
.where { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap }
.fav { padding: 3px 10px; font-size: 13px; font-weight: 600 }

/* projects: a sheet from the bottom on phones, centred on wide screens */
.proj .mlist { gap: 8px }
.pj[aria-current] { border: 2px solid var(--accent); padding: 9px 11px }
@media (min-width: 760px) { .proj { align-items: center; justify-content: center; padding: 24px } .proj .menu-in { width: min(100%, 520px); max-height: 80vh } }
@media (prefers-reduced-motion: reduce) { .side, .ftag, .leads { transition: none } }

/* stages and colours (owner) */
.stg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px }
.stg-list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid var(--line); flex-wrap: wrap; min-height: 44px }
.stg-list li.on { border-left: 4px solid var(--accent); padding-left: 8px }
.stg-list svg { width: 22px; height: 22px; flex: none }
.stg-acts { margin-left: auto; display: flex; gap: 6px }
.stg-form { margin-top: 6px }
.sf-colours { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px }
.sf-colours legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px }
.sw { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-height: 40px }
.sw:has(input:checked) { border: 2px solid var(--accent); padding: 5px 7px; font-weight: 600 }
.sw input[type=radio] { margin: 0; width: 16px; height: 16px; accent-color: var(--accent) }
.sw i { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .25) }
.sw input[type=color] { width: 26px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none }
.stg-prev { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; color: #1a1e21; border-radius: 8px }
.stg-prev svg { width: 26px; height: 26px }
.stg-prev .small { color: #5a636a }

/* iPhones zoom the page into any text box under 16px when you tap it: keep them at 16px on phones */
@media (max-width: 600px) { input, select, textarea { font-size: 16px } }

/* ---------------------------------------------------------------- Admin panel (admin.js): owners and PMs, a drawer from the right */
.side.admin { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); width: min(92vw, 380px);
  transform: translateX(102%); box-shadow: var(--shadow) }
.side.admin.open { transform: none; visibility: visible }
@media (min-width: 1000px) { body:not(.nav-closed) .side.admin:not(.open) { transform: translateX(102%); visibility: hidden } }
#admin-bg { z-index: 2550 }
.adm-btn { flex: none; font-weight: 600 }
.h-top .adm-btn { margin-left: 8px }
.h-proj[hidden] + .adm-btn { margin-left: auto }
.bar .adm-btn { margin-left: auto }
.bar .me-btn + .adm-btn { margin-left: 0 }
.h-top .me-btn + .adm-btn { margin-left: 8px }
@media (max-width: 600px) { .adm-btn { display: none } }   /* phones: the Admin panel opens from the side panel */
.adm-kind { border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 4px; display: grid; gap: 2px; background: var(--bg) }
.adm-kname { font-family: var(--font-display); font-size: 17px; margin: 0 2px 4px }
.adm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px }
.adm-sw { display: flex; align-items: center; gap: 9px; padding: 6px 4px; min-height: 42px; cursor: pointer; border-top: 1px solid var(--line) }
.adm-sw svg { width: 20px; height: 20px; flex: none }
.adm-l { flex: 1; font-size: 14px }
.adm-sw input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; margin: 0; flex: none;
  background: var(--line); position: relative; cursor: pointer; transition: background .15s }
.adm-sw input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .15s }
.adm-sw input:checked { background: var(--accent) }
.adm-sw input:checked::after { transform: translateX(18px) }
.adm-sw input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
.adm-sw input:disabled { opacity: .5 }
.adm-state { font-style: normal; font-size: 12px; font-weight: 700; width: 26px; color: var(--muted) }   /* the words carry it, not the colour */

/* ---------------------------------------------------------------- the right panel's tabs: My day (me.js) and Admin (admin.js), 12 Nov */
.r-tabs { padding: 8px 12px 0 } .r-tabs .seg { display: flex } .r-tabs .seg button { flex: 1; min-height: 40px }
.r-secs { display: flex; margin-bottom: 4px } .r-secs button { flex: 1 1 auto; min-height: 38px; padding: 6px 10px; font-size: 13.5px }
.r-hello { margin: 2px 2px 4px; display: grid; gap: 2px } .r-hello b { font-family: var(--font-display); font-size: 21px }
.r-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 }
.r-person, .r-task, .r-talk { display: grid; gap: 6px; padding: 10px 2px; border-top: 1px solid var(--line) }
.r-pt { display: grid; gap: 2px; min-width: 0 } .r-pt b { font-weight: 600; overflow-wrap: anywhere }
.r-pt q { quotes: none; font-size: 13.5px; overflow-wrap: anywhere; border-left: 3px solid var(--line); padding-left: 8px; margin-top: 2px }
.r-pt details summary { cursor: pointer; font-size: 13px; font-weight: 600; min-height: 32px; display: flex; align-items: center }
.r-signs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13.5px }
.r-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center }
.r-acts button, .r-acts select { min-height: 38px }
.r-task.done .r-pt > b { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px }   /* the ✓ in front says it too */
.r-card { padding: 12px; gap: 8px; margin-top: 4px } .r-card .ctitle { font-size: 17px }
.r-card input[type=text], .r-card input[type=date], .r-card select, .r-card textarea { width: 100%; min-width: 0 }
.r-link { display: grid; gap: 6px; padding: 10px; border: 2px solid var(--accent); border-radius: 10px; margin-top: 4px }
.r-link input { width: 100%; font-size: 13px }
.r-who { border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: 6px 8px; display: grid; gap: 0; max-height: 220px; overflow-y: auto }
.r-who legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px }
.r-check { display: flex; align-items: center; gap: 9px; min-height: 40px; font-size: 14px; cursor: pointer }
.r-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent) }
.r-check small { color: var(--muted) }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* joining by invite link */
.jn h1 { margin: 0 0 6px; font-family: var(--font-display); font-size: 26px }
.jn h2 { margin: 18px 0 4px; font-size: 16px }
.jn-what { margin: 0 0 6px; font-size: 16px; line-height: 1.4 }
.jn { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 8px }
.jn form { display: grid; gap: 12px }
.jn label { display: grid; gap: 6px; font-weight: 600; font-size: 14px }
.jn input { font: inherit; font-size: 16px; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100% }
.jn input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
#jn-go { padding: 12px; font-weight: 700 }
.jn-signin { margin-top: 16px; width: 100%; min-height: 44px }

/* a toolbox talk to sign */
.talk .menu-in { display: grid; gap: 10px; padding: 16px }
.tk-title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.2; overflow-wrap: anywhere }
.tk-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; max-height: 40vh; overflow-y: auto;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg) }
.tk-ok { align-items: flex-start; padding: 6px 0 } .tk-ok input { margin-top: 2px }
.talk .field input { width: 100% }
#talk { z-index: 4000 }

/* a short message at the bottom */
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 4500;
  max-width: min(92vw, 420px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  box-shadow: var(--shadow); text-align: center }

/* updated drawings: the manager's colours (Admin, Drawings) */
.r-colour { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; border-top: 1px solid var(--line) }
.r-colour svg { width: 24px; height: 24px; flex: none }
.r-colour span { flex: 1 }
.r-colour input[type=color] { width: 52px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); flex: none }

/* Who's who (hours.js): a wide table scrolls inside its card; names are buttons that look like links */
.tblwrap { overflow-x: auto; margin: 0 -2px }
.tbl.who { min-width: 560px }
.tbl.who td:nth-child(2) b { font-variant-numeric: tabular-nums }
.linkish { border: 0; background: none; padding: 0; color: inherit; font: inherit; font-weight: 600; text-align: left;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px }
.linkish:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
