/* GOLD DESK — design system
   Regola della casa: verde e rosso solo per soldi e direzione del prezzo.
   Oro = marchio e azioni private · Ciano = azioni verso il pubblico (iscritti). */

@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  /* superfici */
  --bg: #06080c;
  --surface: #0c1016;
  --surface-2: #111722;
  --surface-3: #18202d;
  --line: #1c2431;
  --line-2: #283244;
  /* testo (contrasti su --surface: 15.8 / 7.6 / 4.9) */
  --text: #e8ecf2;
  --text-2: #a3aec0;
  --text-3: #7d899c;
  /* marchio e ruoli */
  --gold: #e9b949;
  --gold-2: #f5d27a;
  --gold-soft: rgba(233, 185, 73, .12);
  --gold-line: rgba(233, 185, 73, .35);
  --public: #45c8e8;
  --public-soft: rgba(69, 200, 232, .12);
  --up: #2ebd85;
  --up-soft: rgba(46, 189, 133, .14);
  --down: #f6465d;
  --down-soft: rgba(246, 70, 93, .14);
  --warn: #f0a03c;
  /* tipografia */
  --font: "Inter", system-ui, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs: 13px;
  --fs-md: 15px;
  --fs-lg: 18px;
  /* spazi (densità alta) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --r: 10px;
  --r-sm: 6px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --top-h: 52px;
  --tab-h: 0px;
  --rail-w: 380px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--r-sm); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── barra in alto ───────── */
.top {
  height: var(--top-h);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s4);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0f15, var(--bg));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .14em; font-size: 13px; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.brand b { color: var(--gold); font-weight: 700; }
