/* TraqHQ site stylesheet for pages on base.html.
   Sections follow the templates: tokens, base, buttons, forms, header, account menu,
   footer, dialogs, then one section per page. */

/* ========================================
   Tokens. Dark is the default theme; light overrides follow.
   Every colour is defined here once. Tints, hovers and translucent fills are mixed
   from these, never written as new hex values.
   ======================================== */
:root {
    --color-bg-primary: #11141b;
    --color-surface: #1a1e28;
    --color-text-primary: #f0f1f3;
    --color-text-secondary: #b4bac4;
    --color-text-muted: #8f96a3;
    --color-border: #2c3241;
    --color-border-control: #434a5b;

    --color-accent-orange: #ff6b35;
    --color-accent-cyan: #00e5ff;
    --color-accent-orange-text: #ff6b35;    /* orange used as text or an icon */
    --color-text-on-accent: #15171b;        /* text on a solid orange fill */
    --color-link: #6fdcee;
    --color-going: #35c27a;
    --color-watching: #ffd23f;              /* Watch: text and outline when pressed */
    --color-watching-line: #ffd23f;
    --color-friend: #7aa7ff;                /* friends, and the keyboard focus ring */
    --color-canceled: #ff5a4f;              /* canceled events and form errors */
    --color-logo-tile: #ffffff;             /* logos sit on white in both themes */
    /* The transcript PDF preview is a sheet of paper: the light-theme colours in both themes. */
    --color-sheet-paper: #ffffff;
    --color-sheet-ink: #16181d;
    --color-sheet-muted: #4c525c;
    --color-sheet-line: #dcdfd9;
    --color-sheet-fill: #f3f4f1;
    --color-sheet-solo: #177a45;

    /* The header, footer and account menu are dark in both themes. */
    --color-header-bg: #15171b;
    --color-header-border: #3a3f49;
    --color-header-text: #f0f1f3;
    --color-header-muted: #a9afba;

    /* Mixed from the colours above. */
    --color-accent-orange-hover: color-mix(in srgb, var(--color-accent-orange) 82%, white);
    --color-accent-orange-tint: color-mix(in srgb, var(--color-accent-orange) 14%, var(--color-surface));
    --color-going-tint: color-mix(in srgb, var(--color-going) 12%, var(--color-surface));
    --color-watching-tint: color-mix(in srgb, var(--color-watching-line) 22%, var(--color-surface));
    --color-text-on-going: var(--color-text-on-accent);
    --color-header-hover: color-mix(in srgb, white 7%, transparent);
    --color-header-current: color-mix(in srgb, var(--color-accent-orange) 14%, transparent);
    --color-header-current-text: color-mix(in srgb, var(--color-accent-orange) 80%, white);
    --color-selected-bg: var(--color-accent-orange);
    --color-selected-text: var(--color-text-on-accent);
    --color-card-top: var(--color-accent-orange);   /* the 3px rule on top of a card */
    --color-backdrop: color-mix(in srgb, black 67%, transparent);
    --color-map-land: color-mix(in srgb, var(--color-text-primary) 8%, var(--color-surface));
    --color-map-dim: var(--color-text-muted);
    --page-glow:
        radial-gradient(900px 420px at 88% -40px, color-mix(in srgb, var(--color-accent-orange) 15%, transparent), transparent 70%),
        radial-gradient(700px 380px at 0% 0, color-mix(in srgb, var(--color-accent-cyan) 5%, transparent), transparent 70%);

    --font-body: 'Barlow', system-ui, sans-serif;
    --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-ui: 'Lexend', system-ui, sans-serif;
    --font-wordmark: 'Comfortaa', sans-serif;

    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-popover: 0 24px 50px -18px color-mix(in srgb, black 80%, transparent);
    --shadow-dialog: 0 40px 90px -20px color-mix(in srgb, black 80%, transparent);

    --page-width: 1280px;
    --page-gutter: 22px;
}

[data-theme="light"] {
    --color-bg-primary: #f3f4f1;
    --color-surface: #ffffff;
    --color-text-primary: #16181d;
    --color-text-secondary: #4c525c;
    --color-text-muted: #636a76;
    --color-border: #dcdfd9;
    --color-border-control: #b9beb6;

    --color-accent-orange-text: #b83c0b;
    --color-link: #636a76;
    --color-going: #177a45;
    --color-watching: #8a5a00;
    --color-watching-line: #f0b400;
    --color-friend: #2059c9;
    --color-canceled: #c62828;

    --color-text-on-going: var(--color-surface);
    --color-selected-bg: var(--color-text-primary);
    --color-selected-text: var(--color-bg-primary);
    --page-glow: none;
}

/* ========================================
   Base
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-primary);
    background-image: var(--page-glow);
    background-repeat: no-repeat;
    color: var(--color-text-primary);
    font: 16px/1.5 var(--font-body);
}
main { flex: 1; width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--color-friend); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--color-accent-orange); color: var(--color-text-on-accent); padding: 8px 14px; border-radius: var(--radius-pill); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
.text-link { color: var(--color-link); font-weight: 600; }

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--color-accent-orange); color: var(--color-text-on-accent);
    font: 600 16px var(--font-ui); text-decoration: none; white-space: nowrap;
    border: 0; border-radius: var(--radius-pill); padding: 9px 18px;
}
.btn:hover { background: var(--color-accent-orange-hover); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-quiet {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1.5px solid var(--color-border-control); background: var(--color-surface); color: var(--color-text-primary);
    border-radius: var(--radius-pill); padding: 8px 16px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.btn-quiet:hover { border-color: var(--color-text-primary); }
.btn-icon {
    width: 36px; height: 36px; flex: none; display: grid; place-items: center;
    border-radius: 50%; border: 1.5px solid var(--color-border-control); background: transparent;
}
.btn-icon:hover { border-color: var(--color-text-primary); }
.btn-icon svg { width: 16px; height: 16px; }

/* ========================================
   Forms
   ======================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 4px; }
.field input, .field select, .field textarea {
    width: 100%; min-width: 0; padding: 10px 14px;
    border: 1.5px solid var(--color-border-control); border-radius: var(--radius-sm);
    background: var(--color-bg-primary); color: var(--color-text-primary);
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%), linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field textarea { min-height: 76px; resize: vertical; }
.field-hint { display: block; font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }
.form-message { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--color-border-control); font-weight: 500; }
.form-message-error { border-color: var(--color-canceled); color: var(--color-canceled); }
.form-message-success { border-color: var(--color-going); color: var(--color-going); }

/* ========================================
   Header (partials/header.html). Dark in both themes.
   ======================================== */
.site-header { background: var(--color-header-bg); color: var(--color-header-text); border-bottom: 1px solid var(--color-header-border); font-family: var(--font-ui); font-weight: 400; }
.site-header-inner { display: flex; align-items: center; gap: 28px; padding: 0 var(--page-gutter); height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { height: 34px; width: auto; }
.wordmark { font: 700 22px var(--font-wordmark); }
.wordmark .traq { color: var(--color-accent-orange); }
.wordmark .hq { color: var(--color-accent-cyan); }
.primary-nav { display: flex; gap: 6px; }
/* Every header button hovers the same way: a soft fill plus a thin outline. */
.primary-nav a, .header-login { text-decoration: none; padding: 6px 13px; border: 1.5px solid transparent; border-radius: var(--radius-pill); color: var(--color-header-muted); }
.header-login { color: var(--color-header-text); }
.primary-nav a:hover, .header-login:hover { color: var(--color-header-text); background: var(--color-header-hover); border-color: var(--color-header-border); }
.primary-nav a[aria-current] { background: var(--color-header-current); color: var(--color-header-current-text); }
.primary-nav a[aria-current]:hover { border-color: color-mix(in srgb, var(--color-accent-orange) 40%, transparent); }
.account { margin-left: auto; display: flex; gap: 6px; align-items: center; position: relative; }
.narrow-only, .label-short { display: none; }

.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; font: 700 12px var(--font-body); background: var(--color-accent-orange); color: var(--color-text-on-accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 42px; height: 42px; font-size: 15px; }

.account-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: 1.5px solid transparent; border-radius: var(--radius-pill); padding: 3px 10px 3px 3px; color: var(--color-header-text); }
.account-btn { position: relative; }
/* Cyan count of friend requests waiting, on the avatar. The ring is the header colour so it
   stays distinct from the (orange) default avatar underneath. */
.account-badge { position: absolute; left: 19px; top: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; box-sizing: border-box; background: var(--color-accent-cyan); color: var(--color-text-on-accent); box-shadow: 0 0 0 2px var(--color-header-bg); font: 700 11px/17px var(--font-display); text-align: center; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--color-header-hover); border-color: var(--color-header-border); }
.account-btn .chevron { width: 15px; height: 15px; color: var(--color-header-muted); }
.account-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* ========================================
   Account menu (partials/account_menu.html). Opens under the avatar; dark like the header.
   ======================================== */
.account-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 20; width: 292px; background: var(--color-header-bg); color: var(--color-header-text); border: 1px solid var(--color-header-border); border-radius: var(--radius-lg); padding: 8px; box-shadow: var(--shadow-popover); font-family: var(--font-body); }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; background: none; border: 0; color: var(--color-header-text); font-size: 16px; font-weight: 500; text-align: left; }
.account-menu a:hover, .account-menu button:hover { background: var(--color-header-hover); }
.account-menu a[aria-current] { background: var(--color-header-current); color: var(--color-header-current-text); }
.account-menu svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.account-menu nav { padding: 6px 0; margin: 6px 0; border-top: 1px solid var(--color-header-border); border-bottom: 1px solid var(--color-header-border); }
.account-menu form { margin: 0; }
.account-menu-id b { display: block; font: 600 16px/1.2 var(--font-ui); }
.account-menu-id small { display: block; color: var(--color-header-muted); font-size: 14px; overflow-wrap: anywhere; }
.menu-count { margin-left: auto; font: 700 14px/1 var(--font-display); min-width: 22px; text-align: center; padding: 3px 6px; border-radius: 6px; background: var(--color-header-hover); }
/* Friend requests waiting: the Friends pill flips from a gray total to cyan words ("2 requests"). */
.menu-count-requests { background: var(--color-accent-cyan); color: var(--color-text-on-accent); padding: 3px 8px; white-space: nowrap; font-size: 13px; letter-spacing: .01em; }

