/* Layout: single centered column, phone first. Big punch buttons, status chip on top, timeline below. */
:root {
  --bg: #f3f5f8; --surface: #ffffff; --fg: #14202e; --muted: #5b6b7d; --line: #dbe1e8;
  --brand: #0f4c81; --brand-fg: #ffffff;
  --go: #1b7a43; --go-bg: #e3f4ea; --warn: #8a5a00; --warn-bg: #fdf0d2; --stop: #b3261e; --stop-bg: #fbe4e2;
  --focus: #0f4c81;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1620; --surface: #17222f; --fg: #e8eef5; --muted: #9db0c4; --line: #2a3a4c;
    --brand: #5aa4e6; --brand-fg: #08121c;
    --go: #6fd49a; --go-bg: #12301f; --warn: #f0c36a; --warn-bg: #3a2c0a; --stop: #ff8f86; --stop-bg: #3d1714;
    --focus: #5aa4e6; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); font: 16px/1.45 var(--font);
  padding-block: max(12px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 520px; margin: 0 auto; display: grid; gap: 14px; }
.boot { text-align: center; color: var(--muted); margin-top: 30vh; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2 { margin: 0; line-height: 1.2; }
h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top img { height: 36px; width: auto; max-width: 55%; object-fit: contain; }
.top .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top .who span { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 8px 4px; text-decoration: underline; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.clock { text-align: center; display: grid; gap: 6px; padding-block: 20px; }
.clock .time { font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock .date { color: var(--muted); }
.chip { justify-self: center; padding: 6px 14px; border-radius: 999px; font-weight: 650; font-size: 15px; background: var(--line); color: var(--fg); }
.chip.working { background: var(--go-bg); color: var(--go); }
.chip.lunch { background: var(--warn-bg); color: var(--warn); }
.elapsed { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }

.actions { display: grid; gap: 10px; }
.btn {
  appearance: none; border: 0; border-radius: 12px; min-height: 64px; padding: 14px 18px; font: inherit; font-size: 20px; font-weight: 700;
  background: var(--brand); color: var(--brand-fg); cursor: pointer; width: 100%;
}
.btn.go { background: var(--go); color: #fff; }
.btn.lunch { background: var(--warn-bg); color: var(--warn); border: 2px solid var(--warn); }
.btn.stop { background: var(--stop); color: #fff; }
.btn.plain { background: transparent; color: var(--fg); border: 1px solid var(--line); min-height: 48px; font-size: 16px; font-weight: 600; }
.btn.small { min-height: 48px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: progress; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.go { color: #06210f; } .btn.stop { color: #2b0805; } }

label { display: grid; gap: 6px; font-weight: 600; }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; width: 100%; min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.msg.err { background: var(--stop-bg); color: var(--stop); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.msg.ok { background: var(--go-bg); color: var(--go); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .t { font-weight: 650; }
.timeline .when { font-variant-numeric: tabular-nums; text-align: right; }
.timeline .loc { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.timeline .loc.bad { color: var(--stop); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notes li { background: var(--bg); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes small { display: block; color: var(--muted); }

.hist { list-style: none; margin: 0; padding: 0; display: grid; }
.hist li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.hist li:first-child { border-top: 0; }
.hist .hrs { font-weight: 700; font-variant-numeric: tabular-nums; }
.hist .sub { grid-column: 1 / -1; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.banner { position: sticky; top: max(0px, env(safe-area-inset-top, 0px)); z-index: 5; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(20px, env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; max-width: 90vw; z-index: 20; }
.login { max-width: 380px; margin: 8vh auto 0; display: grid; gap: 16px; text-align: center; }
.login img { height: 56px; margin: 0 auto; }
.login form { display: grid; gap: 14px; text-align: left; }
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform .08s; } .btn:active { transform: scale(.98); } }

.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 999px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; }
.pill[aria-selected="true"] { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
.picklist, .sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pickrow { appearance: none; width: 100%; text-align: left; display: grid; gap: 2px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; min-height: 56px; }
.pickrow[disabled] { opacity: .55; }
.sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; display: block; }
.sched li { display: grid; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line); }
.sched li:first-child { border-top: 0; padding-top: 0; }
.rowbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rowbtns .btn { width: auto; flex: 1 1 140px; text-align: center; text-decoration: none; display: grid; place-items: center; }
a.btn { text-decoration: none; display: grid; place-items: center; text-align: center; }
.jobnow { margin: 0; display: grid; gap: 2px; font-size: 18px; }
.pickrow.mine { border-color: var(--brand); border-width: 2px; background: var(--go-bg); }
