/* =====================================================================
   Thème macOS (Sonoma) — clair / sombre selon le système, ou forcé.
   Chargé après app.css : redéfinit les couleurs et l'allure des composants.
   ===================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* clair */
  --bg: #f5f5f7;
  --win: #ffffff;
  --side: rgba(236, 236, 241, .72);
  --side-solid: #ececf1;
  --glass: #ffffff;
  --glass2: rgba(0, 0, 0, .045);
  --field: #ffffff;
  --line: rgba(0, 0, 0, .1);
  --hair: rgba(0, 0, 0, .08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --tertiary: #aeaeb2;
  --accent: #007aff;
  --accent2: #007aff;
  --accent-soft: rgba(0, 122, 255, .12);
  --sel: rgba(0, 0, 0, .075);
  --ok: #34c759;
  --warn: #ff9500;
  --bad: #ff3b30;
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .06);
  --win-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 22px 70px rgba(0, 0, 0, .25);
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1c1e; --win: #1e1e1e; --side: rgba(40, 40, 44, .72); --side-solid: #2a2a2e;
    --glass: #2c2c2e; --glass2: rgba(255, 255, 255, .07); --field: rgba(255, 255, 255, .06);
    --line: rgba(255, 255, 255, .11); --hair: rgba(255, 255, 255, .08);
    --text: #f5f5f7; --muted: #98989d; --tertiary: #636366;
    --accent: #0a84ff; --accent2: #0a84ff; --accent-soft: rgba(10, 132, 255, .2); --sel: rgba(255, 255, 255, .1);
    --ok: #30d158; --warn: #ff9f0a; --bad: #ff453a;
    --shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 1px 3px rgba(0, 0, 0, .3);
    --win-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 22px 70px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1c1e; --win: #1e1e1e; --side: rgba(40, 40, 44, .72); --side-solid: #2a2a2e;
  --glass: #2c2c2e; --glass2: rgba(255, 255, 255, .07); --field: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .11); --hair: rgba(255, 255, 255, .08);
  --text: #f5f5f7; --muted: #98989d; --tertiary: #636366;
  --accent: #0a84ff; --accent2: #0a84ff; --accent-soft: rgba(10, 132, 255, .2); --sel: rgba(255, 255, 255, .1);
  --ok: #30d158; --warn: #ff9f0a; --bad: #ff453a;
  --shadow: 0 0 0 .5px rgba(255, 255, 255, .08), 0 1px 3px rgba(0, 0, 0, .3);
  --win-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 22px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
