/* ==========================================================================
   2ools — symbol picker
   Design tokens first, then components. Every colour, radius and timing is a
   variable, which is why moving from the dark theme to this one was a palette
   swap rather than a rewrite. No external fonts or icon libraries: the page must
   render instantly and work offline.

   Contrast: every text colour below was measured against the surface it sits on.
   Body 17.5:1, muted 6.3:1, faint and deep orange 5.0:1, warning 7.1:1 -- all
   above the 4.5:1 AA threshold. Vivid orange fails as *text* (3.5:1), so it is
   used only for fills, bars and decoration, never for a word on the canvas.
   ========================================================================== */

/* `hidden` has to beat any author `display`. The UA rule is
   `[hidden] { display: none }`, and that loses to a class which sets `display` --
   as `.cta__spinner` now does. The element then stays laid out, and any animation
   on it keeps running, while it is marked hidden. */
[hidden] { display: none !important; }

:root {
  /* Canvas: warm off-white. Pure #fff reads as a default; a touch of warmth
     ties the page to the accent and looks deliberate. */
  --bg:             #FFFBF7;
  --surface:        #FFFFFF;
  --surface-top:    #FFFFFF;
  --surface-bottom: #FFF9F4;
  --surface-hover:  rgba(194, 65, 12, 0.05);
  --surface-strong: rgba(194, 65, 12, 0.07);
  --surface-press:  rgba(194, 65, 12, 0.12);
  --surface-sunken: rgba(194, 65, 12, 0.035);
  --field-top:      #FFFFFF;
  --field-bottom:   #FFFCF8;
  --panel-bg:       rgba(255, 255, 255, 0.95);
  --track:          rgba(28, 21, 18, 0.09);

  --border:        #EEE2D6;
  --border-subtle: rgba(28, 21, 18, 0.07);
  --border-strong: #DECBB8;
  --input-bg:      #FFFFFF;

  --text:       #1C1512;
  --text-muted: #6B5B50;
  --text-faint: #7A6A5E;

  /* Three oranges, split by what they can safely carry. White on --accent is
     5.18:1 and on --accent-deep 7.31:1, so those two may hold text; a gradient
     ramps between them, which keeps the lightest point of any such surface at
     5.18:1. White on --accent-vivid is only 3.56:1, so it never carries
     text — it is for decoration and type large enough to need just 3:1. */
  --accent:       #C2410C;
  --accent-deep:  #9A3412;
  --accent-vivid: #EA580C;
  --accent-soft:  rgba(194, 65, 12, 0.09);
  --accent-ring:  rgba(234, 88, 12, 0.26);
  --accent-sheen: rgba(255, 255, 255, 0.30);
  /* The rule under the hero's accent word. Pure decoration drawn below the
     glyphs, so it costs no contrast at all -- a marker block behind the text
     would have to stay under 0.10 alpha to keep the word legible, which is too
     faint to read as deliberate. As a thin line rather than a wide band it needs
     a little more alpha than a block would to hold the same visual weight. */
  --accent-swash: rgba(234, 88, 12, 0.45);
  --accent-glow:  rgba(234, 88, 12, 0.13);
  --warm-glow:    rgba(245, 158, 11, 0.11);
  --texture-ink:  rgba(194, 65, 12, 0.030);
  --on-accent:    #FFFFFF;

  /* Direction keeps the conventional signal: orange is the brand, not the
     forecast. Vivid variants are for large type and bars, which need only 3:1. */
  --up:          #15803D;
  --up-vivid:    #16A34A;
  --up-soft:     rgba(21, 128, 61, 0.10);
  --up-ring:     rgba(21, 128, 61, 0.40);
  --up-ring-0:   rgba(21, 128, 61, 0);
  --down:        #B91C1C;
  --down-vivid:  #DC2626;
  --down-soft:   rgba(185, 28, 28, 0.10);

  --warn-text:   #92400E;
  --warn-bg:     rgba(245, 158, 11, 0.10);
  --warn-border: rgba(217, 119, 6, 0.38);
  --danger-text: #B91C1C;
  --danger:      #DC2626;
  --danger-ring: rgba(220, 38, 38, 0.18);
  --ok-text:     #15803D;

  --scroll-thumb:       rgba(28, 21, 18, 0.18);
  --scroll-thumb-hover: rgba(28, 21, 18, 0.32);

  --radius-sm: 9px;
  --radius:    14px;
  --radius-lg: 22px;

  /* Warm shadows: a neutral grey shadow on a warm canvas looks like dirt. */
  --shadow-field: 0 1px 2px rgba(28, 21, 18, 0.05),
                  0 12px 28px -16px rgba(28, 21, 18, 0.20);
  --shadow-pop:   0 26px 60px -20px rgba(28, 21, 18, 0.26),
                  0 0 0 1px rgba(28, 21, 18, 0.05);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 130ms;
  --base: 200ms;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text",
               "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --shell: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* Reserve the scrollbar's width whether or not this page scrolls. The picker
     and the dossier are different lengths, so on a tall window one of them
     scrolls and the other does not -- and with the column centred, that moved
     the whole header 8px sideways when the reader switched sections. */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient warmth. Fixed and non-interactive so it never interferes with hit
   testing and never causes a repaint on scroll. */
.aurora {
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 70vh;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(46% 52% at 22% 30%, var(--accent-glow), transparent 68%),
    radial-gradient(38% 44% at 78% 18%, var(--warm-glow), transparent 66%);
  filter: blur(20px);
}

/* Texture: a fine orange pinstripe, faded out before the content begins. At
   full strength it reads as wallpaper; masked and at 3% it reads as paper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    135deg,
    var(--texture-ink) 0 1px,
    transparent 1px 8px
  );
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 40%, transparent 72%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 40%, transparent 72%);
}

a { color: inherit; text-decoration: none; }
/* The admin control, the section switch, the model teaser, the sign-in link on
   the dossier, the dossier's back control and the coins badge are surfaces of
   their own, so none of them may inherit the link underline. */
a:not(.brand):not(.admin-link):not(.auth-btn):not(.switch__tab):not(.model-teaser):not(.dossier__back):not(.user-coins-badge) { border-bottom: 1px solid var(--border-strong); }
a:not(.brand):not(.admin-link):not(.auth-btn):not(.switch__tab):not(.model-teaser):not(.dossier__back):not(.user-coins-badge):hover { color: var(--text); border-bottom-color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Top bar ───────────────────────────────────────────────────────────── */

.topbar {
  position: relative;
  z-index: 2;
  width: min(var(--shell), 100% - 3rem);
  margin: 0 auto;
  padding: 1.75rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; }

.brand__mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 22px -8px var(--accent-ring);
}

.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
/* Name and credit share a line, baseline-aligned, so the mark stays compact. */
.brand__line { display: flex; align-items: baseline; gap: 0.5rem; }
.brand__name { font-weight: 700; letter-spacing: -0.02em; }
.brand__from {
  /* Subordinate to the wordmark, but not below the ~12px floor where a
     permanent credit line starts to read as fine print. At 0.72rem (11.5px) it
     was the smallest text on the page and looked like an afterthought rather
     than a credit. */
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--accent);
}
.brand__tag {
  font-size: 0.66rem;
  color: var(--text-faint);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.universe {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0;
  font-size: 0.775rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.universe__pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 0 var(--up-ring);
  animation: pulse 2.6s var(--ease) infinite;
}

.topbar__right { display: flex; align-items: center; gap: 0.85rem; }

/* Admin entry point. Always present: the credential is the boundary, not
   obscurity of the URL. */
.admin-link {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  transition: border-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              background var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.admin-link svg { width: 17px; height: 17px; }
.admin-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

/* ── Section switch ────────────────────────────────────────────────────── */
/* Contained in the page column and sized to its own labels. Full-bleed it read
   as a band of chrome; ending where the content ends is what makes two segments
   read as a switch rather than as a page frame.

   The active segment is a raised thumb rather than a coloured fill: elevation is
   what "selected" looks like in a control, and it leaves the accent free to mark
   only the label. The thumb is a single element moved by `data-active`, so any
   future in-page switch animates by flipping one attribute. */

.sectionbar {
  position: relative;
  z-index: 2;
  width: min(var(--shell), 100% - 3rem);
  /* Air above matches the gap the stage puts below, so the control sits in the
     middle of the space rather than hugging the header. */
  margin: 1.1rem auto 0;
  display: flex;
  /* Centred: the two halves are equal, so a centred control is the only
     placement where the switch is symmetrical about the page. */
  justify-content: center;
}

.switch {
  position: relative;
  display: grid;
  /* minmax(0, 1fr), not 1fr: an `auto` minimum lets the widest label (the one
     with the dot) widen its own column, which desynchronises the thumb. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* A definite width rather than fit-content: each segment is then an equal,
     generous target, and the thumb's maths stays exact. Capped so it never
     becomes the full-bleed band again, floored by the column on phones. */
  width: min(100%, 30rem);
  padding: 4px;
  border: 1px solid var(--border);
  /* Recessed track: the sunken tone plus an inset shadow makes the thumb look
     lifted out of it rather than drawn on top. At --surface-sunken alone the
     track was indistinguishable from the page, so the control read as a pill
     floating on its own. */
  background: rgba(194, 65, 12, 0.06);
  border-radius: 100px;
  box-shadow: inset 0 1px 3px rgba(28, 21, 18, 0.08);
}

.switch__thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  /* One segment wide. 100% here is the padding box, whose content is 8px
     narrower, so (100% - 8px) / 2 is exactly half of the track. */
  width: calc((100% - 8px) / 2);
  border-radius: 100px;
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
  box-shadow: 0 1px 2px rgba(28, 21, 18, 0.09),
              0 10px 22px -12px rgba(28, 21, 18, 0.55),
              0 8px 18px -14px var(--accent-ring),
              inset 0 0 0 1px rgba(194, 65, 12, 0.14);
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  /* Opacity only -- a transform here would fight the translateX below. */
  animation: thumb-in 240ms var(--ease);
}
.switch[data-active="performance"] .switch__thumb { transform: translateX(100%); }

@keyframes thumb-in {
  from { opacity: 0; }
}

.switch__tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Zero minimum so a long label cannot widen its own track. */
  min-width: 0;
  padding: 0.62rem 1.25rem;
  border-radius: 100px;
  font-size: 0.9rem;
  /* Same weight in both states: a weight change would resize the segments and
     make the thumb jump when the state changes. */
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--text-muted);
  transition: color var(--base) var(--ease);
}
/* --accent-deep on the raised thumb measures 7.31:1. */
.switch__tab[aria-current="page"] { color: var(--accent-deep); }

