/* atlas by DeeLab: core flow screens (T-477, T-478). Tokens follow the Atlas design system
   (docs/design/handoff/design-system); the same values as atlas-plan.css. */
@font-face { font-family: Inter; src: url("/fonts/inter.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Manrope; src: url("/fonts/manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
    --canvas: #fbfcfa;
    --surface: #fff;
    --surface-2: #f8fafc;
    --line: #e9ece5;
    --line-card: #e5e7eb;
    --control: #838b99;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #5f6673;
    --accent-deep: #1f7d99;
    --accent: #3ac7ec;
    --accent-tint: #3ac7ec1a;
    --warn: #8a5a00;
    --good: #2f7a3f;
    --display: Manrope, Avenir Next, Avenir, system-ui, sans-serif;
    --text: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
    --mono: "JetBrains Mono", SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-width: 0; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/24px var(--text); }
button, input, select, textarea { font: inherit; }
a { color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -48px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--control); border-radius: 8px; z-index: 10; }
.skip-link:focus { top: 8px; }

/* Shell */
.app-bar { min-height: 56px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.wordmark { display: inline-flex; align-items: baseline; gap: 6px; color: var(--ink); text-decoration: none; }
.wordmark strong { font: 800 22px/28px var(--display); letter-spacing: -.02em; }
.app-bar .bar-status { margin-left: auto; color: var(--muted); font-size: 14px; line-height: 20px; }
.back-link { min-height: 44px; display: inline-flex; align-items: center; gap: 4px; margin-left: -8px; padding: 0 8px; color: var(--accent-deep); font-weight: 700; text-decoration: none; }
.page { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 96px; display: grid; gap: 24px; }
/* Small sentence-case label above a heading or card (UI_SIMPLIFICATION rule 1). Never mono. */
.eyebrow { color: var(--muted); font: 500 13px/20px var(--text); }
.section-label { margin: 0; font: 700 15px/22px var(--display); color: var(--ink); }
h1 { margin: 0; font: 800 28px/34px var(--display); letter-spacing: -.02em; text-wrap: pretty; }
h2 { margin: 0; font: 700 18px/26px var(--display); }
p { margin: 0; }
.lead { color: var(--ink-soft); }
.muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line-card); border-radius: 16px; padding: 16px; display: grid; gap: 12px; min-width: 0; }

/* Buttons */
.button { min-height: 48px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; }
/* One primary (dark) button per screen (UI_SIMPLIFICATION rule 2). */
.button--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.button--ghost { border-color: transparent; background: transparent; color: var(--accent-deep); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button-row form { display: contents; }
.button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Ask */
.ask-form { display: grid; gap: 8px; }
.question-field { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; background: var(--surface); border: 1px solid var(--control); border-radius: 12px; }
.question-field span { color: var(--muted); font: 700 18px/1 var(--text); }
.question-field input { flex: 1; min-width: 0; min-height: 50px; border: 0; background: transparent; outline: none; }
.question-field:focus-within { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.pills { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.pills--wrap { flex-wrap: wrap; overflow-x: visible; }
.pills--wrap .pill { max-width: 100%; text-align: left; }
.example-group { margin-top: 12px; }
.example-group > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; list-style: none; }
.example-group > summary::-webkit-details-marker { display: none; }
.example-group > summary::before { content: "▸"; display: inline-block; width: 1em; }
.example-group[open] > summary::before { content: "▾"; }
.example-group > .pills { margin-top: 8px; }
.pill { flex: 0 0 auto; scroll-snap-align: start; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--line-card); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--control); }
.notice--warn { border-color: var(--warn); }
.notice strong { display: block; }

