/* ================================================================
   Opération Dossiers Disparus — CTF UI
   Layout: CSS Grid (sidebar + main). No flex on body.
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:      #0b0f1a;
  --c-sidebar: #060a12;
  --c-surface: #111828;
  --c-border:  #2a3f62;
  --c-muted:   #6080aa;
  --c-soft:    #a0bcdc;
  --c-text:    #eaf2ff;
  --c-accent:  #f5c800;
  --c-green:   #2ecc71;
  --c-blue:    #5ba3e8;
  --c-red:     #e74c3c;
  --sw: 280px;
}

html {
  height: 100%;
  font-size: 20px;
}

body {
  font-family: "Courier New", Courier, monospace;
  font-size: 1rem;
  line-height: 1.65;
  background: var(--c-bg);
  color: var(--c-text);
  height: 100%;
}

/* ── LAYOUT ────────────────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: var(--sw) 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */

.sidebar {
  grid-column: 1;
  background: var(--c-sidebar);
  border-right: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-duck { font-size: 1.6rem; line-height: 1; }

.logo-text { display: flex; flex-direction: column; gap: 0; }
.logo-op   { font-size: 0.65rem; letter-spacing: 0.2em; color: var(--c-soft); text-transform: uppercase; }
.logo-name { font-size: 1.05rem; font-weight: 700; color: var(--c-accent); letter-spacing: 0.05em; }
.logo-sub  { font-size: 0.65rem; letter-spacing: 0.18em; color: var(--c-soft); text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 0.4rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--c-soft);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}

.nav-item:hover {
  color: var(--c-text);
  background: rgba(255,255,255,0.05);
}

.nav-item.active {
  color: var(--c-accent);
  background: rgba(245,200,0,0.10);
  border-left-color: var(--c-accent);
}

.nav-icon { font-size: 1rem; }

.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--c-border);
  font-size: 0.75rem;
  color: var(--c-soft);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.back-link {
  color: var(--c-soft);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.1s;
}

.back-link:hover { color: var(--c-accent); }

/* ── MAIN ──────────────────────────────────────────────────────── */

.main {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* ── TOPBAR ────────────────────────────────────────────────────── */

.topbar {
  background: var(--c-sidebar);
  border-bottom: 1px solid var(--c-border);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 0.6rem; }

.topbar-back {
  color: var(--c-muted);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.1s;
}

.topbar-back:hover { color: var(--c-accent); }

.topbar-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; color: var(--c-text); }
.topbar-badge { font-size: 0.65rem; letter-spacing: 0.1em; color: var(--c-soft); border: 1px solid var(--c-border); padding: 0.2rem 0.5rem; }

/* ── CONTENT ───────────────────────────────────────────────────── */

.content {
  padding: 2rem 2.5rem;
  width: 100%;
  flex: 1;
}

/* ── TABS ──────────────────────────────────────────────────────── */

.tab-pane { display: none; }

/* ── MISSION CARD ──────────────────────────────────────────────── */

.mission-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-accent);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.mission-stamp {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--c-accent);
  border: 1px solid rgba(245,200,0,0.5);
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.8rem;
}

.mission-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.mission-card p { font-size: 1.05rem; color: var(--c-soft); line-height: 1.7; margin-bottom: 0.35rem; }
.mission-card strong { color: var(--c-text); }

.mission-prereq {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
  font-size: 0.72rem;
}

.prereq-tag { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.15em; color: var(--c-soft); border: 1px solid var(--c-border); padding: 0.15rem 0.5rem; }
.mission-prereq a { color: var(--c-blue); text-decoration: none; font-size: 0.9rem; }
.mission-prereq a:hover { text-decoration: underline; }
.prereq-note { color: var(--c-soft); font-size: 0.88rem; }

.mission-unlock-notice {
  margin-top: 0.9rem;
  padding: 0.55rem 0.9rem;
  background: rgba(30, 90, 160, 0.15);
  border-left: 3px solid var(--c-blue);
  color: var(--c-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}
.mission-unlock-notice strong { color: var(--c-text); }
.unlock-flag-link { color: var(--c-blue); text-decoration: underline; cursor: pointer; }
.unlock-flag-link:hover { color: var(--c-text); }

/* ── SCENARIO CHAIN ────────────────────────────────────────────── */

.scenario-chain {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.25rem;
}

.chain-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.1s;
  min-width: 75px;
  padding: 0.5rem 0.8rem;
}

