:root {
  --bg:         #0e100d;
  --panel:      #181a17;
  --panel-soft: #1f2219;
  --line:       #2e3229;
  --line-soft:  #252820;
  --text:       #ede8dc;
  --muted:      #9e9688;
  --accent:     #c9a646;
  --accent-dim: #8a7030;
  --accent-2:   #7aafa0;
  --danger:     #b65a4b;
  --success:    #5a9c6a;
  --shadow:     rgba(0, 0, 0, 0.45);
  --radius:     8px;
}

* {
  box-sizing: border-box;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 40% at 20% 0%, rgba(201,166,70,0.04) 0%, transparent 55%),
    var(--bg);
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 0.96rem;
  line-height: 1.6;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 18px;
  background: #0c0e0b;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.brand {
  display: block;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.brand-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text);
}

.brand-subtitle,
.eyebrow,
.panel-title,
.side-label {
  color: var(--accent-dim);
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.brand-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.nav {
  display: grid;
  gap: 3px;
  margin: 18px 0;
}

.nav a {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  padding: 8px 11px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
}

.nav a:hover {
  color: var(--text);
  background: var(--panel-soft);
  border-color: var(--line);
}

/* Active nav link */
.nav a.active,
.nav a[aria-current="page"] {
  color: var(--accent);
  background: rgba(201, 166, 70, 0.08);
  border-color: rgba(201, 166, 70, 0.2);
  font-weight: 600;
}

.button,
button,
.pill {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.button:hover,
button:hover,
.pill:hover {
  border-color: var(--accent);
}

.side-panel {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.side-links {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.side-links a {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 3px 0;
  transition: color 0.15s;
}

.side-links a:hover { color: var(--accent); }

.pressure-value {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  margin: 10px 0;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(201,166,70,0.4);
  font-variant-numeric: tabular-nums;
}

.main {
  padding: 28px 32px;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 0;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

h3 {
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0;
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.panel,
.scene-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 2px 12px var(--shadow);
  transition: border-color 0.15s;
  min-width: 0;
}

.panel:focus-within,
.panel:has(summary:hover) {
  border-color: rgba(201, 166, 70, 0.25);
}

.panel {
  padding: 16px 18px;
}

.panel-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.muted {
  color: var(--muted);
}

.grid > *,
.clock-grid > *,
.card-grid > *,
.handout-grid > *,
.map-grid > *,
.outcome-lanes > *,
.runbook-detail-grid > *,
.runbook-map-grid > *,
.map-playbook-grid > *,
.player-hub-grid > *,
.map-group-head > *,
.map-live-head > *,
.table-like > * {
  min-width: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.icon-button {
  width: 42px;
  height: 38px;
  padding: 0;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2d3028;
  min-height: 42px;
}

.compact-button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.84rem;
}

.button.secondary {
  background: transparent;
}

.pill {
  font-size: 0.88rem;
  padding: 8px 10px;
}

.pill.selected {
  border-color: var(--accent);
  background: rgba(201, 166, 70, 0.17);
}

.clock-grid,
.card-grid,
.handout-grid,
.map-grid {
  display: grid;
  gap: 14px;
}

.clock-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.outcome-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.handout-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.map-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.map-group {
  margin-bottom: 22px;
}

.map-group-head {
  display: grid;
  grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
  gap: 18px;
  align-items: end;
  margin: 4px 0 12px;
}

.map-group-head h2,
.map-group-head p {
  margin-bottom: 0;
}

.map-detail-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(min(100%, 22rem), 0.55fr);
}

.handout-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}

.clock-card,
.mini-card,
.handout-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.clock-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.segments {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin: 10px 0;
}

.segment {
  height: 10px;
  border-radius: 99px;
  background: #3d4137;
}

.segment.filled {
  background: var(--danger);
}

.clean-list,
.check-list {
  padding-left: 18px;
  margin-bottom: 0;
}

.clean-list li,
.check-list li {
  margin-bottom: 8px;
}

.finding-list {
  padding-left: 0;
  list-style: none;
}

.finding-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 0;
}

.finding-list input {
  width: auto;
  margin: 3px 0 0;
}

textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10120f;
  color: var(--text);
  padding: 12px;
  margin-bottom: 10px;
  font: inherit;
}

.brief-textarea {
  min-height: 520px;
  white-space: pre;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
}

.compact-scene-notes {
  min-height: 115px;
}

.pre-line {
  white-space: pre-line;
}

input,
textarea,
select {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10120f;
  color: var(--text);
  padding: 10px 12px;
  margin-bottom: 10px;
}

select {
  width: auto;
  min-width: 130px;
  margin-bottom: 0;
}

.search-input {
  margin-bottom: 18px;
  min-height: 44px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  min-width: 0;
}

.toolbar > * {
  min-width: 0;
}

.toolbar input[type="search"],
.toolbar input[type="text"] {
  flex: 1 1 18rem;
  width: auto;
  min-width: min(100%, 14rem);
  margin-bottom: 0;
}

.toolbar .pill,
.toolbar button {
  flex: 0 1 auto;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}

.field-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.toggle-list {
  display: grid;
  gap: 9px;
  margin: 10px 0;
}

.toggle-list.columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.toggle-list input {
  width: auto;
  margin: 0;
}

.gap-top {
  margin-top: 18px;
}

.gap-bottom {
  margin-bottom: 14px;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 12px 0 0;
  padding: 8px 0 8px 14px;
  color: #f3eddc;
}

.scene-list {
  display: grid;
  gap: 12px;
}

.runbook-list {
  display: grid;
  gap: 14px;
}

.runbook-jump-panel {
  position: sticky;
  top: 18px;
  z-index: 4;
}

.runbook-jump-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.runbook-jump {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 9px;
}

.runbook-jump span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #10120f;
  color: var(--accent);
  font-weight: 800;
}

