/* Steve AI Trader (/ai-trader.html, Steve 10/11/2026): tema scuro della dashboard, accento viola per l'AI. */
:root {
  --ground: #0a0e18; --surface: #111726; --surface-raised: #161d2f; --line: #1e2637; --line-soft: #171e2d;
  --ink: #e9edf5; --ink-dim: #8d97ac; --ink-muted: #5c6680; --accent: #2dd4c8; --ai: #a78bfa; --ai-lo: rgba(167, 139, 250, .12);
  --bull: #3ecf8e; --bear: #f2716f; --amber: #f0b850;
  --font-text: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.55 var(--font-text); }
body { background: radial-gradient(900px 420px at 85% -140px, rgba(167, 139, 250, .12), transparent 70%), var(--ground); min-height: 100vh; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.at-w { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.at-top { border-bottom: 1px solid var(--line); }
.at-top__in { display: flex; align-items: center; gap: 12px; height: 58px; }
.at-brand { display: flex; align-items: center; gap: 9px; color: var(--ink-dim); text-decoration: none; font-weight: 600; min-width: 0; }
.at-brand svg { width: 26px; height: 26px; flex: none; }
.at-brand b { color: var(--ink); white-space: nowrap; }
.at-sep { color: var(--ink-muted); }
.at-tag { display: inline-flex; align-items: center; gap: 4px; }
.at-tag__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bull); box-shadow: 0 0 0 3px rgba(62, 207, 142, .18); }
.at-top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.at-tag { font-size: 11.5px; color: var(--ai); border: 1px dashed rgba(167, 139, 250, .5); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

.at-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center; padding: 34px 0 24px; }
.at-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--ink-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.at-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); }
.at-live.is-on { background: var(--bull); box-shadow: 0 0 0 4px rgba(62, 207, 142, .15); }
.at-hero h1 { margin: 0 0 10px; font-size: 38px; line-height: 1.1; letter-spacing: -.02em; }
.at-lead { margin: 0; color: var(--ink-dim); max-width: 560px; }
.at-lead b { color: var(--ink); font-weight: 600; }
.at-kcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.at-start { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(167, 139, 250, .12), rgba(45, 212, 200, .07)); border: 1px solid rgba(167, 139, 250, .3); }
.at-start span { display: block; color: var(--ink-dim); font-size: 11.5px; }
.at-start b { font: 700 20px var(--font-num); white-space: nowrap; }
.at-start__r { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.at-start__r span { grid-column: 1 / -1; }
.at-start__bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.at-start__bar i { display: block; height: 100%; border-radius: 3px; }
.at-start__bar i.up { background: var(--bull); } .at-start__bar i.dn { background: var(--bear); }
.at-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.at-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; min-width: 0; }
.at-kpi span { display: block; color: var(--ink-muted); font-size: 11.5px; }
.at-kpi b { display: block; font: 600 16px var(--font-num); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.at-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.at-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.at-card { background: linear-gradient(170deg, var(--surface-raised), var(--surface) 60%); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; min-width: 0; margin-bottom: 16px; }
.at-col > .at-card { margin-bottom: 0; }
.at-card__h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.at-card__h h2 { margin: 0; font-size: 17.5px; font-weight: 750; letter-spacing: -.01em; color: #fff; display: flex; align-items: center; gap: 10px; }
.at-card__h h2::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--ai), var(--accent)); flex: none; }
.at-card__h { padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.at-sub { color: var(--ink-muted); font-size: 12px; }
.at-sp { flex: 1; }
.at-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.at-seg button { font: 600 12px var(--font-text); color: var(--ink-dim); background: transparent; border: 0; padding: 6px 11px; cursor: pointer; }
.at-seg button b { display: none; font-weight: 700; }
.at-seg button.is-on { background: var(--ai-lo); color: var(--ai); }
.at-note { color: var(--amber); font-size: 13px; margin: 0 0 12px; }
.at-empty { color: var(--ink-muted); margin: 6px 0; }

.at-day { margin: 18px 0 8px; color: var(--ink-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.at-day:first-child { margin-top: 0; }
.at-msg { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; margin-bottom: 14px;
  background: linear-gradient(160deg, rgba(167, 139, 250, .07), rgba(0, 0, 0, .18) 45%); box-shadow: inset 3px 0 0 var(--ai); }
.at-msg--extra { background: linear-gradient(160deg, rgba(240, 184, 80, .08), rgba(0, 0, 0, .18) 45%); box-shadow: inset 3px 0 0 var(--amber); }
.at-msg__h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.at-slot { font-weight: 700; font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--ai-lo); color: #cbb8ff; border: 1px solid rgba(167, 139, 250, .3); }
.at-slot--straordinaria { background: rgba(240, 184, 80, .12); color: #ffd58a; border-color: rgba(240, 184, 80, .35); }
.at-slot--briefing, .at-slot--pagella { background: rgba(45, 212, 200, .1); color: #8ef0e7; border-color: rgba(45, 212, 200, .3); }
.at-slot--chiusura { background: rgba(91, 157, 255, .12); color: #a9c8ff; border-color: rgba(91, 157, 255, .3); }
.at-time { font: 600 14px var(--font-num); color: var(--ink); }
.at-time small { font: 11px var(--font-text); color: var(--ink-muted); }
.at-rid { font: 11px var(--font-num); color: var(--ink-muted); margin-right: 4px; }
.at-st { font-size: 11px; color: var(--amber); }
.at-msg__tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.at-ic { background: none; border: 0; color: var(--ink-muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.at-ic:hover { color: var(--ink); background: var(--surface-raised); }
.at-msg__b { overflow-wrap: anywhere; color: #cfd5e2; font-size: 14px; }

.at-sec { margin-top: 12px; }
.at-sec:first-child { margin-top: 0; }
.at-sec__l { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 7px; }
.at-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 11px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line-soft); }
.at-act__b { font: 700 12px var(--font-num); padding: 3px 9px; border-radius: 7px; letter-spacing: .02em; white-space: nowrap; }
.at-act__t { color: var(--ink-dim); font-size: 13px; }
.at-act--buy { border-color: rgba(62, 207, 142, .35); background: rgba(62, 207, 142, .07); } .at-act--buy .at-act__b { background: rgba(62, 207, 142, .18); color: var(--bull); }
.at-act--sell { border-color: rgba(242, 113, 111, .35); background: rgba(242, 113, 111, .07); } .at-act--sell .at-act__b { background: rgba(242, 113, 111, .18); color: var(--bear); }
.at-act--sl { border-color: rgba(45, 212, 200, .3); background: rgba(45, 212, 200, .06); } .at-act--sl .at-act__b { background: rgba(45, 212, 200, .16); color: var(--accent); }
.at-act--close { border-color: rgba(240, 184, 80, .3); background: rgba(240, 184, 80, .06); } .at-act--close .at-act__b { background: rgba(240, 184, 80, .16); color: var(--amber); }
.at-act--other .at-act__b { font: 13px var(--font-text); padding: 0; white-space: normal; color: var(--ink-dim); }
.at-act--none { color: var(--ink-muted); font-size: 13px; border-style: dashed; background: none; }
.at-sec--warn .at-act { border-color: rgba(240, 184, 80, .45); }
.at-rej { padding: 7px 11px; border-radius: 9px; margin-bottom: 5px; background: rgba(242, 113, 111, .06); border: 1px solid rgba(242, 113, 111, .25); color: #f3b9b8; font-size: 13px; }

.at-sy { display: inline-block; font: 700 11.5px var(--font-num); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 6px; padding: 0 5px; line-height: 1.5; white-space: nowrap; }
.at-sy--big { font-size: 12.5px; padding: 2px 8px; }
.at-n { font-family: var(--font-num); font-size: .93em; color: var(--ink); }
.at-px { font: 12px var(--font-num); color: var(--ink-dim); background: rgba(0, 0, 0, .3); border-radius: 6px; padding: 2px 6px; }
.at-ok { color: var(--bull); font-weight: 600; }
.at-prose p { margin: 0 0 9px; line-height: 1.65; }
.at-prose p:last-child { margin-bottom: 0; }
.at-sec--why .at-prose > p:first-child { color: var(--ink); font-size: 14.5px; }
.at-subh { margin: 12px 0 6px; font-size: 12px; color: var(--ink-dim); font-weight: 700; }
.at-row { display: grid; grid-template-columns: minmax(118px, max-content) minmax(0, 1fr); gap: 12px; align-items: baseline;
  padding: 7px 10px; border-radius: 9px; margin-bottom: 4px; background: rgba(255, 255, 255, .025); }
.at-row__h { display: flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 12.5px; white-space: nowrap; }
.at-row__t { line-height: 1.6; }
.at-row--plain { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.at-lab { color: var(--ink); font-weight: 650; font-size: 12.5px; }
.at-sec--next { padding: 11px 12px 8px; border-radius: 12px; background: rgba(167, 139, 250, .06); border: 1px solid rgba(167, 139, 250, .2); }
.at-sec--next .at-sec__l { color: var(--ai); }
.at-sec--next .at-row { background: rgba(0, 0, 0, .18); }
.at-msg__f { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.at-pill { font-size: 12.5px; color: var(--ink-dim); background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

.at-pos { border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; }
.at-pos__r { display: flex; justify-content: space-between; gap: 8px; }
.at-pos__r b { font-weight: 650; }
.at-slb { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; }
.at-slb b { font-family: var(--font-num); }
.at-slb small { font-weight: 500; opacity: .8; }
.at-slb--be { color: #8ef0c4; background: rgba(62, 207, 142, .12); border: 1px solid rgba(62, 207, 142, .4); }
.at-slb--lock { color: #0b1a12; background: var(--bull); }
.at-slb--risk { color: #f3b9b8; background: rgba(242, 113, 111, .08); border: 1px solid rgba(242, 113, 111, .25); font-weight: 500; }
.at-slb--none { color: var(--amber); background: rgba(240, 184, 80, .1); border: 1px solid rgba(240, 184, 80, .35); }
.at-pos__m { font: 12px var(--font-num); color: var(--ink-dim); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.up { color: var(--bull); } .dn { color: var(--bear); }
.at-side { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.at-side--buy { background: rgba(62, 207, 142, .14); color: var(--bull); } .at-side--sell { background: rgba(242, 113, 111, .14); color: var(--bear); }
.at-curve svg { display: block; max-width: 100%; }
.at-cv__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: -4px 0 8px; }
.at-cv__head b { font: 700 24px var(--font-num); letter-spacing: -.02em; }
.at-cv__head > span { color: var(--ink-muted); font-size: 12px; }
.at-cv__wrap { position: relative; }
.at-cv__ax { font: 10.5px var(--font-num); fill: var(--ink-muted); }
.at-cv__hit { cursor: crosshair; }
.at-cv__bars { margin-top: 2px; }
.at-cv__tip { position: absolute; pointer-events: none; min-width: 150px; background: #0d1320; border: 1px solid #2a3346; border-radius: 10px;
  padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); font-size: 12px; z-index: 2; }
.at-cv__tt { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.at-cv__n { margin-left: auto; font: 11px var(--font-num); color: var(--ink-muted); }
.at-cv__tr { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-dim); }
.at-cv__tr b { font-family: var(--font-num); }
.at-cv__d { margin-top: 4px; font: 11px var(--font-num); color: var(--ink-muted); }
.at-cv__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.at-cv__stats span { display: block; font-size: 11px; color: var(--ink-muted); }
.at-cv__stats b { font: 600 13.5px var(--font-num); white-space: nowrap; }
.at-sym { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.at-sym:last-child { border-bottom: 0; }
.at-sym span { font-family: var(--font-num); }
.at-rules ul { margin: 0; padding-left: 18px; color: var(--ink-dim); font-size: 13px; }
.at-rules li { margin-bottom: 5px; } .at-rules b { color: var(--ink); font-weight: 600; }

.at-tbl-w { overflow-x: auto; }
.at-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.at-tbl th { text-align: left; color: var(--ink-muted); font-weight: 600; font-size: 11.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.at-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.at-tbl td.n { font-family: var(--font-num); text-align: right; } .at-tbl th.n { text-align: right; }
.at-foot { color: var(--ink-muted); font-size: 12px; text-align: center; margin: 8px 0 40px; }
.at-gate { max-width: 420px; margin: 90px auto; text-align: center; padding: 0 16px; }
.at-gate p { color: var(--ink-dim); }
.at-btn { display: inline-block; background: var(--ai-lo); color: var(--ai); border: 1px solid rgba(167, 139, 250, .4); border-radius: 10px; padding: 9px 16px; text-decoration: none; font-weight: 600; }

@media (max-width: 980px) {
  .at-hero { grid-template-columns: 1fr; }
  .at-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .at-w { padding: 0 16px; }
  .at-row { grid-template-columns: 1fr; gap: 3px; }
  .at-seg button span { display: none; } .at-seg button b { display: inline; }
  .at-msg { padding: 12px 12px 10px; }
  .at-hero h1 { font-size: 30px; }
  .at-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .at-start { grid-template-columns: 1fr; gap: 8px; }
  .at-brand > span:first-of-type, .at-sep { display: none; }
}
.at-msg__b b.up, .at-msg__b b.dn { white-space: nowrap; }

/* Trade eseguiti: riquadro + finestra (10/11) */
.at-exp { font: 600 12px var(--font-text); color: var(--ai); background: var(--ai-lo); border: 1px solid rgba(167, 139, 250, .35); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.at-exp:hover { background: rgba(167, 139, 250, .2); }
.at-trl { display: grid; grid-template-columns: 92px auto auto 1fr; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.at-trl:last-of-type { border-bottom: 0; }
.at-trl__d { font: 11.5px var(--font-num); color: var(--ink-dim); }
.at-trl b { text-align: right; font: 600 13px var(--font-num); white-space: nowrap; }
.at-trl .at-side { margin-left: 0; }
.at-trl__more { display: block; width: 100%; margin-top: 8px; font: 600 12.5px var(--font-text); color: var(--ink-dim); background: rgba(255, 255, 255, .03);
  border: 1px dashed var(--line); border-radius: 9px; padding: 7px; cursor: pointer; }
.at-trl__more:hover { color: var(--ink); }
.at-dlg { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; color: var(--ink); background: linear-gradient(170deg, var(--surface-raised), var(--surface) 60%);
  border: 1px solid #2a3346; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.at-dlg[open] { display: flex; flex-direction: column; }
.at-dlg::backdrop { background: rgba(4, 7, 14, .72); backdrop-filter: blur(3px); }
.at-dlg__h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.at-dlg__h h2 { margin: 0; font-size: 19px; font-weight: 750; color: #fff; }
.at-dlg__x { font-size: 15px; }
.at-dlg__sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 8px 18px; }
.at-dlg__sum div { background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.at-dlg__sum span { display: block; font-size: 11px; color: var(--ink-muted); }
.at-dlg__sum b { font: 600 17px var(--font-num); }
.at-dlg__f { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 18px 10px; }
.at-dlg__f button { font: 600 12px var(--font-num); color: var(--c, var(--ink-dim)); background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.at-dlg__f button.is-on { background: color-mix(in srgb, var(--c, #a78bfa) 18%, transparent); border-color: color-mix(in srgb, var(--c, #a78bfa) 50%, transparent); color: var(--c, var(--ai)); }
.at-dlg__b { overflow: auto; padding: 0 18px 16px; }
.at-dlg .at-tbl thead th { position: sticky; top: 0; background: #141b2b; }
@media (max-width: 560px) {
  .at-dlg { width: calc(100vw - 16px); max-height: calc(100vh - 24px); }
  .at-dlg__sum b { font-size: 15px; }
}

/* resoconto appena arrivato (10/11) */
@keyframes atGlow { 0% { box-shadow: inset 3px 0 0 var(--ai), 0 0 0 0 rgba(167, 139, 250, .7); } 70% { box-shadow: inset 3px 0 0 var(--ai), 0 0 0 10px rgba(167, 139, 250, 0); } 100% { box-shadow: inset 3px 0 0 var(--ai), 0 0 0 0 rgba(167, 139, 250, 0); } }
.at-msg--new { border-color: rgba(167, 139, 250, .7); animation: atGlow 1.6s ease-out 3; }
.at-msg--new.at-msg--seen { border-color: var(--line); }
.at-new { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0b0f1a; background: var(--ai); border-radius: 999px; padding: 2px 9px; }
.at-msg--seen .at-new { display: none; }
@media (prefers-reduced-motion: reduce) { .at-msg--new { animation: none; } }