.chain-btn:hover:not([disabled]) { border-color: var(--c-accent); color: var(--c-text); }
.chain-btn.active { background: rgba(240,192,0,0.08); border-color: var(--c-accent); color: var(--c-accent); }

.chain-btn-locked {
  opacity: 0.35;
  cursor: not-allowed !important;
  filter: grayscale(1);
}

.cbtn-lock { font-size: 0.85rem; }

.cbtn-num { font-size: 1.3rem; font-weight: 700; }
.cbtn-lbl { font-size: 0.7rem; letter-spacing: 0.04em; }

.chain-line { flex: 1; max-width: 40px; height: 1px; background: var(--c-border); }

/* ── SCENARIO PANEL ────────────────────────────────────────────── */

.sc-panel {
  display: flex;
  gap: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  margin-bottom: 1.5rem;
  overflow: hidden;
  min-height: 45vh;
}

.sc-aside {
  width: 165px;
  min-width: 165px;
  background: var(--c-sidebar);
  border-right: 1px solid var(--c-border);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.sc-index {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--c-accent);
  opacity: 0.5;
}

.sc-tags { display: flex; flex-direction: column; gap: 0.2rem; }
.sc-tags-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.15em; color: var(--c-soft); margin-bottom: 0.25rem; text-transform: uppercase; }

.sc-tag-link { text-decoration: none; display: block; }
.sc-tag-link code { transition: color 0.1s, border-color 0.1s; }
.sc-tag-link:hover code { color: var(--c-accent); border-color: rgba(245,200,0,0.5); }
.sc-tags code {
  display: block;
  font-size: 0.78rem;
  font-family: inherit;
  background: rgba(0,0,0,0.3);
  color: var(--c-soft);
  border: 1px solid var(--c-border);
  padding: 0.2rem 0.45rem;
  white-space: normal;
  word-break: break-word;
}

.sc-body { flex: 1; padding: 1.5rem 1.8rem; min-width: 0; overflow-y: auto; }

.sc-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--c-text); }

.sc-section {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--c-green);
  text-transform: uppercase;
  margin: 0.9rem 0 0.45rem;
}

.sc-context {
  background: rgba(0,0,0,0.25);
  border-left: 3px solid var(--c-border);
  padding: 0.85rem 1.1rem;
  color: var(--c-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}

.sc-context p { margin: 0; }
.sc-context code { color: var(--c-blue); }

.sc-steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; counter-reset: s; }
.sc-steps li {
  counter-increment: s;
  display: flex;
  gap: 0.85rem;
  font-size: 0.92rem;
  color: var(--c-soft);
  line-height: 1.6;
}
.sc-steps li::before {
  content: counter(s);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  min-width: 1.6rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--c-border);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-soft);
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.sc-steps strong { color: var(--c-text); }

.sc-flag {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(39,174,96,0.25);
  padding: 0.55rem 0.75rem;
  margin-top: 0.2rem;
}

.sc-flag code { color: var(--c-green); font-family: inherit; font-size: 0.95rem; word-break: break-all; }
.sc-flag p { font-size: 0.9rem; color: var(--c-soft); margin-top: 0.25rem; }

.sc-hints { display: flex; flex-direction: column; gap: 0.25rem; }

.sc-epilogue-banner {
  border-left: 4px solid var(--c-green);
  background: rgba(46,204,113,0.08);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.sc-epilogue-banner .sc-epilogue-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--c-green);
  margin-bottom: 0.5rem;
}
.sc-epilogue-banner .sc-epilogue-text {
  font-size: 0.92rem;
  color: var(--c-soft);
  font-style: italic;
  line-height: 1.65;
}

.mission-stamp.mission-done { color: var(--c-green); }
.mission-card.mission-done { border-top-color: var(--c-green); }

/* ── DETAILS ───────────────────────────────────────────────────── */

details { border: 1px solid var(--c-border); overflow: hidden; }
details + details { border-top: none; }

summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-muted);
  background: rgba(0,0,0,0.18);
  user-select: none;
  transition: color 0.1s;
}

summary::before { content: "▶"; font-size: 0.45rem; color: var(--c-muted); transition: transform 0.15s; flex-shrink: 0; }
details[open] summary::before { transform: rotate(90deg); }
summary:hover { color: var(--c-text); }
details[open] summary { color: var(--c-text); border-bottom: 1px solid var(--c-border); }

details > *:not(summary) { padding: 0.7rem 0.8rem; background: var(--c-surface); }

