:root {
  --bg: #0a0d16;
  --panel: #121727;
  --panel-2: #171d31;
  --line: #262d47;
  --text: #e9ebf3;
  --muted: #8f97b2;
  --gold: #d4af6a;
  --gold-soft: rgba(212, 175, 106, .14);
  --danger: #e2726c;
  --ok: #5fd0a0;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -200px, #1a2140 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--gold); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 22, .8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 1.2rem var(--serif); color: var(--text); text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; display: inline-block; flex: none;
  background:
    linear-gradient(var(--gold), var(--gold)) 2px 100% / 5px 60% no-repeat,
    linear-gradient(var(--gold), var(--gold)) 9px 100% / 5px 100% no-repeat,
    linear-gradient(var(--gold), var(--gold)) 16px 100% / 5px 75% no-repeat;
}
.brand-mark-large { width: 44px; height: 44px; background-size: 10px 60%, 10px 100%, 10px 75%; background-position: 4px 100%, 17px 100%, 30px 100%; }
.topnav { display: flex; gap: 6px; flex: 1; }
.topnav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.topnav a:hover { color: var(--text); }
.topnav a[aria-current="page"] { color: var(--gold); background: var(--gold-soft); }
.topuser { display: flex; align-items: center; gap: 12px; margin: 0; }
.topuser-name { color: var(--muted); font-size: .92rem; }

