:root {
  /* Palette ironedgefx.it: nero + rosso neon, accenti oro */
  --bg: #030101;
  --panel: #0b0505;
  --panel-2: #110808;
  --panel-3: #1a0c0e;
  --border: #261214;
  --border-2: #3a1a1e;
  --text: #fcf3f2;
  --muted: #b69592;
  --faint: #7d625f;
  --accent: #ff0e30;
  --accent-2: #ff4a5f;
  --accent-dark: #da0041;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255,14,48, 0.12);
  --accent-glow: 0 0 24px rgba(255,14,48, 0.45);
  --gold: #ffd230;
  --gold-soft: rgba(255, 210, 48, 0.12);
  --green: #2bd47f;
  --green-soft: rgba(43, 212, 127, 0.12);
  --red: #ff5c6c;
  --red-soft: rgba(255, 92, 108, 0.12);
  --blue: #229ed9;
  --blue-soft: rgba(34, 158, 217, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  --sidebar: 252px;
  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Orbitron', 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-family: var(--display); font-size: 25px; font-weight: 700; letter-spacing: 0.01em; }
h2 { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
h3 { font-size: 16px; font-weight: 600; }
.accent-text { color: var(--accent); text-shadow: 0 0 18px rgba(255,14,48,.35); }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.pre { white-space: pre-wrap; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; letter-spacing: 0.04em; font-size: 15px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo svg, .logo img { width: 32px; height: 32px; flex: none; object-fit: contain; }
.logo img { width: 38px; height: 38px; background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 0 14px rgba(255,14,48,.35); }
.logo b { color: var(--accent); font-weight: 900; text-shadow: 0 0 14px rgba(255,14,48,.5); }
.logo small { font-family: var(--font); }
.logo small { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--muted); font-weight: 600; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--panel-3); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); border-color: transparent; color: var(--accent-ink); box-shadow: 0 0 18px rgba(255,14,48,.35); }
.btn-primary:hover { background: linear-gradient(90deg, #ff2a46, #e8104f); box-shadow: var(--accent-glow); }
.btn-danger { color: var(--red); border-color: rgba(255,92,108,.35); background: var(--red-soft); }
.btn-danger:hover { background: rgba(255,92,108,.2); }
.btn-success { color: var(--green); border-color: rgba(43,194,117,.35); background: var(--green-soft); }
.btn-success:hover { background: rgba(43,194,117,.2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; padding: 0; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--bg); color: var(--text); font: 14px var(--font);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="file"].input { padding: 7px 10px; height: auto; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 14px; }
.check input { margin-top: 3px; accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.form-error { background: var(--red-soft); color: #ffb8bf; border: 1px solid rgba(255,92,108,.3); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.form-ok { background: var(--green-soft); color: #9be8bf; border: 1px solid rgba(43,194,117,.3); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 14px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 4px 0 14px; }
.or-sep::before, .or-sep::after { content: ''; height: 1px; background: var(--border); flex: 1; }

/* ---------- Auth page ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at -10% -10%, rgba(255,14,48,.18), transparent 60%),
              radial-gradient(800px 500px at 110% 110%, rgba(218,0,65,.10), transparent 60%), var(--panel);
  border-right: 1px solid var(--border);
}
.auth-hero h1 { font-size: 40px; line-height: 1.1; max-width: 520px; margin-top: 12px; }
.auth-hero h1 em { font-style: normal; color: var(--accent); }
.auth-hero .lead { color: var(--muted); font-size: 16px; max-width: 480px; margin-top: 16px; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; margin-top: 32px; }
.auth-features div { display: flex; gap: 10px; align-items: center; padding: 12px 14px; background: rgba(255,255,255,.025); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.auth-features svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.auth-chart { position: absolute; inset: auto 0 0 0; height: 45%; opacity: .5; pointer-events: none; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); padding: 4px; border-radius: 10px; margin: 22px 0 22px; }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 600 13.5px var(--font); cursor: pointer; }
.tabs button.active { background: var(--panel-3); color: var(--text); }
.risk-note { font-size: 11.5px; color: var(--faint); margin-top: 22px; line-height: 1.5; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--panel); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transition: transform .2s;
}
.sidebar .logo { padding: 20px 20px 18px; border-bottom: 1px solid var(--border); }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav .nav-label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--muted);
  font-weight: 550; font-size: 14px; position: relative;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-2); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a .badge { margin-left: auto; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent); flex: none; border: 1px solid var(--border-2); }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who div { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who small { color: var(--faint); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar { display: none; }
.page { padding: 32px 36px 60px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 680px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: inline-flex; align-items: center; gap: 6px; }
.crumb svg { width: 14px; height: 14px; }
.backdrop { display: none; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .k svg { width: 15px; height: 15px; color: var(--faint); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--panel-3); color: var(--muted); border: 1px solid var(--border-2); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(255,210,48,.3); }
.badge.green { background: var(--green-soft); color: var(--green); border-color: rgba(43,194,117,.3); }
.badge.red { background: var(--red-soft); color: var(--red); border-color: rgba(255,92,108,.3); }
.badge.blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(34,158,217,.3); }
.badge.count { background: var(--accent); color: var(--accent-ink); border: 0; min-width: 20px; justify-content: center; height: 20px; padding: 0 6px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--border-2); border-radius: var(--radius); }
.empty svg { width: 34px; height: 34px; color: var(--faint); margin: 0 auto 10px; display: block; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

.progress { height: 6px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s; }

/* ---------- Home ---------- */
.hero-card {
  background: radial-gradient(700px 300px at 0% 0%, rgba(255,14,48,.16), transparent 70%), var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.ring { --p: 0; width: 108px; height: 108px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--panel-3) 0); display: grid; place-items: center; }
.ring > div { width: 86px; height: 86px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; text-align: center; font-weight: 700; font-size: 20px; line-height: 1.1; }
.ring small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: border-color .15s, transform .15s; }
.step:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.step .n { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; }
.step .n svg { width: 17px; height: 17px; }
.step p { color: var(--muted); font-size: 13px; }

/* ---------- Formazione ---------- */
.strategy-card { display: flex; flex-direction: column; gap: 12px; color: var(--text); transition: border-color .15s, transform .15s; }
.strategy-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.strategy-card .cover {
  height: 110px; border-radius: 9px; margin: -6px -6px 4px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1c0b0d, #0a0404);
  display: flex; align-items: flex-end; padding: 12px;
}
.strategy-card .cover svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.strategy-card .meta { display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; }
.strategy-card .meta span { display: inline-flex; gap: 5px; align-items: center; }
.strategy-card .meta svg { width: 14px; height: 14px; }
.strategy-card p.desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.course { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.viewer { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.viewer .frame { aspect-ratio: 16 / 9; background: #000; }
.viewer .frame iframe, .viewer .frame video { width: 100%; height: 100%; border: 0; display: block; }
.viewer .frame.doc { aspect-ratio: auto; height: 72vh; background: var(--panel-2); }
.viewer .frame.placeholder { display: grid; place-items: center; text-align: center; color: var(--muted); background: linear-gradient(135deg, #170809, #070303); padding: 20px; }
.viewer .frame.placeholder svg { width: 48px; height: 48px; color: var(--accent); margin: 0 auto 12px; }
.viewer .info { padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.viewer .info p { color: var(--muted); margin-top: 6px; }
.playlist { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: sticky; top: 20px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.playlist .pl-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.playlist .pl-body { overflow-y: auto; padding: 6px; }
.pl-group { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 12px 10px 6px; }
.pl-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; cursor: pointer; color: var(--text); border: 1px solid transparent; }
.pl-item:hover { background: var(--panel-2); }
.pl-item.active { background: var(--accent-soft); border-color: rgba(255,14,48,.3); }
.pl-item .ic { width: 30px; height: 30px; border-radius: 7px; background: var(--panel-3); display: grid; place-items: center; flex: none; color: var(--muted); }
.pl-item .ic svg { width: 15px; height: 15px; }
.pl-item.done .ic { background: var(--green-soft); color: var(--green); }
.pl-item .t { font-size: 13.5px; font-weight: 550; line-height: 1.35; }
.pl-item .s { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* ---------- Trading room ---------- */
.room { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 480px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.room-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.room-head .ch-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); display: grid; place-items: center; color: var(--accent-ink); flex: none; }
.room-head .ch-avatar svg { width: 20px; height: 20px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); letter-spacing: .06em; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(43,194,117,.6); animation: pulse 1.8s infinite; }
.live.off { color: var(--faint); }
.live.off::before { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(43,194,117,.55); } 70% { box-shadow: 0 0 0 9px rgba(43,194,117,0); } 100% { box-shadow: 0 0 0 0 rgba(43,194,117,0); } }
.feed { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px;
  background: radial-gradient(circle at 20% 20%, rgba(255,14,48,.04), transparent 40%), var(--bg); }
.day-sep { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 99px; margin: 8px 0; }
.msg { align-self: flex-start; max-width: min(620px, 92%); background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; overflow: hidden; animation: msgIn .25s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .photos { display: grid; gap: 2px; }
.msg .photos.n2 { grid-template-columns: 1fr 1fr; }
.msg .photos.n3, .msg .photos.n4 { grid-template-columns: 1fr 1fr; }
.msg .photos img { width: 100%; max-height: 420px; object-fit: cover; cursor: zoom-in; background: #000; }
.msg .body { padding: 10px 14px 6px; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.msg .body:empty { display: none; }
.msg .body pre, .msg .body code { font-family: var(--mono); font-size: 13px; background: rgba(0,0,0,.3); border-radius: 4px; padding: 1px 4px; }
.msg .body pre { padding: 8px 10px; overflow-x: auto; }
.msg .body blockquote { margin: 4px 0; padding: 2px 10px; border-left: 3px solid var(--accent); color: var(--muted); }
.msg .body .spoiler { background: var(--border-2); color: transparent; border-radius: 3px; cursor: pointer; }
.msg .body .spoiler.show { color: inherit; background: transparent; }
.msg .attach { margin: 8px 14px 0; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 8px; background: rgba(0,0,0,.25); color: var(--text); }
.msg .attach svg { width: 20px; height: 20px; color: var(--accent); }
.msg .foot { padding: 0 12px 7px; font-size: 11px; color: var(--faint); text-align: right; }
.msg.hidden-msg { opacity: .45; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: grid; place-items: center; z-index: 100; cursor: zoom-out; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* ---------- Indicatori ---------- */
.ind-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.ind-card .shot { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1a0a0c, #080303); display: grid; place-items: center; color: var(--faint); border-bottom: 1px solid var(--border); overflow: hidden; }
.ind-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.ind-card .shot svg { width: 40px; height: 40px; }
.ind-card .body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ind-card .body p { color: var(--muted); font-size: 13.5px; flex: 1; }
.howto { counter-reset: h; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.howto li { counter-increment: h; display: flex; gap: 12px; color: var(--muted); font-size: 13.5px; }
.howto li::before { content: counter(h); width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.howto b { color: var(--text); }

/* ---------- Glossario ---------- */
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search .input { padding-left: 38px; height: 44px; font-size: 15px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--panel); color: var(--muted); font: 600 12.5px var(--font); cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: rgba(255,14,48,.4); color: var(--accent-2); }
.letters { display: flex; flex-wrap: wrap; gap: 2px; }
.letters a { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); font-weight: 650; font-size: 12.5px; }
.letters a:hover { background: var(--panel-2); color: var(--accent-2); text-decoration: none; }
.letters a.off { color: var(--border-2); pointer-events: none; }
.g-letter { font-size: 22px; font-weight: 800; color: var(--accent); padding: 18px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px; scroll-margin-top: 20px; }
.g-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.g-item { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.g-item h4 { font-size: 15px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.g-item p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
mark { background: rgba(255,14,48,.3); color: var(--text); border-radius: 2px; }

/* ---------- Broker ---------- */
.broker-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.broker-hero .l { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.broker-hero .r { padding: 28px; background: var(--panel-2); border-left: 1px solid var(--border); }
.broker-logo { height: 44px; width: auto; max-width: 180px; object-fit: contain; object-position: left; }
.steps-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; counter-reset: b; }
.steps-list li { counter-increment: b; display: flex; gap: 12px; font-size: 13.5px; color: var(--muted); }
.steps-list li::before { content: counter(b); width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent-2); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.sys-card { padding: 0; overflow: hidden; }
.sys-card .sys-head { padding: 20px 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.sys-card .sys-head p { color: var(--muted); margin-top: 6px; max-width: 640px; }
.sys-stats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); border-bottom: 1px solid var(--border); }
.sys-stats > div { padding: 14px 20px; border-right: 1px solid var(--border); }
.sys-stats > div:last-child { border-right: 0; }
.sys-stats .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.sys-stats .v { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sys-chart { padding: 16px 12px 6px 6px; }
.sys-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.sys-chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart-tip { position: fixed; pointer-events: none; background: var(--panel-3); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 10px; font-size: 12px; z-index: 90; box-shadow: var(--shadow); white-space: nowrap; }
.months { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.months th { color: var(--faint); font-weight: 600; padding: 8px 4px; text-align: center; font-size: 11.5px; }
.months td { padding: 3px; text-align: center; }
.months td span { display: block; padding: 6px 2px; border-radius: 5px; font-weight: 600; }
.months td.y { color: var(--muted); font-weight: 700; text-align: left; padding-left: 8px; }
.months td.tot span { background: var(--panel-3); }
.table-wrap { overflow-x: auto; }
.disclaimer { font-size: 12px; color: var(--faint); line-height: 1.6; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }

/* ---------- Tables (admin) ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; color: var(--faint); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: rgba(255,255,255,.015); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table-card { padding: 0; overflow: hidden; }
.table-card .table-wrap { overflow-x: auto; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font: 600 12.5px var(--font); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.active { background: var(--panel-3); color: var(--text); }
.seg button svg { width: 15px; height: 15px; }
.modal-head .btn svg, .icon-btn svg, .ic svg { width: 16px; height: 16px; }
.admin-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2); }
.admin-item .ic { width: 32px; height: 32px; border-radius: 7px; background: var(--panel-3); display: grid; place-items: center; color: var(--muted); flex: none; }
.admin-item .ic svg { width: 16px; height: 16px; }
.admin-item .t { font-weight: 600; font-size: 13.5px; }
.admin-item .s { font-size: 12px; color: var(--faint); }
.admin-item .grow { flex: 1; min-width: 0; }
.admin-item > svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
a.admin-item:hover { border-color: var(--border-2); background: var(--panel-3); }
svg { flex-shrink: 0; }
.timeline-ic { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.timeline-ic svg { width: 15px; height: 15px; color: var(--accent); margin-top: 2px; }
.results-editor { width: 100%; border-collapse: collapse; }
.results-editor td { padding: 3px; }
.results-editor .input { height: 34px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(4,6,9,.72); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--panel-2); border-radius: 0 0 14px 14px; }
.upload-bar { height: 6px; background: var(--panel-3); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.upload-bar div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 120; }
.toast { background: var(--panel-3); border: 1px solid var(--border-2); border-left: 3px solid var(--accent); padding: 11px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13.5px; animation: msgIn .2s; max-width: 360px; }
.toast.error { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.loading { display: grid; place-items: center; padding: 60px; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .course { grid-template-columns: 1fr; }
  .playlist { position: static; max-height: none; }
  .steps { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sys-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sys-stats > div { border-bottom: 1px solid var(--border); }
}
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .auth-hero h1 { font-size: 28px; }
  .auth-features, .auth-chart, .auth-hero .lead { display: none; }
  .auth-hero h1 { font-size: 24px; }
  .sidebar { transform: translateX(-100%); }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .main { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 20; }
  .page { padding: 22px 16px 48px; }
  .grid-2, .grid-3, .g-list, .broker-hero, .hero-card { grid-template-columns: 1fr; }
  .broker-hero .r { border-left: 0; border-top: 1px solid var(--border); }
  .room { height: calc(100vh - 200px); }
  .form-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 560px) {
  .steps, .grid-4 { grid-template-columns: 1fr; }
  .sys-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  h1 { font-size: 22px; }
  .hero-card { padding: 20px; }
}
