/* Punch page — the ONE hand-written stylesheet for the ONE template.
   Source of truth: the Claude Design handoff `design_handoff_punch_page/README.md`
   (project 91bad551-0afe-4b33-b2cc-542800445376). Every hex, size, weight,
   letter-spacing, radius and spacing step below is transcribed from it; the prototype
   carries them inline only because of its format constraint (see PUNCH-DESIGN §3.0).

   Descriptive prose (footnotes, notice bodies, the privacy rows, the status line, the date and
   sub-lines) was scaled up 10% on 2026-08-19 by request, rounded to the nearest 0.5px. Headings,
   uppercase labels, buttons and data figures were deliberately NOT touched — scaling those too
   would just enlarge the page and lose the hierarchy the increase was meant to improve.

   Light is the default and the primary set; dark is `prefers-color-scheme: dark` only.
   Every colour is declared HERE in :root and merely re-pointed in the dark block, so no
   colour exists only in dark. */
:root {
  color-scheme: light dark;

  --canvas: #FAFBFB;                /* page ground */
  --surface: #FFFFFF;               /* the punch card */
  --ink: #0E1416;                   /* headings, figures, primary text */
  --muted: #5E7075;                 /* secondary text, labels (5.2:1 on canvas) */
  --line: #E4E8E9;                  /* borders, rules */
  --fill: #F1F4F4;                  /* neutral notice ground, initials chip */
  --accent: #0B7285;                /* every interactive element (5.6:1 on canvas) */
  --accent-soft: #E7F1F3;           /* selected work mode, numeral tiles */
  --accent-press: #08596A;          /* pressed primary */
  --on-accent: #FFFFFF;             /* text/icon on the accent ground */
  --ok: #0F7B43;                    /* checked in, "in progress" */
  --warn: #8A5A00;                  /* missing day, link pending */
  --warn-bg: #FDF7E7;
  --warn-line: #EBD9AE;
  --warn-ink: #6B4600;
  --err: #B4231F;                   /* tap-not-recorded ONLY — the one red in the product */
  /* CHECK OUT is deliberately a different colour from CHECK IN (requested): a yellow→orange
     ramp, so the two actions are never mistaken for each other at a glance. The label is a
     warm near-black — white on this ground measures 1.8–2.8:1 and would fail outright, while
     dark ink measures 6.7–10.4:1. */
  --out-from: #F7B733;
  --out-to: #E8801A;
  --out-from-press: #E0A21C;
  --out-to-press: #CE6B10;
  --out-ink: #2A1A03;

  /* One card shadow, one accent-tinted button lift. Nothing else casts. */
  --shadow-card: 0 1px 2px rgba(9, 11, 12, .035), 0 10px 24px -18px rgba(9, 11, 12, .14);
  --shadow-btn: 0 1px 2px rgba(9, 11, 12, .05), 0 12px 24px -16px rgba(11, 114, 133, .6);
  --shadow-btn-sm: 0 1px 2px rgba(9, 11, 12, .05), 0 10px 22px -14px rgba(11, 114, 133, .55);
  --shadow-btn-out: 0 1px 2px rgba(9, 11, 12, .05), 0 12px 24px -16px rgba(232, 128, 26, .65);

  --ui: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --col: 460px;                     /* desktop: 420–480px, centred, same page */
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0F1416;
    --surface: #161D20;
    --ink: #EAEFF0;
    --muted: #93A5A9;
    --line: #263135;
    --fill: #1B2327;
    --accent: #3FB3C6;
    --accent-soft: #123035;
    --accent-press: #2F97A8;
    /* The dark accent is light: ink on it, not white (white would be ~2.2:1). */
    --on-accent: #0F1416;
    --ok: #41C285;
    --warn: #E0B152;
    --warn-bg: #241E10;
    --warn-line: #4A3C1C;
    --warn-ink: #EBD3A0;
    --err: #F08A82;
    /* Slightly deeper on a dark ground so the ramp reads as a surface, not a light source. */
    --out-from: #F0B429;
    --out-to: #DE7318;
    --out-from-press: #D89F1F;
    --out-to-press: #C4620F;
    --out-ink: #241601;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -18px rgba(0, 0, 0, .5);
    --shadow-btn: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 24px -16px rgba(63, 179, 198, .35);
    --shadow-btn-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 22px -14px rgba(63, 179, 198, .3);
    --shadow-btn-out: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 24px -16px rgba(240, 180, 41, .32);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1, h2, p, ol, li, fieldset, legend { margin: 0; padding: 0; }
ol { list-style: none; }
/* No underlines anywhere (requested). Links are few and in predictable places — Sign out in the
   footer, "Check in again" on the card, the map credit — so colour and weight carry the affordance;
   an underline on every one of them was visual noise on a screen with one real action. */
a { color: var(--accent); text-decoration: none; }

/* Every screen is one centred column, fluid from 360px. No desktop-specific layout. */
.auth, .privacy, .page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--col);
  margin: 0 auto;
}
@supports (min-height: 100dvh) {
  .auth, .privacy, .page { min-height: 100dvh; }
}