body {
  font: 13px/1.45 var(--font); color: var(--text); letter-spacing: -.003em;
  background: var(--bg); background-image: none; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -.012em; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code { font-family: var(--mono); font-size: 12px; background: var(--glass2); padding: 1px 5px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: rgba(128, 128, 128, .45) transparent; }
main { animation: none; }

/* ---------- Fenêtre (grands écrans : une vraie fenêtre posée sur un fond d'écran) ---------- */
@media (min-width: 1100px) {
  body {
    background: radial-gradient(1200px 800px at 15% 10%, #7cb6ff 0%, transparent 60%),
      radial-gradient(1000px 700px at 90% 90%, #c58bff 0%, transparent 55%),
      linear-gradient(135deg, #5b8def, #9d6bd8 60%, #e18fb8);
    background-attachment: fixed; min-height: 100vh;
  }
  :root[data-theme="dark"] body { background: radial-gradient(1200px 800px at 15% 10%, #1f3a6b 0%, transparent 60%), radial-gradient(1000px 700px at 90% 90%, #3e2466 0%, transparent 55%), linear-gradient(135deg, #0f1c36, #221537 60%, #331a2b); background-attachment: fixed; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { background: radial-gradient(1200px 800px at 15% 10%, #1f3a6b 0%, transparent 60%), radial-gradient(1000px 700px at 90% 90%, #3e2466 0%, transparent 55%), linear-gradient(135deg, #0f1c36, #221537 60%, #331a2b); background-attachment: fixed; } }
  .shell {
    position: fixed; inset: 28px 34px; border-radius: 12px; overflow: hidden; box-shadow: var(--win-shadow);
    background: var(--win); grid-template-columns: 236px 1fr; min-height: 0;
  }
  .shell.zoomed { inset: 0; border-radius: 0; }
  .shell main { overflow-y: auto; height: 100%; }
}
@media (max-width: 1099px) { .shell { background: var(--win); } }

/* Barre latérale translucide façon Finder */
.side {
  position: relative; top: auto; height: 100%; min-height: 100vh;
  background: var(--side); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-right: .5px solid var(--line); padding: 0 10px 12px; gap: 1px; overflow-y: auto;
}
@media (min-width: 1100px) { .side { min-height: 0; } }
.traffic { display: flex; gap: 8px; padding: 18px 10px 14px; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); cursor: default; display: grid; place-items: center; font-size: 8.5px; font-style: normal; color: transparent; font-weight: 700; line-height: 1; }
.traffic i:nth-child(1) { background: #ff5f57; } .traffic i:nth-child(2) { background: #febc2e; } .traffic i:nth-child(3) { background: #28c840; cursor: pointer; }
.traffic:hover i:nth-child(1) { color: #820005; } .traffic:hover i:nth-child(2) { color: #985700; } .traffic:hover i:nth-child(3) { color: #006500; }
.shell:not(:focus-within) .traffic.blur i { background: var(--tertiary); }
.brand { padding: 2px 8px 14px; gap: 9px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; background: linear-gradient(180deg, #5ac8fa, #007aff); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.brand b { font-size: 13px; font-weight: 600; font-family: var(--font); }
.brand span { font-size: 11px; }
.navsep { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); opacity: .85; padding: 14px 10px 4px; }
.nav { padding: 5px 10px; border-radius: 6px; gap: 9px; font-weight: 400; font-size: 13px; color: var(--text); }
.nav svg { width: 17px; height: 17px; color: var(--accent); }
.nav:hover { background: transparent; color: var(--text); }
.nav.on { background: var(--sel); color: var(--text); box-shadow: none; font-weight: 500; }
.status-pill { font-size: 11px; padding: 8px 10px 0; }
.dot { width: 7px; height: 7px; box-shadow: none; }

/* Barre d'outils : le titre de chaque page devient une barre collante translucide */
main { padding: 0 28px 48px; background: var(--win); }
.head {
  position: sticky; top: 0; z-index: 20; margin: 0 -28px 18px; padding: 12px 28px; min-height: 52px;
  background: color-mix(in srgb, var(--win) 80%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line);
}
.head h1 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.head .sub { font-size: 11.5px; margin-top: 0; }
.head .btn { padding: 4px 10px; font-size: 12.5px; }

/* ---------- Composants ---------- */
.card { background: var(--glass); border: 0; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; backdrop-filter: none; }
.card h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.grid { gap: 14px; }

.btn {
  border-radius: 6px; padding: 5px 12px; font-size: 13px; font-weight: 400; border: 0;
  background: var(--glass); color: var(--text); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18), 0 .5px 1.5px rgba(0, 0, 0, .12);
  transition: filter .12s;
}
:root[data-theme="dark"] .btn, .btn { }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { background: rgba(255, 255, 255, .13); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .06), 0 .5px 1px rgba(0, 0, 0, .3); } }
:root[data-theme="dark"] .btn { background: rgba(255, 255, 255, .13); box-shadow: 0 0 0 .5px rgba(255, 255, 255, .06), 0 .5px 1px rgba(0, 0, 0, .3); }
.btn:hover { background: var(--glass); filter: brightness(.97); }
.btn:active { transform: none; filter: brightness(.9); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); color: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 122, 255, .3); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--glass); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.icon { padding: 5px 7px; }

.input {
  background: var(--field); border: 0; border-radius: 6px; padding: 6px 9px; font-size: 13px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), inset 0 .5px 1px rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .input { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .15); } }
:root[data-theme="dark"] .input { box-shadow: 0 0 0 .5px rgba(255, 255, 255, .15); }
.input:focus { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 45%, transparent); border: 0; }
label.field { font-size: 12px; color: var(--text); gap: 5px; margin-bottom: 12px; font-weight: 500; }
select.input { appearance: auto; }

/* Interrupteur Apple */
.switch { width: 38px; height: 22px; }
.switch span { background: rgba(120, 120, 128, .32); }
.switch span::after { width: 18px; height: 18px; left: 2px; top: 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 0 0 .5px rgba(0, 0, 0, .04); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }

/* Contrôle segmenté */
.seg { background: rgba(118, 118, 128, .14); border: 0; border-radius: 7px; padding: 2px; gap: 0; }
.seg button { padding: 3px 12px; border-radius: 5px; font-size: 12.5px; color: var(--text); font-weight: 400; }
.seg button.on { background: var(--win); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); font-weight: 500; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }
:root[data-theme="dark"] .seg button.on { background: #636366; }

.chip { border: 0; background: rgba(118, 118, 128, .12); color: var(--text); padding: 4px 11px; font-size: 12px; }
.chip:hover { color: var(--text); background: rgba(118, 118, 128, .2); }
.chip.on { background: var(--accent); color: #fff; }
.chip .n { opacity: .7; }

.setrow { border-bottom: .5px solid var(--hair); padding: 10px 0; }
.bar { height: 6px; background: rgba(118, 118, 128, .18); }
.bar i { background: var(--accent); }
.addr { background: rgba(118, 118, 128, .1); border-radius: 7px; font-family: var(--mono); font-size: 12px; padding: 7px 10px; }
.tip { background: color-mix(in srgb, var(--warn) 12%, transparent); border: 0; border-radius: 9px; font-size: 12.5px; box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--warn) 35%, transparent); }
.tip.info { background: var(--accent-soft); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--accent) 30%, transparent); }
.empty { color: var(--muted); }
.empty h3 { font-size: 15px; }
.spin { border-color: rgba(128, 128, 128, .25); border-top-color: var(--muted); }
.log { border: 0; box-shadow: var(--shadow); border-radius: 9px; background: var(--glass); }
.log-r { border-bottom: .5px solid var(--hair); font-size: 12px; }
.bt-tab th { font-size: 11.5px; }
.bt-tab td, .bt-tab th { border-bottom: .5px solid var(--hair); }

