@charset "utf-8";
/* Layout : coque d'application sur une colonne de téléphone. Zone de contenu défilante,
   barre d'onglets fixe en bas. Dans l'onglet Réglage, l'écran de résultat reste collé en haut. */
:root {
  --bg: #edf0f3;
  --surface: #ffffff;
  --ink: #16202b;
  --muted: #586675;
  --line: #d2d9e1;
  --accent: #c8500f;
  --accent-soft: #fbe6d8;
  --screen-bg: #17212c;
  --screen-fg: #f1f4f7;
  --screen-muted: #9fb0c0;
  --screen-line: #2f3d4b;
  --ok: #1c7d45;
  --ok-soft: #dcf1e4;
  --warn: #9a6400;
  --warn-soft: #fbeccb;
  --bad: #bf2626;
  --bad-soft: #fbdede;
  --info: #2a5f9e;
  --info-soft: #dde9f7;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-num: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161c; --surface: #19212a; --ink: #e5eaef; --muted: #94a2b0; --line: #2b3541;
    --accent: #ff8f45; --accent-soft: #3a2415;
    --screen-bg: #0a0e12; --screen-fg: #f1f4f7; --screen-muted: #8fa0b0; --screen-line: #26313c;
    --ok: #53c684; --ok-soft: #14301f; --warn: #e6b548; --warn-soft: #35290d;
    --bad: #ff7373; --bad-soft: #3b1717; --info: #7db2ee; --info-soft: #14273d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161c; --surface: #19212a; --ink: #e5eaef; --muted: #94a2b0; --line: #2b3541;
  --accent: #ff8f45; --accent-soft: #3a2415;
  --screen-bg: #0a0e12; --screen-fg: #f1f4f7; --screen-muted: #8fa0b0; --screen-line: #26313c;
  --ok: #53c684; --ok-soft: #14301f; --warn: #e6b548; --warn-soft: #35290d;
  --bad: #ff7373; --bad-soft: #3b1717; --info: #7db2ee; --info-soft: #14273d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.4; overflow: hidden; }
h2 { font-size: 20px; margin: 14px 0 2px; text-wrap: balance; }
h3 { font-size: 15px; margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.panes { flex: 1; min-height: 0; }
.pane { height: 100%; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sub { color: var(--muted); font-size: 13px; }

/* Onglets */
.tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-top: 3px solid transparent; padding: 11px 2px 12px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.tabs button[aria-current="page"] { color: var(--accent); border-top-color: var(--accent); }

/* Écran de résultat : sombre dans les deux thèmes, comme l'écran d'une box */
.screen { position: sticky; top: 0; z-index: 2; margin: 0 -16px; padding: 12px 16px 10px; background: var(--screen-bg); color: var(--screen-fg); display: flex; flex-direction: column; gap: 10px; flex: none; }
.screen-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.watt-wrap { min-width: 0; }
.watt { font-family: var(--f-num); font-weight: 700; font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.watt small { font-size: 18px; font-weight: 600; color: var(--screen-muted); margin-left: 4px; letter-spacing: 0; }
.setup { font-size: 12px; color: var(--screen-muted); margin-top: 3px; overflow-wrap: anywhere; }
.stepper { display: flex; gap: 8px; flex: none; }
.stepper button { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--screen-line); background: transparent; color: var(--screen-fg); font-size: 24px; line-height: 1; }
.stepper button:active { border-color: var(--accent); color: var(--accent); }

.gauge { display: flex; flex-direction: column; gap: 4px; }
.g-track { position: relative; height: 20px; margin-inline: 11px; background: var(--screen-line); border-radius: 3px; }
.g-band { position: absolute; top: 0; bottom: 0; background: var(--ok); opacity: 0.85; }
.g-over { position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 3px 3px 0; opacity: 0.55;
  background: repeating-linear-gradient(135deg, var(--bad) 0 4px, transparent 4px 9px); }
.g-sweet { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--screen-fg); transform: translateX(-1px); }
.g-mod { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--warn); }
.g-needle { position: absolute; top: -6px; bottom: -6px; width: 4px; background: var(--accent); border-radius: 2px; transform: translateX(-2px); box-shadow: 0 0 0 2px var(--screen-bg); }
.g-ticks { position: relative; height: 14px; margin-inline: 11px; font-family: var(--f-num); font-size: 11px; color: var(--screen-muted); }
.g-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--screen-line); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--screen-line); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 2px solid var(--screen-bg); margin-top: -9px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid var(--screen-bg); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; border-top: 1px solid var(--screen-line); padding-top: 8px; }
.stats dt { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--screen-muted); }
.stats dd { margin: 1px 0 0; font-family: var(--f-num); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Verdict */
.verdict { display: flex; flex-direction: column; gap: 6px; flex: none; padding-top: 2px; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip { border: 1px solid transparent; border-radius: 6px; padding: 5px 9px; font-size: 12px; font-weight: 600; line-height: 1.2; }
.vchip span { font-weight: 400; }
.vchip.ok { background: var(--ok-soft); color: var(--ok); }
.vchip.warn { background: var(--warn-soft); color: var(--warn); }
.vchip.bad { background: var(--bad-soft); color: var(--bad); }
.vchip.info { background: var(--info-soft); color: var(--info); }
.vchip[aria-pressed="true"] { border-color: currentColor; }
.vtext { font-size: 13px; color: var(--muted); min-height: 4.2em; }

/* Commandes */
.controls { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.full { grid-column: 1 / -1; }
label, .lab { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); min-width: 0; }
.lab { margin-bottom: 4px; }
.row3.opts { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1.3fr); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { background: none; border: 0; padding: 9px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.fits .link { display: inline; font-size: 12px; }
select, input[type="number"], input[type="text"], textarea {
  font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px; width: 100%; min-width: 0;
}
textarea { font-family: var(--f-num); font-size: 12px; resize: vertical; }
.scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.scroll::-webkit-scrollbar { display: none; }
.pick { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pick span { font-family: var(--f-num); font-size: 11px; font-weight: 400; color: var(--muted); }
.pick[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.pick.num { font-family: var(--f-num); min-width: 44px; align-items: center; padding: 9px 8px; }
.fits { font-size: 12px; color: var(--muted); }
.filters .pick { padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: 13px; }
.filters .pick[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Listes et cartes */
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; color: var(--ink); }
.item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.item b { font-size: 14px; }
.item .right { font-family: var(--f-num); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.item .small { font-size: 12px; color: var(--muted); }
.item .tag { font-family: var(--f-num); font-size: 11px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 4px; font-weight: 400; }
.item.static { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.result { font-family: var(--f-num); font-size: 13px; background: var(--bg); border-radius: 6px; padding: 10px; font-variant-numeric: tabular-nums; }
.result strong { font-size: 20px; color: var(--accent); }
.btn { background: var(--accent); color: var(--surface); border: 1px solid var(--accent); border-radius: 6px; padding: 10px; font-weight: 600; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.mini { background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 5px 9px; font-size: 12px; color: var(--ink); }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-size: 13px; align-self: flex-start; }
.tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.tips b { color: var(--ink); }
.rules { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.rules .head { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.rules input { padding: 6px; text-align: center; }
.legal { font-size: 12px; color: var(--muted); padding-bottom: 8px; }
@media (prefers-reduced-motion: no-preference) { .g-needle, .g-band { transition: left 0.12s ease, width 0.12s ease; } }