/* ========================================
   Footer (partials/site_footer.html). Dark in both themes.
   ======================================== */
.site-footer { background: var(--color-header-bg); color: var(--color-header-muted); border-top: 1px solid var(--color-header-border); font-size: 15.5px; }
.site-footer-inner { max-width: var(--page-width); margin: 0 auto; padding: 38px var(--page-gutter) 22px; display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)) minmax(max-content, .52fr); gap: 28px; }
.site-footer .brand { margin-bottom: 10px; }
.site-footer-brand p { margin: 0; max-width: 34ch; line-height: 1.45; }
.site-footer h2 { font: 600 13px var(--font-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--color-header-text); margin: 6px 0 10px; }
.site-footer-col a { display: block; width: fit-content; text-decoration: none; padding: 4px 0; color: var(--color-header-muted); }
.site-footer a:hover { color: var(--color-header-text); text-decoration: underline; }
.site-footer-bottom { border-top: 1px solid var(--color-header-border); }   /* full width, however wide the window */
.site-footer-legal { max-width: var(--page-width); margin: 0 auto; padding: 16px var(--page-gutter) 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 18px; font-size: 14.5px; }
.site-footer-legal a { color: var(--color-header-muted); text-decoration: none; }
.theme-switch { display: inline-flex; border: 1.5px solid var(--color-header-border); border-radius: var(--radius-pill); padding: 2px; }
.theme-switch button { background: transparent; border: 0; border-radius: var(--radius-pill); padding: 3px 12px; color: var(--color-header-muted); font-size: 14px; }
.theme-switch button:hover { color: var(--color-header-text); }
.theme-switch button[aria-pressed="true"] { background: var(--color-header-current); color: var(--color-header-current-text); }

/* ========================================
   Dialogs (partials/dialog.html) and the contact dialog
   ======================================== */
.dialog { border: 0; padding: 0; border-radius: 18px; width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); background: var(--color-surface); color: var(--color-text-primary); box-shadow: var(--shadow-dialog); overflow: auto; }
.dialog-wide { width: min(860px, calc(100vw - 24px)); }
.dialog::backdrop { background: var(--color-backdrop); }
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.dialog-head h2 { font: 700 30px/1 var(--font-display); margin: 0; flex: 1; }
.dialog-body { padding: 14px 22px 4px; }
.dialog-body > p { margin: 0 0 14px; color: var(--color-text-secondary); }
.dialog-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: 16px 22px 20px; }
.dialog-done { text-align: center; padding: 12px 0 4px; }
.dialog-done h3 { font: 700 30px/1 var(--font-display); margin: 0 0 6px; }
.dialog-done p { margin: 0; color: var(--color-text-secondary); }
.status-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--color-going-tint); color: var(--color-going); }
.status-icon svg { width: 30px; height: 30px; }
/* Stops the page behind an open dialog from scrolling, without shifting it sideways. */
html:has(dialog[open]) { overflow: hidden; scrollbar-gutter: stable; }

/* ========================================
   Event rows and lists (partials/event_row.html, partials/event_list.html)
   ======================================== */
.event-month-head { font: 700 20px/1 var(--font-display); margin: 22px 0 8px; display: flex; align-items: center; gap: 10px; }
.event-month-head::before { content: ''; width: 5px; height: 18px; border-radius: 2px; background: var(--color-card-top); }
.event-month-head small { font: 500 14px var(--font-body); color: var(--color-text-muted); }

/* Rows measure the column they sit in (the list, or an account page), not the window: a wide
   row keeps Watch / I'm going on the right; a narrow one puts them under the text (below). */
.event-list, .profile-section { container-type: inline-size; --event-date-width: 64px; }
.event-row { position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 8px; display: grid; grid-template-columns: var(--event-date-width, 64px) minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.event-row.is-watching { border-left-color: var(--color-watching-line); }
.event-row.is-going { border-left-color: var(--color-going); }
.event-date { text-align: center; line-height: 1; }
.event-date-month { font: 600 14px var(--font-display); color: var(--color-accent-orange-text); text-transform: uppercase; letter-spacing: .04em; }
.event-date-day { font: 700 30px/1.05 var(--font-display); white-space: nowrap; }
.event-date-day-long { font-size: 22px; padding: 4px 0; }
.event-date-sub { font-size: 12px; color: var(--color-text-muted); }
.event-row h3 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.25; }
.event-row-where { color: var(--color-text-secondary); }
.event-row-where:empty { display: none; }
.event-row h3 a, .event-row-where a { text-decoration: none; }
.event-row h3 a:hover, .event-row-where a:hover { text-decoration: underline; }
.event-row-title { color: var(--color-text-muted); font-size: 15px; }
.event-row-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 5px; font-size: 14px; color: var(--color-text-muted); }
.event-tag { border: 1px solid var(--color-border-control); border-radius: 4px; padding: 0 7px; color: var(--color-text-secondary); font-weight: 500; }
.event-distance { color: var(--color-text-secondary); font-weight: 600; white-space: nowrap; }
.event-link { white-space: nowrap; color: var(--color-link); }
.event-fresh { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.event-fresh::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent-orange); }

.event-friends { display: inline-flex; align-items: center; gap: 6px; color: var(--color-friend); font-weight: 600; }
.event-friends-faces { display: inline-flex; }
.avatar-sm { width: 22px; height: 22px; font-size: 10px; border: 2px solid var(--color-surface); }
.event-friends-faces .avatar-sm + .avatar-sm { margin-left: -10px; }
.avatar-friend-1 { background: var(--color-friend); color: var(--color-surface); }
.avatar-friend-2 { background: var(--color-going); color: var(--color-surface); }
.avatar-friend-3 { background: var(--color-accent-orange-text); color: var(--color-surface); }

.event-row-actions { display: flex; gap: 8px; align-items: center; }
/* A narrow row: the buttons go under the text at their own width, a little smaller, never stretched. */
@container (max-width: 760px) {
    .event-row { grid-template-columns: var(--event-date-width, 64px) minmax(0, 1fr); row-gap: 10px; }
    .event-row-actions { grid-column: 2; }
    .event-row-actions .event-action { padding: 6px 12px; font-size: 14.5px; }
    .event-row-actions .event-action svg { width: 15px; height: 15px; }
    .event-row-actions { flex-wrap: wrap; }
}
/* The narrowest phones: the buttons start at the row's left edge, so both fit on one line. */
@container (max-width: 345px) {
    .event-row-actions { grid-column: 1 / -1; }
}
.event-action { border: 1.5px solid var(--color-border-control); background: var(--color-surface); color: var(--color-text-primary); border-radius: var(--radius-pill); padding: 8px 14px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.event-action svg { width: 17px; height: 17px; }
.event-action:hover { border-color: var(--color-text-primary); }
.event-action:disabled { cursor: progress; }
.event-action-watch[aria-pressed="true"] { background: var(--color-watching-tint); border-color: var(--color-watching-line); color: var(--color-watching); }
.event-action-going[aria-pressed="true"] { background: var(--color-going); border-color: var(--color-going); color: var(--color-text-on-going); }

.follow-btn { border: 1.5px solid var(--color-border-control); background: var(--color-surface); color: var(--color-text-primary); border-radius: var(--radius-pill); padding: 2px 10px; margin-left: 8px; font: 600 13px/1.3 var(--font-body); white-space: nowrap; vertical-align: 2px; }
.event-row-where .follow-btn { vertical-align: 1px; }
.follow-btn:hover { border-color: var(--color-text-primary); }
.follow-btn[aria-pressed="true"] { background: var(--color-accent-orange-tint); border-color: var(--color-accent-orange); color: var(--color-accent-orange-text); }

/* A past event: the same row, muted, with its year and nothing to act on. */
.event-row.is-past { background: transparent; border-style: dashed; border-left-style: solid; border-left-color: var(--color-border-control); }
.event-row.is-past .event-date-month, .event-row.is-past .event-date-day { color: var(--color-text-muted); }
.event-row.is-past h3, .event-row.is-past h3 a { color: var(--color-text-secondary); font-weight: 600; }
.event-row.is-past .event-row-where { color: var(--color-text-muted); }
.event-row.is-past .event-tag { color: var(--color-text-muted); border-color: var(--color-border); }
.event-past-tag { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-muted); }

/* A canceled event: struck through under a stamp. */
.event-row.is-canceled > :not(.event-row-stamp) { opacity: .55; }
.event-row.is-canceled h3, .event-row.is-canceled .event-row-where { text-decoration: line-through; text-decoration-color: var(--color-text-muted); }
.event-row-stamp { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; overflow: hidden; border-radius: inherit; pointer-events: none; background: color-mix(in srgb, var(--color-surface) 45%, transparent); }
.event-row-stamp span { font: 700 30px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--color-canceled); border-top: 3px solid var(--color-canceled); border-bottom: 3px solid var(--color-canceled); padding: 5px 2px 4px; transform: rotate(-8deg); white-space: nowrap; background: var(--color-surface); }

/* ========================================
   Chips, sort box and logo tiles (shared by the index pages and the finder)
   ======================================== */
.chip { border: 1.5px solid var(--color-border-control); background: var(--color-surface); color: var(--color-text-primary); border-radius: var(--radius-pill); padding: 7px 14px; font-weight: 500; }
.chip:hover { border-color: var(--color-text-primary); }
.chip[aria-pressed="true"] { background: var(--color-selected-bg); border-color: var(--color-selected-bg); color: var(--color-selected-text); }
.sort-by { display: inline-flex; align-items: center; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); background: var(--color-surface); padding-left: 14px; white-space: nowrap; }
.sort-by span { color: var(--color-text-muted); font-size: 15px; }
.sort-by select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--color-text-primary); padding: 9px 14px 9px 7px; font-weight: 600; min-width: 0; cursor: pointer; }
.sort-by:focus-within { outline: 3px solid var(--color-friend); outline-offset: 2px; }
.sort-by select:focus-visible { outline: none; }
.logo-tile { width: 52px; height: 52px; flex: none; border-radius: var(--radius-sm); background: var(--color-logo-tile); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--color-border); }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-tile-initials { background: var(--color-bg-primary); color: var(--color-text-secondary); font: 700 20px var(--font-display); letter-spacing: .02em; }
.follow-btn-large { margin-left: 0; padding: 6px 13px; font-size: 15px; vertical-align: baseline; border-color: var(--color-accent-orange); color: var(--color-accent-orange-text); background: transparent; }
.follow-btn-large:hover { background: var(--color-accent-orange-tint); border-color: var(--color-accent-orange); }
.list-empty { color: var(--color-text-secondary); padding: 18px 4px; }

