/* LONG — stile "plancia di navigazione": abisso, ottone, verde mare e corallo */
:root {
  --bg: #0F1C2B;
  --surface: #16283A;
  --surface-2: #1C3247;
  --line: #24394E;
  --text: #E6EEF3;
  --muted: #8EA3B5;
  --brass: #D9A441;
  --brass-ink: #1A1206;
  --long: #3FB68B;
  --short: #E5604F;
  --long-bg: rgba(63, 182, 139, .14);
  --short-bg: rgba(229, 96, 79, .14);
  --wait: #9FB3C4;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 0px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF2F5;
  --surface: #FFFFFF;
  --surface-2: #F4F7F9;
  --line: #D3DDE5;
  --text: #102233;
  --muted: #5B7083;
  --brass: #A87A1E;
  --brass-ink: #FFFFFF;
  --long: #1E9068;
  --short: #CC4433;
  --long-bg: rgba(30, 144, 104, .1);
  --short-bg: rgba(204, 68, 51, .1);
  --wait: #5B7083;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font); font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-stretch: 88%; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
svg { flex-shrink: 0; }

/* ---------- comuni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--brass); }
.btn-ghost { background: transparent; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px 0; font-size: 13.5px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-s);
  background: transparent; border: 1px solid transparent; color: var(--muted);
}
.icon-btn:hover { color: var(--text); border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { color: var(--brass); }
.panel { background: var(--surface); }
.logo-mark {
  width: 22px; height: 22px; border-radius: 50%; position: relative; display: inline-block;
  border: 2.5px solid var(--brass);
  border-bottom-color: transparent; transform: rotate(-45deg);
}
.logo-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2.5px; height: 10px; background: var(--brass); border-radius: 2px; transform: translate(-50%, -95%) rotate(55deg); transform-origin: 50% 100%; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.form input:not([type=checkbox]):not([type=range]), .form select, .radar-ctl select, .adm-users-h input, .adm-users-h select, .mk-search input {
  min-height: 42px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-s); color: var(--text); width: 100%;
}
.form input:focus, .form select:focus { border-color: var(--brass); outline: none; }
.form .check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; font-size: 13px; }
.form .check input { margin-top: 3px; accent-color: var(--brass); }
.form-grid { grid-template-columns: 1fr 1fr; }
.span2 { grid-column: 1 / -1; }
.form-msg { min-height: 20px; font-size: 13.5px; margin: 12px 0 0; }
.form-msg.err { color: var(--short); }
.form-msg.ok { color: var(--long); }

.seg { display: grid; grid-auto-flow: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; margin-bottom: 20px; }
.seg-btn { background: none; border: 0; min-height: 36px; border-radius: 4px; color: var(--muted); font-weight: 600; }
.seg-btn.is-on { background: var(--surface-2); color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--nav-h)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-s);
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- avvio ---------- */
.screen { min-height: 100%; }
.boot { display: grid; place-items: center; align-content: center; gap: 10px; height: 100vh; color: var(--brass); }
.boot-dial { width: 120px; }
.boot-needle { transform-origin: 60px 60px; animation: sweep 1.6s ease-in-out infinite alternate; }
.boot-word { margin: 0; font-size: 28px; font-weight: 800; font-stretch: 125%; color: var(--text); letter-spacing: -.01em; }
@keyframes sweep { from { transform: rotate(-60deg); } to { transform: rotate(60deg); } }

/* ---------- accesso ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-side { padding: 56px clamp(24px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 22px; background: var(--surface); border-right: 1px solid var(--line); position: relative; overflow: hidden; }
.brand-big { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 26px; font-stretch: 125%; }
.brand-big .logo-mark { width: 28px; height: 28px; }
.auth-title { font-size: clamp(32px, 4.2vw, 54px); line-height: 1.04; margin: 0; font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; max-width: 16ch; text-wrap: balance; }
.auth-lead { color: var(--muted); max-width: 52ch; margin: 0; font-size: 16px; }
.auth-dial { width: min(360px, 80%); margin-top: 10px; }
.auth-needle { transform-origin: 120px 120px; animation: needle-intro 2.4s cubic-bezier(.3,1.4,.5,1) .3s both; }
@keyframes needle-intro { 0% { transform: rotate(-80deg); } 55% { transform: rotate(58deg); } 75% { transform: rotate(38deg); } 100% { transform: rotate(48deg); } }
.auth-card { padding: 56px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; justify-self: center; }

/* ---------- abbonamento ---------- */
.paywall { display: grid; place-items: center; padding: 24px; min-height: 100vh; }
.pay-card { max-width: 480px; display: grid; gap: 16px; }
.pay-card h1 { margin: 12px 0 0; font-size: 32px; font-stretch: 112%; line-height: 1.1; }
.pay-card p { margin: 0; color: var(--muted); }
.pay-price { display: flex; align-items: baseline; gap: 10px; }
.pay-price strong { font-size: 44px; color: var(--text); font-stretch: 100%; font-weight: 800; }
.pay-note { font-size: 13.5px; }
.pay-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- app: griglia ---------- */
.app {
  display: grid; height: 100vh; height: 100dvh;
  grid-template-columns: 268px minmax(0, 1fr) 360px;
  grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas: "top top top" "markets chart signal";
}
.top { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; font-stretch: 125%; width: 236px; }
.asset-pick { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px 4px; border-radius: var(--radius-s); }
.asset-pick:hover { background: var(--surface-2); }
.ap-name { font-weight: 700; font-size: 17px; }
.ap-cat { color: var(--muted); font-size: 13px; }
.quote { display: flex; align-items: baseline; gap: 12px; }
.q-price { font-size: 24px; font-weight: 700; }
.q-chg { font-size: 14px; font-weight: 600; }
.up { color: var(--long); } .down { color: var(--short); }
.q-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); align-self: center; }
.q-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.q-live.live i { background: var(--long); box-shadow: 0 0 0 0 var(--long); animation: ping 2s infinite; }
.q-live.chiuso i { background: var(--brass); }
.q-live.offline i { background: var(--short); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(63,182,139,.6); } 70% { box-shadow: 0 0 0 7px rgba(63,182,139,0); } 100% { box-shadow: 0 0 0 0 rgba(63,182,139,0); } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.user-chip { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; margin-left: 6px; }

