/* Orizzonte - stile. Colori piatti, nessuna sfumatura, tema chiaro e scuro. */
:root {
  color-scheme: light;
  --plane: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --surface-3: #e9e8e2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --accent: #2a78d6;
  --accent-strong: #1c5cab;
  --accent-soft: #e4eefb;
  --on-accent: #ffffff;
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --serious: #ec835a;
  --bad: #d03b3b;
  --bad-text: #b02a2a;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4;
  --band-outer: #cde2fb; --band-mid: #9ec5f4; --band-inner: #6da7ec; --band-line: #184f95;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 236px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2c2c2a;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
    --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #3987e5; --accent-strong: #86b6ef; --accent-soft: #15253a; --on-accent: #ffffff;
    --good-text: #0ca30c; --bad-text: #e66767;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
    --band-outer: #0d366b; --band-mid: #184f95; --band-inner: #256abf; --band-line: #86b6ef;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --surface-3: #2c2c2a;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #3987e5; --accent-strong: #86b6ef; --accent-soft: #15253a; --on-accent: #ffffff;
  --good-text: #0ca30c; --bad-text: #e66767;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181;
  --band-outer: #0d366b; --band-mid: #184f95; --band-inner: #256abf; --band-line: #86b6ef;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
button, input, select { font: inherit; color: inherit; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.up { color: var(--good-text); }
.down { color: var(--bad-text); }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ struttura */
.app { min-height: 100vh; }
.sidebar {
  display: none;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; stroke: var(--plane); stroke-width: 2; fill: none; }
.main { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); max-width: 1320px; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none;
  min-height: 56px; justify-content: center;
}
.tabbar a.active { color: var(--accent); }
.tabbar a.active svg.i { stroke-width: 2.2; }

.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); }
[data-theme="dark"] .nav a.active { color: var(--ink); }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: var(--sidebar) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 22px;
    position: sticky; top: 0; height: 100vh; padding: 20px 14px;
    background: var(--surface); border-right: 1px solid var(--border);
  }
  .sidebar .brand { padding: 2px 8px 0; }
  .nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 10px 12px 4px; }
  .sidebar-foot { margin-top: auto; padding: 0 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
  .topbar, .tabbar { display: none; }
  .main { padding: 28px 32px 48px; }
}