/* Tuiles d'accueil façon widgets */
.hero { background: var(--glass); box-shadow: var(--shadow); }
.hero-t { font-size: 15px; }
.qtile { background: var(--glass); border: 0; box-shadow: var(--shadow); border-radius: 12px; }
.qtile::before { display: none; }
.qtile .qi { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--c) 22%, transparent); margin-bottom: 8px; }
.qtile b { font-size: 13px; font-family: var(--font); font-weight: 600; }
.qtile:hover { transform: none; filter: brightness(.98); }
.stat .v, .bx-value b { font-family: var(--display); }
.spark i { background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0; }
.pulse { width: 10px; height: 10px; }

/* Feuilles modales (sheet macOS) */
.modal-bg { background: rgba(0, 0, 0, .25); backdrop-filter: none; align-items: start; padding-top: 8vh; }
.modal {
  background: color-mix(in srgb, var(--win) 92%, transparent); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 0; border-radius: 12px; box-shadow: var(--win-shadow); padding: 20px; animation: sheet .22s cubic-bezier(.2, .9, .3, 1);
}
@keyframes sheet { from { transform: translateY(-14px) scale(.98); opacity: 0; } }
.modal h2 { font-size: 15px; font-weight: 700; }
.modal p { font-size: 12.5px; }
.modal .actions .btn { min-width: 76px; }

/* Notification façon Centre de notifications */
.toast {
  top: 14px; right: 16px; left: auto; transform: translateX(120%); max-width: 340px;
  background: color-mix(in srgb, var(--win) 80%, transparent); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 0; border-radius: 14px; box-shadow: var(--win-shadow); font-size: 13px; padding: 12px 16px; color: var(--text);
}
.toast.on { transform: translateX(0); }
.toast.bad { box-shadow: var(--win-shadow), inset 3px 0 0 var(--bad); }