/* ========================================
   Track map (partials/map_card.html, map.js)
   ======================================== */
.map-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; position: relative; }
/* The card is in the page from the first paint, at its final size, and map.js sets data-ready when it
   draws: until then it is an empty frame, so nothing beside or below it moves when the map appears. */
.map-card:not([data-ready]) > * { visibility: hidden; }
/* "Jump to" (map_card.html's `jump`): floating on the map's bottom-left corner ('overlay'), or a bar of
   its own above the map ('row'). */
.map-jump { display: flex; gap: 8px; align-items: center; }
.map-jump label { color: var(--color-text-secondary); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.map-jump .map-region-select { padding-top: 5px; padding-bottom: 5px; font-size: 14.5px; min-width: 0; }
.map-card[data-jump="overlay"] .map-jump { position: absolute; z-index: 2; bottom: 12px; left: 12px; padding: 4px 4px 4px 12px; background: color-mix(in srgb, var(--color-surface) 88%, transparent); border: 1px solid var(--color-border); border-radius: var(--radius-pill); box-shadow: var(--shadow-popover); }
.map-card[data-jump="row"] .map-jump { padding: 10px 14px; border-bottom: 1px solid var(--color-border); }
.map-stage { position: relative; }
svg.map { width: 100%; height: 440px; display: block; touch-action: none; cursor: grab; }
svg.map:active { cursor: grabbing; }
.map-state, .map-ring, .map-dot { vector-effect: non-scaling-stroke; }
.map-state { fill: var(--color-map-land); stroke: var(--color-surface); stroke-width: 1; }
.map-ring { fill: color-mix(in srgb, var(--color-accent-orange) 9%, transparent); stroke: var(--color-accent-orange); stroke-width: 1.2; stroke-dasharray: 4 4; }
.map-dot { fill: var(--color-accent-orange); fill-opacity: .85; stroke: var(--color-surface); stroke-width: 1; cursor: pointer; }
.map-dot:hover, .map-dot.is-hovered { fill-opacity: 1; stroke: var(--color-text-primary); stroke-width: 2.5; }
.map-dot.is-dim { fill: var(--color-map-dim); fill-opacity: .45; stroke: none; }
.map-dot.is-followed { stroke: var(--color-watching-line); stroke-width: 2.5; }
.map-dot.is-picked { fill: var(--color-surface); fill-opacity: 1; stroke: var(--color-accent-orange); stroke-width: 3.5; }
.map-label { font: 600 12.5px var(--font-body); fill: var(--color-text-primary); paint-order: stroke; stroke: var(--color-surface); stroke-width: 4px; pointer-events: none; }
.map-reset { position: absolute; top: 12px; right: 12px; padding: 6px 14px 6px 11px; box-shadow: var(--shadow-popover); }
.map-reset svg { width: 15px; height: 15px; }
.map-help { position: absolute; top: 12px; left: 14px; right: 14px; pointer-events: none; font-size: 13.5px; color: var(--color-text-muted); text-shadow: 0 0 3px var(--color-surface), 0 0 3px var(--color-surface), 0 0 3px var(--color-surface); }   /* outlined like the map labels, so it reads over dots */
.map-stage:has(.map-reset:not([hidden])) .map-help { display: none; }   /* once zoomed, Reset map takes the corner */
.map-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); }
.map-zoom button { width: 38px; height: 36px; border: 0; background: transparent; font: 600 22px/1 var(--font-body); }
.map-zoom button:hover { background: var(--color-bg-primary); }
.map-zoom button + button { border-top: 1.5px solid var(--color-border-control); }
.map-chooser { position: absolute; z-index: 3; background: var(--color-surface); border: 1.5px solid var(--color-text-primary); border-radius: var(--radius-md); padding: 8px; box-shadow: var(--shadow-popover); min-width: 230px; }
.map-chooser p { margin: 2px 6px 6px; font-size: 13.5px; color: var(--color-text-secondary); }
.map-chooser button { display: flex; justify-content: space-between; gap: 14px; width: 100%; background: none; border: 0; padding: 7px 8px; border-radius: 8px; text-align: left; font-weight: 600; }
.map-chooser button:hover { background: var(--color-bg-primary); }
.map-chooser button span { color: var(--color-text-muted); font-weight: 400; white-space: nowrap; }

/* ========================================
   Tracks index (tracks.html)
   ======================================== */
.tracks-board { max-width: var(--page-width); margin: 0 auto; padding: 8px var(--page-gutter) 64px; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 28px; align-items: start; }
.tracks-board .map-card { position: sticky; top: 16px; }
.tracks-board svg.map { height: min(640px, calc(100vh - 150px)); min-height: 420px; }
.list-head h2 { font: 700 30px/1.05 var(--font-display); margin: 0; }
.list-head p { margin: 2px 0 12px; color: var(--color-text-secondary); }
.list-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.list-tools input { flex: 1; }
.list-tools input { padding: 9px 14px; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-primary); min-width: 0; }
.list-tools input::placeholder { color: var(--color-text-muted); }
.index-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: var(--radius-md); padding: 11px 14px; margin-bottom: 8px; }
.index-row:hover { border-color: var(--color-border-control); border-left-color: var(--color-accent-orange); }
.index-row.is-following { border-left-color: var(--color-accent-orange); }
.index-row h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.index-row h3 a, .org-card h3 a { text-decoration: none; }
.index-row h3 a:hover, .org-card h3 a:hover { text-decoration: underline; }
.index-row-place { color: var(--color-text-secondary); font-size: 15px; }
.index-row-count { font-size: 14px; color: var(--color-text-muted); margin-top: 1px; }
.index-row-count b { color: var(--color-accent-orange-text); font-weight: 700; }

/* ========================================
   Organizers index (orgs.html)
   ======================================== */
.orgs-page { max-width: var(--page-width); margin: 0 auto; padding: 6px var(--page-gutter) 64px; }
.org-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 8px; container-type: inline-size; }
/* Narrow: "where" and "part of" side by side at equal widths, the event type full width under them. */
@container (max-width: 640px) {
    .org-filter-row:not(.org-filter-top) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .org-filter-row:not(.org-filter-top) > select { width: 100%; min-width: 0; }
    #orgType { grid-column: 1 / -1; }
}
.org-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.org-filter-row > input, .org-filter-row > select { padding: 9px 14px; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text-primary); }
.org-filter-row > select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%), linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.org-filter-row > input { width: 250px; }
.org-filter-top { flex-wrap: nowrap; }
.org-filter-top > input { flex: 1 1 auto; width: auto; min-width: 0; max-width: 360px; }
.org-sort { flex: none; }
.org-filter-row > input::placeholder { color: var(--color-text-muted); }
.org-sort { margin-left: auto; }
.org-count { margin: 14px 0 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.org-count h2 { font: 700 30px/1.05 var(--font-display); margin: 0; }
.org-count span { color: var(--color-text-secondary); }
.org-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.org-divider { grid-column: 1 / -1; margin: 18px 0 2px; color: var(--color-text-secondary); max-width: 80ch; }
.org-divider b { color: var(--color-text-primary); }
.org-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) 168px; gap: 14px; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 14px 12px; align-items: start; }
.org-card:hover { border-color: var(--color-border-control); border-left-color: var(--color-accent-orange); }
.org-card.is-following { border-left-color: var(--color-accent-orange); }
/* The whole card (/orgs) or row (/tracks) opens its page: the heading link's hit area is
   stretched over it (one link for screen readers), and Follow sits above it. */
/* The side lists on track and organizer pages work the same way, row by row. */
.org-card, .index-row, .side-list li { position: relative; }
.org-card h3 a::after, .index-row h3 a::after, .side-list li a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.org-card .follow-btn, .index-row .follow-btn, .side-list .follow-btn { position: relative; z-index: 1; }
.org-card:hover h3 a, .index-row:hover h3 a, .side-list li:hover a { text-decoration: underline; }
.org-card h3 a:focus-visible, .index-row h3 a:focus-visible, .side-list li a:focus-visible { outline: none; }
.org-card:has(h3 a:focus-visible), .index-row:has(h3 a:focus-visible), .side-list li:has(a:focus-visible) { outline: 3px solid var(--color-friend); outline-offset: 2px; }
.org-card h3 { margin: 0; font-size: 18px; line-height: 1.2; }
.org-family { font-size: 13.5px; color: var(--color-text-muted); }
.org-numbers { margin-top: 3px; color: var(--color-text-secondary); font-size: 15px; }
.org-numbers b { color: var(--color-accent-orange-text); }
.org-card.is-quiet .org-numbers { color: var(--color-text-muted); }
.org-next { font-size: 14px; color: var(--color-text-muted); }
.org-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; font-size: 13.5px; }
.org-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
svg.footprint { width: 168px; height: 100px; display: block; }
/* orgs.js appends the SVG after fetching the states file; a card that will get one holds its box until then. */
.org-footprint.has-reach { display: block; width: 168px; height: 100px; }
.footprint use { fill: var(--color-map-land); }
.footprint circle { fill: var(--color-accent-orange); fill-opacity: .9; stroke: var(--color-surface); stroke-width: .8; }
.footprint.is-past circle { fill: var(--color-map-dim); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ========================================
   Events page (events.html, events.js)
   ======================================== */
.events-intro h1 { font-size: clamp(30px, 4.4vw, 56px); }
/* The guest heading: "Every track day, one calendar." on one line, "Build your season." under it. */
.events-h1-split { white-space: nowrap; }
.events-h1-split span { display: block; }
.events-intro p { font-size: 19px; max-width: 58ch; }
.season-line { display: none; }
.events-board { max-width: var(--page-width); margin: 0 auto; padding: 8px var(--page-gutter) 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.events-board.has-season { grid-template-columns: minmax(0, 1fr) 372px; }
/* Two rows at every width. Row 1 never wraps: the search box gives way to List / Map. Row 2 holds
   "Events near" and the event type side by side, or, when they don't fit, the event type full
   width on a line of its own. */
.finder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 0 14px; container-type: inline-size; }
.finder-row { display: flex; gap: 10px; align-items: center; }
.finder-filters { gap: 10px; }
.finder-group, .finder-controls { display: flex; gap: 10px; align-items: center; }
.finder label { font-weight: 600; white-space: nowrap; }
/* The form's own Search button is for visitors without script (events.js makes search live); base.html's
   <noscript> style shows it. Hidden from the start so the finder doesn't shrink when script runs. */
.finder-submit { display: none; }
.finder input, .select-pill { padding: 9px 14px; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); background-color: var(--color-surface); color: var(--color-text-primary); }
.finder input::placeholder { color: var(--color-text-muted); }
#finderSearch { flex: 1 1 auto; min-width: 0; }
#finderZip { width: 112px; }
#finderType { min-width: 150px; }
.select-pill { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%), linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
@container (max-width: 640px) {
    .finder-filters { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 12px; }
    .finder-group { display: contents; }
    .finder-controls { min-width: 0; }
    #finderZip { flex: 1 1 0; width: auto; min-width: 0; }
    #finderRadius { flex: none; }
    #finderType { grid-column: 1 / -1; width: 100%; min-width: 0; }
    .finder-submit { grid-column: 2; justify-self: start; }
}
@container (max-width: 420px) {
    .view-switch button { padding: 6px 11px; }
}
.view-switch { flex: none; display: inline-flex; background: var(--color-surface); border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); padding: 3px; }
.view-switch button { border: 0; background: transparent; border-radius: var(--radius-pill); padding: 6px 16px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center; }
.view-switch button svg { width: 16px; height: 16px; }
.view-switch button[aria-pressed="true"] { background: var(--color-selected-bg); color: var(--color-selected-text); }
/* The Events page's List / Map views. <html data-view> says which: the head script copies the saved pick
   there before first paint and events.js keeps it current. With no pick, Map on a wide screen and List
   on a phone (the same 980px split as events.js), so the map's frame is laid out from the start. */
