:root {
  color-scheme: dark;
  --ink-950: #061014;
  --ink-900: #08171c;
  --ink-850: #0b1d23;
  --ink-800: #10272e;
  --ink-700: #1b3740;
  --ink-600: #2a4b55;
  --paper: #f5f2e8;
  --muted: #9cb0b4;
  --faint: #6d8388;
  --amber: #f6b84a;
  --amber-bright: #ffd477;
  --teal: #68d5c8;
  --coral: #ff806e;
  --violet: #8e9cff;
  --green: #75d49a;
  --danger: #ff6d6d;
  --shadow: 0 30px 70px rgba(0, 0, 0, .32);
  --line: rgba(210, 236, 236, .11);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink-950); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 8% -10%, rgba(104, 213, 200, .12), transparent 35rem),
    radial-gradient(circle at 100% 20%, rgba(246, 184, 74, .09), transparent 30rem),
    var(--ink-950);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

::selection { color: #061014; background: var(--teal); }

.app-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.loading-mark {
  width: 62px;
  height: 62px;
  border: 2px solid rgba(104, 213, 200, .18);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}

.auth-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(38px, 6vw, 86px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(120deg, rgba(6, 16, 20, .92), rgba(6, 16, 20, .35)),
    radial-gradient(circle at 70% 42%, rgba(104, 213, 200, .15), transparent 24rem),
    linear-gradient(145deg, #0a252c 0%, #112d31 45%, #101c22 100%);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-visual::before {
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgba(160, 207, 210, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 207, 210, .12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to right, transparent, black 30%, black);
}

.auth-visual::after {
  width: 34rem;
  height: 34rem;
  right: -9rem;
  bottom: -11rem;
  border: 1px solid rgba(246, 184, 74, .3);
  border-radius: 50%;
  box-shadow:
    0 0 0 5rem rgba(246, 184, 74, .025),
    0 0 0 10rem rgba(246, 184, 74, .018);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 42px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--amber);
}

.brand-mark svg { width: 100%; height: 100%; }
.brand-word { font-size: 1rem; }
.brand-version { margin-left: 3px; color: var(--faint); font-size: .68rem; letter-spacing: .06em; }
.brand-lockup { display: grid; gap: 2px; line-height: 1.05; }
.brand-kicker { color: var(--teal); font-size: .48rem; letter-spacing: .2em; }
.brand-lockup .brand-word { max-width: 154px; font-size: .82rem; line-height: 1.22; letter-spacing: .1em; }

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 770px;
  margin: 80px 0;
}

.eyebrow {
  color: var(--amber);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-copy h1 {
  max-width: 720px;
  margin: 20px 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.3rem, 7vw, 7.6rem);
  line-height: .88;
  letter-spacing: -.065em;
  font-weight: 500;
}

.auth-copy h1 em { color: var(--teal); font-style: normal; }

.auth-copy > p {
  max-width: 620px;
  margin: 0;
  color: #c6d4d4;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.7;
}

.doctrine-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.doctrine-strip span {
  padding: 8px 12px;
  border: 1px solid rgba(104, 213, 200, .18);
  border-radius: 999px;
  color: #b6cbcd;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-panel {
  min-height: 100vh;
  padding: 38px clamp(28px, 5vw, 76px);
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  background: rgba(5, 14, 17, .83);
  backdrop-filter: blur(18px);
}

.auth-card { width: min(100%, 440px); }

.auth-card h2 {
  margin: 16px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -.035em;
}

.auth-card .lede {
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.65;
}

.text-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  padding: 10px 0;
  text-align: left;
}

.text-button:hover { color: #a2eee5; }
.text-button:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }

.recovery-result {
  border: 1px solid rgba(104, 213, 200, .25);
  border-radius: 12px;
  background: rgba(104, 213, 200, .07);
  color: var(--muted);
  line-height: 1.6;
  margin: 18px 0;
  padding: 18px;
}

.recovery-result strong { color: var(--text); }
.recovery-result p { margin: 6px 0 0; }

.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: grid; gap: 8px; }

