/* Screens added to the approved scanner. Keep the accent for actions and state. */
.app { overflow: clip; }
.bottom-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin-top: 0;
  min-height: 66px;
  padding-inline: 6px;
}
.bottom-nav button { min-width: 0; min-height: 44px; white-space: nowrap; }
.header-quota {
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  border-radius: 5px;
  padding: 2px 0 2px 8px;
}
.header-quota:hover { color: var(--accent); }
.review-index {
  display: block;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  margin-top: 24px;
  padding: 10px 0;
}
.mobile-demo { border: 0; background: var(--bg); }
.mobile-demo button { color: var(--muted); }
.ticker-categories {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 5px;
  padding-inline: 8px;
  overflow: visible;
}
.ticker-categories button {
  min-width: 0;
  padding: 3px 0;
  min-height: 38px;
  font-size: 11px;
  line-height: 1.2;
}
.style-options .choice-face { text-align: center; }
.style-options .choice-face strong { white-space: normal; line-height: 1.25; }

.prototype-screen {
  padding-block: 20px 26px;
  line-height: 1.58;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.prototype-screen h2, .prototype-screen h3, .prototype-screen p { margin: 0; }
.prototype-screen h2 { font-size: 25px; font-weight: 740; line-height: 1.22; letter-spacing: -.035em; }
.prototype-screen h3 { font-size: 15px; line-height: 1.4; font-weight: 720; }
.prototype-screen h2:focus, #upload-heading:focus { outline: none; }
.prototype-screen p { color: var(--muted); }
.prototype-screen .back-link {
  width: fit-content;
  min-height: 42px;
  margin: -8px 0 10px -5px;
  padding-inline: 5px 10px;
  font-size: 12px;
}
.prototype-screen .screen-heading { margin-bottom: 23px; }
.screen-heading p { margin-top: 10px; max-width: 34ch; }
.prototype-screen .primary, .prototype-dialog .primary {
  min-height: 46px;
  height: auto;
  padding: 11px 16px;
  text-align: center;
  justify-content: center;
  line-height: 1.4;
}
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 660;
  text-align: center;
}
.secondary:hover { background: var(--surface); }
.quiet-action {
  min-height: 44px;
  width: fit-content;
  background: transparent;
  color: var(--accent);
  padding: 5px 2px;
  font-size: 13px;
  font-weight: 650;
}
.screen-actions { display: grid; gap: 9px; margin-top: 18px; }
.screen-section { margin-top: 23px; }
.screen-section > h3 { margin-bottom: 8px; }
.prototype-screen .screen-copy { margin-bottom: 14px; }
.prototype-screen .screen-notice {
  padding: 9px 12px;
  border-left: 1px solid #5c5336;
  background: #212024;
  margin-top: 16px;
  font-size: 12px;
}
.data-rows { margin: 6px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.data-rows dt { color: var(--muted); }
.data-rows dd { margin: 0; text-align: right; font-weight: 680; }
.negative-text { color: var(--candle-down); }
.screen-details { border-bottom: 1px solid var(--line); }
.screen-details summary {
  min-height: 48px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}
.screen-details summary::-webkit-details-marker { display: none; }
.screen-details .icon { width: 14px; flex: 0 0 14px; color: var(--muted); }
.screen-details[open] > summary > .icon { transform: rotate(180deg); }
.screen-details > div { padding-bottom: 12px; }
.screen-details p { margin: 8px 0 3px; font-size: 13px; }

.welcome-mark { margin: 26px 0; }
.welcome-mark img { display: block; width: 158px; }
.prototype-screen[data-screen="welcome"] { min-height: min(580px, 100svh); }
.prototype-screen[data-screen="welcome"] h2 { font-size: 31px; max-width: 12ch; }
.welcome-form { display: grid; gap: 18px; margin-top: auto; padding-top: 22px; }
.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
}
.consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.prototype-screen[data-screen="progress"] { padding-top: 36px; }
.prototype-screen[data-screen="progress"] .screen-heading h2 { font-size: 28px; }
.prototype-screen .analysis-subject {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 10px;
  font-size: 12px;
}
.analysis-subject:empty { display: none; }
.analysis-subject strong { color: var(--text); font-size: 14px; }
.analysis-progress {
  list-style: none;
  margin: 25px 0 22px;
  padding: 0;
  border-block: 1px solid var(--line);
}
.analysis-progress li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.analysis-progress li:last-child { border-bottom: 0; }
.progress-step { display: grid; gap: 4px; }
.progress-step-name { font-size: 14px; font-weight: 680; line-height: 1.4; color: var(--muted); }
.progress-step-detail, .progress-step-state, .progress-upload-value { color: var(--muted); font-size: 11px; }
.progress-step-state { padding-top: 2px; }
.progress-upload-value { grid-column: 2; font-variant-numeric: tabular-nums; }
.progress-marker { display: grid; place-items: center; width: 17px; height: 20px; }
.progress-marker > * { grid-area: 1 / 1; }
.progress-marker i { width: 8px; height: 8px; border: 1px solid var(--muted); border-radius: 50%; }
.progress-marker .icon { display: none; width: 15px; height: 15px; }
.analysis-progress [data-step="current"] .progress-step-name,
.analysis-progress [data-step="done"] .progress-step-name { color: var(--text); }
.analysis-progress [data-step="current"] .progress-step-state { color: var(--accent); }
.analysis-progress [data-step="current"] .progress-marker i {
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-right-color: transparent;
}
.analysis-progress [data-step="done"] .progress-marker i { display: none; }
.analysis-progress [data-step="done"] .progress-marker .icon { display: block; color: #81d4ad; }
.analysis-progress [data-step="pending"] .progress-step-state { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .analysis-progress [data-step="current"] .progress-marker i { animation: stage-spin 1.1s linear infinite; }
}
@keyframes stage-spin { to { transform: rotate(1turn); } }
.progress-cancel { width: 100%; }

.report-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }
.prototype-screen .report-top .back-link { margin-bottom: 6px; min-height: 40px; }
.prototype-screen .result-instrument h2 { font-size: 26px; font-weight: 750; line-height: 1.25; letter-spacing: -.03em; }
.prototype-screen .result-instrument h2 span { color: var(--muted); font-size: 20px; font-weight: 500; }
.prototype-screen .result-timeframe { border: 0; padding: 0; background: none; font-size: 12px; color: var(--muted); }
.prototype-screen .report-snapshot { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.report-snapshot strong { font-weight: 500; }
.report-snapshot time { font-variant-numeric: tabular-nums; }
.report-overview { min-width: 0; }
.report-decision { margin-top: 24px; padding: 0; border: 0; background: none; }
.prototype-screen .result-finding { margin: 0; font-size: 21px; font-weight: 720; line-height: 1.3; letter-spacing: -.025em; text-wrap: pretty; }
.prototype-screen .report-observation { margin: 9px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); text-wrap: pretty; max-width: 65ch; }
.prototype-screen .result-figure { margin: 20px 0 0; }
.result-chart-toolbar { gap: 12px; }
.prototype-screen .result-chart-toolbar h3 { font-size: 12px; font-weight: 650; color: var(--text); }
.result-chart-toolbar h3 span { color: var(--muted); font-weight: 500; }
#report-levels-toggle { min-height: 44px; border-radius: 4px; }
.report-indicator-controls { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 8px 0 7px; }
.report-indicator-controls button {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 6px;
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.report-indicator-controls button[aria-pressed="true"] { color: var(--text); border-color: var(--indicator-color); }
.report-indicator-controls i, .report-ema-readings i { width: 7px; height: 2px; background: var(--indicator-color); }
[data-indicator-key="ema20"] { --indicator-color: #6fcfe7; }
[data-indicator-key="ema50"] { --indicator-color: #bd9bf7; }
[data-indicator-key="rsi14"] { --indicator-color: #b4a5e8; }
[data-indicator-key="atr14"] { --indicator-color: #a3bfd2; }
.report-indicator-line { fill: none; stroke: var(--indicator-color); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.result-figure [hidden] { display: none !important; }
.report-ema-readings { display: flex; flex-wrap: wrap; gap: 3px 16px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.report-ema-readings:not(:has(span:not([hidden]))) { display: none; }
.report-ema-readings span { display: inline-flex; align-items: center; gap: 5px; }
.report-ema-readings p { flex-basis: 100%; }
.report-ema-readings strong { color: var(--text); }
.report-indicator-panel { padding: 9px 10px; margin-top: 6px; border-top: 1px solid var(--line); }
.report-indicator-panel > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.report-indicator-panel > div span { color: var(--muted); font-weight: 500; }
.report-indicator-panel svg { display: block; width: 100%; height: auto; }
.report-indicator-panel p { margin-top: 3px; font-size: 11px; }
.indicator-guide { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.prototype-screen .report-chart { overflow: hidden; border-radius: 6px; background: #1a1d23; }
.prototype-screen #report-chart { margin: 0; }
.prototype-screen .report-chart svg { display: block; width: 100%; height: auto; }
.prototype-screen .result-levels { display: grid; grid-template-columns: 1fr; gap: 0; margin: 8px 0 0; }
.prototype-screen .result-level {
  display: grid; grid-template-columns: 12px 1fr; align-items: baseline; gap: 3px 8px;
  padding: 10px 0; min-height: 44px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: start; color: var(--text); font-size: 13px;
}
.level-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.prototype-screen .result-level strong { font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.level-meaning { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.5; }
.level-swatch { flex: 0 0 10px; width: 10px; height: 1px; border-top: 1px dashed #b7bdc5; opacity: .55; }
.level-swatch-confirmation { border-color: var(--accent); }
.result-level[aria-pressed="true"] .level-swatch { opacity: 1; }
.prototype-screen .level-explanation { min-height: 0; margin: 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.report-trigger { margin-top: 8px; }
.prototype-screen .report-trigger + .report-observation { margin-top: 12px; }
.prototype-screen .report-next-step { font-size: 13px; line-height: 1.65; color: var(--text); }
.report-watch-price { font-size: 15px; font-weight: 750; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.prototype-screen .chart-signal-key {
  display: flex; align-items: baseline; gap: 7px; margin: 6px 0 0;
  color: var(--muted); font-size: 12px; line-height: 1.45; text-align: start;
}
.chart-signal-key .icon {
  align-self: flex-start; flex: none; box-sizing: border-box; margin-top: 2px;
  width: 14px; height: 14px; padding: 1.5px; border: 1px solid currentColor; border-radius: 50%;
}
.chart-signal-key:is([data-key="confirmed"], [data-key="signal"]) .icon {
  color: #192127; background: var(--signal-ink, var(--candle-up)); border-color: transparent;
}
.watch-signal-mark circle { fill: var(--signal-ink, var(--candle-up)); stroke: #1a1d23; stroke-width: 1.5; }
.watch-signal-mark .signal-leader { stroke: var(--signal-ink, var(--candle-up)); stroke-width: 1; }
.watch-signal-mark .signal-check { fill: none; stroke: #192127; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.prototype-screen .report-watch-note { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.6; text-wrap: pretty; }
.report-plan { margin-top: 23px; }
.report-plan > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.prototype-screen .report-plan h3 { margin: 0; font-size: 15px; font-weight: 720; }
.report-direction { font-size: 11px; font-weight: 650; }
.report-direction[data-direction="long"] { color: var(--candle-up); }
.report-direction[data-direction="short"] { color: var(--candle-down); }
.report-direction[data-direction="watch"] { color: var(--muted); }
.prototype-screen .report-plan-condition { margin-top: 8px; font-size: 13px; line-height: 1.55; color: var(--text); }
.report-plan-unit { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.report-prices { display: block; margin: 12px 0 0; font-variant-numeric: tabular-nums; }
.report-prices > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.report-prices dt { display: flex; gap: 6px; align-items: baseline; font-size: 12px; color: var(--muted); }
.report-prices dt > span { font-size: 10px; opacity: .8; }
.report-prices dd { margin: 0 0 0 auto; font-size: 16px; font-weight: 700; line-height: 1.5; letter-spacing: -.015em; overflow-wrap: anywhere; }
.report-stop { color: var(--candle-down); }
.report-target-price { color: #2ed6a1; }
.prototype-screen .report-entry-rule { margin: 12px 0 0; font-size: 11px; line-height: 1.65; color: var(--muted); text-wrap: pretty; }
.prototype-screen .report-invalidation { margin: 16px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); text-wrap: pretty; }
.report-full-analysis { margin-top: 24px; }
.report-full-analysis .screen-details { border-block: 1px solid var(--line); }
.report-full-analysis summary { font-size: 14px; min-height: 52px; }
.report-full-analysis summary:hover { color: var(--text); }
.report-full-analysis .screen-details > div { display: grid; gap: 18px; padding: 5px 0 20px; max-width: 65ch; }
.report-full-analysis h4 { margin: 0; font-size: 13px; font-weight: 700; }
.prototype-screen .report-full-analysis p { margin: 5px 0 0; font-size: 13px; line-height: 1.7; text-wrap: pretty; color: var(--muted); }
.prototype-screen .report-archive-note { display: none; }
/* Preserve the visible tab row when a shorter panel would clamp scrolling. */
.prototype-screen[data-screen="result"] { overflow-anchor: none; }
.prototype-screen[data-screen="result"]::after { content: ""; display: block; block-size: var(--report-scroll-tail, 0px); }
.report-evidence { margin-top: 26px; scroll-margin-block: 16px; }
.report-evidence > h3 { margin-bottom: 8px; font-size: 14px; }
.report-sections { display: flex; gap: 18px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.report-sections button { flex: 0 0 auto; min-height: 44px; padding: 0; white-space: nowrap; border-radius: 0; background: none; color: var(--muted); box-shadow: inset 0 -2px transparent; font-size: 12px; font-weight: 600; }
.report-sections button:hover { color: var(--text); }
.report-sections button[aria-expanded="true"] { box-shadow: inset 0 -2px var(--accent); color: var(--accent); }
.report-sections button:focus-visible { outline-offset: -3px; }
.report-detail { padding-bottom: 4px; }
@media (max-width: 359px) {
  .prototype-screen .result-instrument h2 { font-size: 24px; }
  .prototype-screen .result-finding { font-size: 19px; }
  .prototype-screen .result-levels { column-gap: 12px; }
  .report-prices dd { font-size: 15px; }
}
.prototype-screen .tab-heading { margin: 19px 0 8px; font-size: 17px; }
.book-totals { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 12px; font-variant-numeric: tabular-nums; }
.book-totals strong { font-size: 20px; }
.book-balance { display: flex; gap: 3px; height: 5px; margin: 8px 0 18px; }
.book-balance span:first-child { background: var(--candle-up); }
.book-balance span:last-child { background: var(--candle-down); }

.history-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.history-filters .screen-field { grid-template-rows: auto 46px; gap: 6px; }
.history-control { position: relative; display: block; min-width: 0; }
.history-filters .history-control > :is(input, select) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  margin: 0;
  padding-inline: 12px;
  appearance: none;
  -webkit-appearance: none;
  line-height: 20px;
}
.history-filters .history-control > select { padding-inline-end: 34px; cursor: pointer; }
.history-control > .icon {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}
.history-control input::placeholder { color: var(--muted); opacity: 1; }
.screen-field { display: grid; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.screen-field input, .screen-field select, .screen-field textarea {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 7px;
  border: 1px solid #363b45;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.screen-field textarea { resize: vertical; }
.screen-field [aria-invalid="true"] { border-color: #e18d80; }
.history-list, .preview-group ul { list-style: none; padding: 0; margin: 0; }
.history-record, .setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.history-record > span, .setting-row > span:first-child { flex: 1; min-width: 0; }
.history-record .icon, .setting-row > .icon, .preview-group a .icon { width: 15px; flex: 0 0 15px; color: var(--muted); }
.history-record:hover, .setting-row:hover, .preview-group a:hover { color: var(--accent); }
.history-meta, .history-summary, .setting-row small { display: block; font-size: 12px; color: var(--muted); }
.history-meta { margin-block: 3px 5px; font-variant-numeric: tabular-nums; }
.screen-empty, .locked-feature { display: grid; justify-items: start; gap: 9px; padding-block: 21px; }
.screen-empty > .icon, .lock-symbol .icon { color: var(--accent); width: 23px; height: 23px; }
.screen-empty .secondary { margin-top: 6px; }
.locked-feature { border-top: 1px solid var(--line); }
.locked-feature .primary { margin-top: 12px; }
.account-identity { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.account-identity img { border: 1px solid var(--line); border-radius: 50%; }
.account-identity > div > span, .account-stat { font-size: 12px; color: var(--muted); }
.account-stat { margin-left: auto; text-align: right; }
.account-stat strong { display: block; font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; }
.row-value { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; }
.row-value .icon { width: 14px; color: var(--accent); }
.settings-list { border-top: 1px solid var(--line); }
.settings-list + .quiet-action { margin-top: 12px; }
.zone-list .setting-row { font-size: 12px; }

.payment-picker { border: 0; min-width: 0; padding: 0; margin: 0 0 16px; }
.payment-picker legend { color: var(--muted); font-size: 12px; padding: 0; margin-bottom: 7px; }
.term-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.term-options label { position: relative; min-width: 0; }
.term-options input { position: absolute; opacity: 0; pointer-events: none; }
.term-options span { display: block; background: var(--surface); border: 1px solid var(--line); padding: 8px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 12px; }
.term-options strong { display: block; font-size: 12px; color: var(--text); white-space: nowrap; }
.term-options :checked + span { border-color: #9d8240; color: var(--accent); }
.term-options :focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.receipt-lines { margin-top: 10px; }
.copy-line { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.copy-line code { color: var(--muted); font-size: 12px; }
.screen-form { display: grid; gap: 8px; margin-top: 12px; }
.form-controls { display: grid; gap: 4px; }
.prototype-screen .form-feedback { color: #f2a89b; font-size: 12px; }
.form-feedback:empty { display: none; }
.prototype-screen #copy-status { color: var(--muted); }
.instruction-list { margin: 0; padding-left: 19px; color: var(--muted); }
.instruction-list li + li { margin-top: 8px; }
.preview-group + .preview-group { margin-top: 24px; }
.preview-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 43px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}
.prototype-dialog {
  max-width: min(360px, calc(100vw - 32px));
  padding: 20px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.prototype-dialog::backdrop { background: #07090dbf; }
.prototype-dialog h2 { font-size: 19px; }
.prototype-dialog p { margin: 9px 0 0; font-size: 13px; color: var(--muted); }
.prototype-dialog .screen-actions { grid-template-columns: 1fr 1fr; }

@media (max-width: 700px) {
  .bottom-nav { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .prototype-screen { padding-top: calc(20px + env(safe-area-inset-top)); }
}
@media (max-width: 360px) {
  .term-options span { padding-inline: 6px; }
}

.welcome-example {
  margin: 0;
  padding: 2px 9px 10px;
  background: #1b1e24;
  border-radius: 8px;
}
.welcome-example svg { display: block; width: 100%; height: auto; }
.welcome-example figcaption { color: var(--muted); font-size: 11px; padding-inline: 7px; }
.event-list { padding: 0; margin: 0; list-style: none; }
.event-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 3px 9px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event-list li > span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.event-list strong { font-size: 13px; font-weight: 680; }
.event-list p { grid-column: 2; font-size: 12px; }

.history-day h3 { margin: 20px 0 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.history-list .history-record { display: grid; grid-template-columns: minmax(0,1fr) 76px; gap: 3px 12px; align-items: center; }
.history-pair { font-size: 16px; letter-spacing: -.025em; }
.history-record time { justify-self: end; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-record .history-summary { grid-column: 1; font-size: 13px; font-weight: 620; color: var(--text); }
.history-record .history-summary:is([data-tone="confirmed"], [data-tone="up"]) { color: var(--candle-up); }
.history-record .history-summary[data-tone="down"] { color: var(--candle-down); }
.history-record .history-summary[data-tone="waiting"] { color: #f0a347; }
.history-record .history-meta { grid-column: 1; margin: 0; font-size: 11px; }
.history-trace { grid-column: 2; grid-row: 2 / 4; width: 76px; color: var(--muted); }
.history-trace[data-change="1"] { color: var(--candle-up); }
.history-trace[data-change="-1"] { color: var(--candle-down); }


.risk-upgrade { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block: 14px; padding: 14px 0; border: 0; border-block: 1px solid var(--line); background: transparent; color: inherit; text-align: start; cursor: pointer; }
.risk-upgrade-copy { display: grid; gap: 4px; }
.risk-upgrade-copy strong { font-size: 15px; }
.risk-upgrade-copy small, .risk-benefit { color: var(--muted); font-size: 13px; line-height: 1.5; }
.risk-benefit { margin: 0 0 12px; }
.risk-upgrade-access { display: inline-flex; align-items: center; gap: 5px; color: var(--accent, #f2c438); font-size: 13px; font-weight: 650; white-space: nowrap; }
.risk-upgrade-access .icon { width: 15px; height: 15px; }
[dir="rtl"] .risk-upgrade-access .icon:last-child { transform: scaleX(-1); }
.pro-risk-benefit { margin-block: 16px; }
.pro-risk-benefit strong { display: block; margin-bottom: 4px; font-size: 15px; }

.bankroll-bar {
  position: sticky; top: 0; z-index: 3; flex: none;
  display: flex; align-items: center; justify-content: flex-end;
  background: var(--bg);
}
.bankroll-bar[hidden], .bankroll-set[hidden] { display: none; }
.bankroll-bar button {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0;
  background: transparent; color: var(--text); font-size: 12px; line-height: 1.2;
}
.bankroll-control { min-width: 0; }
.bankroll-info { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 2px 6px; }
.bankroll-label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.bankroll-label .icon { width: 19px; height: 19px; stroke-width: 1.8; flex: none; color: var(--accent); }
.bankroll-pro {
  display: inline-block; padding: 1px 5px; border-radius: 4px;
  color: var(--accent); background: #302b1e;
  font-size: 10px; line-height: 14px; font-weight: 700;
}
.bankroll-value { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 360px) {
  .bankroll-info { column-gap: 3px; }
  .bankroll-label { gap: 3px; font-size: 11px; }
  .bankroll-pro { padding-inline: 3px; }
}
.bankroll-value bdi { white-space: nowrap; }
.bankroll-value small { color: var(--muted); font-size: 11px; font-weight: 550; }
.bankroll-value .icon { width: 12px; height: 12px; }
.bankroll-control:not(:has(bdi)) .bankroll-value { font-size: 10px; color: var(--muted); }
.bankroll-bar .bankroll-help { width: 24px; flex: none; justify-content: end; color: var(--muted); }
.bankroll-bar button:focus-visible { outline: 1px solid var(--accent); outline-offset: -2px; border-radius: 5px; }
.bankroll-help .icon { width: 14px; height: 14px; }
.bankroll-help[aria-expanded="true"] .icon { color: var(--accent); }
.info-note {
  --note-cut: 9px;
  box-sizing: border-box; padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--surface)); border-radius: 3px;
  clip-path: polygon(0 0,calc(100% - var(--note-cut)) 0,100% var(--note-cut),100% 100%,0 100%);
  background: linear-gradient(45deg,transparent 42%,var(--accent) 44% 55%,transparent 57%) top right / 10px 10px no-repeat, #1b1e24;
  color: var(--text); text-align: start; font: inherit; font-size: 12px; line-height: 1.5;
}
.info-note-title { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.info-note-title strong { font-size: 13px; font-weight: 700; }
.info-note-title svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }
.info-note .info-note-copy { margin: 0; color: var(--muted); }
#bankroll-hint {
  position: absolute; top: 100%; inset-inline-end: 0; z-index: 1;
  width: min(250px, calc(100vw - 44px)); margin: 0;
}
.bankroll-dialog .bankroll-explanation { margin: -6px 0 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.bankroll-dialog { margin: auto; width: min(340px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--bg); }
.bankroll-dialog::backdrop { background: #090a0dc4; }
.bankroll-dialog h3 { margin: 0 0 16px; }
.bankroll-dialog input { width: 100%; font-size: 16px; }
.bankroll-dialog form > div { margin-top: 16px; display: flex; gap: 8px; }
.bankroll-dialog form > div button { flex: 1; min-width: 0; min-height: 44px; }
.bankroll-dialog [role=alert]:not(:empty) { margin-top: 8px; font-size: 13px; color: var(--text); }
.bankroll-set { padding: 6px 0 12px; color: var(--accent); background: none; }

.position-size { margin-block: 16px; border-block: 1px solid var(--line); }
.position-size > summary { font-weight: 700; }
.position-size > .beta-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 0; margin-block: 4px 12px; }
.position-size .screen-field:only-child { grid-column: 1 / -1; }
.position-size input { width: 100%; min-width: 0; }
.position-size output { display: block; margin-block: 12px; font-size: 13px; }
.position-size output:empty { display: none; }
.budget-outcomes { display: flex; flex-wrap: wrap; gap: 14px; margin-block: 18px; }
.budget-outcome { flex: 1 1 115px; min-width: min-content; max-width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.budget-outcome > span { color: var(--muted); }
.budget-outcome strong { font-size: 23px; line-height: 1.2; font-weight: 750; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.budget-outcome strong small { font-size: 12px; font-weight: 600; letter-spacing: 0; }
.budget-loss { color: var(--candle-down); }
.budget-gain { color: #60dba8; }
.budget-share { font-size: 12px; }
.position-size .budget-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; margin-block: 6px; color: var(--muted); font-size: 13px; }
.budget-row bdi { color: var(--text); font-variant-numeric: tabular-nums; text-align: end; }
.position-size output > small, .budget-history p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.position-size output > small { display: block; margin-block: 10px 14px; }
.position-size .budget-history { border-block-start: 1px solid var(--line); border-block-end: 0; }
.budget-history p:first-child { margin-block: 0 10px; }
.budget-history-average { border-block-start: 1px solid var(--line); padding-block-start: 5px; margin-block-start: 12px; }
@media (max-width: 680px), (pointer: coarse) {
  #app :is(input:not([type=checkbox],[type=radio]), textarea, select) { font-size: max(16px, 1em); }
}

[dir="rtl"] :is(.history-record,.setting-row,.screen-field,.report-plan,.report-decision,.report-section) { text-align: start; }
[dir="rtl"] :is(.result-figure svg,.history-trace,.watch-bars,.result-instrument h2,.history-pair) { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .setting-row > .icon { transform: scaleX(-1); }

.report-new-analysis { display: inline-flex; align-items: center; gap: 6px; }
.report-new-analysis[hidden] { display: none; }
.report-new-analysis .icon { width: 14px; height: 14px; }

.report-overview[data-signal-fresh="false"] .report-plan :is(.position-size, .risk-upgrade) { display: none; }

.report-decision[data-side="long"] { --direction-ink: var(--candle-up); }
.report-decision[data-side="short"] { --direction-ink: var(--candle-down); }
.report-decision[data-confirmed="true"] .result-finding,
.report-overview[data-setup-status="signal"] .result-finding { color: var(--direction-ink, var(--text)); }
.report-overview:is([data-setup-status="expired"], [data-setup-status="missed"]) .result-finding { color: var(--text); }

.history-filters {
  grid-template-columns: minmax(0, 3fr) minmax(96px, 2fr);
  gap: 0;
  border-block: 1px solid var(--line);
  margin-block: 12px 18px;
}
.history-filters .screen-field {
  position: relative;
  grid-template-rows: auto 1fr;
  gap: 0;
  padding-block: 7px 3px;
}
.history-filters .screen-field + .screen-field { padding-inline-start: 15px; }
.history-filters .screen-field + .screen-field::before {
  content: ''; position: absolute; inset-block: 10px; inset-inline-start: 0;
  width: 1px; background: var(--line);
}
.history-filters .screen-field:focus-within { box-shadow: inset 0 -2px var(--accent); }
.history-filters .history-control > :is(input, select) {
  height: 34px; min-height: 34px; border: 0; background: transparent;
  padding-block: 3px; padding-inline-start: 0; border-radius: 0; outline: none;
  font-size: 16px; color: var(--text);
}
.history-filters .history-control > input { padding-inline-start: 25px; }
.history-filters .history-search-icon { inset-inline: 0 auto; width: 16px; height: 16px; }
.history-filters .screen-field:focus-within .history-search-icon { color: var(--accent); }
.history-filters option { color: var(--text); background: var(--bg); }
@media (forced-colors: active) {
  .history-filters .history-control > :focus-visible { outline: 2px solid Highlight; }
}
@media (prefers-reduced-motion: no-preference) {
  .analysis-progress .progress-step-name, .analysis-progress .progress-step-state {
    transition: color 200ms ease-out, opacity 200ms ease-out;
  }
  .analysis-progress [data-step="pending"] .progress-step-state { visibility: visible; opacity: 0; }
  .analysis-progress [data-step="done"] .progress-marker .icon {
    animation: step-check-in 220ms ease-out;
  }
  @keyframes step-check-in { from { opacity: 0; scale: .8; } }
  #watch-figure[data-feed="live"] .scanner-corner svg {
    transform-origin: 40% 40%;
    animation: watch-corner-lift 2.8s ease-in-out infinite;
  }
  /* The parent rotates this outward lift into each of the four corners. */
  @keyframes watch-corner-lift {
    0%, 12%, 100% { transform: translate(0, 0) scale(1); }
    55% { transform: translate(-2px, -2px) scale(1.12); }
  }
}
#app > .bankroll-bar {
  width: min(100%,480px);
  margin-inline: auto;
  padding: 4px clamp(18px,5.56vw,24px) 0;
}
#bankroll-hint { transform-origin: top right; }
[dir="rtl"] #bankroll-hint { transform-origin: top left; }
#bankroll-hint[inert] { visibility: hidden; pointer-events: none; opacity: 0; transform: translateY(-4px) scale(.98); }
@media (prefers-reduced-motion: no-preference) {
  #bankroll-hint {
    transition: transform 250ms cubic-bezier(.2,.75,.22,1), opacity 200ms ease-out, visibility 0s;
  }
  #bankroll-hint[inert] { transition-duration: 160ms,145ms,0s; transition-delay: 0s,0s,160ms; }
  .screen-details summary .icon { transition: transform 230ms ease-out; }
  .screen-details[data-collapsing] > summary > .icon { transform: none; }
}

.pro-sheet {
  box-sizing: border-box; width: min(calc(100% - 16px), 460px); height: 93dvh;
  max-height: calc(100dvh - env(safe-area-inset-top) - 8px); max-width: none;
  margin: auto auto max(6px,env(safe-area-inset-bottom)); padding: 0;
  border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--bg);
  overflow: hidden; --entry-offset: 16px;
}
.pro-sheet[open] { display: flex; flex-direction: column; }
.pro-sheet::backdrop { background: #07090dc7; }
.pro-sheet-top { display: flex; flex: none; justify-content: space-between; align-items: center; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); }
.pro-sheet-top h2 { margin: 0; font-size: 24px; letter-spacing: -.045em; }
.pro-sheet-top b { color: var(--accent); }
.pro-sheet-top button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #24272e; color: var(--text); }
.pro-sheet-top .icon { width: 17px; }
.pro-sheet-body { overflow: auto; overscroll-behavior: contain; padding: 20px clamp(16px,5vw,24px); flex: auto; display: flex; flex-direction: column; gap: 18px; }
.pro-sheet-body :is(p,h3,dl,dd) { margin: 0; }
.pro-sheet-body .screen-heading:empty { display: none; }
.pro-sheet-body .pro-period { color: var(--accent); font-size: 14px; font-weight: 650; }
.pro-sheet-body .pro-features { display: grid; gap: 0; margin-block-start: 14px; }
.pro-sheet-body .pro-features > div { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }
.pro-sheet-body .pro-features dt { color: var(--text); font-size: 15px; font-weight: 650; }
.pro-sheet-body .pro-features dd, .pro-sheet-body .pro-terms { color: var(--muted); font-size: 13px; line-height: 1.55; margin-top: 3px; }
.pro-sheet-body .screen-form { margin: 0; }
.pro-sheet:has([data-form="redeem-pro"]) { height: fit-content; max-height: min(93dvh, calc(100dvh - env(safe-area-inset-top) - 8px)); }
.pro-sheet-body [data-form="redeem-pro"] { display: grid; gap: 16px; }
.pro-sheet-body [data-form="redeem-pro"] .screen-field { display: grid; gap: 8px; }
.pro-sheet-body [data-form="redeem-pro"] .primary { margin: 2px 0 0; }
.pro-sheet-body .primary { width: 100%; min-height: 48px; color: #181a20; background: var(--accent); border-radius: 8px; font-weight: 700; }
.pro-sheet-body .form-feedback:empty { display: none; }
@media(min-width:600px) { .pro-sheet { margin: auto; height: min(93dvh,720px); } }

.pro-sheet-body .pro-features dd { font-weight: 500; }
.pro-sheet-body .pro-features > div { border-top: 0; }
.pro-sheet-body .pro-quota-summary { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 0; }
.pro-quota-summary strong { font-size: clamp(44px,11vw,60px); line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.pro-quota-summary span { max-width: 17ch; font-size: 14px; line-height: 1.4; color: var(--muted); }
.pro-sheet-body .pro-features { margin-top: 12px; }

.pro-sheet-body .pro-overview { border: 0; border-radius: 0; background: transparent; padding: 0; }

.pro-wallet-slot { flex: none; padding: 4px clamp(16px,5vw,24px) 0; }
.pro-wallet-slot .bankroll-bar { position: relative; }
.pro-wallet-slot:has(.bankroll-bar:not([hidden])) + .pro-sheet-top { padding-block-start: 2px; }

.guest-pro-link { display: grid; place-items: center; text-decoration: none; }

.free-smiley {
  display: inline-block; width: 24px; height: 22px; vertical-align: middle;
  background: url("assets/free-smiley.png?v=eyes-2") no-repeat; image-rendering: pixelated;
}
@media (prefers-reduced-motion: no-preference) {
  .free-smiley { animation: free-smiley-reaction 4s step-end infinite; }
  @keyframes free-smiley-reaction {
    0%,100% { background-position-x: 0; }
    42% { background-position-x: -24px; } 49% { background-position-x: -48px; }
    55% { background-position-x: -72px; } 61% { background-position-x: -96px; }
    70% { background-position-x: -120px; } 76% { background-position-x: -144px; }
    82% { background-position-x: -168px; }
  }
}

.bank-example { padding-block: 2px 18px; border-bottom: 1px solid var(--line); }
.bank-example h3 .icon { flex: none; width: 22px; height: 22px; color: var(--accent); }
.bank-example h3 { display: flex; align-items: center; gap: 8px; font-size: clamp(22px, 6.1vw, 29px); line-height: 1.08; letter-spacing: -.045em; text-wrap: balance; }
.bank-example .bank-explanation { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.bank-example .ticket-caption { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.ticket-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 10px 0; }
.ticket-bar i { height: 9px; background: #343840; }
.ticket-bar i:first-child { background: var(--accent); }
.ticket-size { color: var(--muted); font-size: 14px; }
.ticket-size strong { color: var(--accent); font-size: 29px; line-height: 1.2; letter-spacing: -.045em; margin-inline-end: 4px; }
.ticket-outcomes { width: 100%; border-collapse: collapse; margin-block-start: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ticket-outcomes th, .ticket-outcomes td { text-align: end; padding: 3px 0; }
.ticket-outcomes thead th { color: var(--muted); font-size: 12px; font-weight: 500; }
.ticket-outcomes tr > :first-child { text-align: start; }
.ticket-outcomes tbody th { font-weight: 500; }
.ticket-outcomes tbody td:first-of-type { font-weight: 700; }
.ticket-outcomes tbody td:last-child { color: var(--muted); }
.pro-sheet-body .pro-access { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; padding-top: 14px; font-size: 14px; }
.pro-access small { color: var(--muted); font-size: 13px; }

.pro-sheet-body .pro-overview .pro-features > div { padding-block: 8px; }
.pro-sheet-body .pro-overview .bank-example { padding-bottom: 12px; }
.pro-sheet-body:has([data-form="redeem-pro"]) { gap: 10px; padding-block: 14px; }
.pro-sheet-body [data-form="redeem-pro"] { gap: 10px; }

.pro-perk-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin: 0 0 20px; padding: 3px 0 18px; border-bottom: 1px solid var(--line); }
.pro-perk-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.35; }
.pro-perk-list :is(.icon, .perk-infinity) { flex: none; width: 18px; height: 18px; color: var(--accent); }
.perk-infinity { display: grid; place-content: center; font-size: 24px; line-height: 1; }

p.research-notice[role="note"] {
  display: flex; align-items: flex-start; gap: 8px; margin-block: 14px 0; padding: 9px 11px;
  border-radius: 6px; background: var(--surface, #1e2026); color: var(--muted);
  font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: normal;
}
.research-notice svg { flex: none; width: 15px; height: 15px; margin-block-start: 1.5px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }

/* Keep the native file picker accessible, with the attachment shown inline. */
.support-file { display: flex; align-items: center; gap: 4px; padding-inline: 8px; background: var(--surface); border-block: 1px solid var(--line); }
.support-file-pick { position: relative; display: flex; align-items: center; gap: 10px; min-height: 62px; flex: 1; min-width: 0; padding-inline: 4px; cursor: pointer; }
.support-file-pick:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.support-file-pick input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.support-file-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; color: var(--accent); background: #363020; clip-path: polygon(0 0,calc(100% - 6px) 0,100% 6px,100% 100%,0 100%); }
.support-file-icon .icon { width: 18px; height: 18px; }
.support-file-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.support-file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.support-file-text small { color: var(--muted); font-size: 12px; }
.support-file-add, .support-file button:not([hidden]) { display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); }
.support-file button { padding: 0; background: none; border: 0; }
.support-file-add .icon, .support-file button .icon { width: 16px; height: 16px; }
.support-file:has(button:not([hidden])) .support-file-add { display: none; }