#mapView { display: none; }
html[data-view="map"] #mapView { display: block; }
@media (min-width: 981px) { html:not([data-view]) #mapView { display: block; } }
/* Tall enough for its heading line before script writes it (h2 below: 26px at 1.1). */
.map-showing { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 18px 0 0; min-height: calc(26px * 1.1); }
.map-showing h2 { font: 700 26px/1.1 var(--font-display); margin: 0; }
.map-showing h2 a { text-decoration: none; }
.map-showing h2 a:hover { text-decoration: underline; }
.map-showing-sub { color: var(--color-text-secondary); }
.near-line { margin: 14px 0 0; color: var(--color-text-secondary); }
.link-btn { background: none; border: 0; padding: 0; margin-left: 6px; color: var(--color-link); font-weight: 600; text-decoration: underline; }
.event-list { margin-top: 4px; }
.event-list.is-loading { opacity: .55; }
.list-empty-state { padding: 18px 4px; color: var(--color-text-secondary); }
.list-empty-state p { margin: 0 0 8px; }
.btn-more { display: block; width: 100%; margin-top: 14px; padding: 12px; border: 1.5px solid var(--color-text-primary); border-radius: var(--radius-pill); background: transparent; color: var(--color-text-primary); font-weight: 600; }
.btn-more:hover { background: var(--color-surface); }

.events-side { position: sticky; top: 16px; display: grid; gap: 12px; align-content: start; }
.season { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: var(--radius-lg); overflow: hidden; }
.season-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--color-border); }
.season-head h2 { font: 700 28px/1 var(--font-display); margin: 0; }
.season-head p { margin: 4px 0 0; color: var(--color-text-secondary); font-size: 15px; }
.season-section { padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.season-section:last-child { border-bottom: 0; }
.season-section h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.season-count { margin-left: auto; font: 700 18px var(--font-display); min-width: 26px; text-align: center; border-radius: 6px; padding: 0 6px; }
.season-key { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.season-going .season-key { background: var(--color-going); }
.season-going .season-count { background: var(--color-going-tint); color: var(--color-going); }
.season-watching .season-key { background: var(--color-watching-line); }
.season-watching .season-count { background: var(--color-watching-tint); color: var(--color-watching); }
.season-following .season-key { background: var(--color-accent-orange); }
.season-following .season-count { background: var(--color-accent-orange-tint); color: var(--color-accent-orange-text); }
.season-friends .season-key { background: var(--color-friend); }
.season-transcript .season-key { background: var(--color-accent-cyan); }
.season-why { margin: 0; color: var(--color-text-secondary); font-size: 14.5px; line-height: 1.4; }
.season-items { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14.5px; }
.season-items li { display: flex; gap: 8px; padding: 5px 0; border-top: 1px dashed var(--color-border); }
.season-items li span:first-child { font-weight: 600; white-space: nowrap; min-width: 62px; }
.season-items li span:last-child { color: var(--color-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season-follows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.season-follows a, .season-follows span { display: inline-block; border: 1.5px solid var(--color-accent-orange); background: var(--color-accent-orange-tint); color: var(--color-accent-orange-text); border-radius: var(--radius-pill); padding: 3px 11px; font-size: 14px; font-weight: 600; text-decoration: none; }
.season-follows a:hover { text-decoration: underline; }
.season-more { margin: 10px 0 0; font-size: 14.5px; }
.season-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.season-stats div { background: var(--color-bg-primary); border-radius: 8px; padding: 8px; text-align: center; font-size: 12.5px; color: var(--color-text-secondary); }
.season-stats b { display: block; font: 700 24px/1 var(--font-display); color: var(--color-text-primary); }

/* A guest's season (events.html, events.js, actions.js): the hint over the list, the save
   box under the panel, the phone bar, the once-per-kind note, the welcome tour. */
.events-hint { background: var(--color-surface); border: 1.5px dashed var(--color-border-control); border-radius: var(--radius-md); padding: 10px 14px; margin: 0; color: var(--color-text-secondary); display: flex; gap: 10px; align-items: flex-start; }
/* Phones: one line under the finder instead of the full hint beside the list. */
.events-hint-short { display: none; margin: 0 0 6px; color: var(--color-text-secondary); font-size: 15px; }
.events-hint-short b { color: var(--color-text-primary); }
.events-hint b { color: var(--color-text-primary); }
.events-hint .link-btn { margin-left: 4px; }
.season-save { padding: 16px 18px; background: var(--color-header-bg); color: var(--color-header-text); }
.season-save p { margin: 0 0 10px; font-size: 15px; }
.season-save p b { color: var(--color-watching-line); }
.season-save .btn { width: 100%; justify-content: center; }
.season-save small { display: block; margin-top: 8px; color: var(--color-header-muted); font-size: 13px; }
.season-save small a { color: var(--color-header-text); }
.season-bar { display: none; }

.nudge { position: fixed; right: 20px; bottom: 20px; z-index: 30; width: min(400px, calc(100vw - 24px)); background: var(--color-surface); color: var(--color-text-primary); border: 1.5px solid var(--color-text-primary); border-left: 5px solid var(--color-accent-orange); border-radius: var(--radius-md); padding: 14px 12px 14px 16px; box-shadow: var(--shadow-dialog); display: flex; gap: 10px; align-items: flex-start; }
.nudge[hidden] { display: none; }
.nudge > div { flex: 1; min-width: 0; }
.nudge b { font: 700 22px/1.1 var(--font-display); display: block; }
.nudge p { margin: 4px 0 12px; color: var(--color-text-secondary); font-size: 15px; line-height: 1.4; }
.nudge p:last-child { margin-bottom: 0; }
.nudge-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.nudge-acts .btn { padding: 7px 14px; font-size: 15px; }

.tour { border: 0; padding: 0; border-radius: 20px; width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; background: var(--color-surface); color: var(--color-text-primary); box-shadow: var(--shadow-dialog); }
.tour::backdrop { background: var(--color-backdrop); }
.tour-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 440px; }
.tour-text { padding: 34px 34px 26px; display: flex; flex-direction: column; }
.tour-step { font: 600 15px var(--font-ui); color: var(--color-accent-orange-text); margin: 0 0 10px; }
.tour-text h2 { font: 700 46px/1 var(--font-display); margin: 0 0 14px; }
.tour-body { margin: 0; font-size: 18px; color: var(--color-text-secondary); max-width: 34ch; }
.tour-nav { margin-top: auto; padding-top: 26px; display: flex; align-items: center; gap: 12px; }
.tour-dots { display: flex; gap: 0; margin-right: auto; }
/* Each dot is a button with room around it to tap; the dot itself stays small. */
.tour-dots button { background: none; border: 0; padding: 10px 3.5px; display: flex; cursor: pointer; }
.tour-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--color-border-control); transition: width .15s; }
.tour-dots button:hover i { background: var(--color-text-muted); }
.tour-dots button.is-on i { background: var(--color-accent-orange); width: 24px; border-radius: var(--radius-pill); }
.tour-skip { background: none; border: 0; color: var(--color-text-muted); font-weight: 600; padding: 8px 6px; }
.tour-skip:hover { color: var(--color-text-primary); }
.tour-art { background-color: var(--color-bg-primary); background-image: var(--page-glow); background-repeat: no-repeat; border-left: 1px solid var(--color-border); display: grid; place-items: center; padding: 34px 30px; overflow: hidden; }
.tour-sample { background: var(--color-surface); width: 100%; max-width: 380px; padding: 20px 20px 14px; position: relative; transform: rotate(1.8deg); border: 1px solid var(--color-border); border-left: 5px solid var(--color-accent-orange); border-radius: 14px; box-shadow: var(--shadow-dialog); font-size: 14.5px; line-height: 1.4; }
.tour-sample[hidden] { display: none; }
.tour-flag { position: absolute; top: -13px; left: 16px; background: var(--color-accent-orange); color: var(--color-text-on-accent); font: 600 12.5px var(--font-ui); padding: 2px 12px; border-radius: var(--radius-pill); }
.tour-sample h3 { font: 700 26px/1.05 var(--font-display); margin: 4px 0 8px; }
.tour-line { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--color-border); align-items: center; }
.tour-line b { font: 700 17px var(--font-display); color: var(--color-accent-orange-text); }
.tour-line-last { padding-bottom: 30px; }
.tour-muted { color: var(--color-text-secondary); }
.tour-pill { border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); padding: 1px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tour-pill-watch { background: var(--color-watching-tint); border-color: var(--color-watching-line); color: var(--color-watching); }
.tour-pill-going { background: var(--color-going); border-color: var(--color-going); color: var(--color-text-on-going); }
.tour-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.tour-stats div { background: var(--color-bg-primary); border-radius: 8px; padding: 8px; text-align: center; }
.tour-stats b { display: block; font: 700 26px/1 var(--font-display); }
.tour-stats span { font-size: 12.5px; color: var(--color-text-secondary); }
.tour-mail { border-left: 3px solid var(--color-accent-orange); padding: 2px 0 2px 12px; margin: 6px 0 10px; }
.tour-faces { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; font-weight: 700; color: var(--color-friend); }
.tour-faces .avatar { width: 26px; height: 26px; font-size: 11px; margin-right: -12px; border: 2px solid var(--color-surface); }
.tour-faces .avatar:last-of-type { margin-right: 0; }
.tour-stamp { position: absolute; right: 16px; bottom: 10px; transform: rotate(-6deg); border: 2px solid var(--color-going); color: var(--color-going); font: 600 12px var(--font-ui); padding: 2px 10px; border-radius: var(--radius-pill); background: var(--color-surface); }
.tour-group { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.tour-group-solo { background: var(--color-friend); }
.tour-group-mid { background: var(--color-watching-line); }
.tour-group-novice { background: var(--color-going); }

/* ========================================
   Track and organizer pages (track.html, org.html, partials/entity_parts.html, entity.js)
   ======================================== */
.entity-page { max-width: var(--page-width); margin: 0 auto; padding: 22px var(--page-gutter) 64px; }
.breadcrumbs { font-size: 15px; color: var(--color-text-muted); margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumbs li + li::before { content: '/'; margin: 0 6px; }
.breadcrumbs a { color: var(--color-link); font-weight: 500; }
.ext-link::after { content: ' ↗'; }
.logo-tile-xl { width: 112px; height: 112px; border-radius: 18px; }
.logo-tile-xl.logo-tile-initials { font-size: 44px; }
.logo-tile-sm { width: 34px; height: 34px; border-radius: 8px; }
.logo-tile-sm.logo-tile-initials { font-size: 14px; }

.entity-head { display: grid; grid-template-columns: auto minmax(0, 1fr) 330px; gap: 24px; align-items: center; }
.entity-head h1 { font: 700 clamp(36px, 4.6vw, 60px)/0.98 var(--font-display); margin: 0 0 6px; letter-spacing: -0.01em; text-wrap: balance; }
.entity-family { font: 500 15px var(--font-ui); color: var(--color-accent-orange-text); margin-bottom: 4px; }
.entity-place { font-size: 19px; color: var(--color-text-secondary); }
.entity-summary { margin: 10px 0 0; font-size: 17px; color: var(--color-text-secondary); max-width: 62ch; }
.follow-link { margin-left: 0; text-align: left; }
.entity-stats .follow-link span { color: inherit; font-size: inherit; }
.follow-link[aria-pressed="true"] { color: var(--color-accent-orange-text); text-decoration: none; }
.follow-box p { margin: 12px 4px 0; font-size: 15px; color: var(--color-text-secondary); line-height: 1.4; }
.follow-box:has(.follow-hero[aria-pressed="true"]) .follow-why-off,
.follow-box:has(.follow-hero[aria-pressed="false"]) .follow-why-on { display: none; }
.follow-hero { gap: 10px; }
.follow-hero svg { width: 20px; height: 20px; }
.follow-hero[aria-pressed="false"] svg:last-of-type, .follow-hero[aria-pressed="true"] svg:first-of-type { display: none; }
.follow-hero[aria-pressed="true"] { background: var(--color-accent-orange-tint); color: var(--color-accent-orange-text); box-shadow: inset 0 0 0 2px var(--color-accent-orange); }
.follow-box .follow-hero { width: 100%; font-size: 19px; padding: 15px 22px; }
.follow-box .follow-hero[aria-pressed="false"] { box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--color-accent-orange) 60%, transparent); }

