:root {
  --bg: #0a0a0b;
  --surface: #17171a;
  --surface-2: #1e1e22;
  --surface-3: #26262b;
  --border: #2a2a2f;
  --text: #f2f2f2;
  --text-muted: #9a9aa2;
  --accent: #d9713f;
  --accent-hover: #e6825a;
  --accent-contrast: #fff;
  --badge-blue-bg: #16304f;
  --badge-blue-text: #8fc0ff;
  --danger: #ff8080;
  --ok: #8fd98f;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --sidebar-w: 4.5rem;
}

* { box-sizing: border-box; }
/* Guarantees the hidden attribute wins even against an inline display style
   (archive.html sets display:flex inline on #ready alongside `hidden`, which
   the UA stylesheet's unweighted [hidden] rule would otherwise lose to). */
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
}
button, input, select { font-family: inherit; color: inherit; }
a { color: inherit; }

#app { display: flex; flex-direction: column; height: 100%; }

/* Maintenance banner (§16-adjacent manual toggle): full-width, high-contrast,
   above the topbar so it's the first thing visible regardless of scroll
   position -- flex-shrink:0 keeps #shell from squeezing it out on short
   viewports the way the canvas area is allowed to. */
.maintenance-banner {
  flex-shrink: 0;
  padding: 0.6rem 1rem;
  text-align: center;
  font-weight: 700;
  background: #f2b705;
  color: #1a1a1a;
}

/* Topbar: brand + status pills + (desktop) donate CTA + avatar */
#topbar {
  display: flex; align-items: center; gap: 0.5rem 0.75rem; flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark {
  width: 2.1rem; height: 2.1rem; border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--accent), #b5502a);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-mark::after {
  content: ""; width: 0.7rem; height: 0.7rem; border-radius: 3px;
  border: 2px solid #fff;
}
.brand .event-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
#topbar .spacer { flex: 1; }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.75rem; border-radius: var(--radius-pill);
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.pill-muted { background: var(--surface-2); color: var(--text-muted); }
.pill-muted .dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--ok); }
#points { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
#status { font-size: 0.78rem; color: var(--text-muted); }
.pill-online-desktop { display: none; }

.btn-donate {
  display: none;
  padding: 0.5rem 1rem; border: none; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-contrast); font-weight: 600;
  cursor: pointer; font-size: 0.85rem;
}
.btn-donate:hover { background: var(--accent-hover); }

.avatar-circle {
  display: none;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--badge-blue-bg); color: var(--badge-blue-text);
  align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; letter-spacing: 0.02em;
  border: none; cursor: pointer; flex-shrink: 0;
}

/* Shell: sidebar (desktop) + main content */
#shell { display: flex; flex: 1; min-height: 0; min-width: 0; }

#sidebar-nav {
  display: none;
  flex-direction: column; align-items: center; gap: 0.4rem;
  width: var(--sidebar-w); flex-shrink: 0;
  padding: 1rem 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

#main {
  flex: 1; min-width: 0; /* flex items default to a content-based min-width;
  without this, .admin-grid's auto-fill columns grow #main (and the page)
  far past the viewport instead of wrapping to one column */
  display: flex; flex-direction: column;
}

/* Shared nav item styling; layout differs by container (bottom bar vs sidebar) */
.nav-bar { display: flex; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.5rem 0.6rem; color: var(--text-muted); text-decoration: none;
  font-size: 0.68rem; border-radius: var(--radius-sm);
}
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--surface-3); }
.nav-icon { font-size: 1.25rem; line-height: 1; }

#bottom-nav {
  display: flex; justify-content: space-around;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

/* Canvas box */
#viewport-wrap {
  flex: 1; position: relative; overflow: hidden;
  margin: 0.75rem; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--surface-2);
}
#viewport {
  display: block; cursor: crosshair; width: 100%; height: 100%;
  /* The canvas's pixel buffer is sized in CSS px (canvas.js's _resize), so
     on any display with devicePixelRatio != 1 the browser upscales the
     bitmap to fill the physical screen -- that resampling is a separate
     step from ctx.imageSmoothingEnabled (which only affects drawImage
     calls inside the canvas's own coordinate space) and defaults to
     smoothing, blurring what should be crisp pixel-art blocks. Force
     nearest-neighbor for that upscale instead. */
  image-rendering: -webkit-optimize-contrast; /* older Safari/Chromium fallback */
  image-rendering: crisp-edges; /* older Firefox fallback */
  image-rendering: pixelated; /* last = wins in modern Chromium/Firefox */
}

