/* IRON — identité tirée du logo : noir du contour, bleu de l'affiche, lettres blanches penchées.
   L'angle des lettres (56,85° → inclinaison de 33,15°) sert de motif : indicateurs d'onglet, barres.
   Mise en page : application mobile d'abord (barre d'onglets en bas), barre latérale à partir de 900 px. */
:root {
  --iron-blue: #5376D2;
  --iron-black: #000000;
  --bg: #000000;
  --surface: #14161B;
  --surface-2: #1E2128;
  --ink: #FFFFFF;
  --muted: #9CA2B0;
  --line: #2A2E37;
  --accent: var(--iron-blue);
  --accent-ink: #000000;
  --accent-text: color-mix(in srgb, var(--accent) 52%, white);
  --accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  --good: #45C98C;
  --warn: #F2B33D;
  --bad: #FF6B5E;
  --good-soft: color-mix(in srgb, var(--good) 15%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 16%, transparent);
  --bad-soft: color-mix(in srgb, var(--bad) 15%, transparent);
  /* couleurs réelles des disques olympiques (calcul des charges uniquement) */
  --plate-25: #D2232A;
  --plate-20: #1F4FD1;
  --plate-15: #E8B10A;
  --plate-10: #1E9E4A;
  --plate-5: #DADBD8;
  --plate-small: #8E949B;
  --bar: #8C939C;
  --slant: -33.15deg;
  --font-display: "Chakra Petch", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --r-sm: 10px;
  --nav-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.num { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-style: italic; font-weight: 700; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.label { font-size: 14px; font-weight: 600; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 22px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .grid3.collapse { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- Logo ---------- */
.iron-logo { display: block; height: auto; }
.iron-logo path { fill: #FFFFFF; }
.iron-logo.sticker path { stroke: #000000; stroke-linejoin: round; paint-order: stroke; }

/* ---------- Démarrage ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 22px; justify-items: center; background: var(--bg); }
.boot .iron-logo { width: min(58vw, 260px); }
.boot-bar { width: 132px; height: 6px; background: var(--surface-2); overflow: hidden; transform: skewX(var(--slant)); }
.boot-bar::after { content: ""; display: block; width: 38%; height: 100%; background: var(--iron-blue); animation: sweep 1.1s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes sweep { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Coque de l'application ---------- */
.shell { min-height: 100vh; display: flex; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 20px); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.topbar-inner {
  max-width: 920px; margin: 0 auto; min-height: 58px; display: flex; align-items: center; gap: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar h1 { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 25px; text-transform: uppercase; line-height: 1.05; letter-spacing: .01em; }
.topbar .sub { font-size: 13.5px; color: var(--muted); }
.page {
  max-width: 920px; margin: 0 auto; padding-block: 8px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
.page.narrow { max-width: 560px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar-inner { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; max-width: 640px; margin: 0 auto; height: var(--nav-h); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; position: relative;
}
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { color: var(--accent-text); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 32%; right: 32%; height: 4px; background: var(--accent); transform: skewX(var(--slant)); }
.badge-dot {
  position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center;
}

@media (min-width: 900px) {
  .side {
    display: flex; flex-direction: column; gap: 4px; width: 236px; flex: none; padding: 26px 14px;
    position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: var(--bg);
  }
  .side .brand { padding: 0 12px 26px; }
  .side a {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 10px;
    color: var(--muted); text-decoration: none; font-weight: 600; position: relative;
  }
  .side a:hover { background: var(--surface); color: var(--ink); }
  .side a[aria-current="page"] { background: var(--surface); color: var(--ink); }
  .side a[aria-current="page"]::before { content: ""; position: absolute; left: 4px; top: 24%; bottom: 24%; width: 4px; background: var(--accent); transform: skewX(var(--slant)); }
  .side a[aria-current="page"] svg { color: var(--accent-text); }
  .side .badge-dot { position: static; margin-left: auto; }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.brand .iron-logo { width: 116px; }
.brand-name { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 16px; min-width: 0; }
.card.flat { background: transparent; border: 1px solid var(--line); }
.card.tight { padding: 12px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-head h2 { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: .02em; }
.list { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-width: 0;
  text-decoration: none; color: inherit; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
button.item:hover, a.item:hover { background: var(--surface-2); }
.item .title { font-weight: 600; }
.divider { height: 1px; background: var(--line); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); transition: transform .08s ease, filter .15s ease; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--accent-text); padding: 0 10px; }
.btn.danger { background: var(--bad); color: #000; }
.btn.small { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn.big {
  min-height: 56px; border-radius: 14px; font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: 18px; text-transform: uppercase; letter-spacing: .03em;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex: none;
  border: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.icon-btn.filled { background: var(--surface); border: 1px solid var(--line); }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 16px; outline: none; transition: border-color .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.num { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; padding: 6px 4px; }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; }
.seg button {
  flex: 1; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 14.5px; color: var(--muted); white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale button {
  min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 20px;
}
.scale button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--surface-2); position: relative; cursor: pointer; flex: none; border: 1px solid var(--line); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(20px); background: #000; }
.error { color: var(--bad); font-size: 14.5px; font-weight: 600; }

/* ---------- Pastilles ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; }

/* ---------- Onglets internes ---------- */
.subtabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-inline: -4px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a, .subtabs button {
  padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 700; white-space: nowrap; border: 0; background: none;
  margin-bottom: -1px; cursor: pointer; font-size: 15.5px; position: relative;
}
.subtabs [aria-current="page"] { color: var(--ink); }
.subtabs [aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 4px; background: var(--accent); transform: skewX(var(--slant)); }

/* ---------- Chiffres ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.stat .v { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.big-num { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Feuille (bottom sheet) ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .66); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line);
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: rise .2s ease;
}
.sheet .list, .sheet .card { background: var(--surface-2); }
.sheet .list .input, .sheet .card .input { background: var(--surface); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 23px; text-transform: uppercase; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 22px; border: 1px solid var(--line); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: .6; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  background: var(--ink); color: #000; padding: 11px 16px; border-radius: 12px; font-weight: 600;
  max-width: calc(100vw - 32px); animation: rise .2s ease;
}
.toast.bad { background: var(--bad); color: #000; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Vide ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 18px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 17px; }
.empty .plate-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--accent-text); }

/* ---------- Connexion, inscription, formulaire public : l'affiche ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; background: var(--iron-blue); overflow: hidden; }
.auth.loading-page { place-items: center; grid-template-rows: 1fr; }
.auth-poster {
  position: relative; display: grid; place-items: center; min-height: 31vh;
  padding: calc(34px + env(safe-area-inset-top, 0px)) 24px 46px;
}
.auth-poster::before {
  content: ""; position: absolute; width: max(150vw, 760px); aspect-ratio: 1; border-radius: 50%; background: #000;
  right: 32%; bottom: 30%;
}
.auth-poster .iron-logo { position: relative; width: min(80vw, 430px); transform: rotate(-3deg); }
.auth-panel {
  position: relative; background: var(--bg); border-radius: 28px 28px 0 0; margin-top: -20px;
  padding: 30px max(20px, env(safe-area-inset-right, 0px)) calc(30px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.auth-card.wide { max-width: 560px; }
.auth-hero { display: flex; flex-direction: column; gap: 8px; }
.auth-hero h1 { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 40px; line-height: .98; text-transform: uppercase; }
.auth-hero .eyebrow { font-weight: 600; color: var(--accent-text); }
@media (min-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1.1fr) minmax(460px, 1fr); grid-template-rows: none; }
  .auth-poster { min-height: 100vh; position: sticky; top: 0; padding: 48px; }
  /* même composition que sur téléphone : disque noir dans le coin, logo entier sur le bleu */
  .auth-poster::before { width: 150vh; right: 45%; bottom: 52%; }
  .auth-poster .iron-logo { width: min(40vw, 560px); }
  .auth-panel { border-radius: 0; margin-top: 0; display: grid; align-content: center; padding: 56px 48px; }
}

/* ---------- Séance ---------- */
.ex-head { display: flex; align-items: flex-start; gap: 12px; }
.ex-index { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 34px; line-height: .9; color: var(--accent-text); min-width: 32px; }
.ex-name { font-weight: 700; font-size: 18.5px; line-height: 1.25; }
.target { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.sets { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 52px; gap: 8px; align-items: center; }
.set-row .n { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 20px; color: var(--muted); text-align: center; }
.set-row.done .input { background: var(--accent-soft); border-color: transparent; }
.check {
  width: 52px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.set-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 52px; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; }
.hintbar { display: flex; flex-wrap: wrap; gap: 6px; }
.rest-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--accent); color: var(--accent-ink);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.rest-inner { max-width: 620px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.rest-time { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: 42px; line-height: 1; font-variant-numeric: tabular-nums; min-width: 96px; }
.rest-bar .btn { background: #000; color: #fff; }
.rest-bar .btn.secondary { background: transparent; color: #000; border-color: rgb(0 0 0 / .4); }
.rest-track { height: 5px; background: rgb(0 0 0 / .2); overflow: hidden; margin-top: 7px; transform: skewX(var(--slant)); }
.rest-track i { display: block; height: 100%; background: #000; transition: width 1s linear; }

/* Barre chargée (calcul des disques) */
.barbell { display: flex; align-items: center; height: 70px; overflow-x: auto; }
.barbell .shaft { height: 8px; background: var(--bar); border-radius: 2px; flex: none; }
.barbell .sleeve { height: 14px; width: 14px; background: var(--bar); border-radius: 2px; flex: none; }
.barbell .plate { flex: none; border-radius: 3px; margin-right: 2px; border: 1px solid rgb(0 0 0 / .3); }
.barbell .collar { width: 6px; height: 22px; background: var(--muted); border-radius: 2px; flex: none; }

/* ---------- Graphique ---------- */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11.5px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }

/* ---------- Messages ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 18px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble.me a { color: inherit; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble video, .bubble img { border-radius: 12px; max-height: 320px; margin-top: 4px; }
.chat-time { font-size: 11.5px; color: var(--muted); align-self: center; margin: 8px 0 2px; }
.composer {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 10; background: var(--bg);
  padding-block: 8px; display: flex; gap: 8px; align-items: flex-end;
}
.composer textarea { min-height: 48px; max-height: 140px; resize: none; }
@media (min-width: 900px) { .composer { bottom: 0; } }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid .ph { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; max-width: 100%; }
.photo-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid .ph span { position: absolute; left: 6px; bottom: 6px; background: rgb(0 0 0 / .65); color: #fff; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; }
.video-box { border-radius: 12px; overflow: hidden; background: #000; max-width: 100%; border: 1px solid var(--line); }
.video-box video { width: 100%; max-height: 420px; }

/* ---------- Tableau ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 6px 8px; }
table.t td { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t input.input { min-height: 38px; padding: 6px 8px; font-size: 15px; }

/* ---------- Divers ---------- */
.week-dots { display: flex; gap: 7px; }
.week-dots i { width: 22px; height: 26px; border: 2px solid var(--line); display: block; transform: skewX(var(--slant)); border-radius: 3px; }
.week-dots i.on { background: var(--accent); border-color: var(--accent); }
.attention { box-shadow: inset 4px 0 0 var(--accent); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.copy-field { display: flex; gap: 8px; align-items: stretch; }
.copy-field .input { font-size: 14px; }
.macro-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.macro-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.kpi-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.kpi-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.loading { display: grid; place-items: center; padding: 40px; }
.callout { background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; }
.callout.warn { background: var(--warn-soft); }
.callout.bad { background: var(--bad-soft); }
.offline-banner { background: var(--warn); color: #000; text-align: center; font-size: 13.5px; font-weight: 700; padding: 6px 12px; }
