/* DSD project portal. Brand tokens from dsd-brand.css (Geminii/Glass Table, Nov 2026). */
:root {
  --red: #FF0000;
  --red-text: #D40000;
  --red-deep: #A30000;
  --red-tint: #FFE8E8;
  --ink: #1C1F22;
  --slate: #5B6168;
  --line: #DDE0E3;
  --surface: #F4F5F6;
  --white: #FFFFFF;
  --tarmac: #34383D;
  --success: #1E7A3C;
  --warning: #B25E00;
  --info: #1F5FA8;
  --font: "Archivo", "Arial Narrow", Arial, system-ui, sans-serif;
  --radius: 3px;
  --radius-lg: 6px;
  --focus: 0 0 0 3px var(--white), 0 0 0 5px var(--ink);
  --wrap: 1080px;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5625rem;
  --fs-2xl: 1.953rem;
  --fs-3xl: 2.441rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.5 var(--font); color: var(--ink); background: var(--surface); }
h1, h2, h3 { font-weight: 800; font-stretch: 112%; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: var(--red-text); text-underline-offset: 2px; }
a:hover { color: var(--red-deep); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--white); padding: 8px 12px; z-index: 20; }
.skip:focus { top: 12px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--slate); }
.sep { display: inline-block; width: 1px; height: 0.9em; background: var(--line); margin: 0 10px; vertical-align: -0.1em; }

/* ---------- buttons and fields ---------- */
.btn { font: 600 1rem/1 var(--font); min-height: 44px; padding: 0 22px; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--red-text); color: var(--white); }
.btn-primary:hover { background: var(--red-deep); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--white); }
.btn:disabled { background: var(--line); color: var(--slate); border-color: transparent; cursor: default; }
.btn-wide { width: 100%; }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); cursor: pointer; }
.link-btn:hover { color: var(--red-text); text-decoration-color: currentColor; }
.field { display: block; font-weight: 600; font-size: var(--fs-sm); }
.field > input, .field > select, .field > textarea { display: block; margin-top: 6px; }
.field input, textarea { font: 400 1rem/1.4 var(--font); color: var(--ink); background: var(--white); border: 1px solid #B9BEC4; border-radius: var(--radius); padding: 10px 12px; width: 100%; }
.field input:focus-visible, textarea:focus-visible { border-color: var(--ink); }
.form-error { color: var(--red-deep); font-size: var(--fs-sm); font-weight: 600; min-height: 1.2em; }
.hint { color: var(--slate); font-size: var(--fs-sm); }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface); border-top: 6px solid var(--red); }
.signin-card { width: min(380px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px 28px 26px; display: grid; gap: 14px; text-align: center; }
.signin-logo { width: 140px; height: auto; margin: 0 auto 4px; }
.signin-card h1 { font-size: var(--fs-xl); }
.signin-card > p { color: var(--slate); }
.pin-input { font: 700 1.9rem/1 var(--font); letter-spacing: 0.5em; text-indent: 0.5em; text-align: center; border: 2px solid var(--ink); border-radius: var(--radius); padding: 12px 8px; width: 100%; }
.signin-help { font-size: var(--fs-sm); color: var(--slate); }

/* ---------- header ---------- */
.site-header { background: var(--white); border-bottom: 6px solid var(--red); }
.header-inner { display: flex; align-items: center; gap: 14px; min-height: 68px; flex-wrap: wrap; }
.brand img { display: block; width: 88px; height: auto; }
.brand-name { font-weight: 800; font-stretch: 112%; font-size: var(--fs-lg); padding-left: 14px; border-left: 1px solid var(--line); }
.spacer { flex: 1; }
.who { font-size: var(--fs-sm); color: var(--slate); }

/* ---------- the month's hours ---------- */
.hours { background: var(--white); border-bottom: 1px solid var(--line); padding: 36px 0 30px; }
.hours-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.intro { color: var(--slate); max-width: 58ch; margin-bottom: 14px; }
.hours-figure { font-size: clamp(2.2rem, 6vw, 3.6rem); font-stretch: 118%; font-variant-numeric: tabular-nums; line-height: 1; }
.fig-unit { font-size: var(--fs-xl); font-weight: 700; font-stretch: 100%; letter-spacing: 0; }
.hours-sub { margin-top: 10px; font-size: var(--fs-lg); color: var(--slate); }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); cursor: pointer; color: var(--ink); }
.month-btn:hover:not(:disabled) { border-color: var(--ink); }
.month-btn:disabled { color: var(--line); cursor: default; }
.month-label { min-width: 9.5em; text-align: center; font-weight: 700; }