details pre code {
  display: block;
  background: rgba(0,0,0,0.4);
  padding: 1.2rem 1.5rem;
  color: #c0d8f0;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

details p { font-size: 0.95rem; color: var(--c-soft); line-height: 1.65; }
details p code { color: var(--c-blue); }

/* ── SUBMIT ────────────────────────────────────────────────────── */

.submit-trigger {
  background: none;
  border: 1px solid var(--c-accent);
  color: var(--c-accent);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  margin-right: 0.75rem;
  transition: background 0.1s;
}
.submit-trigger:hover { background: rgba(245,200,0,0.08); }

.submit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,12,20,0.88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.submit-overlay[hidden] { display: none; }

.submit-modal {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-accent);
  width: 680px;
  max-width: calc(100vw - 2rem);
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.submit-modal-stamp {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-accent);
  border: 1px solid rgba(245,200,0,0.4);
  padding: 0.2rem 0.55rem;
}

.submit-modal-close {
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  transition: color 0.1s;
}
.submit-modal-close:hover { color: var(--c-text); }

.helper-tabs {
  display: flex;
  border-bottom: 1px solid var(--c-border);
  gap: 0;
}

.helper-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--c-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
  margin-bottom: -1px;
}

.helper-tab:hover { color: var(--c-text); }

.helper-tab.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

.helper-pane { display: none; }
.helper-pane.active { display: flex; flex-direction: column; gap: 0.85rem; }

.submit-modal-desc {
  font-size: 0.9rem;
  color: var(--c-soft);
  margin: 0;
}

.submit-modal pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--c-border);
  padding: 1.1rem 1.4rem;
  overflow-x: auto;
  margin: 0;
}

.submit-modal pre code {
  font-size: 0.95rem;
  color: #c0d8f0;
  font-family: inherit;
  line-height: 1.7;
}

/* ── LEADERBOARD LAYOUT ────────────────────────────────────────── */

.lb-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.lb-main { min-width: 0; }

.lb-feed {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-accent);
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feed-header {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-accent);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.feed-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feed-empty {
  font-size: 0.78rem;
  color: var(--c-muted);
  padding: 1.2rem 1rem;
  text-align: center;
}