.canvas-overlay-top {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 2;
}

#zoom-controls {
  position: absolute; right: 0.75rem; bottom: 0.75rem;
  display: flex; flex-direction: column; gap: 0.4rem; z-index: 2;
}
/* Direct-child combinator: admin-tools-panel's own buttons (tabs, tool-btn)
   are also nested under #zoom-controls but must not pick up this square
   FAB sizing -- and #id beats .class, so a descendant selector here would
   otherwise win over their own rules regardless of source order. */
#zoom-controls > button {
  width: 2.3rem; height: 2.3rem; font-size: 1.15rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text);
}
#zoom-controls > button:hover:not(:disabled) { background: var(--surface-2); }
#zoom-controls > button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Extension tool (admin): a "+" handle centered on each edge of the
   canvas *content* itself, not the viewport -- canvas.js positions each
   one with inline left/top on every pan/zoom/resize (_updateExtendHandles)
   so it tracks the actual on-screen edge, and hides a handle outright
   once its edge has no visible overlap with the viewport. Shown only
   while the tool is active (canvas.js toggles #extend-handles' hidden
   attribute). Each shows the pending px count for its direction once set,
   e.g. "+50". */
.extend-handle {
  position: absolute; z-index: 3; cursor: pointer;
  min-width: 2.3rem; height: 2.3rem; padding: 0 0.5rem; font-size: 1.05rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-contrast);
  transform: translate(-50%, -50%);
}
.extend-handle:hover { background: var(--accent-hover); }
.extend-handle.pending { background: var(--ok); color: #0a2e0a; }

.extend-pending-list { list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.85rem; }
.extend-pending-list li { padding: 0.15rem 0; }
.extend-pending-list:empty::before { content: "Aucune extension en attente."; color: var(--text-muted); }

.admin-tools-panel {
  position: absolute; bottom: 100%; right: 0; margin-bottom: 0.5rem;
  width: 22rem; max-width: calc(100vw - 3rem);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 0.85rem; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  display: flex; flex-direction: column; gap: 0.6rem;
}
.admin-tools-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-tools-tabs button {
  flex: 1 1 auto; min-width: 4.5rem; padding: 0.4rem 0.5rem; border: none; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  font-size: 0.8rem; font-weight: 600;
}
.admin-tools-tabs button.active { background: var(--accent); color: #fff; }

/* "Peindre" category's own tab row (Pinceau/Zone), indented to read as
   nested under it rather than a sibling of the top-level tabs. */
.admin-tools-subtabs {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-left: 1rem; padding-left: 0.6rem; border-left: 2px solid var(--border);
}
.admin-tools-subtabs button {
  flex: 1 1 auto; min-width: 4rem; padding: 0.35rem 0.5rem; border: none; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  font-size: 0.78rem; font-weight: 600;
}
.admin-tools-subtabs button.active { background: var(--accent); color: #fff; }
.admin-tools-section .row {
  display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.4rem;
}
.admin-tools-section input, .admin-tools-section select {
  padding: 0.35rem 0.5rem; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
}
.admin-tools-section .tool-btn {
  padding: 0.35rem 0.7rem; border: none; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
.admin-tools-section .tool-btn.active { background: var(--accent); color: #fff; }
.admin-tools-section .tool-btn:hover { background: var(--surface-2); }
.admin-tools-section .tool-btn.active:hover { background: var(--accent-hover); }

/* HUD / drawing toolbar */
#hud {
  display: flex; flex-direction: column; gap: 0.6rem;
  margin: 0 0.75rem 0.75rem; padding: 0.6rem 0.75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.hud-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
#hud input[type=color] {
  width: 2.3rem; height: 2.3rem; border: none; background: none; padding: 0;
  border-radius: var(--radius-sm); cursor: pointer;
}
#hud input[type=text] {
  width: 6rem; font-family: ui-monospace, monospace; padding: 0.45rem 0.6rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm);
}
#target-label {
  font-size: 0.78rem; color: var(--text-muted); flex: 1; min-width: 3rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.palette-row { display: flex; gap: 0.4rem; }
.palette-swatch {
  width: 1.8rem; height: 1.8rem; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; padding: 0;
}
.palette-swatch.active { border-color: #fff; }

.place-group {
  display: flex; align-items: stretch; border-radius: var(--radius-pill);
  overflow: hidden; margin-left: auto;
}
.place-group button {
  border: none; cursor: pointer; font-weight: 700; font-size: 0.9rem;
  padding: 0.55rem 1.1rem; background: var(--accent); color: var(--accent-contrast);
}
.place-group button:hover:not(:disabled) { background: var(--accent-hover); }
.place-group button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cooldown visuel de 5s (§12, internal/redisx.rateLimitWindow) : un voile
   qui se rétracte de la droite vers la gauche par-dessus le bouton pendant
   la durée du cooldown, posé par --cooldown-duration (index.html). */
#place-btn { position: relative; overflow: hidden; }
#place-btn.cooling-down::after {
  content: ''; position: absolute; inset: 0; left: auto; width: 100%;
  background: rgba(0, 0, 0, 0.45); pointer-events: none;
  animation: place-btn-cooldown-sweep var(--cooldown-duration, 5000ms) linear forwards;
}
@keyframes place-btn-cooldown-sweep {
  from { width: 100%; }
  to { width: 0%; }
}
#cost-badge {
  display: flex; align-items: center;
  font-weight: 600; font-size: 0.8rem;
  padding: 0 0.75rem;
  background: rgba(0,0,0,0.28); color: #ffd9b0;
}

#login {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); z-index: 100;
}
#login .login-panel {
  background: var(--surface); padding: 1.75rem; border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; gap: 0.85rem; width: 90%; max-width: 22rem;
  border: 1px solid var(--border);
}
#login[hidden] { display: none; }

