/* GarfieldFaction — système de design.
   Neutres froids très sombres, une seule couleur de marque (orange du logo), surfaces étagées,
   échelle d'espacement de 4 px, typo Geist. Les icônes d'items restent en pixel art : c'est la seule touche « jeu ». */

/* ---------------------------------------------------------------- jetons */
:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #09090b;
  --bg-side: #0c0c0f;
  --surface: #111114;
  --surface-2: #17171b;
  --surface-3: #1f1f24;
  --surface-4: #29292f;
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .11);
  --border-3: rgba(255, 255, 255, .18);

  --text: #ededf0;
  --text-2: #a5a5b0;
  --text-3: #7d7d88;

  --accent: #ff6b2c;
  --accent-hover: #ff7f47;
  --accent-fg: #1c0900;
  --accent-text: #ff9061;
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 45%, transparent);

  --ok: #3ed68e;
  --bad: #ff6262;
  --warn: #f6b443;
  --info: #5eb1ff;
  --violet: #ab8dff;
  --gold: #f6c453;
  --silver: #c9d1db;
  --bronze: #d9925b;
  --discord: #5865f2;
  --discord-hover: #4f5ae0;

  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --control: 36px;
  --side-w: 248px;
  --top-h: 56px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-pop: 0 0 0 1px var(--border-2), 0 18px 48px -12px rgba(0, 0, 0, .7), 0 4px 14px rgba(0, 0, 0, .35);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .035);

  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: var(--surface-4) transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 14px/1.55 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
  font-feature-settings: "ss01", "cv11";
}
::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); color: #fff; }
a { color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 26px; letter-spacing: -.028em; }
h2 { font-size: 18px; }
h3 { font-size: 14px; letter-spacing: -.01em; }
p { text-wrap: pretty; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; transition: color .15s; }
.link:hover { color: var(--text); }
.link .bi { font-size: 11px; transition: transform .2s var(--ease); }
.link:hover .bi { transform: translateX(2px); }
kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text-2); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- boutons */
.btn {
  --b-bg: var(--surface-2); --b-bd: var(--border-2); --b-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--control); padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font-weight: 500; font-size: 13.5px; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--highlight);
  transition: background-color .15s, border-color .15s, color .15s, transform .1s var(--ease), box-shadow .15s;
  user-select: none;
}
.btn .bi { font-size: 14px; }
.btn:hover { --b-bg: var(--surface-3); --b-bd: var(--border-3); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { --b-bg: var(--accent); --b-bd: var(--accent); --b-fg: var(--accent-fg); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .3); }
.btn-primary:hover { --b-bg: var(--accent-hover); --b-bd: var(--accent-hover); }
.btn-discord { --b-bg: var(--discord); --b-bd: var(--discord); --b-fg: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .3); }
.btn-discord:hover { --b-bg: var(--discord-hover); --b-bd: var(--discord-hover); }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); box-shadow: none; }
.btn-ghost:hover { --b-bg: var(--surface-3); --b-bd: transparent; --b-fg: var(--text); }
.btn-danger { --b-bg: transparent; --b-bd: color-mix(in oklab, var(--bad) 35%, transparent); --b-fg: var(--bad); box-shadow: none; }
.btn-danger:hover { --b-bg: color-mix(in oklab, var(--bad) 12%, transparent); --b-bd: color-mix(in oklab, var(--bad) 55%, transparent); }
.btn-danger-solid { --b-bg: var(--bad); --b-bd: var(--bad); --b-fg: #200303; font-weight: 600; }
.btn-danger-solid:hover { --b-bg: #ff7a7a; --b-bd: #ff7a7a; }
.btn-ok .bi { color: var(--ok); }
.danger-hover:hover { --b-fg: var(--bad); --b-bg: color-mix(in oklab, var(--bad) 10%, transparent); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); gap: 6px; }
.btn-sm .bi { font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 10px; gap: 9px; }
.btn-lg .bi { font-size: 17px; }
.btn-block { width: 100%; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icon-btn { width: var(--control); padding: 0; }
.icon-btn.btn-sm { width: 30px; }

/* ---------------------------------------------------------------- badges */
.badge {
  --c: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--text-2); background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px var(--border-2);
}
.badge.dotted::before, .badge:is(.accent, .ok, .bad, .warn, .info, .live):not(.count)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.badge.accent { --c: var(--accent); color: var(--text); }
.badge.ok { --c: var(--ok); }
.badge.bad { --c: var(--bad); }
.badge.warn { --c: var(--warn); }
.badge.info { --c: var(--info); }
.badge.live { --c: var(--ok); color: var(--text); }
.badge.live::before { box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 25%, transparent); animation: ping-soft 2s var(--ease) infinite; }
@keyframes ping-soft { 50% { box-shadow: 0 0 0 5px transparent; } }
.badge.count { height: 18px; min-width: 18px; padding: 0 5px; justify-content: center; font-size: 11px; font-weight: 600; color: var(--c); background: color-mix(in oklab, var(--c) 14%, transparent); box-shadow: none; }
.badge.count:is(.bad, .warn) { color: var(--c); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; }

/* ---------------------------------------------------------------- vitrine */
.landing { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; isolation: isolate; overflow-x: clip; }
.site-nav { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.02em; min-width: 0; }
.brand img { width: 28px; height: 28px; border-radius: 7px; image-rendering: pixelated; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav .grow { flex: 1; }
.site-nav .btn-ghost { --b-fg: var(--text-2); }

.land { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }
.land-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: start; padding: 64px 0 72px; }
.land-intro { display: grid; justify-items: start; padding-top: 8px; }
.land-eyebrow { margin: 0 0 14px; color: var(--accent-text); font-size: 13px; font-weight: 500; }
.land-intro h1 { margin: 0; font-size: clamp(40px, 6vw, 64px); font-weight: 700; letter-spacing: -.045em; line-height: 1; }
.land-lead { margin: 18px 0 0; max-width: 46ch; font-size: 16.5px; line-height: 1.6; color: var(--text-2); }
.land-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.land-intro .msg { margin-top: 12px; min-height: 0; }
.land-stats { display: flex; gap: 40px; margin: 44px 0 0; padding-top: 20px; border-top: 1px solid var(--border); width: 100%; max-width: 460px; }
.land-stats div { display: grid; gap: 2px; }
.land-stats dt { order: 2; font-size: 12.5px; color: var(--text-3); }
.land-stats dd { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.land-next .panel-head h2 { font-size: 14px; }
.land-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.land-h { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.land-list { border-top: 1px solid var(--border); }
.land-list .row { padding-left: 0; padding-right: 0; }
.land-pal { display: grid; border-top: 1px solid var(--border); }
.pal { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 40px; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pal-name { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pal-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); opacity: .8; }
.pal b { text-align: right; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.site-foot { margin-top: auto; border-top: 1px solid var(--border); }
.site-foot > div { max-width: 1120px; margin: 0 auto; padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 12.5px; }
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--text); }

/* écran « pas encore membre » */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(420px, 100%); text-align: center; display: grid; justify-items: center; gap: 10px; padding: 36px 28px 28px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--highlight); }
.gate-card .tile { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; margin-bottom: 8px; }
.gate-card h1 { font-size: 22px; }
.gate-card p { margin: 0 0 14px; color: var(--text-2); }
.gate-card .btn { width: 100%; }

