/* Finish Photos — shared styles. Pop Up Races palette: navy, teal-green, yellow. */
:root {
  --bg: #f2f5f8; --surface: #ffffff; --sunk: #e8edf2; --ink: #0f2236; --muted: #526173; --line: #d7dfe7;
  --navy: #003863; --navy-ink: #ffffff; --accent: #00A18F; --accent-ink: #00705f; --accent-soft: #dbf2ee;
  --warn: #fbefc4; --warn-ink: #5f4a00; --bad: #b3141a; --bad-soft: #fde4e4; --good: #0b7a3e;
  --display: 'Barlow Condensed', 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
  --body: 'Avenir Next', 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1622; --surface: #12212f; --sunk: #0e1b28; --ink: #e6edf4; --muted: #9babbc; --line: #253748;
    --navy: #0f4a7e; --navy-ink: #ffffff; --accent: #2cc4b0; --accent-ink: #62d9c7; --accent-soft: #123a35;
    --warn: #3a3212; --warn-ink: #f2d675; --bad: #ff8080; --bad-soft: #3d1a1d; --good: #5fd28f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.bar { background: var(--navy); color: var(--navy-ink); padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.bar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar .kicker { font-family: var(--display); font-weight: 700; letter-spacing: .14em; font-size: 12px; opacity: .8; }
.bar h1 { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.05; text-wrap: balance; }

main { max-width: 1100px; margin: 0 auto; padding-inline: 16px; padding-block: 18px 48px; display: flex; flex-direction: column; gap: 16px; }
.narrow { max-width: 640px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); }
.card h3 { margin: 0; font-size: 15px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
label, .label { font-size: 13px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; min-height: 44px; width: 100%; min-width: 0;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink); font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }

.btn { font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 10px 16px; min-height: 44px; cursor: pointer;
  background: var(--navy); color: var(--navy-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.go { background: var(--accent); color: #002b25; }
.btn.alt { background: var(--sunk); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.big { min-height: 56px; font-size: 18px; padding: 12px 22px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.msg { padding: 10px 12px; border-radius: 8px; background: var(--sunk); font-size: 14px; }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg.warn { background: var(--warn); color: var(--warn-ink); }
.msg.ok { background: var(--accent-soft); color: var(--accent-ink); }

.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--accent-soft); color: var(--accent-ink); }
.pill.warn { background: var(--warn); color: var(--warn-ink); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.tabs { display: flex; gap: 4px; background: var(--sunk); border-radius: 10px; padding: 4px; }
.tab { flex: 1; font: inherit; font-weight: 700; font-size: 15px; border: 0; border-radius: 7px; padding: 10px; min-height: 44px; background: transparent; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { padding: 12px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.stat b { display: block; font-family: var(--display); font-size: 32px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--sunk); border: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--sunk); }
.thumb .cap { padding: 6px 8px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.thumb button.open { all: unset; cursor: pointer; display: block; }
.thumb button.open:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 700; }

.lightbox { position: fixed; inset: 0; background: rgba(4, 12, 22, .92); display: flex; flex-direction: column; z-index: 50; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); gap: 12px; }
.lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.lightbox .lb-bar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; color: #fff; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline input { font-family: var(--mono); font-size: 13px; }

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