/* Source Serif 4, the app's typeface, so every device draws the same letters. One variable file carries
   the weights and the optical sizes: small text gets the sturdier small-size cut, headings the finer display cut. */
@font-face {
  font-family: "Source Serif 4"; src: url("/source-serif-4.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
/* Forest and Gold: the same eight tokens as the app (Shared/Palette.swift). */
:root {
  --forest: #0D4F34; --deep-forest: #072A1C; --leaf: #12603F; --gold: #C9A45C;
  --cream: #F7F1E3; --linen: #ECE3CF; --ink: #161A17; --oxblood: #9E2B25;

  --bg: var(--cream); --surface: var(--linen); --text: var(--ink); --heading: var(--forest);
  --muted: #3f5a4c; --outline: #9fb3a3; --divider: #d9cfb8;
  --button: var(--gold); --on-button: var(--ink); --feature: var(--forest); --on-feature: var(--cream);
  --alert: var(--oxblood);
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
/* The website is always light, whatever the device is set to. */
:root { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Rendering: real weights only (no faked bold or slant), kerning and ligatures on, lining figures, lean antialiasing. */
html { font-optical-sizing: auto; font-synthesis: none; font-kerning: normal; font-variant-ligatures: common-ligatures;
  font-variant-numeric: lining-nums; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); font-size: 17px; line-height: 1.55; }
h1, h2, h3 { color: var(--heading); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.08; letter-spacing: -0.022em; margin-bottom: 10px; }
h2 { font-size: 23px; line-height: 1.2; letter-spacing: -0.014em; margin-top: 40px; margin-bottom: 14px; }
h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.006em; }
p { margin: 0 0 12px; max-width: 68ch; text-wrap: pretty; }
strong, b { font-weight: 600; }
a { color: var(--heading); }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }
.eyebrow { font-size: 11.5px; font-weight: 500; line-height: 1.4; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: lining-nums tabular-nums; }
.warn { color: var(--alert); }

header.top { border-bottom: 1px solid var(--divider); }
header.top .in { max-width: 1040px; margin: 0 auto; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.brand { font-size: 23px; font-weight: 600; letter-spacing: -0.015em; color: var(--heading); text-decoration: none; margin-right: auto; }
nav.main { display: flex; flex-wrap: wrap; gap: 4px 22px; }
nav.main a { font-size: 15.5px; letter-spacing: 0.005em; text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
nav.main a.on { color: var(--text); border-bottom-color: var(--heading); }
main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }
main.narrow { max-width: 460px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 22px; }
.tabs a { font-size: 15.5px; letter-spacing: 0.005em; text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--text); border-bottom-color: var(--heading); }

button, .btn { font: inherit; font-size: 15.5px; line-height: 1.3; letter-spacing: 0.012em; font-weight: 600; border-radius: 2px; border: 1px solid transparent; padding: 11px 18px; cursor: pointer; background: var(--button); color: var(--on-button); text-decoration: none; display: inline-block; }
button.secondary, .btn.secondary { background: transparent; color: var(--text); border-color: var(--heading); }
button.ghost { background: transparent; color: var(--heading); padding: 6px 0; }
button.danger { background: var(--oxblood); color: #fff; }
button.danger-ghost { background: transparent; color: var(--alert); padding: 6px 0; }
button:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { justify-content: space-between; }

label { display: block; font-size: 13px; line-height: 1.4; letter-spacing: 0.012em; color: var(--muted); margin-bottom: 6px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--outline); border-radius: 2px; padding: 10px 12px; width: 100%; min-height: 46px; }
.field { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
form .actions { margin-top: 8px; }

.feature { background: var(--feature); color: var(--on-feature); padding: 18px 22px; border-radius: 2px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px 28px; align-items: end; margin: 18px 0 6px; }
.feature .big { font-size: 36px; font-weight: 600; line-height: 1.1; letter-spacing: -0.022em; }
.feature .small { font-size: 11.5px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.82; margin-bottom: 4px; }
.chip { display: inline-block; font-size: 12.5px; line-height: 1.5; letter-spacing: 0.02em; padding: 2px 9px; border: 1px solid var(--outline); border-radius: 2px; color: var(--muted); white-space: nowrap; }
.chip.gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.chip.alert { background: var(--oxblood); color: #fff; border-color: var(--oxblood); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 20px; }
.card { text-decoration: none; color: inherit; display: block; }
.card .img { aspect-ratio: 4 / 3; }
.card .name { font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; margin: 3px 0 2px; }
.img { background: var(--surface); border: 1px solid var(--divider); border-radius: 2px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stick { width: 62%; height: 15%; border-radius: 999px; position: relative; transform: rotate(-14deg); box-shadow: 0 6px 10px rgba(0,0,0,.25); }
.stick::after { content: ""; position: absolute; left: 22%; top: 0; bottom: 0; width: 9%; background: var(--gold); opacity: .9; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 8px 11px 0; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); vertical-align: bottom; }
td { font-variant-numeric: lining-nums tabular-nums; }
td.r, th.r { text-align: right; padding-right: 0; }
.scroll { overflow-x: auto; }
dl.specs { display: grid; grid-template-columns: minmax(110px, 180px) 1fr; margin: 0; }
dl.specs dt, dl.specs dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--divider); }
dl.specs dt { color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photos .img { aspect-ratio: 1; }
.two .photos { margin: 12px 0 8px; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--divider); border-radius: 2px; padding: 18px 20px; margin-top: 16px; }
.error { color: var(--alert); min-height: 1.5em; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 2px; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

td.r, th.r { padding-left: 10px; white-space: nowrap; }
td:first-child a { white-space: nowrap; }

textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.5; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
label.btn { font-size: 15.5px; line-height: 1.3; letter-spacing: 0.012em; color: var(--text); margin: 0; }
label.inline { display: inline; font-size: inherit; line-height: inherit; letter-spacing: 0; margin: 0; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; padding: 0; accent-color: var(--forest); }
.preview { max-width: 520px; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
td input[type="number"] { width: 84px; min-height: 40px; padding: 6px 8px; }
td.r, th.r { padding-right: 14px; }
td.r:last-child, th.r:last-child { padding-right: 0; }
.preview img { object-fit: contain; }

h2.flush { margin-top: 0; }
p.label { font-size: 11.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { background: transparent; color: var(--text); border: 1px solid var(--outline); padding: 8px 14px; font-size: 15px; letter-spacing: 0; font-weight: 400; }
.chip-btn[aria-pressed="true"] { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.pick { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; text-decoration: none; color: inherit; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.pick .thumb { width: 72px; height: 72px; }
.pick .name { font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: -0.008em; }
.panel h3 { margin: 18px 0 4px; }
.panel > h3:first-child, .panel form > h3:first-child, form.panel > h3:first-child { margin-top: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-bottom: 14px; }
.photo-card .img { aspect-ratio: 1; margin-bottom: 6px; }
.photo-card .row { gap: 4px 16px; }
.chooser { margin: 8px 0; }
.chooser .preview { margin-top: 12px; }
.panel .row.actions { margin-top: 16px; }
.panel .scroll + .grid { margin-top: 18px; }
.owned-note { color: var(--heading); font-weight: 500; margin: 4px 0 0; }
.list-head { align-items: end; margin-top: 40px; margin-bottom: 14px; }
.list-head h2 { margin: 0; }
.brand-filter select { width: auto; min-width: 180px; min-height: 42px; padding: 8px 12px; font-size: 15.5px; }
.card[hidden] { display: none; }
.review { padding: 14px 0; border-bottom: 1px solid var(--divider); }
.review p { margin: 6px 0 0; }
.review .score { font-size: 20px; font-weight: 600; }
.report select, .mod-actions select { width: auto; min-height: 40px; padding: 6px 10px; font-size: 14px; }
.mod-actions { gap: 8px; margin-top: 10px; }
.mod-actions button { padding: 8px 14px; }
.photo-grid.mod { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.photo-grid.mod .panel { margin-top: 0; }
fieldset.dob { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.dob legend { padding: 0; font-size: 13px; letter-spacing: 0.012em; color: var(--muted); margin-bottom: 6px; }
.dob-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.dob-row .field { margin-bottom: 6px; }
.code, .big-code { font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.08em; white-space: nowrap; }
.big-code { font-size: 30px; font-weight: 600; margin: 6px 0 12px; user-select: all; }
.admin-row { padding: 10px 0; border-bottom: 1px solid var(--divider); margin: 0; max-width: none; }
.panel .grid { align-items: end; }
.member { padding: 18px 0; border-bottom: 1px solid var(--divider); }
.member-name { font-size: 19px; }
.chips-row { gap: 6px; margin-top: 6px; }
.chips-row .chip { white-space: normal; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 20px; margin-top: 14px; }
.stat .num { font-size: 16px; margin-top: 2px; }
.limit { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.limit input { flex: none; margin-top: 3px; }
.member-search { margin-bottom: 14px; }
.member-search .grow { flex: 1; min-width: 200px; }
.days input { width: 110px; }
.agree { margin: 4px 0 16px; }
.legal h3 { margin-top: 22px; }
.legal p { max-width: none; }
