:root {
  --bg: #060b1f;
  --panel: #0d1838;
  --panel-2: #132251;
  --line: #24397a;
  --line-2: #3a58b0;
  --text: #dde7ff;
  --dim: #8596c8;
  --accent: #6ae8ff;
  --accent-ink: #031424;
  --gold: #ffc94a;
  --info: #6ae8ff;
  --warn: #ffb547;
  --crit: #ff4f6d;
  --ok: #7dffb2;
  --radius: 4px;
  --pixel: "Silkscreen", ui-monospace, Consolas, monospace;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
}

/* Ciel polaire : aurore boréale discrète au-dessus de la station. */
body {
  background:
    radial-gradient(ellipse 80% 40% at 20% -5%, rgba(106, 232, 255, 0.13), transparent 70%),
    radial-gradient(ellipse 60% 35% at 85% -10%, rgba(125, 255, 178, 0.09), transparent 70%),
    radial-gradient(ellipse 50% 30% at 55% 0%, rgba(160, 120, 255, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 3px);
  z-index: 100;
}

a { color: var(--accent); }
code { color: var(--gold); }

h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 { font-family: var(--pixel); letter-spacing: 0.05em; }
h2 { font-size: 0.95rem; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
h3 { font-size: 0.95rem; font-weight: 700; }
h3.section { margin: 22px 0 10px; font-family: var(--pixel); font-weight: 400; color: var(--gold); text-transform: uppercase; font-size: 0.85rem; }

.dim { color: var(--dim); }
.small { font-size: 0.82rem; }
.hidden { display: none !important; }

/* ---------- Mise en page ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px;
  background: linear-gradient(to bottom, rgba(19, 34, 81, 0.97), rgba(13, 24, 56, 0.97));
  border-bottom: 2px solid var(--line-2);
  box-shadow: 0 2px 0 #000;
}

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.core {
  flex: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px var(--accent), inset 0 0 6px var(--accent);
  animation: pulse 2.6s ease-in-out infinite;
}
.brand h1 { font-size: 1.05rem; color: var(--accent); text-shadow: 0 0 10px rgba(106, 232, 255, 0.5); }
.brand .who { color: var(--dim); font-size: 0.8rem; overflow-wrap: anywhere; }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 16px 0;
  border-bottom: 2px solid var(--line);
  scrollbar-width: none;
}
.tab {
  flex: none;
  padding: 8px 14px;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: none;
  color: var(--dim);
  font-family: var(--pixel);
  font-size: 0.8rem;
  text-transform: uppercase;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-color: var(--line); background: var(--panel); margin-bottom: -2px; padding-bottom: 10px; }
.badge {
  display: inline-block;
  min-width: 1.5em;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--crit);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-align: center;
}

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 390px) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-2.wide-right { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-2.even, .grid-2.wide-right { grid-template-columns: minmax(0, 1fr); }
}

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 3px 0 rgba(0, 0, 0, 0.45);
}
.panel + .panel { margin-top: 16px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.spread { justify-content: space-between; }
.row.spread > h2 { margin-bottom: 12px; }

/* ---------- Tuiles du Panoptique ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.tile { padding: 12px 14px; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); }
.tile-n { font-family: var(--pixel); font-size: 1.6rem; color: var(--accent); line-height: 1.1; }
.tile-l { font-size: 0.78rem; color: var(--dim); }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

/* ---------- Formulaires ---------- */

label { display: block; font-size: 0.82rem; color: var(--dim); }
label > input:not([type="checkbox"]):not([type="radio"]), label > select, label > textarea { margin-top: 4px; }

input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #040817;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); margin: 0 8px 0 0; vertical-align: -2px; flex: none; }

.check { display: flex; align-items: center; color: var(--text); font-size: 0.9rem; cursor: pointer; }
.checklist { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; padding: 8px 10px; border: 2px dashed var(--line); border-radius: var(--radius); }
.checklist:empty::before { content: "Aucun personnage pour l’instant."; color: var(--dim); font-size: 0.85rem; }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 0; }
legend { padding: 0 6px; font-size: 0.82rem; color: var(--dim); }
.hint { font-size: 0.78rem; color: var(--dim); margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(106, 232, 255, 0.05);
  color: var(--accent);
  font-family: var(--pixel);
  font-size: 0.78rem;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.btn:hover { background: rgba(106, 232, 255, 0.14); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { border-color: var(--crit); color: var(--crit); background: rgba(255, 79, 109, 0.05); }
.btn.danger:hover { background: rgba(255, 79, 109, 0.14); }
.btn.danger.primary { background: var(--crit); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--dim); background: none; }
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn.sm { padding: 3px 9px; font-size: 0.7rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
select.btn { font-family: var(--mono); text-transform: none; }

.error { color: var(--crit); font-size: 0.85rem; min-height: 1.2em; }

/* ---------- Cartes & listes ---------- */

.list > * + * { margin-top: 10px; }
.empty { padding: 22px; text-align: center; color: var(--dim); border: 2px dashed var(--line); border-radius: var(--radius); font-size: 0.9rem; }

.card {
  position: relative;
  padding: 12px 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
}
.card.sev-attention { border-left-color: var(--warn); }
.card.sev-critique { border-left-color: var(--crit); }
.card.unread { border-color: var(--crit); box-shadow: 0 0 18px rgba(255, 79, 109, 0.3); }
.card.pending { border-style: dashed; opacity: 0.88; }
.card.crew, .card.doc, .card.media-card { border-left-color: var(--line-2); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 6px; }
.card-head h3 { margin-right: auto; }
.card-body { overflow-wrap: anywhere; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.meta { font-size: 0.78rem; color: var(--dim); }
.kv { font-size: 0.85rem; margin-top: 6px; }
.kv b { color: var(--dim); font-weight: 400; }
summary { cursor: pointer; color: var(--dim); }
.log-line { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }

.pill {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--dim);
}
.pill.tag::before { content: "#"; }
.pill.sev-info { color: var(--info); border-color: rgba(106, 232, 255, 0.45); }
.pill.sev-attention { color: var(--warn); border-color: rgba(255, 181, 71, 0.5); }
.pill.sev-critique { color: var(--crit); border-color: rgba(255, 79, 109, 0.55); }
.pill.ok { color: var(--ok); border-color: rgba(125, 255, 178, 0.45); }
.pill.state-anomalie { color: var(--crit); border-color: rgba(255, 79, 109, 0.55); }
.pill.state-interrompu { color: var(--warn); }

.kind { font-family: var(--pixel); font-size: 0.7rem; text-transform: uppercase; color: var(--dim); }
.kind.alert { color: var(--crit); }

.excerpt { margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--line-2); font-size: 0.88rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 12px; border: 2px solid var(--line); border-radius: 999px; background: none; color: var(--dim); font: inherit; font-size: 0.8rem; cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- Fiche, objectifs, notes ---------- */

.objectives { list-style: none; margin: 0; padding: 0; }
.objectives li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.objectives li:last-child { border-bottom: none; }
.obj-box {
  flex: none;
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--line-2); border-radius: 3px;
  color: var(--accent-ink); font-weight: 700; font-size: 0.8rem;
}
.objectives li.done .obj-box { background: var(--ok); border-color: var(--ok); }
.objectives li.done > span:last-child { color: var(--dim); text-decoration: line-through; }
.objectives-admin { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.obj-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.obj-row .check { margin-right: auto; }
.obj-done { color: var(--dim); text-decoration: line-through; }
.objectives-admin > .btn { margin-top: 6px; }
.notes-view { margin-top: 6px; padding: 10px 12px; background: #040817; border: 1px solid var(--line); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.88rem; color: var(--text); }
#notes { min-height: 260px; }

/* ---------- Médias ---------- */

.media { margin: 10px 0 0; }
.media img, .media video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; border: 2px solid var(--line); border-radius: var(--radius); }
.media img { cursor: zoom-in; }
.media audio { width: 100%; }
.media figcaption { margin-top: 4px; font-size: 0.78rem; color: var(--dim); }
.media-text { padding: 10px 12px; background: #040817; border: 1px solid var(--line); border-radius: var(--radius); }
.card.doc .media, .card.media-card .media { margin-top: 0; }
.media-card .media-text { max-height: 130px; overflow: hidden; font-size: 0.8rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.media-card .media img, .media-card .media video { height: 130px; }

.dropzone {
  display: block;
  padding: 20px;
  text-align: center;
  color: var(--text);
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  background: rgba(106, 232, 255, 0.03);
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(106, 232, 255, 0.09); }

/* ---------- Voix de la machine ---------- */

.machine-voice { color: var(--accent); text-shadow: 0 0 6px rgba(106, 232, 255, 0.25); }
.redacted {
  display: inline-block;
  padding: 0 2px;
  color: #22325f;
  background: #22325f;
  border-radius: 2px;
  letter-spacing: -0.1em;
  animation: corrupt 3.2s steps(1) infinite;
  user-select: none;
}
.fragment.is-restored { color: #fff; background: rgba(106, 232, 255, 0.16); border-radius: 2px; padding: 0 2px; }
.fragment.is-hidden { color: var(--warn); background: rgba(255, 181, 71, 0.12); border-bottom: 1px dashed var(--warn); padding: 0 2px; }

.denied {
  padding: 48px 20px;
  text-align: center;
  border: 2px solid rgba(255, 79, 109, 0.5);
  border-radius: var(--radius);
  background: repeating-linear-gradient(-45deg, rgba(255, 79, 109, 0.06) 0 12px, transparent 12px 24px);
}
.denied strong { display: block; font-family: var(--pixel); font-weight: 400; font-size: 1.5rem; color: var(--crit); letter-spacing: 0.15em; animation: glitch 2.5s infinite; }

/* ---------- Connexion ---------- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.login-title h1 { font-size: 1.5rem; color: var(--accent); text-shadow: 0 0 12px rgba(106, 232, 255, 0.55); }
.boot { min-height: 7.5em; margin-bottom: 18px; font-size: 0.8rem; color: var(--dim); white-space: pre-wrap; }
.boot .ok { color: var(--ok); }
.boot .ko { color: var(--crit); }
.boot .warn { color: var(--warn); }
.cursor::after { content: "▌"; animation: blink 1s steps(1) infinite; color: var(--accent); }

/* ---------- Toasts & modale ---------- */

#toasts { position: fixed; right: 16px; bottom: 16px; left: 16px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  max-width: 420px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  cursor: pointer;
  animation: slidein 0.25s ease-out;
}
.toast.alert { border-color: var(--crit); box-shadow: 0 0 26px rgba(255, 79, 109, 0.4); }
.toast.error { border-color: var(--crit); color: var(--crit); }
.toast .kind { display: block; margin-bottom: 2px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; background: rgba(2, 5, 15, 0.78); }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; }
.modal.wide { max-width: 820px; }
.preview-box { margin-top: 10px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius); background: #040817; font-size: 0.88rem; }
.preview-box ul { margin: 6px 0 0; padding-left: 18px; }
.preview-box .del { color: var(--crit); }
.preview-box .keep { color: var(--ok); }

/* ---------- Joueur : barre d'onglets ---------- */

.tab-icon { margin-right: 6px; }
@media (min-width: 701px) {
  .tabs { flex-wrap: wrap; row-gap: 2px; }
}
@media (max-width: 700px) {
  .tabs.player-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 0 0 env(safe-area-inset-bottom);
    background: var(--panel-2);
    border-top: 2px solid var(--line-2);
    border-bottom: none;
  }
  .tabs.player-nav .tab {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 2px 7px;
    border: none; border-radius: 0; margin: 0;
    font-size: 0.55rem;
    min-width: 0;
  }
  .tabs.player-nav .tab-icon { margin: 0; font-size: 1.15rem; line-height: 1; font-family: var(--mono); }
  .tabs.player-nav .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabs.player-nav .tab[aria-selected="true"] { background: var(--panel); padding-bottom: 7px; box-shadow: inset 0 3px 0 var(--accent); }
  .tabs.player-nav .badge { position: absolute; top: 3px; right: 18%; margin: 0; }
  .player-nav ~ main { padding-bottom: 96px; }
  body:has(.player-nav) #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

.pill.camp { color: var(--gold); border-color: rgba(255, 201, 74, 0.5); }
.pill.code { font-family: var(--mono); color: var(--accent); border-style: dashed; }
.warn-text { color: var(--warn); }

/* ---------- Messagerie ---------- */

.messenger { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 14px; min-height: 60vh; }
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-items { display: flex; flex-direction: column; gap: 6px; }
.conv-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
  padding: 10px 12px; text-align: left;
  background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius);
  color: var(--text); font: inherit; cursor: pointer;
}
.conv-item.active { border-color: var(--accent); }
.conv-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-last { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { display: flex; flex-direction: column; min-height: 60vh; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 2px solid var(--line); }
.thread-back { display: none; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; max-height: 60vh; }
.msg { max-width: 82%; padding: 8px 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px 10px 10px 2px; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(106, 232, 255, 0.12); border-color: var(--accent); border-radius: 10px 10px 2px 10px; }
.msg.from-mj { border-color: var(--gold); }
.msg-meta { font-size: 0.72rem; color: var(--dim); margin-bottom: 2px; }
.msg-text { overflow-wrap: anywhere; }
.thread-form { display: flex; gap: 8px; padding: 10px; border-top: 2px solid var(--line); }
.thread-form textarea { min-height: 44px; flex: 1; }
#thread-readonly { padding: 10px 14px; }
@media (max-width: 700px) {
  .messenger { grid-template-columns: minmax(0, 1fr); }
  .messenger.has-thread .conv-list { display: none; }
  .messenger:not(.has-thread) .thread { display: none; }
  .thread-back { display: inline-flex; }
  .thread, .thread-msgs { min-height: 0; }
  .thread-msgs { max-height: calc(100vh - 330px); min-height: 240px; }
}

/* ---------- Recherches ---------- */

.progress { position: relative; height: 14px; margin: 10px 0 6px; background: #040817; border: 2px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: repeating-linear-gradient(90deg, var(--accent) 0 8px, #4fc7dd 8px 10px); transition: width 0.4s; }
.progress-mark { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--gold); opacity: 0.8; }
.progress-mark.reached { background: var(--ok); }
.card.project.done .progress-fill { background: var(--ok); }
.milestone-ok { color: var(--ok); }
.milestones { list-style: none; margin: 4px 0 0; padding: 0; font-size: 0.85rem; }
.milestones li { padding: 2px 0; color: var(--dim); }
.milestones li.done { color: var(--ok); }
.points-panel { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.points-big { font-family: var(--pixel); font-size: 2.4rem; color: var(--accent); line-height: 1; }
.points-big .dim { font-size: 1rem; }
.points-panel h2 { margin-bottom: 4px; }
.pts-amount input { width: 80px; }
@media (max-width: 520px) {
  .points-panel { grid-template-columns: auto 1fr; }
  .pts-amount { grid-column: 1 / -1; }
}
.milestone-row { border-style: dashed; }
.camp-row { display: flex; gap: 8px; align-items: center; }
.camp-row input:not([type="checkbox"]) { flex: 1; }
.camp-row .check { flex: none; font-size: 0.8rem; }

/* ---------- Néron, preuves, inventaire ---------- */

.sys-line { display: flex; gap: 10px; padding: 5px 0; font-size: 0.88rem; border-bottom: 1px solid var(--line); }
.sys-line.ok { color: var(--ok); }
.sys-line.ko { color: var(--dim); }
.locked { display: flex; gap: 12px; align-items: center; padding: 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); color: var(--dim); }
.lock-icon { font-size: 1.6rem; color: var(--crit); }
.crew-journal { padding: 10px 14px; }
.crew-journal + .crew-journal { margin-top: 8px; }
.card.clue { border-left-color: var(--gold); }
.holders { margin: 4px 0 0; padding-left: 18px; font-size: 0.85rem; }
.holders li { padding: 2px 0; }
.inventory { list-style: none; margin: 0; padding: 0; }
.inventory li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.inventory li:last-child { border-bottom: none; }
.item-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item-row > div { flex: 1; min-width: 160px; }
.item-row select { width: auto; max-width: 180px; }
.card.action-card { border-left-color: var(--line-2); font-size: 0.88rem; }

/* ---------- Lieux & QR codes ---------- */

.card.space.locked-space { border-left-color: var(--crit); }
.qr-box { display: grid; place-items: center; min-height: 120px; margin: 8px 0; padding: 8px; background: #fff; border-radius: var(--radius); color: #000; font-size: 0.75rem; }
.qr-box img { display: block; width: 100%; max-width: 170px; image-rendering: pixelated; }
.qr-url { overflow-wrap: anywhere; }

#print-sheet { display: none; }
@media print {
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing::after { display: none; }
  body.printing #print-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; color: #000; }
  .qr-print { break-inside: avoid; padding: 18px; border: 2px dashed #000; text-align: center; font-family: var(--mono); }
  .qr-print img { width: 75%; image-rendering: pixelated; }
  .qr-print-name { margin-top: 10px; font-family: var(--pixel); font-size: 1.4rem; }
  .qr-print-sub { font-size: 0.8rem; }
}

/* ---------- Animations ---------- */

@keyframes pulse { 50% { box-shadow: 0 0 3px var(--accent), inset 0 0 2px var(--accent); opacity: 0.65; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
@keyframes corrupt { 0%, 91% { transform: none; } 92% { transform: translateX(2px); background: #3a58b0; } 95% { transform: translateX(-1px); } }
@keyframes glitch { 0%, 88%, 100% { transform: none; text-shadow: none; } 90% { transform: translateX(-3px); text-shadow: 3px 0 var(--info); } 93% { transform: translateX(2px); text-shadow: -2px 0 var(--ok); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

@media (max-width: 520px) {
  html, body { font-size: 14px; }
  .two { grid-template-columns: 1fr; }
  .topbar { padding: 8px 12px; }
  main { padding: 14px 12px 60px; }
  .tabs { padding: 8px 12px 0; }
  .tab { padding: 8px 10px; font-size: 0.72rem; }
}