/* The slim bar that keeps Follow in reach once the box above has scrolled away. */
.stick-follow { position: fixed; top: 0; left: 0; right: 0; z-index: 15; background: var(--color-header-bg); color: var(--color-header-text); border-bottom: 1px solid var(--color-header-border); transform: translateY(-110%); }
.stick-follow.is-on { transform: none; }
.stick-follow > div { max-width: var(--page-width); margin: 0 auto; padding: 8px var(--page-gutter); display: flex; align-items: center; gap: 16px; }
.stick-follow b { font: 700 22px/1 var(--font-display); margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stick-follow span { color: var(--color-header-muted); font-size: 14.5px; }
.stick-follow .follow-hero span { color: inherit; font-size: inherit; }

.entity-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0 30px; }
.entity-stats > div { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 16px; }
.entity-stats b { display: block; font: 700 32px/1.05 var(--font-display); }
.entity-stats span { color: var(--color-text-secondary); font-size: 14.5px; }
.entity-stats .entity-stat-you { border-left: 5px solid var(--color-accent-cyan); }
/* A tile's link always gets its own line under the words, so the tiles line up. */
.entity-stats span a, .entity-stats .follow-link { display: block; width: fit-content; margin-top: 2px; }

.entity-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 32px; align-items: start; }
.entity-section + .entity-section { margin-top: 30px; }
.entity-h2 { font: 700 26px/1.1 var(--font-display); margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.entity-h2 small { font: 400 14.5px var(--font-body); color: var(--color-text-muted); }
.entity-events-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; }
.entity-clear { padding: 3px 12px; font-size: 14.5px; }

/* The next 12 months. Bars (and the type bars on organizer pages) are filled in tenths. */
.month-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 14px 12px 10px; }
.month-strip button { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 8px; }
.month-strip button:disabled { cursor: default; }
.month-strip button[aria-pressed="true"] { background: var(--color-accent-orange-tint); }
.month-strip-well { height: 56px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.month-strip-bar { width: 70%; max-width: 34px; height: var(--fill); border-radius: 5px 5px 2px 2px; background: var(--color-accent-orange); min-height: 3px; }
.month-strip .is-zero .month-strip-bar { background: var(--color-border); }
.month-strip-n { font: 700 16px/1 var(--font-display); height: 16px; }
.month-strip-m { font-size: 12.5px; color: var(--color-text-muted); padding-bottom: 3px; }
.month-strip button[aria-pressed="true"] .month-strip-m { color: var(--color-accent-orange-text); font-weight: 700; }
.fill-0 { --fill: 0%; } .fill-1 { --fill: 10%; } .fill-2 { --fill: 20%; } .fill-3 { --fill: 30%; } .fill-4 { --fill: 40%; } .fill-5 { --fill: 50%; }
.fill-6 { --fill: 60%; } .fill-7 { --fill: 70%; } .fill-8 { --fill: 80%; } .fill-9 { --fill: 90%; } .fill-10 { --fill: 100%; }

.entity-empty { background: var(--color-surface); border: 1px dashed var(--color-border-control); border-radius: var(--radius-md); padding: 18px 20px; }
.entity-empty p { margin: 0 0 14px; color: var(--color-text-secondary); }
.entity-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.past-line { color: var(--color-text-secondary); margin: 14px 0 0; }
.past-line .link-btn { margin-left: 2px; }
.past-section { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--color-border-control); }
.past-h2 { color: var(--color-text-secondary); }
.past-section .event-month-head::before { background: var(--color-border-control); }

.entity-about p, .entity-about ul, .entity-about ol { margin: 0 0 12px; max-width: 68ch; color: var(--color-text-secondary); font-size: 17px; line-height: 1.6; }
.entity-about a { color: var(--color-link); font-weight: 600; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.video { border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-border); }
.track-video-frame { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: var(--color-bg-primary); }
.track-video-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: var(--color-accent-orange); color: var(--color-text-on-accent); display: grid; place-items: center; }
.video-play svg { margin-left: 3px; }
.video-title { padding: 9px 12px; font-weight: 600; font-size: 15px; }

.entity-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.side-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.side-card h2 { font: 700 22px/1 var(--font-display); margin: 0; padding: 14px 18px 10px; }
.side-card-in { padding: 0 18px 16px; }
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px dashed var(--color-border); align-items: start; overflow-wrap: anywhere; }
.contact-list li:first-child { border-top: 0; }
.contact-list svg { width: 18px; height: 18px; margin-top: 3px; color: var(--color-text-muted); }
.contact-sub { display: block; }
/* A tel: link hands off to the OS on desktop (some browsers crash), so it's text there. */
.phone-link { display: none; }
@media (hover: none) and (pointer: coarse) { .phone-text { display: none; } .phone-link { display: inline; } }
.socials { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border: 1.5px solid var(--color-border-control); border-radius: 50%; color: var(--color-text-primary); }
.socials a:hover { border-color: var(--color-text-primary); }
.socials svg { width: 19px; height: 19px; }
svg.minimap { display: block; width: 100%; height: 190px; border-top: 1px solid var(--color-border); }
.minimap .map-state { fill: var(--color-map-land); stroke: var(--color-surface); stroke-width: 1; }
.minimap-other { fill: var(--color-map-dim); fill-opacity: .7; }
.minimap-here { fill: var(--color-accent-orange); stroke: var(--color-surface); stroke-width: 2; }

.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--color-border); }
.side-list li:first-child { border-top: 0; }
.side-list a { text-decoration: none; font-weight: 600; }
.side-list a:hover { text-decoration: underline; }
.side-list .follow-btn { margin-left: 0; }
.side-list-sub { display: block; font-size: 13.5px; color: var(--color-text-muted); font-weight: 400; }
.side-list-num { color: var(--color-text-muted); font-size: 14px; white-space: nowrap; }
.side-list li.side-list-empty { display: block; color: var(--color-text-muted); font-size: 14.5px; }
.side-list-more { margin: 8px 0 0; }
.type-bars { display: grid; gap: 9px; }
.type-bars div { display: grid; grid-template-columns: 118px minmax(0, 1fr) 26px; gap: 10px; align-items: center; font-size: 15px; }
.type-bars i { display: block; height: 10px; width: var(--fill); border-radius: 5px; background: var(--color-accent-orange); min-width: 4px; }
.type-bars b { font: 700 16px var(--font-display); text-align: right; }