.views-nav { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.views-nav button {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 6px 12px; border-radius: 6px;
  color: var(--text-2); font-weight: 500; font-size: var(--fs-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.views-nav button:hover { color: var(--text); background: var(--surface-2); }
.views-nav button[aria-current="page"] { color: var(--bg); background: var(--gold); }
.ticker { display: flex; align-items: baseline; gap: 10px; margin-left: auto; white-space: nowrap; }
.ticker .sym { color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; }
.ticker .px { font-size: 20px; font-weight: 600; }
.ticker .chg { font-size: var(--fs-sm); }
.pills { display: flex; gap: 6px; }
.pill {
  display: flex; align-items: center; gap: 6px; padding: 4px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.dot.ko { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.dot.wait { background: var(--warn); }
.badge-fake {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--bg); background: var(--warn);
  padding: 3px 7px; border-radius: 4px; white-space: nowrap;
}
.clock { font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }

/* ───────── impianto ───────── */
.layout {
  height: calc(100% - var(--top-h) - var(--tab-h));
  display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: var(--s3);
  padding: var(--s3);
}
.views { min-width: 0; min-height: 0; position: relative; }
.view { display: none; height: 100%; min-height: 0; }
.view.on { display: grid; animation: in .22s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.rail { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--s3); min-height: 0; position: relative; }
.rail-grip { position: absolute; left: -11px; top: 50%; transform: translateY(-50%); width: 10px; height: 64px; display: grid; place-items: center; cursor: col-resize; color: var(--text-3); border-radius: 4px; z-index: 5; touch-action: none; }
.rail-grip:hover { color: var(--gold); background: var(--surface-2); }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: var(--fs-xs); gap: 6px; text-decoration: none; color: var(--text-2); }
.btn-sm:hover { color: var(--gold-2); }
.top-h { display: flex; align-items: center; gap: 6px; padding: 8px var(--s3) 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.top-h .ico { color: var(--gold); }
.top-h .linkbtn { margin-left: auto; }
.news-top { display: grid; gap: 8px; padding: 4px var(--s3) 8px; }
.news-top.ridotto { display: none; }
#top-x[aria-expanded="false"] svg { transform: rotate(180deg); }
.hot { position: relative; padding: 10px 34px 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); }
.hot.bull { border-color: rgba(46, 189, 133, .55); background: linear-gradient(90deg, var(--up-soft), var(--surface-2) 60%); }
.hot.bear { border-color: rgba(246, 70, 93, .55); background: linear-gradient(90deg, var(--down-soft), var(--surface-2) 60%); }
.hot .n-title { font-size: var(--fs); font-weight: 500; }
.hot.chiusa .n-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot.chiusa .hot-link { display: none; }
.hot.chiusa .hot-x svg { transform: rotate(180deg); }
.hot-x { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--text-3); padding: 4px; border-radius: 4px; }
.hot-x:hover { color: var(--gold-2); background: var(--surface-3); }
.hot-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: var(--fs-xs); color: var(--text-2); text-decoration: none; }
.hot-link:hover { color: var(--gold-2); }
.en { font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: var(--surface-3); color: var(--text-2); }
.news-list li { cursor: pointer; }
.news-list li:hover { background: var(--surface-2); }
.news-list li.forte .n-title { font-weight: 600; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
}
.card-h {
  display: flex; align-items: center; gap: var(--s2);
  padding: 10px var(--s3); border-bottom: 1px solid var(--line);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
}
.card-h .ico { color: var(--gold); }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; font-weight: 500; }
.card-b { padding: var(--s3); min-height: 0; }
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ───────── cruscotto ───────── */
#v-cruscotto { grid-template-columns: minmax(270px, 0.85fr) minmax(0, 2fr); grid-template-rows: minmax(0, 1fr) auto; gap: var(--s3); }
.globe-card { grid-row: 1 / span 2; }
.globe-wrap { position: relative; flex: 1; min-height: 220px; display: grid; place-items: center; }
.globe-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-legend { position: absolute; left: var(--s3); top: var(--s2); font-size: var(--fs-xs); color: var(--text-3); }
.sessions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.sess { padding: 10px var(--s3); border-right: 1px solid var(--line); }
.sess:last-child { border-right: 0; }
.sess .city { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); }
.sess .city .loc { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); font-weight: 500; }
.sess .fascia { font-size: var(--fs-md); font-weight: 600; margin: 3px 0 2px; white-space: nowrap; }
.sess.open .fascia { color: var(--up); }
.sess .st { font-size: var(--fs-xs); color: var(--text-3); }
.sess .st b { color: var(--gold-2); font-weight: 600; }
.sess.open .st b { color: var(--up); }
.overlap { padding: 8px var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.overlap .ico { color: var(--gold); }

.price-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.hero { display: flex; align-items: flex-end; gap: var(--s5); padding: var(--s3) var(--s4) var(--s2); flex-wrap: wrap; }
.hero .lbl { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; }
.hero .big { font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.03em; }
.hero .big .dec { color: var(--text-2); }
.hero .delta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); padding-bottom: 4px; }
.hero .meta { margin-left: auto; display: flex; gap: var(--s2); padding-bottom: 4px; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.seg button { white-space: nowrap; border: 0; background: none; padding: 4px 10px; border-radius: 5px; font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--gold-2); }
.chart { min-height: 0; position: relative; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 10px var(--s3); border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .k { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: var(--fs-md); font-weight: 500; white-space: nowrap; }

.event-card .card-b { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s4); align-items: center; }
.ev-main .ev-lbl { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.ev-main .ev-title { font-size: var(--fs-md); font-weight: 600; margin: 2px 0 6px; }
.ev-main .ev-cd { font-size: 30px; font-weight: 600; color: var(--gold-2); letter-spacing: -.02em; line-height: 1.1; }
.ev-main .ev-row { display: flex; gap: var(--s4); margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); }
.impact { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 4px; }
.impact i { width: 4px; height: 10px; border-radius: 1px; background: var(--line-2); }
.impact.i3 i, .impact.i2 i:nth-child(-n+2), .impact.i1 i:first-child { background: var(--gold); }
.ev-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); padding-left: var(--s4); }
.ev-list li { display: grid; grid-template-columns: 72px 1fr auto; gap: var(--s2); padding: 5px 0; font-size: var(--fs-sm); align-items: center; }
.ev-list .h { color: var(--text-3); }

/* ───────── news ───────── */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  padding: 10px var(--s3) 10px calc(var(--s3) + 3px); border-bottom: 1px solid var(--line); position: relative;
}
.news-list li::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: var(--line-2); }
.news-list li.bull::before { background: var(--up); }
.news-list li.bear::before { background: var(--down); }
.news-list li.new { animation: flashIn .8s var(--ease); }
@keyframes flashIn { from { background: var(--gold-soft); } }
.n-top { display: flex; gap: var(--s2); font-size: var(--fs-xs); color: var(--text-3); align-items: center; }
.n-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.bull .n-tag { color: var(--up); background: var(--up-soft); }
.bear .n-tag { color: var(--down); background: var(--down-soft); }
.neu .n-tag { color: var(--text-2); background: var(--surface-3); }
.n-title { margin-top: 3px; font-size: var(--fs-sm); line-height: 1.4; color: var(--text); }

