/* ================= Tokens ================= */
:root, [data-theme="light"] {
  --bg: #f5f2ec;
  --surface: #fbfaf7;
  --surface-2: #efebe3;
  --ink: #16140f;
  --ink-2: #3d3a33;
  --muted: #736d61;
  --faint: #a19a8c;
  --rule: #e3ded3;
  --rule-2: #d0c9bb;
  --accent: #2747d0;
  --up: #0f8a72;
  --down: #cc4a3e;
  --warn: #a8660f;
  --btn-ink: #16140f;
  --btn-ink-text: #f5f2ec;
  --shadow: 0 1px 1px rgb(22 20 15 / .04), 0 2px 6px -2px rgb(22 20 15 / .06), 0 18px 40px -24px rgb(22 20 15 / .18);
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --r: 10px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f0e0c;
  --surface: #171613;
  --surface-2: #201e1a;
  --ink: #efebe3;
  --ink-2: #cdc7ba;
  --muted: #948d80;
  --faint: #6b655a;
  --rule: #2a2823;
  --rule-2: #3b3830;
  --accent: #8098ff;
  --up: #1fa38a;
  --down: #e65a50;
  --warn: #e9a23b;
  --btn-ink: #efebe3;
  --btn-ink-text: #0f0e0c;
  --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 20px 50px -30px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ================= Base ================= */
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* sinon un display:flex de classe réaffiche les éléments masqués */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11"; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
em { font-style: italic; }
::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.err { color: var(--down); font-size: 12px; min-height: 1em; margin-top: 6px; }
.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font: 500 10px var(--mono); color: var(--muted); border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 10px; border: 3px solid var(--bg); } ::-webkit-scrollbar-track { background: transparent; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 400 25px/1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.wm-box { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.wm-box .i { width: 16px; height: 16px; stroke-width: 2.4; }
.wordmark.small { font-size: 20px; } .wordmark.small .wm-box { width: 22px; height: 22px; }

/* ================= Contrôles ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent; font: 500 13.5px var(--sans); cursor: pointer; color: var(--ink); background: transparent; transition: background .15s, border-color .15s, transform .08s, opacity .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn .i { width: 15px; height: 15px; }
.btn-ink { background: var(--btn-ink); color: var(--btn-ink-text); }
.btn-ink:hover { opacity: .88; }
.btn-line { border-color: var(--rule-2); background: var(--surface); }
.btn-line:hover { border-color: var(--muted); }
.btn-line.danger:hover { color: var(--down); border-color: var(--down); }
.btn-icon { width: 36px; padding: 0; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; height: 42px; }
.btn-lg .i { transition: transform .2s; } .btn-lg:hover .i { transform: translateX(3px); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.link { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 13px; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

input, select { font: 14px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--rule-2); border-radius: 9px; height: 38px; padding: 0 12px; outline: none; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
input[type=datetime-local] { font: 12px var(--mono); padding: 0 8px; }
input[type=range] { height: 22px; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--muted); display: flex; justify-content: space-between; }
.field > span b { color: var(--ink); font-weight: 500; }
.field-row { display: flex; gap: 8px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); }
.seg button { border: 0; background: none; color: var(--muted); font: 500 12.5px var(--sans); padding: 5px 12px; border-radius: 7px; cursor: pointer; transition: color .15s, background .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--rule); }
.seg-full { display: flex; } .seg-full button { flex: 1; padding: 6px 0; }
.toggle { display: flex; align-items: center; gap: 11px; cursor: pointer; font-weight: 500; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { width: 38px; height: 22px; border-radius: 99px; background: var(--rule-2); position: relative; transition: background .2s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .22s cubic-bezier(.3,.7,.3,1); box-shadow: 0 1px 2px rgb(0 0 0 / .25); }
.toggle input:checked + i { background: var(--warn); }
.toggle input:checked + i::after { transform: translateX(16px); }
.toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 color-mix(in oklab, var(--up) 60%, transparent); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; font: 500 12px var(--mono); padding: 2px 7px 2px 4px; border-radius: 6px; background: color-mix(in oklab, currentColor 10%, transparent); }
.chip .i { width: 13px; height: 13px; stroke-width: 2.4; }
.chip.flat { padding-left: 7px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--rule-2); color: var(--muted); white-space: nowrap; }
.status .i { width: 13px; height: 13px; }
.status.on { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 45%, transparent); background: color-mix(in oklab, var(--warn) 9%, transparent); }
.status.wait { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, transparent); }

/* ================= App ================= */
.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--rule); display: flex; flex-direction: column; min-height: 0; }
.side > .wordmark { padding: 20px 18px 18px; }
.side-nav { padding: 0 10px 8px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.side-nav a:hover { color: var(--ink); background: var(--surface-2); }
.side-nav a.on { color: var(--ink); background: var(--surface-2); }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 20px; font-size: 12px; font-weight: 500; color: var(--muted); }
.side-label em { font-style: normal; color: var(--faint); margin-left: 4px; font-family: var(--mono); font-size: 11px; }
.watchlist { flex: 1; overflow-y: auto; padding: 0 10px 10px; }
.wl-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; transition: background .15s; }
.wl-row:hover { background: var(--surface-2); }
.wl-row.on { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--rule-2); }
.wl-row img { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); }
.wl-row b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-row small { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--faint); }
.wl-row small .i { width: 12px; height: 12px; color: var(--warn); }
.wl-num { text-align: right; }
.wl-num b { font: 500 13px var(--mono); }
.wl-num span { font: 500 11px var(--mono); }
.wl-empty { padding: 12px 10px; color: var(--faint); font-size: 13px; line-height: 1.6; }
.side-user { border-top: 1px solid var(--rule); padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 10px; }
.side-user img { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); }
.side-user div { flex: 1; min-width: 0; line-height: 1.3; }
.side-user b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--faint); font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: 60px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--rule); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs span { color: var(--faint); }
.topbar-r { display: flex; align-items: center; gap: 18px; }
.live-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.search-btn { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 8px 0 11px; border: 1px solid var(--rule-2); border-radius: 9px; background: var(--surface); color: var(--faint); font: 13px var(--sans); cursor: pointer; min-width: 220px; transition: border-color .15s; }
.search-btn:hover { border-color: var(--muted); color: var(--muted); }
.search-btn span { flex: 1; text-align: left; }
.view { flex: 1; overflow-y: auto; padding: 28px; }
.view > * { max-width: 1320px; margin-left: auto; margin-right: auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font: 400 40px/1.05 var(--serif); letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.hint { font-size: 12px; color: var(--faint); }
.note { padding: 14px 20px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--faint); }
.cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-top: 16px; }