/* ========================================
   Page intro (the heading band at the top of a page)
   ======================================== */
.page-intro { max-width: var(--page-width); margin: 0 auto; padding: 26px var(--page-gutter) 14px; }
.page-intro h1 { font: 700 clamp(32px, 3.6vw, 46px)/0.98 var(--font-display); letter-spacing: -0.01em; margin: 0 0 8px; text-wrap: balance; }
.page-intro h1 span { color: var(--color-accent-orange-text); }
.page-intro p { margin: 0; font-size: 17px; color: var(--color-text-secondary); max-width: 80ch; }

/* ========================================
   About (about.html)
   ======================================== */
.about-grid { max-width: var(--page-width); margin: 0 auto; padding: 8px var(--page-gutter) 64px; display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 40px; align-items: start; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.stat-tiles div { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: var(--radius-md); padding: 14px 16px; color: var(--color-text-secondary); }
.stat-tiles b { display: block; font: 700 44px/1 var(--font-display); color: var(--color-text-primary); }
.about-section { margin-bottom: 26px; max-width: 70ch; }
.about-section h2 { font: 700 28px/1.05 var(--font-display); margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.about-section h2::before { content: ''; width: 5px; height: 22px; border-radius: 2px; background: var(--color-card-top); }
.about-section p { margin: 0 0 10px; font-size: 17px; line-height: 1.6; color: var(--color-text-secondary); }
.about-section p b { color: var(--color-text-primary); }
.about-section a { color: var(--color-link); font-weight: 600; }
.about-card { position: sticky; top: 16px; background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: var(--radius-lg); padding: 18px 20px; }
.about-card h2 { font: 700 26px/1 var(--font-display); margin: 0 0 4px; }
.about-card > p { margin: 0 0 12px; color: var(--color-text-secondary); }
.about-card-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--color-border); text-decoration: none; font-weight: 600; }
.about-card-row:hover span { text-decoration: underline; }
.about-card-row svg { width: 20px; height: 20px; color: var(--color-accent-orange-text); flex: none; }
.about-card-row small { display: block; font-weight: 400; color: var(--color-text-secondary); font-size: 14.5px; }
.about-card .btn { width: 100%; margin-top: 8px; }

/* ========================================
   Terms and Privacy (legal.html)
   ======================================== */
.legal { max-width: 820px; margin: 0 auto; padding: 36px var(--page-gutter) 64px; }
.legal-tabs { display: inline-flex; background: var(--color-surface); border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); padding: 3px; margin-bottom: 26px; }
.legal-tabs a { text-decoration: none; border-radius: var(--radius-pill); padding: 6px 16px; font-weight: 600; }
.legal-tabs a[aria-current] { background: var(--color-selected-bg); color: var(--color-selected-text); }
.legal h1 { font: 700 clamp(40px, 5.4vw, 60px)/1 var(--font-display); margin: 0 0 20px; letter-spacing: -0.01em; }
.legal-body { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: var(--radius-lg); padding: 28px 30px; font-size: 17px; line-height: 1.65; color: var(--color-text-secondary); overflow-wrap: break-word; }
.legal-body > :first-child { margin-top: 0; }
.legal-body > :last-child { margin-bottom: 0; }
.legal-body p, .legal-body ul, .legal-body ol { margin: 0 0 14px; max-width: 68ch; }
.legal-body h2 { font: 700 26px/1.1 var(--font-display); color: var(--color-text-primary); margin: 30px 0 10px; }
.legal-body h3 { font: 600 18px/1.3 var(--font-body); color: var(--color-text-primary); margin: 22px 0 8px; }
.legal-body .page-subsection { padding-left: 18px; }
.legal-body strong { color: var(--color-text-primary); }
.legal-body a { color: var(--color-link); font-weight: 600; }
.legal-foot { margin: 18px 0 0; color: var(--color-text-muted); font-size: 15px; }

/* ========================================
   Page not found (404.html)
   ======================================== */
.not-found { max-width: 760px; margin: 0 auto; padding: 64px var(--page-gutter) 80px; text-align: center; }
.not-found-code { font: 700 clamp(110px, 24vw, 220px)/.82 var(--font-display); letter-spacing: -0.02em; color: var(--color-accent-orange-text); }
.not-found h1 { font: 700 clamp(34px, 5vw, 52px)/1 var(--font-display); margin: 14px 0 10px; }
.not-found > p { margin: 0 auto 22px; color: var(--color-text-secondary); font-size: 18px; max-width: 46ch; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 26px; }
.not-found-actions .btn { padding: 12px 22px; }
.not-found-actions .btn-quiet { padding: 11px 20px; }
.not-found-more { display: flex; gap: 10px; }   /* Tracks + Organizers wrap to the next row together */
.not-found small { color: var(--color-text-muted); font-size: 15px; }

/* ========================================
   Contact page (contact.html): the form without the dialog, for visitors with no script
   ======================================== */
.contact-page { max-width: 600px; margin: 0 auto; padding: 36px var(--page-gutter) 64px; }
.contact-page h1 { font: 700 clamp(34px, 5vw, 46px)/1 var(--font-display); margin: 0 0 8px; }
.contact-page > p { margin: 0 0 18px; color: var(--color-text-secondary); }
.contact-card { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: var(--radius-lg); padding: 20px 22px; }
.contact-card .btn { margin-top: 16px; }

/* ========================================
   Sign up, log in and the password pages (auth.html); the friend-invite page (invite.html)
   ======================================== */
.auth { max-width: 1040px; margin: 0 auto; padding: 44px var(--page-gutter) 64px; display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 56px; align-items: start; }
.auth-narrow { grid-template-columns: minmax(0, 460px); justify-content: center; }
.auth-card { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: 18px; padding: 30px 30px 26px; }
.auth-card h1 { font: 700 44px/1 var(--font-display); margin: 0 0 8px; letter-spacing: -0.01em; text-wrap: balance; }
.auth-card .lede { margin: 0 0 20px; color: var(--color-text-secondary); font-size: 17px; overflow-wrap: anywhere; }
.auth-card .lede b { color: var(--color-text-primary); }
.auth-card .lede-small { font-size: 15.5px; }
.auth-picks { margin: -8px 0 18px; padding: 10px 14px; border: 1px solid var(--color-border); border-left: 5px solid var(--color-going); border-radius: var(--radius-md); background: var(--color-going-tint); font-size: 15px; }
.auth-picks[hidden] { display: none; }
.auth-card .lede a, .auth-alt a, .fine a, .field-label-row a { color: var(--color-link); font-weight: 600; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .form-grid .field { margin-bottom: 0; }
.auth-card .form-grid { margin-bottom: 14px; }
.auth-card .field input { padding: 12px 14px; font-size: 17px; }
.auth-card .field input.is-invalid { border-color: var(--color-canceled); }
.auth-card .btn { width: 100%; padding: 13px 18px; font-size: 17px; margin-top: 4px; }
.auth-card .btn-quiet { width: 100%; justify-content: center; padding: 11px 16px; margin-top: 8px; }
.auth-card form { margin: 0; }
.auth-card .auth-resend { margin: -4px 0 16px; }
.auth-resend .btn-quiet { margin-top: 0; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field-label-row a { font-size: 14px; margin-bottom: 4px; }
.password-row { position: relative; }
.password-row input { padding-right: 68px !important; }
.password-row button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--color-link); font-weight: 600; font-size: 15px; padding: 6px; }
.field-error { display: block; color: var(--color-canceled); font-size: 14px; font-weight: 500; }
.field-error:empty { display: none; }
.field-error:not(:empty) { margin-top: 4px; }
.password-strength:empty { display: none; }
.password-strength[data-level="too-short"] { color: var(--color-canceled); }
.password-strength[data-level="fair"] { color: var(--color-watching); }
.password-strength[data-level="good"], .password-strength[data-level="strong"] { color: var(--color-going); }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 16px; color: var(--color-text-secondary); cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin: 3px 0 0; accent-color: var(--color-accent-orange); }
.check a { color: var(--color-link); font-weight: 600; }
.check + .field-error { margin: -10px 0 14px; }
.auth-alt { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--color-border); color: var(--color-text-secondary); text-align: center; }
.fine { margin: 12px 0 0; font-size: 14px; color: var(--color-text-muted); text-align: center; }
.auth-card .status-icon { margin: 0 0 16px; }
.status-icon-mail { background: var(--color-accent-orange-tint); color: var(--color-accent-orange-text); }
.status-icon-bad { background: var(--color-border); color: var(--color-text-secondary); }

.auth-side { padding-top: 14px; }
.auth-side h2 { font: 700 34px/1.02 var(--font-display); margin: 0 0 6px; }
.auth-side h2 span { color: var(--color-accent-orange-text); }
.auth-side > p { margin: 0 0 18px; color: var(--color-text-secondary); font-size: 17px; }
.why-list { list-style: none; margin: 0; padding: 0; }
.why-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 4px 12px; padding: 13px 0; border-top: 1px solid var(--color-border); }
.why-list b { font-size: 17px; }
.why-list span:last-child { grid-column: 2; color: var(--color-text-secondary); font-size: 15.5px; line-height: 1.4; }
.why-dot { width: 12px; height: 12px; border-radius: 3px; margin-top: 6px; }
.why-going { background: var(--color-going); }
.why-watching { background: var(--color-watching-line); }
.why-follow { background: var(--color-accent-orange); }
.why-friend { background: var(--color-friend); }
.auth-side .auth-side-free { margin-top: 16px; color: var(--color-text-muted); font-size: 15px; }

.invite-who { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; }
.invite-who b { font-size: 18px; overflow-wrap: anywhere; }
.avatar-xl { width: 64px; height: 64px; font: 700 26px var(--font-display); }
.invite-app { display: none; }
.btn-danger { color: var(--color-accent-orange-text); border-color: var(--color-accent-orange); }
.dialog-foot-left { margin-right: auto; }
.link-btn-danger { color: var(--color-accent-orange-text); }

/* ========================================
   Account pages (profile/base.html and profile/*.html)
   ======================================== */