/* ---------------------------------------------------------------- coque de l'espace membres */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg-side); border-right: 1px solid var(--border);
}
.side-top { padding: 14px 12px 8px; display: grid; gap: 12px; }
.side-top .brand { padding: 4px 6px; }
.search-btn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text-3); cursor: pointer; font-size: 13px; text-align: left; transition: border-color .15s, background-color .15s, color .15s; }
.search-btn:hover { border-color: var(--border-2); background: var(--surface-2); color: var(--text-2); }
.search-btn span { flex: 1; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 1px; overscroll-behavior: contain; }
.nav-group { font-size: 11px; font-weight: 500; color: var(--text-3); padding: 18px 10px 6px; letter-spacing: .01em; }
.nav-group:first-child { padding-top: 8px; }
.tab {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border: 0; border-radius: var(--r); background: none; color: var(--text-2); cursor: pointer;
  font-weight: 500; font-size: 13.5px; text-align: left; transition: background-color .12s, color .12s;
}
.tab span:first-of-type { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .bi { font-size: 15px; width: 18px; text-align: center; color: var(--text-3); transition: color .12s; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab:hover .bi { color: var(--text-2); }
.tab.active { color: var(--text); background: var(--surface-3); box-shadow: var(--highlight); }
.tab.active .bi { color: var(--accent); }
.side-foot { padding: 10px 12px 12px; border-top: 1px solid var(--border); position: relative; }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; cursor: pointer; border-radius: var(--r); text-align: left; transition: background-color .12s; }
.me-btn:hover, .me-btn[aria-expanded="true"] { background: var(--surface-2); }
.me-btn > span { flex: 1; min-width: 0; }
.me-btn b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn small { display: block; font-size: 12px; color: var(--text-3); }
.me-btn .bi { color: var(--text-3); font-size: 12px; }
.menu {
  position: absolute; z-index: 50; min-width: 220px; padding: 5px; border-radius: 10px;
  background: var(--surface-2); box-shadow: var(--shadow-pop);
  transform-origin: bottom left; animation: pop .16s var(--ease-out);
}
.side-foot .menu { left: 12px; right: 12px; bottom: calc(100% + 6px); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--r-sm); font-size: 13.5px; color: var(--text-2); }
.menu button .bi { font-size: 15px; width: 16px; }
.menu button:hover { background: var(--surface-3); color: var(--text); }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 5px -5px; }
.menu .danger:hover { color: var(--bad); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.97); } }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-4); flex: none; object-fit: cover; display: inline-block; box-shadow: 0 0 0 1px var(--border); }
.avatar.sm { width: 22px; height: 22px; }
.avatar.lg { width: 36px; height: 36px; }

.topbar { display: none; }
.side-backdrop { display: none; }
.main { min-width: 0; position: relative; }
.view { width: 100%; max-width: 1200px; margin: 0 auto; padding: 36px 40px 96px; }
.view.enter { animation: enter .32s var(--ease-out); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.loading-bar { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 2px; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s; }
.loading-bar::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: slide 1s var(--ease) infinite; }
body.busy .loading-bar { opacity: 1; transition-delay: .15s; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------------------------------------------------------------- en-tête de page */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head > div:first-child { min-width: 0; max-width: 100%; }
.eyebrow { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.page-head p { margin: 8px 0 0; color: var(--text-2); max-width: 68ch; }
.page-head .btn-group { flex-wrap: wrap; }

/* ---------------------------------------------------------------- panneaux */
.panel { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--highlight); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px 10px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.panel-head h2 .bi { color: var(--text-3); font-size: 14px; }
.panel-head .sub { color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.panel-head > :last-child:not(:first-child) { margin-left: auto; }
.panel-body { padding: 16px 18px; }
.panel-body.form { padding: 20px 18px; }
.panel-foot { padding: 10px 12px; border-top: 1px solid var(--border); }
.search-field { position: relative; flex: 1; max-width: 360px; }
.search-field .bi { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; pointer-events: none; }
.search-field .input { padding-left: 32px; height: 32px; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.mt { margin-top: 10px; }
.panel > .list, .panel > .feed { border: 0; }
.panel > .empty { border: 0; border-radius: 0; background: none; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.section { margin-top: 32px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: -.005em; }
.section-title .count { color: var(--text-3); font-weight: 500; }
.section-title .link { margin-left: auto; }

.home { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: 16px 18px; display: grid; gap: 10px; box-shadow: var(--highlight); min-width: 0; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.kpi-label .bi { font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: -.01em; margin-left: 4px; }
.kpi-value.ok { color: var(--ok); } .kpi-value.bad { color: var(--bad); }

/* ---------------------------------------------------------------- listes */
.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 18px; border-top: 1px solid var(--border); transition: background-color .12s; }
.list > .row:first-child, .list > :first-child > .row { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.row-text { min-width: 0; flex: 1; }
.row-text b { display: block; font-weight: 500; overflow-wrap: anywhere; color: var(--text); }
.row-text > span, .row-text > small { color: var(--text-3); font-size: 12.5px; display: block; overflow-wrap: anywhere; margin-top: 1px; }
.late { color: var(--warn); }
.row.cancelled .row-text b { text-decoration: line-through; color: var(--text-3); }
.goal-mini { display: grid; gap: 10px; width: 100%; min-width: 0; }
.goal-mini .top { display: flex; justify-content: space-between; gap: 12px; }
.goal-mini b { font-weight: 500; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.row-end { margin-left: auto; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: var(--surface-2); }
.row.picked { background: var(--accent-soft); }
button.row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; text-align: left; font: inherit; color: inherit; }

/* état vide */
.empty { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 36px 20px; color: var(--text-3); font-size: 13px; border: 1px dashed var(--border-2); border-radius: var(--r-lg); }
.empty .bi { font-size: 18px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--text-3); margin-bottom: 8px; box-shadow: inset 0 0 0 1px var(--border); }
.empty strong { color: var(--text); font-weight: 500; font-size: 14px; }
.empty.compact { padding: 22px 16px; }
.empty.compact .bi { display: none; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 13px; color: var(--text-2); border: 1px solid color-mix(in oklab, var(--c, var(--bad)) 30%, transparent); background: color-mix(in oklab, var(--c, var(--bad)) 8%, transparent); margin-bottom: 20px; }
.alert .bi { color: var(--c, var(--bad)); font-size: 16px; margin-top: 1px; }
.alert strong { color: var(--text); display: block; font-weight: 600; }
.alert.ok { --c: var(--ok); } .alert.warn { --c: var(--warn); } .alert.info { --c: var(--info); }

/* ---------------------------------------------------------------- cartes */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { position: relative; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); display: flex; flex-direction: column; box-shadow: var(--highlight); transition: border-color .15s; min-width: 0; }
.card:hover { border-color: var(--border-2); }
.card.urgent { border-color: color-mix(in oklab, var(--bad) 28%, transparent); }
.card.urgent::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bad); }
.card.flash { animation: flash 1.6s var(--ease-out); }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent); } }
.card-body { padding: 16px 18px; display: grid; gap: 14px; flex: 1; align-content: start; }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-head > div:first-of-type { flex: 1; min-width: 0; }
.card-head h3 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.card-head h3 .qty { color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.card-head .sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.card-head .btn-group { gap: 6px; flex: none; }
.card p { margin: 0; color: var(--text-2); font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--border); }
.card-foot .grow { flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-3); font-size: 12.5px; align-items: center; }
.meta > span { display: inline-flex; align-items: center; gap: 6px; }
.meta .bi { font-size: 13px; }
.meta .late { color: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.legend b { color: var(--text-2); font-weight: 500; }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* tuile d'icône */
.tile { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); font-size: 16px; }
.tile.sm { width: 32px; height: 32px; border-radius: 8px; font-size: 14px; }

/* barres de progression */
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .6s var(--ease-out); }
.bar i + i { box-shadow: inset 1px 0 0 var(--surface); }
.bar i.pending { background: color-mix(in oklab, var(--accent) 40%, var(--surface-3)); }
.bar.ok i { background: var(--ok); }
.bar.ok i.pending { background: var(--warn); }
.bar.thin { height: 4px; }
.progress-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; font-size: 13.5px; }
.progress-line > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.progress-line > span:first-child > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-line .bar { grid-column: 1 / -1; }
.progress-line .btn { grid-column: 1 / -1; justify-self: start; }
.progress-list { display: grid; gap: 16px; }
.pct { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--text); }
.ring { --p: 0; width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }

/* ---------------------------------------------------------------- icônes d'items (planche 32 px, 40 colonnes) */
.ii { --s: 24px; width: var(--s); height: var(--s); flex: none; display: inline-block; background-image: url("assets/items.png"); background-repeat: no-repeat; background-size: calc(var(--s) * 40) auto; image-rendering: pixelated; vertical-align: middle; }
.ii.none { background: var(--surface-3); border-radius: 4px; }
.ii.sm { --s: 18px; }
.ii.lg { --s: 32px; }
.ii.xl { --s: 40px; }
.tile .ii.lg { --s: 26px; }
.item-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.item-strip > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.item-strip .ii { --s: 20px; }

.picker { position: relative; }
.picker-input { position: relative; }
.picker-input .ii { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); --s: 20px; }
.picker-input .input { padding-left: 38px; }
.picker-list { position: absolute; z-index: 8; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow: auto; padding: 4px; background: var(--surface-2); border-radius: 10px; box-shadow: var(--shadow-pop); animation: pop .14s var(--ease-out); transform-origin: top; }
.picker-list button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 8px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 13.5px; border-radius: var(--r-sm); }
.picker-list button:hover, .picker-list button.on { background: var(--surface-3); }
.picker-list small { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.picker-list .more { padding: 8px 10px; color: var(--text-3); font-size: 12.5px; }

/* ---------------------------------------------------------------- événements */
.event-kind { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, var(--surface-3), var(--surface-2)); box-shadow: inset 0 0 0 1px var(--border-2), inset 0 1px 0 rgba(255, 255, 255, .05); }
.event-kind .ii { --s: 24px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5)); }
.event-kind.sm { width: 24px; height: 24px; border-radius: 6px; }
.event-kind.sm .ii { --s: 16px; }
.date-box { width: 44px; height: 44px; flex: none; display: grid; place-content: center; text-align: center; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.date-box span { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; line-height: 1; }
.date-box b { display: block; font-size: 16px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.date-box.today { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.date-box.today span { color: var(--accent-text); }
.time { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text); width: 46px; flex: none; letter-spacing: -.01em; }
.week { display: grid; gap: 24px; }
.day-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.day-head .badge { text-transform: none; }
.day-head.today { color: var(--text); }
/* agenda : grille neutre, la couleur vient des textures du jeu */
.agenda-layout { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.panel.agenda { overflow: hidden; }

.ag-next {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 22px;
  margin-bottom: 20px; padding: 22px 24px; border-radius: var(--r-xl); cursor: pointer;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border), var(--highlight);
  transition: box-shadow .2s var(--ease);
}
.ag-next:hover { box-shadow: inset 0 0 0 1px var(--border-3), var(--highlight); }
.ag-next:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ag-next-glow, .ev-glow { position: absolute; z-index: -1; pointer-events: none; }
.ag-next-glow { left: -40px; top: 50%; transform: translateY(-50%); }
.ag-next-glow .ii, .ev-glow .ii { --s: 220px; filter: blur(56px) saturate(1.3); opacity: .38; image-rendering: auto; }
.ag-next::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 14px 14px; -webkit-mask-image: linear-gradient(90deg, #000, transparent 55%); mask-image: linear-gradient(90deg, #000, transparent 55%); }
.ag-next-art { width: 84px; height: 84px; flex: none; display: grid; place-items: center; border-radius: 18px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 30px -10px rgba(0, 0, 0, .8); backdrop-filter: blur(6px); }
.ag-next-art .ii { --s: 64px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
.ag-next-text { min-width: 0; flex: 1; }
.ag-next-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.ag-next h2 { margin: 6px 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.ag-next p { margin: 0; color: var(--text-3); font-size: 13.5px; }
.ag-next p b { color: var(--text); font-weight: 500; }
.ag-next-side { display: flex; align-items: center; gap: 12px; flex: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 25%, transparent); animation: ping-soft 2s var(--ease) infinite; }
.faces { display: inline-flex; align-items: center; }
.faces .avatar { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--surface); }
.faces > * + * { margin-left: -8px; }
.more-faces { height: 26px; min-width: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font: 600 11px/1 var(--mono); color: var(--text-2); background: var(--surface-3); box-shadow: 0 0 0 2px var(--surface); }

.ag-days { display: grid; grid-template-columns: repeat(8, minmax(64px, 1fr)); gap: 4px; padding: 10px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ag-days::-webkit-scrollbar { display: none; }
.ag-days button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border: 0; border-radius: 10px; background: none; color: var(--text-3); cursor: pointer; transition: background-color .15s, color .15s; }
.ag-days button:hover { background: var(--surface-2); color: var(--text-2); }
.ag-days .wd { font-size: 11px; font-weight: 500; text-transform: capitalize; }
.ag-days b { font-size: 18px; font-weight: 600; line-height: 1.2; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ag-days .today .wd { color: var(--accent-text); }
.ag-days button.on { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2), var(--highlight); color: var(--text-2); }
.ag-days button.on b { color: var(--text); }
.ag-day-kinds { display: flex; gap: 1px; height: 16px; align-items: center; }
.ag-day-kinds .ii { --s: 16px; opacity: .85; }
.ag-day-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-3); }

.ag-bar { display: flex; align-items: center; gap: 12px; padding: 16px 18px 4px; }
.ag-bar h2 { font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ag-bar .sub { font-size: 12.5px; font-weight: 400; color: var(--text-3); }
.ag-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px 14px; border-bottom: 1px solid var(--border); }
.ag-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 6px; border-radius: 8px; border: 0; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 500; cursor: pointer; box-shadow: inset 0 0 0 1px var(--border); transition: background-color .12s, color .12s, box-shadow .12s, opacity .12s; }
.ag-chip .ii { --s: 16px; filter: grayscale(1); opacity: .45; transition: filter .15s, opacity .15s; }
.ag-chip:hover { color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-2); }
.ag-chip.on { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); }
.ag-chip.on .ii { filter: none; opacity: 1; }