/* The peek. Pointing at a segment sends the thumb there before the click, so the
   control answers the cursor instead of waiting for it -- and because the thumb
   is the same element that will be there after navigation, the hover is a
   truthful preview of what clicking does, not decoration. The label identity
   follows the thumb: the current page dims, the pointed-at one takes the accent.
   `focus-visible` is bundled in so a keyboard reader gets the same preview.

   `:has()` degrades to "no peek" on older engines, which is why every state
   above is also correct without it. */
.switch:has(.switch__tab:is(:hover, :focus-visible)) .switch__tab[aria-current="page"] {
  color: var(--text-muted);
}
.switch:has(.switch__tab:is(:hover, :focus-visible)) .switch__tab:is(:hover, :focus-visible) {
  color: var(--accent-deep);
}
.switch:has(.switch__tab:first-child:is(:hover, :focus-visible)) .switch__thumb {
  transform: translateX(0);
}
.switch:has(.switch__tab:last-child:is(:hover, :focus-visible)) .switch__thumb {
  transform: translateX(100%);
}

/* ── Locked destination ────────────────────────────────────────────────── */
/* The Record requires a session. Rather than hide Performance from visitors,
   show it locked; session.js removes the lock for signed-in leads. The server
   remains the real boundary. */
.switch__tab[data-locked] .switch__label::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: 0.4rem;
  background-color: currentColor;
  opacity: 0.55;
  /* A padlock, drawn rather than imported: the page ships no icon library. */
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Crect x='4' y='10.5' width='16' height='10' rx='2.2'/%3E%3Cpath d='M8 10.5V7a4 4 0 0 1 8 0v3.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Crect x='4' y='10.5' width='16' height='10' rx='2.2'/%3E%3Cpath d='M8 10.5V7a4 4 0 0 1 8 0v3.5'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.switch__label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* A live dot on the segment we want clicked. Same idle-pulse language as the
   universe counter, so it reads as "new", not as a notification badge. */