.profile { max-width: var(--page-width); margin: 0 auto; padding: 14px var(--page-gutter) 64px; }
.profile-head { display: flex; align-items: center; gap: 20px; padding: 14px 0 26px; }
.profile-head h1 { font: 700 clamp(34px, 4.4vw, 54px)/1 var(--font-display); margin: 0 0 6px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.profile-head p { margin: 0; color: var(--color-text-secondary); font-size: 17px; }
.profile-head p b { color: var(--color-text-primary); font-weight: 600; }
.profile-photo-btn { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; }
.profile-photo-edit { position: absolute; right: -4px; bottom: -2px; background: var(--color-surface); border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); padding: 1px 9px; font-size: 13px; font-weight: 600; }
.profile-photo-btn:hover .profile-photo-edit { border-color: var(--color-text-primary); }
.avatar-xxl { width: 84px; height: 84px; font: 700 32px var(--font-display); }
.avatar-md { width: 46px; height: 46px; font-size: 16px; }
.avatar-fill { width: 100%; height: 100%; border-radius: 0; font: 700 84px var(--font-display); }

.profile-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.profile-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.profile-nav a, .profile-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; background: none; border: 0; font-weight: 600; color: var(--color-text-secondary); text-align: left; white-space: nowrap; }
.profile-nav a:hover, .profile-nav button:hover { color: var(--color-text-primary); background: var(--color-surface); }
.profile-nav a[aria-current] { background: var(--color-surface); color: var(--color-text-primary); box-shadow: inset 3px 0 0 var(--color-accent-orange); }
.profile-nav svg { width: 19px; height: 19px; flex: none; }
.profile-nav .menu-count { background: var(--color-border); color: var(--color-text-primary); }
.profile-nav .menu-count-requests { background: var(--color-accent-cyan); color: var(--color-text-on-accent); }
.profile-nav hr { border: 0; border-top: 1px solid var(--color-border); margin: 10px 0; width: 100%; }
.profile-nav form { margin: 0; }
.profile-nav button { color: var(--color-text-muted); font-weight: 500; }

.profile-section > h2 { font: 700 34px/1 var(--font-display); margin: 0 0 6px; }
.profile-section > .lede { margin: 0 0 22px; color: var(--color-text-secondary); font-size: 17px; max-width: 64ch; }
.profile-group { font: 700 22px/1 var(--font-display); margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.profile-section > .lede + .profile-group { margin-top: 0; }
.profile-key { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.profile-key-going { background: var(--color-going); }
.profile-key-watching { background: var(--color-watching-line); }
.profile-count { font: 700 17px var(--font-display); min-width: 26px; text-align: center; border-radius: 6px; padding: 1px 7px; background: var(--color-border); }
.profile-count-alert { background: var(--color-accent-orange); color: var(--color-text-on-accent); }
.profile-group-link { margin-left: auto; font: 600 16px var(--font-body); color: var(--color-link); }
.profile-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; }
.profile-card h4 { margin: 0 0 4px; font-size: 18px; }
.profile-card > p { margin: 0 0 14px; color: var(--color-text-secondary); max-width: 62ch; }
.profile-card form { margin: 0; }
.profile-card .form-grid { margin-bottom: 14px; }
.profile-card .form-message { margin: 12px 0 0; }
.profile-card .profile-card-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 12px; color: var(--color-text-muted); font-size: 15px; }
.profile-card-foot .link-btn { margin-left: 0; }
.profile-cards-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.profile-cards-2 .profile-card { margin: 0; }
.profile-empty { border: 1.5px dashed var(--color-border-control); border-radius: var(--radius-md); padding: 16px 18px; color: var(--color-text-secondary); margin: 0 0 8px; }
.profile-empty a { color: var(--color-link); font-weight: 600; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; padding: 9px 14px; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); background: var(--color-bg-primary); color: var(--color-text-secondary); }

/* Rows of things you follow and people you know. */
.profile-row { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 5px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-bottom: 8px; }
.profile-pending { border-left-style: dashed; }
.profile-row h4 { margin: 0; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.profile-row h4 a { text-decoration: none; }
.profile-row h4 a:hover { text-decoration: underline; }
.profile-row-sub { color: var(--color-text-secondary); font-size: 15px; overflow-wrap: anywhere; }
.profile-row-sub b { color: var(--color-accent-orange-text); }
.profile-row-actions { display: flex; gap: 8px; }
.profile-asked { background: var(--color-accent-orange-tint); border-radius: var(--radius-md); padding: 12px 12px 4px; margin-bottom: 18px; }
.profile-asked > p { margin: 0 4px 10px; font-weight: 600; }
.profile-section .event-row { margin-bottom: 8px; }

/* An on / off switch: a checkbox drawn as a slider. */
.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch > span { flex: 1; }
.switch b { display: block; font-weight: 600; }
.switch small { color: var(--color-text-secondary); font-size: 15px; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--color-border-control); position: relative; margin: 2px 0 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-surface); }
.switch input:checked { background: var(--color-going); }
.switch input:checked::after { left: 21px; }

.profile-photo-row { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; }
.profile-photo-row small { display: block; color: var(--color-text-muted); font-size: 14px; margin-top: 4px; }
.profile-facts { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--color-border); display: grid; gap: 6px; }
.profile-facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
.profile-facts dt { color: var(--color-text-muted); }
.profile-facts dd { margin: 0; overflow-wrap: anywhere; }
.status-ok { color: var(--color-going); font-weight: 600; }
.loses { margin: 0 0 14px; padding-left: 20px; color: var(--color-text-secondary); }
.loses b { color: var(--color-text-primary); }

/* Driver transcript */
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.profile-stats div { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 3px solid var(--color-card-top); border-radius: var(--radius-md); padding: 14px 16px; color: var(--color-text-secondary); font-size: 15px; }
.profile-stats b { display: block; font: 700 40px/1 var(--font-display); color: var(--color-text-primary); margin-bottom: 2px; }
.profile-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 22px; }
.profile-tools small { color: var(--color-text-muted); font-size: 15px; margin-left: 6px; }
.bars { display: grid; gap: 2px; margin-top: 10px; }
.bars-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 12px; align-items: center; background: none; border: 0; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; font-size: 15px; text-align: left; }
.bars-row:hover { background: var(--color-bg-primary); }
.bars-k { color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars-track { height: 12px; }
.bars-bar { display: block; height: 12px; width: var(--fill); min-width: 6px; border-radius: 6px; background: var(--color-accent-orange); }
.bars-v { font: 700 16px var(--font-display); }
.bars-more { margin: 8px 0 0; color: var(--color-text-muted); font-size: 14px; }
.meter { height: 14px; border-radius: 7px; background: var(--color-border); margin: 14px 0 10px; overflow: hidden; }
.meter-solo { display: block; height: 100%; width: var(--fill); background: var(--color-going); }
.meter-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--color-text-secondary); font-size: 15px; }
.meter-legend b { color: var(--color-text-primary); }
.meter-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--color-border-control); }
.meter-dot-solo { background: var(--color-going); }
.tlog { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.tlog-plain { margin: 0; }
.tlog-year { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 12px 18px 8px; font: 700 24px/1 var(--font-display); border-top: 1px solid var(--color-border); }
.tlog-year:first-child { border-top: 0; }
.tlog-year small { font: 500 14px var(--font-body); color: var(--color-text-muted); }
.tl { display: grid; grid-template-columns: 86px minmax(0, 1.5fr) minmax(0, 1.2fr) 112px minmax(0, 1fr) auto; gap: 14px; padding: 9px 18px; border-top: 1px dashed var(--color-border); align-items: baseline; font-size: 15.5px; }
.tlog-plain .tl:first-child { border-top: 0; }
.tl-head { border-top: 0; padding-top: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); font-weight: 600; }
.tl-date { font-weight: 700; white-space: nowrap; }
.tl-date small { display: block; font-weight: 400; color: var(--color-text-muted); font-size: 13px; }
.tl-track { font-weight: 600; overflow-wrap: anywhere; }
.tl-club, .tl-inst { color: var(--color-text-secondary); overflow-wrap: anywhere; }
.tl-acts { display: flex; gap: 12px; justify-self: end; }
.tl-acts .link-btn { margin: 0; font-size: 14.5px; }
.run-group { border: 1px solid var(--color-border-control); border-radius: 4px; padding: 0 7px; font-size: 14px; font-weight: 500; color: var(--color-text-secondary); white-space: nowrap; }
.solo { color: var(--color-going); font-weight: 600; }

/* The photo dialog */
.photo-crop { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: center; }
.photo-stage { width: 200px; height: 200px; border-radius: var(--radius-lg); background: var(--color-bg-primary); border: 1px solid var(--color-border); overflow: hidden; display: grid; place-items: center; }
.photo-stage img { display: block; max-width: 100%; }
.photo-stage-current { width: 100%; height: 100%; }
.photo-stage-current .avatar { border-radius: 0; }
.photo-side { display: grid; gap: 12px; }
.photo-drop { border: 1.5px dashed var(--color-border-control); border-radius: var(--radius-md); padding: 16px; text-align: center; color: var(--color-text-secondary); display: grid; gap: 4px; justify-items: center; }
.photo-drop.is-over { border-color: var(--color-accent-orange); background: var(--color-accent-orange-tint); }
.photo-drop b { color: var(--color-text-primary); }
.photo-drop small { color: var(--color-text-muted); margin-bottom: 6px; }
.photo-zoom { display: flex; align-items: center; gap: 10px; color: var(--color-text-secondary); font-size: 14px; font-weight: 600; }
.photo-zoom input { flex: 1; accent-color: var(--color-accent-orange); }
.photo-hint { margin: 0; color: var(--color-text-muted); font-size: 14px; }

