/* SB12 Daily - wide two-column layout: dark top bar, Don't-miss banner, photo hero, section cards,
   schedule + sidebar. Large type and high contrast for older eyes; dark mode supported. */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --ink: #172230;
    --muted: #55616f;
    --line: #dfe3e8;
    --bar: #13283d;
    --bar-ink: #ffffff;
    --bar-muted: #d2dde7;
    --accent: #b4471a;            /* sunset clay: times, active items */
    --accent-ink: #ffffff;
    --banner: #f2a65a;
    --banner-ink: #2a1606;
    --hero: #2b4157;
    --sb1: #1f5f9e;
    --sb1-soft: #e3eef9;
    --sb2: #2f7a4b;
    --sb2-soft: #e2f3e8;
    --warn-bg: #fff4d6;
    --warn-ink: #6b4b00;
    --radius: 14px;
    --gutter: 16px;
    --head: "Outfit", system-ui, sans-serif;
}

/* Theme: "System" (no data-theme) follows the device; the Theme menu sets data-theme="light"|"dark" on <html>.
   The dark tokens appear twice - once for System on a dark device, once for an explicit Dark choice. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #12161b;
    --surface: #1b2129;
    --ink: #eef1f4;
    --muted: #aab4bf;
    --line: #303842;
    --bar: #0b1824;
    --bar-muted: #b9c6d2;
    --accent: #f08a5d;
    --accent-ink: #1a0b04;
    --banner: #c9772f;
    --banner-ink: #1a0b04;
    --hero: #1f2f40;
    --sb1: #8bbcef;
    --sb1-soft: #1c2c3d;
    --sb2: #84cfa2;
    --sb2-soft: #1a3324;
    --warn-bg: #3a2f12;
    --warn-ink: #f5d98a;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #12161b;
        --surface: #1b2129;
        --ink: #eef1f4;
        --muted: #aab4bf;
        --line: #303842;
        --bar: #0b1824;
        --bar-muted: #b9c6d2;
        --accent: #f08a5d;
        --accent-ink: #1a0b04;
        --banner: #c9772f;
        --banner-ink: #1a0b04;
        --hero: #1f2f40;
        --sb1: #8bbcef;
        --sb1-soft: #1c2c3d;
        --sb2: #84cfa2;
        --sb2-soft: #1a3324;
        --warn-bg: #3a2f12;
        --warn-ink: #f5d98a;
    }
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }   /* 18px base */
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }

.wrap { max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 24px; } }

/* Top bar */
/* The top bar is pinned to the top of the screen; the page starts below it. */
:root { --bar-h: 64px; --bar-total: var(--bar-h); }
.topbar { background: var(--bar); color: var(--bar-ink); position: fixed; top: 0; left: 0; right: 0; z-index: 40; }
body { padding-top: var(--bar-total); }
/* Links to an event on the page (#e-...) stop below the top bar. */
html { scroll-padding-top: calc(var(--bar-total) + 12px); }
.topbar-in { display: flex; flex-wrap: nowrap; align-items: center; gap: 12px; height: var(--bar-h); }
.bar-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 700; font-size: 1.45rem; color: var(--bar-ink); text-decoration: none; letter-spacing: -0.01em; }
.logo img { width: 28px; height: 28px; flex: none; }
/* Member logins are a convenience, not a call to action: quiet text links that brighten on hover. */
.logins { display: flex; gap: 2px; align-items: center; }
.login { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: 8px; font-weight: 500; font-size: 0.85rem; text-decoration: none; color: var(--bar-muted); }
.login:hover { color: var(--bar-ink); text-decoration: underline; text-underline-offset: 3px; }
/* "SaddleBrooke" as plain text, then the two HOA site links close beside it. */
.login-label { font-weight: 500; font-size: 0.85rem; color: var(--bar-muted); padding: 8px 2px 8px 10px; opacity: 0.8; }
.login-hoa { padding-left: 6px; padding-right: 6px; }
.login:focus-visible { outline: 3px solid #f2a65a; outline-offset: 0; color: var(--bar-ink); }

/* Theme menu (in the top bar) */
.theme-menu { position: relative; }
.theme-menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--bar-muted); cursor: pointer; }
.theme-menu > summary:hover { color: var(--bar-ink); background: rgba(255,255,255,0.1); }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu > summary:focus-visible { outline: 3px solid #f2a65a; outline-offset: 2px; }
.theme-menu[open] > summary { background: rgba(255,255,255,0.14); }
.theme-options { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.22); display: flex; flex-direction: column; }
.theme-options button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; }
.theme-options button:hover { background: var(--bg); }
.theme-options button[aria-checked="true"] { font-weight: 700; }
.theme-options button[aria-checked="true"]::after { content: ""; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--accent); }