.btn {
  font: 600 .95rem var(--sans);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: linear-gradient(180deg, #e2c184, #c79d54); color: #1a1408; border-color: transparent; }
.btn-primary:hover { background: linear-gradient(180deg, #ecd09a, #d1a85e); }
.btn-ghost { background: transparent; padding: 7px 14px; font-weight: 500; }
.btn-small { padding: 6px 12px; font-size: .85rem; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.hint, .card-sub, .lead { color: var(--muted); font-size: .9rem; }
.lead { font-size: 1rem; margin: 6px 0 22px; }

.alert { padding: 10px 14px; border-radius: 10px; font-size: .93rem; margin: 0 0 16px; border: 1px solid; }
.alert-error { color: #f3b4b0; background: rgba(226, 114, 108, .1); border-color: rgba(226, 114, 108, .4); }
.alert-ok { color: #a9e8cc; background: rgba(95, 208, 160, .1); border-color: rgba(95, 208, 160, .4); }
[hidden] { display: none !important; }

.field { display: grid; gap: 6px; font-size: .88rem; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: #0c101c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
textarea { resize: vertical; min-height: 84px; }
.stack { display: grid; gap: 16px; }

/* Connexion */
.page-login { overflow: hidden; }
.backdrop {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(2px 2px at 12% 18%, #dfe6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 31% 9%, #dfe6ff 50%, transparent 51%),
    radial-gradient(2px 2px at 54% 22%, #dfe6ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 72% 12%, #dfe6ff 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 27%, #dfe6ff 50%, transparent 51%),
    radial-gradient(900px 500px at 50% 110%, #2a3566 0%, transparent 70%),
    linear-gradient(180deg, #060912, #131a36);
  background-size: 100% 100%;
  animation: drift 26s ease-in-out infinite alternate;
}
.backdrop canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s ease; }
.backdrop.ready { animation: none; }
.backdrop.ready canvas { opacity: 1; }
.backdrop::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(6, 9, 18, .1) 0%, rgba(6, 9, 18, .72) 100%);
}
@keyframes drift { from { background-position: 0 0; filter: hue-rotate(0deg); } to { background-position: 0 -40px; filter: hue-rotate(25deg); } }

.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%);
  background: rgba(14, 18, 32, .72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(212, 175, 106, .28);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: rise .9s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login-card h1 { margin-top: 14px; }
.login-lead { color: var(--muted); margin: 6px 0 26px; }
.login-card form { text-align: left; }
.login-card .btn { width: 100%; margin-top: 4px; }

/* Ville */
.city { padding: 0 clamp(12px, 3vw, 40px) 60px; max-width: 1400px; margin: 0 auto; }
.scene-wrap { margin: 18px 0 20px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #060912; position: relative; }
.scene { display: block; width: 100%; height: auto; }
.stage { position: relative; aspect-ratio: 16 / 7; min-height: 320px; max-height: 66vh; width: 100%; background: #070b18; }
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.2s ease; }
.stage.ready .stage-canvas canvas { opacity: 1; }
.stage-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: italic 1.05rem var(--serif); animation: pulse 1.6s ease-in-out infinite; }
.stage.ready .stage-loading { display: none; }
.stage-tools { position: absolute; top: 12px; right: 12px; display: none; gap: 6px; }
.stage.ready .stage-tools { display: flex; }
.stage-tools .btn { width: 34px; height: 34px; padding: 0; font-size: 1.1rem; background: rgba(18, 23, 39, .8); }
.stage-hint { position: absolute; left: 14px; top: 14px; font-size: .8rem; color: var(--muted); background: rgba(10, 13, 22, .6); padding: 3px 10px; border-radius: 999px; display: none; pointer-events: none; }
.stage.ready .stage-hint { display: block; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.person { font: 600 .82rem var(--sans); color: var(--text); background: transparent; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.person:hover, .person[aria-pressed="true"] { border-color: var(--c); background: var(--panel-2); }
.scene-status {
  background: var(--panel); border-top: 1px solid var(--line);
  padding: 9px 16px; font-size: .9rem; color: var(--muted); text-align: center;
}

.star { fill: #dfe6ff; opacity: .7; }
.twinkle { animation: twinkle 4s ease-in-out infinite; }
.win { fill: #0d1120; }
.win.lit { opacity: .78; }
.sign { font: 700 10.5px var(--sans); letter-spacing: .09em; }
.building, .char { cursor: pointer; outline: none; }
.building .b-body { transition: stroke-opacity .2s, fill .2s; }
.building:hover .b-body, .building:focus-visible .b-body, .building.selected .b-body { stroke-opacity: 1; fill: #1c2340; }

.char { transform: translate(var(--hx), var(--hy)); transition: transform 1.9s cubic-bezier(.45, .05, .25, 1); }
.scene.meeting .char { transform: translate(var(--mx), var(--my)); }
.char-body { animation: bob 3.2s ease-in-out infinite; }
.char:hover .char-body, .char:focus-visible .char-body, .char.selected .char-body { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55)); }
.char-name { font: 600 11px var(--sans); fill: #c4cae0; paint-order: stroke; stroke: #0a0d16; stroke-width: 3px; }
.char-bubble { opacity: 0; transition: opacity .25s; }
.char.thinking .char-bubble, .char.done .char-bubble, .char.error .char-bubble { opacity: 1; }
.char-bubble .tick, .char-bubble .cross { display: none; }
.char.done .dots, .char.error .dots { display: none; }
.char.done .tick { display: inline; }
.char.error .cross { display: inline; transform: translateY(6px); }
.char.thinking .dots circle { animation: dot 1.1s ease-in-out infinite; }
.char.thinking .dots circle:nth-child(2) { animation-delay: .18s; }
.char.thinking .dots circle:nth-child(3) { animation-delay: .36s; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .75; } 50% { opacity: .2; } }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.main-col { display: grid; gap: 20px; min-width: 0; }
.side-col { display: grid; gap: 20px; position: sticky; top: 76px; }

.ask label { display: block; font: 600 1.1rem var(--serif); margin-bottom: 10px; }
.ask-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.ask .alert { margin: 14px 0 0; }

.room { display: grid; gap: 16px; }
.room-question { font: italic 1.15rem/1.45 var(--serif); color: var(--text); padding: 4px 4px 4px 16px; border-left: 3px solid var(--gold); }
.room-title { margin-top: 6px; color: var(--muted); font-size: 1rem; }

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 1rem var(--serif); color: #10131f; background: var(--c, var(--gold));
}
.dept { font: 500 .78rem var(--sans); color: var(--c, var(--muted)); margin-left: 6px; text-transform: uppercase; letter-spacing: .06em; }

.answer { border-color: rgba(212, 175, 106, .5); background: linear-gradient(180deg, rgba(212, 175, 106, .08), transparent 120px), var(--panel); }
.answer .rich { font-size: 1.02rem; }
.opinions { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.opinion { border-top: 3px solid var(--c); }
.opinion[data-state="waiting"] { opacity: .55; }
[data-state="thinking"] .card-sub { animation: pulse 1.4s ease-in-out infinite; }
[data-state="error"] .card-sub { color: var(--danger); }
[data-state="error"] .btn { margin-top: 4px; }

.rich p { margin: 0 0 .7em; }
.rich ul, .rich ol { margin: 0 0 .8em; padding-left: 1.25em; }
.rich li { margin-bottom: .3em; }
.rich strong { color: #fff; }
.rich > :last-child { margin-bottom: 0; }
.opinion .rich { font-size: .94rem; color: #d3d7e6; }

.profile h2, .history h2 { margin-bottom: 10px; }
.profile p { margin-bottom: 10px; }
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.skills li { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 380px; overflow: auto; }
.history-item {
  width: 100%; text-align: left; background: transparent; border: 0; color: var(--text);
  font: inherit; font-size: .9rem; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.history-item:hover { background: var(--panel-2); }
.history-date { color: var(--gold); font-size: .78rem; margin-right: 8px; }

/* Comptes */
.admin { max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 60px; }
.admin .panel { margin-bottom: 20px; }
.admin .panel h2 { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.table-wrap { overflow-x: auto; }
.accounts { width: 100%; border-collapse: collapse; font-size: .92rem; }
.accounts th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.accounts td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.accounts tr:last-child td { border-bottom: 0; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin: 2px 6px 2px 0; }
.inline input, .inline select { width: auto; padding: 6px 10px; font-size: .85rem; }
.inline input[type="password"] { width: 170px; }
.actions { min-width: 300px; }
.tag { font-size: .72rem; color: var(--gold); border: 1px solid rgba(212, 175, 106, .5); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.state { font-size: .82rem; padding: 2px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.state-on { color: var(--ok); border-color: rgba(95, 208, 160, .4); }
.state-off { color: var(--muted); border-color: var(--line); }

@media (max-width: 980px) {
  .columns { grid-template-columns: 1fr; }
  .side-col { position: static; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topuser-name { display: none; }
  .char-name { font-size: 15px; }
  .sign { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .char { transition: none; }
  .char-body, .twinkle, .char.thinking .dots circle, [data-state="thinking"] .card-sub, .backdrop, .login-card, .stage-loading { animation: none; }
}

/* Fiche entreprise, débat, tête-à-tête */
.alert-info { color: #b9c6ef; background: rgba(120, 140, 220, .1); border-color: rgba(120, 140, 220, .4); }
.field-label { color: var(--text); font-weight: 600; font-size: .95rem; }
.field-hint { font-size: .84rem; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font: 400 .9rem var(--sans); color: var(--muted); cursor: pointer; }
.ask .check { font-family: var(--sans); font-size: .9rem; font-weight: 400; margin-bottom: 0; }
.check input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--gold); }

.rebuttal { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rebuttal-title { font: 600 .74rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--c, var(--gold)); margin-bottom: 6px; }

.talk { margin-top: 14px; border-color: var(--gold); color: var(--gold); }
.chat { border-top: 3px solid var(--c, var(--gold)); }
.chat .avatar { background: var(--c, var(--gold)); }
.chat-title { flex: 1; min-width: 0; }
.chat-messages { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px 12px; }
.chat-messages:empty::before { content: "Posez votre première question."; color: var(--muted); font-size: .9rem; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: .95rem; }
.msg-user { align-self: flex-end; background: var(--gold-soft); border: 1px solid rgba(212, 175, 106, .35); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg-assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg-assistant p:last-child { margin-bottom: 0; }
.msg-typing { align-self: flex-start; color: var(--muted); font-style: italic; font-size: .88rem; animation: pulse 1.4s ease-in-out infinite; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { min-height: 52px; }

.stage-tools #daylight { font-size: 1rem; }
.stage-tools #daylight[data-mode="day"] { color: #ffd98a; }
.stage-tools #daylight[data-mode="night"] { color: #9fb4ff; }

@media (max-width: 640px) {
  .chat .card-head { flex-wrap: wrap; }
  .chat-form { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .msg-typing { animation: none; }
}

/* Objectif */
.goal-track { display: block; height: 10px; border-radius: 999px; background: #0c101c; border: 1px solid var(--line); overflow: hidden; }
.goal-fill { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: linear-gradient(90deg, #c79d54, #f0d28f); }
.goal-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-size: .88rem; }
.goal-bar:hover { background: var(--panel-2); }
.goal-bar-label { font: 600 .92rem var(--serif); color: var(--gold); white-space: nowrap; }
.goal-bar .goal-track { flex: 1; }
.goal-bar-value { color: var(--muted); white-space: nowrap; }
.goal-summary { display: grid; gap: 16px; }
.goal-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.goal-figures p { display: grid; gap: 2px; }
.goal-figures strong { font: 600 1.9rem var(--serif); color: var(--gold); }
.goal-figures span, .goal-next { color: var(--muted); font-size: .92rem; }
.goal-next strong { color: var(--text); }
.goal-summary .goal-track { height: 14px; }
.phase-title { margin: 20px 0 8px; color: var(--gold); font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--sans); font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.step form { margin: 0; display: flex; }
.step-check { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 1.5px solid var(--muted); background: transparent; color: #10131f; font: 700 .95rem var(--sans); display: grid; place-items: center; padding: 0; }
button.step-check { cursor: pointer; }
button.step-check:hover { border-color: var(--gold); }
.step-done .step-check { background: var(--gold); border-color: var(--gold); }
.step-label { flex: 1; min-width: 0; }
.step-done .step-label { color: var(--muted); }
.step .btn { white-space: nowrap; border-left: 3px solid var(--c, var(--line)); }
.sale-form { margin: 14px 0 18px; }
.num { text-align: right; white-space: nowrap; }
.accounts th.num { text-align: right; }

@media (max-width: 640px) {
  .goal-bar { flex-wrap: wrap; }
  .goal-bar .goal-track { flex-basis: 100%; order: 3; }
  .step { flex-wrap: wrap; }
}

a.btn { display: inline-block; text-decoration: none; color: var(--text); }
a.btn-primary { color: #1a1408; }

/* Dossier de décision */
.dossier-stake { font: italic 1.05rem/1.5 var(--serif); margin-bottom: 14px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.option { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel-2); display: grid; gap: 8px; align-content: start; }
.option h3 { font-size: 1rem; color: var(--gold); }
.option .rich { font-size: .93rem; color: #d3d7e6; }
.option .btn { justify-self: start; }
.option.chosen { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.dossier-checks { margin-top: 14px; padding: 10px 14px; border-left: 3px solid var(--line); font-size: .92rem; color: var(--muted); }
.ruling { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(212, 175, 106, .35); }
.ruling-form label { display: block; font: 600 1.05rem var(--serif); margin-bottom: 8px; }
.ruling-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.ruling-banner { display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--gold-soft); border: 1px solid rgba(212, 175, 106, .5); }
.ruling-banner strong { color: var(--gold); font: 600 .8rem var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.ruling-banner span { font-size: 1.05rem; white-space: pre-wrap; }
.ruling-banner .btn { justify-self: start; margin-top: 4px; }
.history-flag { display: inline-block; margin-left: 8px; font-size: .7rem; color: var(--gold); border: 1px solid rgba(212, 175, 106, .5); border-radius: 999px; padding: 0 7px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.profile-actions .talk { margin-top: 0; }

/* Mon bureau */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.desk .panel > .hint { margin-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 12px; }
.proposal, .mission { border-top: 3px solid var(--c, var(--gold)); background: var(--panel-2); }
.proposal .avatar, .mission .avatar, .action { --c: var(--gold); }
.proposal-title { font-size: 1.02rem; margin-bottom: 8px; }
.proposal-details { margin: 0; display: grid; gap: 6px; font-size: .9rem; }
.proposal-details dt { font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--c, var(--gold)); }
.proposal-details dd { margin: 0 0 4px; color: #d3d7e6; }
.card-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-accept { border-color: rgba(95, 208, 160, .6); color: var(--ok); }
.btn-accept:hover { border-color: var(--ok); }
.actions-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.action { display: flex; align-items: flex-start; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 10px; flex-wrap: wrap; }
.action-text { flex: 1; min-width: 220px; display: grid; gap: 2px; }
.action-text details { margin-top: 6px; font-size: .9rem; }
.action-text summary { cursor: pointer; color: var(--muted); font-size: .84rem; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.action-done strong { text-decoration: line-through; color: var(--muted); }
.done-actions { margin-top: 14px; }
.done-actions summary { cursor: pointer; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.mission-form { display: grid; gap: 12px; margin-bottom: 18px; }
.missions { display: grid; gap: 14px; }
.mission .card-head .state { margin-left: auto; }
.mission-brief { font: italic .95rem var(--serif); padding-left: 12px; border-left: 3px solid var(--line); margin-bottom: 12px; white-space: pre-wrap; }
.deliverable { background: #0c101c; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: .95rem; }
.feedback-form { display: grid; gap: 8px; margin-top: 10px; }
.feedback-form .btn { justify-self: start; }
.mission > .hint { margin-top: 8px; }
.register { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.register li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.register li > div { flex: 1; min-width: 220px; }
.register-subject { color: var(--muted); font-size: .9rem; }
.register-decision { font-weight: 600; white-space: pre-wrap; }

/* Version mobile */
.tabbar { display: none; }
.logout-icon { display: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }

@media (max-width: 720px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.page-login { padding-bottom: 0; }

  .topbar { padding: max(10px, env(safe-area-inset-top)) 16px 10px; gap: 10px; flex-wrap: nowrap; }
  .brand { font-size: 1.08rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topnav, .topuser-name, .logout-label { display: none; }
  .logout-icon { display: block; }
  .topuser .btn-ghost { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(10, 13, 22, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px;
    color: var(--muted); text-decoration: none; font: 600 .68rem var(--sans); letter-spacing: .01em;
  }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--gold); background: var(--gold-soft); }

  input, select, textarea { font-size: 16px; }
  .inline input, .inline select { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn-small { min-height: 36px; padding: 7px 14px; }

  .city { padding: 0 0 24px; }
  .scene-wrap { margin: 0 0 14px; border-radius: 0; border-left: 0; border-right: 0; }
  .stage { aspect-ratio: auto; height: clamp(260px, 46vh, 360px); min-height: 0; }
  .stage-hint { display: none !important; }
  .stage-tools { top: 10px; right: 10px; gap: 8px; }
  .stage-tools .btn { width: 40px; height: 40px; min-height: 40px; }
  .scene-status { font-size: .86rem; }
  .goal-bar { padding: 10px 16px; }
  .columns { padding: 0 12px; gap: 14px; }
  .main-col, .side-col { gap: 14px; }
  .panel { padding: 16px; border-radius: 12px; }
  .ask label { font-size: 1.02rem; }
  .ask-actions { flex-direction: column; align-items: stretch; }
  .ask-actions .btn, .ruling-actions .btn { width: 100%; }
  .room-question { font-size: 1.02rem; }
  .opinions, .options, .cards { grid-template-columns: 1fr; }
  .ruling-actions { flex-direction: column; align-items: stretch; }
  .chat-messages { max-height: 55vh; }
  .chat .card-head { flex-wrap: wrap; }
  .chat-title { flex-basis: calc(100% - 52px); }
  .chat-form { flex-direction: row; align-items: flex-end; }
  .chat-form .btn { flex: none; }
  .msg { max-width: 92%; }
  .people .person { padding: 7px 12px; }

  .admin { padding: 20px 12px 24px; }
  .admin h1 { font-size: 1.55rem; }
  .lead { margin-bottom: 16px; }
  .section-head .btn { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .goal-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .goal-figures strong { font-size: 1.25rem; }
  .goal-figures span { font-size: .78rem; }
  .step { gap: 10px; padding: 10px; }
  .step .btn { flex-basis: calc(100% - 36px); margin-left: 36px; text-align: center; }
  .action { flex-direction: column; align-items: stretch; }
  .action-buttons .btn { flex: 1; }
  .register li { flex-direction: column; align-items: stretch; gap: 6px; }

  .table-wrap { overflow: visible; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table thead { display: none; }
  .stack-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel-2); }
  .stack-table tr:last-child td { border-bottom: 0; }
  .stack-table td { border: 0; padding: 4px 0; text-align: left; white-space: normal; }
  .stack-table td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .stack-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
  .stack-table .cell-title { font-weight: 600; font-size: 1rem; padding-bottom: 6px; }
  .stack-table .actions { display: grid; gap: 8px; min-width: 0; }
  .stack-table .actions::before { margin-bottom: 2px; }
  .stack-table .inline { display: flex; width: 100%; margin: 0; }
  .stack-table .inline input[type="password"], .stack-table .inline select { flex: 1; width: auto; min-width: 0; }
  .stack-table .cell-actions { text-align: right; }

  .login { padding: 16px; align-items: center; }
  .login-card { padding: 28px 22px; }
}

@media (display-mode: standalone) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
}

.action-mine { border-left-color: var(--gold); background: var(--gold-soft); }
.state-gold { color: var(--gold); border-color: rgba(212, 175, 106, .5); }
.register .state { display: inline-block; margin-top: 6px; }

/* Décision de l'équipe */
.ask-hint { margin: -4px 0 10px; }
.decision-headline { font: 600 1.18rem/1.45 var(--serif); color: var(--text); padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; margin-bottom: 14px; }
.decision-block { margin-top: 12px; }
.decision-block h3 { font: 600 .74rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin-bottom: 6px; }
.decision-block .rich { font-size: .95rem; color: #d3d7e6; }
.decision-dissent .rich { color: var(--muted); font-style: italic; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan li { display: flex; gap: 10px; align-items: baseline; font-size: .95rem; }
.plan-who { flex: none; min-width: 74px; font: 700 .78rem var(--sans); color: #10131f; background: var(--c, var(--gold)); border-radius: 999px; padding: 2px 10px; text-align: center; }
.verdict { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(212, 175, 106, .35); display: grid; gap: 12px; }
.verdict-banner { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid rgba(212, 175, 106, .5); }
.verdict-banner strong { color: var(--gold); font: 600 .78rem var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.verdict-banner span { white-space: pre-wrap; }
.verdict-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.verdict-form label { display: block; font: 600 1rem var(--serif); margin-bottom: 8px; }
.thread { display: grid; gap: 8px; }
.thread:empty { display: none; }
.thread-msg { padding: 10px 14px; border-radius: 12px; font-size: .93rem; display: grid; gap: 4px; }
.thread-msg strong { font: 600 .74rem var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.thread-msg p { white-space: pre-wrap; }
.thread-mine { background: var(--gold-soft); border: 1px solid rgba(212, 175, 106, .35); margin-left: 24px; }
.thread-mine strong { color: var(--gold); }
.thread-team { background: var(--panel-2); border: 1px solid var(--line); margin-right: 24px; }
.thread-team strong { color: var(--muted); }
@media (max-width: 720px) {
  .verdict-buttons .btn { flex: 1 1 100%; }
  .plan li { flex-direction: column; gap: 4px; }
  .thread-mine { margin-left: 12px; }
  .thread-team { margin-right: 12px; }
}
