/* =====================================================================
   RestRating.com — design system
   Light by default, automatic dark mode, plus accessibility modes
   (html.a11y-*) controlled by the Accessibility panel.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-readable: "Atkinson Hyperlegible", Verdana, Tahoma, sans-serif;

  --bg: #f7f6f8;
  --bg-alt: #f0eef2;
  --surface: #ffffff;
  --surface-2: #faf9fb;
  --text: #17171c;
  --text-2: #3c3c45;
  --muted: #5c5c66;
  --border: #e3e1e7;
  --border-strong: #c9c6d0;

  --brand: #d6003b;            /* 5.35:1 on white — safe for text and white-on-brand */
  --brand-hover: #b8002f;
  --brand-ink: #ffffff;        /* text on brand */
  --brand-soft: #fff0f3;
  --brand-soft-2: #ffe1e8;
  --brand-logo: #ff0049;

  --star: #f2a20c;
  --star-empty: #dddae2;
  --ok: #0f7a46;
  --ok-soft: #e7f6ee;
  --warn: #8a5300;
  --warn-soft: #fff4dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info: #1f5fbf;
  --info-soft: #eaf1fd;

  --focus: #1f5fbf;
  --focus-ring: 0 0 0 3px var(--surface), 0 0 0 6px var(--focus);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 28, .06), 0 1px 1px rgba(23, 23, 28, .04);
  --shadow: 0 4px 16px -4px rgba(23, 23, 28, .10), 0 2px 4px rgba(23, 23, 28, .04);
  --shadow-lg: 0 24px 48px -12px rgba(23, 23, 28, .22);

  --tap: 44px;                 /* minimum target size */
  --gap: 1rem;
  --header-h: 64px;
  --container: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --speed: .18s;

  --tile-l: 94%;
  --tile-c: 45%;
  --tile-ink-l: 25%;
  color-scheme: light;
}

/* Dark: follow the device unless the visitor picked Light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121216; --bg-alt: #17171d; --surface: #1c1c22; --surface-2: #22222a;
    --text: #f2f2f5; --text-2: #d6d6de; --muted: #a8a8b3; --border: #2e2e37; --border-strong: #45454f;
    --brand: #ff6b8a; --brand-hover: #ff8aa3; --brand-ink: #1a0509; --brand-soft: #2b161c; --brand-soft-2: #3a1a23;
    --star: #ffb92e; --star-empty: #3a3a44;
    --ok: #5fd39a; --ok-soft: #12291f; --warn: #ffc56b; --warn-soft: #2d2412; --danger: #ff8a80; --danger-soft: #331816;
    --info: #8db8ff; --info-soft: #152238; --focus: #8db8ff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow: 0 6px 20px -6px rgba(0,0,0,.6); --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.7);
    --tile-l: 24%; --tile-c: 35%; --tile-ink-l: 82%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121216; --bg-alt: #17171d; --surface: #1c1c22; --surface-2: #22222a;
  --text: #f2f2f5; --text-2: #d6d6de; --muted: #a8a8b3; --border: #2e2e37; --border-strong: #45454f;
  --brand: #ff6b8a; --brand-hover: #ff8aa3; --brand-ink: #1a0509; --brand-soft: #2b161c; --brand-soft-2: #3a1a23;
  --star: #ffb92e; --star-empty: #3a3a44;
  --ok: #5fd39a; --ok-soft: #12291f; --warn: #ffc56b; --warn-soft: #2d2412; --danger: #ff8a80; --danger-soft: #331816;
  --info: #8db8ff; --info-soft: #152238; --focus: #8db8ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow: 0 6px 20px -6px rgba(0,0,0,.6); --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.7);
  --tile-l: 24%; --tile-c: 35%; --tile-ink-l: 82%;
  color-scheme: dark;
}

/* High contrast: black / white / yellow regardless of theme */
:root.a11y-contrast {
  --bg: #000; --bg-alt: #000; --surface: #000; --surface-2: #0a0a0a;
  --text: #fff; --text-2: #fff; --muted: #f0f0f0; --border: #fff; --border-strong: #fff;
  --brand: #ffe600; --brand-hover: #fff27a; --brand-ink: #000; --brand-soft: #000; --brand-soft-2: #1a1a00; --brand-logo: #fff;
  --star: #ffe600; --star-empty: #555;
  --ok: #7dffb0; --ok-soft: #000; --warn: #ffe600; --warn-soft: #000; --danger: #ff9b9b; --danger-soft: #000;
  --info: #7dd3ff; --info-soft: #000; --focus: #ffe600;
  --shadow-sm: none; --shadow: none; --shadow-lg: none;
  --tile-l: 0%; --tile-c: 0%; --tile-ink-l: 100%;
  color-scheme: dark;
}

/* Text size (rem-based layout scales with it) */
html { font-size: 100%; }
html.text-1 { font-size: 112.5%; }
html.text-2 { font-size: 125%; }
html.text-3 { font-size: 150%; }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html:not(.a11y-motion) { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; outline: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { padding-left: 1.25em; }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; padding: .1em .45em;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2);
}
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
::selection { background: var(--brand-soft-2); color: var(--text); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }

/* ---------- 3. Utilities ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000; padding: .75rem 1.25rem;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: 1rem; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.container-wide { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 clamp(1rem, 2.5vw, 2rem); }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.fine-print { font-size: .875rem; color: var(--muted); margin: 1rem 0 0; }
.stack > * + * { margin-top: 1.25rem; }
.show-sm, .show-sm-sr, .show-md-sr { display: none; }
@media (max-width: 1400px) { .hide-lg { display: none !important; } }
[hidden] { display: none !important; }
.js .js-hide { display: none; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--tap); padding: .6em 1.15em; border-radius: var(--radius-pill);
  border: 1.5px solid transparent; font-weight: 650; font-size: .95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background var(--speed) var(--ease), border-color var(--speed), color var(--speed), transform var(--speed), box-shadow var(--speed);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.1em; height: 1.1em; vertical-align: 0; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--brand) 60%, transparent); }
.btn-primary:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-light { background: #fff; color: #17171c; }
.btn-light:hover { background: #fff0f3; color: #17171c; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 38px; padding: .4em .85em; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: .75em 1.5em; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-sub { font-size: .72em; font-weight: 600; padding-left: .25em; border-left: 1px solid currentColor; margin-left: .15em; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; list-style: none; padding: 0; margin: 0; }
.btn-row-center { justify-content: center; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--radius-pill);
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }
.link-button {
  background: none; border: 0; padding: .25em 0; color: var(--brand); font-weight: 650; cursor: pointer;
  text-decoration: underline; text-underline-offset: .18em; min-height: 32px;
}
.link-button:hover { color: var(--brand-hover); }
.link-button:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* ---------- 5. Form controls ---------- */
.form { display: grid; gap: 1.15rem; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .35rem; color: var(--text); padding: 0; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field-label-inline { font-weight: 600; font-size: .9rem; color: var(--muted); }
.field-hint { font-size: .875rem; color: var(--muted); margin: -.1rem 0 .45rem; }
.field-count { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; text-align: right; }
.req, .opt { font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; margin-left: .35em; }
.req { color: var(--brand); }
.opt { color: var(--muted); }
.small-link { font-size: .875rem; font-weight: 600; }
.input, .select {
  width: 100%; min-height: 48px; padding: .65rem .9rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--text);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.input:hover, .select:hover { border-color: var(--muted); }
.input:focus, .select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); outline: none; }
.textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 2.5rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
.select-sm { min-height: 38px; padding: .3rem 2.2rem .3rem .75rem; font-size: .9rem; width: auto; }
.has-error .input, .has-error .select, .input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { display: flex; gap: .4rem; align-items: flex-start; color: var(--danger); font-weight: 600; font-size: .9rem; margin: .45rem 0 0; }
.field-error .icon { margin-top: .15em; }
.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 6rem; }
.input-addon {
  position: absolute; right: 4px; top: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: .35rem;
  padding: 0 .8rem; border: 0; border-radius: 6px; background: var(--bg-alt); color: var(--text-2); font-weight: 600; font-size: .85rem; cursor: pointer;
}
.input-addon:hover { color: var(--text); }
.input-code { font-size: 1.75rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; padding-left: 1.2rem; }
.meter { height: 6px; border-radius: 99px; background: var(--bg-alt); margin-top: .55rem; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--danger); transition: width .25s, background .25s; }
.meter span[data-level="2"] { background: var(--warn); }
.meter span[data-level="3"], .meter span[data-level="4"] { background: var(--ok); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; padding-top: .5rem; }
.inline-form { display: flex; align-items: center; gap: .5rem; }