.runbook-jump strong,
.runbook-jump small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runbook-jump small {
  grid-column: 2;
  color: var(--muted);
}

.runbook-jump.selected {
  border-color: var(--accent);
}

.runbook-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.runbook-step.active-step {
  border-color: var(--accent);
}

.runbook-step.progress-done {
  border-color: rgba(143, 179, 163, 0.75);
}

.runbook-step.progress-skipped {
  opacity: 0.76;
}

.runbook-step {
  scroll-margin-top: 150px;
}

.runbook-index {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10120f;
  color: var(--accent);
  font-weight: 800;
}

.runbook-body,
.runbook-head {
  min-width: 0;
}

.runbook-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.runbook-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0;
}

.runbook-grid p {
  margin: 5px 0 0;
  color: var(--muted);
}

.runbook-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 14px;
  margin: 14px 0;
}

.runbook-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 10px;
  margin: 14px 0;
}

.runbook-map-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.runbook-map-card > div {
  min-width: 0;
}

.runbook-map-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: #0d0e0c;
}

.runbook-map-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.scene-note-strip,
.runbook-handouts {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.handout-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px 10px;
}

.compact-list {
  margin-top: 6px;
}

.handout-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.handout-ribbon.no-border {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.progress-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-summary span {
  min-width: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

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

.prep-card {
  min-height: 220px;
}

.prep-ok {
  border-color: rgba(143, 179, 163, 0.6);
}

.prep-warn {
  border-color: rgba(201, 166, 70, 0.65);
}

.scene-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.tag {
  display: inline-flex;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-2);
}

.mini-card-list {
  display: grid;
  gap: 10px;
}

.mini-card {
  display: grid;
  gap: 5px;
}

.mini-card span,
.mini-card em {
  color: var(--muted);
}

.handout-card {
  display: grid;
  gap: 8px;
  min-height: 100%;
}

.handout-shown {
  border-color: rgba(143, 179, 163, 0.75);
}

.map-shown {
  border-color: rgba(143, 179, 163, 0.75);
}

.map-show-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  margin-top: 12px;
}

.inline-check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.handout-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #0d0e0c;
}

.map-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0d0e0c;
  margin-bottom: 10px;
}

.linked-scenes {
  margin: 12px 0;
}

.map-use-callout {
  border: 1px solid rgba(201, 166, 70, 0.45);
  border-radius: 8px;
  background: rgba(201, 166, 70, 0.1);
  color: #f1dfac;
  padding: 10px 12px;
  margin-top: 10px;
}

.map-route-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  margin-top: 12px;
}

.route-pair {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.route-pair span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.map-nav-panel {
  margin-bottom: 18px;
}

.map-nav-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.map-nav-item {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 8px;
}

.map-nav-item.selected {
  border-color: var(--accent);
  background: rgba(201, 166, 70, 0.12);
}

.map-nav-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #0d0e0c;
}

.map-nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-live-panel {
  margin-bottom: 18px;
}