.ag-scroll { height: min(640px, 66vh); overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(var(--surface), var(--surface)); }
.ag-grid { position: relative; margin: 14px 0; }
.ag-hour, .ag-half { position: absolute; left: 0; right: 0; height: 0; }
.ag-hour span { position: absolute; left: 0; width: 50px; text-align: right; transform: translateY(-50%); font: 500 11px/1 var(--mono); color: var(--text-3); }
.ag-hour::after { content: ""; position: absolute; left: 60px; right: 14px; border-top: 1px solid var(--border); }
.ag-half::after { content: ""; position: absolute; left: 60px; right: 14px; border-top: 1px dashed rgba(255, 255, 255, .03); }
.ag-track { position: absolute; top: 0; bottom: 0; left: 62px; right: 12px; }
.ag-now { position: absolute; left: 56px; right: 0; border-top: 1.5px solid var(--accent); z-index: 3; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -4px; top: -4.75px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ag-now span { position: absolute; right: 14px; top: -9px; font: 600 10.5px/1 var(--mono); color: var(--accent-fg); background: var(--accent); padding: 3px 5px; border-radius: 4px; }

.ag-card {
  position: absolute; display: flex; align-items: flex-start; gap: 10px; overflow: hidden; text-align: left;
  border: 0; border-radius: 8px; padding: 8px 10px 8px 9px; color: var(--text); cursor: pointer;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2), inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .35);
  transition: transform .15s var(--ease), background-color .15s, box-shadow .15s;
}
.ag-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-3); }
.ag-card:hover { z-index: 2; background: var(--surface-4); transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--border-3), 0 10px 24px -8px rgba(0, 0, 0, .7); }
.ag-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 2; }
.ag-card > .ii { --s: 32px; margin-left: 2px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.ag-body { display: grid; gap: 3px; min-width: 0; flex: 1; padding-top: 1px; }
.ag-card b { font-size: 13px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-time { font: 500 11px/1.25 var(--mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-tags { display: flex; gap: 4px; flex: none; align-items: center; }
.ag-yes { display: inline-flex; gap: 4px; align-items: center; height: 20px; padding: 0 6px; border-radius: 999px; font: 500 11px/1 var(--mono); color: var(--text-2); background: rgba(0, 0, 0, .28); }
.ag-yes .bi { font-size: 10px; }
.ag-must { height: 20px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); }
.ag-card.slim { align-items: center; padding-top: 0; padding-bottom: 0; }
.ag-card.slim > .ii { --s: 20px; }
.ag-card.slim .ag-body { display: flex; align-items: baseline; gap: 8px; padding: 0; }
.ag-card.must::before { background: var(--accent-line); }
.ag-card.going::before { background: var(--accent); }
.ag-card.going { background: color-mix(in oklab, var(--accent) 7%, var(--surface-3)); }
.ag-card.live { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ok) 45%, transparent), 0 0 0 3px color-mix(in oklab, var(--ok) 10%, transparent); }
.ag-card.past { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.ag-card.past > *, .ag-card.off > * { opacity: .45; }
.ag-card.past > .ii, .ag-card.off > .ii { filter: grayscale(1); }
.ag-card.off b { text-decoration: line-through; }
.tpl-times { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tpl-time { font: 500 11.5px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2); }
button.tpl-time { cursor: pointer; transition: color .12s, border-color .12s; } button.tpl-time:hover { color: var(--text); border-color: var(--accent-line); }
@media (max-width: 640px) {
  .ag-card.narrow { padding: 4px 6px; gap: 6px; }
  .ag-card.narrow > .ii { --s: 16px; }
  .ag-card.narrow b { font-size: 11.5px; }
  .ag-card.narrow .ag-time, .ag-card.narrow .ag-tags { display: none; }
  .ag-hour span { width: 38px; }
  .ag-hour::after, .ag-half::after { left: 46px; right: 6px; }
  .ag-track { left: 48px; right: 4px; }
  .ag-now { left: 44px; }
  .ag-days { grid-template-columns: repeat(8, 58px); }
  .ag-next { flex-wrap: wrap; gap: 14px 16px; padding: 18px; }
  .ag-next-art { width: 64px; height: 64px; border-radius: 14px; }
  .ag-next-art .ii { --s: 48px; }
  .ag-next-text { flex-basis: calc(100% - 80px); }
  .ag-next h2 { font-size: 19px; }
  .ag-next-side { width: 100%; justify-content: space-between; }
}
.rsvp { display: flex; gap: 6px; flex-wrap: wrap; }
.rsvp .btn.on { --b-bg: var(--accent-soft); --b-bd: var(--accent-line); --b-fg: var(--text); }
.quick { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r); background: var(--bg); box-shadow: inset 0 0 0 1px var(--border-2); }
.quick button { border: 0; background: transparent; color: var(--text-3); width: 28px; height: 26px; cursor: pointer; font-size: 14px; border-radius: 6px; display: grid; place-items: center; transition: background-color .12s, color .12s; }
.quick button:hover { color: var(--text); background: var(--surface-3); }
.quick button.on { background: var(--surface-4); color: var(--text); box-shadow: var(--highlight); }
.quick button.on.yes i { color: var(--ok); }
.quick button.on.maybe i { color: var(--warn); }
.quick button.on.no i { color: var(--bad); }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 3px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); font-size: 12.5px; }
.person .avatar { width: 22px; height: 22px; }
.recur { color: var(--text-3); font-size: 12px; margin-left: 4px; }
.facepile { display: inline-flex; }
.facepile .avatar { width: 20px; height: 20px; box-shadow: 0 0 0 2px var(--surface); }
.facepile .avatar + .avatar { margin-left: -6px; }
.detail-grid { display: grid; gap: 18px; }
.detail-grid h4 { font-size: 12.5px; font-weight: 500; color: var(--text-3); margin: 0 0 8px; letter-spacing: 0; }
.prose { white-space: pre-wrap; margin: 0; color: var(--text-2); overflow-wrap: anywhere; line-height: 1.6; }

/* ---------------------------------------------------------------- fil d'annonces */
.feed { display: grid; }
.msg-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 12px; padding: 16px 18px; border-top: 1px solid var(--border); position: relative; }
.feed > .msg-item:first-child, .feed > :first-child > .msg-item { border-top: 0; }
.msg-item > .avatar { width: 36px; height: 36px; grid-row: span 2; }
.msg-item > .tile.sm { width: 36px; height: 36px; grid-row: span 2; color: var(--accent-text); }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.msg-head b { font-size: 13.5px; font-weight: 600; }
.msg-head time { font-size: 12px; color: var(--text-3); }
.msg-head .bi-discord { color: #8b93f8; font-size: 12px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: 13.5px; margin-top: 3px; line-height: 1.6; }
.msg-body b { color: var(--text); font-weight: 600; }
.msg-body a { color: var(--info); text-decoration: none; }
.msg-body a:hover { text-decoration: underline; }
.msg-body code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.msg-embed { margin-top: 10px; border-left: 3px solid var(--accent); background: var(--surface-2); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; font-size: 13.5px; }
.msg-embed b { display: block; color: var(--text); }
.msg-img { margin-top: 10px; max-height: 300px; border-radius: var(--r); display: block; box-shadow: 0 0 0 1px var(--border); }
.msg-item.clamp .msg-body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.msg-tools { position: absolute; top: 10px; right: 12px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; background: var(--surface); border-radius: var(--r); }
.msg-item:hover .msg-tools, .msg-tools:focus-within { opacity: 1; }

/* ---------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 0 14px; height: 52px; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { padding-left: 18px; }
table.data th:last-child, table.data td:last-child { padding-right: 18px; }
table.data thead th { height: 38px; border-top: 0; color: var(--text-3); font-weight: 500; font-size: 12px; background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
table.data tbody tr { transition: background-color .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.r, table.data th.r { text-align: right; }
table.data td.wrap { white-space: normal; min-width: 200px; }
table.data .row-main { gap: 10px; }
table.data .row-text b { font-weight: 500; }
.amount { font-variant-numeric: tabular-nums; font-weight: 500; }
.amount.plus { color: var(--ok); } .amount.minus { color: var(--bad); }
.rank { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--text-3); width: 28px; flex: none; text-align: center; }
.medal { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #1a1306; }
.rank.g1 .medal { background: var(--gold); } .rank.g2 .medal { background: var(--silver); } .rank.g3 .medal { background: var(--bronze); }
.me-row { background: color-mix(in oklab, var(--accent) 6%, transparent) !important; box-shadow: inset 2px 0 0 var(--accent); }
.grade { display: inline-flex; align-items: center; gap: 7px; }

/* podium du classement */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.podium > div { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--highlight); min-width: 0; }
.podium .avatar { width: 44px; height: 44px; }
.podium b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium span { color: var(--text-3); font-size: 12.5px; }
.podium .medal { color: #1a1306; font-size: 11px; }
.podium strong { margin-left: auto; font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.podium > div:first-child { border-color: color-mix(in oklab, var(--gold) 35%, transparent); background: linear-gradient(180deg, color-mix(in oklab, var(--gold) 7%, var(--surface)), var(--surface)); }

/* ---------------------------------------------------------------- contrôle segmenté */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; cursor: pointer; color: var(--text-3); font-size: 12.5px; font-weight: 500; white-space: nowrap; border-radius: 7px; transition: background-color .15s, color .15s; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--highlight), 0 1px 2px rgba(0, 0, 0, .3); }
.seg button .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------------------------------------------------------------- formulaires */
.form { display: grid; gap: 16px; }
.form-section { display: grid; gap: 16px; padding-top: 22px; border-top: 1px solid var(--border); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section > h3 { font-size: 14px; font-weight: 600; }
.form-section > h3 + p { margin: -10px 0 0; color: var(--text-3); font-size: 13px; }
.field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field small, .hint { color: var(--text-3); font-size: 12px; line-height: 1.5; }
.field small a, .hint a { color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; height: var(--control); padding: 0 11px; border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background-color .15s; font-size: 13.5px;
}
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:hover { border-color: var(--border-3); }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.input[readonly] { color: var(--text-3); }
textarea.input { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237d7d88' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
select.input[multiple] { height: auto; padding: 4px; background-image: none; }
select.input[multiple] option { padding: 5px 8px; border-radius: 4px; }
select.input.sm { height: 30px; font-size: 12.5px; width: auto; border-radius: var(--r-sm); padding-left: 9px; }
input[type="color"].input { padding: 3px; cursor: pointer; }
input[type="number"].input { font-variant-numeric: tabular-nums; }
input[type="date"].input, input[type="datetime-local"].input, input[type="time"].input { font-variant-numeric: tabular-nums; }
::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; color: var(--text-2); user-select: none; min-height: 24px; }
.check:hover { color: var(--text); }
.check input, .checks input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 16px; height: 16px; border-radius: 5px;
  border: 1px solid var(--border-3); background: var(--bg); cursor: pointer; display: grid; place-items: center;
  transition: background-color .12s, border-color .12s;
}
.check input::after { content: ""; width: 9px; height: 9px; transform: scale(0); transition: transform .12s var(--ease-out); background: var(--accent-fg); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: scale(1); }
.check input:checked + * , .check:has(input:checked) { color: var(--text); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checks.boxed { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 16px; max-height: 232px; overflow: auto; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--bg); }
.checks.boxed .check { min-height: 30px; }
.msg { min-height: 0; color: var(--bad); font-size: 13px; }
.msg:empty { display: none; }
.item-rows { display: grid; gap: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; }
.note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); color: var(--text-2); font-size: 13px; box-shadow: inset 0 0 0 1px var(--border); }
.note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.note.ok::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ok) 20%, transparent); }
.note.bad::before { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in oklab, var(--bad) 20%, transparent); }
.save-bar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--r-lg); background: color-mix(in oklab, var(--surface-2) 92%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow-pop); }
.save-bar .msg { margin-right: auto; }
.save-bar .hint { margin-right: auto; }
.save-bar .msg:not(:empty) + .hint { display: none; }