/* Checkboxes */
.check { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; position: relative; min-height: var(--tap); padding: .55rem 0; line-height: 1.4; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.check-box {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: .05em; border-radius: 6px;
  border: 2px solid var(--border-strong); background: var(--surface); color: transparent; transition: all var(--speed);
}
.check-box .icon { width: 15px; height: 15px; stroke-width: 3.2; }
.check input:checked + .check-box { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.check input:focus-visible + .check-box { box-shadow: var(--focus-ring); }
.check:hover .check-box { border-color: var(--text-2); }
.check-icon { color: var(--muted); }
.check-list { display: grid; gap: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: .65rem; }
.check-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: .85rem; background: var(--surface); transition: border-color var(--speed), background var(--speed); }
.check-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.check-card input { left: .85rem; top: .85rem; }
.check-card-text { display: grid; gap: .15rem; }
.check-card-title { display: flex; align-items: center; gap: .4rem; font-weight: 650; }
.check-card-title .icon { color: var(--brand); }
.check-card-hint { font-size: .82rem; color: var(--muted); }

/* Pills (radio buttons that look like chips) */
.pill-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill > span {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: .35rem .85rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: all var(--speed);
}
.pill > span .icon { width: 1em; height: 1em; color: var(--star); }
.pill:hover > span { border-color: var(--text-2); }
.pill input:checked + span { background: var(--text); border-color: var(--text); color: var(--surface); }
.pill input:checked + span .icon { color: var(--star); }
.pill input:focus-visible + span { box-shadow: var(--focus-ring); }
.pill-group-tight .pill > span { min-width: 44px; justify-content: center; padding: .35rem .65rem; }

/* Switches (role="switch" checkboxes) */
.switch {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .85rem; padding: .7rem .75rem; margin: 0 -.75rem;
  border-radius: var(--radius); cursor: pointer; position: relative;
}
.switch:hover { background: var(--bg-alt); }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-alt); color: var(--text-2); }
.switch-text { display: grid; gap: .1rem; }
.switch-label { font-weight: 700; }
.switch-hint { font-size: .84rem; color: var(--muted); line-height: 1.4; }
.switch-track {
  position: relative; width: 52px; height: 30px; border-radius: 99px; background: var(--border-strong); transition: background var(--speed);
  border: 2px solid transparent;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--speed) var(--ease);
}
.switch input:checked ~ .switch-track { background: var(--brand); }
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(22px); background: var(--brand-ink); }
.switch input:checked ~ .switch-icon { background: var(--brand-soft-2); color: var(--brand); }
.switch input:focus-visible ~ .switch-track { box-shadow: var(--focus-ring); }

/* Segmented controls */
.segmented { margin: 0 0 1rem; }
.segmented legend { font-weight: 700; margin-bottom: .45rem; padding: 0; }
.segmented-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--bg-alt); }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 56px; padding: .35rem;
  border-radius: 10px; font-weight: 650; font-size: .82rem; color: var(--text-2); cursor: pointer; text-align: center;
}
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); outline: 2px solid var(--brand); outline-offset: -2px; }
.seg input:focus-visible + span { box-shadow: var(--focus-ring); }
.seg-glyph { font-weight: 800; line-height: 1; }
.seg-size-0 .seg-glyph { font-size: 1rem; }
.seg-size-1 .seg-glyph { font-size: 1.2rem; }
.seg-size-2 .seg-glyph { font-size: 1.4rem; }
.seg-size-3 .seg-glyph { font-size: 1.65rem; }

/* ---------- 6. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 500; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: var(--header-h); padding-top: .5rem; padding-bottom: .5rem; }
.brand { display: inline-flex; align-items: center; flex: none; padding: .35rem 0; }
.brand img { width: 168px; height: auto; display: block; }
.header-search { flex: 1; min-width: 0; max-width: 640px; }
.header-nav { margin-left: auto; }
.header-nav ul { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.header-nav a:not(.btn), .btn-a11y {
  display: inline-flex; align-items: center; gap: .45rem; min-height: var(--tap); padding: .4rem .8rem; border-radius: var(--radius-pill);
  color: var(--text-2); font-weight: 650; font-size: .95rem; text-decoration: none; background: none; border: 0; cursor: pointer;
}
.header-nav a:not(.btn):hover, .btn-a11y:hover { background: var(--bg-alt); color: var(--text); }
.header-nav a[aria-current="page"] { color: var(--brand); }
.btn-a11y { border: 1.5px solid var(--border-strong); }
.btn-a11y .icon { width: 1.35em; height: 1.35em; color: var(--brand); }
.nav-user { padding-left: .3rem !important; }

/* Avatars */
.avatar {
  --h: 340; display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: hsl(var(--h) var(--tile-c) var(--tile-l)); color: hsl(var(--h) 60% var(--tile-ink-l));
  font-weight: 800; font-size: .95rem; object-fit: cover; border: 1px solid var(--border);
}
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-xl { width: 84px; height: 84px; font-size: 1.75rem; }

/* ---------- 7. Search form ---------- */
.search-form {
  display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill); position: relative; transition: box-shadow var(--speed), border-color var(--speed);
}
.search-form:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }
.sf-field { position: relative; display: flex; align-items: center; flex: 1 1 50%; min-width: 0; }
.sf-field + .sf-field::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: var(--border); }
.sf-icon { display: grid; place-items: center; padding-left: 1rem; color: var(--muted); pointer-events: none; }
.sf-field input {
  flex: 1; min-width: 0; min-height: 46px; border: 0; background: transparent; padding: .5rem .6rem; outline: none; font-size: .95rem;
}
.sf-field input::-webkit-search-cancel-button { cursor: pointer; }
.sf-field input::placeholder { color: var(--muted); opacity: 1; }
.sf-mic, .sf-locate {
  display: inline-flex; align-items: center; gap: .35rem; flex: none; min-height: 38px; min-width: 38px; justify-content: center; margin-right: .3rem;
  padding: 0 .5rem; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); cursor: pointer; font-weight: 650; font-size: .85rem;
}
.sf-mic:hover, .sf-locate:hover { background: var(--bg-alt); color: var(--brand); }
.sf-locate.is-active { color: var(--brand); background: var(--brand-soft); }
.sf-mic.is-listening { color: #fff; background: var(--brand); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 50%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.sf-submit { border-radius: var(--radius-pill); margin: 4px; min-height: 40px; padding: 0 1rem; }
.search-compact .sf-submit { min-width: 44px; padding: 0 .75rem !important; }
.search-compact .sf-submit .icon { width: 1.15rem; height: 1.15rem; }

.search-hero { padding: .45rem; border-radius: 22px; box-shadow: var(--shadow-lg); border-color: transparent; max-width: 860px; margin: 0 auto; }
.search-hero .sf-field { flex-direction: row; flex-wrap: wrap; align-content: center; padding: .35rem 0; }
.search-hero .sf-label { position: absolute; left: 3.05rem; top: .45rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.search-hero .sf-icon { padding-left: 1.1rem; }
.search-hero .sf-field input { min-height: 56px; padding-top: 1.3rem; font-size: 1.05rem; }
.search-hero .sf-submit { min-height: 56px; padding: 0 1.6rem; border-radius: 16px; font-size: 1.05rem; margin: 0; }
.search-hero .sf-locate-text { white-space: nowrap; }

/* Autocomplete list */
.suggest {
  position: absolute; z-index: 600; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: .4rem; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 360px; overflow: auto;
}
.suggest li { display: flex; align-items: center; gap: .65rem; padding: .6rem .7rem; border-radius: 10px; cursor: pointer; min-height: var(--tap); }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--brand-soft); }
.suggest .icon { color: var(--muted); }
.suggest small { display: block; color: var(--muted); font-size: .8rem; }

/* ---------- 8. Flash / notices ---------- */
.flash-stack { display: grid; gap: .6rem; margin-top: 1rem; }
.flash {
  display: flex; align-items: flex-start; gap: .7rem; padding: .85rem 1rem; border-radius: var(--radius);
  border: 1.5px solid; background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--text);
}
.flash p { margin: 0; flex: 1; font-weight: 550; }
.flash > .icon { color: var(--info); margin-top: .15em; }
.flash-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.flash-success > .icon { color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.flash-error > .icon { color: var(--danger); }
.flash-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: .15rem; border-radius: 6px; min-width: 32px; min-height: 32px; }
.notice {
  display: flex; gap: .55rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--info-soft);
  color: var(--text); font-size: .92rem; margin: .5rem 0 0;
}
.notice > .icon { color: var(--info); margin-top: .1em; }
.notice-a11y { background: var(--brand-soft); }
.notice-a11y > .icon { color: var(--brand); }
.error-summary { padding: 1rem 1.15rem; border-radius: var(--radius); border: 2px solid var(--danger); background: var(--danger-soft); margin-bottom: 1.25rem; outline: none; }
.error-summary h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; color: var(--danger); margin-bottom: .4rem; }
.error-summary ul { margin: 0; }
.error-summary a { color: var(--danger); font-weight: 650; }