/* mercati */
.markets { grid-area: markets; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.mk-search { padding: 12px 12px 8px; }
.mk-cats { display: flex; gap: 4px; padding: 0 12px 10px; flex-wrap: wrap; }
.mk-cat { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.mk-cat.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }
.mk-list { list-style: none; margin: 0; padding: 0 6px 12px; overflow-y: auto; flex: 1; }
.mk-item { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; align-items: center; }
.mk-item:hover { background: var(--surface-2); }
.mk-item.is-on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brass); }
.mk-n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-s { font-size: 12px; color: var(--muted); }
.mk-p { text-align: right; font-size: 13.5px; }
.mk-c { text-align: right; font-size: 12px; }
.mk-star { background: none; border: 0; color: var(--line); padding: 0 0 0 6px; font-size: 15px; line-height: 1; }
.mk-star.on { color: var(--brass); }
.mk-group { padding: 12px 10px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* grafico */
.chartcol { grid-area: chart; display: grid; grid-template-rows: auto minmax(0, 1fr) 238px; min-width: 0; min-height: 0; }
.tf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tf-group { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; overflow-x: auto; scrollbar-width: none; }
.tf-btn { background: none; border: 0; min-width: 38px; height: 30px; border-radius: 4px; font-weight: 600; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf-btn.is-on { background: var(--brass); color: var(--brass-ink); }
.tf-btn:not(.is-on):hover { color: var(--text); }
.tf-tools { display: flex; gap: 14px; }
.mini-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.mini-toggle input { accent-color: var(--brass); }
.chart-wrap { position: relative; min-height: 0; }
.chart { position: absolute; inset: 0; }
.chart-legend { position: absolute; left: 12px; top: 8px; display: flex; gap: 12px; font-size: 12px; color: var(--muted); pointer-events: none; z-index: 2; flex-wrap: wrap; }
.chart-legend b { font-weight: 600; }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); z-index: 3; background: color-mix(in srgb, var(--bg) 70%, transparent); }