.feed-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.feed-item-success  { border-left: 3px solid var(--c-green); }
.feed-item-rejected { border-left: 3px solid var(--c-red); }
.feed-item-hint     { border-left: 3px solid #f0c000; }
.feed-item-register { border-left: 3px solid #5b9cf6; }

.feed-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.feed-tag {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border: 1px solid;
}

.feed-tag-success  { color: var(--c-green); border-color: rgba(46,204,113,0.4); }
.feed-tag-rejected { color: var(--c-red);   border-color: rgba(231,76,60,0.4); }
.feed-tag-hint     { color: #f0c000;        border-color: rgba(240,192,0,0.4); }
.feed-tag-register { color: #5b9cf6;        border-color: rgba(91,156,246,0.4); }

.feed-time {
  font-size: 0.6rem;
  color: var(--c-muted);
}

.feed-detail {
  font-size: 0.78rem;
  color: var(--c-soft);
  line-height: 1.5;
}

.feed-pseudo {
  color: var(--c-text);
  font-weight: 700;
}

.feed-reason {
  font-size: 0.7rem;
  color: var(--c-muted);
  margin-top: 0.2rem;
  font-style: italic;
}

/* ── PODIUM ────────────────────────────────────────────────────── */

.podium-row { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

.podium-card {
  flex: 1;
  min-width: 120px;
  padding: 0.9rem 0.85rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.p-gold   { background: rgba(240,192,0,0.07);   border: 1px solid rgba(240,192,0,0.25); }
.p-silver { background: rgba(150,160,180,0.07);  border: 1px solid rgba(150,160,180,0.2); }
.p-bronze { background: rgba(205,127,50,0.07);   border: 1px solid rgba(205,127,50,0.2); }

.p-trophy { font-size: 1.2rem; line-height: 1; margin-bottom: 0.25rem; }
.p-place  { font-size: 0.5rem; font-weight: 700; letter-spacing: 0.15em; color: var(--c-muted); text-transform: uppercase; }
.p-name   { font-size: 1rem; font-weight: 700; color: var(--c-text); margin-top: 0.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-score  { font-size: 0.72rem; color: var(--c-soft); }

.stat-card { min-width: 80px; background: var(--c-surface); border: 1px solid var(--c-border); padding: 0.9rem 0.85rem 0.8rem; display: flex; flex-direction: column; gap: 0.2rem; }
.stat-num  { font-size: 1.65rem; font-weight: 700; color: var(--c-text); line-height: 1; }
.stat-label{ font-size: 0.48rem; font-weight: 700; letter-spacing: 0.15em; color: var(--c-muted); text-transform: uppercase; }

/* ── CHART ─────────────────────────────────────────────────────── */

.chart-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  padding: 0.9rem;
  height: 280px;
  position: relative;
  margin-bottom: 1.25rem;
}

/* ── TABLE ─────────────────────────────────────────────────────── */

#updated { font-size: 0.58rem; color: var(--c-muted); margin-bottom: 0.5rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.9rem; text-align: center; border-bottom: 1px solid var(--c-border); font-size: 0.88rem; }
th { background: var(--c-sidebar); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-soft); }
td:nth-child(2) { text-align: left; font-weight: 600; }
tr:hover { background: var(--c-surface); }

.rank-1  { color: #f0c000; }
.rank-2  { color: #a0b0c8; }
.rank-3  { color: #cd7f32; }
.solved  { color: var(--c-green); font-weight: 600; }
.unsolved{ color: var(--c-muted); }
.score   { font-size: 0.85rem; font-weight: 700; }

/* ── MAP ───────────────────────────────────────────────────────── */

#map { width: 100%; }
.map-legend {
  position: absolute;
  bottom: 1.5rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: rgba(6, 10, 18, 0.85);
  border: 1px solid var(--c-border);
  padding: 0.4rem 0.8rem;
  font-size: 0.65rem;
  color: var(--c-muted);
  z-index: 1000;
}
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── RESPONSIVE ────────────────────────────────────────────────── */

/* ── LANDING PAGE ─────────────────────────────────────────────── */

.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}

.landing-duck { font-size: 3rem; line-height: 1; margin-bottom: 0.5rem; }

.landing-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.landing-subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--c-soft);
  text-transform: uppercase;
  margin-top: 0.8rem;
}

.landing-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 700px;
}

.landing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  padding: 1.5rem 1.2rem;
  min-width: 180px;
  flex: 1;
  text-decoration: none;
  color: var(--c-text);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  text-align: center;
}

.landing-card:hover {
  border-color: var(--c-accent);
  background: rgba(240,192,0,0.04);
}

.landing-card-icon { font-size: 2rem; line-height: 1; }

.landing-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--c-accent);
}

.landing-card-desc {
  font-size: 0.78rem;
  color: var(--c-soft);
  line-height: 1.5;
}

/* ── AGENT BADGE ───────────────────────────────────────────────── */

.agent-badge {
  display: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  border: 1px solid rgba(245,200,0,0.4);
  background: rgba(245,200,0,0.06);
  padding: 0.4rem 0.7rem;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-agent {
  font-size: 1rem;
  padding: 0.4rem 1rem;
  margin-top: 0.6rem;
  letter-spacing: 0.18em;
}

/* ── AGENT MODAL ───────────────────────────────────────────────── */

#agent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,12,20,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#agent-modal {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 2px solid var(--c-accent);
  padding: 2rem 2.2rem 1.8rem;
  width: 340px;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.modal-stamp {
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--c-accent);
  border: 1px solid rgba(240,192,0,0.35);
  display: inline-block;
  padding: 0.1rem 0.4rem;
  align-self: flex-start;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: 0.05em;
}

.modal-desc {
  font-size: 0.78rem;
  color: var(--c-soft);
  line-height: 1.55;
}

#agent-input {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
  outline: none;
  width: 100%;
  margin-top: 0.2rem;
}

#agent-input:focus { border-color: var(--c-accent); }
#agent-input::placeholder { color: var(--c-muted); }

#agent-confirm {
  background: none;
  border: 1px solid var(--c-accent);
  color: var(--c-accent);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  cursor: pointer;
  align-self: flex-end;
  transition: background 0.1s;
}

#agent-confirm:hover { background: rgba(240,192,0,0.08); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60%  { transform: translateX(-6px); }
  40%,80%  { transform: translateX(6px); }
}

#agent-input.shake { animation: shake 0.4s ease; border-color: var(--c-red); }

/* ── RESPONSIVE ────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { grid-column: 1; }
  .content { padding: 1rem; }
  .sc-panel { flex-direction: column; }
  .sc-aside { width: 100%; min-width: 0; flex-direction: row; border-right: none; border-bottom: 1px solid var(--c-border); }
  .landing-cards { flex-direction: column; }
  .landing-card { min-width: 0; }
}