/* ---------- 9. Home ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .85rem; font-size: .8rem; font-weight: 750;
  letter-spacing: .06em; text-transform: uppercase; color: var(--brand);
}
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); text-align: center; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 15% 10%, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%),
    radial-gradient(50% 50% at 90% 20%, color-mix(in srgb, #ffb92e 14%, transparent), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, color-mix(in srgb, var(--info) 10%, transparent), transparent 70%),
    var(--bg);
}
.a11y-contrast .hero-bg { background: #000; }
.hero h1 { max-width: 15ch; margin: 0 auto .6rem; font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem); letter-spacing: -.03em; }
.hl { color: var(--brand); }
.lead { font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); color: var(--text-2); max-width: 60ch; margin-left: auto; margin-right: auto; }
.hero .lead { margin-bottom: 2rem; }
.quick-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; list-style: none; padding: 0; margin: 1.5rem 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: .4rem 1rem; border-radius: var(--radius-pill);
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text); font-weight: 650; font-size: .92rem; text-decoration: none; box-shadow: var(--shadow-sm);
}
.chip .icon { color: var(--brand); }
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip-strong { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip-strong .icon { color: inherit; }
.chip-strong:hover { color: var(--surface); background: var(--text-2); }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem 2.5rem; margin: 2.5rem 0 0; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { font-size: .85rem; color: var(--muted); font-weight: 600; }
.hero-stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 1.75rem; max-width: 65ch; }
.section-head p { color: var(--muted); margin: 0; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; max-width: none; flex-wrap: wrap; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .85rem; list-style: none; padding: 0; margin: 0; }
.cat-card {
  --h: 340; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; height: 100%; padding: 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--border); color: var(--text); text-decoration: none; font-weight: 700;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed), border-color var(--speed);
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); color: var(--text); }
.cat-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: hsl(var(--h) var(--tile-c) var(--tile-l)); color: hsl(var(--h) 65% var(--tile-ink-l)); }
.cat-icon .icon { width: 24px; height: 24px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.card-grid > li { display: flex; }
.card-grid .place-card { flex: 1; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.25rem; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step { position: relative; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); counter-increment: step; }
.step::after { content: counter(step); position: absolute; top: 1rem; right: 1.25rem; font-size: 2.75rem; font-weight: 800; color: var(--bg-alt); line-height: 1; }
.step-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); margin-bottom: 1rem; }
.step-icon .icon { width: 26px; height: 26px; }
.step p { color: var(--muted); margin: 0; }

.a11y-band { background: #17171c; color: #f2f2f5; }
.a11y-band h2 { color: #fff; }
.a11y-band p { color: #d0d0da; }
.a11y-contrast .a11y-band { border-top: 2px solid #fff; border-bottom: 2px solid #fff; }
.eyebrow-on-dark { color: #ff8aa3; }
.a11y-contrast .eyebrow-on-dark { color: var(--brand); }
.a11y-band-inner { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.5rem; align-items: center; }
.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; list-style: none; padding: 0; margin: 0; }
.feature-list li { display: flex; gap: .75rem; padding: 1rem; border-radius: var(--radius); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: .9rem; color: #d0d0da; line-height: 1.45; }
.feature-list strong { display: block; color: #fff; font-size: .95rem; margin-bottom: .1rem; }
.feature-list .icon { color: #ff8aa3; width: 1.5em; height: 1.5em; }

.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.quote-card { padding: 1.35rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: .6rem; }
.quote-card h3 { margin: 0; font-size: 1.02rem; }
.quote-card > p { margin: 0; color: var(--text-2); }
.quote-by { display: flex; gap: .6rem; align-items: center; font-size: .86rem; color: var(--muted); margin-top: auto !important; padding-top: .5rem; }
.quote-by strong { color: var(--text); }

.cta-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg); background: var(--brand-soft); border: 1px solid var(--brand-soft-2);
}
.cta-card h2 { margin-bottom: .3rem; }
.cta-card p { margin: 0; color: var(--text-2); }

/* ---------- 10. Place cards ---------- */
.place-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "tile body" "tile actions"; gap: .2rem 1rem;
  padding: 1.1rem; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color var(--speed), box-shadow var(--speed); position: relative; scroll-margin-top: calc(var(--header-h) + 1rem);
}
.place-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.place-card.is-highlight { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.place-tile {
  --h: 340; grid-area: tile; position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px;
  background: hsl(var(--h) var(--tile-c) var(--tile-l)); color: hsl(var(--h) 65% var(--tile-ink-l));
}
.place-tile .icon { width: 28px; height: 28px; }
.place-num {
  position: absolute; top: -8px; left: -8px; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px;
  background: var(--brand); color: var(--brand-ink); font-size: .8rem; font-weight: 800; border: 2px solid var(--surface);
}
.place-body { grid-area: body; min-width: 0; }
.place-name { font-size: 1.12rem; margin: 0 0 .15rem; }
.place-name a { color: var(--text); text-decoration: none; }
.place-name a:hover { color: var(--brand); text-decoration: underline; }
.place-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card clickable */
.place-card .place-actions, .place-card .badges { position: relative; z-index: 1; }
.place-meta { display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin: 0 0 .35rem; font-size: .875rem; color: var(--muted); }
.place-dist { display: inline-flex; align-items: center; gap: .25rem; font-weight: 700; color: var(--text-2); }
.place-dist .icon { width: 1em; height: 1em; color: var(--brand); }
.place-rating { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; font-size: .92rem; margin-bottom: .3rem; }
.place-rating strong { font-weight: 800; }
.rating-word { font-weight: 650; color: var(--text-2); }
.place-address { display: flex; gap: .35rem; align-items: flex-start; font-size: .875rem; color: var(--muted); margin: 0 0 .5rem; }
.place-address .icon { width: 1em; height: 1em; margin-top: .25em; }
.place-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

.badges { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: var(--radius-pill);
  font-size: .78rem; font-weight: 700; background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
}
.badge .icon { width: 1.05em; height: 1.05em; }
.badge-changing_table { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.badge-gender_neutral { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.badges-quiet .badge { background: var(--bg-alt); color: var(--text-2); border-color: var(--border); }

/* Stars */
.stars { position: relative; display: inline-block; line-height: 0; vertical-align: middle; white-space: nowrap; }
.stars-base, .stars-fill { display: inline-flex; gap: 1px; }
.stars-base { color: var(--star-empty); }
.stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--star); }
.stars .icon { width: 1.05rem; height: 1.05rem; vertical-align: 0; }
.stars-sm .icon { width: .95rem; height: .95rem; }
.stars-lg .icon { width: 1.5rem; height: 1.5rem; }

/* ---------- 11. Search results page ---------- */
.search-page { padding-top: 1.5rem; padding-bottom: 3rem; }
.results-head { margin-bottom: 1.25rem; }
.results-head h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: .25rem; }
.results-summary { color: var(--muted); font-weight: 600; margin: 0; }
.results-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) minmax(0, .9fr); gap: 1.5rem; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto; border-radius: var(--radius-lg); }
.filters-details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.filters-details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1.15rem; cursor: pointer; list-style: none; font-weight: 750;
  min-height: var(--tap);
}
.filters-details > summary::-webkit-details-marker { display: none; }
.filters-title { display: inline-flex; align-items: center; gap: .5rem; }
.summary-chev { transition: transform var(--speed); }
.filters-details[open] .summary-chev { transform: rotate(180deg); }
.count-pill { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; }
.filter-form { display: grid; gap: 1.25rem; padding: 0 1.15rem 1.15rem; }
.filter-actions { display: grid; gap: .4rem; position: sticky; bottom: 0; background: var(--surface); padding-top: .5rem; }
.results-main { min-width: 0; }
.place-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.results-map { position: sticky; top: calc(var(--header-h) + 1rem); height: calc(100vh - var(--header-h) - 2rem); min-height: 420px; }
.results-map { display: flex; flex-direction: column; gap: .5rem; }
.results-map .map { flex: 1 1 auto; height: auto; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.map-hint { margin: 0; color: var(--muted); font-size: .85rem; }
.origin-line { display: flex; gap: .4rem; align-items: flex-start; margin: .35rem 0 0; color: var(--text-2); font-size: .92rem; }
.origin-line .icon { flex: none; margin-top: .2em; color: var(--info); }
.origin-adjust { margin-left: .35rem; white-space: nowrap; }
.discover-status { margin: .5rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.discover-status.is-busy { color: var(--muted); font-size: .9rem; }
.discover-status.is-busy::before { content: ""; width: .8em; height: .8em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rr-spin .8s linear infinite; }
@keyframes rr-spin { to { transform: rotate(360deg); } }
.geo-progress { margin: .5rem 0 0; font-size: .9rem; font-weight: 600; color: var(--text-2); }
.geo-progress:empty { display: none; }
.map { width: 100%; height: 100%; min-height: 280px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg-alt); z-index: 1; }
.view-toggle { display: none; }
.seg-btn {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .3rem 1rem; border: 0; border-radius: var(--radius-pill);
  background: transparent; font-weight: 700; cursor: pointer; color: var(--text-2);
}
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.empty-state { text-align: center; padding: 3rem 1.5rem; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty-state-sm { padding: 2rem 1rem; border: 0; background: var(--surface-2); }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); margin-bottom: 1rem; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty-state p { color: var(--muted); }

.pagination { margin-top: 1.75rem; }
.pagination ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.page-btn, .page-num {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-width: var(--tap); min-height: var(--tap); padding: 0 .85rem;
  border-radius: var(--radius-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none;
}
.page-btn:hover, .page-num:hover { border-color: var(--text-2); color: var(--text); }
.page-num.is-current { background: var(--text); color: var(--surface); border-color: var(--text); }
.page-btn.is-disabled { opacity: .45; }
.page-gap { color: var(--muted); padding: 0 .25rem; }

/* Map pins (Leaflet divIcon) */
.pin {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--brand); border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); color: var(--brand-ink); font: 800 13px/1 var(--font);
}
.pin span { transform: rotate(45deg); }
.pin.is-active { background: #17171c; color: #fff; transform: rotate(-45deg) scale(1.2); }
.pin-origin { cursor: grab; width: 18px; height: 18px; border-radius: 50%; background: var(--info); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 30%, transparent); }
.leaflet-container { font-family: var(--font); }
.leaflet-container .leaflet-control-attribution { background: var(--surface); color: var(--text-2); font-size: .72rem; }
.leaflet-container .leaflet-control-attribution a { color: var(--brand); }
.leaflet-bar a { color: #17171c; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 12px 14px; font-size: .9rem; }
.leaflet-popup-content a { font-weight: 700; }

/* ---------- 12. Location page ---------- */
.location-page { padding-top: 1.25rem; padding-bottom: 3rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .875rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--border-strong); }
.breadcrumbs a { color: var(--text-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.loc-hero {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.75rem; padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 1.25rem;
}
.loc-hero h1 { margin-bottom: .75rem; }
.loc-hero-map .map { min-height: 300px; }
.loc-rating { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.loc-rating p { margin: .15rem 0 0; font-size: .95rem; }
.rating-big { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.loc-bio { color: var(--text-2); margin: 0 0 1.25rem; max-width: 60ch; line-height: 1.6; }
.loc-facts { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .55rem; }
.loc-facts li { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .3rem .6rem; color: var(--text-2); }
.loc-facts .icon { color: var(--brand); margin-top: .2em; }
.loc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.15rem, 2.5vw, 1.6rem); }
.card > h2 { font-size: 1.25rem; }
.amen-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.amen { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .6rem .7rem; border-radius: var(--radius); }
.amen-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-alt); color: var(--muted); }
.amen-text { display: grid; line-height: 1.35; }
.amen-text span { font-size: .84rem; color: var(--muted); }
.amen-state { display: inline-flex; align-items: center; gap: .25rem; font-weight: 750; font-size: .84rem; color: var(--muted); }
.amen-yes { background: var(--ok-soft); }
.amen-yes .amen-icon { background: var(--surface); color: var(--ok); }
.amen-yes .amen-state { color: var(--ok); }
.amen-some .amen-state { color: var(--warn); }
.hist { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .45rem; }
.hist li, .subscores li { display: grid; grid-template-columns: 4.5rem 1fr 2.5rem; align-items: center; gap: .75rem; font-size: .9rem; }
.hist-label { font-weight: 650; color: var(--text-2); }
.hist-bar, .sub-bar { height: 10px; border-radius: 99px; background: var(--bg-alt); overflow: hidden; }
.hist-bar span, .sub-bar span { display: block; height: 100%; border-radius: inherit; background: var(--star); }
.sub-bar span { background: var(--brand); }
.hist-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.sub-h { font-size: .95rem; margin-top: .5rem; }
.subscores { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.subscores li { grid-template-columns: auto 8.5rem 1fr 2.5rem; }
.sub-icon { color: var(--brand); }
.sub-label { font-weight: 650; }
.sub-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.subscores .muted.sub-val { grid-column: span 2; text-align: left; font-weight: 500; }

.reviews { scroll-margin-top: calc(var(--header-h) + 1rem); outline: none; }
.reviews-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: .75rem; }
.reviews-head h2 { margin: 0; }
.review-list { list-style: none; padding: 0; margin: 0; }
.review-list > li + li { border-top: 1px solid var(--border); }
.review { padding: 1.35rem 0; scroll-margin-top: calc(var(--header-h) + 1rem); }
.review-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .7rem; }
.review-name { font-size: 1rem; margin: 0; }
.review-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .7rem; margin: .1rem 0 0; font-size: .82rem; color: var(--muted); }
.level { display: inline-flex; padding: .1rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-alt); color: var(--text-2); }
.level-lvl3 { background: var(--info-soft); color: var(--info); }
.level-lvl4, .level-lvl5 { background: var(--warn-soft); color: var(--warn); }
.level-lvl6, .level-staff { background: var(--brand); color: var(--brand-ink); }
.review-rating { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .5rem; }
.review-subs { display: flex; flex-wrap: wrap; gap: .25rem .75rem; list-style: none; padding: 0; margin: 0; font-size: .82rem; color: var(--muted); }
.review-subs strong { color: var(--text); }
.review-title { font-weight: 750; font-size: 1.05rem; margin: 0 0 .3rem; }
.review-body { color: var(--text-2); margin-bottom: .75rem; overflow-wrap: anywhere; }
.review-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .875rem; }
.helpful-btn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }
.helpful-count:empty { display: none; }