.lower { border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 11px 12px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.is-on { color: var(--text); border-bottom-color: var(--brass); }
.tab-body { padding: 12px 16px; overflow: auto; flex: 1; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }

/* confluenza */
.conf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.conf-cell { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; display: grid; gap: 6px; background: var(--bg); }
.conf-cell.is-cur { border-color: var(--brass); }
.conf-tf { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.conf-dir { font-weight: 800; font-size: 15px; font-stretch: 112%; }
.conf-bar { height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.conf-bar i { position: absolute; top: 0; bottom: 0; left: 50%; }
.conf-sum { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.conf-sum strong { color: var(--text); }

/* backtest */
.bt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 18px; margin-bottom: 10px; }
.bt-k { font-size: 12px; color: var(--muted); }
.bt-v { font-size: 20px; font-weight: 700; }
.bt-curve { width: 100%; height: 64px; display: block; }
.bt-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }

/* diario */
.diary { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.diary th, .diary td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.diary th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.diary select { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 3px 4px; font-size: 12.5px; }

/* ---------- Bussola e pannello segnale ---------- */
.signal { grid-area: signal; border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 18px; }
.compass { display: grid; justify-items: center; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dial { width: 100%; max-width: 300px; overflow: visible; }
.dial-lab { fill: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.dial-tick { stroke: var(--bg); stroke-width: 2; }
.needle { transform-origin: 130px 134px; transform: rotate(0deg); transition: transform 1.1s cubic-bezier(.25, 1.5, .45, 1); }
.verdict { text-align: center; }
.v-dir { font-size: 46px; font-weight: 800; font-stretch: 125%; line-height: 1; letter-spacing: -.02em; color: var(--wait); }
.v-dir.long { color: var(--long); }
.v-dir.short { color: var(--short); }
.v-sub { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.v-sub .num { color: var(--text); font-weight: 600; }
.v-note { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 34ch; margin-inline: auto; min-height: 1em; }
.verdict.flash .v-dir { animation: flash 1s ease 2; }
@keyframes flash { 50% { opacity: .35; } }

.block { display: grid; gap: 10px; }
.block-h { margin: 0; font-size: 15px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.block-h small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.plan { display: grid; grid-template-columns: 1fr auto auto; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.plan > div { display: contents; }
.plan dt, .plan dd { padding: 8px 12px; margin: 0; border-top: 1px solid var(--line); font-size: 14px; }
.plan > div:first-child dt, .plan > div:first-child dd { border-top: 0; }
.plan dt { color: var(--muted); }
.plan dd { text-align: right; font-variant-numeric: tabular-nums; font-stretch: 88%; }
.plan dd.dist { color: var(--muted); font-size: 12.5px; }
.plan .r-entry dd:first-of-type { font-weight: 700; color: var(--text); }
.plan .r-sl dt { color: var(--short); }
.plan .r-tp dt { color: var(--long); }
.plan.hypo { opacity: .62; }
.plan-actions { display: flex; gap: 8px; }

.calc-in { display: grid; gap: 12px; }
.calc-in label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); position: relative; }
.calc-in input[type=number] { min-height: 40px; padding: 0 12px 0 28px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); width: 100%; font-variant-numeric: tabular-nums; }
.calc-in .cur { position: absolute; left: 11px; bottom: 10px; color: var(--muted); }
.range-row { display: grid; grid-template-columns: 1fr 58px; gap: 10px; align-items: center; }
.range-row input { accent-color: var(--brass); width: 100%; }
.range-row output { text-align: right; color: var(--text); font-weight: 600; }
.calc-out { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 14px; }
.calc-out dt { color: var(--muted); }
.calc-out dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-out .warn { grid-column: 1 / -1; color: var(--brass); font-size: 12.5px; font-weight: 500; }

.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.why li { display: grid; grid-template-columns: 86px 54px 1fr; gap: 10px; align-items: center; font-size: 13px; }
.why b { font-weight: 600; }
.why span { color: var(--muted); }
.wbar { height: 6px; background: var(--line); border-radius: 3px; position: relative; overflow: hidden; }
.wbar i { position: absolute; top: 0; bottom: 0; left: 50%; }
.disclaimer { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.45; }

/* ---------- fogli (radar, profilo, tecnico) ---------- */
.sheet { position: fixed; inset: 0; background: rgba(5, 12, 20, .62); z-index: 50; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.sheet-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; width: min(480px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: 22px; display: grid; gap: 18px; align-content: start; animation: rise .22s ease; }
.sheet-card.wide { width: min(760px, 100%); }
.sheet-card.full { width: min(1240px, 100%); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.sheet-h { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.sheet-h h2 { margin: 0; font-size: 22px; font-stretch: 112%; }
.sheet-h p { margin: 0; color: var(--muted); font-size: 14px; grid-column: 1; }
.sheet-h .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.pf-actions { display: grid; gap: 8px; }
.fine { font-size: 12px; color: var(--muted); margin: 0; text-align: center; }

.radar-ctl { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.radar-out { display: grid; gap: 6px; }
.radar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 74px 64px; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg); cursor: pointer; text-align: left; width: 100%; }
.radar-row:hover { border-color: var(--muted); }
.radar-row .rn { font-weight: 600; }
.radar-row .rd { font-weight: 800; font-stretch: 112%; text-align: right; }
.radar-row .rs { text-align: right; }

.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; background: var(--bg); }
.stat b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat.hl b { color: var(--brass); }
.adm-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-box { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.adm-box h3 { margin: 0; font-size: 16px; }
.adm-users { grid-row: span 2; }
.adm-users-h { display: grid; grid-template-columns: auto auto 1fr 150px; gap: 10px; align-items: center; }
.table-wrap { overflow: auto; max-height: 520px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12.5px; position: sticky; top: 0; background: var(--surface); }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); }
.pill.g { color: var(--long); border-color: color-mix(in srgb, var(--long) 40%, transparent); }
.pill.r { color: var(--short); border-color: color-mix(in srgb, var(--short) 40%, transparent); }
.pill.y { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 40%, transparent); }
.u-pay { border-top: 1px solid var(--line); padding-top: 16px; }
.u-pay h3 { margin: 0; font-size: 15px; }

.bottom-nav { display: none; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 230px minmax(0, 1fr) 320px; }
  .brand { width: 198px; }
  .adm-grid { grid-template-columns: 1fr; }
  .adm-users { grid-row: auto; }
}

/* ---------- telefono ---------- */
@media (max-width: 860px) {
  :root { --nav-h: 64px; }
  body { font-size: 15px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: calc(28px + env(safe-area-inset-top)) 22px 8px; border-right: 0; background: transparent; gap: 14px; }
  .auth-title { font-size: 34px; }
  .auth-lead { font-size: 14.5px; }
  .auth-dial { display: none; }
  .auth-card { padding: 16px 22px 40px; }

  .app { grid-template-columns: 100%; grid-template-rows: calc(56px + env(safe-area-inset-top)) minmax(0, 1fr) calc(var(--nav-h) + env(safe-area-inset-bottom)); grid-template-areas: "top" "main" "nav"; }
  .top { padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); gap: 8px; min-width: 0; }
  .brand { width: auto; }
  .brand-word { display: none; }
  .asset-pick { display: flex; min-width: 0; }
  .ap-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; font-size: 16px; }
  .ap-cat { display: none; }
  .chart-legend .lg-ema { display: none; }
  .chart-legend { font-size: 11.5px; gap: 8px; }
  .quote { flex-direction: column; gap: 0; align-items: flex-end; margin-left: auto; }
  .q-price { font-size: 17px; }
  .q-chg { font-size: 12px; }
  .q-live { display: none; }
  .top-actions { margin-left: 0; }
  #btn-theme, #btn-alerts { display: none; }

  .markets, .chartcol, .signal { grid-area: main; display: none; border: 0; }
  body[data-view="markets"] .markets { display: flex; }
  body[data-view="chart"] .chartcol { display: grid; }
  body[data-view="signal"] .signal { display: flex; }
  .chartcol { grid-template-rows: auto minmax(0, 1fr) 210px; }
  .tf-bar { padding: 8px 10px; }
  .tf-group { width: 100%; }
  .tf-btn { flex: 1; min-width: 32px; }
  .tf-tools { width: 100%; justify-content: space-between; }
  .signal { padding: 14px 16px 30px; }
  .v-dir { font-size: clamp(34px, 13vw, 52px); }

  .bottom-nav { grid-area: nav; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav button { background: none; border: 0; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
  .bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav button.is-on { color: var(--brass); }

  .sheet { padding: 0; place-items: end stretch; }
  .sheet-card, .sheet-card.wide, .sheet-card.full { width: 100%; border-radius: 16px 16px 0 0; max-height: 92dvh; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .radar-ctl { grid-template-columns: 1fr 1fr; }
  .radar-ctl .btn { grid-column: 1 / -1; }
  .radar-row { grid-template-columns: minmax(0, 1fr) 70px 54px; }
  .radar-row .rx { display: none; }
  .adm-users-h { grid-template-columns: 1fr 1fr; }
  .adm-users-h h3 { grid-column: 1 / -1; }
  .why li { grid-template-columns: 80px 46px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- v2: blocco, impostazioni, password, apprendimento ---------- */
.lock { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; text-align: center; }
.lock-card { display: grid; gap: 14px; justify-items: center; max-width: 360px; }
.lock-card h1 { margin: 0; font-size: 26px; font-stretch: 112%; }
.lock-card p { margin: 0; color: var(--muted); }
.lock-card .btn { width: 100%; }
.lock-ico { width: 72px; height: 72px; color: var(--brass); }
.small-card { width: min(400px, 100%); justify-items: center; text-align: center; }
.small-card h2 { margin: 0; font-size: 20px; }
.small-card .pf-actions { width: 100%; }

.pw { position: relative; display: block; }
.pw input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 38px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); border-radius: var(--radius-s); }
.pw-eye:hover { color: var(--text); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.auth-lang { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.lang-select { min-height: 36px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); }
#st-lang { width: 100%; min-height: 42px; }

.v-model { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.v-model::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); flex: none; }
.v-model:empty { display: none; }

.set-block { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-block h3 { margin: 0; font-size: 16px; }
.set-help { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.set-help:empty { display: none; }
.lrn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lrn-row > div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; display: grid; }
.lrn-row b { font-size: 24px; font-weight: 800; }
.lrn-row span { font-size: 12.5px; color: var(--muted); }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--long); border-radius: 3px; transition: width .8s ease; }
.skill { display: grid; gap: 8px; }
.skill-h { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.skill-h b { color: var(--brass); font-size: 15px; }
.skill-bar { position: relative; height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--short), #C9A44B 45%, var(--long)); opacity: .9; }
.skill-bar::after { content: ""; position: absolute; inset: 0; border-radius: 8px; background: var(--bg); opacity: .62; clip-path: inset(0 0 0 var(--skill, 0%)); transition: clip-path .9s ease; }
.skill-bar i { position: absolute; top: -4px; bottom: -4px; width: 4px; border-radius: 2px; background: var(--text); left: calc(var(--skill, 0%) - 2px); z-index: 1; transition: left .9s ease; }
.skill-ticks { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); pointer-events: none; z-index: 1; }
.skill-ticks span { border-right: 2px solid var(--surface); }
.skill-ticks span:last-child { border-right: 0; }
.skill.cal .skill-bar { filter: grayscale(.8); }
.lrn-spark { width: 100%; height: 48px; display: block; }
.fine-left { font-size: 12px; }
.switch-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; cursor: pointer; }
.switch-row > span { display: grid; gap: 3px; }
.switch-row small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.switch-row input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch-row input:checked { background: var(--long); }
.switch-row input:checked::after { transform: translateX(20px); }
.switch-row input:disabled { opacity: .4; }
.calc-out .warn.hot { color: var(--short); }

/* ---------- v2: telefono ---------- */
@media (max-width: 860px) {
  .boot, .paywall { min-height: 100dvh; }
  .paywall { padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
  .pay-card h1 { font-size: 26px; }
  .pay-price strong { font-size: 36px; }
  .auth-card { padding: 16px 22px calc(32px + env(safe-area-inset-bottom)); }
  .auth-title { font-size: clamp(28px, 8.5vw, 34px); }
  .asset-pick { flex: 1 1 auto; overflow: hidden; }
  .ap-name { max-width: none; flex: 0 1 auto; }
  .quote { flex: none; }
  .q-price { font-size: clamp(14px, 4.4vw, 17px); }
  .user-chip { width: 34px; height: 34px; margin-left: 2px; }
  #btn-admin { width: 34px; }
  .signal { padding: 14px max(16px, env(safe-area-inset-left)) 30px max(16px, env(safe-area-inset-right)); gap: 16px; }
  .dial { max-width: 260px; }
  .v-note { font-size: 12.5px; }
  .plan { grid-template-columns: minmax(0, 1fr) auto auto; }
  .plan dt, .plan dd { padding: 8px 10px; font-size: 13.5px; }
  .plan dt { overflow-wrap: anywhere; }
  .plan dd.dist { font-size: 11.5px; padding-left: 4px; }
  .block-h { flex-wrap: wrap; }
  .plan-actions .btn { flex: 1; }
  .calc-out { font-size: 13.5px; }
  .why li { grid-template-columns: 76px 40px minmax(0, 1fr); gap: 8px; font-size: 12.5px; }
  .tf-bar { gap: 6px; }
  .tf-btn { min-width: 0; padding: 0 2px; font-size: 13px; }
  .tf-tools { gap: 8px; }
  .mini-toggle { font-size: 12.5px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab-body { padding: 10px 12px; }
  .conf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
  .bt-v { font-size: 17px; }
  .mk-list { padding-bottom: 16px; }
  .sheet-card { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 20px; }
  .kv { font-size: 14px; }
  .kv dd { overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .brand .logo-mark { display: none; }
  .tf-tools .mini-toggle span { font-size: 12px; }
  .lrn-row b { font-size: 20px; }
}

.range-row { grid-template-columns: minmax(0, 1fr) 82px; }
.range-num { min-height: 34px !important; padding: 0 8px !important; text-align: right; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); width: 100%; font-weight: 600; color: var(--text); }
.range-num-wrap { position: relative; display: block; }
.range-num-wrap .range-num { padding-left: 24px !important; }
.range-pre { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.lrn-row b small { font-size: 14px; font-weight: 600; color: var(--long); margin-left: 4px; }

/* ---------- v3: guida "?" e percorso guidato ---------- */
.help-fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%; z-index: 40;
  background: var(--surface-2); color: var(--brass); border: 1.5px solid color-mix(in srgb, var(--brass) 55%, transparent);
  font: 800 20px/1 var(--font); font-stretch: 112%; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  animation: fab-float 4.5s ease-in-out infinite;
}
.help-fab::before, .help-fab::after {
  content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid var(--brass);
  opacity: 0; animation: fab-ring 4.5s ease-out infinite; pointer-events: none;
}
.help-fab::after { animation-delay: 2.25s; }
.help-fab span { animation: fab-tilt 9s ease-in-out infinite; display: block; }
.help-fab:hover { background: var(--brass); color: var(--brass-ink); }
@keyframes fab-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fab-ring { 0% { transform: scale(1); opacity: .45; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
@keyframes fab-tilt { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-4deg); } }

.help-q { min-height: 42px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); width: 100%; }
.help-list { display: grid; gap: 6px; }
.help-item { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg); }
.help-item summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; flex: none; margin-top: -4px; }
.help-item[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.help-item[open] { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.help-body { padding: 0 14px 14px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.help-body p { margin: 0 0 8px; }
.help-body p:last-child { margin-bottom: 0; }
.help-body b { color: var(--text); font-weight: 600; }
.gloss { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.gloss dt { color: var(--text); font-weight: 700; }
.gloss dd { margin: 0; }

.tour { position: fixed; inset: 0; z-index: 90; }
.tour-hole {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(5, 12, 20, .74), 0 0 0 2px var(--brass);
  transition: top .35s ease, left .35s ease, width .35s ease, height .35s ease, opacity .2s;
}
.tour-hole.center { opacity: 0; }
.tour.no-hole { background: rgba(5, 12, 20, .74); }
.tour-card {
  position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); display: grid; gap: 8px;
  transition: top .35s ease, left .35s ease;
}
.tour-card h3 { margin: 0; font-size: 19px; font-stretch: 112%; }
.tour-card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.tour-step { font-size: 12.5px !important; color: var(--brass) !important; font-weight: 600; }
.tour-dots { display: flex; gap: 4px; }
.tour-dots i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); }
.tour-dots i.on { background: var(--brass); }
.tour-again { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; cursor: pointer; }
.tour-again input { accent-color: var(--brass); }
.tour-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.tour-nav { display: flex; gap: 8px; }

@media (min-width: 861px) { .bottom-nav { display: none; } }
@media (max-width: 860px) {
  .help-fab { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); right: max(12px, env(safe-area-inset-right)); width: 40px; height: 40px; font-size: 18px; }
  #btn-radar { display: none; }
  .tour-card { left: 16px !important; width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .help-fab, .help-fab span { animation: none; }
  .help-fab::before, .help-fab::after { display: none; }
}

/* ---------- v4: collega il tuo broker ---------- */
.chartcol { display: flex; flex-direction: column; }
.chartcol > .tf-bar, .chartcol > .br-card { flex: none; }
.chartcol > .chart-wrap { flex: 1 1 auto; min-height: 0; }
.chartcol > .lower { flex: 0 0 238px; }
@media (max-width: 860px) {
  body[data-view="chart"] .chartcol { display: flex; }
  .chartcol > .lower { flex-basis: 210px; }
}
.chart-wrap { display: grid; grid-template-columns: 1fr; }
.chart-pane { position: relative; min-width: 0; min-height: 0; }
.broker-pane { display: none; position: relative; min-width: 0; min-height: 0; background: #05090e; flex-direction: column; }
.chart-wrap[data-mode="broker"] .chart-pane { display: none; }
.chart-wrap[data-mode="broker"] .broker-pane { display: flex; }
.chart-wrap[data-mode="split"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.chart-wrap[data-mode="split"] .broker-pane { display: flex; border-left: 1px solid var(--line); }
.broker-pane video { flex: 1; min-height: 0; width: 100%; object-fit: contain; display: block; }
.broker-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px; }
.broker-name { font-weight: 700; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.broker-status { color: var(--muted); flex: 1 1 200px; min-width: 0; }
.broker-status.ok { color: var(--text); }
.broker-status.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--long); margin-right: 6px; vertical-align: 1px; }
.broker-status.warn { color: var(--brass); }
.broker-tools { display: flex; gap: 6px; align-items: center; }
.broker-spread { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.broker-spread input { width: 84px; min-height: 30px; padding: 0 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); }
.br-modes { margin: 0; padding: 2px; }
.br-modes .seg-btn { min-height: 28px; padding: 0 10px; font-size: 13px; }

.br-card { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; margin: 10px 12px 0; padding: 12px 12px 12px 14px; border: 1px solid color-mix(in srgb, var(--brass) 45%, var(--line)); border-radius: var(--radius-m); background: color-mix(in srgb, var(--brass) 8%, var(--surface)); }
.br-card-ico { width: 30px; height: 30px; fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.br-card-txt { display: grid; gap: 2px; font-size: 13.5px; min-width: 0; }
.br-card-txt span { color: var(--muted); }
.br-card-act { display: flex; gap: 6px; }
.br-card-x { width: 30px; height: 30px; }

.broker-pick { position: fixed; inset: 0; z-index: 95; cursor: crosshair; background: rgba(5, 12, 20, .25); touch-action: none; }
.broker-pick-card { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--brass); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.45); cursor: default; }
.broker-pick-card p { margin: 0; font-weight: 600; }
.broker-pick-act { display: flex; gap: 8px; justify-content: flex-end; }
.broker-sel { position: fixed; z-index: 96; border: 2px solid var(--brass); background: rgba(217, 164, 65, .15); pointer-events: none; border-radius: 3px; }
.plan-src { display: inline-flex; align-items: center; gap: 5px; color: var(--long) !important; }
.plan-src::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--long); }