/* Shared full-screen overlay panels (Don / Profil / any modal-style page section) */
.overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75); z-index: 50;
}
.overlay[hidden] { display: none; }
.overlay-panel {
  background: var(--surface); padding: 1.75rem; border-radius: var(--radius-lg);
  max-width: 26rem; width: 90%; border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.85rem;
}
.overlay-panel h2 { margin: 0; }
.overlay-panel button {
  padding: 0.55rem 1.1rem; cursor: pointer; border: none; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--text); font-weight: 600;
}
.overlay-panel button:hover { background: var(--surface-2); }
.overlay-panel button.danger-btn { background: var(--danger); color: #2a0a0a; }
.overlay-panel button.danger-btn:hover { background: #ff9999; }

@media (min-width: 768px) {
  #sidebar-nav { display: flex; }
  #bottom-nav { display: none; }
  #sidebar-nav .nav-item { width: 3rem; height: 3rem; justify-content: center; }
  #sidebar-nav .nav-label { display: none; }
  #sidebar-nav .nav-icon { font-size: 1.35rem; }

  .online-pill-mobile { display: none; }
  #topbar .pill-online-desktop { display: inline-flex; }
  .btn-donate { display: inline-block; }
  .avatar-circle { display: inline-flex; }

  #hud {
    max-width: 44rem; margin: 0 auto 1rem;
    flex-direction: row; align-items: center;
  }
  /* Flatten hud-row so target-label/place-group and palette-row share one
     flex context -- as siblings of separate nested flex boxes, place-group's
     margin-left:auto pushed hud-row's own box wider than its content,
     leaving a gap before palette-row instead of after place-group. */
  .hud-row { display: contents; }
  #hud input[type=color] { order: 1; }
  #hud input[type=text] { order: 2; }
  .palette-row { order: 3; flex-wrap: nowrap; }
  #target-label { order: 4; }
  .place-group { order: 5; }
}

/* Admin dashboard (admin.html) */
.admin-main { flex: 1; overflow-y: auto; padding: 1.25rem; }
.admin-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem; max-width: 90rem; margin: 0 auto; min-width: 0; width: 100%;
  /* #main is itself a flex column (shared with index.html's layout), so this
  grid is a flex item too. Without an explicit width, the auto-fill track
  count has no definite available size to resolve against through the
  nested flex containers, and Chromium falls back to a much wider
  max-content size instead of wrapping to one column. */
}
.admin-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.1rem; min-width: 0; /* grid items default to a content-based min-width,
  which lets an unbreakable string (e.g. a backup filename) force the track wider
  than the viewport -- this is the standard CSS grid overflow fix */
}
.admin-section.span-2 { grid-column: span 1; }
@media (min-width: 900px) {
  .admin-section.span-2 { grid-column: span 2; }
}
.admin-section h2 { margin: 0 0 0.85rem; font-size: 1rem; }
/* Generic stacked-card sub-categories within one admin section (Mode
   maintenance's Utilisateur/Admin, Configuration's Points/Coût des pixels,
   Points & RGPD's own .users-subsection variant below). */