.switch__spark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-vivid);
  box-shadow: 0 0 0 0 var(--accent-ring);
  animation: tab-pulse 2.6s var(--ease) infinite;
}
@keyframes tab-pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring); }
  70%  { box-shadow: 0 0 0 6px rgba(234, 88, 12, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 var(--up-ring); }
  70%  { box-shadow: 0 0 0 7px var(--up-ring-0); }
  100% { box-shadow: 0 0 0 0 var(--up-ring-0); }
}

/* ── Stage ─────────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(var(--shell), 100% - 3rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 9vh, 6rem) 0 3rem;
}

/* The switch above already separates the header from the page, so the stage does
   not need its full opening breath underneath it. */
.sectionbar + .stage {
  padding-top: clamp(1.6rem, 5vh, 3rem);
}

.hero { margin-bottom: 2.25rem; }

.hero__eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  /* Sized to sit as a headline over a 46rem column rather than to fill the
     screen. The longer wording wraps to two lines at any sensible width, so the
     ceiling is set for that rather than for one very wide line. */
  margin: 0;
  font-size: clamp(1.75rem, 4.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  /* inline-block keeps the gradient box tight around the word. */
  display: inline-block;
  /* Vivid-to-deep orange, clipped to the glyphs. Decorative, so it may use the
     vivid tone that would fail contrast as plain body text. */
  background: linear-gradient(100deg, var(--accent-vivid), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* The descender needs painting room the line box does not give it.

     With `background-clip: text` and a transparent colour, the glyphs are
     painted by the *background*, and a background only exists inside the padding
     box. Measured at 40px: the box ends at 296.8 while the g's ink reaches 299.7,
     so the bottom 2.9px of the descender had nothing to paint it and was simply
     missing -- which is the "eclipsed" tail. The negative margin cancels the
     padding exactly, so the layout box is unchanged and nothing on the page
     moves; only the paintable area grows. */
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
  /* A real underline, not a bar drawn behind the glyphs. A bar has to be placed
     below the baseline, which puts it straight across the descender, and the
     descender is the same orange as the bar. Nudging the bar clear of the
     descender needs ~0.2em of drop and leaves it detached from the word, with
     about a pixel of margin either way. text-decoration-skip-ink breaks the rule
     around the descender by itself and, unlike hard-coded geometry, survives a
     font or size change. */
  text-decoration: underline;
  text-decoration-color: var(--accent-swash);
  text-decoration-thickness: 0.085em;
  text-underline-offset: 0.07em;
  text-decoration-skip-ink: auto;
}

/* The swash. Sits just under the baseline and BEHIND the glyphs, so the "g" tail
   paints over it the way a highlighter stroke passes behind a descender.
   Positioning it clear of the descender instead would need ~0.23em of clearance,
   which leaves the bar visibly detached from the word. */
/* ── Search field ──────────────────────────────────────────────────────── */

.picker { position: relative; }

/* Positioning context for the popup. It must hang off the bottom of the field,
   not the bottom of the section, which also contains the status line. */
.fieldwrap { position: relative; }

.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 1.05rem;
  height: 4.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--field-top), var(--field-bottom));
  box-shadow: var(--shadow-field);
  transition: border-color var(--base) var(--ease),
              box-shadow var(--base) var(--ease),
              transform var(--base) var(--ease);
}

.field:hover { border-color: var(--border-strong); }

.field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-field), 0 0 0 4px var(--accent-soft);
}

.field__icon {
  width: 21px; height: 21px;
  flex: none;
  color: var(--text-faint);
  transition: color var(--base) var(--ease);
}
.field:focus-within .field__icon { color: var(--accent); }

.field__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.16rem;
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.field__input::placeholder {
  color: var(--text-faint);
  text-transform: none;
  letter-spacing: 0.01em;
  font-family: var(--font-sans);
  font-weight: 400;
}
.field__input:focus { outline: none; }

.field__spinner {
  flex: none;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field__kbd {
  flex: none;
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--surface-sunken);
}