/* Result */
.result-layout { display: grid; gap: 16px; min-width: 0; }
.chart-frame { background: var(--surface); border: 1px solid var(--line-card); border-radius: 16px; overflow: hidden; }
.chart-frame svg { display: block; width: 100%; height: auto; }
.chart-frame .chart-compact { display: none; }
@media (max-width: 479px) {
    .chart-frame .chart-article { display: none; }
    .chart-frame .chart-compact { display: block; }
}
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line-card); border-radius: 12px; width: fit-content; max-width: 100%; }
.segmented a { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 8px; color: var(--ink-soft); text-decoration: none; }
.segmented a[aria-current="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table caption { text-align: left; padding: 12px; font-weight: 700; }
.data-table th, .data-table td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.about dl { margin: 0; display: grid; gap: 10px; }
.about dt { font: 700 14px/20px var(--text); color: var(--ink); }
.about dd { margin: 0; }
.about ul { margin: 0; padding-left: 20px; }
.snippet { width: 100%; min-height: 96px; padding: 12px; border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface-2); font: 13px/20px var(--mono); resize: vertical; }
.legal { color: var(--muted); font: 12px/16px var(--text); }
.state { display: grid; gap: 12px; }

@media (min-width: 600px) {
    .page { padding: 32px 24px 64px; }
    h1 { font-size: 34px; line-height: 40px; }
}
@media (min-width: 1000px) {
    .result-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}

/* Embed: nothing but the chart. */
.embed-body { background: transparent; }
.embed-body .chart-frame { border: 0; border-radius: 0; }

/* Trends right now (T-526) */
.trend-block { display: grid; gap: 8px; }
.trend-list { margin: 0; padding-left: 1.6em; }
.trend-list li { margin: 6px 0; }
.trend-list .muted { margin-left: 6px; }

/* Showcase stories (T-516): cards, stat tiles, steps. Same tokens as above. */
.story-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.story-card { display: grid; gap: 6px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 16px; color: var(--ink); text-decoration: none; }
.story-card:hover { border-color: var(--accent-deep); }
.story-card strong { font: 700 18px/24px var(--display); }
.story-card__facts { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--ink-soft); font-size: 14px; }
.story-card__facts b { font-family: var(--mono); }
.story-card__go { color: var(--accent-deep); font-weight: 700; }
.stat-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-tile { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 12px; }
.stat-tile__label { color: var(--ink-soft); font-size: 14px; }
.stat-tile__value { font: 700 28px/34px var(--mono); }
@media (max-width: 599px) {
    .stat-tile { padding: 10px; font-size: 13px; line-height: 18px; }
    .stat-tile__label { font-size: 12px; line-height: 16px; }
    .stat-tile__value { font-size: 22px; line-height: 28px; }
}
.story-steps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.story-steps a { flex: 0 0 auto; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-card); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; }
.story-steps__n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-deep); font: 700 12px/1 var(--mono); }
.story-section { display: grid; gap: 12px; scroll-margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); }
.story-text { display: grid; gap: 8px; max-width: 70ch; color: var(--ink-soft); }
.story-caution { color: var(--ink); }
.source-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
@media (min-width: 720px) {
    .story-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Atlas is working on your question (T-585) */
.working-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-tint); }
.working-line p { margin: 0; font-weight: 700; }
.working-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-deep); animation: working-pulse 1.2s ease-in-out infinite; }
@keyframes working-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .working-dot { animation: none; } }

/* Data videos (ATLAS_73 M1) */
.video-chart { max-width: 340px; }
.video-chart svg { max-width: 100%; height: auto; }
.video-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.video-choices legend { padding: 0; }
.video-choices legend h2 { margin: 0; }
.video-choice { display: grid; grid-template-columns: 24px 36px 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line-card); border-radius: 12px; cursor: pointer; }
.video-choice:has(input:checked) { border-color: var(--accent-deep); background: var(--accent-tint); }
.video-choice input { width: 22px; height: 22px; accent-color: var(--accent-deep); }
.video-choice > span:last-child { display: grid; }
.video-choice--off { opacity: 0.7; cursor: not-allowed; }
.video-choice__why { color: var(--warn); }
.video-shape { display: block; border: 2px solid var(--ink-soft); border-radius: 4px; justify-self: center; }
.video-shape--9x16 { width: 18px; height: 32px; }
.video-shape--4x5 { width: 26px; height: 32px; }
.video-shape--1x1 { width: 30px; height: 30px; }
.video-shape--16x9, .video-shape--16x9-tv { width: 40px; height: 23px; }
.video-progress progress { width: 100%; height: 12px; accent-color: var(--accent-deep); }
.video-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.video-player { display: block; width: auto; max-width: 100%; max-height: 75vh; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line-card); border-radius: 12px; }
.video-player--9x16 { aspect-ratio: 9 / 16; }
.video-player--4x5 { aspect-ratio: 4 / 5; }
.video-player--1x1 { aspect-ratio: 1 / 1; }
.video-player--16x9, .video-player--16x9-tv { aspect-ratio: 16 / 9; width: 100%; height: auto; }
.video-post { min-height: 220px; font-family: var(--text); }
/* Place menu for trends (T-593, T-594) */
.place-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.place-form label { font-weight: 700; }
.place-form select { min-height: 44px; min-width: 0; max-width: 100%; padding: 0 12px; border: 1px solid var(--control); border-radius: 12px; background: var(--surface); color: var(--ink); }
.place-form .button { min-height: 44px; }