/* Side-on road: the truck sits on the tarmac and drives to the hours used. */
.road-scene { position: relative; padding: 0 0 4px; margin: 6px 0 0; }
.lane { position: relative; height: 82px; margin: 0 76px 0 0; }
.truck { position: absolute; bottom: -4px; left: max(var(--x), 146px); width: 150px; margin-left: -146px; transition: left 1.6s cubic-bezier(.3, .1, .2, 1); z-index: 2; }
.truck-svg { display: block; width: 100%; height: auto; }
.truck-word { font: 800 21px/1 var(--font); font-stretch: 125%; fill: var(--red); letter-spacing: 1px; }
.allow-post { position: absolute; bottom: -2px; left: var(--x); width: 34px; margin-left: -17px; z-index: 1; }
.allow-post svg { display: block; width: 100%; height: auto; }
.allow-label { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font-weight: 800; font-size: var(--fs-sm); white-space: nowrap; }
.tarmac { position: relative; height: 26px; background: var(--tarmac); margin-right: 76px; border-radius: 2px; overflow: hidden; }
.tarmac::after { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .7) 0 22px, transparent 22px 40px); }
.travelled { position: absolute; left: 0; top: 0; height: 5px; width: var(--x); background: var(--red); transition: width 1.6s cubic-bezier(.3, .1, .2, 1); z-index: 1; }
.over { position: absolute; top: 0; bottom: 0; left: var(--a); width: calc(var(--b) - var(--a)); background: repeating-linear-gradient(-45deg, var(--red) 0 10px, var(--white) 10px 20px); z-index: 1; }
.ticks { position: relative; height: 26px; margin-right: 76px; color: var(--slate); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.tick { position: absolute; left: var(--x); top: 0; transform: translateX(-50%); padding-top: 9px; }
.tick::before { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: 6px; background: #B9BEC4; }
.tick:first-child { transform: none; }
.tick:first-child::before { left: 0; }
.tick-unit { position: absolute; right: -76px; top: 9px; }
.month-split { margin-top: 18px; }
.split-title { font-size: var(--fs-sm); font-weight: 700; font-stretch: 100%; letter-spacing: 0; color: var(--slate); margin-bottom: 6px; }
.split { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; }
.split li { display: flex; gap: 10px; align-items: baseline; }
.split a { color: var(--ink); font-weight: 600; }
.split-h { font-variant-numeric: tabular-nums; color: var(--slate); }
.split-empty { color: var(--slate); font-size: var(--fs-sm); }

/* ---------- projects as stops on a route ---------- */
.projects { padding-top: 40px; padding-bottom: 56px; }
.section-title { font-size: var(--fs-2xl); margin-bottom: 22px; }
.section-title::before { content: ""; display: inline-block; width: .6em; height: .8em; margin-right: .4em; background: var(--red); clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%); vertical-align: -.02em; }
.route { list-style: none; margin: 0; padding: 0 0 0 38px; position: relative; }
.route::before { content: ""; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 6px; background: var(--tarmac); border-radius: 3px; }
.stop { position: relative; margin-bottom: 14px; }
.stop-mark { position: absolute; left: -34px; top: 18px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); border: 4px solid var(--tarmac); }
.stop.s-in_progress .stop-mark { background: var(--red); border-color: var(--red-deep); }
.stop.s-waiting_dsd .stop-mark { background: var(--warning); border-color: #7A4100; }
.stop.s-complete .stop-mark { background: var(--success); border-color: #135127; }
.stop-body { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 22px; position: relative; }
.stop-body:hover { border-color: #B9BEC4; }
.stop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stop h3 { font-size: var(--fs-lg); }
.stop h3 a { color: var(--ink); text-decoration: none; }
.stop h3 a::after { content: ""; position: absolute; inset: 0; }
.stop h3 a:hover { color: var(--red-text); }
.stop h3 a:focus-visible { box-shadow: none; }
.stop-body:has(a:focus-visible) { box-shadow: var(--focus); }
.stop-summary { color: var(--slate); margin-top: 4px; max-width: 70ch; }
.stop-facts { display: grid; grid-template-columns: minmax(0, 320px) auto; justify-content: space-between; align-items: end; gap: 10px 24px; margin-top: 14px; }
.stop-meta { color: var(--slate); font-size: var(--fs-sm); }
.stop.s-complete .stop-body { background: transparent; }
.route-empty { color: var(--slate); }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--radius); border: 1px solid currentColor; white-space: nowrap; line-height: 1.5; }
.pill.s-not_started { color: var(--slate); background: var(--surface); }
.pill.s-in_progress { color: var(--info); background: #E7EFF9; }
.pill.s-waiting_dsd { color: var(--warning); background: #FDF1E3; }
.pill.s-paused { color: var(--slate); background: var(--surface); border-style: dashed; }
.pill.s-complete { color: var(--success); background: #E8F4EC; }

/* ---------- hours meter ---------- */
.meter { height: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink); }
.meter.is-over span { background: repeating-linear-gradient(-45deg, var(--red) 0 6px, var(--red-deep) 6px 12px); }
.meter.big { height: 14px; }
.meter-text { font-size: var(--fs-sm); margin-top: 6px; font-variant-numeric: tabular-nums; }
.meter.big + .meter-text { font-size: 1rem; font-weight: 600; }

/* ---------- drawer ---------- */
.drawer { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(620px, 100%); max-width: 100%; padding: 0; border: 0; border-left: 6px solid var(--red); background: var(--white); color: var(--ink); }
.drawer::backdrop { background: rgba(28, 31, 34, .45); }
.drawer[open] { animation: slide-in .22s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: .4; } }
.drawer-inner { height: 100%; overflow-y: auto; padding: 28px 32px 48px; position: relative; }
.drawer-close { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; z-index: 2; }
.drawer-close:hover { border-color: var(--ink); }
.d-head { padding-right: 48px; display: grid; gap: 10px; justify-items: start; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.d-head h2 { font-size: var(--fs-2xl); }
.d-summary { color: var(--slate); font-size: 1.0625rem; }
.d-dates { font-size: var(--fs-sm); color: var(--slate); }
.d-sec { padding: 22px 0; border-bottom: 1px solid var(--line); }
.d-sec:last-child { border-bottom: 0; }
.d-sec h3 { font-size: 1.0625rem; font-stretch: 105%; margin-bottom: 12px; }
.h3-note { font-weight: 500; font-stretch: 100%; color: var(--slate); font-size: var(--fs-sm); margin-left: 6px; }
.brief p + p { margin-top: .8em; }
.brief { max-width: 64ch; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: start; padding: 9px 0; border-top: 1px solid var(--surface); }
.tasks li:first-child { border-top: 0; }
.box { width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 2px; display: grid; place-items: center; margin-top: 1px; }
.is-done .box { background: var(--success); border-color: var(--success); color: var(--white); }
.is-done .t-text { color: var(--slate); }
.t-date { display: block; font-size: var(--fs-xs); color: var(--slate); }
.t-hours { font-variant-numeric: tabular-nums; color: var(--slate); font-size: var(--fs-sm); white-space: nowrap; }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.docs a { font-weight: 600; }
.doc-meta { display: block; font-size: var(--fs-xs); color: var(--slate); }
.comments { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.comments li { background: var(--surface); border-radius: var(--radius-lg); padding: 12px 14px; }
.comments li.from-gt { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--ink); }
.c-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: var(--fs-sm); margin-bottom: 4px; }
.c-org { font-size: var(--fs-xs); color: var(--slate); }
.c-who time { margin-left: auto; color: var(--slate); font-size: var(--fs-xs); }
.c-text p + p { margin-top: .6em; }
.c-text { overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 8px; justify-items: start; }
.comment-form textarea { resize: vertical; min-height: 84px; }

/* ---------- modal ---------- */
.modal { border: 0; border-top: 6px solid var(--red); border-radius: var(--radius-lg); padding: 0; width: min(400px, calc(100% - 32px)); color: var(--ink); }
.modal::backdrop { background: rgba(28, 31, 34, .45); }
.modal-inner { padding: 24px; display: grid; gap: 14px; }
.modal-inner h2 { font-size: var(--fs-xl); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- footer, toast ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 36px; color: var(--slate); font-size: var(--fs-sm); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 10px 18px; border-radius: var(--radius); font-weight: 600; z-index: 50; }
.fatal { padding: 40px 24px; font-size: var(--fs-lg); }

@media (max-width: 720px) {
  .drawer-close { top: 12px; right: 12px; }
  .wrap { padding: 0 16px; }
  .header-inner { gap: 8px 12px; padding-top: 8px; padding-bottom: 8px; }
  .brand img { width: 72px; }
  .brand-name { font-size: 1rem; padding-left: 10px; }
  .who { display: none; }
  .hours { padding-top: 26px; }
  .lane { height: 60px; margin-right: 40px; }
  .truck { width: 108px; margin-left: -105px; left: max(var(--x), 105px); }
  .allow-post { width: 26px; margin-left: -13px; }
  .tarmac, .ticks { margin-right: 40px; }
  .tick-unit { right: -40px; }
  .stop-facts { grid-template-columns: 1fr; }
  .stop-head { flex-direction: column; gap: 6px; }
  .drawer-inner { padding: 22px 18px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .truck, .travelled { transition: none; }
  .drawer[open] { animation: none; }
}