/* ---------------------------------------------------------------- shared bits */

.label {                                  /* uppercase section label */
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--muted);
}
.footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  font-size: 15px;
  color: var(--muted);
}
.footnote-plain { font-size: 15px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; }
/* The wordmark links to "/". Styled as the mark it already was — a logo that suddenly looked like a
   link would read as a second action competing with the punch button. */
.brand-link { text-decoration: none; color: inherit; border-radius: 8px; }
.brand-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mark { flex: none; color: var(--accent); }
.wordmark {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.017em;
  color: var(--ink);
}

/* Buttons — the primary is the ONLY pressable-looking element on any screen. */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 0;
  border-radius: 999px;
  font-family: var(--ui);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-press); }
@media (hover: hover) {
  .btn-primary:hover:not([disabled]) { background: var(--accent-press); }
}
/* Disabled = waiting for the position, or location refused (the notice above says which).
   Kept legible rather than ghosted: it is a state to read, not a decoration. */
.btn[disabled] {
  /* `background` (not background-color) so it also clears .btn-out's gradient image. */
  background: var(--fill);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}
/* CHECK OUT — the yellow→orange counterpart to the teal CHECK IN. Its own shadow tint, so the
   lift matches the button rather than glowing teal underneath it. */
.btn-out {
  background: linear-gradient(135deg, var(--out-from), var(--out-to));
  color: var(--out-ink);
}
.btn-out:active {
  background: linear-gradient(135deg, var(--out-from-press), var(--out-to-press));
}
@media (hover: hover) {
  .btn-out:hover:not([disabled]) {
    background: linear-gradient(135deg, var(--out-from-press), var(--out-to-press));
  }
}
.btn-out.btn-punch { box-shadow: var(--shadow-btn-out); }

