/* Portfolio Analytics (page-analytics.ts): the app's analytics screen.
 *
 * Phone (< 768px) is the app: one column, 14px between cards, the app's type
 * and measurements (audit 02 §5). Wide: hero across the top, Grade beside
 * vs S&P, then the distribution and the three ranked lists in a grid.
 * Colours are tokens only (tokens.css), including the fixed analytics ramps
 * (--tb-grade-*, --tb-split-*, --tb-series-*, --tb-gain-text / --tb-loss-text).
 */

.an-page { --an-gap: 14px; }

/* ── Header ────────────────────────────────────────────────────────────── */
.an-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.an-head__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.an-head__title .tb-page-title { font-weight: 900; letter-spacing: -0.02em; }
.an-pro {
    display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: var(--tb-r-pill);
    background: var(--tb-accent); color: var(--tb-bg); font-size: 10px; font-weight: 900; letter-spacing: 0.04em;
}

.an-picker-wrap { position: relative; }
.an-picker {
    display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 4px; min-width: 220px; max-width: 100%;
    border-radius: var(--tb-r-pill); border: 1px solid var(--tb-border); background: var(--tb-surface);
    color: var(--tb-text); font: inherit; cursor: pointer; text-align: left;
    transition: border-color var(--tb-dur) var(--tb-ease), background var(--tb-dur) var(--tb-ease);
}
.an-picker:hover { border-color: var(--tb-border-strong); }
.an-picker > .tb-icon { color: var(--tb-primary-light); }
.an-picker__avatar, .an-menu__avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--tb-primary); border: 1px solid var(--tb-border-strong); color: var(--tb-on-primary); font-size: 13px; font-weight: 800;
}
.an-picker__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.an-picker__eyebrow { font-size: 9px; font-weight: 800; letter-spacing: 0.11em; color: var(--tb-muted); }
.an-picker__name { font-size: 14px; font-weight: 800; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.an-menu {
    position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 32px));
    padding: 8px; border-radius: 16px; background: var(--tb-bg3); border: 1px solid var(--tb-border-strong); box-shadow: var(--tb-shadow-menu);
    display: flex; flex-direction: column; gap: 2px; animation: an-rise 160ms var(--tb-ease);
}
.an-menu__eyebrow { margin: 0; padding: 6px 8px 4px; font-size: 9.5px; font-weight: 800; letter-spacing: 0.1em; color: var(--tb-muted); }
.an-menu__empty { margin: 0; padding: 8px; font-size: 12.5px; color: var(--tb-muted); }
.an-menu__row {
    display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 11px; border: 0; background: none;
    color: var(--tb-text); font: inherit; text-align: left; cursor: pointer;
}
.an-menu__row:hover { background: var(--tb-surface); }
.an-menu__row.is-active { background: var(--tb-primary-tint); }
.an-menu__row > .tb-icon { color: var(--tb-primary-light); margin-left: auto; }
.an-menu__avatar { width: 32px; height: 32px; background: var(--tb-surface); border-color: var(--tb-border); }
.an-menu__avatar.is-active { background: var(--tb-primary); border-color: var(--tb-primary); }
.an-menu__text { min-width: 0; display: flex; flex-direction: column; padding-right: 8px; }
.an-menu__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-menu__meta { font-size: 11.5px; color: var(--tb-muted); margin-top: 1px; }

/* ── Grid ──────────────────────────────────────────────────────────────── */
/* Phone: one column in the app's order. The two column wrappers are
   transparent here; `order` puts the cards back in the app's sequence. */
.an-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--an-gap); align-items: start; }
.an-col { display: contents; }
.an-area-hero { order: 1; }
.an-area-grade { order: 2; }
.an-area-sp { order: 3; }
.an-area-donut { order: 4; }
.an-area-top { order: 5; }
.an-area-vol { order: 6; }
.an-area-low { order: 7; }
.an-grid--enter > :not(.an-col), .an-grid--enter > .an-col > * { animation: an-rise 260ms var(--tb-ease) both; }
@keyframes an-rise { from { opacity: 0; transform: translateY(10px); } }