/* ---------- 13. Review form ---------- */
.review-page { padding-top: 1.25rem; padding-bottom: 3rem; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.form-card h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-bottom: .3rem; }
.form-lead { color: var(--muted); margin-bottom: 1.5rem; }
.star-input { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; cursor: pointer; color: var(--star-empty); transition: transform var(--speed), color var(--speed); }
.star-input label .icon { width: 40px; height: 40px; }
.star-input label:hover { transform: scale(1.08); }
.star-input input:focus-visible + label { box-shadow: var(--focus-ring); }
.star-input:has(#rating-1:checked) label:nth-of-type(-n+1),
.star-input:has(#rating-2:checked) label:nth-of-type(-n+2),
.star-input:has(#rating-3:checked) label:nth-of-type(-n+3),
.star-input:has(#rating-4:checked) label:nth-of-type(-n+4),
.star-input:has(#rating-5:checked) label:nth-of-type(-n+5) { color: var(--star); }
@media (hover: hover) {
  .star-input:has(label:hover) label { color: var(--star-empty) !important; }
  .star-input label:hover, .star-input label:has(~ label:hover) { color: var(--star) !important; }
}
.star-output { margin-left: .75rem; font-weight: 800; font-size: 1.1rem; color: var(--text-2); }
.star-field.has-error .star-input { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: 12px; }
.detail-ratings { display: grid; gap: .85rem; }
.detail-row { display: grid; grid-template-columns: 11rem 1fr; align-items: center; gap: .75rem; }
.detail-row legend { float: left; display: flex; align-items: center; gap: .4rem; font-weight: 650; padding: 0; }
.detail-row legend .icon { color: var(--brand); }
.tips-card { position: sticky; top: calc(var(--header-h) + 1rem); }
.tips-card h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.tips { padding-left: 1.1rem; color: var(--text-2); font-size: .92rem; }
.tips li + li { margin-top: .4rem; }

/* ---------- 14. Auth ---------- */
.page-auth main { display: flex; flex-direction: column; }
.auth-wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: clamp(1.5rem, 5vw, 3.5rem) 1rem 3rem; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 5vw, 2.4rem); box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); margin-bottom: .4rem; }
.auth-step { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: .2rem .65rem; border-radius: 99px; margin-bottom: .9rem; }
.auth-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); margin-bottom: 1rem; }
.auth-icon .icon { width: 28px; height: 28px; }
.auth-lead { color: var(--muted); margin-bottom: 1.5rem; }
.auth-card .flash, .auth-card .notice { margin-bottom: 1.25rem; }
.auth-alt { margin: 1.5rem 0 0; text-align: center; color: var(--muted); }
.auth-alt a { font-weight: 700; }
.auth-trust { display: flex; gap: .5rem; align-items: flex-start; justify-content: center; margin: 1.25rem auto 0; font-size: .84rem; color: var(--muted); max-width: 40ch; text-align: center; }
.auth-trust .icon { color: var(--ok); flex: none; }
.resend-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin-top: 1.25rem; font-size: .92rem; }
.turnstile { min-height: 65px; }