/* ---------------------------------------------------------------- fenêtres */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 860px); padding: 0; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--text); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06), 0 32px 80px -16px rgba(0, 0, 0, .85), 0 8px 24px rgba(0, 0, 0, .4);
  display: none; flex-direction: column;
}
dialog.modal[open] { display: flex; animation: dialog-in .28s var(--ease-out); }
dialog.modal::backdrop { background: rgba(3, 3, 5, .72); backdrop-filter: blur(8px) saturate(.8); -webkit-backdrop-filter: blur(8px) saturate(.8); animation: fade .24s var(--ease); }
dialog.modal.closing { animation: dialog-out .16s var(--ease) forwards; }
dialog.modal.closing::backdrop { animation: fade .16s var(--ease) reverse forwards; }
dialog.modal.wide { width: min(780px, calc(100vw - 32px)); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 16px 4px 24px; flex: none; }
.modal-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; min-width: 0; overflow-wrap: anywhere; }
.modal-head .btn { color: var(--text-3); border-radius: 999px; }
.modal-body { padding: 16px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal-body > .list { margin: -8px -24px -24px; border-top: 1px solid var(--border); }
.modal-body > .list .row { padding-left: 24px; padding-right: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin: 8px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg-side); position: sticky; bottom: -24px; z-index: 2; }
.modal-foot .grow, .modal-actions .grow { flex: 1; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 24px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg-side); position: sticky; bottom: -24px; z-index: 2; }

/* fenêtre illustrée (événement) : l'en-tête classique laisse place au bandeau */
dialog.modal.has-cover .modal-head { position: absolute; top: 0; right: 0; z-index: 5; padding: 12px; }
dialog.modal.has-cover .modal-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
dialog.modal.has-cover .modal-head .btn { background: rgba(0, 0, 0, .35); color: var(--text-2); backdrop-filter: blur(8px); }
dialog.modal.has-cover .modal-head .btn:hover { color: var(--text); background: rgba(0, 0, 0, .55); }
dialog.modal.has-cover .modal-body { padding-top: 0; }
.ev-cover { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; gap: 18px; margin: 0 -24px; padding: 40px 24px 22px; }
.ev-cover::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 14px 14px; -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.ev-cover::after { content: ""; position: absolute; inset: auto 0 0; height: 60%; z-index: -1; background: linear-gradient(transparent, var(--surface)); }
.ev-glow { left: -20px; top: -70px; }
.ev-glow .ii { --s: 260px; opacity: .5; }
.ev-art { width: 88px; height: 88px; flex: none; display: grid; place-items: center; border-radius: 20px; background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 34px -12px rgba(0, 0, 0, .9); backdrop-filter: blur(8px); }
.ev-art .ii { --s: 64px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
.ev-head { min-width: 0; display: grid; gap: 6px; padding-bottom: 2px; }
.ev-kicker { font-size: 12px; font-weight: 500; color: var(--text-2); }
.ev-head h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.ev-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ev-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 22px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.ev-facts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ev-facts > div { padding: 11px 14px; min-width: 0; }
.ev-facts > div + div { border-left: 1px solid var(--border); }
.ev-facts dt { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.ev-facts dt .bi { font-size: 12px; }
.ev-facts dd { margin: 4px 0 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ev-main { display: grid; gap: 24px; }
.ev-main h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.005em; }
.ev-main h4 .muted { font-weight: 400; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice button { display: grid; justify-items: start; gap: 2px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text-2); text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--border-2); transition: background-color .15s, box-shadow .15s, color .15s, transform .1s var(--ease); }
.choice button:hover { background: var(--surface-3); color: var(--text); }
.choice button:active { transform: scale(.98); }
.choice .bi { font-size: 17px; margin-bottom: 6px; color: var(--text-3); transition: color .15s; }
.choice b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.choice small { font-size: 12px; color: var(--text-3); }
.choice button.on { background: var(--surface-3); box-shadow: inset 0 0 0 1.5px var(--c), 0 0 0 4px color-mix(in oklab, var(--c) 12%, transparent); }
.choice .yes { --c: var(--ok); } .choice .maybe { --c: var(--warn); } .choice .no { --c: var(--bad); }
.choice button.on .bi, .choice button:hover .bi { color: var(--c); }
.who-groups { display: grid; gap: 16px; }
.who-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.who-label span { font-family: var(--mono); color: var(--text-3); }
.dot.yes { background: var(--ok); } .dot.maybe { background: var(--warn); } .dot.no { background: var(--bad); }
.dot.yes, .dot.maybe, .dot.no { width: 6px; height: 6px; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.who { display: flex; align-items: center; gap: 9px; padding: 6px 8px 6px 6px; border-radius: 9px; min-width: 0; }
.who:hover { background: var(--surface-2); }
.who .avatar { width: 28px; height: 28px; flex: none; }
.who > span { display: grid; min-width: 0; }
.who b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* choix du type d'événement : les textures du jeu en grille */
.kind-pick { border: 0; padding: 0; margin: 0; }
.kind-pick legend { padding: 0; margin-bottom: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.kind-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.kind-grid label { position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; transition: background-color .12s, box-shadow .12s; }
.kind-grid label:hover { background: var(--surface-3); }
.kind-grid input { position: absolute; opacity: 0; pointer-events: none; }
.kind-grid .ii { --s: 32px; filter: grayscale(.7) brightness(.8); transition: filter .15s, transform .15s var(--ease); }
.kind-grid span { font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.kind-grid label:hover .ii { filter: none; }
.kind-grid label:has(:checked) { background: var(--surface-3); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft); }
.kind-grid label:has(:checked) .ii { filter: none; transform: scale(1.08); }
.kind-grid label:has(:checked) span { color: var(--text); }
.kind-grid label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* éditeur de règle (horaires fixes) */
.input-unit { position: relative; display: block; }
.input-unit em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.input-unit .input { padding-right: 44px; }
.field > span small { font-weight: 400; color: var(--text-3); }
.day-pick { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border-2); }
.day-pick.mw { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.day-pick label { position: relative; cursor: pointer; }
.day-pick input { position: absolute; opacity: 0; pointer-events: none; }
.day-pick span { display: grid; place-items: center; height: 32px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-3); transition: background-color .12s, color .12s, box-shadow .12s; }
.day-pick label:hover span { color: var(--text); background: var(--surface-2); }
.day-pick input:checked + span { color: var(--text); background: var(--surface-4); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-3), inset 0 -2px 0 var(--accent); }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.presets { display: flex; gap: 2px; margin: 2px 0 0 -8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px 0 10px; border-radius: 8px; font: 500 12.5px/1 var(--mono); color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2); animation: pop .14s var(--ease-out); }
#ruleSkips .chip { font-family: var(--font); }
.chip button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; font-size: 15px; }
.chip button:hover { color: var(--bad); background: var(--surface-4); }
.inline-add { display: flex; gap: 8px; }
.inline-add .input { max-width: 180px; }
.repeat-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.repeat-gen .input { height: 30px; width: auto; padding: 0 8px; font-size: 12.5px; }
.repeat-gen input[type="number"] { width: 56px; }
details.adv { border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
details.adv summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; color: var(--text); }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary small { color: var(--text-3); font-weight: 400; margin-left: 2px; }
details.adv summary::after { content: "\F282"; font-family: "bootstrap-icons"; margin-left: auto; color: var(--text-3); font-size: 12px; transition: transform .2s var(--ease); }
details.adv[open] summary::after { transform: rotate(180deg); }
.adv-body { display: grid; gap: 16px; padding: 4px 14px 16px; }
.rule-preview { border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--border-2); overflow: hidden; }
.rule-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rule-preview-head span { color: var(--text-3); font-size: 12px; text-align: right; }
.rule-preview ol { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.rule-preview li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface); }
.rule-preview li span { font-size: 11.5px; color: var(--text-3); }
.rule-preview li b { font: 500 13px/1.2 var(--mono); }
.rule-preview li.none { grid-column: 1 / -1; color: var(--text-3); font-size: 12.5px; background: none; }
.tpl-row.paused .row-main { opacity: .5; }