.hero-card { padding: 4px 0 8px; }
.metrics { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.metric { padding: 20px 22px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.metric:first-child { border-left: 0; }
.metric > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.metric b { font: 500 26px/1.15 var(--mono); letter-spacing: -.03em; }
.metric.main b { font-size: 44px; }
.metric em { font-style: normal; font-size: 12.5px; }
.chart-wrap { padding: 4px 20px 6px; }
.chart-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 2px 8px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); }
.chart-title b { font-weight: 500; color: var(--ink-2); }
.chart-title.sub { border-top: 0; padding-top: 10px; padding-bottom: 2px; }
.card-head + .chart-wrap .chart-box:first-child { margin-top: 2px; }
.chart-box { position: relative; height: 300px; }
.chart-box.small { height: 84px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { white-space: nowrap; text-align: left; font-weight: 500; font-size: 12px; color: var(--faint); padding: 0 20px 10px; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 11px 20px; border-bottom: 1px solid var(--rule); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .12s; } .tbl tbody tr:hover { background: var(--surface-2); }
.tbl .r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl .nm { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.tbl .nm img { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); }
.tbl .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

.heatmap { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 20px; min-height: 230px; align-content: stretch; }
.heat { flex: 1 1 130px; min-height: 86px; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); border: 1px solid color-mix(in oklab, var(--ink) 6%, transparent); transition: transform .15s; }
.heat:hover { transform: translateY(-1px); }
.heat b { font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat span { font: 500 18px var(--mono); letter-spacing: -.02em; }
.heat small { font: 11.5px var(--mono); color: var(--ink-2); }
.heat-legend { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; font: 11px var(--mono); color: var(--faint); }
.heat-legend i { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, color-mix(in oklab, var(--down) 75%, var(--surface-2)), var(--surface-2)); }
.heat-legend i.pos { background: linear-gradient(90deg, var(--surface-2), color-mix(in oklab, var(--up) 75%, var(--surface-2))); }