/* ---------- 15. Account ---------- */
.account-page { padding-top: 2rem; padding-bottom: 3rem; }
.account-hero { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.account-hero h1 { margin: 0; }
.account-hero p { margin: .15rem 0 0; }
.acct-badges { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; font-size: .9rem; color: var(--muted); }
.verified { display: inline-flex; align-items: center; gap: .3rem; color: var(--ok); font-weight: 650; }
.acct-signout { margin-left: auto; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.my-reviews { list-style: none; padding: 0; margin: 0; }
.my-review { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--border); }
.my-review h3 { font-size: 1.02rem; margin: 0; }
.my-review p { margin: .2rem 0 .3rem; font-size: .92rem; }
.my-review-actions { display: flex; flex-direction: column; gap: .3rem; align-items: flex-end; }
.status { font-weight: 700; }
.status-pending { color: var(--warn); }
.status-rejected { color: var(--danger); }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .9rem; }
.activity li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- 16. Content pages ---------- */
.page-hero { padding: clamp(2.25rem, 6vw, 4rem) 0 1.5rem; }
.page-hero .lead { margin-left: 0; }
.prose { padding-bottom: 3.5rem; }
.prose section + section { margin-top: 2.25rem; }
.prose p, .prose li { color: var(--text-2); }
.prose li + li { margin-top: .35rem; }
.icon-list { list-style: none; padding: 0; display: grid; gap: .85rem; }
.icon-list li { display: flex; gap: .8rem; align-items: flex-start; }
.icon-list .icon { color: var(--brand); width: 1.4em; height: 1.4em; margin-top: .1em; }
.stat-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0 0 2.5rem; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: var(--border); }
.stat-band div { display: flex; flex-direction: column-reverse; padding: 1.15rem 1.25rem; background: var(--surface); }
.stat-band dt { font-size: .85rem; color: var(--muted); font-weight: 600; }
.stat-band dd { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.error-page { text-align: center; padding: 4rem 1rem 5rem; }
.error-code { font-size: .9rem; font-weight: 800; letter-spacing: .1em; color: var(--brand); margin-bottom: .25rem; }
.error-page .lead { margin-bottom: 2rem; }

/* ---------- 17. Footer ---------- */
.site-footer { margin-top: auto; background: var(--surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; }
.footer-brand p { color: var(--muted); max-width: 36ch; margin: .75rem 0 1rem; }
.footer-brand img { width: 150px; }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; }
.site-footer nav a, .site-footer .link-button { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); text-decoration: none; font-weight: 550; font-size: .92rem; }
.site-footer nav a:hover, .site-footer .link-button:hover { color: var(--brand); text-decoration: underline; }
.site-footer .link-button { text-decoration: none; padding: 0; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; }
.footer-base p { margin: 0; }
.footer-base a { color: inherit; }

/* ---------- 18. Accessibility panel (native <dialog>) ---------- */
.a11y-panel {
  width: min(440px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); display: none; flex-direction: column;
}
.a11y-panel[open] { display: flex; animation: slide-in .22s var(--ease); }
.a11y-panel::backdrop { background: rgba(10, 10, 14, .45); backdrop-filter: blur(2px); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.a11y-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid var(--border); }
.a11y-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.35rem; margin: 0 0 .25rem; }
.a11y-head h2 .icon { color: var(--brand); width: 1.3em; height: 1.3em; }
.a11y-head p { margin: 0; font-size: .88rem; color: var(--muted); }
.a11y-body { flex: 1; overflow-y: auto; padding: .5rem 1.25rem 1.25rem; overscroll-behavior: contain; }
.a11y-group { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.a11y-group:last-child { border-bottom: 0; }
.a11y-group > h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }
.a11y-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; margin: .5rem 0 .85rem; }
.a11y-row-label { font-weight: 650; font-size: .92rem; }
.a11y-row input[type="range"] { width: 100%; accent-color: var(--brand); min-height: 32px; }
.a11y-row output { font-weight: 800; min-width: 3ch; text-align: right; }
.a11y-note { font-size: .88rem; color: var(--muted); }
.a11y-tips dl { margin: 0; display: grid; gap: .45rem; font-size: .9rem; }
.a11y-tips dl div { display: flex; justify-content: space-between; gap: 1rem; }
.a11y-tips dd { margin: 0; color: var(--muted); text-align: right; }
.a11y-foot { display: flex; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }

/* Read-aloud highlight */
.tts-reading { outline: 3px dashed var(--brand) !important; outline-offset: 3px; background: var(--brand-soft) !important; }
.tts-indicator {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 900; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem;
  border-radius: 99px; background: var(--text); color: var(--surface); font-weight: 700; font-size: .85rem; box-shadow: var(--shadow-lg);
}
.tts-indicator button { background: none; border: 0; color: inherit; cursor: pointer; font-weight: 800; text-decoration: underline; min-height: 32px; }

/* ---------- 19. Accessibility modes ---------- */
.a11y-readable body, .a11y-readable button, .a11y-readable input, .a11y-readable select, .a11y-readable textarea { font-family: var(--font-readable); }
.a11y-readable h1, .a11y-readable h2, .a11y-readable h3 { letter-spacing: 0; }
.a11y-spacing body { letter-spacing: .06em; word-spacing: .16em; line-height: 1.9; }
.a11y-spacing p, .a11y-spacing li { margin-bottom: 1.1em; }
.a11y-spacing h1, .a11y-spacing h2, .a11y-spacing h3 { line-height: 1.45; letter-spacing: .02em; }

.a11y-links a:not(.btn):not(.chip):not(.cat-card) { text-decoration: underline !important; text-decoration-thickness: 2px !important; font-weight: 700; }
.a11y-links a { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 3px; }
.a11y-links .place-name a::after { display: none; }

.a11y-focus *:focus-visible { outline: 4px solid #000 !important; outline-offset: 2px !important; box-shadow: 0 0 0 8px #ffe600 !important; border-radius: 4px; }

.a11y-targets { --tap: 56px; }
.a11y-targets .btn { min-height: 56px; padding: .8em 1.4em; font-size: 1.02rem; }
.a11y-targets .btn-sm { min-height: 50px; }
.a11y-targets .pill > span, .a11y-targets .page-num, .a11y-targets .page-btn { min-height: 52px; min-width: 52px; }
.a11y-targets .check-box { width: 30px; height: 30px; }
.a11y-targets .check input { width: 30px; height: 30px; }
.a11y-targets .btn-row, .a11y-targets .place-actions, .a11y-targets .pill-group { gap: .85rem; }
.a11y-targets .input, .a11y-targets .select { min-height: 56px; }
.a11y-targets .sf-field input { min-height: 56px; }
.a11y-targets .place-name a::after { display: none; }   /* avoid accidental whole-card taps */
.a11y-targets .star-input label { width: 64px; height: 64px; }

.a11y-cursor, .a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1.2L16 21l-3 1.4-3.4-6.8L4 20z' fill='%23000' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 4, auto !important;
}
.a11y-cursor a, .a11y-cursor button, .a11y-cursor label, .a11y-cursor summary, .a11y-cursor select, .a11y-cursor [role="option"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1.2L16 21l-3 1.4-3.4-6.8L4 20z' fill='%23d6003b' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 6 4, pointer !important;
}