/* confirmation */
dialog.ask { width: min(400px, calc(100vw - 32px)); }
.ask-body { padding: 24px 24px 0; display: grid; gap: 8px; }
.ask-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; font-size: 18px; color: var(--text-2); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-2); }
.ask.danger .ask-icon { color: var(--bad); background: color-mix(in oklab, var(--bad) 12%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--bad) 25%, transparent); }
.ask-body h2 { font-size: 16.5px; letter-spacing: -.015em; }
.ask-body p { margin: 0; color: var(--text-2); line-height: 1.55; }
.ask-body textarea { margin-top: 8px; }
.ask .modal-foot { margin: 24px 0 0; bottom: 0; border-top: 0; background: none; padding: 0 24px 24px; }
.ask .modal-foot .btn { flex: 1; }

/* palette de commandes */
dialog.palette { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; max-height: 64vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.palette-input .bi { color: var(--text-3); font-size: 15px; }
.palette-input input { flex: 1; height: 52px; border: 0; background: none; font-size: 15px; outline: none; }
.palette-input input::placeholder { color: var(--text-3); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-list .pg { padding: 10px 10px 6px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.palette-list button { display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 10px; border: 0; background: none; border-radius: var(--r); cursor: pointer; text-align: left; color: var(--text-2); font-size: 13.5px; }
.palette-list button .bi { font-size: 15px; width: 18px; color: var(--text-3); }
.palette-list button.on { background: var(--surface-3); color: var(--text); }
.palette-list button.on .bi { color: var(--accent); }
.palette-list button kbd { margin-left: auto; }
.palette-list .none { padding: 24px; text-align: center; color: var(--text-3); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; flex: none; }
.palette-foot span { display: inline-flex; gap: 6px; align-items: center; }

/* annonces du site, règlement */
.rules { max-width: 72ch; white-space: pre-wrap; color: var(--text-2); overflow-wrap: anywhere; line-height: 1.75; font-size: 14.5px; }

/* relations */
.rel { --c: var(--text-2); }
.rel-ally { --c: var(--ok); } .rel-nap { --c: var(--info); } .rel-neutral { --c: var(--text-2); } .rel-watch { --c: var(--warn); } .rel-enemy { --c: var(--bad); }
.rel-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px 8px; font-size: 12px; font-weight: 500; color: var(--c); border-top: 1px solid var(--border); }
.rel-head:first-child { border-top: 0; }
.rel-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c) 20%, transparent); }
.rel-head .n { color: var(--text-3); }
.rel-group .row { border-top: 0; min-height: 48px; padding-left: 34px; }