.field__clear {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.field__clear svg { width: 15px; height: 15px; }
.field__clear:hover { background: var(--surface-press); color: var(--text); }

/* ── Results ───────────────────────────────────────────────────────────── */

.results {
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  top: calc(100% + 0.6rem);
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  max-height: min(24rem, 52vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  background: var(--panel-bg);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow-pop);
  animation: rise var(--base) var(--ease);
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

/* A default scrollbar inside a floating panel reads as unfinished. */
.results::-webkit-scrollbar { width: 8px; }
.results::-webkit-scrollbar-track { background: transparent; }
.results::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 100px;
}
.results::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

@keyframes rise {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "symbol badge" "meta badge";
  align-items: center;
  gap: 0 0.75rem;
  padding: 0.66rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.result[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.result__symbol {
  grid-area: symbol;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result__symbol mark {
  background: none;
  color: var(--accent);
  font-weight: 650;
}

.result__meta {
  grid-area: meta;
  min-width: 0;
  font-size: 0.755rem;
  color: var(--text-faint);
  letter-spacing: 0.015em;
  /* Truncate rather than wrap: a two-line row makes the list jump as it filters. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result__badge {
  grid-area: badge;
  padding: 0.14rem 0.46rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.655rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── Status line ───────────────────────────────────────────────────────── */

.status {
  min-height: 1.3rem;
  margin: 0.85rem 0.2rem 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}
.status[data-tone="error"] { color: var(--danger-text); }
.status__retry {
  margin-left: 0.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid currentColor;
}

/* ── Quick picks ───────────────────────────────────────────────────────── */

.quickpicks {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.quickpicks__label {
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 0.25rem;
}

.chip {
  padding: 0.36rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease),
              color var(--fast) var(--ease),
              background var(--fast) var(--ease),
              transform var(--fast) var(--ease);
}
.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

/* ── Model teaser ──────────────────────────────────────────────────────── */
/* Sits in the empty state below the picker, which is the one place on the page
   with room to make an argument. It is a whole-surface link because the whole
   card is the offer; nothing inside it is separately clickable. */

.model-teaser {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.4rem;
  margin-top: 2.6rem;
  padding: 1.4rem 1.4rem 1.35rem 1.6rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
  box-shadow: 0 1px 2px rgba(28, 21, 18, 0.04),
              0 22px 48px -34px rgba(28, 21, 18, 0.55);
  animation: rise var(--base) var(--ease);
  transition: border-color var(--base) var(--ease),
              transform var(--base) var(--ease),
              box-shadow var(--base) var(--ease);
}
/* Warm bloom from the top right, echoing .aurora at card scale. Purely
   decorative, so it may use the vivid tone. */
.model-teaser::before {
  content: "";
  position: absolute;
  inset: -70% -20% auto 35%;
  height: 240%;
  pointer-events: none;
  background: radial-gradient(
    38% 42% at 68% 32%,
    var(--accent-glow),
    transparent 72%
  );
}
.model-teaser:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(28, 21, 18, 0.05),
              0 30px 56px -34px rgba(28, 21, 18, 0.62);
}

/* The accent rail. A 3px edge is enough to mark the card as the brand's own
   claim without turning it into an alert. */
.model-teaser__rail {
  position: absolute;
  left: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
}

.model-teaser__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.model-teaser__kicker {
  font-size: 0.665rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
}

.model-teaser__title {
  margin-top: 0.45rem;
  font-size: clamp(1.06rem, 2.7vw, 1.3rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.024em;
  color: var(--text);
  text-wrap: balance;
}
/* The same swash as the hero's word, at card scale: the signature repeats
   instead of being reinvented. */
.model-teaser__title em {
  font-style: normal;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-swash);
  text-decoration-thickness: 0.085em;
  text-underline-offset: 0.07em;
  text-decoration-skip-ink: auto;
}

.model-teaser__sub {
  margin-top: 0.5rem;
  max-width: 58ch;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.model-teaser__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}
.model-teaser__pill {
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.665rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
}

.model-teaser__go {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent-deep);
  background: var(--surface);
  transition: background var(--base) var(--ease),
              color var(--base) var(--ease),
              border-color var(--base) var(--ease),
              transform var(--base) var(--ease);
}
.model-teaser__go svg { width: 17px; height: 17px; }
/* White on the accent gradient is 5.18:1 at its lightest point. */
.model-teaser:hover .model-teaser__go {
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  border-color: transparent;
  color: var(--on-accent);
  transform: translateX(2px);
}

@media (max-width: 34rem) {
  .model-teaser {
    margin-top: 2rem;
    padding: 1.25rem 1.15rem 1.2rem 1.35rem;
    gap: 0.9rem;
  }
  .model-teaser__rail { top: 1.25rem; bottom: 1.25rem; }
  .model-teaser__go { width: 2.3rem; height: 2.3rem; }
  /* Each pill needs a row of its own at this width, and they only restate the
     sentence above them. The arrow alone carries the affordance. */
  .model-teaser__proof { display: none; }
}

/* ── Selection panel ───────────────────────────────────────────────────── */

.selection {
  margin-top: 1.6rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  animation: rise var(--base) var(--ease);
}

.selection__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.selection__symbol {
  font-family: var(--font-mono);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.selection__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 1rem 0 0;
}
.selection__grid div { min-width: 0; }
.selection__grid dt {
  font-size: 0.665rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}
.selection__grid dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ── Workflow: timeframe + run ─────────────────────────────────────────── */

.workflow {
  margin-top: 1.6rem;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  animation: rise var(--base) var(--ease);
}

.workflow__row + .workflow__row { margin-top: 1.35rem; }

.workflow__label {
  margin: 0 0 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.workflow__row--action {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.workflow__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* Segmented control: one tap, no dropdown, no ambiguity. */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.28rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface-sunken);
}

.segment {
  padding: 0.44rem 0.95rem;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.83rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.segment:hover { color: var(--text); background: var(--surface-hover); }
/* Selected: the accessible orange, because this state carries white text. */
.segment[aria-checked="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  box-shadow: 0 6px 16px -8px var(--accent-ring);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.78rem 1.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--accent), var(--accent-deep));
  color: var(--on-accent);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: filter var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.cta:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.cta:disabled { opacity: 0.45; cursor: not-allowed; }

/* An abacus rather than a ring: beads moving on rods reads as counting work,
   where a circular spinner reads as "connecting" and made people suspect the
   network. Colour follows the button's text so it stays legible on the fill. */
.cta__spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.16rem;
  color: var(--on-accent);
}

.abacus {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .abacus__bead {
    animation: abacus-count 2.1s var(--ease) infinite;
  }

  /* Staggered per bead so the rods ripple instead of sliding as one block. */
  .abacus__bead:nth-child(1) { animation-delay: 0ms; }
  .abacus__bead:nth-child(2) { animation-delay: 150ms; }
  .abacus__bead:nth-child(3) { animation-delay: 300ms; }
  .abacus__bead:nth-child(4) { animation-delay: 450ms; }
  .abacus__bead:nth-child(5) { animation-delay: 600ms; }
  .abacus__bead:nth-child(6) { animation-delay: 750ms; }
}

@keyframes abacus-count {
  0%, 12%   { transform: translateX(0); }
  45%, 62%  { transform: translateX(6px); }
  95%, 100% { transform: translateX(0); }
}

/* ── Verdict ───────────────────────────────────────────────────────────── */

.verdict {
  margin-top: 1.6rem;
  padding: 1.5rem 1.55rem 1.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
  box-shadow: var(--shadow-field);
  animation: rise var(--base) var(--ease);
}

.verdict__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.verdict__symbol {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.035em;
}
.verdict__window {
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.verdict__figure {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 1.15rem 0 0.95rem;
}

@media (max-width: 42rem) {
  .verdict__figure {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
  }
}

.verdict__side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

/* The grade: a donut around the number, so the answer reads as a result rather
   than a bare figure. The ring fills to the up-probability and shares its
   colour with the direction band below, so the three can never disagree. */
.gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(8.5rem, 34vw, 11rem);
  height: clamp(8.5rem, 34vw, 11rem);
  flex-shrink: 0;
}

.gauge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge__track {
  fill: none;
  stroke: var(--track);
  stroke-width: 6.5;
}

.gauge__arc {
  fill: none;
  stroke-width: 6.5;
  stroke-linecap: round;
}

.gauge--up .gauge__arc { stroke: var(--up-vivid); }
.gauge--down .gauge__arc { stroke: var(--down-vivid); }

.gauge__value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.1rem;
}

.gauge__number {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 7vw, 2.35rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.gauge--up .gauge__number { color: var(--up-vivid); }
.gauge--down .gauge__number { color: var(--down-vivid); }

.gauge__unit {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.verdict__caption {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.38;
  color: var(--text);
  letter-spacing: -0.01em;
}

.verdict__caption strong {
  font-weight: 800;
  color: var(--accent-vivid, #D97706);
}

.verdict__caption--up strong {
  color: var(--up-vivid, #16A34A);
}

.verdict__caption--down strong {
  color: var(--down-vivid, #DC2626);
}

/* The qualitative grade, so a 52% and a 78% do not read alike. Shares the
   up/down tokens with the price delta, keeping direction consistent. */
.verdict__band {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.verdict__band--up { color: var(--up); background: var(--up-soft); }
.verdict__band--down { color: var(--down); background: var(--down-soft); }

/* The split bar is the whole answer in one glance. */
.splitbar {
  display: flex;
  height: 9px;
  border-radius: 100px;
  overflow: hidden;
  background: var(--track);
}
.splitbar__up { background: linear-gradient(90deg, var(--up), var(--up-vivid)); }
.splitbar__down { background: linear-gradient(90deg, var(--down), var(--down-vivid)); flex: 1; }

.verdict__legend {
  display: flex;
  justify-content: space-between;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.verdict__meta {
  margin: 1.15rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-faint);
  display: flex;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}

/* One price display, reused on the selected symbol and on the result, so the
   same number cannot be rendered two different ways. */
.price {
  display: flex;
  align-items: baseline;
  gap: 0.55rem 0.9rem;
  flex-wrap: wrap;
}

.price__close {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text);
}

.price__asof {
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* Direction keeps the same tokens the split bar uses, so the price and the
   forecast can never disagree about which way is up. */
.price__delta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}

.price__delta--up {
  color: var(--up);
  background: var(--up-soft);
}

.price__delta--down {
  color: var(--down);
  background: var(--down-soft);
}

.verdict__price {
  margin: 0.85rem 0 0;
}

/* The price history, drawn inline. Colour flows from the same up/down tokens the
   delta pill uses, so the chart cannot disagree with the number above it.

   A 3:1 box rather than a fixed height: the stage is capped at 46rem, so this
   tops out around 231px and cannot balloon on a wide screen, while staying at the
   same proportion on a narrow one. The viewBox is stretched to fill it
   (preserveAspectRatio="none"), which at this ratio scales x and y almost
   equally -- at the old 46px height the data was squashed roughly 4:1 vertically,
   which is what made it read as a sparkline rather than a chart. */
.sparkline {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  margin-top: 0.75rem;
  overflow: visible;
}

.sparkline--up { color: var(--up); }
.sparkline--down { color: var(--down); }

/* The x-axis: dates only. Labels are thinned to fit the width, so the row is
   laid out with space-between to keep them aligned with the line above. */
.chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-axis__tick { flex: 0 0 auto; }

.selection__chart-caption {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* The pre-query price and chart, under the selected symbol's details. */
.selection__quote {
  margin: 0.95rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.selection__quote--muted {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.verdict__disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.verdict__error {
  margin: 0;
  font-size: 0.87rem;
  color: var(--danger-text);
}

/* ── Analysis reveal ───────────────────────────────────────────────────── */
.reveal__head {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.reveal {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.reveal__step {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.75rem;
}

/* The rail that ties the steps into one sequence. */
.reveal__step::before {
  content: "";
  position: absolute;
  left: 0.27rem;
  top: 1.25rem;
  bottom: -0.25rem;
  width: 1px;
  background: var(--border);
}

.reveal__step:last-child::before { display: none; }

.reveal__dot {
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: var(--track);
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.reveal__step[data-state="active"] .reveal__dot {
  background: var(--accent-vivid);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.reveal__step[data-state="done"] .reveal__dot { background: var(--accent); }

.reveal__label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-faint);
  transition: color var(--fast) var(--ease);
}

.reveal__step[data-state="active"] .reveal__label,
.reveal__step[data-state="done"] .reveal__label { color: var(--text); }

.reveal__step[data-state="pending"] .reveal__detail { display: none; }

.reveal__detail {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.reveal__caption { margin: 0 0 0.4rem; }

/* The calibration hold. A bar filling over the pause, so the wait reads as work
   in progress rather than as a frozen page. Duration comes from the caller, so
   the bar and the hold cannot disagree. */
.calib__track {
  position: relative;
  display: block;
  margin-top: 0.15rem;
  height: 0.26rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.calib__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-vivid), var(--accent));
  transform-origin: left center;
}

@media (prefers-reduced-motion: no-preference) {
  /* Scoped to the active step, with the finished step pinned at full. A live
     animation here restarts every time the panel is opened: `display: none` on a
     closed <details> tears the animation down, so revealing it began the whole
     calibration sweep again a second time. */
  .reveal__step[data-state="active"] .calib__fill {
    animation: calib-sweep var(--calib-ms, 15000ms) linear forwards;
    transform: scaleX(0);
  }

  /* A travelling sheen, so the bar looks busy rather than merely long. */
  .reveal__step[data-state="active"] .calib__track::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--accent-sheen), transparent);
    animation: calib-sheen 1.4s var(--ease) infinite;
  }
}

.reveal__step[data-state="done"] .calib__fill { transform: scaleX(1); }

@keyframes calib-sweep {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes calib-sheen {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ── The workings, kept after the answer ───────────────────────────────── */
/* Sits above the answer, so the divider goes below it, and the gap to the
   symbol line is deliberate rather than the default paragraph rhythm. */
.workings {
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.workings__summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.workings__summary::-webkit-details-marker { display: none; }

/* A chevron that turns as the panel opens. */
.workings__summary::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--fast) var(--ease);
}

.workings[open] .workings__summary::before { transform: rotate(45deg); }

.workings__summary:hover { background: var(--surface-hover); border-color: var(--border-strong); }

/* Pushed to the far end so the row reads as a control, not as a label. */
.workings__count {
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-faint);
}

.workings__body { padding: 0.9rem 0.9rem 0.3rem; }

.workings[open] .workings__summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.workings[open] .workings__body {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.workings__body .reveal__head { margin-top: 0.2rem; }

/* Moving averages: the level, how much it counted, and the share. */
.avgs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.32rem;
}

.avgs__row {
  display: grid;
  grid-template-columns: 4.3rem 5.6rem 1fr 2.9rem;
  align-items: center;
  gap: 0.55rem;
  font-variant-numeric: tabular-nums;
}

.avgs__window { color: var(--text-faint); }
.avgs__level { font-weight: 600; color: var(--text); }
.avgs__weight { text-align: right; color: var(--text-faint); }

.avgs__track {
  display: block;
  height: 0.34rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.avgs__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-vivid), var(--accent));
  transform-origin: left center;
}

/* The fitted model. */
.equation {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
}

.coefs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.26rem;
}

.coefs__row {
  display: grid;
  grid-template-columns: 9.8rem 1fr 3.5rem;
  align-items: center;
  gap: 0.55rem;
  font-variant-numeric: tabular-nums;
}

.coefs__name { font-size: 0.78rem; color: var(--text-faint); }
.coefs__value { text-align: right; font-weight: 600; color: var(--text); }

.coefs__track {
  display: block;
  height: 0.34rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.coefs__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--up-vivid);
  transform-origin: left center;
}

.coefs__row[data-sign="down"] .coefs__fill { background: var(--down-vivid); }

@media (prefers-reduced-motion: no-preference) {
  .reveal__step[data-state="active"] .avgs__fill,
  .reveal__step[data-state="active"] .coefs__fill {
    animation: bar-in 460ms var(--ease);
  }
}

@keyframes bar-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Failure dialog ────────────────────────────────────────────────────── */
/* A native <dialog>, so focus trapping, Esc-to-close and the backdrop come from
   the platform rather than from hand-written JS. */
.alert {
  width: min(30rem, calc(100vw - 2.5rem));
  padding: 1.4rem 1.5rem 1.2rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
  color: var(--text);
  box-shadow: 0 24px 60px -22px rgba(28, 21, 18, 0.34);
}

.alert::backdrop {
  background: rgba(28, 21, 18, 0.34);
  backdrop-filter: blur(2px);
}

.alert__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.alert__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-text);
}

.alert__icon svg { width: 1.25rem; height: 1.25rem; }

.alert__title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.alert__message {
  margin: 0.85rem 0 0;
  font-size: 0.89rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Emphasis inside the copy. Darker rather than orange: orange here would read as
   a link, and the phrase is not one. */
.alert__message strong {
  font-weight: 650;
  color: var(--text);
}

.alert__note {
  color: var(--text-faint);
}

.alert__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.alert__actions button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--field-top);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.alert__actions button:hover { background: var(--surface-hover); }

/* Scoped under .alert__actions: the shared button rule above is a
   class-plus-type selector, so a bare .alert__retry would lose to it. */
.alert__actions .alert__retry {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.alert__actions .alert__retry:hover {
  background: var(--accent-deep);
}

@media (prefers-reduced-motion: no-preference) {
  .alert[open] { animation: alert-in 200ms var(--ease); }
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 34rem) {
  .workflow__row--action { align-items: stretch; }
  .cta { justify-content: center; width: 100%; }
  /* The emphasis bars need more room than a phone has, so the numbers stay and
     the graphics go. */
  .avgs__row { grid-template-columns: 3.7rem 4.7rem 1fr 2.7rem; }
  .coefs__row { grid-template-columns: 1fr 3.3rem; }
  .coefs__track { display: none; }
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 1;
  width: min(var(--shell), 100% - 3rem);
  margin: 0 auto;
  padding: 1.5rem 0 2.25rem;
  font-size: 0.775rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}
.footer p { margin: 0; }
.footer__sep { margin: 0 0.45rem; opacity: 0.5; }

/* ── Small screens ─────────────────────────────────────────────────────── */

@media (max-width: 34rem) {
  .field { height: 3.7rem; padding: 0 0.9rem; }
  .field__input { font-size: 1.05rem; }
  .field__kbd { display: none; }
  .topbar { padding: 1.25rem 0; }
  .universe { display: none; }

  /* On a phone the wordmark competes with the sign-in control and the admin
     icon. The descriptor is the least load-bearing of the three brand lines, so
     it goes; the credit stacks under the name instead of wrapping raggedly
     beside it, which keeps the block two tidy lines at every phone width. */
  .brand__tag { display: none; }
  .brand__line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.02rem;
  }
  .brand__from { font-size: 0.72rem; line-height: 1.2; }

  .switch__tab { padding: 0.55rem 0.85rem; font-size: 0.84rem; }

  /* The coins badge, the name, the way out and the admin console are four
     controls wide. Rather than clip one of them on a phone, the right-hand group
     takes a line of its own -- which it does identically on every page, so the
     header still cannot shift between sections. */
  .topbar { flex-wrap: wrap; row-gap: 0.6rem; }
  .topbar__right { margin-left: auto; }
}

/* ── Disclaimers and disclosures ───────────────────────────────────────── */
/* Reserved space at the end of the page for the legal copy, which is authored
   elsewhere. Deliberately quiet: it is reference material, not a message. */

.disclosures {
  margin-top: 3.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.disclosures__placeholder {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-faint);
}

/* Respect a stated preference for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── User panel & Auth dialog ─────────────────────────────────────────── */

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.95rem;
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 500;
  /* `normal`, not the inherited 1.55: the dossier renders this as an <a> and the
     picker as a <button>, and only the anchor inherits the body line-height,
     which made the header 1px taller on that page. */
  line-height: normal;
  /* Never let the label break across two lines: the button shares the header
     with the wordmark, and "Sign in" stacking reads as a layout fault. */
  white-space: nowrap;
  flex: none;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.auth-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-1px);
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.22rem 0.4rem 0.22rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
}
.user-coins-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-weight: 700;
  font-size: 0.81rem;
  color: #B45309;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.38);
  padding: 0.18rem 0.62rem;
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.12);
  transition: all var(--fast) var(--ease);
}