.a11y-motion *, .a11y-motion *::before, .a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* High contrast specifics */
.a11y-contrast body { background: #000; }
.a11y-contrast a { color: #ffe600; text-decoration: underline; }
.a11y-contrast .btn, .a11y-contrast .chip, .a11y-contrast .card, .a11y-contrast .place-card, .a11y-contrast .auth-card,
.a11y-contrast .cat-card, .a11y-contrast .step, .a11y-contrast .quote-card, .a11y-contrast .search-form, .a11y-contrast .filters-details,
.a11y-contrast .loc-hero, .a11y-contrast .input, .a11y-contrast .select, .a11y-contrast .pill > span, .a11y-contrast .badge,
.a11y-contrast .page-num, .a11y-contrast .page-btn, .a11y-contrast .flash, .a11y-contrast .notice, .a11y-contrast .cta-card,
.a11y-contrast .empty-state, .a11y-contrast .ad-placeholder, .a11y-contrast .check-box, .a11y-contrast .switch-track, .a11y-contrast .a11y-panel { border: 2px solid #fff !important; }
.a11y-contrast .btn-primary, .a11y-contrast .chip-strong, .a11y-contrast .page-num.is-current, .a11y-contrast .pill input:checked + span { background: #ffe600; color: #000; border-color: #ffe600 !important; }
.a11y-contrast .btn-primary:hover { background: #fff; color: #000; }
.a11y-contrast .btn-light { background: #ffe600; color: #000; }
.a11y-contrast .badge, .a11y-contrast .level, .a11y-contrast .amen-yes, .a11y-contrast .check-card:has(input:checked) { background: #000; color: #fff; }
.a11y-contrast .amen-yes .amen-state { color: #7dffb0; }
.a11y-contrast .site-header { background: #000; border-bottom: 2px solid #fff; }
.a11y-contrast .brand img, .a11y-contrast .footer-brand img { filter: brightness(0) invert(1); }
.a11y-contrast .feature-list li { border: 2px solid #fff; background: #000; }
.a11y-contrast .hist-bar, .a11y-contrast .sub-bar, .a11y-contrast .meter { border: 1px solid #fff; background: #000; }
.a11y-contrast .map .leaflet-tile-pane { filter: grayscale(1) contrast(1.25); }
.a11y-contrast .switch input:checked ~ .switch-track { background: #ffe600; }
.a11y-contrast .switch-thumb { background: #fff; }
.a11y-contrast .switch input:checked ~ .switch-track .switch-thumb { background: #000; }
.a11y-contrast .place-tile, .a11y-contrast .cat-icon, .a11y-contrast .avatar, .a11y-contrast .step-icon, .a11y-contrast .empty-icon, .a11y-contrast .auth-icon { border: 2px solid #fff; }
.a11y-contrast .pin { background: #ffe600; color: #000; border-color: #000; }

/* Dark theme: logo keeps brand red, map tiles dim slightly */
[data-theme="dark"] .map .leaflet-tile-pane { filter: brightness(.9); }

/* Results layout responds to its own width (container queries), so it adapts
   whether or not ad rails are taking space beside it. */
.results-wrap { container: results / inline-size; min-width: 0; }
@container results (max-width: 1100px) {
  .results-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .results-map { grid-column: 2; position: static; height: 360px; min-height: 0; order: -1; }
  .results-layout .filters { grid-column: 1; grid-row: 1 / span 2; }
}
@container results (max-width: 760px) {
  .results-layout { grid-template-columns: 1fr; }
  .results-layout .filters { position: static; max-height: none; grid-row: auto; }
  .results-map { display: none; grid-column: auto; order: 0; height: 60vh; }
  .view-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--bg-alt); margin-bottom: 1rem; }
  .search-page.show-map .results-map { display: flex; }
  .search-page.show-map .results-main .place-list, .search-page.show-map .results-main .pagination { display: none; }
}

/* ---------- Ad slots (results page) ----------
   Desktop ≥1280px: 160×600 rails left + right (sticky beside results, never over content).
   Below that: banner above and below the results — 320×50 / 320×100 on phones, 728×90 on tablets.
   Space is always reserved so nothing jumps when an ad loads. */
.ad-slot { display: block; text-align: center; }
.ad-label { display: block; margin-bottom: .3rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-box { position: relative; margin: 0 auto; overflow: hidden; border-radius: var(--radius-sm); }
.ad-box ins.adsbygoogle { margin: 0 auto; }
.ad-house { display: block; width: 100%; height: 100%; }
.ad-house img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; width: 100%; height: 100%;
  padding: .75rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text-2); text-decoration: none; text-align: center; line-height: 1.3;
}
.ad-placeholder:hover { border-color: var(--brand); color: var(--text); background: var(--brand-soft); }
.ad-placeholder .icon { color: var(--brand); width: 1.6rem; height: 1.6rem; }
.ad-ph-title { font-weight: 800; font-size: .95rem; color: var(--text); }
.ad-ph-text { font-size: .8rem; color: var(--muted); }
.ad-ph-cta { font-size: .8rem; font-weight: 750; color: var(--brand); text-decoration: underline; text-underline-offset: .18em; }

/* Banners (default: phones) */
.ad-banner { margin: 1rem auto; max-width: 100%; }
.ad-top { margin-top: 0; padding-top: 1rem; }
.ad-bottom { margin-top: 2.5rem; }
.ad-banner .ad-box { width: 100%; max-width: 320px; height: 50px; }
.ad-bottom .ad-box { height: 100px; }
.ad-banner .ad-placeholder { flex-direction: row; flex-wrap: wrap; gap: .1rem .6rem; padding: .3rem .75rem; }
.ad-banner .ad-placeholder .icon { width: 1.15rem; height: 1.15rem; }
.ad-top .ad-ph-text { display: none; }
.search-page.has-ads { padding-top: 0; }
.search-page.has-ads .results-head { margin-top: .5rem; }
@media (min-width: 641px) {
  .ad-banner .ad-box, .ad-bottom .ad-box { max-width: 728px; height: 90px; }
  .ad-top .ad-ph-text { display: inline; }
}

/* Narrow desktops / tablets: header search gets its own row so it stays usable */
@media (max-width: 1100px) {
  .header-inner { flex-wrap: wrap; gap: .5rem 1rem; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; padding-bottom: .25rem; }
}

/* Rails (desktop) */
.ad-rail { display: none; }
@media (min-width: 1280px) {
  html:not(.text-2):not(.text-3) .search-page.has-ads { max-width: 1880px; padding-top: 1.5rem; }
  html:not(.text-2):not(.text-3) .has-ads .ad-banner { display: none; }
  html:not(.text-2):not(.text-3) .has-ads .ad-shell { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 1.5rem; align-items: start; }
  html:not(.text-2):not(.text-3) .has-ads .results-wrap { grid-column: 2; grid-row: 1; }
  html:not(.text-2):not(.text-3) .has-ads .ad-rail { display: block; position: sticky; top: calc(var(--header-h) + 1rem); grid-row: 1; }
  .ad-rail-left { grid-column: 1; }
  .ad-rail-right { grid-column: 3; }
  .ad-rail .ad-box { width: 160px; height: 600px; }
}

/* Large text sizes: give the header search its own row */
.text-2 .header-inner, .text-3 .header-inner { flex-wrap: wrap; gap: .5rem 1rem; }
.text-2 .header-search, .text-3 .header-search { order: 3; flex-basis: 100%; max-width: none; padding-bottom: .25rem; }
.text-3 .results-layout { grid-template-columns: 1fr; }
.text-3 .results-layout .filters { position: static; max-height: none; }
.text-3 .results-map { position: static; height: 50vh; }

/* ---------- 20. Responsive ---------- */
@media (max-width: 960px) {
  .hide-md { display: none; }
  .show-md-sr { display: inline; }
  .header-inner { flex-wrap: wrap; gap: .5rem 1rem; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; padding-bottom: .25rem; }
  .btn-a11y { padding: .4rem !important; width: var(--tap); justify-content: center; }
  .a11y-band-inner { grid-template-columns: 1fr; }
  .loc-hero, .loc-grid, .account-grid, .review-layout { grid-template-columns: 1fr; }
  .tips-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .cta-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}
@media (max-width: 640px) {
  :root { --header-h: 112px; }
  .hide-sm { display: none !important; }
  .show-sm { display: inline-block; }
  .show-sm-sr { display: inline; }
  .brand img { width: 140px; }
  .nav-signin span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .search-hero { flex-direction: column; border-radius: 20px; padding: .4rem; }
  .search-hero .sf-field + .sf-field::before { left: 1rem; right: 1rem; top: 0; bottom: auto; width: auto; height: 1px; }
  .search-hero .sf-submit { width: 100%; margin-top: .25rem; }
  .search-compact .sf-mic { display: none; }
  .search-hero .sf-locate-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .feature-list { grid-template-columns: 1fr; }
  .place-card { grid-template-columns: auto 1fr; grid-template-areas: "tile body" "actions actions"; padding: 1rem; }
  .place-tile { width: 48px; height: 48px; border-radius: 14px; }
  .place-tile .icon { width: 22px; height: 22px; }
  .place-actions .btn { flex: 1; }
  .loc-rating { flex-wrap: wrap; }
  .loc-hero .btn-row .btn { flex: 1 1 100%; }
  .detail-row { grid-template-columns: 1fr; gap: .4rem; }
  .subscores li { grid-template-columns: auto 1fr 2.5rem; }
  .subscores .sub-bar { grid-column: 2 / 4; grid-row: 2; }
  .star-input label { width: 48px; height: 48px; }
  .star-input label .icon { width: 36px; height: 36px; }
  .footer-grid { grid-template-columns: 1fr; }
  .my-review { flex-direction: column; }
  .my-review-actions { flex-direction: row; align-items: center; }
  .acct-signout { margin-left: 0; }
  .a11y-panel { width: 100vw; }
}


/* ---------- Security highlights ---------- */
.trust-strip {
  display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem 1.1rem; margin: 1.5rem auto 0;
  padding: .55rem 1.1rem; border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); font-size: .86rem; font-weight: 700; text-decoration: none;
}
.trust-strip:hover { color: var(--ok); border-color: var(--ok); }
.trust-strip span { display: inline-flex; align-items: center; gap: .35rem; }
.trust-strip .trust-more { color: var(--text-2); text-decoration: underline; text-underline-offset: .18em; }
.trust-strip .icon { width: 1.05em; height: 1.05em; }
.auth-trust a { color: inherit; font-weight: 700; }
.sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 0 0 2.5rem; }
.sec-grid li { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.sec-grid li > span:last-child { font-size: .85rem; color: var(--muted); }
.sec-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--ok-soft); color: var(--ok); margin-bottom: .45rem; flex: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.sec-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
.sec-table th, .sec-table td { padding: .7rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.sec-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.sec-table tbody tr:last-child > * { border-bottom: 0; }
.sec-table td:last-child { color: var(--text-2); }
.sec-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 99px; font-weight: 750; font-size: .8rem; white-space: nowrap; }
.sec-pill .icon { width: 1em; height: 1em; }
.sec-pill-ok { background: var(--ok-soft); color: var(--ok); }
.sec-pill-muted { background: var(--bg-alt); color: var(--text-2); }
.attack-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.attack-list li { display: flex; gap: .9rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 !important; }
.attack-list h3 { font-size: 1rem; margin: 0 0 .2rem; }
.attack-list p { margin: 0; font-size: .92rem; }
.sec-checklist { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .55rem; font-size: .9rem; }
.sec-checklist li { display: flex; gap: .55rem; align-items: flex-start; color: var(--text-2); }
.sec-checklist .icon { color: var(--ok); margin-top: .15em; stroke-width: 3; }
.sec-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; border-top: 1px solid var(--border); }
.sec-row h3 { margin: 0; font-size: 1rem; }
.sec-row p { margin: .1rem 0 0; font-size: .9rem; }
.sec-details { border-top: 1px solid var(--border); padding: .25rem 0; }
.sec-details > summary { display: flex; align-items: center; gap: .5rem; min-height: var(--tap); font-weight: 700; cursor: pointer; }
.sec-details > summary .icon { color: var(--muted); }
.sec-details .form { padding: .25rem 0 1rem; }
.sec-danger > summary { color: var(--danger); }
.sec-danger > summary .icon { color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.card > h2 .icon { color: var(--ok); }
.a11y-contrast .trust-strip, .a11y-contrast .sec-grid li, .a11y-contrast .attack-list li, .a11y-contrast .table-wrap { border: 2px solid #fff; background: #000; color: #fff; }
.a11y-contrast .btn-danger-solid { background: #ff9b9b; color: #000; }

.iso-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: .75rem; margin: 0 0 1rem; }
.iso-box { padding: 1.1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.iso-box h3 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin: 0 0 .35rem; }
.iso-box h3 .icon { color: var(--ok); }
.iso-box p { margin: 0; font-size: .92rem; }
.a11y-contrast .iso-box { border: 2px solid #fff; background: #000; }

/* ---------- 21. Print ---------- */
@media print {
  .site-header, .site-footer, .a11y-panel, .filters, .results-map, .map, .btn, .pagination, .skip-link, .ad-slot { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .place-card, .loc-hero { border: 1px solid #999; box-shadow: none; }
}

/* ------------------------------------------------------------------
   "Where are you?" (/here), add business, approvals
   ------------------------------------------------------------------ */
.lead-sm { color: var(--text-2); max-width: 62ch; margin: .25rem 0 0; }
.here-page, .games-page, .game-page, .pending-page { padding-block: clamp(1.25rem, 3vw, 2.25rem) 3rem; }
.here-head { margin-bottom: 1.25rem; }
.here-head h1 { margin: .2rem 0 0; }
.here-locate { display: grid; gap: 1rem; max-width: 640px; }
.here-locate p { margin: 0; }
.here-where { display: grid; gap: .4rem; }
.inline-field { display: flex; gap: .5rem; }
.inline-field .input { flex: 1; min-width: 0; }
.here-origin { margin: 0 0 1rem; }
.here-at { margin-bottom: 1.5rem; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.here-at-kicker { margin: 0; color: var(--muted); font-weight: 600; }
.here-at-name { margin: .1rem 0 .4rem; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.here-at-name a { color: inherit; text-decoration: none; }
.here-at-name a:hover { text-decoration: underline; }
.here-at-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--text-2); margin: 0 0 1rem; }
.here-at-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.here-actions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.here-action {
  display: flex; align-items: center; gap: .85rem; min-height: 76px; padding: .9rem 1rem; border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed);
}
.here-action:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.here-action-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.here-action-icon .icon { width: 24px; height: 24px; }
.here-action-text { display: grid; gap: .1rem; }
.here-action-text span { color: var(--muted); font-size: .9rem; }
.here-action-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.here-action-primary .here-action-icon { background: color-mix(in srgb, var(--brand-ink) 18%, transparent); color: var(--brand-ink); }
.here-action-primary .here-action-text span { color: var(--brand-ink); }
.here-action-primary:hover { background: var(--brand-hover); }
.here-list h2 { margin-bottom: .2rem; }
.here-choices { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; gap: .5rem; }
.here-choice { display: flex; align-items: center; gap: .85rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.here-choice.is-at { border-color: var(--brand); }
.here-choice-text { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.here-choice-text .muted { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here-choice-current { display: inline-flex; align-items: center; gap: .3rem; color: var(--brand); font-weight: 700; font-size: .9rem; }
.place-tile.place-tile-sm { width: 42px; height: 42px; border-radius: 12px; flex: none; }
.place-tile.place-tile-sm .icon { width: 20px; height: 20px; }
.here-missing { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: var(--bg-alt); }
.here-missing h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .25rem; font-size: 1.1rem; }
.here-missing p { margin: 0; color: var(--text-2); }
.notice-pending { margin-bottom: 1rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.field-row > .field { flex: 0 1 180px; }
.field-row > .field.grow { flex: 1 1 220px; }
.field-row > .field.narrow { flex: 0 1 130px; }
.more-details { margin: .5rem 0 1.25rem; }
.more-details > summary { cursor: pointer; font-weight: 700; padding: .5rem 0; min-height: var(--tap); }
.tips-sub { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.tips-plain { list-style: none; padding: 0; }
.tips-plain a { display: inline-flex; align-items: center; gap: .35rem; }
.pending-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .75rem; }
.pending-item { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.pending-name { font-size: 1.15rem; margin: 0 0 .25rem; }
.pending-item p { margin: .2rem 0; }

/* ------------------------------------------------------------------
   Games
   ------------------------------------------------------------------ */
.games-head { margin-bottom: 1.5rem; }
.games-at { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.game-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
.game-tile { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed); }
.game-tile:hover, .game-tile:focus-within { border-color: var(--brand); box-shadow: var(--shadow); }
.game-tile-art { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.game-tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.game-tile:hover .game-tile-art img { transform: scale(1.04); }
.game-tile-tag { position: absolute; top: .6rem; left: .6rem; padding: .15rem .6rem; border-radius: var(--radius-pill); background: rgba(23, 23, 28, .78); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.game-tile-body { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem 1.15rem; flex: 1; }
.game-tile-title { font-size: 1.15rem; margin: 0; }
.game-tile-desc { margin: 0; color: var(--text-2); font-size: .95rem; flex: 1; }
.game-tile-meta { margin: 0; display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; }
.game-tile-meta .icon { width: 15px; height: 15px; }
.game-tile-play { align-self: flex-start; margin-top: .35rem; }
@media (prefers-reduced-motion: reduce) { .game-tile-art img { transition: none; } }
.a11y-motion .game-tile:hover .game-tile-art img { transform: none; }
.game-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.game-card {
  display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: start; height: 100%; padding: 1rem; color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); transition: border-color var(--speed), box-shadow var(--speed);
}
.game-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.game-card-art { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); }
.game-card-art .icon { width: 34px; height: 34px; }
.game-art-merge { background: var(--warn-soft); color: var(--warn); }
.game-art-mines { background: var(--info-soft); color: var(--info); }
.game-art-snake { background: var(--ok-soft); color: var(--ok); }
.game-art-sudoku { background: var(--surface-2); color: var(--text); }
.game-card-body { display: grid; gap: .3rem; }
.game-card-title { font-size: 1.1rem; }
.game-card-blurb { color: var(--text-2); font-size: .95rem; }
.game-card-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; }
.game-card-meta .icon { width: 15px; height: 15px; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.game-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.game-top h1 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.game-stats { display: flex; gap: .5rem; margin: 0; }
.game-stats div { min-width: 92px; padding: .4rem .8rem; border-radius: var(--radius); background: var(--surface-2); text-align: center; }
.game-stats dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.game-stats dd { margin: 0; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.game-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .5rem; min-height: 0; }
.game-toolbar:empty { margin: .5rem 0 0; }
.select-sm { min-height: 38px; padding-block: .3rem; width: auto; }
.game-root { display: grid; justify-items: center; gap: 1rem; margin-top: .5rem; }
.game-status { min-height: 1.6em; margin: .75rem 0; font-weight: 600; text-align: center; color: var(--text-2); }
.game-buttons { justify-content: center; }
.game-root button { font: inherit; }

/* Memory */
.mm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; width: min(100%, 440px); }
.mm-card {
  position: relative; aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--border-strong); background: var(--brand); color: var(--brand-ink);
  cursor: pointer; font-size: clamp(1.6rem, 6vw, 2.4rem); display: grid; place-items: center; transition: transform var(--speed), background var(--speed);
}
.mm-card .mm-face { display: none; }
.mm-card.is-open, .mm-card.is-matched { background: var(--surface); color: var(--text); }
.mm-card.is-open .mm-face, .mm-card.is-matched .mm-face { display: block; }
.mm-card.is-open .mm-back, .mm-card.is-matched .mm-back { display: none; }
.mm-card.is-matched { border-color: var(--ok); background: var(--ok-soft); }
.mm-back { font-weight: 800; opacity: .8; }

/* Merge tiles */
.mt-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 400px); aspect-ratio: 1; padding: 8px; border-radius: 16px; background: var(--surface-2); touch-action: none; }
.mt-cell { display: grid; place-items: center; border-radius: 10px; background: var(--bg-alt); font-weight: 800; font-size: clamp(1.1rem, 5vw, 1.9rem); font-variant-numeric: tabular-nums; color: #17171c; }
.mt-v2 { background: #fde8ec; } .mt-v4 { background: #fbd3dc; } .mt-v8 { background: #f9b3c3; } .mt-v16 { background: #f68aa3; }
.mt-v32 { background: #f05d80; color: #fff; } .mt-v64 { background: #e3305b; color: #fff; } .mt-v128 { background: #c41848; color: #fff; font-size: clamp(1rem, 4.5vw, 1.6rem); }
.mt-v256 { background: #a70f3b; color: #fff; font-size: clamp(1rem, 4.5vw, 1.6rem); } .mt-v512 { background: #8a0c31; color: #fff; font-size: clamp(1rem, 4.5vw, 1.6rem); }
.mt-v1024, .mt-v2048, .mt-v4096 { background: #5b0820; color: #fff; font-size: clamp(.9rem, 3.8vw, 1.35rem); }
.mt-cell.is-merged { animation: mt-pop .18s var(--ease); }
@keyframes mt-pop { 50% { transform: scale(1.12); } }
.dpad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: 6px; justify-content: center; }
.dpad button { border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.dpad .dpad-up { grid-column: 2; grid-row: 1; } .dpad .dpad-left { grid-column: 1; grid-row: 2; }
.dpad .dpad-down { grid-column: 2; grid-row: 2; } .dpad .dpad-right { grid-column: 3; grid-row: 2; }

/* Mine sweep */
.ms-grid { --cols: 9; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 3px; width: min(100%, calc(var(--cols) * 42px)); }
.ms-grid { --n1: #1d4ed8; --n2: #15803d; --n3: #b91c1c; --n4: #6d28d9; --n5: #9a3412; --covered: color-mix(in srgb, var(--text) 16%, var(--surface)); }
.ms-cell { aspect-ratio: 1; min-width: 0; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--covered);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--text) 18%, transparent); color: var(--text); font-weight: 800; cursor: pointer; padding: 0; font-size: clamp(.8rem, 3.2vw, 1.1rem); }
.ms-cell.is-open { background: var(--surface); border-color: var(--border); box-shadow: none; cursor: default; }
.ms-cell.is-flag { color: var(--brand); }
.ms-cell[data-n="1"] { color: var(--n1); } .ms-cell[data-n="2"] { color: var(--n2); } .ms-cell[data-n="3"] { color: var(--n3); }
.ms-cell[data-n="4"] { color: var(--n4); } .ms-cell[data-n="5"] { color: var(--n5); } .ms-cell[data-n="mine"] { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ms-grid { --n1: #8db8ff; --n2: #5fd39a; --n3: #ff8a80; --n4: #c4a5ff; --n5: #ffb36b; } }
:root[data-theme="dark"] .ms-grid { --n1: #8db8ff; --n2: #5fd39a; --n3: #ff8a80; --n4: #c4a5ff; --n5: #ffb36b; }
.ms-cell.is-boom { background: var(--danger); color: #fff; }

/* Snake */
.sn-canvas { width: min(100%, 360px); height: auto; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--border-strong); touch-action: none; image-rendering: pixelated; }

/* Sudoku */
.sd-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); width: min(100%, 450px); border: 3px solid var(--text); border-radius: 6px; overflow: hidden; }
.sd-cell { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); background: var(--surface); color: var(--info); font-size: clamp(1rem, 4.2vw, 1.45rem); font-weight: 700; cursor: pointer; }
.sd-cell.is-given { color: var(--text); font-weight: 800; }
.sd-cell.sd-rb { border-right: 2px solid var(--text); }
.sd-cell.sd-bb { border-bottom: 2px solid var(--text); }
.sd-cell.is-same { background: var(--info-soft); }
.sd-cell.is-sel { background: var(--brand-soft-2); box-shadow: inset 0 0 0 3px var(--brand); }
.sd-cell.is-wrong { color: var(--danger); background: var(--danger-soft); }
.sd-pad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: min(100%, 450px); }
.sd-pad button { min-height: 48px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.15rem; font-weight: 700; cursor: pointer; }

/* Tic-tac-toe */
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 330px); }
.ttt-cell { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--border-strong); background: var(--surface); font-size: clamp(2.2rem, 12vw, 3.6rem); font-weight: 800; cursor: pointer; color: var(--text); }
.ttt-cell[data-p="X"] { color: var(--brand); } .ttt-cell[data-p="O"] { color: var(--info); }
.ttt-cell.is-line { background: var(--ok-soft); border-color: var(--ok); }

.mm-card:hover, .ms-cell:not(.is-open):hover, .sd-cell:hover, .ttt-cell:hover, .dpad button:hover, .sd-pad button:hover { border-color: var(--brand); }

@media (max-width: 960px) {
  .game-layout { grid-template-columns: 1fr; }
  .here-actions { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .here-choice { flex-wrap: wrap; }
  .here-choice .btn { margin-left: auto; }
  .inline-field { flex-direction: column; }
}

/* Flutter Duck / Hallway Dash */
.fl-canvas, .hd-canvas { width: min(100%, 360px); height: auto; border-radius: 14px; border: 2px solid var(--border-strong); touch-action: none; cursor: pointer; display: block; }
.fl-canvas { aspect-ratio: 360 / 540; }
.hd-canvas { aspect-ratio: 360 / 560; }
.hd-pad { display: grid; grid-template-columns: repeat(4, 64px); gap: 8px; justify-content: center; }
.hd-pad button { min-height: 52px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; }
.hd-pad button:hover { border-color: var(--brand); }

/* Continue with Google (Google's light button style: white, grey border, dark text) */
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #747775; font-weight: 600; gap: .65rem; }
.btn-google:hover { background: #f3f6fc; color: #1f1f1f; border-color: #1f1f1f; }
.btn-google-logo { width: 20px; height: 20px; flex: none; }
.auth-or { display: flex; align-items: center; gap: .8rem; margin: 1.25rem 0; color: var(--muted); font-size: .9rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.connected-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-content: space-between; }
.connected-row p { margin: 0; }
.connected-name { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.a11y-contrast .btn-google { background: #fff; color: #000; border-color: #fff !important; text-decoration: none; }
.a11y-contrast .btn-google:hover { background: #ffe600; color: #000; }

/* Four in a Row */
.c4 { display: grid; justify-items: center; gap: .75rem; width: 100%; }
.c4-board { --c4-frame: #24345a; --c4-hole: var(--surface); display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; width: min(100%, 540px); padding: 8px; border-radius: 18px; background: var(--c4-frame); box-shadow: 0 10px 0 -2px #1a2744, var(--shadow); }
.c4-col { display: flex; flex-direction: column; gap: 4px; padding: 4px 3px; margin: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; min-width: 0; }
.c4-col:hover, .c4-col:focus-visible { background: rgba(255, 255, 255, .14); }
.c4-col:focus-visible { outline: 3px solid #fff; outline-offset: 1px; box-shadow: 0 0 0 6px var(--focus); }
.c4-col[aria-disabled="true"] { cursor: default; }
.c4-board.is-thinking, .c4-board.is-thinking .c4-col { cursor: progress; }
.c4-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: var(--c4-hole); box-shadow: inset 0 3px 5px rgba(0, 0, 0, .35); }
.c4-disc { position: relative; display: block; width: 86%; height: 86%; border-radius: 50%; }
.c4-p1 { background: radial-gradient(circle at 35% 30%, #ff6b88, #d1003a 60%, #a3002c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.c4-p2 { background: radial-gradient(circle at 35% 30%, #ffe58a, #f5b301 60%, #c48a00); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.c4-p2::after { content: ""; position: absolute; inset: 24%; border-radius: 50%; border: 3px solid rgba(110, 70, 0, .6); }   /* a ring, so the two colours differ in shape too */
.c4-board[data-next="1"] .c4-col:not([aria-disabled="true"]):hover .is-next::before,
.c4-board[data-next="2"] .c4-col:not([aria-disabled="true"]):hover .is-next::before,
.c4-board[data-next="1"] .c4-col:not([aria-disabled="true"]):focus-visible .is-next::before,
.c4-board[data-next="2"] .c4-col:not([aria-disabled="true"]):focus-visible .is-next::before { content: ""; width: 86%; height: 86%; border-radius: 50%; opacity: .45; }
.c4-board[data-next="1"] .is-next::before { background: #d1003a; }
.c4-board[data-next="2"] .is-next::before { background: #f5b301; }
.c4-disc.is-last::before { content: ""; position: absolute; inset: 40%; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .45); z-index: 1; }
.c4-disc.is-win { box-shadow: 0 0 0 3px #fff, 0 0 0 6px #0f7a46; animation: c4-glow 1s ease-in-out infinite alternate; z-index: 1; }
.c4-disc.is-dropping { animation: c4-drop calc(var(--fall, 1) * 45ms + 140ms) cubic-bezier(.45, 0, .9, .6); z-index: 2; }
@keyframes c4-drop { from { transform: translateY(calc(var(--fall, 1) * -118%)); } to { transform: none; } }
@keyframes c4-glow { to { box-shadow: 0 0 0 3px #fff, 0 0 0 8px #0f7a46; } }
@media (prefers-reduced-motion: reduce) { .c4-disc.is-dropping, .c4-disc.is-win { animation: none; } }
.a11y-motion .c4-disc.is-dropping, .a11y-motion .c4-disc.is-win { animation: none; }
.c4-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.25rem; margin: 0; color: var(--text-2); font-size: .92rem; }
.c4-key { display: inline-flex; align-items: center; gap: .45rem; }
.c4-key .c4-disc { width: 20px; height: 20px; }
.c4-key .c4-p2::after { inset: 22%; border-width: 2px; }
.a11y-contrast .c4-board { --c4-frame: #000; --c4-hole: #000; border: 2px solid #fff; box-shadow: none; }
.a11y-contrast .c4-cell { box-shadow: inset 0 0 0 2px #fff; }
.a11y-contrast .c4-p1 { background: #ff6b88; }
.a11y-contrast .c4-p2 { background: #ffe600; }