/* candidatures */
.answers { display: grid; gap: 16px; }
.answer b { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.answer div { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- notifications */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 8px; justify-items: end; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 420px; padding: 12px 14px 12px 12px; border-radius: 10px; background: var(--surface-3); box-shadow: var(--shadow-pop); font-size: 13.5px; color: var(--text); animation: toast-in .3s var(--ease-out); }
.toast .bi { font-size: 16px; margin-top: 1px; color: var(--ok); }
.toast.bad .bi { color: var(--bad); }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ---------------------------------------------------------------- squelettes de chargement */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-title { width: 220px; height: 26px; }
.sk-line { width: 340px; max-width: 70%; height: 13px; margin-top: 12px; }
.sk-block { height: 260px; border-radius: var(--r-lg); }
.sk-kpi { height: 86px; border-radius: var(--r-lg); }

/* ---------------------------------------------------------------- adaptatif */
@media (max-width: 1180px) {
  .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .home, .cols, .agenda-layout { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 8px; height: var(--top-h); padding: 0 10px;
    padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top));
    background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--border);
  }
  .topbar .page-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.015em; }
  .side {
    position: fixed; z-index: 70; top: 0; left: 0; bottom: 0; width: 288px; max-width: 86vw; height: auto;
    transform: translateX(-102%); transition: transform .28s var(--ease-out), box-shadow .28s; padding-top: env(safe-area-inset-top);
  }
  body.side-open .side { transform: none; box-shadow: 24px 0 60px rgba(0, 0, 0, .55); }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(4, 4, 6, .6); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.side-open .side-backdrop { opacity: 1; pointer-events: auto; }
  body.side-open { overflow: hidden; }
  .tab { height: 40px; font-size: 14.5px; }
  .view { padding: 24px 20px 88px; }
  .land-hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 48px 0 56px; }
  .land-split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .page-head .eyebrow { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .view { padding: 20px 16px 88px; }
  .page-head { margin-bottom: 20px; align-items: stretch; }
  .page-head > .btn-group { width: 100%; }
  .page-head > .btn-group > .btn { flex: 1; }
  .page-head > .btn-group > .seg { width: 100%; }
  .page-head > .btn-group > .seg button { flex: 1; justify-content: center; }
  .kpis, .kpis.k3, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 21px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .item-row { grid-template-columns: minmax(0, 1fr) 92px auto; }
  .podium { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .row { padding: 12px 16px; flex-wrap: wrap; }
  .row:has(> .row-actions) > .row-main { flex-basis: 100%; }
  .row > .row-actions { width: 100%; justify-content: flex-start; padding-left: 0; }
  .row.event > .row-actions { width: auto; flex-basis: auto; margin-left: auto; }
  .row.event > .row-main { flex-basis: auto; }
  .row.event { flex-wrap: nowrap; }
  .row.event .time { display: none; }
  .row.event .row-text span .when-inline { display: inline; }
  .row.event .row-actions .badge { display: none; }
  .msg-item { padding: 14px 16px; }
  .site-nav { padding: 14px 16px; }
  .site-nav .hide-sm { display: none; }
  .land { padding: 0 16px 56px; }
  .land-hero { padding: 32px 0 44px; }
  .land-lead { font-size: 15px; }
  .land-cta { width: 100%; flex-direction: column; }
  .land-cta .btn { width: 100%; }
  .land-stats { gap: 28px; margin-top: 32px; }
  .land-stats dd { font-size: 22px; }
  .pal { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 32px; gap: 12px; }
  .kind-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rule-preview ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ev-facts { grid-template-columns: 1fr 1fr; }
  .ev-facts:not(.two) > div:last-child { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
  .choice button { padding: 10px 12px; }
  .ev-art { width: 72px; height: 72px; }
  .ev-art .ii { --s: 48px; }
  .ev-head h3 { font-size: 19px; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog.modal[open] { animation: sheet-in .3s var(--ease-out); }
  dialog.modal.closing { animation: sheet-out .18s var(--ease) forwards; }
  dialog.palette { margin: 8px auto auto; border-radius: var(--r-xl); width: calc(100vw - 16px); }
  dialog.palette[open] { animation: dialog-in .22s var(--ease-out); }
  .palette-foot { display: none; }
  .toasts { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); justify-items: stretch; }
  .toast { max-width: none; }
  .save-bar { bottom: calc(10px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.when-inline { display: none; }
@media (hover: none) { .msg-tools { opacity: 1; } .search-btn kbd { display: none; } }
@media (max-width: 640px) { .row.event:has(.date-box) .event-kind { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* --- Règlement : un document qu'on lit en descendant ---------------------------------------- */
.doc-bar { display: flex; gap: 10px; margin: -6px 0 28px; }
.doc-search { position: relative; flex: 1; min-width: 0; max-width: 560px; }
.doc-search .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.doc-search .input { height: 42px; padding-left: 40px; font-size: 14.5px; border-radius: var(--r-lg); background: var(--surface); }
.doc-jump { position: relative; display: none; flex: 1; min-width: 0; }
.doc-jump .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--accent-text); pointer-events: none; }
.doc-jump .input { height: 42px; padding-left: 38px; border-radius: var(--r-lg); background-color: var(--surface); font-weight: 500; text-overflow: ellipsis; }

.doc { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc-main { min-width: 0; max-width: 740px; }

/* Sommaire : toutes les parties, les articles de la partie en cours seulement. */
.doc-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain; padding: 2px 8px 24px 0; scrollbar-width: thin; }
.doc-toc-head { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px 10px; }
.doc-toc a { display: block; text-decoration: none; border-radius: var(--r-sm); transition: color .15s, background-color .15s; }
.doc-toc-part > a { display: grid; grid-template-columns: 22px 1fr; gap: 4px; padding: 6px 10px; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.doc-toc-part > a span { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding-top: 1px; font-variant-numeric: tabular-nums; }
.doc-toc-part > a:hover { color: var(--text); background: var(--surface-2); }
.doc-toc-part.on > a { color: var(--text); font-weight: 500; background: var(--surface-2); }
.doc-toc-part.on > a span { color: var(--accent-text); }
.doc-toc-arts { display: none; margin: 4px 0 10px 20px; padding-left: 12px; border-left: 1px solid var(--border-2); }
.doc-toc-part.on .doc-toc-arts { display: grid; gap: 1px; }
.doc-toc-arts a { position: relative; padding: 4px 8px; font-size: 12.5px; line-height: 1.4; color: var(--text-3); }
.doc-toc-arts a:hover { color: var(--text); }
.doc-toc-arts a.on { color: var(--accent-text); }
.doc-toc-arts a.on::before { content: ""; position: absolute; left: -13px; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--accent); }

/* Parties et articles */
.doc-part { scroll-margin-top: 24px; }
.doc-part + .doc-part { margin-top: 72px; }
.doc-part-head { padding-bottom: 22px; margin-bottom: 8px; border-bottom: 1px solid var(--border-2); }
.doc-part-num { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.doc-part-head h2 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -.025em; font-weight: 650; text-wrap: balance; }
.doc-part-head p { margin: 12px 0 0; color: var(--text-2); font-size: 15.5px; line-height: 1.7; }
.doc-art { position: relative; padding: 30px 0 2px; scroll-margin-top: 16px; border-radius: var(--r); }
.doc-art h3 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -.015em; color: var(--text); }
.doc-art h3 > span { min-width: 0; text-wrap: balance; }
.doc-art h3 .badge { align-self: center; }
.doc-id { flex: none; position: relative; top: -1px; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text-3); text-decoration: none; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-2); font-variant-numeric: tabular-nums; transition: color .15s, border-color .15s, background-color .15s; }
a.doc-id:hover { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.doc-edit { margin-left: auto; align-self: center; flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .15s, background-color .15s, color .15s; }
.doc-art:hover .doc-edit, .doc-edit:focus-visible { opacity: 1; }
.doc-edit:hover { background: var(--surface-3); color: var(--text); }
.doc-art.is-draft { opacity: .75; }
.doc-art.flash { animation: doc-flash 1.8s var(--ease-out); }
@keyframes doc-flash { 0%, 30% { background: var(--accent-soft); box-shadow: 0 0 0 12px var(--accent-soft); } 100% { background: transparent; box-shadow: 0 0 0 12px transparent; } }
.doc-empty { color: var(--text-3); font-style: italic; margin: 0 0 14px; }
.doc-add { margin-top: 16px; }

.wiki-body { color: var(--text-2); font-size: 15.5px; line-height: 1.75; }
.wiki-body p, .wiki-body ol, .wiki-body ul { margin: 0 0 14px; }
.wiki-body ol, .wiki-body ul { padding-left: 22px; display: grid; gap: 6px; }
.wiki-body li { padding-left: 4px; }
.wiki-body li::marker { color: var(--accent-text); font-weight: 600; }
.wiki-body strong { color: var(--text); font-weight: 600; }
.wiki-example { padding: 12px 16px; border-radius: var(--r); background: var(--surface); border-left: 3px solid var(--border-3); font-size: 14.5px; }
.wiki-table { margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--r); overflow: auto; }
.wiki-table td.yes { color: var(--ok); font-weight: 500; }
.wiki-table td.no { color: var(--text-3); }
.wref { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wref:hover { color: var(--accent-text); text-decoration-color: currentColor; }
.wiki-note { margin: 4px 0 16px; padding: 12px 16px; border-radius: var(--r); background: color-mix(in oklab, var(--warn) 8%, var(--surface)); border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent); color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.wiki-note .eyebrow { color: var(--warn); display: flex; gap: 6px; align-items: center; }
.wiki-note p { margin: 0; }
.wiki-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-2); }
.wiki-tools > span { font-size: 12.5px; color: var(--text-3); margin-right: 4px; }

/* Résultats de recherche */
.doc-results { max-width: 820px; }
.doc-count { margin: 0 0 12px; font-size: 13px; color: var(--text-3); }
.doc-hits { display: grid; gap: 8px; }
.doc-hit { display: grid; gap: 5px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s; }
.doc-hit:hover { border-color: var(--border-3); background: var(--surface-2); }
.doc-hit-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.doc-hit-part { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-hit b { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.doc-hit-text { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.doc-hit mark { background: color-mix(in oklab, var(--accent) 28%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }

@media (max-width: 1080px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { display: none; }
  .doc-main { max-width: none; }
  .doc-bar { position: sticky; top: 0; z-index: 20; margin: -6px -40px 24px; padding: 10px 40px; background: color-mix(in oklab, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
  .doc-search { max-width: none; }
  .doc-jump { display: block; }
  .doc-part, .doc-art { scroll-margin-top: 80px; }
}
@media (max-width: 920px) {
  .doc-bar { top: calc(var(--top-h) + env(safe-area-inset-top)); margin: -4px -20px 20px; padding: 10px 20px; }
  .doc-part, .doc-art { scroll-margin-top: calc(var(--top-h) + 76px); }
}
@media (max-width: 640px) {
  .doc-bar { flex-direction: column-reverse; gap: 8px; margin: -4px -16px 18px; padding: 10px 16px; }
  .doc-part, .doc-art { scroll-margin-top: calc(var(--top-h) + 124px); }
  .doc-part + .doc-part { margin-top: 56px; }
  .doc-part-head h2 { font-size: 23px; }
  .doc-part-head p { font-size: 15px; }
  .doc-art { padding-top: 26px; }
  .doc-art h3 { font-size: 16.5px; gap: 10px; }
  .wiki-body { font-size: 15px; }
  .doc-edit { opacity: 1; }
}
@media (hover: none) { .doc-edit { opacity: 1; } }

/* --- Mise aux normes du règlement : discipline, PB, signalements ------------------------------- */
.tile.ok { color: var(--ok); background: color-mix(in oklab, var(--ok) 10%, var(--surface-2)); }
.tile.warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 10%, var(--surface-2)); }
.tile.bad { color: var(--bad); background: color-mix(in oklab, var(--bad) 10%, var(--surface-2)); }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hint { color: var(--text-3); font-size: 13px; line-height: 1.6; margin: 16px 0 0; }
.notice { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.notice > .bi { font-size: 20px; color: var(--accent-text); flex: none; }
.notice > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.notice span { color: var(--text-2); font-size: 13.5px; }
.staff-inbox { margin-bottom: 20px; }
.staff-inbox .panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0; }
.proof, .appeal-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2) !important; overflow-wrap: anywhere; }
.proof .bi { color: var(--text-3); }
.pb-ask p { margin: 0 0 14px; color: var(--text-2); line-height: 1.6; max-width: 70ch; }
.doc-accept { display: flex; align-items: center; gap: 14px; margin-top: 64px; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--accent-line); background: var(--accent-soft); }
.doc-accept > .bi { font-size: 22px; color: var(--accent-text); }
.doc-accept > div { display: grid; gap: 2px; flex: 1; }
.doc-accept span { color: var(--text-2); font-size: 13.5px; }
.doc-accept.done { border-color: color-mix(in oklab, var(--ok) 35%, transparent); background: color-mix(in oklab, var(--ok) 8%, var(--surface)); }
.doc-accept.done > .bi { color: var(--ok); }
@media (max-width: 640px) {
  .notice, .doc-accept { flex-wrap: wrap; }
  .notice .btn, .doc-accept .btn { width: 100%; }
  .kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Questions au règlement (assistant IA) ------------------------------------------------------- */
/* Même matière que le reste du site : surfaces, filets, accent orange au focus. Il se déplie sur place. */
.ask { margin: 0 0 16px; border: 1px solid var(--border-2); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--highlight); transition: border-color .2s; }
.ask:hover:not(.open) { border-color: var(--border-3); }
.ask:focus-within { border-color: var(--accent-line); box-shadow: var(--highlight), 0 0 0 3px var(--accent-soft); }
.ask-bar { display: flex; align-items: flex-start; gap: 10px; padding: 0 6px 0 14px; cursor: text; }
.ask-ico { flex: none; height: 44px; display: grid; place-items: center; color: var(--text-3); font-size: 15px; transition: color .2s; }
.ask:focus-within .ask-ico, .ask.open .ask-ico { color: var(--accent-text); }
.ask-bar textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: 12px 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; line-height: 20px; }
.ask-bar textarea::placeholder { color: var(--text-3); }
.ask-send { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: 6px 0; border: 0; border-radius: var(--r); background: var(--accent); color: var(--accent-fg); font-size: 15px; cursor: pointer; transition: opacity .15s, background-color .15s, transform .15s; }
.ask-send:hover:not(:disabled) { background: var(--accent-hover); }
.ask-send:active:not(:disabled) { transform: scale(.94); }
.ask-send:disabled { opacity: .35; cursor: default; }
.ask-bar:has(textarea:placeholder-shown) .ask-send { background: var(--surface-3); color: var(--text-3); }

.ask-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s var(--ease-out); }
.ask-fold > div { min-height: 0; overflow: hidden; }
.ask.open > .ask-fold, .ask-fold.open { grid-template-rows: 1fr; }
.ask > .ask-fold > div { opacity: 0; transition: opacity .2s; }
.ask.open > .ask-fold > div { opacity: 1; transition: opacity .25s .08s; }

