:root {
  --navy: #123366; --navy-2: #1d4a8f; --ink: #17202b; --muted: #5f6b7a; --line: #dde3ea; --bg: #f3f5f8; --card: #fff;
  --green: #17803d; --green-bg: #e6f4ea; --red: #b42318; --red-bg: #fdecea; --amber: #a15c00; --amber-bg: #fff4e0;
  --r: 12px; --tap: 48px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
header#top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; } .brand img { height: 30px; width: auto; display: block; } .brand span { opacity: .85; border-left: 1px solid rgba(255,255,255,.35); padding-left: 10px; }
#who { font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; } #who button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); min-height: 34px; padding: 0 10px; font-size: 14px; }
main { max-width: 1100px; margin: 0 auto; padding: 12px 16px calc(env(safe-area-inset-bottom) + 90px); }
h1 { font-size: 22px; margin: 6px 0 12px; } h2 { font-size: 17px; margin: 18px 0 8px; } h3 { font-size: 15px; margin: 0 0 4px; }
.muted { color: var(--muted); } .pad { padding: 16px; } .small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
a.card, button.card { display: block; width: 100%; text-align: left; color: inherit; text-decoration: none; font: inherit; cursor: pointer; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button.primary, .btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.big { width: 100%; font-size: 18px; min-height: 56px; }
button:disabled { opacity: .5; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid #c9d1db; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row > * { flex: 1 1 140px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--green-bg); color: var(--green); border-color: #b7dfc3; } .pill.bad { background: var(--red-bg); color: var(--red); border-color: #f3c0bb; } .pill.warn { background: var(--amber-bg); color: var(--amber); border-color: #f1d3a1; }
/* week strip */
.weeknav { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; } .weeknav .label { flex: 1; text-align: center; font-weight: 700; }
.weeknav button { min-width: var(--tap); padding: 0; }
.day h2 { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.day.today h2 { color: var(--navy-2); border-color: var(--navy-2); }
.job .when { font-weight: 700; color: var(--navy-2); font-size: 14px; } .job .addr { color: var(--muted); font-size: 14px; }
.job.done { border-left: 5px solid var(--green); } .job.issues { border-left: 5px solid var(--amber); } .job.cancelled { opacity: .55; text-decoration: line-through; }
/* detail */
dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; } dl.kv dt { color: var(--muted); font-size: 14px; } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
table.items { width: 100%; border-collapse: collapse; font-size: 14px; } table.items td, table.items th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; } table.items th { color: var(--muted); font-weight: 600; }
.files a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--navy-2); }
/* sign-off */
.check { padding: 12px 0; border-bottom: 1px solid var(--line); } .check:last-child { border-bottom: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.seg button { min-height: 44px; padding: 0 6px; font-weight: 700; }
.seg button.on[data-v=yes] { background: var(--green); border-color: var(--green); color: #fff; } .seg button.on[data-v=no] { background: var(--red); border-color: var(--red); color: #fff; } .seg button.on[data-v=na] { background: #6b7684; border-color: #6b7684; color: #fff; }
.result button { display: block; width: 100%; text-align: left; margin: 6px 0; min-height: 52px; }
.result button.on { border: 2px solid var(--navy); background: #eef3fb; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 8px 0; }
.thumbs .t { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #ddd; } .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .t button { position: absolute; top: 4px; right: 4px; min-height: 28px; height: 28px; width: 28px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0; }
.addphoto { position: relative; overflow: hidden; } .addphoto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.issue { border: 1px solid #f1d3a1; background: var(--amber-bg); border-radius: 10px; padding: 10px; margin: 8px 0; }
.sig { border: 2px dashed #b8c2ce; border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 170px; display: block; }
.sigbar { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; } .sigbar button { min-height: 36px; }
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 10px); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); z-index: 9; }
.stickybar > div { max-width: 1100px; margin: 0 auto; display: flex; gap: 10px; } .stickybar button { flex: 1; }
/* login */
.login { max-width: 380px; margin: 30px auto; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; } .keypad button { min-height: 62px; font-size: 24px; }
.dots { display: flex; justify-content: center; gap: 12px; margin: 16px 0 4px; } .dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--navy); } .dots i.f { background: var(--navy); }
/* office */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px; } .tabs button { flex: 0 0 auto; min-height: 40px; border-radius: 999px; }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table.grid { border-collapse: collapse; min-width: 900px; width: 100%; font-size: 13px; table-layout: fixed; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 6px; vertical-align: top; } table.grid th { background: #f7f9fb; font-size: 12px; } table.grid th.team { width: 130px; text-align: left; }
table.grid td.today { background: #f2f6fd; }
.chip { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 4px solid var(--navy-2); background: #fff; border-radius: 6px; padding: 5px 6px; margin-bottom: 5px; font-size: 12px; min-height: 0; font-weight: 400; cursor: pointer; }
.chip.done { border-left-color: var(--green); } .chip.issues { border-left-color: var(--amber); } .chip.manual { border-left-style: dashed; }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 86px); transform: translateX(-50%); background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; } #toast.err { background: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
@media (min-width: 760px) { dl.kv { grid-template-columns: 140px 1fr; } }

.day-empty { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.day-empty.today { color: var(--navy-2); font-weight: 700; }
.chip.cancelled { opacity: .6; text-decoration: line-through; border-left-color: var(--red); }

.tabs.dept button { min-height: 34px; font-size: 14px; }
table.grid tr.depthead th { background: var(--navy); color: #fff; text-align: left; font-size: 13px; } table.grid tr.depthead .muted { color: #c9d6ea; }
.deptrow { margin: 6px 0; } .deptrow input.dn { flex: 2 1 160px; } label.tick { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; flex: 1 1 200px; } label.tick input { width: 22px; min-height: 22px; height: 22px; }

/* ---- merged features ---- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.crewtag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; background: color-mix(in srgb, var(--c) 14%, #fff); border: 1px solid color-mix(in srgb, var(--c) 45%, #fff); color: #1f2937; }
.job { border-left: 5px solid var(--line); }
.chip { border-left: 4px solid var(--c, var(--navy-2)); background: color-mix(in srgb, var(--c, #1d4a8f) 7%, #fff); }
.chip.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .chip.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 2px dashed color-mix(in srgb, var(--c) 55%, #fff); }
.chip[draggable="true"] { cursor: grab; } td.cell.drop { background: #e7effb; outline: 2px dashed var(--navy-2); outline-offset: -3px; }
table.grid th.today { background: #e7effb; }
.toolbar { justify-content: space-between; align-items: center; margin-bottom: 4px; } .toolbar .tabs { margin: 0; padding: 0; flex: 1 1 auto; }
.seg2, .seg3 { display: flex; gap: 6px; } .seg2 button, .seg3 button { flex: 1; min-height: 44px; } .seg3 { flex: 0 0 auto; }
.seg2 button.on, .seg3 button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.outbox { margin-top: 10px; border: 1px solid #f1d7ab; background: #fffaf0; border-radius: 10px; padding: 10px; }
.outbox .card { margin: 8px 0; }
label.tick.big { font-size: 16px; font-weight: 600; margin-top: 12px; }
.issue.resolved { opacity: .7; border-color: #b7dfc3; background: var(--green-bg); }
.card.warn { background: var(--amber-bg); border-color: #f1d3a1; }
button.sm { min-height: 36px; padding: 0 12px; font-size: 14px; } button.danger { color: var(--red); border-color: #f3c0bb; }
.thumbs .doc { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; font-size: 28px; text-decoration: none; color: var(--ink); background: #f7f9fb; }
.thumbs .doc span { font-size: 11px; padding: 0 4px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.thumbs img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; } .lightbox button { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 12px; background: rgba(255,255,255,.15); color: #fff; border: 0; width: 44px; min-height: 44px; border-radius: 50%; font-size: 24px; }
table.month td { height: 92px; } table.month td.other { background: #f7f9fb; color: var(--muted); } table.month td.today { background: #eef3fb; }
.mday { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.mchip { display: block; width: 100%; min-height: 0; padding: 2px 5px; margin-bottom: 3px; font-size: 11px; font-weight: 500; text-align: left; border: 0; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mchip.done { opacity: .6; } .more { min-height: 0; padding: 0; border: 0; background: none; color: var(--navy-2); font-size: 12px; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; } .fchips button { min-height: 40px; font-weight: 500; } .fchips button.on { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); font-weight: 700; }
.crewrow { padding: 10px 0; border-bottom: 1px solid var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .swatches button { width: 28px; min-height: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); } .swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
@media (max-width: 600px) { .toolbar .btn.primary { min-height: 40px; padding: 0 12px; } .brand img { height: 24px; } }
.row > .pill, .row > .crewtag { flex: 0 0 auto; }
/* logins (match Workshop Stores) */
.login.wide { max-width: 560px; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.names button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
input.code { font-size: 26px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: flex; justify-content: center; margin: 10px 0; } .qr svg { width: 220px; height: 220px; max-width: 70vw; max-height: 70vw; border: 1px solid var(--line); border-radius: 8px; }
code.key { font-size: 16px; letter-spacing: 1px; background: var(--bg); padding: 4px 8px; border-radius: 6px; word-break: break-all; } code.key.big { font-size: 22px; letter-spacing: 3px; flex: 0 0 auto; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; } .codes code { font-size: 18px; text-align: center; padding: 8px; background: var(--bg); border-radius: 8px; letter-spacing: 1px; }
.warnbox { background: var(--amber-bg); border-color: #f1d3a1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.devrow { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; align-items: center; }
#who .idle { font-variant-numeric: tabular-nums; opacity: .75; font-size: 13px; } #who .idle.low { opacity: 1; color: #ffd27a; font-weight: 700; }
#who a.who { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
/* search + paperwork */
form.search { display: flex; gap: 8px; margin: 10px 0; } form.search input { flex: 1 1 auto; min-width: 0; } form.search button { flex: 0 0 auto; }
a.card.result { display: block; color: inherit; text-decoration: none; } a.card.result:hover { border-color: var(--navy-2); }
h4.doch { margin: 10px 0 4px; font-size: 14px; color: var(--muted); } h4.doch:first-child { margin-top: 0; }
b.loc { font-size: 16px; letter-spacing: .5px; }