/* ---------- v5: abbonamento, attivazione, invita amici, footer, chat ---------- */
.sub-cta { display: grid; gap: 6px; justify-items: center; margin-bottom: 18px; }
.sub-cta .btn { width: 100%; }
.invite-banner { margin-bottom: 14px; padding: 10px 12px; border-radius: var(--radius-m); background: var(--long-bg); border: 1px solid color-mix(in srgb, var(--long) 45%, transparent); font-size: 14px; }
.activate { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.act-card { width: min(440px, 100%); display: grid; gap: 14px; }
.act-card h1 { margin: 10px 0 0; font-size: 28px; font-stretch: 112%; line-height: 1.1; }
.act-lead { margin: 0; color: var(--muted); }
.act-code { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--brass); border-radius: var(--radius-m); background: color-mix(in srgb, var(--brass) 10%, var(--surface)); }
.act-code span { color: var(--muted); font-size: 13px; }
.act-code b { font-size: 26px; letter-spacing: .12em; flex: 1; }
.code-in { letter-spacing: .14em; font-weight: 700; text-transform: uppercase; }

.ref-link { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.ref-link input { min-height: 38px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); font-size: 13px; min-width: 0; }
.ref-prog { display: grid; gap: 6px; }
.ref-prog-h { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.ref-prog-h b { color: var(--brass); }
.ref-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.ref-dots i { height: 10px; border-radius: 3px; background: var(--line); }
.ref-dots i.on { background: var(--long); }
.ref-gift { display: flex; gap: 8px; align-items: center; }
.ref-gift select { min-height: 40px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); }
.ref-gift .btn { flex: 1; }
.gift-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.gift-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.gift-list li span:first-child { color: var(--muted); }
.rules-text { white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; }