/* Menus contextuels */
.pop { background: color-mix(in srgb, var(--win) 80%, transparent); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 0; border-radius: 9px; padding: 5px; box-shadow: var(--win-shadow); min-width: 200px; }
.pop button { border-radius: 5px; padding: 5px 10px; font-size: 13px; }
.pop button:hover { background: var(--accent); color: #fff; }
.pop hr { border-top: .5px solid var(--line); margin: 4px 6px; }
.mv-list { border: 0; box-shadow: var(--shadow); border-radius: 8px; }
.mv-list button { border-bottom: .5px solid var(--hair); padding: 8px 12px; }
.mv-list button:hover { background: var(--accent); color: #fff; }

/* Photos / fichiers */
.month { background: linear-gradient(var(--win) 70%, transparent); font-size: 15px; font-weight: 700; }
.ph { border-radius: 4px; background: rgba(118, 118, 128, .12); }
.fi { background: transparent; border: 0; border-radius: 8px; }
.fi:hover { background: rgba(118, 118, 128, .1); border: 0; }
.fi.picked { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.fgrid.list { border: 0; box-shadow: var(--shadow); background: var(--glass); border-radius: 9px; }
.fgrid.list .fi { border-bottom: .5px solid var(--hair); border-radius: 0; }
.fgrid.list .fi:nth-child(even) { background: rgba(118, 118, 128, .05); }
.crumbs button { font-size: 13px; }
.selbar { background: color-mix(in srgb, var(--win) 82%, transparent); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); border: 0; box-shadow: var(--win-shadow); border-radius: 12px; }
.uploads { background: color-mix(in srgb, var(--win) 85%, transparent); backdrop-filter: blur(30px); border: 0; box-shadow: var(--win-shadow); border-radius: 12px; }
.drop { background: color-mix(in srgb, var(--win) 70%, transparent); }
.drop div { border: 2px dashed var(--accent); color: var(--accent); font-size: 17px; font-weight: 600; }

/* Jeux / outils / caméra / bourse */
.game-banner { border-radius: 0; }
.act { background: rgba(118, 118, 128, .08); border: 0; border-radius: 10px; }
.act:hover { border: 0; background: rgba(118, 118, 128, .14); }
.clip { background: rgba(118, 118, 128, .08); border: 0; }
.sp-t, .sec-stats > div { background: rgba(118, 118, 128, .08); border: 0; border-radius: 9px; }
.gauge .g-v { fill: var(--text); } .gauge .g-l { fill: var(--accent); }
.cam-frame { border: 0; border-radius: 10px; box-shadow: var(--shadow); }
.badge-st { background: rgba(118, 118, 128, .14); }

/* Connexion : fenêtre de verrouillage */
.login .card { max-width: 340px; padding: 28px 26px; border-radius: 14px; box-shadow: var(--win-shadow); background: color-mix(in srgb, var(--win) 88%, transparent); backdrop-filter: saturate(180%) blur(30px); }
.login .logo { width: 64px; height: 64px; border-radius: 15px; background: linear-gradient(180deg, #5ac8fa, #007aff); box-shadow: 0 4px 14px rgba(0, 122, 255, .35); }
.login h1 { font-size: 20px; }
.login p { font-size: 12.5px; }
.login .btn { padding: 7px; }
.or { font-size: 11px; }

/* ---------- Mobile : barre d'onglets iOS ---------- */
@media (max-width: 820px) {
  main { padding: 0 16px 96px; }
  .head { margin: 0 -16px 14px; padding: 10px 16px; }
  .head h1 { font-size: 22px; }
  .tabbar { background: color-mix(in srgb, var(--win) 80%, transparent); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); border-top: .5px solid var(--line); }
  .tabbar .nav { color: var(--muted); font-size: 10px; background: none; }
  .tabbar .nav svg { color: inherit; width: 22px; height: 22px; }
  .tabbar .nav.on { color: var(--accent); background: none; }
  .sheet { background: var(--win); border-top: 0; box-shadow: var(--win-shadow); }
  .sheet-item { background: rgba(118, 118, 128, .08); border: 0; font-weight: 500; }
  .sheet-item svg { color: var(--accent); }
  .sheet-item.on { background: var(--accent-soft); }
  .toast { left: 12px; right: 12px; max-width: none; transform: translateY(-150%); }
  .toast.on { transform: translateY(0); }
}

/* Barre latérale compacte (pastille jaune) : icônes seules */
.shell.nosidebar { grid-template-columns: 64px 1fr; }
.shell.nosidebar .side { padding: 0 8px 12px; }
.shell.nosidebar .traffic { flex-direction: column; align-items: center; gap: 7px; padding: 16px 0 10px; }
.shell.nosidebar .brand div:last-child, .shell.nosidebar .nav span, .shell.nosidebar .navsep, .shell.nosidebar #livetxt { display: none; }
.shell.nosidebar .brand { justify-content: center; padding: 2px 0 12px; }
.shell.nosidebar .nav { justify-content: center; padding: 7px 0; }
.shell.nosidebar .status-pill { justify-content: center; }

/* Correctifs : boutons bleus en sombre, grilles à 2 colonnes, segments sur une ligne */
:root[data-theme="dark"] .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); color: #fff; } }
:root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] .btn.ghost { color: inherit; }
:root[data-theme="dark"] .btn.danger { color: var(--bad); }
:root[data-theme="dark"] .btn.ghost { background: transparent; box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.ghost { background: transparent; box-shadow: none; } :root:not([data-theme="light"]) .btn.danger { color: var(--bad); } }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.seg { flex-wrap: nowrap; white-space: nowrap; }
.qgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Barre de sélection (Photos / Fichiers) : vraiment cachée hors sélection */
.selbar { visibility: hidden; opacity: 0; pointer-events: none; transform: translate(-50%, 16px);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1), opacity .18s, visibility 0s .22s; }
.selbar.on { visibility: visible; opacity: 1; pointer-events: auto; transform: translate(-50%, 0); transition: transform .22s cubic-bezier(.2, .9, .3, 1), opacity .18s; }
.selbar b { font-size: 13px; font-weight: 600; }
@media (min-width: 1100px) { .selbar { bottom: 52px; } }