.field label {
  color: #b9c9cb;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field small { color: var(--faint); line-height: 1.5; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(213, 236, 235, .14);
  border-radius: 12px;
  outline: none;
  color: var(--paper);
  background: rgba(16, 39, 46, .72);
  padding: 12px 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.textarea { min-height: 108px; resize: vertical; }

.input::placeholder,
.textarea::placeholder { color: #627a80; }

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(104, 213, 200, .7);
  background: rgba(16, 39, 46, .95);
  box-shadow: 0 0 0 4px rgba(104, 213, 200, .09);
}

.button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .015em;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; }

.button-primary { color: #102025; background: var(--amber); box-shadow: 0 10px 28px rgba(246, 184, 74, .16); }
.button-primary:hover { background: var(--amber-bright); }
.button-teal { color: #092126; background: var(--teal); }
.button-ghost { border-color: var(--line); color: #c6d2d3; background: rgba(255,255,255,.025); }
.button-ghost:hover { border-color: rgba(104, 213, 200, .3); background: rgba(104, 213, 200, .07); }
.button-danger { border-color: rgba(255, 109, 109, .28); color: #ffaaa0; background: rgba(255, 109, 109, .07); }
.button-wide { width: 100%; }
.button-small { min-height: 36px; padding: 7px 12px; font-size: .75rem; }

.form-error {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 109, 109, .22);
  border-radius: 10px;
  color: #ffb0a6;
  background: rgba(255, 109, 109, .07);
  font-size: .85rem;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 27px 18px 22px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(6, 16, 20, .84);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.sidebar .brand { padding: 0 10px 28px; }

.nav-label {
  margin: 15px 12px 8px;
  color: #607a7f;
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.nav { display: grid; gap: 5px; }

.nav-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8da3a8;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 720;
  font-size: .84rem;
}

.nav-button:hover { color: var(--paper); background: rgba(255,255,255,.035); }
.nav-button.active { color: var(--paper); border-color: rgba(104, 213, 200, .13); background: linear-gradient(90deg, rgba(104, 213, 200, .12), rgba(104, 213, 200, .03)); }
.nav-icon { width: 23px; height: 23px; display: grid; place-items: center; color: var(--teal); font-size: 1rem; }

.sidebar-bottom { margin-top: auto; }

.identity-card {
  padding: 13px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #0a1b1f;
  background: var(--amber);
  font-weight: 900;
}

.identity-card strong,
.identity-card small {
  overflow: hidden;
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.identity-card strong { font-size: .8rem; }
.identity-card small { margin-top: 2px; color: var(--faint); font-size: .68rem; }

.main { min-width: 0; }

.topbar {
  min-height: 76px;
  padding: 0 clamp(22px, 3.5vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 18, 22, .7);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--faint);
  font-size: .76rem;
  font-weight: 760;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.breadcrumb strong { color: #dce5e3; }

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.status-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px rgba(117, 212, 154, .09);
}

.content {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 56px);
}

.page-head {
  margin-bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.page-head h1 {
  margin: 7px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1;
}

.page-head p { max-width: 680px; margin: 10px 0 0; color: var(--muted); line-height: 1.55; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.metric-card,
.panel,
.scenario-card,
.session-card,
.role-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(16, 39, 46, .78), rgba(8, 24, 29, .82));
  box-shadow: 0 16px 45px rgba(0, 0, 0, .12);
}

.metric-card {
  min-height: 126px;
  padding: 20px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  right: -28px;
  top: -30px;
  border: 1px solid var(--metric-color, rgba(104,213,200,.2));
  border-radius: 50%;
  opacity: .45;
}

.metric-label { color: var(--muted); font-size: .69rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.metric-value { margin-top: 10px; font-family: Georgia, "Times New Roman", serif; font-size: 2.35rem; line-height: 1; }
.metric-note { margin-top: 7px; color: var(--faint); font-size: .72rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 20px;
}

.panel { border-radius: var(--radius); overflow: hidden; }

.panel-head {
  min-height: 65px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 { margin: 0; font-size: .9rem; letter-spacing: .03em; }
.panel-head p { margin: 4px 0 0; color: var(--faint); font-size: .72rem; }
.panel-body { padding: 20px; }

.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-state .empty-icon { margin: 0 auto 16px; font-size: 2rem; color: var(--teal); }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--paper); }
.empty-state p { max-width: 430px; margin: auto; line-height: 1.55; }

.session-list { display: grid; }

.session-row {
  padding: 17px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, auto);
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background .16s ease;
}

.session-row:last-child { border-bottom: 0; }
.session-row:hover { background: rgba(104, 213, 200, .045); }
.session-title { font-weight: 800; }
.session-meta { margin-top: 5px; display: flex; gap: 12px; flex-wrap: wrap; color: var(--faint); font-size: .72rem; }
.session-code { color: var(--amber); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; letter-spacing: .1em; }
.session-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.session-actions .session-code { margin-right: 6px; }
.session-hint { color: var(--faint); font-size: .7rem; }
.archive-panel { margin-top: 20px; }

.badge {
  min-height: 27px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #aebfc1;
  background: rgba(255,255,255,.025);
  font-size: .65rem;
  font-weight: 820;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.badge.status-active, .badge.status-complete { color: var(--green); border-color: rgba(117,212,154,.2); background: rgba(117,212,154,.07); }
.badge.status-paused { color: var(--amber); border-color: rgba(246,184,74,.2); }
.badge.status-lobby { color: var(--violet); border-color: rgba(142,156,255,.2); }
.badge.status-archived { color: var(--muted); border-color: var(--line); }

.principles { display: grid; gap: 8px; }

.principle {
  padding: 11px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 10px;
  color: #b8c7c9;
  background: rgba(255,255,255,.025);
  font-size: .78rem;
}

.principle-index {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--amber);
  background: rgba(246,184,74,.08);
  font: 800 .65rem ui-monospace, monospace;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.participant-room-grid { align-items: start; }

.participant-session-card {
  min-height: 178px;
  padding: 22px;
  align-self: start;
  display: flex;
  flex-direction: column;
  border-left: 4px solid var(--role-color, var(--teal));
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.participant-session-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--role-color, var(--teal)) 42%, var(--line));
  background: linear-gradient(145deg, rgba(20, 47, 55, .88), rgba(8, 24, 29, .9));
}

.participant-session-card .toolbar { margin-top: auto; }

.scenario-card {
  min-height: 390px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease;
}

.scenario-card:hover { transform: translateY(-3px); border-color: rgba(104,213,200,.25); }

.scenario-art {
  height: 184px;
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(135deg, rgba(8,23,28,.08), rgba(8,23,28,.7)),
    var(--scene-image),
    radial-gradient(circle at 68% 36%, var(--art-color, rgba(104,213,200,.2)), transparent 28%),
    linear-gradient(145deg, #0d2a33, #071519);
  background-size: cover;
  background-position: center;
}

.scenario-art::before {
  content: none;
}

.scenario-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(5,15,18,.82));
  pointer-events: none;
}

.scenario-art-shade { position: absolute; inset: 0; background: radial-gradient(circle at 55% 35%, transparent 15%, rgba(4,14,18,.22) 100%); }
.scenario-category { position: absolute; left: 16px; top: 16px; z-index: 2; backdrop-filter: blur(12px); background: rgba(5,15,18,.72); }
.scenario-art-meta { position: absolute; z-index: 2; left: 17px; right: 17px; bottom: 14px; display: flex; justify-content: space-between; align-items: center; color: #e7eeeb; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.difficulty-dots { display: inline-flex; gap: 4px; }
.difficulty-dots i { width: 13px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); }
.difficulty-dots i.on { background: var(--amber); box-shadow: 0 0 10px rgba(246,184,74,.35); }

.scenario-card-body { padding: 20px; display: flex; flex: 1; flex-direction: column; }
.scenario-card h3 { margin: 8px 0 4px; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 500; }
.scenario-subtitle { color: var(--muted); font-size: .82rem; }
.scenario-copy { margin: 14px 0; color: #93a9ad; font-size: .78rem; line-height: 1.55; }
.scenario-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scenario-facts { display: flex; gap: 10px; color: var(--faint); font-size: .68rem; }
.scenario-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.scenario-tags span { padding: 5px 8px; border: 1px solid rgba(104,213,200,.12); border-radius: 999px; color: #8eaaad; background: rgba(104,213,200,.035); font-size: .61rem; }
.content-advisory { margin: 0 0 16px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .68rem; }
.content-advisory summary { cursor: pointer; color: #bfd0d1; font-weight: 750; }
.content-advisory p { margin: 8px 0 5px; line-height: 1.5; }
.content-advisory small { color: var(--faint); }

.scenario-filterbar { margin: 0 0 22px; padding: 15px; display: grid; grid-template-columns: minmax(210px,1.4fr) repeat(4,minmax(130px,.65fr)) auto; gap: 12px; align-items: end; border: 1px solid var(--line); border-radius: 15px; background: rgba(8,24,29,.72); }
.scenario-filterbar .field { gap: 5px; }
.scenario-filterbar label { font-size: .58rem; }
.filter-clear { min-height: 44px; }
.library-count { color: var(--faint); font: 800 .7rem ui-monospace,monospace; text-transform: uppercase; letter-spacing: .08em; }
.filter-empty { grid-column: 1 / -1; }
.scenario-readiness { display: grid; grid-template-columns: minmax(0,1fr) minmax(250px,.8fr); gap: 18px; padding: 17px; border: 1px solid rgba(246,184,74,.15); border-radius: 13px; background: rgba(246,184,74,.04); }
.scenario-readiness strong { display: block; margin-top: 7px; }
.scenario-readiness p { margin: 6px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.source-links { display: grid; gap: 5px; }
.source-links span { color: var(--faint); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; }
.source-links a { color: var(--teal); font-size: .68rem; line-height: 1.4; text-decoration: none; }
.source-links a:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.table th {
  padding: 12px 15px;
  color: var(--faint);
  font-size: .64rem;
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
  background: rgba(255,255,255,.018);
}

.table td { padding: 14px 15px; border-top: 1px solid var(--line); color: #bdcbcc; }
.table strong { color: var(--paper); }
.type-dot { width: 8px; height: 8px; display: inline-block; margin-right: 8px; border-radius: 50%; background: var(--teal); }
.type-dot.admin { background: var(--amber); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  z-index: 100;
  background: rgba(2, 8, 10, .8);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(100%, 600px);
  max-height: min(90vh, 850px);
  overflow-y: auto;
  border: 1px solid rgba(210,236,236,.16);
  border-radius: 22px;
  background: #0b1b20;
  box-shadow: var(--shadow);
}

.modal-wide { width: min(100%, 980px); }
.modal-head { padding: 22px 24px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: Georgia,serif; font-size: 1.7rem; font-weight: 500; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.modal-body { padding: 24px; }
.modal-footer { padding: 18px 24px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.assignment-grid { display: grid; gap: 10px; margin-top: 18px; }

.assignment-row {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr);
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.02);
}

.role-identity { display: flex; gap: 12px; align-items: center; }
.role-color { width: 9px; height: 42px; flex: 0 0 auto; border-radius: 8px; background: var(--role-color); }
.role-identity strong { display: block; font-size: .85rem; }
.role-identity small { display: block; margin-top: 3px; color: var(--faint); font-size: .7rem; }

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(330px, .7fr);
  gap: 20px;
  align-items: start;
}

.live-main,
.live-rail { display: grid; gap: 20px; }

.scenario-banner {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(104,213,200,.14);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(13,38,45,.95), rgba(8,24,29,.8)),
    radial-gradient(circle at 86% 30%, rgba(246,184,74,.13), transparent 20rem);
}

.scenario-banner::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -130px;
  top: -150px;
  border: 1px solid rgba(246,184,74,.22);
  border-radius: 50%;
}

.scenario-banner h1 { margin: 8px 0 6px; font-family: Georgia,serif; font-size: clamp(2rem,4vw,3.6rem); font-weight: 500; letter-spacing: -.04em; }
.scenario-banner p { max-width: 780px; margin: 0; color: var(--muted); line-height: 1.55; }
.banner-meta { margin-top: 18px; display: flex; gap: 18px; flex-wrap: wrap; color: #a9babb; font-size: .72rem; }
.banner-meta strong { color: var(--paper); }

.scene-wrap {
  position: relative;
  min-height: 420px;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(104,213,200,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104,213,200,.025) 1px, transparent 1px),
    #071519;
  background-size: 28px 28px;
}

.scene-wrap.mode-cinematic {
  background-image:
    linear-gradient(90deg, rgba(4,14,18,.38), transparent 22%, transparent 72%, rgba(4,14,18,.5)),
    linear-gradient(0deg, rgba(4,14,18,.48), transparent 36%),
    var(--scene-background);
  background-size: cover;
  background-position: center;
}

.scene-svg { width: 100%; min-height: 420px; display: block; position: relative; z-index: 1; }
.scene-zone { stroke: rgba(198,222,222,.18); stroke-width: 2; fill: rgba(33,65,72,.45); }
.scene-zone.safe { fill: rgba(104,213,200,.08); stroke: rgba(104,213,200,.35); }
.scene-zone.path { fill: rgba(246,184,74,.04); stroke: rgba(246,184,74,.18); stroke-dasharray: 8 8; }
.scene-label { fill: #729096; font-size: 14px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.mode-cinematic .scene-zone { fill: rgba(7,21,25,.1); stroke: rgba(155,218,222,.18); stroke-dasharray: 8 7; }
.mode-cinematic .scene-zone.safe { fill: rgba(104,213,200,.04); stroke: rgba(104,213,200,.28); }
.mode-cinematic .scene-label { fill: rgba(227,240,238,.72); paint-order: stroke; stroke: rgba(4,14,18,.8); stroke-width: 5px; }
.scene-route { stroke: var(--teal); stroke-width: 4; stroke-dasharray: 11 9; filter: drop-shadow(0 0 6px rgba(104,213,200,.45)); }
.scene-route.risk { stroke: var(--coral); }
.scene-route.communication { stroke: var(--violet); }
.scene-mode { position: absolute; z-index: 4; top: 14px; right: 14px; padding: 4px; display: flex; border: 1px solid rgba(210,236,236,.15); border-radius: 10px; background: rgba(4,14,18,.8); backdrop-filter: blur(12px); }
.scene-mode button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.scene-mode button.active { color: #071519; background: var(--teal); }
.scene-mode button:disabled { opacity: .4; cursor: not-allowed; }
.replay-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--paper); font-size: .72rem; }
.replay-controls > div { display: flex; flex-wrap: wrap; gap: 6px; }
.replay-controls button { min-height: 34px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.replay-controls button.active { background: var(--teal); border-color: var(--teal); color: #071519; font-weight: 800; }
.phase-map-review { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.phase-map-review summary { cursor: pointer; color: var(--teal); font-size: .78rem; font-weight: 750; }
.phase-map-review summary:focus-visible, .replay-controls button:focus-visible, .scene-mode button:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.phase-map-review > p { color: var(--muted); font-size: .72rem; line-height: 1.5; }
.replay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.replay-grid > div { min-width: 0; }
.replay-grid strong { display: block; margin-bottom: 6px; color: var(--paper); font-size: .7rem; }
.replay-grid .scene-wrap, .replay-grid .scene-svg { min-height: 180px; }
.replay-grid .scene-mode { top: 6px; right: 6px; }
.replay-grid .scene-mode button { min-height: 28px; padding: 0 5px; }
.marker-ring { fill: rgba(7,21,25,.93); stroke-width: 3; }
.marker-ring.person { stroke: var(--teal); }
.marker-ring.helper { stroke: var(--violet); }
.marker-ring.unknown { stroke: var(--coral); stroke-dasharray: 5 4; }
.marker-ring.exit { stroke: var(--green); }
.marker-ring.vehicle { stroke: var(--amber); }
.marker-dot { fill: currentColor; }
.marker-label-bg { fill: rgba(5,15,18,.88); stroke: rgba(210,236,236,.1); }
.marker-label { fill: #dce5e3; font-size: 13px; font-weight: 750; }

.map-legend {
  position: absolute;
  left: 25px;
  bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  pointer-events: none;
}

.map-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .65rem; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.legend-dot.unknown { background: var(--coral); }
.legend-dot.helper { background: var(--violet); }

.stage-head {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.stage-title { display: flex; gap: 14px; }
.stage-number { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #082025; background: var(--amber); font-weight: 900; }
.stage-head h2 { margin: 0; font-family: Georgia,serif; font-size: 1.45rem; font-weight: 500; }
.stage-head p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.stage-time { color: var(--amber); font: 800 .78rem ui-monospace, monospace; }

.metric-bars { display: grid; gap: 15px; }

.metric-bar-head { margin-bottom: 7px; display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; font-weight: 760; }
.metric-track { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.055); }
.metric-fill { height: 100%; border-radius: inherit; background: var(--bar-color, var(--teal)); transition: width .45s ease; }

.assignment-list { display: grid; gap: 9px; }

.assignment-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 11px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.018);
}

.assignment-card .role-stripe { align-self: stretch; border-radius: 7px; background: var(--role-color); }
.assignment-card strong { display: block; font-size: .78rem; }
.assignment-card small { display: block; margin-top: 3px; color: var(--faint); font-size: .66rem; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #40555a; }
.online-dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(117,212,154,.08); }

.decision-status { display: grid; gap: 7px; }
.decision-line { padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; border-radius: 9px; background: rgba(255,255,255,.02); font-size: .72rem; }
.decision-line span { color: var(--muted); }
.decision-line strong { color: var(--paper); text-align: right; }

.timeline { display: grid; gap: 0; }

.timeline-item {
  position: relative;
  padding: 0 0 18px 23px;
  border-left: 1px solid rgba(104,213,200,.16);
}

.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; width: 8px; height: 8px; left: -4.5px; top: 4px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px #0d2228; }
.timeline-item time { display: block; margin-bottom: 4px; color: var(--faint); font: .63rem ui-monospace,monospace; }
.timeline-item p { margin: 0; color: #b6c5c7; font-size: .75rem; line-height: 1.5; }

.participant-shell { min-height: 100vh; }

.participant-topbar {
  min-height: 70px;
  padding: 0 clamp(18px,4vw,48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(6,16,20,.88);
  backdrop-filter: blur(15px);
}

.participant-content { width: min(100%, 1420px); margin: auto; padding: clamp(20px,3.5vw,48px); }

.role-hero {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 17px;
  border: 1px solid color-mix(in srgb, var(--role-color) 25%, transparent);
  border-radius: var(--radius);
  background: linear-gradient(115deg, color-mix(in srgb, var(--role-color) 10%, #0c2329), #0a1b20);
}

.role-emblem {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--role-color) 45%, transparent);
  border-radius: 17px;
  color: var(--role-color);
  background: color-mix(in srgb, var(--role-color) 9%, transparent);
  font-size: 1.4rem;
  font-weight: 900;
}

.role-hero h1 { margin: 3px 0 0; font-family: Georgia,serif; font-size: clamp(1.65rem,4vw,2.65rem); font-weight: 500; }
.role-hero p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }

.progress-steps { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.progress-step { width: 32px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress-step.done { background: var(--role-color); }

.player-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 20px;
  align-items: start;
}

.observation-card {
  padding: 26px;
  border: 1px solid rgba(104,213,200,.16);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(16,39,46,.9), rgba(8,24,29,.82));
}

.observation-card h2 { margin: 7px 0 14px; font-family: Georgia,serif; font-size: 1.7rem; font-weight: 500; }
.observation-card > p { margin: 0; color: #d1dcda; font-size: .95rem; line-height: 1.72; }
.cue {
  margin-top: 18px;
  padding: 13px 15px;
  border-left: 3px solid var(--amber);
  color: #b5c6c7;
  background: rgba(246,184,74,.055);
  font-size: .78rem;
  line-height: 1.55;
}

.choice-list { display: grid; gap: 11px; }

.choice {
  width: 100%;
  padding: 15px;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  gap: 13px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  background: rgba(255,255,255,.018);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.choice:hover { transform: translateX(2px); border-color: color-mix(in srgb, var(--role-color) 42%, transparent); background: color-mix(in srgb, var(--role-color) 5%, transparent); }
.choice.selected { border-color: var(--role-color); background: color-mix(in srgb, var(--role-color) 8%, transparent); }

.choice-radio { width: 20px; height: 20px; margin-top: 2px; border: 2px solid #536c72; border-radius: 50%; }
.choice.selected .choice-radio { border: 6px solid var(--role-color); }
.choice strong { display: block; font-size: .84rem; }
.choice p { margin: 5px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.choice-intent { padding: 5px 7px; border-radius: 7px; color: var(--amber); background: rgba(246,184,74,.06); font-size: .59rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }

.committed {
  padding: 14px;
  display: flex;
  gap: 11px;
  align-items: center;
  border: 1px solid rgba(117,212,154,.2);
  border-radius: 12px;
  color: #bae7cb;
  background: rgba(117,212,154,.065);
  font-size: .78rem;
}

.teammate-strip { display: flex; flex-wrap: wrap; gap: 8px; }

.teammate {
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255,255,255,.02);
  font-size: .68rem;
}

.message-list { max-height: 285px; overflow-y: auto; display: grid; gap: 9px; }
.message {
  padding: 11px 12px;
  border-radius: 11px 11px 11px 3px;
  background: rgba(104,213,200,.07);
  font-size: .74rem;
  line-height: 1.5;
}
.message.mine { border-radius: 11px 11px 3px 11px; background: rgba(246,184,74,.08); }
.message-meta { margin-bottom: 4px; color: var(--faint); font-size: .62rem; }

.lobby {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 30px;
}

.lobby-card { width: min(100%, 780px); padding: clamp(28px,5vw,56px); text-align: center; }
.lobby-card h1 { margin: 14px 0 8px; font-family: Georgia,serif; font-size: clamp(2.4rem,6vw,4.5rem); font-weight: 500; }
.lobby-card > p { max-width: 570px; margin: 0 auto 28px; color: var(--muted); line-height: 1.6; }

.aar-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; }
.outcome-card { padding: 30px; }
.outcome-card h2 { margin: 10px 0; font-family: Georgia,serif; font-size: 2rem; font-weight: 500; }
.outcome-card p { color: var(--muted); line-height: 1.6; }

.score-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.score-tile { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.score-tile span { display: block; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; }
.score-tile strong { display: block; margin-top: 7px; font: 500 1.7rem Georgia,serif; }
.score-tile small { color: var(--teal); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.aar-summary { display: grid; gap: 20px; }
.aar-decisions-panel .panel-body { padding: 0; }
.personal-review-list, .resolution-list { display: grid; gap: 0; }
.personal-review { padding: 24px; border-top: 1px solid var(--line); }
.personal-review:first-child { border-top: 0; }
.personal-review-head, .resolution-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.personal-review h3, .resolution-head h3 { margin: 6px 0 0; font: 500 1.5rem Georgia,serif; }
.selected-decision { margin-top: 16px; padding: 16px; border-left: 3px solid var(--amber); border-radius: 0 11px 11px 0; background: rgba(246,184,74,.055); }
.selected-decision small { display: block; color: var(--faint); font-size: .59rem; text-transform: uppercase; letter-spacing: .1em; }
.selected-decision strong { display: block; margin-top: 4px; }
.selected-decision p, .causal-link p, .alternative p { margin: 6px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.consequence { margin: 14px 0; color: #b8c8c9; font-size: .75rem; line-height: 1.55; }
.consequence strong { display: block; margin-bottom: 4px; color: var(--teal); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.delta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.delta-chips span { padding: 5px 8px; border-radius: 999px; font: 750 .6rem ui-monospace,monospace; background: rgba(255,255,255,.04); }
.delta-chips .positive { color: var(--green); border: 1px solid rgba(117,212,154,.2); }
.delta-chips .negative { color: var(--coral); border: 1px solid rgba(255,128,110,.2); }
.causal-link { margin: 10px 0; padding: 13px; border: 1px solid rgba(104,213,200,.18); border-radius: 11px; background: rgba(104,213,200,.04); }
.causal-link strong { color: var(--teal); font-size: .76rem; }
.what-if { margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.what-if summary { padding: 12px 14px; cursor: pointer; color: #cbd8d6; font-size: .72rem; font-weight: 800; background: rgba(255,255,255,.02); }
.what-if > div { padding: 0 14px 14px; }
.alternatives { display: grid; gap: 9px; padding-top: 12px !important; }
.alternative { padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.alternative strong { font-size: .75rem; }
.alternative small { display: block; margin-top: 7px; color: var(--faint); line-height: 1.45; }
.counterfactual-note, .quiet-note { color: var(--faint); font-size: .66rem; line-height: 1.5; }
.counterfactual-note { padding: 0 14px 13px; margin: 0; }
.resolution-block { padding: 24px 0; border-top: 1px solid var(--line); }
.resolution-block:first-child { padding-top: 0; border-top: 0; }
.resolution-columns { margin-top: 14px; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(240px,.85fr); gap: 20px; }
.aar-decision { border-bottom: 1px solid var(--line); }
.aar-decision summary { padding: 12px 0; display: flex; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.aar-decision summary small, .aar-decision summary strong { display: block; }
.aar-decision summary small { margin-bottom: 3px; color: var(--faint); font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; }
.aar-decision-body { padding: 0 0 12px; }
.aar-decision-body p { color: var(--muted); font-size: .73rem; line-height: 1.5; }

.credentials {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 10px;
}

.credential {
  padding: 13px;
  border: 1px solid rgba(246,184,74,.18);
  border-radius: 11px;
  background: rgba(246,184,74,.05);
}

.credential strong { display: block; font-size: .8rem; }
.credential code { display: block; margin-top: 6px; color: var(--amber); font-size: .76rem; }

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid rgba(104,213,200,.22);
  border-radius: 12px;
  color: #dce7e5;
  background: #10282e;
  box-shadow: var(--shadow);
  font-size: .78rem;
  animation: toast-in .22s ease both;
}

.toast.error { border-color: rgba(255,109,109,.3); background: #2a191b; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .cards-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .live-layout, .player-grid { grid-template-columns: 1fr; }
  .live-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .live-rail .panel:last-child { grid-column: 1 / -1; }
  .scenario-filterbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-clear { align-self: stretch; }
  .resolution-columns { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  .replay-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { min-height: 48vh; padding: 30px; }
  .auth-copy { margin: 60px 0; }
  .auth-copy h1 { font-size: clamp(3.5rem,15vw,6rem); }
  .auth-panel { min-height: 52vh; border-left: 0; border-top: 1px solid var(--line); }
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 64px; padding: 0 18px; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; }
  .mobile-nav .nav-button { width: auto; flex: 0 0 auto; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .scenario-readiness { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .content, .participant-content { padding: 20px 14px 32px; }
  .metric-grid, .cards-grid, .live-rail, .aar-grid, .credentials, .score-grid { grid-template-columns: 1fr; }
  .live-rail .panel:last-child { grid-column: auto; }
  .form-row, .assignment-row { grid-template-columns: 1fr; }
  .session-row { grid-template-columns: 1fr auto; }
  .session-row .badge { grid-row: 1; grid-column: 2; }
  .session-row .session-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .role-hero { align-items: flex-start; }
  .progress-steps { display: none; }
  .choice { grid-template-columns: 22px 1fr; }
  .choice-intent { grid-column: 2; justify-self: start; }
  .scene-wrap { min-height: 310px; padding: 5px; }
  .scene-svg { min-height: 300px; }
  .participant-topbar .brand-lockup, .participant-topbar .brand-version { display: none; }
  .scenario-filterbar { grid-template-columns: 1fr; }
  .scenario-art { height: 160px; }
  .personal-review-head, .resolution-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