.map-live-head {
  display: grid;
  grid-template-columns: minmax(0, 0.35fr) minmax(0, 0.65fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.map-live-head h2,
.map-live-head p {
  margin-bottom: 0;
}

.map-pressure-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.pressure-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #10120f;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 800;
}

.map-clock-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.map-playbook {
  margin-bottom: 18px;
}

.map-playbook-scene {
  margin-bottom: 14px;
}

.map-playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 16px;
  margin-top: 16px;
}

.scene-row-actions {
  margin-top: 10px;
}

.status-line {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 5px;
}

.map-strip {
  display: grid;
  gap: 12px;
}

.map-mini {
  display: grid;
  grid-template-columns: minmax(min(100%, 14rem), 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.map-mini img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
}

.map-mini span {
  display: block;
  color: var(--muted);
  margin: 4px 0 10px;
}

.annotated-map-frame {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  line-height: 0;
}

.annotated-map-frame > img,
.map-detail-main > img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0d0e0c;
}

.map-annotations {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  display: grid;
  grid-template-columns: auto minmax(0, max-content);
  gap: 5px;
  align-items: center;
  max-width: min(210px, 38%);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(245, 223, 158, 0.9);
  border-radius: 8px;
  background: rgba(12, 13, 11, 0.86);
  color: #f5df9e;
  padding: 5px 7px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  font-size: 0.78rem;
  line-height: 1.2;
  z-index: 2;
}

.map-marker:hover,
.map-marker:focus-visible,
.map-marker:focus-within {
  z-index: 8;
}

.map-marker span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #151714;
  font-weight: 800;
}

.map-marker strong {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.map-marker:hover strong,
.map-marker:focus-visible strong,
.map-marker:focus-within strong {
  white-space: normal;
}

.map-annotation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.map-annotation-list strong {
  color: var(--text);
}

.warning-panel {
  border-color: rgba(201, 166, 70, 0.55);
  margin-bottom: 18px;
}

.validation-list {
  display: grid;
  gap: 10px;
}

.validation-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.validation-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.validation-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.validation-accepted {
  border-color: rgba(143, 179, 163, 0.75);
}

.validation-rejected {
  border-color: rgba(182, 90, 75, 0.75);
  opacity: 0.78;
}

.validation-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.metric {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.sticky-save {
  position: sticky;
  bottom: 18px;
  z-index: 5;
  margin: 0 0 18px;
  box-shadow: 0 12px 30px var(--shadow);
}

.handout-card small {
  color: var(--muted);
}

.player-body {
  display: block;
  min-height: 100vh;
  background: #080907;
}

.player-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding: 18px;
  background: #080907;
}

.player-view > img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

.player-handout {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  padding: 18px;
}

.player-handout img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

.player-map-frame {
  width: fit-content;
  max-width: 100%;
}

.player-map-frame > img {
  max-height: calc(100vh - 190px);
}

.player-map-legend {
  width: min(1100px, 100%);
  max-height: 120px;
  overflow-y: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  font-size: 0.85rem;
}

.player-view ol {
  width: min(1100px, 100%);
  max-height: 120px;
  overflow-y: auto;
  margin: 12px 0 0;
  color: var(--muted);
}

.player-caption {
  color: var(--muted);
  padding-top: 12px;
}

.player-hub-body {
  display: block;
  min-height: 100vh;
  background: #080907;
}

.player-hub {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.player-hub-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  min-height: 190px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 9, 7, 0.15), rgba(8, 9, 7, 0.88)),
    #151714;
}

