/* Relish: warm amber and cream, big readable type, food photos do the talking. */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ground: #FBF5EC; --card: #FFFFFF; --line: #E3D3BF; --line-2: #D9C6AE; --line-3: #EFE3D3;
  --ink: #2A211B; --muted: #6B5A4C;
  --primary: #B4500A; --primary-ink: #FFFFFF; --primary-dark: #8A3A05;
  --chip: #FCEBD3; --chip-ink: #8A3A05; --chip-deep: #6E2E04;
  --match: #E2EFDF; --match-ink: #2E6337;
  --danger: #A12B12;
  --display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(60,40,20,.08), 0 8px 24px rgba(60,40,20,.07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.45 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }

/* ---------- layout ---------- */
.top { padding: max(16px, env(safe-area-inset-top)) 16px 4px; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-row.start { justify-content: flex-start; }
main { max-width: 640px; margin: 0 auto; padding: 8px 16px 128px; display: flex; flex-direction: column; gap: 20px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 40px; letter-spacing: -.5px; color: var(--primary); }
.wordmark.small { font-size: 30px; }

/* ---------- controls ---------- */
.btn { min-height: 52px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--primary); color: var(--primary-ink); font-size: 17px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.wide { width: 100%; }
.btn.big { min-height: 58px; font-size: 19px; box-shadow: 0 6px 16px rgba(180,80,10,.3); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost.on { background: var(--chip); color: var(--chip-ink); border-color: var(--chip); }
.btn.ghost.on-green { background: var(--match); color: var(--match-ink); border-color: var(--match); }
.btn.ghost.danger-text { color: var(--danger); }
.btn.small { min-height: 44px; font-size: 16px; padding: 0 14px; }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.linkbtn { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--primary-dark); font-size: 17px; font-weight: 700; text-decoration: underline; cursor: pointer; align-self: center; }
.linkbtn.small { font-size: 15px; min-height: 40px; align-self: flex-start; padding: 4px 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 22px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chip[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 700; }
.chip.worth[aria-pressed=true] { background: var(--match); border-color: var(--match-ink); color: var(--match-ink); }
.chip.select { padding: 0 6px 0 4px; position: relative; }
.chip.select select { border: 0; background: transparent; min-height: 40px; padding: 0 8px; font-size: 16px; cursor: pointer; max-width: 60vw; }
.seg4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.seg2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg4 .chip, .seg2 .chip { border-radius: 14px; min-height: 52px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 17px; }
.opt { font-weight: 400; color: var(--muted); font-size: 15px; }
input[type=text], input[type=password], input:not([type]), select, textarea {
  width: 100%; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; background: #fff; font-size: 18px; color: var(--ink);
}
textarea { resize: vertical; min-height: 84px; }
input.pin { font-size: 26px; letter-spacing: .35em; text-align: center; }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 17px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.row.tight > .btn { flex: 0 0 auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.form { gap: 22px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 17px; }
.checks input { width: 22px; height: 22px; accent-color: var(--primary); }
.hint { margin: 0; color: var(--muted); font-size: 17px; }

/* ---------- avatars, pills, tags ---------- */
.avatar { width: 40px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--ink); background: #F2C38B; flex-shrink: 0; }
.avatar.big { width: 56px; height: 56px; border-radius: 28px; font-size: 22px; }
.avatar[data-bg="1"] { background: #BFD8C2; } .avatar[data-bg="2"] { background: #E9B8A8; } .avatar[data-bg="3"] { background: #C9D3EE; }
.avatar[data-bg="4"] { background: #E8D49B; } .avatar[data-bg="5"] { background: #D8C2E6; }
.pill { margin-left: auto; padding: 5px 11px; border-radius: 12px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.pill.match { background: var(--match); color: var(--match-ink); }
.pill.new, .pill.you { background: var(--line-3); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { padding: 5px 11px; border-radius: 12px; background: var(--chip); color: var(--chip-ink); font-size: 15px; font-weight: 700; }
.meta { color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.tags .meta { margin-left: 4px; }
.match-text { color: var(--match-ink); font-weight: 700; }

/* ---------- feed cards ---------- */
.post { background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.post-photo { display: block; width: 100%; height: auto; aspect-ratio: 358 / 230; object-fit: cover; background: var(--line-3); }
.post-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.who .avatar { width: 36px; height: 36px; font-size: 15px; }
.place { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 16px; text-decoration: none; min-height: 32px; }
.place:hover span { text-decoration: underline; }
.tip { margin: 0; font-size: 17px; line-height: 1.4; }
.likers { margin: 0; color: var(--muted); font-size: 15px; }
.actions { display: flex; gap: 10px; }
.actions > .btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 8px; gap: 6px; font-size: 16px; }
.actions > .btn span { white-space: nowrap; }
.empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* ---------- want to try ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--chip); color: var(--chip-deep); }
.banner p { margin: 0; font-size: 17px; line-height: 1.35; }
.saved { background: var(--card); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.saved-top { display: flex; gap: 12px; }
.saved-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.saved h2 { font-size: 20px; }
.from { font-size: 16px; }
.thumb { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.thumb.none { display: inline-flex; align-items: center; justify-content: center; background: var(--line-3); color: var(--muted); }
details.tried { background: var(--card); border-radius: 18px; padding: 4px 16px; box-shadow: var(--shadow); }
details.tried summary { min-height: 52px; display: flex; align-items: center; font-weight: 700; font-size: 17px; cursor: pointer; }
.tried-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-3); }

/* ---------- post form ---------- */
.photo-pick { position: relative; display: block; border-radius: 20px; overflow: hidden; min-height: 200px; background: var(--card); border: 2px dashed var(--line-2); cursor: pointer; }
.photo-pick img { display: block; width: 100%; height: 240px; object-fit: cover; }
.photo-pick.busy { opacity: .6; }
.photo-empty { height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--primary-dark); font-weight: 700; }
.photo-change { position: absolute; right: 12px; bottom: 12px; min-height: 44px; padding: 0 16px; border-radius: 22px; background: rgba(42,33,27,.85); color: #fff; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; }
.paste { min-height: 52px; border-color: var(--primary); color: var(--primary-dark); }

/* ---------- me ---------- */
.card { background: var(--card); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.card h2 { font-size: 20px; }
.bar { display: grid; grid-template-columns: 84px minmax(0, 1fr) 48px; gap: 10px; align-items: center; font-size: 16px; }
.bar .pct { text-align: right; color: var(--muted); }
.bar progress { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border: 0; border-radius: 6px; background: #F3E6D4; overflow: hidden; }
.bar progress::-webkit-progress-bar { background: #F3E6D4; border-radius: 6px; }
.bar progress::-webkit-progress-value { background: var(--primary); border-radius: 6px; }
.bar progress::-moz-progress-bar { background: var(--primary); border-radius: 6px; }

/* ---------- bottom bar ---------- */
nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line-3); padding: 8px 24px max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; z-index: 5; }
nav.bottom button { width: 96px; min-height: 52px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; }
nav.bottom button[aria-current=page] { color: var(--primary); }
nav.bottom .fab { width: 64px; height: 64px; border-radius: 32px; background: var(--primary); color: #fff; margin-top: -30px; box-shadow: 0 6px 16px rgba(180,80,10,.35); justify-content: center; }

/* ---------- gate (login) ---------- */
.gate { max-width: 440px; margin: 0 auto; padding: max(48px, env(safe-area-inset-top)) 20px 40px; display: flex; flex-direction: column; gap: 16px; text-align: center; align-items: stretch; }
.gate .avatar.big { align-self: center; }
.people { display: flex; flex-direction: column; gap: 10px; }
.btn.person { justify-content: flex-start; gap: 12px; font-size: 18px; }
.btn.person .avatar { width: 36px; height: 36px; }

/* ---------- admin (shared stylesheet) ---------- */
.item-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.section-title { margin: 8px 0 0; font-weight: 700; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.alert { border: 2px solid var(--primary); }
.warn { margin: 0; color: var(--danger); font-weight: 700; }
p.pin { margin: 0; font-size: 40px; font-weight: 700; letter-spacing: .3em; text-align: center; }
table.adm { width: 100%; border-collapse: collapse; }
table.adm td { padding: 10px 0; border-top: 1px solid var(--line-3); vertical-align: middle; overflow-wrap: anywhere; }
table.adm tr:first-child td { border-top: 0; }
table.adm td.act { text-align: right; width: 1%; white-space: nowrap; padding-left: 10px; }
.top h1 + .hint { margin-top: -4px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; font-size: 17px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center; z-index: 10; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
