/* Theme surfaces preserve the original blue / lime art direction. */
:root {
  color-scheme: light;
  --surface: #fff;
  --soft-surface: #edf1f7;
  --scene-surface: #e2e9f5;
  --chat-surface: #f2f5fc;
  --field-surface: #fff;
  --switch-surface: #e4e8f0;
  --message-surface: #dce7ff;
  --surface-line: #d3ddeb;
  --small-ink: #52627c;
  --heading-muted: #737b89;
  --accent-ink: #3354ed;
  --card-shadow: #38466f45;
  --use-bar: #dce2f5;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10131b;
  --ink: #edf1fa;
  --muted: #a9b3c6;
  --line: #30394b;
  --ice: #283858;
  --surface: #1b2230;
  --soft-surface: #151c28;
  --scene-surface: #202c40;
  --chat-surface: #151d2c;
  --field-surface: #222d40;
  --switch-surface: #111a29;
  --message-surface: #293e65;
  --surface-line: #3a4860;
  --small-ink: #b4c3dc;
  --heading-muted: #9ca9bd;
  --accent-ink: #a0b2ff;
  --card-shadow: #00000070;
  --use-bar: #293c65;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #10131b; --ink: #edf1fa; --muted: #a9b3c6; --line: #30394b;
    --ice: #283858; --surface: #1b2230; --soft-surface: #151c28;
    --scene-surface: #202c40; --chat-surface: #151d2c; --field-surface: #222d40;
    --switch-surface: #111a29; --message-surface: #293e65; --surface-line: #3a4860;
    --small-ink: #b4c3dc; --heading-muted: #9ca9bd; --accent-ink: #a0b2ff;
    --card-shadow: #00000070; --use-bar: #293c65;
  }
  :root:not([data-theme]) .brand-in-light { display: none; }
  :root:not([data-theme]) .brand-in-dark { display: block; }
}
.header { gap: 24px; }
.header .brand, .footer .brand { flex: 0 0 330px; letter-spacing: normal; }
.brand-full { display: block; width: 330px; }
.brand-full img { display: block; width: 100%; height: auto; }
.brand-symbol { display: none; }
.brand-in-dark { display: none !important; }
[data-theme="dark"] .brand-in-light { display: none !important; }
[data-theme="dark"] .brand-in-dark { display: block !important; }
.mini-brand img { width: 30px; height: 30px; display: block; }
.mini-brand { border-radius: 12px; flex-shrink: 0; }
.header-actions { display: flex; gap: 14px; align-items: center; }
.header nav { gap: 24px; white-space: nowrap; }
.theme-picker { display: flex; align-items: center; position: relative; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; flex-shrink: 0; }
.theme-picker svg { width: 20px; height: 20px; margin: auto; pointer-events: none; }
.theme-picker select { cursor: pointer; position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; }
.theme-picker:focus-within { outline: 3px solid var(--accent-ink); outline-offset: 4px; }
.theme-picker:hover { background: var(--ice); }
.theme-picker select option { background: var(--surface); color: var(--ink); }
.muted { color: var(--heading-muted); }
.button-dark { background: var(--ink); color: var(--paper); }
.button-white, .button-lime { color: #191b22; }
.heading-asterisk, .blue-dot, .less-grid h2 > span, .chat-title > svg { color: var(--accent-ink); }
.hero-chat, .transaction { background: var(--surface); border-color: var(--surface-line); box-shadow: 0 30px 65px -30px var(--card-shadow); }
.chat-title { border-color: var(--surface-line); }
.chat-body, .story-messages { background: var(--chat-surface); }
.bubble-in { background: var(--surface); border-color: var(--surface-line); }
.bubble-out { background: var(--message-surface); }
.bubble-out > span, .chat-date, .story-note, .story-visual-top { color: var(--small-ink); }
.bubble-out b, .bubble-success svg { color: var(--accent-ink); }
.bubble-category > span { background: var(--switch-surface); color: var(--ink); }
.event-icon { color: var(--accent-ink); }
.orbit { border-color: var(--surface-line); }
.stage-grid { background-image: radial-gradient(var(--surface-line) 1px, transparent 1px); }
.balance-card, .final-receipt, .use-balance i { color: #191b22; }
.cross-list span { color: var(--muted); }
.cross-list span:after { background: var(--muted); }
.how-section { background: var(--soft-surface); }
.story-step { border-color: var(--surface-line); }
.story-step.is-active .step-number, .story-step.is-active .step-arrow { color: var(--accent-ink); }
.story-visual { background: var(--scene-surface); }
.story-visual:after { border-color: var(--surface-line); }
.story-window { background: var(--surface); border-color: var(--surface-line); }
.welcome-icon { color: var(--accent-ink); }
.category-track span { color: var(--small-ink); border-color: var(--surface-line); }
.story-dots i { background: var(--surface-line); }
.story-dots i.active { background: var(--accent-ink); }
.demo-chat { background: var(--chat-surface); }
.demo-bot-message { background: var(--surface); border-color: var(--surface-line); }
.demo-bot-message.success svg { color: var(--accent-ink); }
.demo-user-message { background: var(--message-surface); }
.demo-tag { color: var(--small-ink); border-color: var(--surface-line); }
.type-switch { background: var(--switch-surface); }
.type-switch span { color: var(--muted); }
.type-switch input:checked + span { background: var(--field-surface); color: var(--ink); }
.form-fields label { color: var(--muted); }
.form-fields input, .form-fields select { background: var(--field-surface); border-color: var(--surface-line); color: var(--ink); }
.form-fields select:disabled { opacity: .7; }
.quick-examples button { background: var(--field-surface); border-color: var(--surface-line); color: var(--small-ink); }
.use-coffee { background: var(--surface); border-color: var(--surface-line); }
.use-coffee > i { color: var(--accent-ink); }
.use-bars i { background: var(--use-bar); }
.use-bars i:nth-child(4) { background: var(--blue); }
.use-bars i:nth-child(6) { background: #8fa5ff; }
.faq-list summary > span { background: var(--switch-surface); }
.faq-list details[open] summary > span { background: var(--ice); color: var(--accent-ink); }
.motion-control { background: var(--surface); color: var(--ink); border-color: var(--surface-line); }
.skip-link, .site-toast { background: var(--ink); color: var(--paper); }
.demo-chat :focus-visible, .type-switch input:focus-visible + span { outline-color: var(--accent-ink); }
.test-label { color: var(--small-ink); }
.form-error { color: #b21e32; }
[data-theme="dark"] .form-error { color: #ffb8c6; }
[data-theme="dark"] .form-fields input[aria-invalid="true"] { border-color: #ffb8c6; }
[data-theme="dark"] .hero-chat, [data-theme="dark"] .story-window { box-shadow: 0 32px 70px -25px #0009; }
[data-theme="dark"] .hero-stage .salary { border-color: #546d3f; }
[data-theme="dark"] .event-check { color: #d5f77b; border-color: #83a548; }

/* More space for the data, plus category inspection. */
.demo-workspace { grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr); }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 9px; }
.chart-toolbar h3 { font-size: 14px; font-weight: 500; letter-spacing: -.025em; }
.chart-toolbar button { min-height: 40px; border: 1px solid transparent; border-radius: 30px; padding: 8px 11px; background: transparent; color: #bdc9df; font-size: 11px; }
.chart-toolbar button[aria-pressed="true"] { background: #343f52; color: #fff; }
.chart-toolbar button:hover { border-color: #647594; }
.chart-layout { grid-template-columns: minmax(190px, 1.05fr) minmax(165px, 1fr); gap: 20px; }
.donut-wrap { max-width: 300px; width: 100%; }
.donut-track, .donut circle.segment { stroke-width: 17; }
.donut circle.segment { transition: stroke-dasharray .7s var(--ease), stroke-dashoffset .7s var(--ease), opacity .25s, stroke-width .25s; }
.donut circle.segment.is-muted { opacity: .16 !important; }
.donut circle.segment.is-selected { stroke-width: 21; }
.donut-center { gap: 7px; }
.donut-center strong { font-size: 31px; }
.donut-center span { font-size: 12px; }
.chart-legend { gap: 7px; }
.chart-legend li { display: block; }
.legend-category { padding: 10px 11px; display: block; width: 100%; min-height: 53px; text-align: left; color: #fff; background: transparent; border: 1px solid transparent; border-radius: 11px; transition: background .2s, border-color .2s; }
.legend-category:hover, .legend-category[aria-pressed="true"] { background: #303a4c; border-color: #51617d; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-row span, .legend-row b { font-size: 12px; }
.legend-row i { width: 7px; height: 7px; }
.legend-bar { display: block; height: 3px; border-radius: 3px; background: #3c485e; margin: 9px 0 0 15px; overflow: hidden; }
.legend-bar em { display: block; height: 100%; width: var(--share); background: var(--color); border-radius: inherit; transition: width .55s var(--ease); }
.trend-panel { margin-top: 24px; padding: 31px 35px 24px; border: 1px solid #424956; border-radius: 28px; background: #22262f; }
.trend-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.trend-eyebrow { font-size: 12px; color: #b3bfd5; }
.trend-heading h3 { font-size: 28px; font-weight: 500; letter-spacing: -.045em; margin-top: 10px; }
.trend-switch { display: flex; align-items: center; padding: 4px; background: #161c26; border-radius: 30px; gap: 3px; }
.trend-switch button { min-height: 40px; padding: 10px 20px; color: #b8c4d8; background: transparent; border-radius: 30px; font-size: 13px; }
.trend-switch button[aria-pressed="true"] { background: #d5f77b; color: #191b22; }
.trend-key { margin-top: 28px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 17px; min-height: 43px; }
.trend-key > span { color: #b3bfd5; font-size: 13px; }
.trend-key strong { font-size: 31px; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.trend-key > span:last-child { font-size: 11px; margin-left: auto; }
.trend-plot { height: 220px; margin: 7px -4px 0; }
.trend-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.trend-grid path { fill: none; stroke: #3c485d; stroke-width: 1; stroke-dasharray: 3 7; vector-effect: non-scaling-stroke; }
.trend-point { fill: #22262f; stroke: #9babff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-point.active { fill: #d5f77b; stroke: #d5f77b; }
.trend-points { display: grid; grid-template-columns: repeat(var(--points, 6), minmax(0, 1fr)); gap: 8px; }
.trend-points button { padding: 9px 7px; min-height: 44px; border-radius: 9px; color: #b8c4d8; background: transparent; border: 1px solid transparent; font-size: 11px; overflow-wrap: anywhere; }
.trend-points button[aria-pressed="true"], .trend-points button:hover { color: white; background: #303a4c; border-color: #536381; }
.trend-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; border-top: 1px solid #3c4451; margin-top: 20px; padding-top: 19px; color: #abb8cf; font-size: 11px; line-height: 1.6; }
html:not(.js) .chart-toolbar, html:not(.js) .trend-panel { display: none; }

@media (hover: hover) and (pointer: fine) {
  .button-dark:hover { background: var(--ink); color: var(--paper); }
  .text-link:hover, .faq-list summary:hover, .step-button:hover .step-arrow { color: var(--accent-ink); }
}
@media (max-width: 1200px) {
  .header nav { display: none; }
  .demo-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .chart-layout { grid-template-columns: 1fr; gap: 6px; }
  .donut-wrap { max-width: 270px; margin: auto; }
  .chart-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .legend-row { flex-wrap: wrap; gap: 6px; }
  .legend-row b { margin-left: 13px; }
  .legend-bar { margin-left: 0; }
  .legend-category { padding: 10px 8px; }
}
@media (max-width: 800px) {
  .header .brand { flex-basis: 320px; }
  .brand-full { width: 320px; }
  .demo-workspace { grid-template-columns: 1fr; }
  .chart-layout { max-width: none; grid-template-columns: minmax(210px, 1fr) minmax(200px, 1fr); gap: 24px; }
  .chart-legend { grid-template-columns: 1fr; }
  .legend-row { flex-wrap: nowrap; }
  .legend-row b { margin-left: auto; }
  .legend-bar { margin-left: 15px; }
  .trend-panel { padding: 27px 25px 23px; }
  .trend-heading h3 { font-size: 26px; }
  .footer { gap: 26px; }
}
@media (max-width: 700px) {
  .header { gap: 18px; }
  .header .brand { flex: 0 0 44px; }
  .header .brand-full { display: none; }
  .header .brand-symbol { display: block; width: 44px; height: 44px; }
  .brand-symbol img { width: 44px; height: 44px; }
  .header-actions { gap: 12px; }
  .theme-picker { width: 42px; height: 42px; }
  .header .button-small { min-height: 44px; }
  .footer .brand { flex: 0 1 330px; max-width: 100%; }
  .footer .brand-full { width: min(330px, 100%); }
  .footer p { margin: 0; }
  .chart-layout { grid-template-columns: 1fr; }
  .donut-wrap { max-width: 285px; }
  .chart-legend { grid-template-columns: 1fr; gap: 5px; }
  .legend-row span, .legend-row b { font-size: 14px; }
  .legend-category { padding: 11px 13px; }
  .chart-legend li:first-child { grid-column: auto; }
  .chart-toolbar { margin-top: 0; }
  .chart-toolbar h3 { font-size: 14px; }
  .chart-toolbar button { font-size: 11px; padding: 8px; }
  .trend-panel { border-radius: 22px; padding: 25px 18px 21px; }
  .trend-heading { flex-direction: column; align-items: stretch; gap: 21px; }
  .trend-eyebrow { font-size: 11px; }
  .trend-heading h3 { font-size: 28px; }
  .trend-switch { width: fit-content; }
  .trend-switch button { font-size: 12px; padding: 10px 20px; }
  .trend-key { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 24px; }
  .trend-key strong { grid-column: 1 / -1; grid-row: 2; font-size: clamp(20px, 5.5vw, 28px); overflow-wrap: anywhere; }
  .trend-key > span:last-child { grid-column: 2; grid-row: 1; align-self: center; font-size: 10px; }
  .trend-plot { height: 185px; }
  .trend-points { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .trend-points button { font-size: 11px; padding: 8px; }
  .trend-caption { display: block; font-size: 11px; }
  .trend-caption p + p { margin-top: 6px; }
  .donut-center strong { font-size: 33px; }
  .donut-center span { font-size: 13px; }
}
@media (max-width: 359px) {
  .header-actions { gap: 10px; }
  .chart-toolbar { flex-wrap: wrap; gap: 3px; }
  .trend-heading h3 { font-size: 26px; }
  .trend-key strong { font-size: 22px; }
  .legend-row span, .legend-row b { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .donut circle.segment, .legend-bar em, .legend-category { transition: none; }
}
.motion-off .donut circle.segment, .motion-off .legend-bar em { transition: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .brand-in-light { display: none !important; }
  :root:not([data-theme]) .brand-in-dark { display: block !important; }
  :root:not([data-theme]) .form-error { color: #ffb8c6; }
}

@media (max-width: 540px) { .story-step.is-active .step-button { color: var(--accent-ink); } }