.player-hub-header h1 {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.player-hub-section {
  margin-top: 18px;
}

.player-hub-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.player-hub-section-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.player-hub-section-head span {
  color: var(--muted);
}

.player-hub-grid {
  display: grid;
  gap: 14px;
}

.player-hub-grid.maps {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.player-hub-grid.handouts {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.player-hub-card {
  display: grid;
  gap: 9px;
  min-height: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.player-hub-card:hover {
  border-color: var(--accent);
}

.player-hub-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: #0d0e0c;
}

.player-hub-grid.handouts .player-hub-card img {
  aspect-ratio: 4 / 3;
}

.player-hub-card strong,
.player-hub-card span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-hub-card span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.player-hub-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.table-like {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-like > div {
  padding: 12px;
  background: var(--panel-soft);
}

.prose pre {
  white-space: pre-wrap;
  margin: 0;
  font: inherit;
  color: var(--text);
}

code {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10120f;
  overflow-wrap: anywhere;
}

.roll-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #10120f;
  border: 1px solid var(--line);
}

@media (max-width: 1240px) {
  body {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .main {
    padding: 24px;
  }

  .map-detail-grid,
  .map-playbook-grid {
    grid-template-columns: 1fr;
  }

  .map-live-head,
  .map-group-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .grid.two,
  .grid.three,
  .prep-grid,
  .validation-summary,
  .map-detail-grid,
  .clock-grid,
  .card-grid,
  .outcome-lanes,
  .handout-grid,
  .handout-grid.compact,
  .player-hub-grid.maps,
  .player-hub-grid.handouts,
  .map-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-mini {
    grid-template-columns: 1fr;
  }

  .map-group-head {
    grid-template-columns: 1fr;
  }

  .map-live-head,
  .map-pressure-control {
    grid-template-columns: 1fr;
  }

  .runbook-step,
  .runbook-grid,
  .runbook-detail-grid,
  .map-playbook-grid,
  .map-annotation-list,
  .player-map-legend,
  .runbook-map-grid,
  .runbook-jump-grid {
    grid-template-columns: 1fr;
  }

  .runbook-index {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px 14px;
  }

  .sidebar {
    padding: 16px 14px;
  }

  .page-header,
  .runbook-head,
  .player-hub-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar,
  .button-row {
    align-items: stretch;
  }

  .toolbar > *,
  .button-row > *,
  .toolbar input[type="search"],
  .toolbar input[type="text"],
  .button-row .button,
  .button-row button {
    width: 100%;
  }

  .runbook-map-card,
  .map-mini,
  .table-like {
    grid-template-columns: 1fr;
  }

  .brief-textarea {
    min-height: 340px;
    white-space: pre-wrap;
  }

  .player-view,
  .player-handout {
    padding: 10px;
  }

  .player-map-frame > img {
    max-height: calc(100vh - 150px);
  }

  .player-view ol {
    max-height: 150px;
  }

  .player-caption {
    text-align: center;
    line-height: 1.35;
  }

  .map-marker {
    grid-template-columns: auto;
    gap: 2px;
    max-width: 7rem;
    padding: 3px;
    font-size: 0.68rem;
  }

  .map-marker span {
    width: 18px;
    height: 18px;
    font-size: 0.72rem;
  }

  .map-marker strong {
    display: none;
  }

  .map-marker:hover strong,
  .map-marker:focus-visible strong,
  .map-marker:focus-within strong {
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    display: block;
    width: max-content;
    max-width: min(68vw, 14rem);
    transform: translateX(-50%);
    border: 1px solid rgba(245, 223, 158, 0.9);
    border-radius: 8px;
    background: rgba(12, 13, 11, 0.95);
    padding: 6px 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
    white-space: normal;
  }
}

/* ============================================================
   REFONTE NAVIGATION — Mai 2026
   Groupes de liens, icônes, liens externes
   ============================================================ */

/* ── Labels de groupes de nav ─────────────────────────────── */
.nav-group-label {
  color: var(--accent-dim);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 0 11px 4px;
  text-transform: uppercase;
  user-select: none;
}

/* ── Icônes dans les liens nav ────────────────────────────── */
.nav-icon {
  flex-shrink: 0;
  height: 1rem;
  opacity: 0.6;
  width: 1rem;
  transition: opacity 0.15s;
}

.nav a:hover .nav-icon,
.nav a.active .nav-icon {
  opacity: 1;
}

.nav a.active .nav-icon {
  color: var(--accent);
}

/* ── Lien externe dans nav ────────────────────────────────── */
.nav-external {
  color: var(--muted) !important;
  font-size: 0.88rem;
}

.nav-ext-arrow {
  margin-left: auto;
  flex-shrink: 0;
  height: 10px;
  opacity: 0.45;
  width: 10px;
  transition: opacity 0.15s;
}

.nav a.nav-external:hover .nav-ext-arrow {
  opacity: 1;
}

/* ── Liens externes dans side-links ───────────────────────── */
.side-links a {
  align-items: center;
  display: flex;
  gap: 6px;
}

.ext-link-icon {
  flex-shrink: 0;
  height: 10px;
  opacity: 0.45;
  width: 10px;
}

.side-links a:hover .ext-link-icon {
  opacity: 1;
}

/* ── Bouton Verrouiller avec icône ────────────────────────── */
.button.secondary {
  align-items: center;
  display: flex;
  gap: 8px;
}

/* ── Amélioration active state : barre latérale ───────────── */
.nav a.active {
  border-left: 2px solid var(--accent);
  padding-left: 9px;
}

/* ── Sidebar : séparateur entre sections ──────────────────── */
.nav-group-label:not(:first-child) {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