/* On / the badge opens the recharge dialog in place; on the standalone pages it
   is a link to that dialog. Either way it should read as pressable. */
.user-coins-badge:hover,
.user-coins-badge:focus-visible {
  border-color: rgba(217, 119, 6, 0.62);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.28);
}

.user-coins-badge::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -120%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  transform: rotate(25deg);
  animation: coinShimmer 4s infinite ease-in-out;
  pointer-events: none;
}

@keyframes coinShimmer {
  0%, 70% { left: -120%; }
  88%, 100% { left: 180%; }
}

.user-coins-badge svg {
  color: #F59E0B;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(180, 83, 9, 0.35));
  animation: coinTilt 5s infinite ease-in-out;
}

@keyframes coinTilt {
  0%, 80%, 100% { transform: scale(1) rotate(0deg); }
  85% { transform: scale(1.18) rotate(14deg); }
  92% { transform: scale(1.18) rotate(-14deg); }
}

.user-coins-badge:hover {
  border-color: #F59E0B;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.28);
  transform: translateY(-1px);
}

.user-coins-badge--bump {
  animation: coinBump 0.45s ease-out;
}

@keyframes coinBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
  100% { transform: scale(1); }
}
.user-name {
  font-weight: 500;
  color: var(--text);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.btn-logout:hover {
  color: var(--danger, #DC2626);
  background: var(--surface-muted);
}

/* Auth Dialog */
.auth-dialog {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px -12px rgba(26, 18, 11, 0.24);
  max-width: 26rem;
  width: calc(100% - 2rem);
  margin: auto;
}
.auth-dialog::backdrop {
  background: rgba(26, 18, 11, 0.45);
  backdrop-filter: blur(4px);
}
.auth-box {
  position: relative;
  padding: 2rem 2.2rem;
}
.auth-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}
.auth-close:hover { color: var(--text); }

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-icon-wrap {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: grid;
  place-items: center;
}
.auth-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
.auth-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.auth-label {
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-muted);
}
.auth-optional {
  font-weight: 400;
  opacity: 0.7;
}