/* ───────── centro comandi (ex TWtoTGnotify) ───────── */
.cmd .card-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.cmd-row { display: flex; align-items: center; gap: var(--s2); }
.switch {
  position: relative; width: 40px; height: 22px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface-3); flex: none; transition: background .2s var(--ease);
}
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.switch[aria-checked="true"] { background: var(--gold-soft); border-color: var(--gold-line); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--gold); }
.cmd-ap { flex: 1; min-width: 0; }
.cmd-ap b { display: block; font-size: var(--fs-sm); }
.cmd-ap span { font-size: var(--fs-xs); color: var(--text-3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 var(--s3); border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface-2); font-weight: 600; font-size: var(--fs-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s;
}
.btn:hover { border-color: var(--text-3); background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.btn.primary:hover { background: var(--gold-2); }
.btn.public { color: var(--public); border-color: rgba(69, 200, 232, .4); background: var(--public-soft); }
.btn.cancel { color: var(--down); border-color: rgba(246, 70, 93, .5); background: transparent; }
.btn.full { width: 100%; }
.btn .sub { font-weight: 500; color: inherit; opacity: .7; font-size: var(--fs-xs); }
.cmd-lbl { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.app {
  position: relative; display: grid; place-items: center; gap: 3px; padding: 8px 4px 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 10px; color: var(--text-2);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app img.glyph { object-fit: contain; background: none; }
.app .glyph { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; }
.app.off .glyph { filter: grayscale(1); opacity: .35; }
.app .st { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; }
.app .st svg { width: 9px; height: 9px; stroke-width: 3.5; }
.app.onn .st { background: var(--up); color: #062014; }
.app.off .st { background: var(--down); color: #2a0509; }
.log {
  display: flex; align-items: center; gap: var(--s2); padding: 8px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line); font-size: var(--fs-sm); min-width: 0;
}
.log .tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; flex: none; }
.tag.ok { background: var(--up-soft); color: var(--up); }
.tag.run { background: var(--gold-soft); color: var(--gold-2); }
.tag.err { background: var(--down-soft); color: var(--down); }
.tag.info { background: var(--surface-3); color: var(--text-2); }
.log .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .h { color: var(--text-3); font-size: var(--fs-xs); }
.linkbtn { border: 0; background: none; color: var(--text-2); font-size: var(--fs-xs); padding: 4px; display: inline-flex; gap: 4px; align-items: center; }
.linkbtn:hover { color: var(--gold-2); }
.history { list-style: none; margin: 0; padding: 0; max-height: 140px; display: none; }
.history.on { display: block; }
.history li { display: flex; gap: var(--s2); padding: 4px 0; font-size: var(--fs-xs); border-bottom: 1px dashed var(--line); }

/* ───────── order book / volumetrica ───────── */
#v-book { grid-template-columns: 250px minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr) 210px; gap: var(--s3); }
body[data-view="book"] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-view="book"] .rail { display: none; }
.prof-col { grid-row: 1 / span 2; grid-column: 3; display: grid; grid-template-rows: minmax(0, 1.25fr) 130px minmax(0, 1fr); gap: var(--s3); min-height: 0; }
.vp-wrap { flex: 1; position: relative; min-height: 0; }
.vp-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#cvd24-v { font-weight: 600; letter-spacing: 0; }
.lettura { font-size: var(--fs-sm); }
.lettura p { margin: 4px 0 6px; line-height: 1.45; color: var(--text-2); }
.lettura p b { color: var(--text); }
.gold { color: var(--gold-2); }
.let-tit { margin: 10px 0 2px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.let-tit:first-child { margin-top: 0; }
.lettura .avviso { padding: 8px 10px; border-radius: 8px; background: rgba(240,160,60,.12); border: 1px solid rgba(240,160,60,.4); color: var(--warn); }
.lettura .avviso b { color: var(--warn); }
#vp-avviso { font-weight: 700; }
.est { color: var(--warn); font-weight: 600; }
.lv { font-family: var(--mono); font-size: var(--fs-xs); padding: 2px 0 6px; }
.dom-card { grid-row: 1; }
.tas-card { grid-row: 2; grid-column: 1; }
.fp-card { grid-row: 1 / span 2; grid-column: 2; }

.dom { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dom-row { display: grid; grid-template-columns: 1fr 78px 1fr; height: 19px; align-items: center; position: relative; }
.dom-row span { position: relative; z-index: 1; padding: 0 6px; }
.dom-row .px { text-align: center; color: var(--text-2); }
.dom-row .bid { text-align: right; }
.dom-row .ask { text-align: left; }
.dom-row .bar { position: absolute; top: 2px; bottom: 2px; z-index: 0; border-radius: 2px; }
.dom-row .bar.b { right: calc(50% + 39px); background: var(--up-soft); }
.dom-row .bar.a { left: calc(50% + 39px); background: var(--down-soft); }
.dom-row.ask-row .ask { color: var(--down); }
.dom-row.bid-row .bid { color: var(--up); }
.dom-row.big .bid, .dom-row.big .ask { font-weight: 700; }
.dom-row.big .bar.b { background: rgba(46, 189, 133, .32); }
.dom-row.big .bar.a { background: rgba(246, 70, 93, .32); }
.dom-mid { display: flex; justify-content: center; gap: var(--s3); padding: 5px 0; margin: 2px 0; border-block: 1px solid var(--line); font-family: var(--mono); font-size: var(--fs-sm); }
.dom-mid b { color: var(--gold-2); }
.tas { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.tas-row { display: grid; grid-template-columns: 62px 1fr 1fr 22px; gap: 4px; padding: 2px var(--s3); }
.tas-row.b { color: var(--up); }
.tas-row.s { color: var(--down); }
.tas-row.big { background: var(--gold-soft); font-weight: 700; }
.tas-row .t { color: var(--text-3); }
.fp-tools { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); border-bottom: 1px solid var(--line); font-size: var(--fs-xs); flex-wrap: wrap; }
.fp-tools .faint:not(:first-child) { margin-left: var(--s2); }
.fp-zoom { margin-left: auto; display: inline-flex; gap: 4px; }
.tog[aria-pressed="true"] { color: var(--gold-2); border-color: var(--gold-line); background: var(--gold-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.fp-hint { font-size: 10.5px; padding: 3px var(--s3); border-bottom: 1px solid var(--line); }
.fp-wrap canvas { cursor: grab; touch-action: none; }
.fp-wrap { flex: 1; position: relative; min-height: 0; }
.fp-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.src-note { font-size: var(--fs-xs); color: var(--text-3); padding: 6px var(--s3); border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; }
.src-note .est { color: var(--warn); font-weight: 600; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.kv .k { color: var(--text-3); }
.kv .v { font-family: var(--mono); font-weight: 500; }
.pressure { height: 8px; border-radius: 4px; background: var(--down-soft); overflow: hidden; margin: 6px 0 2px; }
.pressure i { display: block; height: 100%; background: var(--up); border-radius: 4px 0 0 4px; transition: width .4s var(--ease); }
.cvd { width: 100%; height: 90px; display: block; margin-top: var(--s2); }

/* ───────── operatività ───────── */
#v-opera { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.tr-card { min-height: 0; }
.tr-wrap { flex: 1; position: relative; min-height: 0; background: #05070c; }
.tr-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tr-attesa { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-sm); }
.tr-nota { margin-right: 4px; }
body[data-view="opera"] .layout { grid-template-columns: minmax(0, 1fr) var(--rail-w); }

/* ───────── toast ───────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px); transform: translate(-50%, 20px); opacity: 0;
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 16px;
  font-size: var(--fs-sm); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 50;
  display: flex; gap: 8px; align-items: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* barra in basso del telefono (nascosta su desktop) */
.tabbar { display: none; }

/* ───────── larghezze medie ───────── */
@media (max-width: 1500px) {
  :root { --rail-w: 330px; }
  body[data-view="book"] .rail .news { display: none; }
  body[data-view="book"] .rail { grid-template-rows: 1fr; align-content: end; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-right: 0; }
  .stat:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 1180px) {
  .pills .pill span.lbl { display: none; }
  #v-book { grid-template-columns: 230px minmax(0, 1fr); }
  .prof-col { display: none; }
}

/* ───────── telefono ───────── */
@media (max-width: 860px) {
  :root { --top-h: 50px; --tab-h: calc(62px + env(safe-area-inset-bottom)); --fs: 14px; --fs-sm: 13px; }
  body { overflow: hidden; }
  .top { padding: 0 var(--s4); padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
  .views-nav, .pills, .clock { display: none; }
  .ticker .px { font-size: 18px; }
  .ticker .sym { display: none; }
  .badge-fake { font-size: 9px; padding: 2px 5px; }
  .top { gap: var(--s3); }
  .card-h { flex-wrap: wrap; }
  .dom-card { order: 1; } .fp-card { order: 2; } .prof-col { order: 3; } .tas-card { order: 4; }
  .layout { display: block; padding: var(--s3); height: calc(100% - var(--top-h) - env(safe-area-inset-top) - var(--tab-h)); overflow: auto; }
  .views, .view.on { height: auto; }
  .rail { display: none; }
  .rail-grip { display: none; }
  body[data-view="news"] .views, body[data-view="comandi"] .views { display: none; }
  body[data-view="news"] .rail, body[data-view="comandi"] .rail { display: grid; grid-template-rows: auto; height: auto; }
  body[data-view="news"] .rail .cmd, body[data-view="comandi"] .rail .news { display: none; }
  #v-cruscotto, #v-book { grid-template-columns: 1fr; grid-template-rows: none; }
  #v-opera { height: calc(100dvh - 140px); }
  .tr-nota { display: none; }
  .globe-card { grid-row: auto; }
  .globe-wrap { height: 230px; flex: none; }
  .price-card { grid-template-rows: auto 280px auto; }
  .hero .big { font-size: 38px; }
  .hero .meta { margin-left: 0; }
  .event-card .card-b { grid-template-columns: 1fr; }
  .ev-list { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--s2); }
  .dom-card, .tas-card, .fp-card, .prof-col { grid-row: auto; grid-column: auto; }
  .prof-col { display: grid; grid-template-rows: 360px 140px auto; }
  .fp-card { height: 420px; }
  .tas-card { height: 260px; }
  .btn { min-height: 44px; }
  .switch { width: 48px; height: 28px; }
  .switch::after { width: 22px; height: 22px; }
  .switch[aria-checked="true"]::after { transform: translateX(20px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(12, 16, 22, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); z-index: 20;
  }
  .tabbar button { border: 0; background: none; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 10.5px; color: var(--text-3); min-height: 44px; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar button[aria-current="page"] { color: var(--gold); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* centro comandi F3 */
.badge-prova { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--bg); background: var(--public); padding: 2px 6px; border-radius: 4px; }
.cmd-vecchio { display: grid; gap: 8px; padding: 10px; border-radius: 8px; background: rgba(240, 160, 60, .12); border: 1px solid rgba(240, 160, 60, .4); color: var(--warn); font-size: var(--fs-sm); }
.cmd-vecchio b { color: var(--warn); }
.switch:disabled { opacity: .4; cursor: not-allowed; }

/* ───────── telefono fuori casa (F5): PIN e avviso PC spento ───────── */
body.accesso-aperto { overflow: hidden; }
.accesso {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px);
  background: radial-gradient(700px 420px at 50% -10%, rgba(233, 185, 73, .16), transparent 60%), var(--bg);
}
.accesso[hidden] { display: none; }
.accesso-in { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.accesso-in img { border-radius: 16px; box-shadow: 0 8px 30px rgba(233, 185, 73, .25); margin-bottom: 12px; }
.accesso-in h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: .04em; }
.accesso-in h2 b { color: var(--gold); font-weight: 700; }
.accesso-sotto { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-md); }
.puntini { display: flex; gap: 16px; margin: 28px 0 8px; }
.puntini i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); transition: background .15s, box-shadow .15s; }
.puntini i.pieno { background: var(--gold); box-shadow: none; }
.accesso.attesa .puntini i.pieno { animation: pulsa-pin 1s infinite; }
@keyframes pulsa-pin { 50% { opacity: .35; } }
.accesso-err { min-height: 22px; margin: 0 0 16px; color: var(--down); font-size: 14px; }
.tastierino { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px 24px; }
.tastierino button {
  width: 76px; height: 76px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  font: 600 28px var(--font); display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .12s, transform .12s; -webkit-tap-highlight-color: transparent;
}
.tastierino button:active { background: var(--surface-3); transform: scale(.94); }
.tastierino button[data-cifra="canc"] { background: none; border: 0; color: var(--text-2); }
.tastierino button[data-cifra="canc"] .ico { width: 26px; height: 26px; }
.accesso.bloccato .tastierino, .accesso.attesa .tastierino { opacity: .4; pointer-events: none; }
@media (max-height: 640px) { .tastierino { grid-template-columns: repeat(3, 64px); } .tastierino button { width: 64px; height: 64px; font-size: 24px; } .puntini { margin-top: 16px; } }
.avviso-pc {
  position: fixed; left: 50%; top: calc(var(--top-h) + env(safe-area-inset-top) + 8px); transform: translateX(-50%); z-index: 60;
  display: flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px;
  background: var(--down-soft); border: 1px solid var(--down); color: var(--text); font-size: var(--fs-sm); white-space: nowrap;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.avviso-pc[hidden] { display: none; }
body.remoto #tv-btn { display: none; }
body.pc-spento .ticker, body.pc-spento #px-big, body.pc-spento #px-delta, body.pc-spento .dom { opacity: .35; filter: grayscale(1); transition: opacity .3s; }
/* PC spento: i comandi non possono partire, si vede subito */
body.pc-spento .card.cmd .card-b { opacity: .4; pointer-events: none; filter: grayscale(1); }
body.pc-spento .card.cmd #esci-btn, body.pc-spento .card.cmd #hist-btn { pointer-events: auto; }