/* Landing page (T-701, T-702; Atlas Paid and Landing.dc.html frames L1 to L5). Works from 320 px. */
.landing .page { max-width: 1180px; grid-template-columns: minmax(0, 1fr); }
.landing .state, .landing .card { grid-template-columns: minmax(0, 1fr); }
/* Scroll strips hold their own hidden labels, so nothing in them widens the page. */
.around-cards, .pills { position: relative; }
.landing-bar { gap: 8px; }
.landing-nav { display: none; }
.landing-bar__signin { margin-left: auto; min-height: 44px; padding: 0 14px; font-size: 14px; }
@media (min-width: 768px) {
    .landing-bar { padding: 0 32px; gap: 16px; }
    .landing-nav { display: flex; gap: 4px; margin-left: 16px; }
    .landing-nav a { min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; color: var(--ink-soft); font-size: 14px; text-decoration: none; }
    .landing-nav a:hover { color: var(--ink); text-decoration: underline; }
}
.landing-hero { display: grid; gap: 24px; align-items: start; min-width: 0; }
.landing-ask { display: grid; gap: 16px; min-width: 0; }
.landing-ask h1 { font-size: 30px; line-height: 1.12; text-wrap: balance; }
.landing-ask .lead { font-size: 16px; line-height: 26px; max-width: 34rem; }
.landing-ask__note { font-size: 13px; line-height: 20px; }
.landing-try { display: grid; gap: 8px; }
.landing-try__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.landing-try__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.landing-try__list li { max-width: 100%; }
.landing-try__list .pill { max-width: 100%; white-space: normal; text-align: left; font-size: 14px; line-height: 20px; padding: 8px 14px; }
.question-field--button { padding: 0 6px 0 14px; }
.question-field--button .button { min-height: 40px; padding: 0 16px; border-radius: 9px; flex: 0 0 auto; }
@media (min-width: 1024px) {
    .landing-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding-top: 24px; }
    .landing-ask h1 { font-size: 44px; }
}