.auth-phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  overflow: hidden;
  transition: border-color var(--fast) var(--ease);
}
.auth-phone-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-prefix {
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  background: var(--surface);
  user-select: none;
}
.auth-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color var(--fast) var(--ease);
}
.auth-phone-input .auth-input {
  border: none;
  background: transparent;
  border-radius: 0;
}
.auth-phone-input .auth-input:focus {
  outline: none;
}
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.auth-otp-field {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  padding: 0.6rem 0.8rem;
}

.auth-error {
  font-size: 0.8rem;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin: 0;
}

.auth-submit-btn {
  margin-top: 0.5rem;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.auth-submit-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-dev-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #FFFBEB;
  border: 1px dashed #F59E0B;
  color: #B45309;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.785rem;
  margin-bottom: 0.9rem;
}
.dev-autofill-btn {
  border: 1px solid #F59E0B;
  background: #FEF3C7;
  color: #92400E;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.dev-autofill-btn:hover {
  background: #FDE68A;
}

.auth-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.auth-link-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--accent-deep);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link-btn:disabled {
  color: var(--text-faint);
  text-decoration: none;
  cursor: not-allowed;
}

/* ==========================================================================
   Executive Quantitative Visual Analytics Deck
   ========================================================================== */

.visual-deck {
  margin: 1.4rem 0 0.8rem;
  padding: 1.25rem 1.25rem 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-bottom));
  box-shadow: 0 4px 16px -6px rgba(28, 21, 18, 0.08);
}