@media (min-width: 768px) {
    /* Hero across; Grade beside the chart; then two columns that balance:
       Top performers over Low performers, the donut over Most volatile. */
    .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-area-hero { grid-column: 1 / -1; }
    .an-area-grade, .an-area-sp { align-self: stretch; }
    .an-col { display: flex; flex-direction: column; gap: var(--an-gap); min-width: 0; order: 4; }
    .an-col--b { order: 5; }
}
@media (min-width: 1180px) {
    .an-page { --an-gap: 16px; }
}

/* ── Shared card bits ──────────────────────────────────────────────────── */
.an-card { gap: 12px; }
.an-eyebrow { margin: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tb-primary-light); line-height: 1.3; }
.an-title { margin: 2px 0 0; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; color: var(--tb-text); }
.an-gain { color: var(--tb-gain-text); }
.an-loss { color: var(--tb-loss-text); }
.an-empty { margin: 0; padding: 16px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--tb-muted); }

/* ── 1. Hero ───────────────────────────────────────────────────────────── */
.an-hero {
    position: relative; overflow: hidden; border-radius: var(--tb-r-card); padding: 18px;
    border: 1px solid rgba(var(--tb-primary-light-rgb), 0.18);
    background: linear-gradient(135deg, rgba(var(--tb-primary-rgb), 0.18), rgba(var(--tb-success-rgb), 0.12)), var(--tb-bg);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "pl badge" "div div" "stats stats";
    align-items: start; column-gap: 12px;
}
.an-hero__pl { grid-area: pl; min-width: 0; }
.an-hero__value { margin: 4px 0 0; font-size: 26px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.an-hero__caption { margin: 2px 0 0; font-size: 11px; font-weight: 600; color: var(--tb-text2); font-variant-numeric: tabular-nums; }
.an-hero__divider { grid-area: div; display: block; height: 1px; margin: 16px 0; background: var(--tb-border); }
.an-hero__stats { grid-area: stats; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.an-alpha {
    grid-area: badge; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(var(--tb-success-rgb), 0.55);
    background: rgba(var(--tb-success-rgb), 0.18); color: var(--tb-gain-text);
    display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.an-alpha--down { border-color: rgba(var(--tb-error-rgb), 0.55); background: rgba(var(--tb-error-rgb), 0.18); color: var(--tb-loss-text); }
.an-alpha__label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.an-alpha__value { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }

.an-mini { display: flex; flex-direction: column; min-width: 0; }
.an-mini__label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--tb-muted); }
.an-mini__value { margin-top: 4px; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; color: var(--tb-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-mini__sub { margin-top: 1px; font-size: 10px; font-weight: 600; color: var(--tb-muted); }

@media (min-width: 768px) and (max-width: 1179px) {
    .an-hero__value { font-size: 32px; }
}
@media (min-width: 1180px) {
    /* One band: P&L | the three figures | the badge. */
    .an-hero {
        padding: 24px 28px; grid-template-columns: minmax(220px, auto) auto minmax(0, 1fr) auto;
        grid-template-areas: "pl div stats badge"; align-items: center; column-gap: 28px;
    }
    .an-hero__value { font-size: 38px; letter-spacing: -0.03em; }
    .an-hero__caption { font-size: 12.5px; margin-top: 4px; }
    .an-hero .an-eyebrow { font-size: 11px; }
    .an-hero__divider { width: 1px; height: 56px; margin: 0; }
    .an-hero__stats { gap: 24px; }
    .an-mini__label { font-size: 10.5px; }
    .an-mini__value { font-size: 20px; margin-top: 6px; }
    .an-mini__sub { font-size: 11.5px; margin-top: 2px; }
    .an-alpha { padding: 12px 16px; border-radius: 14px; }
    .an-alpha__label { font-size: 10.5px; }
    .an-alpha__value { font-size: 22px; }
}

/* ── 2. Grade ──────────────────────────────────────────────────────────── */
.an-grade { gap: 14px; }
.an-grade__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.an-window-pill {
    padding: 4px 8px; border-radius: var(--tb-r-pill); border: 1px solid var(--tb-border); background: rgba(var(--tb-primary-light-rgb), 0.1);
    color: var(--tb-muted); font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap;
}
.an-grade__empty { padding: 24px 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.an-grade__empty-title { margin: 0; font-size: 14px; font-weight: 800; color: var(--tb-text2); }
.an-grade__empty-body { margin: 0; font-size: 12px; line-height: 1.45; color: var(--tb-muted); }

.an-grade__id { display: flex; align-items: center; gap: 14px; }
.an-grade__badge {
    --from: var(--tb-grade-b-from); --to: var(--tb-grade-b-to); --fg: var(--tb-grade-b-fg); --shadow: var(--tb-grade-b-shadow);
    width: 64px; height: 64px; flex-shrink: 0; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--from), var(--to)); color: var(--fg);
    font-size: 36px; font-weight: 900; letter-spacing: -0.03em; line-height: 1;
    box-shadow: 0 8px 22px var(--shadow);
}
.an-grade__text { flex: 1; min-width: 0; }
.an-grade__label { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.01em; }
.an-grade__blurb { margin: 4px 0 0; font-size: 12px; line-height: 1.42; color: var(--tb-text2); }

.an-g-s { --from: var(--tb-grade-s-from); --to: var(--tb-grade-s-to); --fg: var(--tb-grade-s-fg); --shadow: var(--tb-grade-s-shadow); }
.an-g-a { --from: var(--tb-grade-a-from); --to: var(--tb-grade-a-to); --fg: var(--tb-grade-a-fg); --shadow: var(--tb-grade-a-shadow); }
.an-g-b { --from: var(--tb-grade-b-from); --to: var(--tb-grade-b-to); --fg: var(--tb-grade-b-fg); --shadow: var(--tb-grade-b-shadow); }
.an-g-c { --from: var(--tb-grade-c-from); --to: var(--tb-grade-c-to); --fg: var(--tb-grade-c-fg); --shadow: var(--tb-grade-c-shadow); }
.an-g-d { --from: var(--tb-grade-d-from); --to: var(--tb-grade-d-to); --fg: var(--tb-grade-d-fg); --shadow: var(--tb-grade-d-shadow); }
.an-g-f { --from: var(--tb-grade-f-from); --to: var(--tb-grade-f-to); --fg: var(--tb-grade-f-fg); --shadow: var(--tb-grade-f-shadow); }
.an-g-s-accent { color: var(--tb-grade-s-accent); }
.an-g-a-accent { color: var(--tb-grade-a-accent); }
.an-g-b-accent { color: var(--tb-grade-b-accent); }
.an-g-c-accent { color: var(--tb-grade-c-accent); }
.an-g-d-accent { color: var(--tb-grade-d-accent); }
.an-g-f-accent { color: var(--tb-grade-f-accent); }

.an-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--tb-border); border-radius: 12px; overflow: hidden; }
.an-metric { padding: 10px 6px; display: flex; flex-direction: column; align-items: center; min-width: 0; border-right: 1px solid var(--tb-border); }
.an-metric:last-child { border-right: 0; }
.an-metric__label { font-size: 9px; font-weight: 800; letter-spacing: 0.06em; color: var(--tb-muted); white-space: nowrap; }
.an-metric__value { margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--tb-text); font-variant-numeric: tabular-nums; white-space: nowrap; }