/* ------------------------------------------------------------ intestazioni pagina */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------ superfici */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.card + .card { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .hint { font-size: 12.5px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.span-2 { grid-column: span 1; }
@media (min-width: 720px) { .span-2 { grid-column: span 2; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.divider { height: 1px; background: var(--border); margin: 14px 0; border: 0; }

/* ------------------------------------------------------------ numeri chiave */
.hero-num { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
@media (min-width: 720px) { .hero-num { font-size: 40px; } }
.tiles { display: grid; gap: 1px; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--surface); padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile .v { font-size: 21px; font-weight: 620; letter-spacing: -0.01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .d { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.tile.emph .v { color: var(--accent-strong); }
[data-theme="dark"] .tile.emph .v { color: var(--accent-strong); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ------------------------------------------------------------ controlli */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn.icon { width: 38px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: default; }

.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 9px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font-size: 13.5px; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; min-height: 32px; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--border); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; font-weight: 550; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .label { font-size: 13px; color: var(--ink-2); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.field .val { color: var(--ink); font-weight: 620; font-variant-numeric: tabular-nums; }
.input, select.input {
  height: 40px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); width: 100%; min-width: 0;
}
.input:focus, .btn:focus-visible, .seg button:focus-visible, input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .input { flex: 1; }
.input-group .unit { color: var(--muted); font-size: 13px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: var(--surface-3); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 4px; background: var(--surface-3); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 14px; min-height: 36px; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--surface-3); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 0 0 1px var(--border); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

details.more { border-top: 1px solid var(--border); padding-top: 10px; }
details.more > summary { cursor: pointer; list-style: none; font-weight: 550; font-size: 14px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "+"; font-size: 18px; color: var(--muted); }
details.more[open] > summary::after { content: "\2212"; }
details.more > .stack { margin-top: 10px; }

/* ------------------------------------------------------------ badge e stato */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge.demo { background: transparent; border: 1px dashed var(--serious); color: var(--ink-2); }
.badge.live { background: transparent; border: 1px solid var(--border-strong); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.signal { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.signal svg { width: 16px; height: 16px; stroke-width: 2.2; }
.signal.pos svg { stroke: var(--good); } .signal.pos { color: var(--good-text); }
.signal.neu svg { stroke: var(--muted); } .signal.neu { color: var(--ink-2); }
.signal.neg svg { stroke: var(--bad); } .signal.neg { color: var(--bad-text); }

.notice { border: 1px solid var(--border-strong); border-left: 3px solid var(--serious); background: var(--surface); padding: 10px 12px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }
.notice.info { border-left-color: var(--accent); }

/* ------------------------------------------------------------ tabelle */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 550; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t th.num, table.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }

/* sotto i 720px le tabelle marcate diventano schede impilate */
@media (max-width: 719px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  table.t.cards tr:last-child { border-bottom: 0; }
  table.t.cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.t.cards td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; font-weight: 500; }
  table.t.cards td.lead { font-weight: 600; font-size: 15px; }
  table.t.cards td.lead::before { content: none; }
}

/* ------------------------------------------------------------ grafici */
.chart { width: 100%; height: 260px; }
.chart.tall { height: 300px; }
.chart.short { height: 180px; }
@media (min-width: 720px) {
  .chart { height: 320px; }
  .chart.tall { height: 400px; }
  .chart.short { height: 200px; }
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.legend i.line { height: 2px; }
.legend i.dash { height: 0; border-top: 2px dashed var(--muted); }
.spark { width: 96px; height: 30px; }

/* barra punteggio -1..+1 */
.meter { position: relative; height: 8px; background: var(--surface-3); border-radius: 4px; margin: 8px 0 4px; }
.meter .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.meter .fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.meter .mark { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 2px; background: var(--ink); transform: translateX(-2px); }
.meter-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }

/* barre orizzontali semplici (lenti, settori, posizioni) */
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; padding: 5px 0; }
.hbar .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 4px; position: relative; }
.hbar .bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.hbar .bar.neg { background: var(--bad); }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 56px; text-align: right; }

/* lista fattori */
.factor { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.factor:last-child { border-bottom: 0; }
.factor .fn { font-weight: 600; font-size: 14.5px; }
.factor .fv { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.factor .ft { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.factor .fm { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }

/* notizie */
.news-item { padding: 11px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.news-item:last-child { border-bottom: 0; }
.news-item a { color: var(--ink); font-weight: 550; }

/* watchlist */
.wl-item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.wl-item:last-child { border-bottom: 0; }
.wl-item .sym { font-weight: 650; }
.wl-item .nm { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
@media (min-width: 720px) { .wl-item .nm { max-width: 280px; } }

/* layout simulatore */
.sim-layout { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .sim-layout { grid-template-columns: 340px minmax(0, 1fr); align-items: start; } .sim-controls { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; } }
.sim-controls .stack { gap: 16px; }
.change-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }

/* barra riassuntiva fissa del simulatore su mobile */
.sim-sticky { display: none; }
@media (max-width: 1099px) {
  .sim-sticky {
    display: flex; position: sticky; top: 57px; z-index: 15; margin: -16px -16px 12px; padding: 10px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border); justify-content: space-between; align-items: center; gap: 10px;
  }
  .sim-sticky .lbl { font-size: 11.5px; color: var(--muted); }
  .sim-sticky .val { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
}
@media (max-width: 959px) and (min-width: 0) { .sim-sticky { top: calc(57px + env(safe-area-inset-top)); } }
@media (min-width: 960px) and (max-width: 1099px) { .sim-sticky { top: 0; margin: -28px -32px 16px; padding: 12px 32px; } }

/* foglio inferiore (menu "Altro" su mobile) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 14px 14px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.sheet .handle { width: 36px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 4px auto 10px; }
.sheet a { display: flex; align-items: center; gap: 12px; padding: 13px 10px; color: var(--ink); font-weight: 550; border-radius: 8px; text-decoration: none; }
.sheet a:hover { background: var(--surface-2); }

/* selettore simbolo */
.sym-select { max-width: 220px; }

/* stato di caricamento */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 28px 4px; font-size: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: var(--surface-2); border-radius: 6px; min-height: 18px; }
.error { color: var(--bad-text); font-size: 14px; padding: 12px 0; }

.footer-note { font-size: 12px; color: var(--muted); margin-top: 22px; line-height: 1.5; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--plane); padding: 9px 14px; border-radius: 8px; font-size: 14px; z-index: 60; }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* ------------------------------------------------------------ accesso */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 24px; }
.auth-wrap .error:empty { display: none; }
.qr-box { background: #ffffff; padding: 10px; border-radius: 8px; width: 200px; max-width: 100%; }
.qr-box svg { width: 100%; height: auto; display: block; }
code.secret { font-family: var(--mono); font-size: 13px; word-break: break-all; background: var(--surface-2); padding: 6px 8px; border-radius: 6px; display: inline-block; }

/* Quotazioni in giornata (live.js) */
.today { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.today-nums { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.today-nums .k { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.today-spark { width: 160px; max-width: 100%; }
.today-spark .spark { width: 100%; height: 34px; display: block; }
.today-status { flex-basis: 100%; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--ink-2); opacity: .6; }
.live-dot.on { background: var(--good); opacity: 1; animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
.flash-up, .flash-down { animation: live-flash 1.4s ease-out; border-radius: 4px; }
.flash-up { --flash: color-mix(in srgb, var(--good) 28%, transparent); }
.flash-down { --flash: color-mix(in srgb, var(--bad) 28%, transparent); }
@keyframes live-flash { from { background: var(--flash); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot.on, .flash-up, .flash-down { animation: none; } }

/* Simulatore: tabella dei fattori considerati */
.factors-t tr.group td { background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; }
.factors-t td.lead { max-width: 460px; }