.admin-subsections { display: flex; flex-direction: column; gap: 1rem; }
.admin-subsection {
  min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.85rem;
}
.admin-subsection h3 { margin: 0 0 0.6rem; font-size: 0.9rem; }
/* Points & RGPD's two sub-blocks (joueurs connectés / recherche), same
   stacked-card treatment as maintenance's sub-categories above. */
.users-subsection {
  min-width: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1.5rem; margin-bottom: 1.75rem;
}
.users-subsection:last-child { margin-bottom: 0; }
.users-subheading { margin: 0; font-size: 1rem; flex: 1; }
/* Points & RGPD asked to feel less cramped than the other admin sections:
   looser rows, bigger text, more breathing room around the tables --
   scoped to #section-users so the rest of the panel keeps its density. */
#section-users.admin-section { padding: 1.5rem; }
#section-users .row { gap: 0.85rem; margin-bottom: 1rem; }
#section-users input, #section-users select, #section-users button {
  padding: 0.65rem 1.1rem; font-size: 0.95rem;
}
/* table-layout:fixed (inherited from .admin-section table) splits all 4
   columns evenly, which starves the actions column -- its two inputs plus
   two buttons then wrap onto a second line and blow up row height. auto
   lets ID/Points shrink to their actual (tiny) content and hands the
   freed-up width to Pseudo/Actions instead. */
#section-users table { font-size: 0.95rem; table-layout: auto; }
#section-users th, #section-users td { padding: 0.75rem 0.85rem; }
#section-users th:nth-child(1), #section-users td:nth-child(1),
#section-users th:nth-child(3), #section-users td:nth-child(3) { width: 1%; white-space: nowrap; }
/* Pseudo column was being squeezed down to almost nothing by the bigger
   row-level button/input sizing below applying inside the actions column
   too, wrapping the name one letter per line. Actions gets its own smaller
   controls so it stops eating Pseudo's space. */
#section-users td:last-child { white-space: nowrap; }
#section-users td:last-child input, #section-users td:last-child button {
  padding: 0.2rem 0.35rem; font-size: 0.68rem;
}
#section-users td:last-child > * + * { margin-left: 0.2rem; }
#section-users .anonymize-btn { background: var(--danger); color: #2a0a0a; }
#section-users .anonymize-btn:hover { background: #ff9999; }
#section-users .admin-badge {
  display: inline-block; padding: 0.2rem 0.35rem; font-size: 0.68rem; font-weight: 700;
  background: var(--accent); color: var(--accent-contrast); border-radius: var(--radius-sm);
}
#section-users .admin-log { font-size: 0.85rem; margin-top: 0.5rem; }
.admin-section .row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.admin-section input, .admin-section select {
  padding: 0.45rem 0.6rem; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
}
.admin-section button {
  padding: 0.45rem 0.9rem; cursor: pointer; border: none; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text); font-weight: 600;
}
.admin-section button:hover { background: var(--surface-2); }
.admin-section table { width: 100%; border-collapse: collapse; font-size: 0.85rem; table-layout: fixed; }
.admin-section th, .admin-section td {
  text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.admin-log { font-family: ui-monospace, monospace; font-size: 0.78rem; white-space: pre-wrap; color: var(--text-muted); max-height: 8rem; overflow-y: auto; }
.admin-log.error { color: var(--danger); }
.admin-log.ok { color: var(--ok); }
.chart-canvas { width: 100%; height: 12rem; background: var(--surface-2); border-radius: var(--radius-md); }
.metric-current { display: flex; align-items: baseline; gap: 0.5rem; margin: 0.4rem 0; }
.metric-current .metric-current-value { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.metric-current .metric-current-unit { font-size: 0.9rem; color: var(--text-muted); }
.metric-current .metric-current-desc { font-size: 0.8rem; color: var(--text-muted); }
.forbidden { padding: 3rem 1rem; text-align: center; color: var(--text-muted); }

/* Archive page (archive.html) */
.archive-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.25rem; overflow: auto; }
.archive-body img { max-width: 100%; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-md); }
#archive-scrubber { width: 100%; max-width: 40rem; }
.archive-controls { display: flex; align-items: center; gap: 0.85rem; width: 100%; max-width: 60rem; }
.archive-controls button, .archive-controls select {
  padding: 0.45rem 0.7rem; cursor: pointer; border: none; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text); font-weight: 600;
}
.archive-controls button:hover { background: var(--surface-2); }
/* Bigger track + thumb than the browser default so the scrubber is easier
   to grab and to place precisely -- the default ~4px track/12px thumb was
   fiddly to navigate on a timeline meant to be dragged often. */