.visual-deck__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.visual-deck__title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.visual-deck__title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.visual-deck__subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.visual-deck__formula-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--accent-deep);
  white-space: nowrap;
}

/* Stacked Visual Sections */
.visual-section {
  margin-top: 1.6rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.visual-section:first-of-type {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
}

.visual-section__title {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ── View 1: Sigmoid S-Curve & Scatter Plot ────────────────────────────── */

.chart-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.6rem 0.5rem 0.5rem;
  overflow: hidden;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
  overflow: visible;
}

.chart-axis-line {
  stroke: var(--border-strong);
  stroke-width: 1.2;
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-threshold-line {
  stroke: var(--warn-border);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.chart-center-line {
  stroke: var(--border-strong);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-faint);
}

.chart-threshold-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  fill: var(--warn-text);
}

.chart-zone-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chart-zone-label--down { fill: #B91C1C; }
.chart-zone-label--up   { fill: #15803D; }

.sigmoid-curve {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 2px 4px rgba(28, 21, 18, 0.12));
}

.scatter-dot {
  cursor: pointer;
  transition: transform 120ms ease, r 120ms ease;
  transform-origin: center;
}

.scatter-dot:hover {
  r: 7.5;
  stroke-width: 2.5;
  stroke: #FFFFFF;
}

.scatter-dot--up {
  fill: #16A34A;
  stroke: #15803D;
  stroke-width: 1.2;
}

.scatter-dot--down {
  fill: #DC2626;
  stroke: #B91C1C;
  stroke-width: 1.2;
}

/* Radar Pulse on Today's Asset Pin */
.pulse-ring {
  fill: none;
  stroke: var(--accent-vivid);
  stroke-width: 2;
  animation: radar-pulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  transform-origin: center;
}

@keyframes radar-pulse {
  0% {
    r: 7;
    opacity: 0.9;
    stroke-width: 2.5;
  }
  70% {
    r: 22;
    opacity: 0.2;
    stroke-width: 1;
  }
  100% {
    r: 26;
    opacity: 0;
    stroke-width: 0.5;
  }
}

.today-pin-core {
  stroke: #FFFFFF;
  stroke-width: 3;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.today-pin-core--up   { fill: #16A34A; }
.today-pin-core--down { fill: #DC2626; }

.chart-badge-bg {
  fill: #1C1512;
  rx: 7;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

.chart-badge-text {
  fill: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.chart-legend__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: none;
}

.chart-legend__dot--up   { background: #16A34A; }
.chart-legend__dot--down { background: #DC2626; }
.chart-legend__dot--today {
  background: var(--accent-vivid);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.chart-legend__line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #DC2626, #F59E0B, #16A34A);
}

.visual-deck__note {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px dashed var(--border-strong);
  font-size: 0.77rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.visual-deck__note strong {
  color: var(--text);
}

/* ── View 2: Factor Impact Waterfall Bars ──────────────────────────────── */

.waterfall-deck {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.waterfall-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.waterfall-card {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.waterfall-card__label {
  font-size: 0.73rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.waterfall-card__value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.waterfall-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.waterfall-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.waterfall-row {
  display: grid;
  grid-template-columns: 13rem 1fr 4.2rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  transition: background var(--fast) var(--ease);
}

.waterfall-row:hover {
  background: var(--surface-hover);
}

.waterfall-feature {
  display: flex;
  flex-direction: column;
}

.waterfall-name {
  font-size: 0.81rem;
  font-weight: 650;
  color: var(--text);
}

.waterfall-tag {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.waterfall-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 1.1rem;
  background: var(--surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}

.waterfall-center-guide {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
  z-index: 1;
}

.waterfall-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 400ms var(--ease);
}

.waterfall-bar--up {
  position: absolute;
  left: 50%;
  background: linear-gradient(90deg, #16A34A, #22C55E);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.waterfall-bar--down {
  position: absolute;
  right: 50%;
  background: linear-gradient(90deg, #EF4444, #DC2626);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.waterfall-val {
  font-family: var(--font-mono);
  font-size: 0.81rem;
  font-weight: 700;
  text-align: right;
}

.waterfall-val--up   { color: #15803D; }
.waterfall-val--down { color: #B91C1C; }

/* ── View 3: Supply & Demand Zones Radar ───────────────────────────────── */

.radar-deck {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.radar-spectrum-box {
  padding: 1.1rem 1rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.radar-spectrum-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.76rem;
  color: var(--text-faint);
}

.radar-spectrum-track {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.12), rgba(245, 158, 11, 0.12) 50%, rgba(22, 163, 74, 0.15));
  border: 1px solid var(--border);
  margin-bottom: 5.6rem;
}

.radar-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text-muted);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-marker-stem {
  position: absolute;
  top: 24px;
  width: 1.5px;
  background: var(--border-strong);
}

.radar-marker-flag {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%);
  z-index: 2;
}

.radar-current-pin {
  position: absolute;
  top: -12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
}

.radar-current-diamond {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  background: var(--accent);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 3px var(--accent-ring), 0 3px 6px rgba(0, 0, 0, 0.2);
}

.radar-current-line {
  width: 2px;
  height: 30px;
  background: var(--accent-deep);
}

.radar-current-tag {
  position: absolute;
  top: -24px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--text);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 34rem) {
  .radar-grid {
    grid-template-columns: 1fr;
  }
}

.radar-card {
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.radar-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.radar-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.radar-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.radar-card-role {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.radar-card-role--support {
  background: var(--up-soft);
  color: var(--up);
}

.radar-card-role--resistance {
  background: var(--down-soft);
  color: var(--down);
}

.radar-card-price {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.radar-card-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 0.4rem;
  margin-top: 0.2rem;
}

.radar-card-delta {
  font-family: var(--font-mono);
  font-weight: 600;
}

.radar-card-delta--above { color: var(--up); }
.radar-card-delta--below { color: var(--down); }

.radar-takeaway {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  font-size: 0.81rem;
  line-height: 1.45;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

@media (max-width: 40rem) {
  .waterfall-row {
    grid-template-columns: 1fr 3.5rem;
    gap: 0.45rem;
  }
  .waterfall-bar-wrap {
    grid-column: 1 / -1;
    order: 3;
    height: 0.8rem;
  }
  .chart-svg {
    max-height: 280px;
  }
}

/* ── Coin Recharge Dialog (Razorpay) ──────────────────────────────────── */

.recharge-dialog {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px -12px rgba(26, 18, 11, 0.32);
  max-width: 27rem;
  width: calc(100% - 2rem);
  margin: auto;
}

.recharge-dialog::backdrop {
  background: rgba(26, 18, 11, 0.52);
  backdrop-filter: blur(4px);
}

.recharge-modal {
  position: relative;
  padding: 2rem 2.2rem;
}

.recharge-close {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.recharge-close:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.recharge-header {
  text-align: center;
  margin-bottom: 1.2rem;
}

.recharge-icon-wrap {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #D97706;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

.recharge-title {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.recharge-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.recharge-balance-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.95rem;
  margin-bottom: 1.1rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recharge-balance-pill strong {
  font-family: var(--font-mono);
  color: #B45309;
  font-weight: 700;
}

.recharge-unit-badge {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Custom Coin Input Block */
.recharge-custom {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  margin-bottom: 1.25rem;
  transition: all var(--fast) var(--ease);
}

.recharge-custom:hover {
  border-color: rgba(245, 158, 11, 0.6);
}

.recharge-custom--active {
  border-color: #D97706;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.03));
  box-shadow: 0 0 0 1px #D97706, 0 4px 12px rgba(245, 158, 11, 0.12);
}

.recharge-custom__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.recharge-custom__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.recharge-custom__sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.recharge-custom__control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.recharge-step-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all var(--fast) var(--ease);
  flex-shrink: 0;
}

.recharge-step-btn:hover {
  background: var(--surface);
  border-color: #D97706;
  color: #D97706;
}

.recharge-custom__input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.recharge-custom__input {
  width: 100%;
  padding: 0.55rem 3.5rem 0.55rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
  box-sizing: border-box;
  transition: all var(--fast) var(--ease);
}

.recharge-custom__input:focus {
  outline: none;
  border-color: #D97706;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.recharge-custom__unit {
  position: absolute;
  right: 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
}

/* Preset Quick Select Chips */
.recharge-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  margin-bottom: 0.95rem;
}

.recharge-chip {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.65rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  transition: all var(--fast) var(--ease);
}

.recharge-chip span.chip-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
}

.recharge-chip span.chip-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.recharge-chip:hover {
  background: var(--surface);
  border-color: rgba(245, 158, 11, 0.6);
  transform: translateY(-1px);
}

.recharge-chip--active {
  background: rgba(245, 158, 11, 0.12);
  border-color: #D97706;
  color: #B45309;
  box-shadow: 0 0 0 1px #D97706;
}

.recharge-chip--popular {
  border-color: rgba(245, 158, 11, 0.4);
}

.recharge-chip--popular span.chip-tag {
  color: #D97706;
  font-weight: 700;
}

.recharge-chip--pro {
  border-color: rgba(16, 185, 129, 0.4);
}

.recharge-chip--pro span.chip-tag {
  color: #059669;
  font-weight: 700;
}

/* Tier Multiplier Banner */
.recharge-tier-banner {
  border-radius: 9px;
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
  transition: all var(--fast) var(--ease);
}

.recharge-tier-banner--standard {
  background: var(--surface-muted);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.recharge-tier-banner--popular {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #B45309;
  font-weight: 600;
}

.recharge-tier-banner--pro {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(5, 150, 105, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #047857;
  font-weight: 600;
}

.recharge-tier-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* Cost & Coin Breakdown */
.recharge-breakdown {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.recharge-breakdown__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}

.recharge-breakdown__row span:first-child {
  font-size: 0.8rem;
}

.recharge-bonus-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #D97706;
}

.recharge-breakdown__row--total {
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
  margin-top: 0.2rem;
  color: var(--text);
  font-size: 0.88rem;
}

.recharge-breakdown__row--total strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #D97706;
}

.recharge-breakdown__row--cost strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #16A34A;
}

.recharge-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: all var(--fast) var(--ease);
}

.recharge-submit-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
}

.recharge-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.recharge-error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--down-soft);
  color: var(--down);
  font-size: 0.82rem;
  line-height: 1.4;
}

.recharge-footer {
  margin-top: 1.1rem;
  text-align: center;
}

.recharge-trust {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-faint);
}

.recharge-trust svg {
  color: #059669;
}
