/* Mereholt account: one stylesheet (build spec section 6). Self-hosted fonts keep the CSP tight. */
@font-face { font-family: 'Cinzel'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/fonts/cinzel-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  --vellum: #F4EEE1; --card: #FFFFFF; --border: #E2DACB; --rule: #EEE7DA; --field: #CFC7B8;
  --ink: #1E1B18; --muted: #5E5850; --oxblood: #7A1F2B; --oxblood-dark: #5A1520;
  --header: #1E1B18; --success: #2F6B3F; --danger: #8E2230; --soft: #FBF8F1; --pill: #EAE2D2;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--vellum); color: var(--ink); font: 400 15px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--oxblood); }
a:hover { color: var(--oxblood-dark); }
:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }
h1, .wordmark { font-family: Cinzel, Georgia, serif; font-weight: 600; }
h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.25; }
.sub { margin: 0; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Plain pages: sign in, create account and the other public steps (one column, phone first). */
.plain { max-width: 440px; margin: 0 auto; padding: 32px 20px 28px; min-height: 100vh; display: flex; flex-direction: column; gap: 18px; }
.plain .brand { display: flex; justify-content: center; }
.plain .brand img { height: 44px; width: auto; }
.plain .intro { text-align: center; }
.plain .foot { margin-top: auto; text-align: center; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pill { background: var(--pill); border-radius: 16px; padding: 6px 14px; color: var(--ink); font-size: 13px; }

/* Signed-in pages: dark header, one column at most 760px. */
.site-header { background: var(--header); color: var(--vellum); display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 20px; }
.site-header .brand img { height: 34px; width: auto; display: block; }
.site-header .who { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 14px; }
.site-header .who span { color: #D9D2C3; overflow-wrap: anywhere; }
.site-header .linkish { color: var(--vellum); }
main.page { max-width: 760px; margin: 0 auto; padding: 28px 20px 56px; display: flex; flex-direction: column; gap: 20px; }
.backlink { font-size: 14px; }

/* Forms */
form.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input[type=email], .field input[type=text], .field input[type=password], .field textarea {
  height: 48px; border: 1px solid var(--field); border-radius: 8px; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 400; background: #fff; color: var(--ink); width: 100%; }
.field textarea { height: auto; min-height: 96px; padding: 10px 14px; }
.field .help { font-size: 12px; font-weight: 400; color: var(--muted); }
.field .error, .error-text { font-size: 13px; font-weight: 500; color: var(--danger); }
.field.has-error input { border-color: var(--danger); }
.pw { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 8px; background: #fff; height: 48px; }
.pw input { flex: 1; min-width: 0; border: 0 !important; height: 100% !important; background: transparent !important; }
.pw button { border: 0; background: none; font: inherit; font-size: 13px; color: var(--oxblood); padding: 0 14px; min-height: 44px; cursor: pointer; }
.pw:focus-within { outline: 2px solid var(--oxblood); outline-offset: 1px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 400; padding: 8px 0; min-height: 44px; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--oxblood); }
fieldset.box { border: 1px solid #D9D1C1; border-radius: 10px; padding: 12px 14px; margin: 0; background: var(--soft); }
fieldset.box legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
fieldset.box p { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--oxblood); border-color: var(--oxblood); color: #fff; font-weight: 600; font-size: 16px; }
.btn.primary:hover { background: var(--oxblood-dark); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--oxblood); text-decoration: underline; cursor: pointer; min-height: 44px; }

.notice { border-radius: 10px; padding: 12px 16px; background: #fff; border: 1px solid var(--border); font-size: 14px; }
.notice.ok { border-color: #BFD8C5; background: #F1F8F2; }
.notice.bad { border-color: #E3B9BF; background: #FBF1F2; color: var(--danger); }

/* Cards and rows (Your account) */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.card.pad { padding: 18px 22px; }
.card h2 { margin: 0; padding: 16px 22px 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card.prompt { padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.card.prompt .text { flex: 1 1 300px; }
.card.prompt h2 { padding: 0; margin: 0 0 4px; font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.card.prompt p { margin: 0; color: var(--muted); font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; min-height: 52px; flex-wrap: wrap; }
a.row:hover { background: var(--soft); color: inherit; }
.row .label { flex: 1 1 140px; }
.row .value { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.row .chev { color: #8A8274; }
.row.danger, .row.danger:hover { color: var(--danger); }
.game-icon { width: 44px; height: 44px; border-radius: 8px; background: #3A1218; flex: none; display: block; }
.game .text { flex: 1 1 200px; }
.game .actions { display: flex; gap: 12px; align-items: center; }
.footnote { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }

/* Emails from us: switches are buttons in forms, so they work without JavaScript. */
.topic { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--rule); }
.topic .text { flex: 1; min-width: 0; }
.topic .name { font-weight: 600; }
.topic .about { font-size: 14px; color: var(--muted); }
.topic .record { font-size: 12px; color: #6B6458; margin-top: 4px; }
.switch { flex: none; position: relative; width: 52px; height: 30px; border-radius: 15px; border: 0; padding: 0; cursor: pointer; background: #B9B1A2; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch[aria-pressed=true] { background: var(--oxblood); }
.switch[aria-pressed=true]::after { left: 25px; }
.always { font-size: 13px; font-weight: 600; color: var(--success); white-space: nowrap; }
.status-live { min-height: 20px; font-size: 13px; color: var(--success); }
.split { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 10px 22px; border-top: 1px solid var(--rule); vertical-align: top; }
.codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; padding: 16px 22px; }
.qr { display: flex; justify-content: center; padding: 8px; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }

@media (max-width: 400px) {
  .row, .topic, .card h2, .card.pad, .card.prompt { padding-left: 16px; padding-right: 16px; }
  .codes { grid-template-columns: 1fr; }
}

/* Utilities (the CSP allows no inline style attributes). */
.m0 { margin: 0; } .mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mb4 { margin-bottom: 4px; } .mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.m4-0 { margin: 4px 0 0; } .center { text-align: center; } .bold { font-weight: 600; } .anywhere { overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 200px; } .flex1 { flex: 1; } .full { grid-column: 1 / -1; } .span2 { grid-column: span 2; }
.rowflex { display: flex; align-items: center; gap: 16px; } .soft { background: var(--soft); } .nobt { border-top: 0; }
.mutedlink, .mutedlink:hover { color: var(--muted); } .lead-in { margin: 0; padding: 16px 22px 0; }
@media (max-width: 700px) { .span2 { grid-column: auto; } }
/* Long values (an email) wrap under the label on phones instead of pushing the arrow onto its own line. */
.row { flex-wrap: nowrap; }
.row .label { flex: 0 1 auto; min-width: 0; margin-right: auto; }
.row .value { min-width: 0; text-align: right; }
@media (max-width: 480px) { a.row .label { flex: 1 1 auto; } a.row .value { max-width: 60%; } }
.game .value { text-align: left; }