.archive-controls input[type="range"] {
  flex: 1; min-width: 0; height: 1.5rem; margin: 0;
  background: transparent; appearance: none; -webkit-appearance: none;
}
.archive-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 0.6rem; border-radius: var(--radius-pill);
  background: var(--surface-3); border: 1px solid var(--border);
}
.archive-controls input[type="range"]::-moz-range-track {
  height: 0.6rem; border-radius: var(--radius-pill);
  background: var(--surface-3); border: 1px solid var(--border);
}
.archive-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 1.4rem; height: 1.4rem; border-radius: 50%; margin-top: -0.45rem;
  background: var(--accent); border: 2px solid var(--accent-contrast); cursor: pointer;
}
.archive-controls input[type="range"]::-moz-range-thumb {
  width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--accent-contrast);
  background: var(--accent); cursor: pointer;
}
.muted { color: var(--text-muted); font-size: 0.85rem; }
.maintenance-status-active { color: #15803d; font-weight: 700; }

/* Styled window.confirm() replacement (web/confirmDialog.js) */
.confirm-dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-2); color: var(--text);
  padding: 1.25rem; max-width: 26rem; width: calc(100% - 2rem);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.confirm-dialog-message { margin: 0 0 1rem; font-size: 0.9rem; line-height: 1.4; white-space: pre-wrap; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }
.confirm-dialog-actions button {
  padding: 0.45rem 0.9rem; border: none; border-radius: var(--radius-pill);
  font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.confirm-dialog-cancel { background: var(--surface-3); color: var(--text); }
.confirm-dialog-cancel:hover { background: var(--border); }
.confirm-dialog-confirm { background: var(--accent); color: var(--accent-contrast); }
.confirm-dialog-confirm:hover { background: var(--accent-hover); }
.confirm-dialog-confirm.confirm-dialog-danger { background: var(--danger); color: #2a0a0a; }

/* Legal pages (web/mentions-legales.html, cgu.html, confidentialite.html) */
.legal-page {
  max-width: 42rem; margin: 0 auto; padding: 2rem 1.25rem 4rem;
  line-height: 1.6; color: var(--text);
}
.legal-page h1 { font-size: 1.4rem; margin: 0 0 0.25rem; }
.legal-page .legal-updated { color: var(--text-muted); font-size: 0.8rem; margin: 0 0 1.5rem; }
.legal-page h2 { font-size: 1.05rem; margin: 2rem 0 0.5rem; }
.legal-page p, .legal-page li { font-size: 0.92rem; color: var(--text); }
.legal-page ul { padding-left: 1.2rem; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.85rem; }
.legal-page th, .legal-page td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
.legal-page th { color: var(--text-muted); font-weight: 600; }
.legal-page a { color: #8fc0ff; }
.legal-notice-box {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 0.9rem 1rem; margin: 0 0 1.5rem; font-size: 0.85rem; color: var(--text-muted);
}
.legal-todo {
  background: #3a2410; border: 1px solid #7a4a10; border-radius: var(--radius-md);
  padding: 0.9rem 1rem; margin: 0 0 1.5rem; font-size: 0.85rem; color: #ffcf8f;
}

/* Site footer (legal links), included on the main app pages */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: center;
  padding: 0.9rem 1rem; font-size: 0.78rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

/* Cookie banner (web/cookiebanner.js) */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 50;
  max-width: 34rem; margin: 0 auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.7rem;
  font-size: 0.85rem; color: var(--text);
}
.cookie-banner p { margin: 0; line-height: 1.5; }
.cookie-banner a { color: #8fc0ff; }
.cookie-banner-actions { display: flex; justify-content: flex-end; }
.cookie-banner-actions button {
  padding: 0.45rem 1rem; border: none; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-contrast); font-weight: 600;
  cursor: pointer; font-size: 0.85rem;
}
.cookie-banner-actions button:hover { background: var(--accent-hover); }
.confirm-dialog-confirm.confirm-dialog-danger:hover { background: #ff9999; }