.empty { max-width: 620px; margin: 6vh auto; padding: 48px 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.empty .ch-num { font: 500 12px var(--mono); color: var(--accent); }
.empty h2 { font: 400 40px/1.05 var(--serif); }
.empty p { color: var(--muted); font-size: 15px; line-height: 1.6; margin-bottom: 10px; }

/* page jeu */
.g-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: 20px; align-items: center; margin-bottom: 18px; }
.g-head img { width: 64px; height: 64px; border-radius: 15px; background: var(--surface-2); box-shadow: var(--shadow); }
.g-title { min-width: 0; }
.g-title h1 { font: 400 38px/1.05 var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-title .page-sub { font-size: 11.5px; margin-top: 6px; }
.g-price { text-align: right; }
.g-price b { display: block; font: 500 38px/1 var(--mono); letter-spacing: -.035em; }
.g-price em { font-style: normal; display: inline-block; margin-top: 6px; }
.g-actions { display: flex; gap: 8px; }
.strip { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.strip div { padding: 13px 18px; border-left: 1px solid var(--rule); }
.strip div:first-child { border-left: 0; padding-left: 0; }
.strip span { display: block; font-size: 12px; color: var(--muted); }
.strip b { font: 500 16px var(--mono); }
.g-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.g-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side-col { position: sticky; top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--rule); }
.stat-grid div { padding: 14px 20px; border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat-grid div:nth-child(4n+1) { border-left: 0; }
.stat-grid div:nth-last-child(-n+4) { border-bottom: 0; }
.stat-grid span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.stat-grid b { font: 500 18px var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.stat-grid b small { font-size: 12px; color: var(--faint); }
.log { list-style: none; margin: 0; padding: 0 8px 8px; max-height: 280px; overflow-y: auto; }
.log li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.log li:hover { background: var(--surface-2); }
.log li > i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule-2); color: var(--muted); }
.log li > i .i { width: 13px; height: 13px; }
.log li.ev-cooldown > i { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 45%, transparent); }
.log li.ev-normal > i, .log li.ev-link > i { color: var(--up); border-color: color-mix(in oklab, var(--up) 45%, transparent); }
.name-preview { margin: -6px 0 0; font-size: 12px; color: var(--muted); min-height: 1em; }
.name-preview b { color: var(--ink); font-weight: 500; }
.countdown .links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.countdown.manual { flex-direction: column; align-items: flex-start; gap: 2px; color: var(--ink-2); background: color-mix(in oklab, var(--accent) 8%, var(--surface-2)); }
.log li.ev-manual > i { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.log li.ev-update > i { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.log li.ev-record > i { color: var(--up); border-color: color-mix(in oklab, var(--up) 45%, transparent); }
.log li.ev-drop > i { color: var(--down); border-color: color-mix(in oklab, var(--down) 45%, transparent); }
.log li.ev-error > i { color: var(--down); border-color: color-mix(in oklab, var(--down) 45%, transparent); }
.log li.ev-error > span { color: var(--down); }
.log time { font: 11.5px var(--mono); color: var(--faint); }
.log .empty-log { display: block; color: var(--faint); padding: 6px 12px 12px; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 2px 20px 16px; }
.previews figure { margin: 0; }
.previews canvas { width: 100%; aspect-ratio: 1; border-radius: 22%; background: var(--surface-2); display: block; box-shadow: var(--shadow); }
.previews figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }
.countdown { margin: 0 20px; padding: 11px 14px; border-radius: 10px; background: var(--surface-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.countdown b { font: 500 16px var(--mono); color: var(--ink); letter-spacing: -.02em; }
.countdown.err-box { color: var(--down); justify-content: flex-start; background: color-mix(in oklab, var(--down) 8%, transparent); }
.form { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.file { cursor: pointer; }

/* dialogues */
.dlg { background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-radius: 16px; padding: 22px; width: min(500px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45); }
.dlg::backdrop { background: rgb(15 14 12 / .45); backdrop-filter: blur(3px); }
.dlg[open] { animation: pop .2s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-head h2 { font: 400 28px/1.1 var(--serif); }
.dlg-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.label { font-size: 12px; font-weight: 500; color: var(--muted); margin: 20px 0 8px; }
.auth-list { display: flex; flex-direction: column; gap: 6px; max-height: 250px; overflow-y: auto; }
.auth-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; color: var(--ink); padding: 11px 13px; font: 500 13.5px var(--sans); cursor: pointer; text-align: left; transition: border-color .15s; }
.auth-list button:hover:not(:disabled) { border-color: var(--ink); }
.auth-list button:disabled { opacity: .5; cursor: default; }
.auth-list small { font: 12px var(--mono); color: var(--muted); }
.add-row { display: flex; gap: 8px; margin-bottom: 4px; }
.palette { padding: 0; width: min(580px, calc(100vw - 32px)); margin-top: 13vh; overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--rule); color: var(--faint); }
.pal-in input, .pal-in input:focus { border: 0; background: none; height: 56px; font-size: 16px; padding: 0; box-shadow: none; outline: none; }
#pal-list { list-style: none; margin: 0; padding: 8px; max-height: 340px; overflow-y: auto; }
#pal-list li { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
#pal-list li img, #pal-list li .pi { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
#pal-list li span { flex: 1; }
#pal-list li small { font: 12px var(--mono); color: var(--faint); }
#pal-list li.sel { background: var(--surface-2); }
#pal-list .pal-sec { font-size: 11.5px; color: var(--faint); padding: 10px 10px 4px; cursor: default; }
.pal-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--faint); }
.pal-foot kbd { margin-right: 2px; }

/* robux */
.sales-top { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.sales-top div { padding: 14px 20px; border-left: 1px solid var(--rule); }
.sales-top div:first-child { border-left: 0; }
.sales-top span { display: block; font-size: 12px; color: var(--muted); }
.sales-top b { font: 500 22px var(--mono); letter-spacing: -.02em; }
.sales-top b small { font-size: 13px; color: var(--faint); margin-left: 4px; }
.head-l { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-r { display: flex; align-items: center; gap: 6px; }
.script-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.script-st i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.script-st.on { color: var(--up); } .script-st.on i { background: var(--up); }
.icon-btn.spin .i { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ok-line { display: flex; align-items: center; gap: 7px; color: var(--up); font-weight: 600; margin-bottom: 4px; }
.tips { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.sales-total { background: var(--surface-2); }
.sales-total em { display: block; font-style: normal; font-size: 11px; color: var(--faint); margin-top: 2px; }
.devex-head { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.sales-top .seg-mini { display: inline-flex; }
.seg-mini { padding: 2px; border-radius: 7px; background: var(--surface); }
.seg-mini button { padding: 1px 7px; font-size: 10.5px; border-radius: 5px; }
.products { list-style: none; margin: 0; padding: 4px 20px 16px; }
.products li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.products li:last-child { border-bottom: 0; }
.products li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.products li em { font-style: normal; font-size: 11.5px; color: var(--faint); }
.products li b { font: 500 13px var(--mono); }
.bar-in { height: 4px; border-radius: 2px; background: var(--rule); margin-top: 6px; overflow: hidden; }
.bar-in i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.blank { padding: 6px 20px 22px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.blank .btn { margin-top: 12px; }

/* quand tes joueurs sont là */
.when { padding: 2px 20px 18px; }
.when-grid { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; font: 10px var(--mono); color: var(--faint); }
.when-grid i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.when-grid i.best { outline: 2px solid var(--ink); outline-offset: -1px; }
.when-grid span { display: flex; align-items: center; }
.when-grid .h { text-align: center; display: block; }
.when-rec { margin-top: 14px; font-size: 13.5px; color: var(--ink-2); display: flex; gap: 10px; align-items: flex-start; }
.when-rec .i { color: var(--accent); margin-top: 2px; }
.when-rec b { font-weight: 600; color: var(--ink); }

/* mises à jour */
.updates { list-style: none; margin: 0; padding: 0 8px 10px; }
.updates li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; font-size: 13px; }
.updates li > i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule-2); color: var(--accent); }
.updates li > i .i { width: 13px; height: 13px; }
.updates small { display: block; font-size: 11.5px; color: var(--faint); }
.updates .empty-log { display: block; color: var(--faint); padding: 6px 12px 12px; }
.updates .pending { font-size: 12px; color: var(--faint); }

/* dialogue de suivi */
.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.warn-box { display: flex; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: color-mix(in oklab, var(--warn) 10%, transparent); color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.warn-box .i { color: var(--warn); margin-top: 2px; }
.setup { margin: 16px 0 12px; padding-left: 20px; font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }
.code { position: relative; }
.code .btn { position: absolute; top: 10px; right: 10px; }
.code pre { margin: 0; max-height: 300px; overflow: auto; padding: 16px; border-radius: 10px; background: #16140f; color: #e8e3d8; font: 12px/1.6 var(--mono); white-space: pre; }
.fine { font-size: 12px; color: var(--faint); margin-top: 12px; line-height: 1.6; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--btn-ink); color: var(--btn-ink-text); border-radius: 11px; box-shadow: 0 16px 40px -10px rgb(0 0 0 / .4); font-size: 13.5px; max-width: 380px; animation: toast-in .3s cubic-bezier(.2,.8,.2,1); pointer-events: auto; }
.toast.error .i { color: var(--down); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--rule), var(--surface-2)); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 9px; }
@keyframes sk { to { background-position: -200% 0; } }
.view > .page-head, .view > #ov-body, .view > .g-head, .view > .strip, .view > .g-grid { animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1200px) {
  .g-grid { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .side { border-right: 0; border-bottom: 1px solid var(--rule); }
  .watchlist { max-height: 230px; }
  .side-user { display: none; }
  .topbar { padding: 0 16px; }
  .search-btn { min-width: 0; } .search-btn span, .search-btn kbd, .live-status span { display: none; }
  .view { padding: 18px 16px; }
  .page-head h1, .g-title h1, .empty h2 { font-size: 32px; }
  .metric.main b { font-size: 34px; }
  .g-head { grid-template-columns: auto 1fr; }
  .g-price { text-align: left; grid-column: 1 / -1; }
  .g-actions { grid-column: 1 / -1; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .strip div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid div:nth-child(4n+1) { border-left: 1px solid var(--rule); }
  .stat-grid div:nth-child(odd) { border-left: 0; }
  .stat-grid div:nth-last-child(-n+4) { border-bottom: 1px solid var(--rule); }
  .stat-grid div:nth-last-child(-n+2) { border-bottom: 0; }
  .chart-box { height: 240px; }
  .sales-top b { font-size: 17px; }
  .when-grid { grid-template-columns: 28px repeat(24, 1fr); gap: 1px; font-size: 8px; }
  .tbl th:nth-child(2), .tbl td:nth-child(2), .tbl th:nth-child(4), .tbl td:nth-child(4) { display: none; }
  .tbl th, .tbl td { padding-left: 14px; padding-right: 14px; }
}
