:root {
  --ink: #161616;
  --soft: #5a5a5a;
  --paper: #f6f4ef;
  --card: #ffffff;
  --night: #0e0e0e;
  --gold: #c9a24a;
  --gold-deep: #a9832f;
  --green: #1f8a4c;
  --red: #c0392b;
  --warn: #b26a00;
  --line: #e6e1d6;
  --radius: 14px;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1rem/1.5 var(--sans); color: var(--ink); background: var(--paper); }
a { color: var(--gold-deep); }
h1, h2 { line-height: 1.2; margin: 0 0 .6rem; font-weight: 600; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--night); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.05rem; letter-spacing: .03em; }
.brand img { border-radius: 8px; }
.brand b { color: var(--gold); font-weight: 600; }
.who { color: #ccc; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px; background: #1b1b1b; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 8px 12px; border-radius: 999px; color: #ddd; text-decoration: none; font-size: .95rem; }
.tabs a[aria-current="page"] { background: var(--gold); color: var(--night); font-weight: 600; }

.main { max-width: 980px; margin: 0 auto; padding: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.muted { color: var(--soft); font-weight: 400; }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: .05em; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; color: var(--gold-deep); font-weight: 600; margin-bottom: .3rem; }

.note { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.note.ok { background: #e7f5ec; color: #145c33; }
.note.err { background: #fbeaea; color: #8a1f15; }

.form { display: grid; gap: 14px; }
.form label, .filters label { display: grid; gap: 4px; font-size: .9rem; color: var(--soft); }
input, select, button { font: inherit; }
input:not([type="checkbox"]), select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfc8b8; border-radius: 10px; background: #fff; color: var(--ink); font-size: 1rem; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
label.check input { width: 20px; height: 20px; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; margin: 0; }
legend { padding: 0 6px; font-size: .9rem; color: var(--soft); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; text-decoration: none; cursor: pointer; font-weight: 600; }
.btn.gold { background: var(--gold); color: var(--night); }
.btn.gold:hover { background: var(--gold-deep); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: #cfc8b8; color: var(--ink); }
.btn.big { width: 100%; min-height: 64px; font-size: 1.2rem; border-radius: 14px; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.clock { text-align: center; }
.clock h1 { font-size: 1.6rem; }
.clock.running { border-color: var(--green); box-shadow: 0 0 0 3px #1f8a4c22; }
.clock .form { text-align: left; }
.timer { font-size: 2.6rem; font-weight: 600; font-variant-numeric: tabular-nums; margin: .4rem 0; }
.list .timer, li .timer { font-size: inherit; margin: 0; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li .actions { margin-top: 6px; }
.voided { opacity: .55; }
.voided td { text-decoration: line-through; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #efece4; color: var(--soft); font-size: .8rem; text-decoration: none; white-space: nowrap; }
.tag.warn { background: #fff1db; color: var(--warn); }

.big-total { font-size: 1.5rem; font-weight: 600; margin: .4rem 0 1rem; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-nav h1 { margin: 0; text-transform: capitalize; text-align: center; }
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 12px; }

.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.totals { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.totals:empty { display: none; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 1rem; }
.facts dt { color: var(--soft); }
.facts dd { margin: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

.signatures { display: none; }

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .table { font-size: .88rem; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .top, .tabs, .no-print { display: none !important; }
  .main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; }
  .signatures div { border-top: 1px solid #000; padding-top: 6px; font-size: 10pt; }
}

/* Live location (A003) */
.map { height: 320px; border-radius: 10px; margin: 12px 0; background: #1a1a1a; z-index: 0; }
.map-fallback { padding: 12px; }
.pin { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 700 13px/1 system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.live-away { color: #8a5a00; font-weight: 600; }
.live-stale, .live-none { color: #5c5c5c; }
.alert-card { border: 2px solid #e0a020; }
.track { margin-top: 4px; }