.set-foot { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; font-size: 13px; color: var(--muted); }
.set-foot p { margin: 0; line-height: 1.5; }
.foot-warn { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-m); border: 1px solid color-mix(in srgb, var(--short) 45%, transparent); background: var(--short-bg); }
.foot-warn b { color: var(--text); }
.foot-owner b { color: var(--text); }
.foot-links .link { font-size: 13px; padding: 0; }
.foot-links a { color: var(--brass); }
.foot-copy { font-size: 12px; }

.adm-wide { grid-column: 1 / -1; }
.adm-box textarea { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); font: 13.5px/1.5 var(--font); resize: vertical; }
.u-sub { margin: 6px 0 0; font-size: 15px; }
.u-ref { border-top: 1px solid var(--line); padding-top: 14px; }

.help-tabs { margin-bottom: 0; }
#help-guide { display: grid; gap: 12px; }
.chat { display: grid; gap: 10px; }
.chat-log { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; align-content: start; }
.chat-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-msg p { margin: 0 0 6px; } .chat-msg p:last-child { margin: 0; }
.chat-msg.bot { background: var(--surface-2); border: 1px solid var(--line); border-top-left-radius: 4px; justify-self: start; }
.chat-msg.bot > b:first-child { display: block; margin-bottom: 4px; color: var(--brass); }
.chat-msg.bot.hint { background: none; border: 0; padding: 2px 4px; color: var(--muted); }
.chat-msg.me { background: var(--brass); color: var(--brass-ink); border-top-right-radius: 4px; justify-self: end; font-weight: 600; }
.chat-msg .gloss { grid-template-columns: max-content 1fr; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--text); }
.chip:hover { border-color: var(--brass); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-form input { min-height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--text); }
@media (max-width: 860px) { .ref-link { grid-template-columns: 1fr 1fr; } .ref-link input { grid-column: 1 / -1; } }