/* Mobile : comme Photos sur iPhone, la barre d'actions REMPLACE la barre d'onglets pendant la sélection */
@media (max-width: 820px) {
  .tabbar { transition: transform .22s cubic-bezier(.2, .9, .3, 1); }
  body.selecting .tabbar { transform: translateY(110%); }
  .selbar {
    left: 0; right: 0; bottom: 0; transform: translateY(100%); max-width: none; border-radius: 0; opacity: 1;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); justify-content: space-between; gap: 2px; overflow: visible;
    border-top: .5px solid var(--line); box-shadow: none;
  }
  .selbar.on { transform: translateY(0); }
  .selbar b { flex: 1; text-align: center; order: 0; margin: 0; font-size: 13px; white-space: nowrap; }
  .selbar .btn { background: transparent; box-shadow: none; padding: 8px 9px; color: var(--accent); }
  .selbar .btn.danger { color: var(--bad); }
  .selbar .btn svg { width: 22px; height: 22px; }
  .selbar .btn[data-a="close"] { display: none; }
  .selbar .btn[data-a="x"] { color: var(--muted); }
  .selbar .btn:disabled { opacity: .3; }
  body.selecting main { padding-bottom: 90px; }
  .uploads { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Sélection de photos façon Apple : cercle vide → cercle bleu coché + contour bleu */
.ph .sel { width: 22px; height: 22px; left: auto; right: 6px; top: auto; bottom: 6px; border: 1.5px solid #fff; background: rgba(0, 0, 0, .18); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.ph .sel svg { opacity: 0; transition: opacity .12s; }
.ph.picked .sel { background: var(--accent); border-color: #fff; }
.ph.picked .sel svg { opacity: 1; }
.ph.picked { background: transparent; }
.ph.picked img { transform: none; border-radius: 0; opacity: .82; }
.ph.picked::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--accent); border-radius: inherit; pointer-events: none; }
.selecting .ph:hover img { transform: none; }
.ph .badge { right: auto; left: 6px; }

/* ---------- Minecraft ---------- */
.badge-st.warn { background: rgba(251, 191, 36, .16); color: #d97706; }
.mc-console { background: #1e1e1e; color: #d4d4d4; font: 11.5px/1.5 var(--mono); border-radius: 8px; padding: 10px 12px; margin: 12px 0 10px;
  height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.mc-hero .addr { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (max-width: 700px) { .mc-console { height: 260px; font-size: 10.5px; } #mc-pf { flex-wrap: wrap !important; } }
.g3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.mc-guard { margin-top: 14px; }
.mc-guard.tripped { box-shadow: 0 0 0 2px rgba(255, 59, 48, .55); }
/* Processeur / Wi-Fi en direct (accueil) */
.live { margin-top: 16px; display: grid; gap: 10px; }
.live-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-row > div { display: flex; flex-direction: column; min-width: 0; }
.live-row b { font-family: var(--display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.live-row .spark { width: 45%; max-width: 180px; height: 30px; flex: none; }
.pz-watch { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line, rgba(128,128,128,.2)); }
.pz-w { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; align-items: flex-start; }
.pz-w > div { min-width: 0; }
.pz-px { white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
/* ---------- Assistant ---------- */
.as-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; }
@media (max-width: 800px) { .as-grid { grid-template-columns: 1fr; } }
.as-chat { display: flex; flex-direction: column; gap: 10px; min-height: 460px; }
.as-log { flex: 1; display: flex; flex-direction: column; gap: 8px; overflow: auto; max-height: 58vh; padding: 4px; }
.as-m { max-width: 82%; padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.as-m.me { align-self: flex-end; background: var(--accent, #0a84ff); color: #fff; border-bottom-right-radius: 4px; }
.as-m.bot { align-self: flex-start; background: rgba(118, 118, 128, .16); border-bottom-left-radius: 4px; }
.as-m.wait { opacity: .6; font-style: italic; }
.as-m.err { background: rgba(255, 59, 48, .14); }
.as-m span { display: block; font-size: 11px; opacity: .6; margin-top: 3px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid rgba(128, 128, 128, .3); background: none; color: inherit; border-radius: 99px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.chip:hover { background: rgba(118, 118, 128, .12); }
/* ---------- Gestionnaire de tâches ---------- */
.live-row.clickable { cursor: pointer; border-radius: 8px; margin: -4px -6px; padding: 4px 6px; }
.live-row.clickable:hover { background: rgba(118, 118, 128, .1); }
.live-row .link { color: var(--accent, #0a84ff); }
.modal.tasks { width: 100%; max-width: 760px; max-height: 86vh; overflow: auto; background: var(--win); }
.tk-head, .tk-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px 84px; gap: 10px; align-items: center; }
.tk-row { padding: 8px 0; border-top: 1px solid rgba(128, 128, 128, .15); }
.tk-name { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tk-name > div { min-width: 0; }
.tk-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-ic { font-size: 20px; flex: none; }
.tk-num { font-variant-numeric: tabular-nums; font-size: 13px; }
.tk-bar { height: 4px; border-radius: 2px; background: rgba(128, 128, 128, .2); margin-top: 4px; overflow: hidden; }
.tk-bar i { display: block; height: 100%; background: var(--accent, #0a84ff); }
@media (max-width: 600px) {
  .tk-head { display: none; }
  .tk-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .tk-row > div:nth-child(3) { grid-column: 2; }
  .tk-row > div:last-child { grid-column: 1 / -1; }
  .tk-row > div:last-child .btn { width: 100%; }
}
/* ---------- Musique ---------- */
.mu-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 12px; border: 2px dashed rgba(128, 128, 128, .35); border-radius: 12px; cursor: pointer; text-align: center; transition: .15s; }
.mu-drop > div { font-size: 30px; }
.mu-drop:hover, .mu-drop.over { border-color: var(--accent, #0a84ff); background: rgba(10, 132, 255, .06); }
.mu-hero .addr { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* IA Bourse */
.ia-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.ia-big span { font-size: 17px; font-weight: 600; margin-left: 6px; }
.ia-up { color: var(--ok); } .ia-down { color: var(--bad); }
.ia-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.ia-steps > div { background: var(--field); border-radius: 10px; padding: 9px 11px; }
.ia-steps b { display: block; margin-bottom: 2px; }
.ia-chart { width: 100%; height: auto; margin-top: 6px; }
.ia-chart text { font-size: 10px; fill: var(--muted); }
.ia-chart .ia-grid { stroke: var(--line); stroke-width: 1; }
.ia-l-a { stroke: #818cf8; stroke-width: 2; } .ia-l-u { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ia-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.ia-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.ia-k-a { background: #818cf8; } .ia-k-u { background: var(--muted); }
.ia-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ia-chip { background: var(--field); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12px; font-weight: 600; }
.ia-chip b { display: inline-block; min-width: 20px; text-align: center; margin-right: 5px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 10px; padding: 1px 4px; }
.ia-pos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ia-pos > div { display: flex; flex-direction: column; background: var(--field); border-radius: 9px; padding: 6px 9px; font-size: 12px; }
.ia-log { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.ia-sec { font-size: 18px; margin: 26px 0 10px; scroll-margin-top: 80px; }
.pz-all { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 760px) { .pz-all { grid-template-columns: repeat(2, 1fr); } }
.pz-sum { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer; font: inherit; color: inherit; padding: 12px 14px; }
.pz-sum:hover { outline: 2px solid var(--accent-soft); }
.pz-sum-v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Page Bourse : onglets + vue d'ensemble */
.bz-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: none; }
.bz-tabs button { flex: none; border: 0; background: var(--field); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer; }
.bz-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.pz-all { display: block; margin-bottom: 14px; }
.bz-total { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.bz-total > div { display: flex; flex-direction: column; margin-right: auto; }
.bz-total b { font-size: 26px; font-variant-numeric: tabular-nums; }
.bz-total > span:nth-child(2) { font-size: 18px; font-weight: 700; }
.bz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.bz-card { display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 0; }
.bz-card:hover { outline: 2px solid var(--accent-soft); }
.bz-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.bz-rule { min-height: 2.6em; }
.bz-val { display: flex; align-items: baseline; gap: 8px; }
.bz-val b { font-size: 22px; font-variant-numeric: tabular-nums; }
.bz-val span { font-weight: 700; }
.bz-spark { width: 100%; height: 36px; }
.bz-spark-empty { height: 36px; display: flex; align-items: center; }
.bz-more { color: var(--accent); margin-top: 2px; }
#pz.bz-single .pz-profiles { grid-template-columns: 1fr; }
@media (max-width: 760px) { .bz-grid { grid-template-columns: 1fr 1fr; } .bz-rule { min-height: 0; } }
[data-bz][hidden] { display: none !important; }
.cfo-sec { display: grid; grid-template-columns: 1fr minmax(260px, 420px); gap: 12px; align-items: center; margin-top: 14px; }
@media (max-width: 760px) { .cfo-sec { grid-template-columns: 1fr; } }
.fan-seg { margin-top: 6px; } .fan-seg button { padding: 3px 10px; font-size: 12px; }
/* Test du refroidissement */
.ct-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.ct-now > div { background: var(--field); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.ct-now b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ct-chart { width: 100%; height: auto; margin: 6px 0; }
.ct-chart text { font-size: 11px; fill: var(--muted); }
.ct-grid { stroke: var(--line); }
.ct-fan { fill: rgba(10, 132, 255, .12); }
.ct-lbl { fill: #0a84ff !important; }
.ct-res { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--field); margin-top: 6px; }
.ct-res b { font-size: 20px; } .ct-res.ok b { color: var(--ok); }

/* Memecoins : 3 versions côte à côte */
.meme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.meme-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meme-col h3 { margin: 8px 0 0; font-size: 14px; }
.meme-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line, rgba(128,128,128,.2)); font-size: 13px; }
.meme-row > span:last-child { text-align: right; white-space: nowrap; }
.meme-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { .meme-grid { grid-template-columns: 1fr; } }

/* Chercheur : console en direct */
.rs-live { background: #0b0f14; border-radius: 10px; overflow: hidden; margin: 6px 0 4px; border: 1px solid rgba(255,255,255,.08); }
.rs-live-head { padding: 7px 10px; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: #9fb3c8; border-bottom: 1px solid rgba(255,255,255,.08); }
.rs-live-lines { height: 260px; overflow-y: auto; padding: 6px 10px; font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #d7e3ee; }
.rs-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-l time { color: #5f7890; margin-right: 6px; }
.rs-l b { color: #fff; }
.rs-neg { color: #8a9aab; }
.rs-best { color: #4ade80; }
.rs-best b { color: #4ade80; }
.rs-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; margin-right: 4px; animation: rsPulse 1.2s infinite; }
@keyframes rsPulse { 50% { opacity: .3; } }
@media (max-width: 760px) { .rs-l { white-space: normal; } .rs-live-lines { height: 320px; } }

/* Page Chercheur */
.ch-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ch-stats .card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; }
.ch-stats b { font-size: 18px; }
.ch-console .rs-live-lines { height: calc(100vh - 330px); min-height: 280px; }
.ch-best-only .rs-l:not(.rs-best) { display: none; }
.rs-tag { display: inline-block; padding: 0 5px; border-radius: 4px; background: rgba(96,165,250,.18); color: #93c5fd; font-size: 10.5px; }

/* Turbo : 4 livres, décomposition prix / frais / net */
.turbo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.turbo-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.turbo-col h3 { margin: 8px 0 0; font-size: 14px; }
.turbo-rate b { font-size: 20px; }
.turbo-split { display: flex; flex-direction: column; gap: 3px; }
.turbo-split > div { display: flex; justify-content: space-between; gap: 8px; }
.turbo-bar { height: 6px; border-radius: 3px; background: rgba(48, 209, 88, .35); overflow: hidden; }
.turbo-bar i { display: block; height: 100%; background: #ff453a; }
@media (max-width: 1250px) { .turbo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .turbo-grid { grid-template-columns: 1fr; } }

/* Page Santé : courbes */
.sc-t { fill: var(--muted, #9c95b8); font-size: 10px; }
.sc-g { stroke: rgba(128, 128, 128, .18); stroke-width: 1; }
.sc-line { stroke: #fb7185; stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.sc-down { fill: rgba(255, 69, 58, .28); }

/* Page Journal : page blanche façon document Word (A4) */
.jr-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.jr-paper { background: #fff !important; color: #222 !important; max-width: 794px; padding: 52px clamp(22px, 5vw, 76px); box-shadow: 0 2px 18px rgba(0, 0, 0, .35); border-radius: 3px;
  font: 15.5px/1.6 Calibri, Carlito, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; }
.jr-paper p, .jr-paper li { margin: 0 0 9px; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.jr-paper ul { margin: 0 0 9px; padding-left: 22px; }
.jr-paper .jr-title { font: 300 34px/1.15 'Calibri Light', Calibri, Carlito, 'Helvetica Neue', Arial, sans-serif; color: #1f3864; margin: 4px 0 18px; padding-bottom: 8px; border-bottom: 2px solid #2f5496; }
.jr-paper .jr-h1, .jr-paper .jr-h2 { font: 300 22px/1.25 'Calibri Light', Calibri, Carlito, 'Helvetica Neue', Arial, sans-serif; color: #2f5496; margin: 24px 0 6px; }
.jr-paper .jr-h2 { font-size: 18px; }
.jr-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; font-style: italic; color: #595959; margin-bottom: 4px; }
.jr-meta .btn { font-style: normal; font-size: 12px; padding: 5px 10px; }
.jr-fig { margin: 14px 0; text-align: center; }
.jr-fig img { max-width: 100%; max-height: 360px; border-radius: 2px; }
.jr-fig figcaption { font-size: 11px; color: #7f7f7f; margin-top: 4px; font-style: italic; }
.jr-note { margin-top: 26px; font-size: 11.5px; font-style: italic; color: #7f7f7f; }
@media (max-width: 900px) { .jr-wrap { grid-template-columns: 1fr; } .jr-paper { padding: 26px 22px; } }

.jr-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 13px; text-align: left; }
.jr-table th { font-weight: 600; color: #2f5496; border-bottom: 2px solid #2f5496; padding: 5px 6px; }
.jr-table td { padding: 4px 6px; border-bottom: 1px solid #e5e5e5; }
.jr-table .jr-grp td { background: #eef2fa; font-weight: 600; color: #1f3864; }

/* Journal : onglets et réglages */
.jr-tabs { margin-bottom: 12px; flex-wrap: wrap; }
.jr-status { min-height: 18px; margin: 4px 0 6px; color: #7f7f7f; }
.jr-settings { max-width: 760px; }
.jr-det { border-top: 1px solid var(--line); padding: 12px 0; }
.jr-det:first-of-type { border-top: 0; padding-top: 0; }
.jr-det > summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; }
.jr-det > summary::-webkit-details-marker { display: none; }
.jr-det > summary::after { content: '\203A'; transition: transform .15s; font-size: 20px; line-height: 1; }
.jr-det[open] > summary::after { transform: rotate(90deg); }
.jr-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 10px; }
.jr-days label { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.jr-days .input { max-width: 92px; padding: 5px 6px; }
.jr-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 10px; }
.jr-keyrow { padding: 6px 0; }

.jr-paper .btn { background: #f3f4f6 !important; color: #1f2937 !important; border: 1px solid #d1d5db !important; box-shadow: none !important; }
.jr-paper .btn.primary { background: #2f5496 !important; color: #fff !important; border-color: #2f5496 !important; }
.jr-paper .btn:hover { background: #e5e7eb !important; }
.jr-paper .btn.primary:hover { background: #1f3864 !important; }
.jr-paper .muted { color: #6b7280 !important; }
@media (max-width: 1100px) { .jr-paper p, .jr-paper li { text-align: left; hyphens: manual; -webkit-hyphens: manual; } }
.jr-wide { max-width: 980px; }
.jr-scroll { overflow-x: auto; }
.jr-table td, .jr-table th { white-space: nowrap; }
.jr-table td:first-child { white-space: normal; }
.jr-paper .input { background: #fff; color: #1f2937; border: 1px solid #d1d5db; border-radius: 8px; }
.jr-audio { margin: 4px 0 14px; padding: 10px 12px; background: #f3f4f6; border-radius: 8px; }
.jr-audio audio { margin-top: 2px; }

/* Page ESP32 */
.es-state { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.es-big { font-size: 38px; font-weight: 700; line-height: 1.1; }
.es-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; }
.es-facts > div { display: flex; flex-direction: column; gap: 2px; }
.es-page { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-top: 1px solid var(--line); }
.es-gifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.es-gif { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.es-gif.on { border-color: #34d399; box-shadow: 0 0 0 1px #34d399 inset; }
.es-gif img { width: 100%; aspect-ratio: 5 / 4; object-fit: contain; background: #000; border-radius: 6px; margin-bottom: 4px; }
@media (max-width: 760px) { .es-state { grid-template-columns: 1fr; } }
.es-play { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }

/* Navigation tactile et accueil : mêmes couleurs et composants macOS. */
.sheet { max-height:calc(100dvh - 20px); display:flex;flex-direction:column;overflow:hidden; }
.sheet-head { display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:4px 4px 12px; }
.sheet-head h2 { margin:0;font-size:19px; }
.sheet-links { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:2px 2px 8px; }
.sheet-links .navsep { grid-column:1/-1; }
.sheet-item { min-height:48px; color:var(--text); text-align:left;touch-action:manipulation; }
.sheet-item > svg { pointer-events:none;flex-shrink:0; }
.sheet-bg:not(.on) { pointer-events:none; }
.nav,.qtile,.sheet-item { -webkit-tap-highlight-color:transparent; }
.nav:focus-visible,.sheet-item:focus-visible,.qtile:focus-visible { outline:3px solid var(--accent);outline-offset:2px; }
.home-services-head { display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:24px 0 12px; }
.home-services-head h2 { font-size:19px;margin:0; }
.qtile { min-height:126px;text-align:left; }
button.live-row { width:100%;border:0;background:transparent;font:inherit;color:inherit;text-align:left; }
@media(max-width:820px) { .tabbar .nav { min-height:48px; } .home-services-head { align-items:flex-start;flex-direction:column;gap:4px; } .qtile { min-height:112px; } }

/* Le menu défile sans comprimer ses boutons au moment d’un appui. */
.side > .nav,.side > .navsep,.side > .brand,.side > .traffic,.side > .status-pill { flex-shrink:0; }
.side > .nav { min-height:38px;position:relative; }
.side > .grow { min-height:12px; }

/* Mascotte de l’assistant : rendu local, mêmes cartes et couleurs que le serveur. */
.as-presence { display:flex; align-items:center; gap:16px; border-bottom:1px solid var(--border,rgba(118,118,128,.16)); padding-bottom:12px; }
.as-presence h2 { margin:0 0 6px; font-size:18px; }
.as-presence p { margin:0; }
.as-mascot { width:180px; height:180px; flex-shrink:0; position:relative; }
.as-mascot canvas, .as-mascot img { width:100%; height:100%; display:block; object-fit:contain; border-radius:16px; }
.as-mascot [hidden] { display:none; }
@media (max-width:500px) { .as-mascot { width:130px; height:130px; } .as-presence { gap:10px; } }

/* Pronote and speech input use the server's existing theme. */
.pronote-frame{display:block;width:100%;height:calc(100dvh - 165px);min-height:520px;border:0;border-radius:10px;background:var(--win)}
#as-talk[aria-pressed="true"]{background:var(--bad);color:#fff;border-color:var(--bad)}
.as-mic-note{margin:8px 0 14px;line-height:1.5}
@media(max-width:600px){#as-form{flex-wrap:wrap!important}#as-form input{flex-basis:100%!important}.pronote-frame{height:calc(100dvh - 180px);min-height:450px}}