/* The transcript PDF preview (a sketch of web/transcript_pdf.py's page) */
.sheet-wrap { background: var(--color-bg-primary); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 18px; max-height: 56vh; max-height: max(180px, min(56dvh, calc(100dvh - 380px))); overflow: auto; }   /* leaves room for the switch and buttons */
.sheet { background: var(--color-sheet-paper); color: var(--color-sheet-ink); border-radius: 6px; padding: 30px 34px 18px; font-size: 13.5px; line-height: 1.4; }
.sheet-top { display: flex; align-items: flex-end; gap: 16px; border-bottom: 3px solid var(--color-sheet-ink); padding-bottom: 12px; }
.sheet-top h3 { font: 700 30px/1 var(--font-display); margin: 0; flex: 1; }
.sheet-top h3 small { display: block; font: 500 14px var(--font-body); color: var(--color-sheet-muted); margin-top: 4px; }
.sheet-top .wordmark { font-size: 17px; }
.sheet-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.sheet-stats div { background: var(--color-sheet-fill); border-radius: 6px; padding: 8px 10px; color: var(--color-sheet-muted); font-size: 12.5px; }
.sheet-stats b { display: block; font: 700 24px/1 var(--font-display); color: var(--color-sheet-ink); }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-sheet-muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--color-sheet-line); }
.sheet td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--color-sheet-line); vertical-align: top; overflow-wrap: anywhere; }
.sheet td:first-child { white-space: nowrap; font-weight: 600; }
.sheet-solo { color: var(--color-sheet-solo); font-weight: 600; }
.sheet .sheet-notes { display: none; }
.sheet.with-notes .sheet-notes { display: table-cell; }
.sheet-more { margin: 10px 0 0; color: var(--color-sheet-muted); font-style: italic; }
.sheet-foot { margin-top: 14px; color: var(--color-sheet-muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; }
.pdf-notes { margin-top: 14px; }
@media (hover: none) and (pointer: coarse) { .invite-app { display: block; } }

/* ========================================
   Narrow screens
   ======================================== */
@media (max-width: 980px) {
    :root { --page-gutter: 16px; }
    .header-login, .account-name, .wide-only { display: none; }
    .narrow-only { display: inline; }
    .site-header-inner { gap: 10px; padding: 0 12px; height: 54px; }
    .brand { gap: 5px; }
    .brand img { height: 26px; }
    .wordmark { font-size: 18px; }
    .primary-nav { gap: 0; }
    .primary-nav a { padding: 5px 6.5px; font-size: 14px; }
    .account { gap: 0; }
    .account-btn { padding: 2px 5px 2px 2px; gap: 4px; }
    .account-badge { left: 17px; }
    .account-menu { width: min(292px, calc(100vw - 24px)); max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; }   /* drops down under the avatar, as on desktop */
    .site-header .btn { padding: 6px 11px; font-size: 14px; }

    .site-footer-inner { grid-template-columns: 1fr 1fr; padding: 28px 16px 18px; gap: 22px 16px; }
    .site-footer-brand { grid-column: 1 / -1; }
    .site-footer-legal { padding: 14px 16px 22px; justify-content: flex-start; }

    .dialog .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .dialog .field input, .dialog .field select { padding-left: 10px; padding-right: 10px; }
    .dialog-foot .btn, .dialog-foot .btn-quiet { flex: 1; justify-content: center; }

    .about-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 48px; gap: 12px; }
    .about-card { position: static; }
    .stat-tiles b { font-size: 34px; }
    .stat-tiles div { padding: 10px 12px; font-size: 14.5px; }
    .legal { padding-top: 22px; }
    .legal-body { padding: 20px 18px; }
    .contact-page .form-grid { grid-template-columns: 1fr; }
    .auth { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 20px var(--page-gutter) 48px; }
    .auth-card { padding: 22px 18px 20px; }
    .auth-card h1 { font-size: 36px; }
    .auth-card .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .auth-card .field input { padding-left: 12px; padding-right: 12px; }

    .profile-head { gap: 14px; padding: 4px 0 16px; }
    .avatar-xxl { width: 60px; height: 60px; font-size: 24px; }
    .profile-head p { font-size: 15px; }
    .profile-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    /* The side list becomes a row of pills that scrolls sideways. */
    .profile-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; margin: 0 calc(-1 * var(--page-gutter)); padding: 2px var(--page-gutter) 8px; scrollbar-width: none; }
    .profile-nav::-webkit-scrollbar { display: none; }
    .profile-nav a { width: auto; border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill); padding: 6px 14px; background: var(--color-surface); gap: 8px; }
    .profile-nav a[aria-current] { background: var(--color-selected-bg); border-color: var(--color-selected-bg); color: var(--color-selected-text); box-shadow: none; }
    .profile-nav a svg, .profile-nav hr, .profile-nav form { display: none; }
    .profile-cards-2 { grid-template-columns: minmax(0, 1fr); }
    .profile-card .form-grid { grid-template-columns: minmax(0, 1fr); }
    .profile-stats { grid-template-columns: 1fr 1fr; }
    .profile-stats b { font-size: 32px; }
    .profile-row { grid-template-columns: auto minmax(0, 1fr); }
    .profile-row-actions { grid-column: 1 / -1; }
    .profile-row-actions > * { flex: 1; justify-content: center; }
    .profile-facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .copy-row { flex-wrap: wrap; }
    .copy-row input { flex-basis: 100%; }
    .tl { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; }
    .tl-head { display: none; }
    .tl-date { grid-row: 1 / 4; }
    .tl-club { grid-column: 2; grid-row: 2; }
    .tl-group { grid-column: 3; grid-row: 1; justify-self: end; }
    .tl-inst { grid-column: 3; grid-row: 2; justify-self: end; font-size: 14px; }
    .tl-acts { grid-column: 2 / -1; grid-row: 3; justify-self: start; margin-top: 2px; }
    .tlog-year { padding: 12px 14px 8px; }
    .photo-crop { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .photo-side { width: 100%; }
    .dialog-foot-left { flex-basis: 100%; }
    .sheet { padding: 18px 16px; min-width: 520px; }
    .sheet-wrap { padding: 10px; }

    .tracks-board { grid-template-columns: minmax(0, 1fr); }
    .tracks-board .map-card { position: relative; top: auto; }   /* not sticky on a phone, but still the anchor for "Jump to" */
    .tracks-board svg.map, svg.map { height: 300px; min-height: 0; }
    .org-grid { grid-template-columns: minmax(0, 1fr); }
    .org-card { grid-template-columns: 52px minmax(0, 1fr); }
    .org-card-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
    .org-filter-top > input { max-width: none; }

    .events-board.has-season { grid-template-columns: minmax(0, 1fr); }
    .events-intro h1 { font-size: min(38px, 8.2vw); }
    .events-intro p { font-size: 16px; }
    /* On a phone the season panel gives way to one line linking to My season. */
    .events-side { display: none; }
    .events-hint-short { display: block; }
    .season-line { display: flex; gap: 10px; align-items: center; max-width: var(--page-width); margin: 0 var(--page-gutter) 10px; padding: 10px 14px; background: var(--color-surface); border: 1px solid var(--color-border); border-left: 5px solid var(--color-going); border-radius: var(--radius-md); text-decoration: none; color: var(--color-text-secondary); }
    .season-line span { flex: 1; min-width: 0; }
    .season-line b { color: var(--color-link); font-weight: 600; white-space: nowrap; }
    .season-line b::after { content: ' ›'; }
    /* A guest's phone gets a bar fixed to the bottom instead, with room left under the footer. */
    .season-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--color-header-bg); color: var(--color-header-text); border-top: 1px solid var(--color-header-border); padding: 10px var(--page-gutter); gap: 12px; align-items: center; justify-content: space-between; font-weight: 600; }
    .season-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body:has(.season-bar) .site-footer { padding-bottom: 64px; }
    .nudge { right: 12px; bottom: 12px; }
    body:has(.season-bar) .nudge { bottom: 68px; }
    .tour-in { grid-template-columns: 1fr; min-height: 0; }
    /* Phones: compact enough that the whole tour fits the visible screen of a current iPhone. */
    .tour-art { order: -1; padding: 22px 16px 14px; border-left: 0; border-bottom: 1px solid var(--color-border); }
    .tour-sample { padding: 16px 16px 10px; font-size: 13.5px; line-height: 1.35; }
    .tour-sample h3 { font-size: 22px; margin: 2px 0 6px; }
    .tour-line { padding: 6px 0; }
    .tour-line-last { padding-bottom: 24px; }
    .tour-stats b { font-size: 22px; }
    .tour-text { padding: 16px 18px 12px; }
    .tour-step { margin-bottom: 6px; }
    .tour-text h2 { font-size: 30px; margin-bottom: 8px; }
    .tour-body { font-size: 16px; }
    .tour-nav { padding-top: 14px; }

    .entity-page { padding-top: 14px; }
    .entity-head { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
    .logo-tile-xl { width: 72px; height: 72px; border-radius: 14px; }
    .logo-tile-xl.logo-tile-initials { font-size: 28px; }
    .follow-box { grid-column: 1 / -1; }
    .stick-follow > div > span { display: none; }
    .entity-stats { grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 22px; }
    .entity-stats b { font-size: 26px; }
    .entity-grid { grid-template-columns: minmax(0, 1fr); }
    .entity-side { position: static; }
    .month-strip { gap: 2px; padding: 12px 6px 8px; }
    .month-strip-m { font-size: 11px; }

    .event-list, .profile-section { --event-date-width: 54px; }
    .event-row.is-past .event-row-actions { display: none; }
    .event-row-stamp span { font-size: 26px; }
}
/* Signed-out phones show a Sign up button, so the logo mark gives way first. */
/* "Organizers" is too long for a phone header, so the narrowest screens show "Org". */
@media (max-width: 442px) { .label-full { display: none; } .label-short { display: inline; } .primary-nav a { padding: 5px 4.5px; } }
@media (max-width: 386px) { .site-header-guest .brand img { display: none; } }
@media (max-width: 380px) { .brand img { display: none; } .primary-nav a { padding: 5px 5.5px; } .site-header .btn { padding: 6px 10px; } }
@media (max-width: 340px) { .site-header-inner { gap: 6px; padding: 0 8px; } .wordmark { font-size: 16px; } .primary-nav a { padding: 5px 3.5px; font-size: 14px; } .site-header .btn { padding: 6px 8px; font-size: 13px; } }

@media (prefers-reduced-motion: no-preference) {
    .account-btn .chevron { transition: transform .15s; }
    .event-action, .follow-btn, .chip { transition: background .15s, border-color .15s, color .15s; }
    .stick-follow { transition: transform .2s; }
    .switch input, .switch input::after { transition: background .15s, left .15s; }
    .tour-sample.is-in { animation: tour-drop .35s cubic-bezier(.2, .8, .3, 1); }
    @keyframes tour-drop { from { opacity: 0; transform: rotate(5deg) translateY(18px); } }
}