/* Don't miss banner */
.dontmiss { background: var(--banner); color: var(--banner-ink); }
.dontmiss-in { display: flex; flex-wrap: wrap; gap: 6px 26px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
.dontmiss .tag { display: inline-block; margin-right: 6px; padding: 0 6px; border: 1px solid currentColor; border-radius: 5px; font-size: 0.72rem; font-weight: 700; vertical-align: 1px; }
.dontmiss-label { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; }

/* Hero - illustrated desert sunset (same idea as the SB1 Villas site): a brown-to-sand sunset gradient,
   the Catalinas-and-plants silhouette on the right, faint grain, and a curved edge into the page. */
.hero { position: relative; color: #ffffff; min-height: 440px; display: flex; align-items: center; overflow: hidden; }
.hero-art {
    background:
        /* Saguaro Sun: the art is 5:1 with the scene at its right edge and sky + ground running left,
           so scaling it to the hero's height keeps the saguaro in view at every width. */
        url('/images/hero-saguaro.svg') right bottom / auto 100% no-repeat,
        #13283d;
}
/* Shade + grain behind the text so white and sand lettering stays readable over the bright part of the sunset. */
.hero-art::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
        linear-gradient(90deg, rgba(10,22,34,0.55) 0%, rgba(10,22,34,0.25) 40%, rgba(10,22,34,0) 62%);
}
.hero-photo { background: var(--hero); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-photo::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8,18,28,0.75), rgba(8,18,28,0.2) 70%); }
/* Curved bottom edge melting into the page background (follows light/dark theme). */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 64px; background: var(--bg); clip-path: ellipse(58% 100% at 50% 100%); z-index: 1; }
.hero-in { position: relative; z-index: 2; width: 100%; padding-top: 52px; padding-bottom: 84px; }
/* Venues button sitting in the middle of the curved edge (also in the top bar and the menu). */
.hero-buttons { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; white-space: nowrap; }
.hero-venues { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
               background: #13283d; color: #ffffff; border: 2px solid #f2a65a; border-radius: 999px;
               font-weight: 600; font-size: 0.92rem; text-decoration: none; box-shadow: 0 4px 12px rgba(8,18,28,0.25); }