.ask-log { max-height: min(60vh, 600px); overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--border); scrollbar-width: thin; }
.ask-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ask-ideas { display: grid; padding: 14px 8px 10px; }
.ask-ideas .ask-label { padding: 0 8px; }
.ask-ideas button { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: var(--r); background: none; color: var(--text-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background-color .15s, color .15s; }
.ask-ideas button .bi { color: var(--text-3); font-size: 13px; }
.ask-ideas button:hover { background: var(--surface-2); color: var(--text); }
.ask-empty { margin: 0; padding: 16px; color: var(--text-3); font-size: 14px; }

.ask-turn { padding: 18px 18px 16px; animation: ask-in .3s var(--ease-out); }
.ask-turn + .ask-turn { border-top: 1px solid var(--border); }
@keyframes ask-in { from { opacity: 0; transform: translateY(4px); } }
.ask-q { margin: 0 0 10px; color: var(--text); font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.45; overflow-wrap: anywhere; }
.ask-a { color: var(--text-2); font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.ask-a p { margin: 0 0 10px; }
.ask-a ul, .ask-a ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.ask-a > :last-child { margin-bottom: 0; }
.ask-a strong { color: var(--text); font-weight: 600; }
.ask-ref { display: inline-block; margin: 0 1px; padding: 1px 5px; border: 0; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font: 500 11.5px/1.5 var(--mono); vertical-align: 1px; cursor: pointer; transition: background-color .15s, color .15s; }
.ask-ref:hover { background: var(--accent-soft); color: var(--accent-text); }
.ask-wait { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text-3); font-size: 14px; }
.ask-spin { width: 14px; height: 14px; border: 2px solid var(--surface-4); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ask-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.ask-err > .bi { color: var(--bad); }
.ask-err span { flex: 1; min-width: 160px; }

.ask-srcs { margin-top: 16px; }
.ask-srcs ul { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.ask-srcs li + li { border-top: 1px solid var(--border); }
.ask-src { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: background-color .15s, color .15s; }
.ask-src:hover, .ask-src.on { background: var(--surface-2); color: var(--text); }
.ask-id { flex: none; color: var(--text-3); font: 500 12px var(--mono); }
.ask-src.on .ask-id { color: var(--accent-text); }
.ask-src-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-src .bi { flex: none; color: var(--text-3); font-size: 12px; transition: transform .25s var(--ease-out); }
.ask-src.on .bi { transform: rotate(180deg); }
.ask-art { padding: 2px 14px 14px 12px; margin-left: 12px; border-left: 2px solid var(--accent-line); background: var(--surface-2); }
.ask-art .wiki-body { padding-top: 6px; color: var(--text-2); font-size: 14px; }
.ask-art .ask-link { margin-top: 8px; }

.ask-foot { display: flex; align-items: center; gap: 4px; padding: 8px 10px 8px 16px; border-top: 1px solid var(--border); }
.ask-foot span { flex: 1; min-width: 0; color: var(--text-3); font-size: 12px; }
.ask-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-radius: var(--r-sm, 6px); background: none; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; transition: background-color .15s, color .15s; }
.ask-link:hover { background: var(--surface-3); color: var(--text); }
.ask-link[hidden] { display: none; }

.doc-ask-hit { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background-color .15s, border-color .15s; }
.doc-ask-hit span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-ask-hit b { color: var(--text); font-weight: 500; }
.doc-ask-hit .bi { color: var(--accent-text); }
.doc-ask-hit .bi-arrow-right { color: var(--text-3); }
.doc-ask-hit:hover { border-color: var(--border-3); background: var(--surface-2); }

@media (max-width: 640px) {
  .ask-log { max-height: 64vh; }
  .ask-turn { padding: 16px 14px 14px; }
  .ask-bar textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ask-fold, .ask > .ask-fold > div { transition: none; }
  .ask-turn { animation: none; }
}
