:root {
  color-scheme: light;
  --surface: #ffffff;
  --ink: #152b3b;
  --muted: #577082;
  --line: #dbe4eb;
  --chat: #e8edf1;
  --accent: #187db7;
  --tint: #f7f8fa;
  --warn: #a76711;
  --good: #25806b;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #17212b;
  --ink: #e9f1f7;
  --muted: #aabac6;
  --line: #344451;
  --chat: #0f1821;
  --accent: #63b9ed;
  --tint: #1e2a35;
  --warn: #e0a34f;
  --good: #67c7ac;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #dfe7ec; color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
.telegram-shell { width: min(100%, 900px); margin: 24px auto; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 40px #243b5318; }
.status-line, .telegram-header, .pinned, .telegram-footer { background: var(--surface); }
.status-line { display: flex; justify-content: space-between; gap: 8px; padding: 12px 24px 8px; font-size: 11px; font-weight: 600; }
.demo-label { color: var(--warn); letter-spacing: .06em; }
.telegram-header { display: flex; align-items: center; gap: 14px; padding: 10px 22px 16px; }
.header-icon { color: var(--accent); font-size: 24px; line-height: 1; }
.avatar { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: #e1f1fc; color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.header-title { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.header-title strong { font-size: 16px; }
.header-title small, .pinned small, .risk-score small, .event small, .metric small { color: var(--muted); font-size: 12px; }
.pinned { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 11px 24px; }
.pin-mark { color: var(--accent); font-size: 20px; }
.pinned div { display: flex; flex-direction: column; border-left: 2px solid var(--accent); padding-left: 10px; }
.pinned strong { color: var(--accent); font-size: 13px; }
.chat { min-height: 900px; background: var(--chat); padding: 20px 18px 28px; }
.date-pill { width: max-content; max-width: 100%; margin: 0 auto 16px; border-radius: 16px; background: #d4dfe7; padding: 4px 12px; color: var(--muted); font-size: 11px; }
.bubble { border-radius: 12px 12px 12px 4px; background: var(--surface); padding: 19px; }
.byline { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; font-weight: 600; }
.byline span { color: var(--muted); font-weight: 400; }
h1 { margin: 7px 0 17px; font-size: 25px; line-height: 1.25; letter-spacing: -.02em; }
h2 { margin: 23px 0 9px; font-size: 14px; line-height: 1.3; }
.risk-card { border-radius: 10px; background: var(--tint); padding: 16px; }
.risk-score { display: flex; align-items: center; gap: 15px; min-height: 52px; }
.score-number { font-size: 42px; font-weight: 650; letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-number small { margin-left: 3px; font-size: 17px; font-weight: 400; }
.score-empty { width: 54px; color: var(--muted); font-size: 38px; line-height: 1; text-align: center; }
.risk-score div { display: flex; flex-direction: column; }
.risk-score strong { font-size: 14px; }
.risk-meter { height: 6px; margin: 14px 0 10px; overflow: hidden; border-radius: 6px; background: #e1e7ec; }
.risk-meter span { display: block; width: 100%; height: 100%; background: #c7d4dc; }
.risk-deltas { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.lead { margin: 15px 0 0; font-size: 14px; }
.change { display: flex; align-items: flex-start; gap: 9px; }
.change p { margin: 0 0 10px; }
.dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 7px; border-radius: 50%; }
.dot.warn { background: var(--warn); }
.dot.good { background: var(--good); }
.quiet { margin: 7px 0; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metric { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding: 9px 0; }
.metric span { font-size: 12px; }
.metric strong { margin-top: 2px; font-size: 14px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 10px; }
.event { display: flex; gap: 12px; border-top: 1px solid var(--line); padding: 9px 0; }
.event > span { min-width: 76px; color: var(--accent); font-size: 11px; font-weight: 600; }
.event div { display: flex; flex-direction: column; }
.event strong { font-size: 13px; }
.source-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 15px; border-radius: 7px; background: #f3f5f7; padding: 10px; color: var(--muted); font-size: 12px; }
.source-note > span:first-child { display: grid; width: 16px; height: 16px; flex: 0 0 auto; place-items: center; border: 1px solid var(--muted); border-radius: 50%; font-size: 11px; }
.meta { margin-top: 12px; color: var(--muted); font-size: 10px; text-align: right; }
.meta span { margin-left: 5px; }
.keyboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 7px; }
.keyboard button { border: 0; border-radius: 7px; background: #d4e4ee; color: var(--accent); padding: 11px 7px; font-size: 12px; font-weight: 500; }
.telegram-footer { display: flex; justify-content: center; gap: 9px; padding: 16px; color: var(--accent); font-size: 12px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.guide-button { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--accent); text-decoration: none; background: var(--tint); font-weight: 600; }
.guide-button small { grid-column: 1; color: var(--muted); font-weight: 400; }
.guide-button > span:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 22px; }
.guide-page { background: var(--chat); }
.guide-shell { max-width: 800px; margin: 24px auto; padding: 28px 38px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.guide-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; }
.guide-nav span, .guide-eyebrow { font-size: 11px; letter-spacing: .09em; color: var(--muted); }
.guide-nav a, .guide-footer a, .guide-body a { color: var(--accent); text-underline-offset: 3px; }
.guide-eyebrow { color: var(--accent); margin-bottom: 16px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.guide-toc[hidden] { display: none; }
.guide-toc a { border: 1px solid var(--line); border-radius: 16px; padding: 6px 10px; color: var(--accent); text-decoration: none; font-size: 12px; }
.guide-body { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.guide-body h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.15; margin: 20px 0; letter-spacing: -.035em; }
.guide-body h2 { border-top: 1px solid var(--line); padding-top: 28px; margin-top: 38px; font-size: 24px; scroll-margin-top: 18px; }
.guide-body h3 { font-size: 18px; margin: 28px 0 8px; color: var(--accent); }
.guide-body p { margin: 10px 0 16px; }
.guide-body h1 + p { color: var(--muted); font-size: 13px; }
.guide-body li { margin: 8px 0; }
.guide-detail { margin: 10px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); }
.guide-detail summary { color: var(--accent); font-weight: 600; cursor: pointer; }
.guide-detail[open] summary { margin-bottom: 16px; }
.guide-comparison { width: 100%; border-collapse: collapse; font-size: 13px; }
.guide-comparison th, .guide-comparison td { border-bottom: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: top; }
.guide-comparison th { color: var(--muted); }
.guide-note { border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--tint); padding: 18px 20px; margin: 24px 0; }
.guide-footer { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }
@media (max-width: 600px) {
  .guide-shell { margin: 0; padding: 20px; border: 0; border-radius: 0; }
  .guide-nav { font-size: 12px; }
  .guide-nav span { font-size: 9px; }
  .guide-body h2 { font-size: 22px; }
  .guide-comparison thead { display: none; }
  .guide-comparison tr { display: block; margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
  .guide-comparison td { display: block; border: 0; padding: 5px 0; }
  .guide-comparison td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; }
}
.mini-content { background: var(--chat); padding: 18px 22px 30px; }
.dashboard-status { border-radius: 8px; background: var(--tint); padding: 9px 12px; color: var(--muted); font-size: 12px; }
.dashboard-status[data-kind="error"] { color: var(--warn); }
.dashboard-status[data-kind="ok"] { color: var(--good); }
.mini-section { margin-top: 16px; border-radius: 12px; background: var(--surface); padding: 16px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.section-heading h1 { margin: 0; font-size: 22px; }
.risk-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--accent); font-size: 12px; text-align: right; }
.risk-summary span { color: var(--muted); }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.range-row > div > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.segmented { display: flex; gap: 4px; flex-wrap: wrap; }
.segmented button { border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); padding: 7px 9px; cursor: pointer; font-size: 11px; }
.segmented button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.history-chart { width: 100%; min-height: 220px; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1.2; fill: none; }
.history-path { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.history-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-title { fill: var(--ink); font-size: 13px; font-weight: 600; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-label.end { text-anchor: end; }
.chart-empty { fill: var(--muted); font-size: 13px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-card { display: flex; min-height: 84px; flex-direction: column; border-top: 1px solid var(--line); padding-top: 9px; }
.mini-card span { color: var(--muted); font-size: 11px; }
.mini-card strong { margin-top: 4px; font-size: 15px; font-variant-numeric: tabular-nums; }
.mini-card small { margin-top: auto; color: var(--muted); font-size: 10px; }
.compact-list { display: grid; gap: 7px; margin: 0; padding-left: 18px; color: var(--ink); font-size: 12px; }
.compact-list .gap { color: var(--warn); }
@media (max-width: 600px) {
  body { background: var(--surface); }
  .telegram-shell { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .chat { min-height: 0; padding: 16px 12px 24px; }
  .bubble { padding: 15px; }
  h1 { font-size: 21px; }
  .keyboard { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .mini-content { padding: 12px 10px 22px; }
  .mini-section { padding: 13px; }
  .section-heading { flex-direction: column; }
  .risk-summary { align-items: flex-start; text-align: left; }
  .range-row, .mini-grid { grid-template-columns: 1fr; }
  .history-chart { min-height: 190px; }
}

/* The index is the principal result. Direction is also written in text. */
.index-hero{display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:22px 18px;border:1px solid #7f8eaa33;border-radius:22px;margin:14px 0;background:linear-gradient(135deg,#b4c9e51a,#8096ba0a)}
.index-eyebrow{text-transform:uppercase;font-size:11px;letter-spacing:.09em;opacity:.7}.index-value-row{display:flex;align-items:baseline;gap:12px}.index-number{font-size:68px;font-weight:750;line-height:1.1;letter-spacing:-.06em;font-variant-numeric:tabular-nums}.index-scale{font-size:20px;opacity:.6}.index-trends{display:flex;gap:10px;flex-wrap:wrap}.index-delta{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:9px;border-radius:12px;background:#7f8eaa0c;font-size:12px}.index-delta small{width:100%;opacity:.7}.index-delta svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}.index-delta[data-direction=up]{color:#B42318}.index-delta[data-direction=down]{color:#13795B}.index-delta[data-direction=neutral]{opacity:.65}.index-limit,.index-gap{font-size:12px;line-height:1.5;margin:0}.index-components{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.index-components .mini-card{min-width:0}.index-hero small{line-height:1.45}.index-hero p{overflow-wrap:anywhere}html[data-theme=dark] .index-delta[data-direction=up]{color:#FF9C92}html[data-theme=dark] .index-delta[data-direction=down]{color:#6FDBC0}

.risk-summary.index-hero{align-items:stretch;text-align:left;color:var(--ink)}.index-hero .index-number{color:var(--accent)}.index-hero .index-delta span{color:inherit}

.method-overview{margin-top:16px;padding:15px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
.method-overview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.method-overview-head h2{margin:0;font-size:16px;line-height:1.3;letter-spacing:-.01em}
.method-overview-head p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.4}
.method-weight{flex:0 0 auto;border:1px solid color-mix(in srgb,var(--accent) 24%,var(--line));border-radius:999px;background:color-mix(in srgb,var(--accent) 9%,var(--surface));padding:5px 9px;color:var(--accent);font-size:10px;font-weight:700;white-space:nowrap}
.method-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:13px}
.method-pillar{display:grid;grid-template-columns:24px minmax(0,1fr);align-content:start;gap:6px 8px;min-width:0;border:1px solid var(--line);border-radius:13px;background:var(--tint);padding:10px}
.method-number{display:grid;width:24px;height:24px;place-items:center;border-radius:8px;background:color-mix(in srgb,var(--accent) 12%,var(--surface));color:var(--accent);font-size:10px;font-weight:700;font-variant-numeric:tabular-nums}
.method-pillar strong{align-self:center;min-width:0;font-size:11px;line-height:1.3;overflow-wrap:anywhere}
.method-pillar small{grid-column:1/-1;min-height:32px;color:var(--muted);font-size:10px;line-height:1.45;overflow-wrap:anywhere}
.method-share{grid-column:1/-1;color:var(--accent);font-size:10px;font-weight:650}
.method-note{margin:12px 0 0;color:var(--muted);font-size:11px;line-height:1.55;overflow-wrap:anywhere}
.method-overview .guide-button{margin-top:11px}
@media (min-width:700px){.method-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.method-pillar small{min-height:48px}}