.btn-punch {                              /* CHECK IN / CHECK OUT */
  /* 15% down from the handoff's 66px/19px (requested 2026-08-19). Height and label scale
     together so the proportions hold; 56px still clears the 48px minimum tap target, which is
     the floor this cannot go below. */
  height: 56px;
  margin-top: 14px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .045em;
  box-shadow: var(--shadow-btn);
}
.btn-auth {
  height: 60px;
  gap: 9px;
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: .005em;
  box-shadow: var(--shadow-btn-sm);
}
.btn-ack {
  height: 58px;
  margin-top: 20px;
  font-size: 17.5px;
  font-weight: 600;
  box-shadow: var(--shadow-btn-sm);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.text-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

/* Notices — tinted ground + hairline in the semantic hue. No left-edge bars. */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: var(--fill);
  border-radius: 12px;
  animation: notice-in .18s ease-out both;
}
.notice svg { flex: none; margin-top: 1px; }
.notice-body { flex: 1; }
.notice-title { font-size: 16.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.notice-text { margin-top: 3px; font-size: 15.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.notice-line { font-size: 16px; line-height: 1.45; color: var(--ink); }
.notice-warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.notice-warn .notice-title { color: var(--warn-ink); }
.notice-warn .notice-text { color: var(--warn-ink); opacity: .9; line-height: 1.48; }
.notice-dismiss {
  position: relative;
  flex: none;
  margin: -6px -6px 0 0;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
}
/* The ✕ is 15px by design; the TAP TARGET is the 48px minimum, added invisibly so the
   layout keeps the drawn size. */
.notice-dismiss::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}
.notice-muted { color: var(--muted); }

/* Inline error — no ground, 14px/500, the only red state (state 9). */
.error-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--err);
}
.error-line svg { flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- 1 + 2: auth */

.auth { justify-content: space-between; padding: max(40px, env(safe-area-inset-top)) 28px 34px; }
.auth-headline {
  margin-top: 38px;
  font-family: var(--display);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -.016em;
  text-wrap: pretty;
}
.auth-body {
  margin-top: 14px;
  max-width: 290px;
  font-size: 17.5px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.auth-bottom .notice { margin: 0 0 14px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 15px; color: var(--muted); }

/* ---------------------------------------------------------------- 3: privacy */

.privacy { padding: max(24px, env(safe-area-inset-top)) 24px 30px; }
.privacy-body { flex: 1; }
.privacy-title {
  margin-top: 9px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -.016em;
  text-wrap: pretty;
}
.privacy-standfirst {
  margin-top: 11px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}
.privacy-rows { margin-top: 20px; border-top: 1px solid var(--line); }
.privacy-row {
  display: flex;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.privacy-num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
}
.privacy-row-title { font-size: 17.5px; font-weight: 600; line-height: 1.35; }
.privacy-row-body {
  margin-top: 3px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}
.privacy-footnote a { color: var(--warn); }
.privacy-footnote { margin-top: 13px; text-align: center; font-size: 14.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 4–9: the punch shell */

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Was a flat 52px, transcribed from a handoff drawn as a PHONE mockup where that space stood
     in for the status bar / notch. A desktop browser has no status bar, and mobile browsers
     already inset the viewport below one, so it rendered as dead space at the top of the page.
     `max()` keeps the right clearance if this is ever installed as a PWA with
     `viewport-fit=cover` (where the page does extend under the notch and env() becomes non-zero),
     while a plain browser tab just gets the base. */
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 0;
}
.topbar .brand { gap: 8px; }
.topbar .wordmark { font-size: 18px; letter-spacing: -.014em; }
.account { display: flex; align-items: center; gap: 7px; }   /* plain text: NOT pressable */
.account-name { font-size: 15px; color: var(--muted); }
.account-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Grown with the text it holds — a 10% larger initial in a 28px disc reads as cramped. */
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.content { flex: 1; padding: 0 var(--gutter) 22px; }
.greeting { margin-top: 22px; }
.greeting h1 {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.016em;
  line-height: 1.24;
}
.date-line { margin-top: 2px; font-size: 16px; color: var(--muted); }

/* The one card on the page. The week list gets no card at all. */
.card {
  margin-top: 16px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  animation: state-in .18s ease-out both;
}

.tick-cut { stroke: var(--surface); }        /* the tick inside a filled disc */

/* status block (6, 7, 8) */
.status-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .075em;
  text-transform: uppercase;
  color: var(--ok);
}
.status-dot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.status-title {
  margin-top: 7px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
}
.status-sub { margin-top: 3px; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.elapsed-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.elapsed {                                 /* the largest figure on the page */
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.elapsed-label { font-size: 14.5px; color: var(--muted); }
.again { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.again .footnote-plain { margin-top: 6px; }

/* week list — 38px weekday / figures / right-aligned total, tabular so it scans */
.week { margin-top: 22px; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; }
.week-total { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* The session count is context for the hours beside it, so it sits one step back. */
.week-total-sub { opacity: .75; }
.week-rows { margin-top: 8px; border-top: 1px solid var(--line); }
.week-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.week-day { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.week-mid { font-size: 15px; letter-spacing: .005em; color: var(--muted); }
.week-end { font-size: 15px; font-weight: 500; color: var(--ink); }
.row-open .week-end { color: var(--ok); }
.row-done .week-end { font-weight: 600; }
/* Today's sessions (checkin-8) — same grid as a week row, one step quieter: it is detail
   under a heading, not a second competing table. */
.session-row .week-day { font-variant-numeric: tabular-nums; color: var(--muted); }
.session-place {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 1px;
}
/* Location status (checkin-9) — a row that answers "will this work?" before the tap. Reads as
   information, not as a control: the dot carries the state, the sentence carries the fix. */
.loc-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
}
.loc-status-body { flex: 1; }
.loc-status-text { font-size: 15px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.loc-dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}
.loc-dot-ok { background: var(--ok); }
.loc-dot-warn { background: var(--warn); }
.loc-dot-err { background: var(--err); }
.loc-dot-wait { background: var(--muted); animation: loc-pulse 1.1s ease-in-out infinite; }
@keyframes loc-pulse { 50% { opacity: .3; } }
/* The on-demand map preview: a fixed window, tiles positioned inside it. No pan or zoom — it
   answers "is this where I am" and nothing more. */
.loc-map-wrap { margin: 0 0 14px; }
.loc-map-canvas {
  position: relative;
  height: 170px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--fill);
}
.loc-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  /* Dark mode has no dark tile set from this host, so knock the glare off rather than
     shipping a second tile provider. */
  filter: none;
}
@media (prefers-color-scheme: dark) {
  .loc-tile { filter: brightness(.82) saturate(.9); }
}
.loc-map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(9, 11, 12, .35), 0 2px 6px rgba(9, 11, 12, .4);
}
.loc-map-credit {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.loc-map-credit a { color: var(--muted); }
.loc-check {
  flex: none;
  position: relative;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font: 500 13px var(--ui);
  cursor: pointer;
}
/* 48px tap target without changing the drawn size (same trick as .notice-dismiss). */
.loc-check::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  min-width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
}

/* the missing working day: warning on ALL THREE cells — the product's feedback loop */
.row-miss .week-day, .row-miss .week-mid, .row-miss .week-end { color: var(--warn); }

/* Sign out: same size as the body text around it (15px, matching the footnotes and week rows) and
   the same colour as "no record" / "no check-in" (`--warn`) — requested. It was 13px in `--muted`,
   which read as fine print rather than an action. */
.page-foot { margin-top: 24px; text-align: center; font-size: 15px; }
.page-foot a { color: var(--warn); }

@media (max-width: 389px) {
  :root { --gutter: 16px; }
  .auth { padding-left: 20px; padding-right: 20px; }
  .privacy { padding-left: 18px; padding-right: 18px; }
}

@keyframes notice-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes state-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .loc-dot-wait { animation: none; }
  * { animation: none !important; transition: none !important; }
}
