/* SIYAD 3D QUANT — command center styles (no build step). */
:root {
  --void: #04060a;
  --panel: rgba(10, 15, 22, 0.9);
  --panel-solid: #0a0f16;
  --panel-2: rgba(16, 23, 33, 0.86);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --ink: #e8edf3;
  --ink-2: #a7b2c1;
  --ink-3: #6d7a8c;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.14);
  --red: #f0506e;
  --red-soft: rgba(240, 80, 110, 0.14);
  --blue: #5aa9f0;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--void); color: var(--ink); }
body { font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.mono { font-family: var(--mono); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h2, h3, h4 { font-family: var(--display); margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- persistent WebGL background ---------- */
#bg-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
#bg-veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(ellipse at 50% 0%, rgba(4, 6, 10, 0.35), rgba(4, 6, 10, 0.86) 70%); }
body.is-live #bg-veil { opacity: 1; }
body.no-webgl { background: radial-gradient(ellipse at 50% -10%, #0b2a22 0%, var(--void) 55%); }

/* ---------- intro HUD ---------- */
#intro { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(16px, 3vw, 36px); pointer-events: none; transition: opacity 0.5s ease; }
#intro.is-leaving { opacity: 0; }
.intro-top { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; letter-spacing: 0.18em; color: var(--ink-2); }
#intro-lock { color: var(--gold); }
.intro-fallback { text-align: center; }
.fallback-title { font: 700 clamp(40px, 8vw, 96px)/1 var(--display); letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff, #f5d48a 45%, #8a6a1c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fallback-title [lang="ar"] { font-family: "Noto Kufi Arabic", var(--display); }
.fallback-sub { margin-top: 12px; letter-spacing: 0.4em; color: var(--emerald); font-size: 13px; }
.intro-bottom { display: flex; flex-direction: column; align-items: center; gap: 18px; pointer-events: auto; }
.intro-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; }
.intro-stats li { text-align: center; }
.intro-stats b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.intro-stats span { font-size: 10px; letter-spacing: 0.2em; color: var(--ink-3); }
.intro-enter { padding: 15px 30px; border: 1px solid var(--emerald); border-radius: 4px; background: rgba(16, 185, 129, 0.1);
  color: #d1fae5; letter-spacing: 0.16em; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px);
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s; }
.intro-enter:hover { background: rgba(16, 185, 129, 0.24); box-shadow: 0 0 38px rgba(16, 185, 129, 0.45); transform: translateY(-1px); }
.intro-auto { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: 0.2em; color: var(--ink-3); }
.intro-auto i { display: block; width: 160px; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold)) no-repeat left / 0% 100%, rgba(148, 163, 184, 0.2); }
#warp-flash { position: fixed; inset: 0; z-index: 40; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #eafff7 0%, #10b981 30%, rgba(4, 6, 10, 0) 72%); }

/* ---------- app shell ---------- */
.app { position: relative; z-index: 5; min-height: 100vh; opacity: 0; visibility: hidden; transform: scale(1.03);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
body.is-live .app { opacity: 1; visibility: visible; transform: none; }
.telemetry { position: sticky; top: 0; z-index: 12; background: rgba(4, 6, 10, 0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); }
.telemetry-row { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; max-width: 1560px; margin: 0 auto; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; color: var(--emerald); }
.brand-name { font: 700 17px/1 var(--display); letter-spacing: 0.2em; }
.brand-name span { color: var(--gold); }
.brand-ar { font: 700 12px/1.3 "Noto Kufi Arabic", var(--sans); color: var(--ink-3); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  font: 500 11px/1.2 var(--mono); color: var(--ink-2); background: rgba(10, 15, 22, 0.6); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pill.ok i { background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.pill.warn i { background: var(--gold); }
.pill.off i { background: var(--red); }
.pill b { color: var(--ink); font-weight: 600; }
.kpis { display: flex; gap: 18px; }
.kpi { text-align: right; }
.kpi span { display: block; font: 500 10px/1.2 var(--mono); letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; }
.kpi b { font: 700 16px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.pos { color: var(--emerald); } .neg { color: var(--red); } .warn-ink { color: var(--gold); }
.scan-btn { padding: 10px 16px; border-radius: 8px; border: 1px solid var(--gold); background: var(--gold-soft); color: #fde6b0;
  font: 600 13px/1 var(--display); letter-spacing: 0.04em; transition: background 0.2s, box-shadow 0.2s; }
.scan-btn:hover:not(:disabled) { background: rgba(245, 158, 11, 0.26); box-shadow: 0 0 24px rgba(245, 158, 11, 0.3); }
.scan-btn:disabled { opacity: 0.6; cursor: progress; }
.scan-progress { display: flex; align-items: center; gap: 12px; max-width: 1560px; margin: 0 auto; padding: 0 20px 9px; }
.scan-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(148, 163, 184, 0.16); overflow: hidden; }
#scan-bar { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--emerald), var(--gold)); transition: width 0.25s ease; }
#scan-text { font-size: 11px; color: var(--ink-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }

.main { max-width: 1560px; margin: 0 auto; padding: 16px 20px 80px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tab { flex: none; padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--ink-2); font: 600 13px/1.2 var(--display); transition: border-color 0.15s, color 0.15s, background 0.15s; }
.tab small { font: 400 10px/1 var(--mono); color: var(--ink-3); margin-left: 4px; }
.tab:hover { color: var(--ink); border-color: var(--line-strong); }
.tab.is-active { color: #d1fae5; border-color: var(--emerald); background: var(--emerald-soft); }

.toolbar { margin: 14px 0 6px; display: grid; gap: 10px; }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: var(--panel); }
.search:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12); }
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 14px; }
.search input::placeholder { color: var(--ink-3); }
#search-meta { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip, .chip-select { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--ink-2); font: 500 12px/1.2 var(--sans); }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { border-color: var(--gold); color: #fde6b0; background: var(--gold-soft); }
.chip-select { appearance: none; padding-right: 22px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a7b2c1' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 8px center / 9px; }
.chip-select option { background: var(--panel-solid); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }
.section-head h2 { font-size: 16px; letter-spacing: 0.02em; }
.section-head p { margin: 0; font-size: 11px; color: var(--ink-3); }

.week-strip { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 8px; margin-top: 12px; overflow-x: auto; }
.week-day { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.week-day b { display: block; font: 600 13px/1.2 var(--display); }
.week-day span { font: 400 11px/1.4 var(--mono); color: var(--ink-3); display: block; }
.week-day .bar { height: 3px; margin-top: 6px; background: rgba(148, 163, 184, 0.15); border-radius: 2px; }
.week-day .bar i { display: block; height: 100%; background: var(--emerald); border-radius: 2px; }

/* ---------- match cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 12px; }
.card { position: relative; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); display: grid; gap: 10px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.card:hover { border-color: var(--emerald); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.card.is-routed { border-left: 3px solid var(--emerald); }
.card-top { display: flex; justify-content: space-between; gap: 10px; font: 400 11px/1.3 var(--mono); color: var(--ink-3); }
.card-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-mid { display: flex; align-items: center; gap: 12px; }
.teams { flex: 1; min-width: 0; font: 600 15px/1.3 var(--display); }
.teams div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teams small { font: 400 11px/1 var(--mono); color: var(--ink-3); margin-left: 6px; }
.score-ring { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring, var(--emerald)) calc(var(--v) * 1%), rgba(148, 163, 184, 0.14) 0); }
.score-ring b { width: 44px; height: 44px; border-radius: 50%; background: var(--panel-solid); display: grid; place-items: center;
  font: 700 14px/1 var(--display); font-variant-numeric: tabular-nums; }
.prob-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; gap: 2px; }
.prob-bar i { display: block; height: 100%; border-radius: 2px; }
.prob-bar .h { background: var(--emerald); } .prob-bar .d { background: #7d8a9c; } .prob-bar .a { background: var(--gold); }
.prob-legend { display: flex; justify-content: space-between; font: 400 11px/1.2 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pick { padding: 8px 10px; border-radius: 8px; background: rgba(4, 6, 10, 0.55); border: 1px solid var(--line); font-size: 12px; }
.pick b { display: block; font: 600 13px/1.3 var(--sans); color: var(--ink); }
.pick span { font: 400 11px/1.4 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 2px 7px; border-radius: 4px; font: 500 10px/1.5 var(--mono); border: 1px solid var(--line); color: var(--ink-2); }
.tag.g { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); background: var(--emerald-soft); }
.tag.y { color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); background: var(--gold-soft); }
.tag.r { color: #fda4b5; border-color: rgba(240, 80, 110, 0.4); background: var(--red-soft); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--panel); }
.empty b { display: block; font: 600 16px/1.4 var(--display); color: var(--ink); margin-bottom: 6px; }

/* ---------- VIP vault: 3D-tilting glass tickets ---------- */
.vault { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 14px; perspective: 1400px; }
.ticket { --rx: 0deg; --ry: 0deg; position: relative; padding: 16px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 45%, rgba(16, 185, 129, 0.06));
  backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform 0.18s ease-out; display: grid; gap: 12px; align-content: start; }
.ticket::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.14), transparent 45%); }
.ticket.t-coffre_fort { border-top: 2px solid var(--emerald); }
.ticket.t-v1_asymetrique { border-top: 2px solid var(--blue); }
.ticket.t-top_ev { border-top: 2px solid var(--gold); }
.ticket.is-expired { opacity: 0.62; }
.ticket h3 { font-size: 15px; letter-spacing: 0.03em; }
.ticket .sub { font: 400 11px/1.4 var(--mono); color: var(--ink-3); }
.ticket-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ticket-kpis div { padding: 7px 8px; border-radius: 8px; background: rgba(4, 6, 10, 0.5); }
.ticket-kpis span { display: block; font: 400 9px/1.2 var(--mono); letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase; }
.ticket-kpis b { font: 700 14px/1.4 var(--display); font-variant-numeric: tabular-nums; }
.leg { padding: 9px 10px; border-radius: 9px; background: rgba(4, 6, 10, 0.5); border: 1px solid var(--line); display: grid; gap: 5px; }
.leg.is-started { border-color: rgba(240, 80, 110, 0.5); }
.leg-head { display: flex; justify-content: space-between; gap: 8px; font: 400 10px/1.3 var(--mono); color: var(--ink-3); }
.leg-match { font: 600 13px/1.3 var(--display); background: none; border: 0; padding: 0; text-align: left; }
.leg-match:hover { color: #6ee7b7; }
.leg-pick { font-size: 12px; color: var(--ink); }
.leg-pick b { color: #fde6b0; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 7px; border-radius: 4px; overflow: hidden; gap: 2px; }
.split i { display: block; height: 100%; border-radius: 2px; min-width: 2px; }
.split .full { background: var(--emerald); } .split .half { background: #6ee7b7; } .split .push { background: #7d8a9c; }
.split .hloss { background: #fda4b5; } .split .loss { background: var(--red); }
.split-legend { display: flex; flex-wrap: wrap; gap: 3px 10px; font: 400 10px/1.3 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.split-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; background: var(--c); }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.btn { padding: 8px 13px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(4, 6, 10, 0.5); color: var(--ink);
  font: 600 12px/1 var(--sans); transition: border-color 0.15s, background 0.15s; }
.btn:hover:not(:disabled) { border-color: var(--emerald); background: var(--emerald-soft); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.gold { border-color: var(--gold); color: #fde6b0; background: var(--gold-soft); }
.note { font: 400 11px/1.4 var(--mono); color: var(--ink-3); }
.note.bad { color: #fda4b5; } .note.good { color: #6ee7b7; }

/* ---------- tables & panels ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px; }
.panel h3 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; font: 500 10px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  padding: 7px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row-link { cursor: pointer; } tr.row-link:hover td { background: rgba(16, 185, 129, 0.07); }
.badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font: 600 10px/1.5 var(--mono); white-space: nowrap; }
.badge.WIN, .badge.ok { color: #6ee7b7; background: var(--emerald-soft); }
.badge.LOSS, .badge.ko { color: #fda4b5; background: var(--red-soft); }
.badge.PENDING, .badge.PUSH, .badge.VOID, .badge.HALF_WIN, .badge.HALF_LOSS { color: #fcd34d; background: var(--gold-soft); }
.lookup { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lookup input { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: rgba(4, 6, 10, 0.6);
  font-family: var(--mono); width: min(280px, 100%); outline: 0; }
.lookup input:focus { border-color: var(--emerald); }

/* ---------- bilan ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.stat span { display: block; font: 500 10px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.stat b { font: 700 22px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.stat small { display: block; font: 400 11px/1.3 var(--mono); color: var(--ink-3); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { font: 10px var(--mono); fill: var(--ink-3); }
.chart .gridline { stroke: rgba(148, 163, 184, 0.13); }
.chart-tip { position: absolute; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: #111a25; border: 1px solid var(--line-strong);
  font: 400 11px/1.5 var(--mono); white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.day-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.day-card { text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; gap: 4px; }
.day-card:hover, .day-card.is-open { border-color: var(--gold); }
.day-card .d { font: 600 13px/1.2 var(--display); }
.day-card .n { font: 700 19px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.day-card span { font: 400 11px/1.4 var(--mono); color: var(--ink-2); }
.heal-day { border-top: 1px solid var(--line); padding: 10px 0; }
.heal-day summary { cursor: pointer; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; font: 600 13px/1.4 var(--display); }
.heal-day summary span { font: 400 11px/1.4 var(--mono); color: var(--ink-3); }
.term { margin: 0; padding: 12px; border-radius: 10px; background: #05080d; border: 1px solid var(--line); color: #c7d2e0;
  font: 400 11.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; }

/* ---------- drawer: 360° match quant terminal ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(2, 4, 7, 0.72); backdrop-filter: blur(3px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 55; width: min(1180px, 100vw); overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #070b11, #05080d); border-left: 1px solid var(--line-strong);
  transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.drawer.is-open { transform: none; }
.drawer-head { position: sticky; top: 0; z-index: 4; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between;
  padding: 14px 20px; background: rgba(5, 8, 13, 0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-head p { margin: 3px 0 0; font: 400 11px/1.5 var(--mono); color: var(--ink-2); }
.close { flex: none; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); background: none; font-size: 16px; }
.close:hover { border-color: var(--red); color: #fda4b5; }
.drawer-content { padding: 16px 20px 60px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.panel-grid > *, .mrow > * { min-width: 0; }
.drawer { overflow-x: hidden; }
.verdict { padding: 12px 14px; border-radius: 12px; font: 600 13px/1.5 var(--mono); border: 1px solid; }
.verdict.ok { color: #a7f3d0; background: var(--emerald-soft); border-color: rgba(16, 185, 129, 0.5); }
.verdict.ko { color: #fecdd6; background: var(--red-soft); border-color: rgba(240, 80, 110, 0.5); }
.pitch-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #03050a; }
.pitch-canvas { display: block; width: 100%; height: clamp(300px, 46vh, 460px); cursor: grab; touch-action: pan-y; }
.pitch-canvas:active { cursor: grabbing; }
.pitch-hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px;
  background: var(--line); border-top: 1px solid var(--line); }
.pitch-hud > div { padding: 9px 12px; background: rgba(5, 8, 13, 0.9); font: 400 11px/1.55 var(--mono); color: var(--ink-2); }
.pitch-hud b { display: block; color: var(--ink); font: 600 11px/1.5 var(--mono); letter-spacing: 0.06em; }
.pitch-hint { position: absolute; top: 10px; right: 12px; font: 400 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--ink-3); pointer-events: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin: 0; }
.kv dt { color: var(--ink-3); font: 400 11px/1.6 var(--mono); }
.kv dd { margin: 0; text-align: right; font: 500 12px/1.6 var(--mono); font-variant-numeric: tabular-nums; }
.tline { font: 400 11.5px/1.6 var(--mono); color: var(--ink-2); margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); white-space: pre-wrap; word-break: break-word; }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 52px; gap: 8px; align-items: center; font: 400 11px/1.2 var(--mono); color: var(--ink-2); }
.bar-row .track { height: 8px; background: rgba(148, 163, 184, 0.12); border-radius: 4px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 4px; background: var(--emerald); }
.bar-row b { text-align: right; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.alloc { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; margin-bottom: 8px; }
.alloc i { display: block; height: 100%; min-width: 3px; }
.alloc-legend { display: grid; gap: 4px; font: 400 11px/1.4 var(--mono); color: var(--ink-2); }
.alloc-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; background: var(--c); }
.mgrid { display: grid; gap: 6px; }
.mrow { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; }
.mrow > b { font: 600 11px/1.9 var(--mono); color: var(--blue); letter-spacing: 0.04em; }
.cells { display: flex; flex-wrap: wrap; gap: 5px; }
.cell { max-width: 100%; overflow-wrap: anywhere; padding: 3px 8px; border-radius: 6px; background: rgba(4, 6, 10, 0.6); border: 1px solid var(--line); font: 400 11px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.cell b { font-weight: 600; color: var(--ink); }
.cell.hi { border-color: rgba(16, 185, 129, 0.45); } .cell.hi b { color: #6ee7b7; }
.cell.mid b { color: #fcd34d; } .cell.lo b { color: #fda4b5; }
.cell small { color: var(--ink-3); font-size: 10px; }
.strat { display: grid; grid-template-columns: 62px 96px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.strat:last-child { border-bottom: 0; }
.strat .sid { font: 700 12px/1.6 var(--mono); color: var(--ink); }
.strat p { margin: 0; font: 400 11.5px/1.6 var(--mono); color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.strat.is-valid p { color: #d6e2ee; }
.legacy { padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--gold); color: #fde6b0; background: var(--gold-soft); font-size: 12.5px; }
details.raw > summary { cursor: pointer; font: 600 12px/1.6 var(--display); color: var(--ink-2); }

/* ---------- modal (fiche ticket) ---------- */
.modal { position: fixed; z-index: 70; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 18px; border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #0d141d, #070b11); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); }
#modal-backdrop { z-index: 65; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-head p { margin: 3px 0 0; font: 400 11px/1.5 var(--mono); color: var(--ink-2); }
.modal-content { padding: 16px 18px 20px; display: grid; gap: 12px; }
.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.money div { padding: 10px 12px; border-radius: 10px; background: rgba(4, 6, 10, 0.6); border: 1px solid var(--line); }
.money span { display: block; font: 500 10px/1.3 var(--mono); letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; }
.money b { font: 700 19px/1.3 var(--display); font-variant-numeric: tabular-nums; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 8px;
  background: #111a25; border: 1px solid var(--line-strong); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.foot { max-width: 1560px; margin: 0 auto; padding: 0 20px 28px; font-size: 11px; color: var(--ink-3); }

@media (max-width: 720px) {
  .telemetry-row { padding: 8px 12px; gap: 8px 12px; }
  .kpis { order: 3; width: 100%; justify-content: space-between; }
  .scan-btn { order: 4; width: 100%; }
  .main { padding: 12px 12px 70px; }
  .mrow { grid-template-columns: 1fr; gap: 4px; }
  .strat { grid-template-columns: 52px 1fr; } .strat p { grid-column: 1 / -1; }
  .ticket-kpis { grid-template-columns: repeat(2, 1fr); }
  .money { grid-template-columns: 1fr; }
  .drawer-content, .drawer-head { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .ticket { transform: none !important; }
}