/* ---------- v6: Long Connect ---------- */
.lc-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lc-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.lc-chip.ok::before { background: var(--long); }
.lc-chip.warn::before { background: var(--brass); }
.acct-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.acct-kv dt { color: var(--muted); font-size: 13px; }
.acct-kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.acct-kv .acct-none { grid-column: 1 / -1; }
.acct-warn { margin: 10px 0 0; color: var(--short); font-size: 13px; font-weight: 600; }
.acct-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.acct-tbl { width: 100%; font-size: 12.5px; }
.acct-tbl th, .acct-tbl td { padding: 5px 4px; }
.acct-tbl .side { font-weight: 700; font-size: 11.5px; }
#acct-pos { overflow-x: auto; }
#acct-pos .empty { margin: 0; font-size: 13px; }
.lc-status { color: var(--muted); }
.lc-status.ok { color: var(--long); }
.lc-status.warn { color: var(--brass); }
.lc-intro { margin: 0 0 14px; line-height: 1.55; }
.lc-steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 8px; line-height: 1.5; }
.lc-steps li::marker { color: var(--brass); font-weight: 700; }
.lc-row .btn { flex: none; }
@media (max-width: 860px) { .lc-chip { max-width: 150px; } }
.br-ok { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 8px; border-radius: 17px; border: 1px solid color-mix(in srgb, var(--long) 55%, transparent); background: color-mix(in srgb, var(--long) 14%, transparent); color: var(--long); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.br-ok[hidden] { display: none; }
.br-ok svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.br-ok small { color: var(--muted); font-weight: 500; font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.br-ok.warn { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 55%, transparent); background: color-mix(in srgb, var(--brass) 12%, transparent); }
@media (max-width: 1100px) { .br-ok small { display: none; } }
.calc-out .calc-act { grid-column: 1 / -1; display: grid; gap: 3px; padding: 10px 12px; margin-bottom: 4px; border-radius: var(--radius-s, 8px); border-left: 4px solid; color: var(--text); }
.calc-out .calc-act b { font-size: 15px; letter-spacing: .02em; }
.calc-out .calc-act span { font-size: 13px; line-height: 1.45; color: var(--text); font-weight: 500; }
.calc-out .calc-act.long { border-color: var(--long); background: color-mix(in srgb, var(--long) 13%, transparent); }
.calc-out .calc-act.long b { color: var(--long); }
.calc-out .calc-act.short { border-color: var(--short); background: color-mix(in srgb, var(--short) 13%, transparent); }
.calc-out .calc-act.short b { color: var(--short); }
.calc-out .calc-act.hypo { border-color: var(--muted); background: var(--surface-2); }
.calc-out .calc-act.hypo b { color: var(--muted); }
.calc-src { margin: 8px 0 10px; font-size: 12.5px; line-height: 1.4; }
.calc-src.ok { color: var(--long); }
.calc-src.warn { color: var(--brass); }
.calc-src .link { font-size: 12.5px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--long); margin-right: 6px; vertical-align: 1px; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.lrn-rate { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.adm-live { display: grid; gap: 14px; margin: 6px 0 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg); }
.adm-live-n { display: grid; gap: 2px; }
.adm-live-n b { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.adm-live-n span { color: var(--muted); font-size: 13px; }
.mq { display: block; width: 90px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.mq i { display: block; height: 100%; border-radius: 4px; }
.br-card[hidden] { display: none; }
.br-card-m { grid-template-columns: auto 1fr; }
.br-card-m .br-card-act { grid-column: 1 / -1; }
.mt-key { display: grid; gap: 6px; margin: 12px 0 14px; font-size: 13px; color: var(--muted); }
.mt-key-row { display: flex; gap: 8px; }
.mt-key-row input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 13px; letter-spacing: .03em; }
#sheet-bridge .set-block { margin-top: 14px; }
.calc-tf { display: grid; gap: 6px; margin: 0 0 14px; }
.calc-tf-l { font-size: 13.5px; color: var(--muted); }
.calc-tf-row { display: flex; flex-wrap: wrap; gap: 4px; }
.calc-tf-row .tf-btn { position: relative; min-width: 38px; }
.tf-br { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--long); }
.calc-tf-hint { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.calc-tf-hint.ok { color: var(--long); }
.calc-tf-hint.warn { color: var(--brass); }
.logo-img { width: 30px; height: 30px; border-radius: 50%; flex: none; display: block; }
.brand-big .logo-img { width: 44px; height: 44px; }
.mk-seg { width: 100%; margin-bottom: 10px; }
.mk-seg [aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--brass); }
#sheet-newuser, #sheet-confirm { z-index: 60; }
.tv-pane { display: none; position: relative; min-width: 0; min-height: 0; background: var(--bg); }
.chart-wrap[data-src="tv"] .tv-pane { display: block; }
.chart-wrap[data-src="tv"] .chart-pane { display: none; }
.tv-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); z-index: 2; background: var(--bg); }
.tv-msg p { margin: 0; max-width: 34em; }
#src-modes { margin-left: 8px; }
.tv-box { position: absolute; inset: 0; }
@media (max-width: 860px) {
  .chartcol { overflow-y: auto; }
  .chartcol > .chart-wrap { min-height: 320px; }
  .br-card-m { padding: 10px 12px; gap: 8px 10px; }
  .br-card-m .br-card-txt { font-size: 12.5px; }
  .br-card-m .br-card-ico { width: 24px; height: 24px; }
}
.tf-tools[hidden] { display: none; }
/* telefono: una sola vista alla volta (la regola generale di .chartcol sopra la rendeva sempre visibile) */
@media (max-width: 860px) {
  .chartcol { display: none; }
  body[data-view="chart"] .chartcol { display: flex; }
}
@media (max-width: 860px) {
  /* spazio in fondo: l'ultimo contenuto non resta sotto il pulsante «?» */
  .signal, .markets, .chartcol { padding-bottom: 84px; }
  #help-fab { width: 48px; height: 48px; }
}
/* Tecnico: nuovo account gratuito */
#sheet-newuser .sheet-card { width: min(640px, 100%); }
.nu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; align-items: end; }
.nu-grid > label { display: grid; gap: 6px; min-width: 0; }
.nu-grid input, .nu-grid select { width: 100%; min-width: 0; }
.nu-grid .mt-key-row input { flex: 1; }
.nu-grid .check { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.nu-grid .span2, .nu-grid .form-msg { grid-column: 1 / -1; }
#nu-text { min-height: 170px; resize: vertical; }
@media (max-width: 600px) {
  .nu-grid { grid-template-columns: 1fr; }
}
.nu-grid input[type="checkbox"] { width: auto; flex: none; }
.calc-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* ---------- Metodi (solo Tecnico) */
.adm-methods { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--brass); border-radius: var(--radius-m); padding: 12px 16px; margin: 0 0 16px; }
.adm-methods div { display: grid; gap: 2px; } .adm-methods span { font-size: 13px; color: var(--muted); }
.mt-block #mt-mini { display: grid; gap: 6px; }
.mt-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.mt-lab { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--muted); justify-self: start; }
.mt-lab.wait { color: var(--brass); border-color: var(--brass); }
.mt-lab.ready, .mt-lab.on { color: var(--long); border-color: var(--long); }
.mt-lab.off { color: var(--short); border-color: var(--short); }
.mt-top { margin: 0 0 10px; } .mt-top label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.mt-top select, .mt-htf select, .mt-field input, .mt-field select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 10px; font: inherit; min-width: 0; max-width: 100%; }
.mt-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; }
.mt-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 9px 12px; font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; }
.mt-tabs button.is-on { color: var(--text); border-bottom-color: var(--brass); }
.mt-body { display: grid; gap: 14px; min-width: 0; }
.mt-ctx { display: grid; gap: 10px; }
.mt-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.mt-facts b { color: var(--text); }
.mt-htf { display: flex; gap: 8px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.mt-text { margin: 0; line-height: 1.55; max-width: 80ch; }
.mt-brs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; }
.mt-br { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.mt-br header { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt-br h3 { margin: 0; font-size: 15px; } .mt-br h4 { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.mt-why { margin: 0; padding-left: 18px; font-size: 13.5px; }
.mt-plan { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.mt-plan dt { color: var(--muted); } .mt-plan dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.mt-plan small, .mt-ck small { color: var(--muted); }
.mt-ck { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13.5px; }
.mt-ck li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: baseline; }
.mt-ck li > span { font-weight: 800; }
.mt-ck .ok > span { color: var(--long); } .mt-ck .no > span { color: var(--muted); } .mt-ck .contra > span, .mt-ck .contra { color: var(--short); } .mt-ck .na { color: var(--muted); }
.mt-tag { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-left: 4px; white-space: nowrap; }
.mt-tag.src { background: color-mix(in srgb, var(--long) 16%, transparent); color: var(--long); }
.mt-tag.prop { background: color-mix(in srgb, #6FA8DC 18%, transparent); color: #6FA8DC; }
.mt-tag.ver { background: color-mix(in srgb, var(--brass) 18%, transparent); color: var(--brass); }
.mt-mod { color: var(--brass); }
.mt-manual { display: grid; gap: 6px; font-size: 13.5px; }
.mt-seg { margin: 0; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.mt-seg button { background: none; border: 0; border-radius: 6px; padding: 7px 6px; color: var(--muted); font: 600 12.5px var(--font); cursor: pointer; }
.mt-seg button.is-on { background: var(--surface-2); color: var(--text); }
.mt-warn { margin: 0; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--brass); font-size: 13.5px; }
.mt-foot { margin: 0; }
.mt-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px 16px; }
.mt-field { display: grid; gap: 5px; font-size: 13.5px; align-content: start; }
.mt-field > small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.mt-field.mt-bool { grid-template-columns: 1fr auto; } .mt-field.mt-bool > small { grid-column: 1 / -1; }
.mt-doc { max-width: 82ch; line-height: 1.6; font-size: 14.5px; }
.mt-doc h2 { font-size: 20px; } .mt-doc h3 { font-size: 16.5px; margin-top: 26px; } .mt-doc h4 { font-size: 14.5px; }
.mt-doc blockquote { margin: 0; padding: 4px 14px; border-left: 3px solid var(--brass); color: var(--muted); }
.mt-doc pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; overflow-x: auto; font-size: 12.5px; }
.mt-doc .tbl td { white-space: normal; min-width: 120px; }
.mt-fid { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; }
@media (max-width: 560px) { .mt-plan { grid-template-columns: 1fr; gap: 2px; } .mt-plan dd { margin-bottom: 6px; } }

/* ---------- pannello Confluenza/Backtest richiudibile (PC) */
.tabs { align-items: stretch; }
.lower-toggle { margin-left: auto; align-self: center; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: var(--radius-s); color: var(--muted); cursor: pointer; }
.lower-toggle:hover { color: var(--text); border-color: var(--line); }
.lower-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.lower-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
@media (min-width: 861px) {
  .chartcol > .lower.is-closed { flex: 0 0 auto; }
  .lower.is-closed .tab-body { display: none; }
  .lower.is-closed .lower-toggle svg { transform: rotate(180deg); }
  .lower.is-closed .tabs { border-bottom: 0; }
}
@media (max-width: 860px) { .lower-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { .lower-toggle svg { transition: none; } }

/* ---------- Metodi: Adesso, Impara, Assistente */
.mt-now-mini { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); }
.mt-now-mini b { font-size: 15px; } .mt-now-mini span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-now-mini.long, .mt-now.long { border-color: var(--long); } .mt-now-mini.long b, .mt-now.long h3 { color: var(--long); }
.mt-now-mini.short, .mt-now.short { border-color: var(--short); } .mt-now-mini.short b, .mt-now.short h3 { color: var(--short); }
.mt-now-mini.wait, .mt-now.wait { border-color: var(--brass); }
.mt-now { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; display: grid; gap: 10px; max-width: 760px; }
.mt-now-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mt-learned { color: var(--long); } .mt-learned.off { color: var(--muted); }
.mt-now h3 { margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.01em; }
.mt-now > p { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.mt-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.45; }
.mt-plan-now { max-width: 520px; }
.mt-learn { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; display: grid; gap: 14px; }
.mt-learn.on { border-color: var(--long); }
.mt-learn-h { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.mt-learn-h h3 { margin: 0 0 2px; font-size: 18px; } .mt-learn-h p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 60ch; }
.mt-learn.on .mt-learn-h h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--long); margin-right: 8px; vertical-align: middle; animation: livepulse 1.6s infinite; }
.mt-learn-n { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mt-learn-n div { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; display: grid; gap: 2px; }
.mt-learn-n b { font-size: 22px; } .mt-learn-n span { font-size: 12.5px; color: var(--muted); }
.mt-learn-tf { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13.5px; }
.mt-learn-tf .chip { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.mt-learn-tf small { flex-basis: 100%; color: var(--muted); }
.mt-hist { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; }
.mt-hist small { color: var(--muted); }
.mt-chat { display: grid; gap: 10px; max-width: 820px; }
.mt-chat-log { display: grid; gap: 8px; max-height: min(52vh, 520px); overflow-y: auto; padding: 4px 2px; align-content: start; }
.mt-msg { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; line-height: 1.5; max-width: 88%; }
.mt-msg.me { justify-self: end; background: color-mix(in srgb, var(--brass) 22%, transparent); }
.mt-msg ul { margin: 6px 0 0; padding-left: 18px; }
.mt-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mt-chips .chip { cursor: pointer; }
.mt-chat-in { display: flex; gap: 8px; }
.mt-chat-in input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 12px; font: inherit; }

/* ---------- Bussola rimpicciolibile (PC) */
.signal { position: relative; }
.sig-rail { display: none; }
@media (min-width: 861px) {
  .sig-rail { display: flex; justify-content: flex-end; margin: -6px -8px -14px 0; }
  .sig-toggle { width: 30px; height: 30px; display: grid; place-items: center; background: none; border: 1px solid transparent; border-radius: var(--radius-s); color: var(--muted); cursor: pointer; }
  .sig-toggle:hover { color: var(--text); border-color: var(--line); }
  .sig-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
  .sig-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .rail-dir, .rail-score { display: none; }
  body.sig-mini .app { grid-template-columns: 268px minmax(0, 1fr) 64px; }
  body.sig-mini .signal { padding: 10px 6px; overflow: hidden; }
  body.sig-mini .signal > :not(.sig-rail) { display: none; }
  body.sig-mini .sig-rail { flex-direction: column; justify-content: flex-start; align-items: center; gap: 14px; margin: 0; height: 100%; cursor: pointer; }
  body.sig-mini .sig-toggle svg { transform: rotate(180deg); }
  body.sig-mini .rail-dir { display: block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 22px; font-weight: 800; letter-spacing: .04em; }
  body.sig-mini .rail-dir.long { color: var(--long); } body.sig-mini .rail-dir.short { color: var(--short); }
  body.sig-mini .rail-score { display: block; font-size: 13px; color: var(--muted); }
}
@media (min-width: 861px) and (max-width: 1180px) { body.sig-mini .app { grid-template-columns: 230px minmax(0, 1fr) 64px; } }

/* ---------- operazioni aperte sul broker, sotto il grafico */
.pos-strip { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: 8px 16px 10px; display: grid; gap: 6px; }
.pos-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pos-h > b { font-size: 13.5px; }
.pos-live { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.pos-tot { margin-left: auto; color: var(--muted); }
.pos-tot b { font-size: 15px; margin-left: 4px; }
.pos-fold { font-size: 12.5px; }
.pos-tot:empty + .pos-fold { margin-left: auto; }
.pos-strip.is-folded .pos-list { display: none; }
.pos-list { display: grid; gap: 4px; max-height: 132px; overflow-y: auto; }
.pos-row { display: grid; grid-template-columns: auto minmax(90px, 0.8fr) minmax(170px, 1.2fr) minmax(180px, 2fr) 120px minmax(90px, auto); gap: 12px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); font-size: 13px; }
.pos-row.is-cur { border-color: color-mix(in srgb, var(--brass) 60%, var(--line)); }
.pos-sym { display: flex; gap: 6px; align-items: baseline; min-width: 0; } .pos-sym b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-sym small, .pos-px small, .pos-nosl { color: var(--muted); font-size: 11.5px; }
.pos-px { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-pl { font-size: 16px; text-align: right; white-space: nowrap; }
.pos-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.pos-track { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--short) 30%, transparent), var(--surface-2) 50%, color-mix(in srgb, var(--long) 30%, transparent)); }
.pos-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.pos-fill.up { background: var(--long); } .pos-fill.down { background: var(--short); }
.pos-entry { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--brass); }
.pos-now { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--text); border: 2px solid var(--bg); transition: left .4s; }
.pos-spark { width: 120px; height: 30px; }
.pos-spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.pos-spark polyline.up { stroke: var(--long); } .pos-spark polyline.down { stroke: var(--short); }
.pos-spark .z { stroke: var(--line); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
@media (max-width: 1180px) { .pos-row { grid-template-columns: auto minmax(80px, 1fr) minmax(160px, 1.5fr) minmax(90px, auto); } .pos-row .pos-bar { grid-column: 2 / -1; grid-row: 2; } .pos-spark { display: none; } }
@media (max-width: 860px) {
  .pos-strip { padding: 8px 12px; }
  .pos-row { grid-template-columns: auto 1fr auto; gap: 4px 10px; }
  .pos-row .pos-px { grid-column: 1 / -1; grid-row: 2; }
  .pos-row .pos-bar, .pos-row .pos-nosl { grid-column: 1 / -1; grid-row: 3; }
  .pos-list { max-height: 180px; }
}
@media (prefers-reduced-motion: reduce) { .pos-now { transition: none; } }