.hero-venues svg { color: #f2a65a; }
.hero-venues:hover { background: #1d3a56; }
.hero-venues:focus-visible { outline: 3px solid #f2a65a; outline-offset: 2px; }
@media (max-width: 640px) {
    /* Phones: a light desert brown curve, set apart from the Don't miss strip right under it. */
    .hero::after { background: #c4a685; }
    .hero-buttons { bottom: 10px; gap: 8px; }
    .hero-venues { min-height: 36px; padding: 0 14px; font-size: 0.85rem; }
}
.hero-eyebrow { margin: 0 0 10px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #f1e2c6; }
.hero h1 { margin: 0 0 6px; font-family: var(--head); font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.02em; text-shadow: 0 2px 20px rgba(10,22,34,0.45); }
.hero h1 span { color: #f1e2c6; }
.hero-date { margin: 0 0 20px; font-size: 1.15rem; color: #f5ede0; }
@media (max-width: 640px) {
    /* Phones: text sits over the art, so the shade runs top to bottom instead of left to right. */
    .hero-art::before { background: linear-gradient(180deg, rgba(10,22,34,0.62) 0%, rgba(10,22,34,0.35) 50%, rgba(10,22,34,0) 75%); }
}
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }
/* Home hero: heading at the top, tonight's pills sitting on the bottom (just above the curve and buttons), so when one
   drops off after it starts the rest stay put instead of shifting up. */
.home-hero { align-items: stretch; }
.home-hero .hero-in { display: flex; flex-direction: column; }
.home-hero .hero-links { margin-top: auto; }
.hero-link { display: inline-flex; gap: 10px; align-items: baseline; background: #ffffff; color: #13283d; text-decoration: none; padding: 12px 16px; border-radius: 10px; font-weight: 600; min-height: 44px; }
.hero-link span { color: #b4471a; font-weight: 700; }

/* Section cards */
.cards-area { padding-top: 28px; }
.section-h { font-family: var(--head); font-size: 1.5rem; margin: 0 0 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); min-height: 132px; }
.card:hover { border-color: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.card-title { font-family: var(--head); font-size: 1.25rem; font-weight: 600; }
.card-count { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.card-next-label { font-size: 0.85rem; color: var(--muted); }
.card-next { font-weight: 600; }

/* Two columns */
.columns { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-top: 28px; padding-bottom: 40px; }
.main-col { flex: 999 1 560px; min-width: 0; }
.side-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.page-h { font-family: var(--head); font-size: 2rem; margin: 0 0 12px; }

.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { flex: 1; max-width: 220px; text-align: center; padding: 11px; border-radius: 10px; text-decoration: none; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-size: 0.88rem; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.empty { opacity: 0.55; }
.chip .count { font-size: 0.72rem; opacity: 0.8; }
.chips.sub .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; align-self: flex-start; background: var(--surface); }
.seg a { padding: 8px 14px; text-decoration: none; color: var(--ink); font-size: 0.88rem; min-height: 44px; display: inline-flex; align-items: center; }
.seg a + a { border-left: 1px solid var(--line); }
.seg a.on { background: var(--ink); color: var(--bg); }

/* Restaurant card */
.place-card { display: flex; flex-wrap: wrap; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.place-photo { width: 200px; height: 130px; object-fit: cover; border-radius: 10px; }
.place-card h2 { margin: 0 0 4px; font-family: var(--head); font-size: 1.2rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.place-card p { margin: 4px 0; color: var(--muted); }
.place-links { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 600; }
.place-links a { min-height: 44px; display: inline-flex; align-items: center; }

/* Days + events */
.day { margin-bottom: 22px; }
.day-head { font-family: var(--head); font-size: 1.3rem; margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
.day-head span { color: var(--muted); font-weight: 500; font-size: 0.95rem; font-family: "Inter", sans-serif; }
.event { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; scroll-margin-top: 16px; }
.when { font-weight: 700; font-size: 0.95rem; color: var(--accent); }
.what { min-width: 0; }
.what h3 { margin: 0 0 4px; font-size: 1.12rem; line-height: 1.3; }
.meta { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 0.9rem; align-items: center; }
.price { color: var(--ink); font-weight: 600; }
.venue { color: var(--ink); font-weight: 500; }
.venue::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-right: 0.4em; border-radius: 50%; background: var(--accent); vertical-align: 0.1em; }
.desc { margin: 0 0 6px; }
.warn { margin: 6px 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 0.9rem; }
.source { font-size: 0.85rem; }
.flyer { position: relative; display: block; width: 150px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); cursor: zoom-in; align-self: start; }
.flyer img { display: block; width: 100%; height: auto; }
.flyer-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-size: 0.72rem; font-weight: 600; text-align: center; color: #ffffff; background: rgba(12,22,34,0.72); }

.badge { display: inline-block; margin-right: 6px; vertical-align: 2px; padding: 1px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 700; }
.badge.hoa1 { background: var(--sb1-soft); color: var(--sb1); }
.badge.hoa2 { background: var(--sb2-soft); color: var(--sb2); }
.badge.both { background: var(--line); color: var(--ink); }

.empty-state { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); }
.updated { color: var(--muted); font-size: 0.85rem; text-align: center; }

/* Sidebar panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel h2 { font-family: var(--head); font-size: 1.15rem; margin: 0 0 10px; }
.panel-row { display: flex; flex-direction: column; padding: 8px 0; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); min-height: 44px; }
.panel-row:first-of-type { border-top: 0; }
.panel-row:hover .panel-row-title { color: var(--accent); }
.panel-row-title { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.panel-row-sub { font-size: 0.88rem; color: var(--muted); }
.panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; }

/* Flyer viewer */
.flyer-view { border: 0; padding: 0; background: transparent; max-width: min(820px, 94vw); width: 100%; }
.flyer-view::backdrop { background: rgba(8,16,26,0.82); }
.flyer-view-in { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.flyer-view-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flyer-view-head form { margin: 0; }
.flyer-view img { width: 100%; height: auto; border-radius: 8px; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; min-height: 44px; cursor: pointer; }

.site-foot { background: var(--bar); color: var(--bar-muted); font-size: 0.85rem; padding: 18px 0 28px; }
.site-foot a { color: #ffffff; }

/* Phones */
@media (max-width: 640px) {
    .event { grid-template-columns: 1fr; gap: 6px; }
    .flyer { width: 100%; max-width: 260px; }
    .hero { min-height: 280px; }
    .logo { font-size: 1.2rem; gap: 8px; }
    .logo img { width: 24px; height: 24px; }
    .login { padding: 8px 6px; }
    .tab { max-width: none; }
}

/* /review: residents' submissions awaiting approval */
.review { max-width: 760px; padding-top: 20px; padding-bottom: 48px; }
.review h1 { font-family: var(--head); margin: 0 0 4px; }
.review-lead, .review-empty { color: var(--muted); }
.review-msg { padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.review-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; }
.review-item h2 { font-size: 1.15rem; margin: 0; }
.review-item .meta { color: var(--muted); font-size: 0.9rem; margin: 4px 0 8px; overflow-wrap: anywhere; }
.review-count { font-weight: 600; margin: 12px 0 4px; }
.review-when { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.review-text pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.85rem; background: var(--bg); padding: 10px; border-radius: 8px; max-height: 360px; overflow: auto; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.review-actions button { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; min-height: 44px; }
.btn-approve { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) !important; }
.btn-reject { background: var(--surface); color: var(--ink); }
.review-sub { font-size: 1.05rem; margin-top: 28px; }
.review-decided { list-style: none; padding: 0; }
.review-decided li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.review-decided form.inline { display: inline; }
.btn-link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0 4px; }
.badge-approved, .badge-rejected { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--bg); }
.badge-approved { color: var(--accent); }

/* Installable app (PWA) */
.install { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.install { font-size: 0.8rem; }
/* display:flex above would otherwise beat the hidden attribute: show it only once the browser offers an install. */
.install[hidden], .install-ios[hidden] { display: none; }
.install .btn { background: transparent; color: var(--bar-ink); border-color: rgba(255,255,255,0.35); min-height: 32px; padding: 4px 12px; font-size: 0.8rem; font-weight: 600; border-radius: 999px; }
.install .btn:hover { border-color: #f2a65a; color: #f2a65a; }
.install-ios { margin-top: 14px; }
.offline-note { margin: 0; padding: 10px var(--gutter); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; text-align: center; }
/* Installed on iPhone the status bar is see-through, so the top bar pads below it. */
@media (display-mode: standalone) {
    :root { --bar-total: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); }
    .topbar { padding-top: env(safe-area-inset-top, 0px); }
}

/* Phones: Don't-miss banner and hero dining pills 30% smaller so they don't crowd the screen. */
@media (max-width: 640px) {
    .dontmiss-in { font-size: 0.7rem; gap: 4px 18px; padding-top: 8px; padding-bottom: 8px; }
    .dontmiss-label { font-size: 0.85em; }
    .dontmiss .tag { font-size: 0.8em; padding: 0 4px; margin-right: 4px; }
    .hero-links { gap: 7px; }
    /* Phones: one pill per line, stacked from the bottom up (the next one to start is the lowest). */
    .home-hero .hero-links { flex-direction: column-reverse; align-items: flex-start; }
    .hero-link { font-size: 0.7rem; gap: 7px; padding: 8px 11px; min-height: 36px; border-radius: 8px; }
}

/* Search */
.search-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: var(--bar-muted); }
.search-link:hover { color: var(--bar-ink); background: rgba(255,255,255,0.1); }
.search-link:focus-visible { outline: 3px solid #f2a65a; outline-offset: 2px; color: var(--bar-ink); }
.search-page { padding-top: 18px; padding-bottom: 28px; max-width: 900px; }
.search-form { display: flex; gap: 8px; margin: 0 0 14px; }
.search-form input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.search-form input:focus-visible { outline: 3px solid #f2a65a; outline-offset: 1px; }
.search-hint, .search-count { color: var(--muted); margin: 0 0 16px; }
.repeat-note { margin: 0 0 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search-form .btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Search fly-in from the right */
.flyin { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: min(560px, 90vw); max-width: none; height: 100vh; height: 100dvh; max-height: none;
         background: var(--bg); color: var(--ink); box-shadow: -12px 0 32px rgba(0,0,0,0.3); overscroll-behavior: contain; }
.flyin::backdrop { background: rgba(8,16,26,0.55); }
.flyin[open] { animation: flyin-in 0.22s ease-out; }
@keyframes flyin-in { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .flyin[open] { animation: none; } }
.flyin-in { padding: max(12px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.flyin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.flyin-head h2 { font-family: var(--head); font-size: 1.4rem; margin: 0; }
.flyin-head form { margin: 0; }
.flyin-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.flyin-close:hover { background: var(--surface); color: var(--ink); }
.flyin-close:focus-visible { outline: 3px solid #f2a65a; outline-offset: 0; }
.flyin .event { grid-template-columns: 1fr; gap: 6px; }
.flyin .flyer { width: 100%; max-width: 220px; }
.flyin .day-head { font-size: 1.1rem; }
body:has(.flyin[open]) { overflow: hidden; }

/* Phones: the top bar stays one slim row, since it is fixed at the top. */
@media (max-width: 640px) {
    .logo { font-size: 1.05rem; gap: 7px; white-space: nowrap; }
    .logo img { width: 22px; height: 22px; }
    :root { --bar-h: 54px; }
    /* The heading sits just under the bar and the hero is only as tall as its content plus the saguaro,
       so Don't miss and the top of the first card show on the first screen: a cue that there's more below. */
    .home-hero { min-height: 400px; align-items: stretch; }
    .home-hero .hero-in { padding-top: 22px; padding-bottom: 76px; }
}

/* Menu button and panel (phones and tablets) */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -6px; border: 0; border-radius: 50%; background: transparent; color: var(--bar-ink); cursor: pointer; }
.nav-toggle:hover { background: rgba(255,255,255,0.1); }
.nav-toggle:focus-visible { outline: 3px solid #f2a65a; outline-offset: 2px; }
.nav-toggle .nav-close-icon, .nav-toggle[aria-expanded="true"] .nav-open-icon { display: none; }
.nav-toggle[aria-expanded="true"] .nav-close-icon { display: inline; }
.nav-panel { background: var(--bar); border-top: 1px solid rgba(255,255,255,0.1); box-shadow: 0 14px 28px rgba(0,0,0,0.35);
             max-height: calc(100vh - var(--bar-total)); max-height: calc(100dvh - var(--bar-total)); overflow-y: auto; }
.nav-panel[hidden] { display: none; }
.nav-panel-in { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; padding-bottom: 18px; }
.nav-pages, .nav-group { display: flex; flex-direction: column; }
.nav-panel a { display: flex; align-items: center; min-height: 46px; color: var(--bar-ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav-panel a:hover { color: #f2a65a; }
.nav-panel a:focus-visible, .theme-seg button:focus-visible { outline: 3px solid #f2a65a; outline-offset: 2px; }
.nav-group a { font-weight: 500; color: var(--bar-muted); }
.nav-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bar-muted); margin-bottom: 2px; }
.theme-seg { display: flex; margin-top: 6px; border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; overflow: hidden; align-self: flex-start; }
.theme-seg button { min-height: 40px; padding: 6px 16px; border: 0; background: transparent; color: var(--bar-muted); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.theme-seg button + button { border-left: 1px solid rgba(255,255,255,0.25); }
.theme-seg button[aria-checked="true"] { background: #f2a65a; color: #13283d; }
@media (max-width: 839px) {
    .logins { display: none; }
    .nav-toggle { display: inline-flex; }
}
@media (min-width: 840px) { .nav-panel { display: none !important; } }

/* Long email addresses and links in listings wrap instead of widening the page on phones. */
.event .what { min-width: 0; overflow-wrap: anywhere; }

/* Venue finder */
.venue-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.venue-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.places { padding-top: 18px; padding-bottom: 32px; max-width: 980px; }
.places-lead, .place-sub { color: var(--muted); margin: 0 0 18px; }
.crumb { margin: 0 0 6px; font-size: 0.9rem; }
.crumb a { color: var(--muted); }
.places-group { margin-bottom: 24px; }
.places-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.places-switch > * { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; }
.places-switch strong { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.places-switch a { color: var(--ink); text-decoration: none; background: var(--surface); }
.places-switch a:hover { border-color: var(--accent); }
.az-group { margin-bottom: 14px; }
.az-letter { margin: 0 0 6px; font-family: var(--head); font-size: 1.1rem; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.az-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.az-item { display: flex; flex-direction: column; gap: 2px; min-height: 48px; justify-content: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.az-item:hover { border-color: var(--accent); }
.az-item:focus-visible { outline: 3px solid #f2a65a; outline-offset: 1px; }
.az-name { font-weight: 600; }
.az-name .outdoor-tag { margin-left: 6px; }
.az-where { color: var(--muted); font-size: 0.88rem; }
.place-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.place-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.place-tile:hover { border-color: var(--accent); }
.place-tile-name { font-family: var(--head); font-weight: 600; font-size: 1.1rem; }
.place-tile-rooms { color: var(--muted); font-size: 0.88rem; }
.place-tile-dir { color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.outdoor-tag { display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; font-family: "Inter", sans-serif; font-size: 0.72rem; font-weight: 600; color: var(--muted); vertical-align: 2px; }
.place-facts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.place-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.place-facts dl:empty { display: none; }
.place-facts dt { font-weight: 700; }
.place-facts dd { margin: 0; }
.place-photo-lg { width: 100%; max-width: 520px; border-radius: var(--radius); }
.place-pending { color: var(--muted); margin: 0; }
.btn.directions { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); text-decoration: none; }
.room-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.room { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.room:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.room-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.room-head .outdoor-tag { margin-left: 0; }
.room-level { color: var(--muted); font-size: 0.85rem; }
.room p { margin: 6px 0 0; }
.room .room-note { color: var(--muted); font-size: 0.9rem; }
.room .btn.directions { margin-top: 10px; min-height: 38px; padding: 6px 12px; font-size: 0.85rem; }
.place-events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.place-events li { display: grid; grid-template-columns: 11em 1fr; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pe-when { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.pe-room { color: var(--muted); }
@media (max-width: 640px) { .place-events li { grid-template-columns: 1fr; } }
.place-hits { margin-bottom: 18px; }
.place-hit { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.place-hit svg { color: var(--accent); flex: none; }
.place-hit:hover { border-color: var(--accent); }
.place-hit-in { color: var(--muted); }

/* Pickleball today */
.pb-card.pb-main { margin-bottom: 18px; }
.pb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pb-list li { display: grid; grid-template-columns: 8.2em 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.pb-list li:first-child { border-top: 0; }
.pb-when { font-weight: 700; color: var(--accent); white-space: nowrap; }
.pb-what { display: flex; flex-direction: column; }
.pb-courts { font-size: 0.85rem; color: var(--muted); }
.pb-foot { margin: 10px 0 0; font-size: 0.82rem; color: var(--muted); }
/* In the sidebar the time sits above the session; the column is narrow. */
.pb-side .pb-list li { grid-template-columns: 1fr; gap: 0; }

/* ---------- Phones: one pass over sizes (kept last so it wins) ----------
   The desktop base is 18px; on a phone that made every heading, button and chip oversized. Phones get the
   16px base phones use for body text, then the big pieces scale down further than the reading text. */
@media (max-width: 640px) {
    html { font-size: 100%; }
    .page-h { font-size: 1.6rem; margin-bottom: 10px; }
    .section-h { font-size: 1.2rem; margin-bottom: 10px; }
    .hero h1 { font-size: 1.85rem; }
    .hero-date { font-size: 1rem; margin-bottom: 14px; }
    /* Don't miss and the hero pills were shrunk against the 18px base; keep them readable at 16px. */
    .dontmiss-in { font-size: 0.8rem; }
    .hero-link { font-size: 0.8rem; }

    /* Section cards: two per row, title + count + the next item in two lines at most. */
    .cards-area { padding-top: 20px; }
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { min-height: 0; padding: 12px; gap: 2px; }
    .card-top { flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 2px; }
    .card-title { font-size: 1.05rem; }
    .card-count { font-size: 0.75rem; }
    .card-next-label { display: none; }
    .card-next { font-size: 0.85rem; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

    /* Today / Week switch and the section chips share one row; the restaurant chips under Dining get their own. */
    .columns { padding-top: 20px; }
    .viewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
    .viewbar .filters { display: contents; }
    .tabs { flex: none; display: inline-flex; gap: 0; padding: 2px; margin: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
    .tab { flex: none; padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; font-size: 0.82rem; min-height: 32px; display: inline-flex; align-items: center; }
    .tab.active { border: 0; }
    .wide-only { display: none; }

    /* Section chips: one row you swipe sideways, fading out on the right so it's clear there are more. */
    .chips { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px;
             padding: 1px;
             -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
    .chips.sub { flex-basis: 100%; }
    .chips::-webkit-scrollbar { display: none; }
    /* End spacer: scrolling rows ignore right padding, so the last chip would end under the fade. */
    .chips::after { content: ""; flex: 0 0 20px; }
    .chip { min-height: 32px; padding: 4px 11px; font-size: 0.82rem; white-space: nowrap; gap: 4px; }

    /* Event list */
    .day-head { font-size: 1.15rem; }
    .day-head span { font-size: 0.85rem; }
    .event { padding: 12px 14px; }
    .what h3 { font-size: 1.05rem; }
    .meta { font-size: 0.85rem; }
    .panel h2 { font-size: 1.05rem; }
}

/* Calendar: month grid (computers and tablets) and week list (everywhere; phones only get weeks). */
.cal-page { padding-top: 22px; padding-bottom: 40px; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; position: sticky; top: var(--bar-total); z-index: 5; background: var(--bg); padding: 6px 0; }
.cal-title { font-family: var(--head); font-size: 1.4rem; margin: 0; min-width: 0; }
.cal-arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
             border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
             font-size: 1.6rem; line-height: 1; text-decoration: none; }
.cal-arrow:hover { border-color: var(--accent); color: var(--accent); }
.cal-arrow.off { opacity: 0.35; }
.cal-today { margin-left: auto; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px;
             border: 1px solid var(--accent); color: var(--accent); font-weight: 600; font-size: 0.88rem; text-decoration: none; }
.cal-grid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-head div { padding: 8px 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cal-cell { min-height: 118px; padding: 6px 8px 8px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:first-child { border-left: 0; }
.cal-cell.other { background: var(--bg); }
.cal-cell.other .cal-day, .cal-cell.other .cal-items { opacity: 0.55; }
.cal-cell.past:not(.today) .cal-items { opacity: 0.7; }
.cal-day { align-self: flex-start; font-weight: 700; font-size: 0.9rem; color: var(--ink); text-decoration: none; min-width: 28px; height: 28px;
           display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.cal-day:hover { background: var(--bg); }
.cal-cell.today .cal-day { background: var(--accent); color: var(--accent-ink); }
.cal-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-items a { display: block; font-size: 0.8rem; line-height: 1.35; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 0; }
.cal-items a:hover { color: var(--accent); }
.cal-time { color: var(--accent); font-weight: 700; }
.cal-more { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-decoration: none; margin-top: auto; }
.cal-more:hover { color: var(--accent); }
.cal-week-day { scroll-margin-top: 64px; }
.cal-none { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }
.cal-note { margin-top: 18px; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 900px) { .cal-cell { min-height: 96px; padding: 4px 5px 6px; } .cal-items a { font-size: 0.74rem; } }
@media (max-width: 640px) {
    .cal-page { padding-top: 14px; }
    .cal-tabs { display: none; }
    .cal-title { font-size: 1.1rem; }
    .cal-arrow { width: 40px; height: 40px; }
    .cal-today { padding: 6px 12px; min-height: 36px; font-size: 0.82rem; }
}

/* Admin: tabs between Submissions and Stats; the stats page. */
.review-tabs { display: flex; gap: 18px; margin-bottom: 14px; font-size: 0.92rem; }
.review-tabs a, .review-tabs strong { padding: 6px 0; border-bottom: 2px solid transparent; }
.review-tabs strong { border-color: var(--accent); }
.review-tabs a { color: var(--muted); text-decoration: none; }
.review-tabs .review-forget { margin-left: auto; font-size: 0.8rem; }
.review-note { display: flex; flex-direction: column; gap: 4px; flex-basis: 100%; font-size: 0.85rem; }
.review-note small { color: var(--muted); }
.review-note textarea { font: inherit; font-size: 0.95rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); resize: vertical; }
.review-sent-note { display: block; margin: 4px 0 0 2px; font-size: 0.85rem; color: var(--muted); white-space: pre-line; }
.review.stats { max-width: 1100px; }
.stats-range { margin: 6px 0 18px; }
.stats-range strong, .stats-range a { padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; font-size: 0.88rem; }
.stats-range a { color: var(--ink); text-decoration: none; }
.stats-range strong { background: var(--ink); color: var(--bg); }
.stats-range > * + * { border-left: 1px solid var(--line); }
.stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stats-kpis div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stats-kpis strong { font-family: var(--head); font-size: 1.9rem; line-height: 1.1; }
.stats-kpis span { color: var(--muted); font-size: 0.88rem; }
.stats-kpis small { display: block; font-size: 0.75rem; }
.stats-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stats-box h2 { font-size: 1.02rem; margin: 0 0 6px; }
.stats-note, .stats-none { color: var(--muted); font-size: 0.82rem; margin: 0 0 8px; }
.stats-chart-box { margin-bottom: 16px; }
.stats-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--line); }
.stats-col { flex: 1; height: 100%; position: relative; min-width: 0; }
.stats-col span { position: absolute; bottom: 0; border-radius: 3px 3px 0 0; }
.stats-col .sv { left: 0; right: 0; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.stats-col .su { left: 20%; right: 20%; background: var(--accent); }
.stats-col.today .sv { outline: 1px dashed var(--accent); }
.key-views, .key-visitors { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.key-views { background: color-mix(in srgb, var(--accent) 35%, transparent); margin-left: 0; }
.key-visitors { background: var(--accent); }
.stats-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.stats-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.stats-list li { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 4px 6px; font-size: 0.88rem; }
.stats-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 13%, transparent); border-radius: 4px; }
.stats-name { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-n { position: relative; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-n small { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 0.75rem; }

/* Footer guides and the guide pages */
.foot-guides { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.foot-guides a { text-decoration: none; }
.foot-guides a:hover { text-decoration: underline; }
.guide { padding-top: 22px; padding-bottom: 32px; max-width: 820px; }
.guide-crumbs { font-size: 0.85rem; margin-bottom: 4px; }
.guide-crumbs a { color: var(--muted); }
.guide-card { margin: 0 0 14px; }
.guide-card p { margin: 0 0 8px; }
.guide-card h3 { font-size: 0.95rem; margin: 12px 0 8px; }
.guide-tag { font-size: 0.72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; vertical-align: middle; margin-left: 4px; }
.guide-sub { color: var(--muted); }
.guide-more { font-size: 0.9rem; }
.guide-next { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 22px; font-size: 0.92rem; }
.guide-index { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.guide-index a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.guide-index a:hover strong { color: var(--accent); }
.guide-index span { color: var(--muted); font-size: 0.9rem; }