.an-scale { display: flex; flex-direction: column; gap: 6px; }
.an-scale__axis { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--tb-muted); font-variant-numeric: tabular-nums; }
.an-scale__bar { position: relative; display: grid; grid-template-columns: var(--an-cols); gap: 2px; height: 10px; margin-top: 4px; }
.an-scale__bar::before { content: none; }
.an-scale__seg { display: block; height: 100%; background: linear-gradient(90deg, var(--from), var(--to)); opacity: 0.3; }
.an-scale__seg:first-child { border-radius: 5px 0 0 5px; }
.an-scale__seg:nth-last-child(2) { border-radius: 0 5px 5px 0; }
.an-scale__seg.is-active { opacity: 1; }
.an-scale__marker {
    position: absolute; top: -7px; width: 0; height: 0; margin-left: -5px;
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 6px solid var(--tb-text);
}
.an-scale__letters { display: grid; grid-template-columns: var(--an-cols); gap: 2px; }
.an-scale__letter { text-align: center; font-size: 11px; font-weight: 900; color: var(--tb-muted); }
.an-footnote { margin: 0; font-size: 11px; line-height: 1.45; font-style: italic; color: var(--tb-muted); }

/* ── 3. vs S&P 500 ─────────────────────────────────────────────────────── */
.an-legend { display: flex; flex-direction: column; gap: 6px; }
.an-legend__row { display: flex; align-items: center; gap: 8px; }
.an-legend__swatch { width: 12px; height: 10px; flex-shrink: 0; display: inline-block; }
.an-legend__swatch--port { width: 10px; border-radius: 50%; background: var(--tb-series-portfolio); }
.an-legend__swatch--sp { height: 2.5px; background: repeating-linear-gradient(90deg, var(--tb-series-sp500) 0 4px, transparent 4px 6px); border-radius: 1px; }
.an-legend__label { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; color: var(--tb-text); }
.an-legend__pct { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }

.an-chart { height: 130px; }
.an-chart__svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.an-chart__stop0 { stop-color: var(--tb-series-portfolio); stop-opacity: 0.3; }
.an-chart__stop1 { stop-color: var(--tb-series-portfolio); stop-opacity: 0; }
.an-chart__port { fill: none; stroke: var(--tb-series-portfolio); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.an-chart__sp { fill: none; stroke: var(--tb-series-sp500); stroke-width: 1.8; stroke-dasharray: 5 4; stroke-linecap: round; stroke-linejoin: round; }
.an-chart__empty { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--tb-muted); }
.an-sp .an-chart { flex: 1 0 130px; }
@media (min-width: 768px) { .an-chart { min-height: 150px; } }

.an-toggles { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.an-toggles .tb-seg--tabs .tb-seg__item:not(.is-active) { color: var(--tb-muted); }
.an-toggles .tb-seg--tabs .tb-seg__item:not(.is-active):hover { color: var(--tb-text); }

/* ── 4. Distribution ───────────────────────────────────────────────────── */
.an-split__body { display: flex; align-items: center; gap: 16px; }
.an-split__donut { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.an-split__donut svg { display: block; }
.an-split__centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.an-split__centre-label { font-size: 9px; font-weight: 800; letter-spacing: 0.06em; color: var(--tb-muted); }
.an-split__centre-value { margin-top: 2px; font-size: 14px; font-weight: 900; color: var(--tb-text); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.an-split__legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.an-split__row { display: flex; align-items: center; gap: 10px; }
.an-split__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.an-split__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.an-split__label { font-size: 12.5px; font-weight: 800; color: var(--tb-text); }
.an-split__meta { margin-top: 1px; font-size: 10.5px; font-weight: 600; color: var(--tb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.an-split__pct { font-size: 12px; font-weight: 800; color: var(--tb-text); font-variant-numeric: tabular-nums; }

/* ── 5–7. Ranked lists ─────────────────────────────────────────────────── */
.an-rank { gap: 4px; }
.an-rank__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.an-rank__icon { color: var(--tb-primary-light); display: inline-flex; }
.an-rows { display: flex; flex-direction: column; }
.an-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 0; color: inherit; text-decoration: none;
    border-bottom: 1px solid var(--tb-border);
}
.an-row:last-child { border-bottom: 0; }
a.an-row { border-radius: 8px; transition: background var(--tb-dur) var(--tb-ease); }
a.an-row:hover { background: var(--tb-surface); }
@media (hover: hover) { a.an-row:hover { margin: 0 -8px; padding-left: 8px; padding-right: 8px; } }
.an-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.an-row__title { font-size: 12.5px; font-weight: 800; color: var(--tb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-row__sub { margin-top: 1px; font-size: 10.5px; font-weight: 600; color: var(--tb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.an-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; text-align: right; }
.an-row__end .an-row__title, .an-row__end .an-row__sub { font-variant-numeric: tabular-nums; }
.an-row__end .tb-up { color: var(--tb-success); }
.an-row__end .tb-down { color: var(--tb-error); }

.an-thumb { width: 36px; height: 50px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--tb-card2); display: block; }
.an-thumb--empty { display: inline-block; }

.an-rankbadge {
    width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 900; color: var(--tb-primary-light);
    background: rgba(var(--tb-primary-rgb), 0.16); border: 1px solid rgba(var(--tb-primary-rgb), 0.33);
}
.an-rankbadge--gold { color: var(--tb-gold-text); background: rgba(var(--tb-gold-rgb), 0.22); border-color: rgba(var(--tb-gold-rgb), 0.55); }

.an-pct {
    padding: 3px 7px; border-radius: var(--tb-r-pill); border: 1px solid; font-size: 10.5px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.an-pct--up { color: var(--tb-gain-text); background: rgba(var(--tb-success-rgb), 0.15); border-color: rgba(var(--tb-success-rgb), 0.45); }
.an-pct--down { color: var(--tb-loss-text); background: rgba(var(--tb-error-rgb), 0.15); border-color: rgba(var(--tb-error-rgb), 0.45); }

/* Volatility rows: title + swing pill, then the 1Y range bar. */
[data-an-row="vol"] { padding: 12px 0; }
.an-vol { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.an-vol__top { display: flex; align-items: center; gap: 8px; }
.an-swing {
    padding: 3px 8px; border-radius: var(--tb-r-pill); border: 1px solid rgba(var(--tb-gold-rgb), 0.5); background: rgba(var(--tb-gold-rgb), 0.16);
    color: var(--tb-gold-text); font-size: 10.5px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.an-range { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.an-range__labels { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.an-range__track {
    position: relative; height: 6px; border-radius: 3px; overflow: hidden;
    background: linear-gradient(90deg, var(--tb-error) 0%, var(--tb-warning) var(--an-zero, 50%), var(--tb-success) 100%);
}
.an-range__zero { position: absolute; top: 0; bottom: 0; left: var(--an-zero, 50%); width: 1px; margin-left: -0.5px; background: var(--tb-bg); opacity: 0.55; }
.an-range__track--none { background: var(--tb-border); opacity: 0.5; }
.an-range__note { margin: 4px 0 0; font-size: 10px; font-weight: 600; font-style: italic; color: var(--tb-muted); }

/* ── States ────────────────────────────────────────────────────────────── */
.an-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 70px 16px; }
.an-state--empty p { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--tb-muted); }
.an-state__icon { color: var(--tb-muted); display: inline-flex; }

.an-skel-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.an-skel-row__main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.an-skel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.an-hero .tb-skel { margin-bottom: 8px; }
.an-hero[aria-hidden="true"] { display: flex; flex-direction: column; }
.an-skel-badge { width: 64px; height: 64px; border-radius: 18px; }
.an-skel-donut { width: 120px; height: 120px; flex-shrink: 0; }
.an-skel-chart { height: 130px; }
.an-skel-row .an-thumb { background: none; }

/* ── Locked ────────────────────────────────────────────────────────────── */
.an-page--locked .tb-pro-lock { min-height: 520px; }
.an-page--locked .tb-pro-lock__veil { align-items: flex-start; padding-top: 96px; }
.an-lock-again { display: flex; justify-content: center; }

/* ── Phone: the app ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .an-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .an-head__title .tb-page-title { font-size: 24px; letter-spacing: -0.02em; }
    .an-picker { width: 100%; }
    .an-menu { left: 0; right: 0; width: auto; max-width: none; }
    .an-page--locked .tb-pro-lock__veil { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .an-grid--enter > :not(.an-col), .an-grid--enter > .an-col > *, .an-menu { animation: none; }
    a.an-row { transition: none; }
}