.landing-trending { gap: 12px; }
.landing-trending__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.landing-trending__head h2 { font-size: 20px; line-height: 26px; }
.landing-trending__change summary { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent-deep); font-size: 14px; font-weight: 700; cursor: pointer; }
.landing-trending__change[open] { flex-basis: 100%; }
.landing-trending__change .place-form { margin-top: 4px; }
.source-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 2px; padding: 3px; background: #f3f5f1; border-radius: 10px; }
.source-tabs__tab { min-width: 0; min-height: 44px; padding: 0 4px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tabs__tab[aria-selected="true"] { background: var(--surface); font-weight: 700; box-shadow: 0 1px 2px rgba(17, 24, 39, .12), inset 0 -3px 0 var(--accent); }
.source-tabs__tab:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 0; }
.landing-trending__panels { transition: opacity 200ms ease; }
.landing-trending__panels.is-fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .landing-trending__panels { transition: none; }
    .landing-trending__panels.is-fading { opacity: 1; }
}
.trend-panel { display: grid; gap: 8px; min-width: 0; }
.trend-panel:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; border-radius: 4px; }
.trend-panel__counts, .trend-panel__credit, .landing-trending__small { font-size: 13px; line-height: 18px; color: var(--muted); }
.trend-panel__sub { margin: 8px 0 0; font: 700 15px/22px var(--display); }
.trend-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.trend-rows__row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 52px; padding: 6px 0; border-top: 1px solid var(--line); }
.trend-rows__n { font: 400 13px/18px var(--mono); color: var(--muted); }
.trend-rows__body { display: grid; gap: 2px; min-width: 0; }
.trend-rows__title { font-size: 15px; font-weight: 700; line-height: 22px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.trend-rows__title:hover { color: var(--accent-deep); text-decoration: underline; }
.trend-rows__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
.trend-rows__meta a { display: inline-flex; align-items: center; min-height: 24px; }
.trend-rows--small .trend-rows__row { min-height: 44px; }
.source-tag { padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px; }
.source-tag--wikipedia { background: #eef0ec; color: var(--ink-soft); }
.source-tag--google { background: #e7f0fb; color: #1d4f91; }
.source-tag--bluesky { background: #e6f4f8; color: #155e74; }
.home-trends__more { font-size: 14px; }

.landing-row { display: grid; gap: 24px; min-width: 0; }
@media (min-width: 1024px) {
    .landing-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.landing-compare h2 { font-size: 20px; line-height: 26px; text-wrap: pretty; }
.compare-form { display: grid; gap: 8px; }
.compare-form__chips { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.compare-form__chips legend { float: left; margin-right: 4px; padding: 0; font-size: 14px; color: var(--ink-soft); }
.chip-check { position: relative; display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d5d9df; border-radius: 999px; background: var(--surface); font-size: 14px; cursor: pointer; }
.chip-check input:checked + span { border-color: var(--accent-deep); background: var(--accent-tint); font-weight: 700; }
.chip-check input:checked + span::before { content: "✓"; color: var(--accent-deep); }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.compare-form__add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.compare-form__add label { font-size: 14px; color: var(--ink-soft); }
.compare-form__add select { min-height: 44px; min-width: 0; max-width: 100%; padding: 0 12px; border: 1px solid var(--control); border-radius: 12px; background-color: var(--surface); color: var(--ink); }
.compare-form__add .button { min-height: 44px; }
.compare-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.compare-bars__row { display: grid; grid-template-columns: minmax(72px, 112px) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.compare-bars__row--own .compare-bars__name { font-weight: 700; color: var(--ink); }
.compare-bars__name { overflow-wrap: anywhere; }
.compare-bars__track { display: block; min-width: 0; }
.compare-bars__fill { display: block; height: 20px; background: #a9d6e5; border-radius: 0 4px 4px 0; }
.compare-bars__row--own .compare-bars__fill { background: var(--accent-deep); }
.compare-bars__value { font-family: var(--mono); color: var(--ink); text-align: right; white-space: nowrap; }
.compare-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; line-height: 18px; color: var(--muted); }
.landing-compare__note { font-size: 13px; line-height: 18px; }

.landing-around { display: grid; gap: 12px; min-width: 0; }
.landing-around h2 { font-size: 20px; line-height: 26px; }
.around-cards { list-style: none; margin: 0; padding: 0 0 4px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 80%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
.around-card { scroll-snap-align: start; display: grid; gap: 6px; align-content: start; padding: 14px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 12px; min-width: 0; }
.around-card__place { margin: 0; font: 700 13px/18px var(--text); color: var(--muted); }
.around-card__place a { color: var(--muted); }
.around-card .trend-list li { margin: 2px 0; overflow-wrap: anywhere; font-weight: 700; }
.around-card .trend-list .muted { font-weight: 400; font-size: 12px; }
.around-card .muted, .around-card .home-trends__more { font-size: 13px; line-height: 18px; }
.around-credit { font-size: 12px; line-height: 18px; }
@media (min-width: 720px) {
    .around-cards { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); overflow-x: visible; }
}
.inline-form { display: inline; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent-deep); text-decoration: underline; cursor: pointer; text-align: left; }

.landing-ready { display: grid; gap: 12px; min-width: 0; }
.ready-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.ready-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 12px; min-width: 0; }
.ready-card form { margin-top: auto; }
.ready-card h3 { margin: 0; font: 700 15px/22px var(--display); }
.ready-card h3 a { color: var(--ink); text-decoration: none; }
.ready-card h3 a:hover { color: var(--accent-deep); text-decoration: underline; }
.ready-card__source { font-size: 13px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.ready-card .button { min-height: 44px; width: 100%; }

.landing-teams { display: grid; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.landing-teams h2 { font-size: 22px; }
.landing-teams h3 { margin: 0; font: 700 15px/22px var(--text); }
.landing-teams p { color: var(--ink-soft); font-size: 14px; line-height: 22px; }
.landing-teams__intro { display: grid; gap: 8px; }
.landing-teams__item { display: grid; gap: 4px; }
@media (min-width: 1024px) {
    .landing-teams { grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 24px; }
}
.landing-footer { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; }
.landing-footer a { display: inline-flex; align-items: center; min-height: 24px; }

/* Stories (T-635, T-636): the story page, one screen. Works from 320 px. */
.story-field { display: grid; gap: 4px; margin: 0 0 12px; font-weight: 700; }
.story-field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--control); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; max-width: 100%; }
.story-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: story; }
.story-item { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line-card); border-radius: 12px; min-width: 0; }
.story-item__body { min-width: 0; }
.story-item__body p { overflow-wrap: anywhere; }
.story-thumb { width: 120px; height: auto; border: 1px solid var(--line-card); border-radius: 8px; background: #fff; }
@media (min-width: 560px) { .story-item { grid-template-columns: 120px minmax(0, 1fr); } }
.story-choice { grid-template-columns: 24px 36px 1fr; }
.story-glyph { display: block; width: 32px; height: 32px; border: 2px solid var(--ink-soft); border-radius: 4px; justify-self: center; }
.story-glyph--combined { background: linear-gradient(90deg, transparent 31%, var(--ink-soft) 31% 37%, transparent 37% 65%, var(--ink-soft) 65% 71%, transparent 71%); }
.story-glyph--series { border: 0; background: linear-gradient(90deg, var(--ink-soft) 0 28%, transparent 28% 36%, var(--ink-soft) 36% 64%, transparent 64% 72%, var(--ink-soft) 72%); border-radius: 2px; opacity: .6; }
.suggested { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-deep); font: 600 12px/22px var(--text); vertical-align: middle; }
.story-images { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.story-image-choice h3 { margin: 0 0 4px; }
.story-preview { display: block; width: 100%; max-width: 270px; height: auto; margin: 8px 0; border: 1px solid var(--line-card); border-radius: 8px; background: #fff; }
.story-sizes { border: 0; margin: 12px 0; padding: 0; display: grid; gap: 4px; }
.story-sizes legend { padding: 0; }
.story-sizes label { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.story-sizes input { width: 22px; height: 22px; accent-color: var(--accent-deep); }
.inline-form { display: inline; }
/* Recipes (T-643): catalogue cards, topic chips and the settings form. Works from 320 px. */
.recipe-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.recipe-topics .pill[aria-current="true"] { border-color: var(--accent-deep); background: var(--accent-tint); color: var(--ink); font-weight: 700; }
.recipe-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.recipe-card { display: grid; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 16px; min-width: 0; }
.recipe-card h2 a { color: var(--ink); text-decoration: none; }
.recipe-card h2 a:hover { color: var(--accent-deep); text-decoration: underline; }
.recipe-card__source { color: var(--ink-soft); font-size: 14px; line-height: 20px; }
.recipe-form { align-content: start; }
.recipe-field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.recipe-field legend { padding: 0 0 6px; display: grid; gap: 2px; }
.recipe-field select, .recipe-field input[type="number"] { min-height: 48px; width: 100%; max-width: 360px; padding: 0 12px; border: 1px solid var(--control); border-radius: 12px; background: var(--surface); color: var(--ink); }
.recipe-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; max-height: 336px; overflow-y: auto; padding: 2px; }
.recipe-check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface); cursor: pointer; }
.recipe-check:has(input:checked) { border-color: var(--accent-deep); background: var(--accent-tint); }
.recipe-check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent-deep); }
.recipe-check--wide { align-items: flex-start; padding: 10px 12px; }
@media (min-width: 720px) {
    .recipe-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Export sizes (T-231) */
.export-form { display: grid; gap: 8px; }
.export-form label { font-weight: 700; }
.export-form select { min-height: 44px; width: 100%; max-width: 100%; padding: 0 12px; border: 1px solid var(--control); border-radius: 12px; background: var(--surface); color: var(--ink); }
.size-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.size-card { display: grid; gap: 10px; align-content: start; }
.size-card h2 { font-size: 18px; line-height: 24px; margin: 0; }
.size-card p { margin: 0; }
.size-preview { border: 1px solid var(--line-card); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.size-preview { display: flex; justify-content: center; }
.size-preview img { display: block; max-width: 100%; max-height: 420px; width: auto; height: auto; }
.size-preview--alpha { background: repeating-conic-gradient(#d9dde3 0% 25%, #f3f4f6 0% 50%) 0 0 / 16px 16px; }

/* Details disclosure (UI_SIMPLIFICATION rule 5): ids, the query and coverage numbers live here. */
.details-box { border: 1px solid var(--line-card); border-radius: 12px; background: var(--surface); padding: 0 14px; }
.details-box > summary { color: var(--accent-deep); }
.details-box[open] { padding-bottom: 12px; }
.details-box .code, .code { font: 13px/20px var(--mono); overflow-wrap: anywhere; }
.figure { font-family: var(--mono); }

/* Answer screen (T-676, Atlas Answer.dc.html). Works from 360 px. */
.answer-top { gap: 12px; }
.answer-top .wordmark strong { font-size: 20px; }
.answer-top__question { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 14px; }
.app-bar .answer-top__status { margin-left: 0; }
.answer-top__new { min-height: 44px; padding: 0 14px; font-size: 14px; flex: none; }
@media (max-width: 599px) { .answer-top__status { display: none; } }
.read-strip { display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 12px; }
.read-strip__title { font: 700 13px/18px var(--text); color: var(--ink-soft); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; background: #f3f5f1; font-size: 13px; line-height: 20px; }
.read-strip__details > summary { min-height: 32px; color: var(--accent-deep); font-size: 13px; }
.read-strip__details { font-size: 13px; line-height: 20px; color: var(--ink-soft); }
.read-strip__details p { margin-top: 4px; overflow-wrap: anywhere; }
.answer-head { display: grid; gap: 4px; }
.answer-head h1 { font-size: 22px; line-height: 28px; }
@media (min-width: 600px) { .answer-head h1 { font-size: 28px; line-height: 34px; } }
.view-tabs { display: grid; grid-template-columns: repeat(var(--tabs, 4), minmax(0, 1fr)); padding: 4px; background: #f3f5f1; border-radius: 12px; max-width: 560px; }
.view-tabs a { min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 6px; border-radius: 9px; color: var(--ink); font-weight: 500; font-size: 14px; text-align: center; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
/* The focus ring of the design (2px #1f7d99 at 2px) drawn above the neighbouring tab. */
.view-tabs a:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.view-tabs a[aria-current="page"], .view-tabs a[aria-selected="true"] { background: var(--surface); font-weight: 700; box-shadow: 0 1px 2px rgba(17, 24, 39, .12), inset 0 -3px 0 var(--accent); }
.answer-card { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 16px; box-shadow: 0 1px 2px rgba(17, 24, 39, .06); min-width: 0; }
.answer-card .chart-frame { border: 0; border-radius: 0; }
.answer-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.answer-bar { width: 100%; display: grid; grid-template-columns: minmax(72px, 30%) minmax(0, 1fr) calc(var(--value-ch, 6) * 1ch + 2px); align-items: center; column-gap: 8px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 13px; text-align: left; cursor: pointer; }
.answer-bar:hover { background: var(--surface-2); }
.answer-bar[aria-pressed="true"] { background: #3ac7ec1f; color: var(--ink); font-weight: 700; }
.answer-bar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer-bar__track { display: block; position: relative; height: 22px; }
.answer-bar__fill { display: block; position: absolute; top: 0; height: 22px; background: #1a8fb5; border-radius: 0 4px 4px 0; transform-origin: left center; }
/* A fall runs left from the zero line, as in the exported chart (T-665). */
.answer-bar__fill--negative { border-radius: 4px 0 0 4px; transform-origin: right center; }
.answer-bar__zero { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #cfd4c8; }
.has-selection .answer-bar[aria-pressed="false"] .answer-bar__fill { background: #a9d6e5; }
.answer-bar[aria-pressed="true"] .answer-bar__fill { background: var(--accent-deep); }
.answer-bar__value { color: var(--ink); font-size: 14px; font-weight: 500; text-align: right; }
.answer-bar--focus .answer-bar__name { color: var(--ink); font-weight: 700; }
.answer-bar__fill[style*="--bar"] { background: var(--bar); }
.answer-areas { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.answer-areas > p { margin: 0 0 4px; font-size: 13px; }
.answer-bar--area { cursor: default; }
.answer-bar--area:hover { background: transparent; }
.answer-bar--area .answer-bar__fill { background: transparent; border: 2px dashed var(--accent-deep); }
.answer-bar__members { grid-column: 1 / -1; font-size: 13px; }
.answer-more { margin: 4px 0 0; font-size: 13px; }
.answer-source { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 18px; }
.answer-image > summary { font-size: 14px; }
.more-views { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.more-view { min-height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid #d5d9df; border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; text-align: center; text-decoration: none; }
.more-view--off { color: #9aa1ad; background: var(--surface-2); }
/* Draw in once, 300 ms ease-out (COMPETITIVE_AUDIT "right amount of sparkle"). */
@keyframes answer-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes answer-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.draw-in .answer-bar__fill { animation: answer-grow 300ms ease-out both; }
.draw-in .answer-draw .chart-frame svg { animation: answer-reveal 300ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
    .draw-in .answer-bar__fill, .draw-in .answer-draw .chart-frame svg { animation: none; }
}
/* Items behind a bar: a bottom sheet on phones, a panel on the right from 600 px. */
.items-sheet { margin: 0; padding: 8px 16px 16px; border: 0; background: var(--surface); color: var(--ink); max-width: none; }
.items-sheet[open] { display: grid; gap: 8px; align-content: start; }
.items-sheet::backdrop { background: rgba(17, 24, 39, .32); }
.items-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-top: 8px; }
.items-sheet__head h2 { font-size: 20px; line-height: 26px; }
.items-list { list-style: none; margin: 0; padding: 0; }
.items-list__item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.items-list__name { font-size: 15px; font-weight: 700; }
@media (max-width: 599px) {
    .items-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-height: 72vh; overflow-y: auto; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(17, 24, 39, .14); }
    .items-sheet::before { content: ""; justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: #d5d9df; }
}
@media (min-width: 600px) {
    .items-sheet { position: fixed; inset: 0 0 0 auto; width: 340px; height: 100%; max-height: none; overflow-y: auto; border-left: 1px solid var(--line-card); box-shadow: 0 8px 24px rgba(17, 24, 39, .12); z-index: 20; padding: 20px; }
}
/* Compact: one pinned bar with the primary action (handoff README). */
.action-bar { display: none; }
@media (max-width: 599px) {
    .answer-body .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
    .action-bar .button { min-height: 48px; }
    .publish-inline { display: none; }
}
/* Waiting page steps and the empty chart (T-676). */
.work-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; line-height: 22px; }
.work-step { display: flex; gap: 10px; }
.work-step__mark { width: 1.2em; font-weight: 700; }
.work-step--done .work-step__mark { color: var(--good); }
.work-step--now .work-step__mark { color: var(--accent-deep); }
.work-step--next { color: var(--muted); }
.skeleton-chart { display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line-card); border-radius: 16px; }
.skeleton-line { display: block; height: 20px; background: #eef0ec; border-radius: 6px; }
.skeleton-line--thin { height: 12px; }
.skeleton-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: center; }
.skeleton-bar { display: block; height: 22px; background: #eef0ec; border-radius: 0 4px 4px 0; }
.data-table th.num { font-family: var(--text); }
/* Brand kits (T-677, Atlas Brand Kit.dc.html). Works from 360 px. */
.kit-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.kit-card h2 { font-size: 18px; line-height: 24px; }
.kit-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.kit-swatch { display: inline-block; width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(17, 24, 39, .12); }
.kit-ok { color: var(--good); font-weight: 700; }
.kit-form { display: grid; gap: 8px; }
.kit-form label { font-weight: 700; }
.kit-form select, .kit-editor select, .text-field { min-height: 48px; width: 100%; max-width: 360px; padding: 0 12px; border: 1px solid var(--control); border-radius: 12px; background: var(--surface); color: var(--ink); }
.kit-editor { display: grid; gap: 24px; align-items: start; }
.kit-editor fieldset { min-width: 0; }
.kit-editor .recipe-field select { margin-bottom: 8px; }
.colour-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.colour-row { display: grid; grid-template-columns: 20px 44px minmax(0, 160px) 20px; gap: 8px; align-items: center; }
.colour-row__swatch { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--line-card); border-radius: 10px; background: var(--surface); }
.colour-row__flag { color: var(--warn); font-weight: 700; }
.kit-alert { display: grid; gap: 8px; }
.kit-alert .button { justify-self: start; }
.kit-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kit-suggest .kit-swatch { width: 20px; height: 20px; border-radius: 4px; }
.kit-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-preview-pane { display: grid; gap: 8px; }
.kit-preview { margin: 0; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line-card); border-radius: 12px; background: var(--kit-bg); color: var(--kit-ink); font-family: var(--kit-label-font), sans-serif; }
.kit-preview figcaption strong { color: var(--kit-title); font-family: var(--kit-title-font), sans-serif; }
.kit-preview figcaption span, .kit-preview__foot { color: var(--kit-muted); }
.kit-preview figcaption { display: grid; gap: 2px; font-size: 13px; }
.kit-preview figcaption strong { font-size: 17px; line-height: 24px; }
.kit-preview__row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
.kit-preview__bar { display: block; height: 20px; border-radius: 0 4px 4px 0; }
.kit-preview__foot { font-size: 12px; }
.kit-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 900px) {
    .kit-editor { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
    .kit-preview-pane { position: sticky; top: 16px; }
    .kit-actions { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
    .kit-body .page { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
    .kit-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.4fr; }
    .kit-actions p { grid-column: 1 / -1; font-size: 13px; line-height: 18px; }
}

/* Dropdowns: draw the arrow so it sits 14px from the right edge on every browser (native arrows ignore padding). */
select:not([multiple]):not([size]) {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23374151' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}
select:not([multiple]):not([size]):disabled { cursor: not-allowed; opacity: .6; }
/* Research runs (T-706, ATLAS_91). Owner only. Works from 360 px. */
.research-form textarea { width: 100%; min-height: 96px; padding: 12px; border: 1px solid var(--control); border-radius: 12px; font: inherit; resize: vertical; }
.research-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.research-chart { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.research-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-card); font-size: 13px; font-weight: 700; }
.research-tag--ai { background: var(--surface-2); }
.research-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.research-log dl { margin: 0; display: grid; gap: 6px; }
.research-log dt { font-weight: 700; }
.research-log dd { margin: 0; overflow-wrap: anywhere; }

/* Usage levels (D-061, T-731): the use question, the "For private use" mark and Sources and permissions.
   Shown only for an output with a private-use source; every other screen is unchanged. */
.use-question { border-color: var(--ink); }
.use-question h2 { margin: 0; }
.use-choices { display: grid; gap: 8px; }
.use-choice { width: 100%; height: auto; min-height: 48px; padding: 10px 16px; justify-content: flex-start; text-align: left; white-space: normal; line-height: 22px; }
.use-choice-note { margin: 0 0 4px; font-size: 14px; line-height: 20px; }
.use-both { justify-self: start; min-height: 44px; }
.use-change { display: grid; gap: 4px; justify-items: start; }
.use-change .link-button { min-height: 44px; }
.app-bar .bar-status.use-mark, .use-mark { padding: 2px 10px; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.level-badge { display: inline-block; padding: 0 8px; border: 1px solid var(--good); border-radius: 999px; color: var(--good); font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.level-badge--private { border-color: var(--ink); color: var(--ink); }
.permissions { display: grid; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.permissions h3 { margin: 8px 0 0; font: 700 17px/24px var(--display); }
.permissions p { margin: 0; }
.permissions__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.permissions__row { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.left-out { padding: 12px; border: 1px dashed var(--control); border-radius: 12px; }
/* The private mark stays on phones: the plain "Private" status hides below 600 px, "For private use" never does. */
@media (max-width: 599px) { .answer-top__status.use-mark { display: inline-block; font-size: 13px; padding: 2px 8px; } }
.about .permissions__list, .permissions .permissions__list { padding-left: 0; }
.action-bar .action-bar__wide { grid-column: 1 / -1; }
