:root {
  --director-header: 64px;
  --director-timeline: 252px;
  --director-rail: 68px;
  --director-ink: #e7edf4;
  --director-muted: #8297ad;
  --director-line: #263b50;
  --director-panel: rgba(8, 20, 33, .94);
  --director-panel-strong: #091624;
  --director-gold: #e8b85e;
  --director-blue: #35b9f4;
  --director-red: #f05f70;
}

html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: #050c14;
  color: var(--director-ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

button, input, select { border-radius: 6px; }
button {
  transition: color .16s ease, background-color .16s ease, border-color .16s ease,
              box-shadow .16s ease, transform .16s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0) scale(.97); }

header {
  position: relative;
  z-index: 30;
  height: var(--director-header);
  padding: 0 18px 0 22px;
  border-bottom: 1px solid #284055;
  background: #081522;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}
.brand { min-width: 0; flex-shrink: 0; gap: 11px; }
.brand b, .brand > span:last-child { display: none; }
.brand .mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--director-gold);
}
.brand .mark svg { width: 30px; height: 30px; stroke-width: 1.7; }
.brand b { font-size: 19px; color: #f3f6fa; letter-spacing: .08em; }
.brand > span:last-child { color: #728aa2; letter-spacing: .18em; }
.board-mode-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  flex-shrink: 0;
  gap: 6px;
  margin: 0 auto 0 12px;
}
.board-mode-nav button {
  position: relative;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--director-muted);
  font-weight: 650;
  white-space: nowrap;
}
.board-mode-nav button:hover { color: var(--director-ink); background: #102335; transform: none; }
.board-mode-nav button[aria-pressed="true"] { color: #dff5ff; background: #102335; }
.board-mode-nav button[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  background: var(--director-blue);
}
.header-actions { min-width: 0; gap: 8px; flex-wrap: nowrap; overflow-x: auto; }
.header-actions > * { flex-shrink: 0; }
#tacticsBoard[hidden], #bpBoard[hidden], .header-actions[hidden] { display: none; }
.bp-board {
  display: grid;
  place-items: center;
  height: calc(100vh - var(--director-header));
  padding: 32px 20px;
  overflow: auto;
  background: radial-gradient(ellipse at 50% 35%, #102b40, #050c14 70%);
}
.bp-placeholder { width: min(100%, 560px); text-align: center; }
.bp-kicker { color: var(--director-blue); font-size: 12px; letter-spacing: .25em; }
.bp-placeholder h1 { margin: 16px 0 12px; font-size: 36px; }
.bp-status { display: inline-block; padding: 3px 12px; border: 1px solid #665336; border-radius: 20px; color: var(--director-gold); font-size: 12px; }
.bp-placeholder p { margin: 24px 0; color: #a9bacb; line-height: 1.8; }
.bp-placeholder button { padding: 10px 24px; border-color: #397393; background: #11364a; color: #dff5ff; }
.header-actions button, .director-chip {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #2b4258;
  background: #0d1d2d;
  color: #b8c7d7;
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.header-actions button:hover { background: #13283b; border-color: #41617e; }
.header-actions button.gold {
  background: #17212b;
  border-color: #b9914e;
  color: #f0c46d;
  box-shadow: inset 0 0 0 1px rgba(232,184,94,.08), 0 0 20px rgba(232,184,94,.06);
}
.header-actions #exportVideo {
  border-color: #d1a34f;
  background: linear-gradient(135deg,#e6b85f,#c8943e);
  color: #15202b;
  box-shadow: 0 7px 22px rgba(232,184,94,.18);
}
.header-actions #exportVideo:hover { border-color:#f4cf83;background:linear-gradient(135deg,#f0c979,#d8a44d);box-shadow:0 9px 28px rgba(232,184,94,.25) }
.header-actions #roleStatus {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-color: #2b4258;
  background: #0c1a28;
}
.director-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
}
.director-chip svg, .header-actions button svg { width: 16px; height: 16px; }
#directorTerrain[aria-pressed="true"], #directorFog[aria-pressed="true"] {
  border-color: #47735f;
  background: #10261f;
  color: #9be0b9;
  box-shadow: inset 0 0 0 1px rgba(91, 190, 137, .08);
}
#directorTerrain[aria-pressed="false"], #directorFog[aria-pressed="false"] {
  border-color: #2b3c4e;
  background: #0a1724;
  color: #718397;
}
.director-icon-button {
  width: 38px;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
}

@media (max-width: 1360px) {
  .header-actions #roleStatus { display: none; }
}

main {
  position: relative;
  display: block;
  height: calc(100vh - var(--director-header));
  min-height: 0;
  overflow: hidden;
}

.workspace {
  position: absolute;
  inset: 0;
  min-width: 0;
  padding: 0;
}
.board-wrap {
  position: absolute;
  inset: 0 0 var(--director-timeline) 0;
  width: auto;
  height: auto !important;
  aspect-ratio: auto;
  border: 0;
  outline: 0;
  background: #07111b;
}
.board-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .32);
}
#board { position: absolute; inset: 0; }

.board-header {
  position: absolute;
  z-index: 12;
  top: 17px;
  left: 102px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(91, 120, 146, .35);
  border-radius: 8px;
  background: rgba(5, 15, 25, .72);
  box-shadow: 0 12px 28px rgba(0,0,0,.23);
  pointer-events: none;
}
.board-header h1 { font-size: 15px; letter-spacing: .08em; }
.board-header h1 span { display: block; margin: 2px 0 0; font-size: 10px; letter-spacing: .12em; }
.board-header p { display: none; }
.board-header .live {
  margin-top: 3px;
  color: #7dd9bd;
  font-size: 10px;
  letter-spacing: .08em;
}
.board-header .live::first-letter { color: #52e0a8; }

.tools {
  position: absolute;
  z-index: 18;
  top: 18px;
  left: 14px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 5px;
  width: var(--director-rail);
  max-height: calc(100% - var(--director-timeline) - 36px);
  overflow: auto;
  padding: 7px;
  border: 1px solid #29435b;
  border-radius: 9px;
  background: rgba(7, 20, 33, .93);
  box-shadow: 0 16px 34px rgba(0,0,0,.32);
  scrollbar-width: none;
}
.tools::-webkit-scrollbar { display: none; }
.tools button {
  display: grid;
  grid-template-rows: 21px auto;
  place-items: center;
  gap: 3px;
  min-height: 53px;
  padding: 6px 3px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a9bd;
  font-size: 10px;
  line-height: 1.15;
}
.tools button svg { width: 20px; height: 20px; stroke-width: 1.8; }
.tools button:hover { background: #11273a; border-color: #294b65; color: #d9e7f4; }
.tools button.active {
  background: #103149;
  border-color: #2ca7df;
  color: #79d5ff;
  box-shadow: inset 3px 0 #3bc5ff, 0 0 20px rgba(48,183,240,.11);
}
.tools .divider { width: 100%; height: 1px; margin: 2px 0; background: #294055; }
.tools .tool-spacer { display: none; }
.tools input[type=color] { width: 100%; height: 28px; padding: 2px; border-radius: 5px; }
#directorRosterToggle { order: -10; }
#directorRosterToggle.active { color: #f0c46d; border-color: #9b7942; background: #2a241a; box-shadow: inset 3px 0 #e8b85e; }
.director-action-dock {
  position: absolute;
  z-index: 18;
  top: 18px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid #29435b;
  border-radius: 9px;
  background: rgba(7,20,33,.9);
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
  transition: right .2s ease;
}
body.inspector-open .director-action-dock { right: 338px; }
.director-action-dock button { display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:6px 9px;background:transparent;border-color:transparent;color:#9eb1c3;font-size:11px }
.director-action-dock button svg { width:15px;height:15px }
.director-action-dock button:hover { background:#132b3f;border-color:#31516a;color:#e1ebf3 }
.director-action-dock #delete { color:#e6a9b0 }
.director-action-dock #clearMap { border-color:#5d3340;background:#281822;color:#ff9ca7 }
.director-action-dock #clearMap:hover { border-color:#9c5260;background:#49232e;color:#ffd4d8 }
.director-action-dock input[type=color] { width:32px;height:32px;padding:3px;border-color:#385268;background:#0b1926 }

.left {
  position: absolute;
  z-index: 17;
  top: 18px;
  bottom: calc(var(--director-timeline) + 18px);
  left: 92px;
  width: 304px;
  display: block;
  padding: 18px;
  overflow: auto;
  border: 1px solid #2d465c;
  border-radius: 10px;
  background: var(--director-panel);
  box-shadow: 0 24px 56px rgba(0,0,0,.42);
  opacity: 0;
  transform: translateX(-18px) scale(.98);
  transform-origin: left top;
  pointer-events: none;
  transition: opacity .2s ease, transform .22s ease;
  scrollbar-width: thin;
}
body.roster-open .left { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.left h2 { margin-bottom: 15px; font-size: 15px; letter-spacing: .08em; }
.left h2 small { color: #70869b; }
.left .teams { padding: 3px; gap: 3px; border-radius: 7px; background: #07131f; }
.left .teams button { border: 0; background: transparent; }
.left .teams button.active { background: #12344d; color: #6fd2ff; }
.left .teams [data-team=red].active { background: #40222d; color: #ff94a0; }
.left > input { padding: 10px 11px; border-color: #294157; background: #081522; }
#roster { grid-template-columns: repeat(4, 1fr); gap: 7px; max-height: none; }
.champ {
  min-height: 72px;
  padding: 7px 3px;
  border-color: transparent;
  background: #0c1b29;
}
.champ:hover { background: #132b3e; border-color: #3a566f; }
.portrait { width: 42px; height: 42px; border-radius: 50%; border-color: #637b8e; }
.unit-buttons { margin: 14px 0; }
.quick-units { margin: 0 0 12px; padding: 10px; border: 1px solid #294157; border-radius: 8px; background: #081522; }
.quick-units > div:first-child { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.quick-units b { color:#e5edf5; font-size:12px; }
.quick-units span { color:#74899d; font-size:9px; }
.quick-units .unit-buttons { margin:8px 0 0; grid-template-columns:repeat(2,minmax(0,1fr)); }
.lane-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:-3px 0 12px; }
.lane-filters button { min-width:0; padding:5px 3px; border-color:#263d51; background:#091724; color:#8fa5b8; font-size:10px; }
.lane-filters button.active { border-color:#4f92b7; background:#12344b; color:#8edcff; }
.roster-empty { grid-column:1/-1; margin:18px 0; color:#8095a8; text-align:center; font-size:11px; }
.layer-panel { padding-top: 12px; }
.layer-panel h3 { margin-top: 0; }
.source { opacity: .7; }

.right {
  position: absolute;
  z-index: 16;
  top: 18px;
  right: 14px;
  bottom: calc(var(--director-timeline) + 18px);
  width: 310px;
  display: block;
  padding: 18px;
  overflow: auto;
  border: 1px solid #2e475e;
  border-radius: 10px;
  background: var(--director-panel);
  box-shadow: 0 24px 58px rgba(0,0,0,.44);
  opacity: 0;
  transform: translateX(18px) scale(.985);
  pointer-events: none;
  transition: opacity .2s ease, transform .22s ease;
  scrollbar-width: thin;
}
body.inspector-open .right { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.right > h2 {
  position: sticky;
  top: -18px;
  z-index: 2;
  margin: -18px -18px 14px;
  padding: 15px 48px 13px 18px;
  border-bottom: 1px solid #273f54;
  background: #0a1927;
  font-size: 14px;
  letter-spacing: .08em;
}
.right .map-config, .right .notice { display: none; }
.selected-name { font-size: 20px; font-weight: 700; color: #f1f5f8; }
.side-tag { margin-bottom: 13px; color: #60c8f7; }
.director-selection-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 12px;
}
.director-selection-head .portrait {
  width: 52px;
  height: 52px;
  border: 2px solid #d7b567;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #142536, 0 0 18px rgba(232,184,94,.12);
}
.director-selection-copy { min-width: 0; }
.director-selection-copy .selected-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.director-selection-copy .side-tag { margin: 2px 0 0; }
.director-inspector-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0 0 13px;
  padding: 3px;
  border-radius: 7px;
  background: #07131f;
}
.director-inspector-tabs button { border-color: transparent; background: transparent; color: #8299ad; }
.director-inspector-tabs button.active {
  border-color: #42586c;
  background: #172b3d;
  color: #edf3f8;
  box-shadow: inset 0 -2px var(--director-gold);
}
.director-inspector-page[hidden] { display: none !important; }
.director-inspector-page h3 { margin-top: 4px; }
.fields { gap: 8px; }
.fields label { color: #91a8bd; font-size: 11px; }
.fields input, .fields select { padding: 8px; border-color: #294258; background: #071521; }
.skills button {
  min-height: 48px;
  background: #0b1a29;
  border-color: #4c5360;
  color: #eac777;
  box-shadow: inset 0 -3px rgba(232,184,94,.12);
}
.skills button:hover { border-color: #d0a854; color: #ffe5a4; box-shadow: 0 0 18px rgba(232,184,94,.12); }
.director-close-panel {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-color: transparent;
  background: transparent;
}
.director-close-panel svg { width: 18px; height: 18px; }

.canvas-label {
  top: auto;
  right: auto;
  bottom: 15px;
  left: 92px;
  padding: 8px 11px;
  border: 1px solid rgba(81,112,139,.32);
  border-radius: 6px;
  background: rgba(5,15,24,.65);
  color: #dbe6ef;
}
.canvas-label span { max-width: 520px; color: #8fa9bd; }
.camera-controls {
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px;
  border-color: #38546a;
  border-radius: 8px;
  background: rgba(7,20,32,.9);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.camera-controls button { min-height: 30px; background: transparent; border-color: transparent; }
.camera-controls button:hover { background: #173047; border-color: #365b76; }
.camera-controls #fit { color: #f0c76f; }
.minimap-wrap {
  right: 14px;
  bottom: 14px;
  width: 174px;
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 1px solid #5d7482;
  border-radius: 8px;
  background: #081521;
  box-shadow: 0 16px 34px rgba(0,0,0,.42);
}
.minimap-wrap > div { padding: 5px 8px; border-bottom: 1px solid #253c50; letter-spacing: .06em; }
#minimap { height: 116px; }
#floatingSkills { border-radius: 8px; animation: director-pop .16s ease-out; }
#statusBadge { left: 92px; bottom: 63px; }

.timeline {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--director-timeline);
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  grid-template-rows: 61px 1fr 36px;
  column-gap: 16px;
  margin: 0;
  padding: 14px 18px 12px;
  overflow: hidden;
  border: 0;
  border-top: 1px solid #304b62;
  border-radius: 0;
  background: #081522;
  box-shadow: 0 -16px 40px rgba(0,0,0,.32);
}
.timeline-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: 28px 18px;
  align-self: start;
  gap: 8px;
  padding: 3px 0 0;
}
.timeline-title b { grid-column: 1; grid-row: 1; align-self: center; color: #f0f3f7; font-size: 18px; letter-spacing: .06em; white-space: nowrap; }
.timeline-title span { grid-column: 1 / -1; grid-row: 2; display: block; max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-title #demo { grid-column: 2; grid-row: 1; margin-left: 0; padding: 5px 8px; }
.timeline-title #directorTimelineToggle { grid-column: 3; grid-row: 1; min-height: 28px; height: 28px; }
.timeline-controls {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 54px 68px 1fr;
  align-content: start;
  gap: 8px;
  margin: 0;
}
.timeline-controls #play {
  grid-row: 1 / span 2;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  background: #1d2934;
  border: 2px solid var(--director-gold);
  color: #f1c66d;
  box-shadow: 0 0 22px rgba(232,184,94,.11);
}
.timeline-controls #reset { height: 54px; padding: 5px; }
.timeline-controls output { align-self: center; font-size: 17px; color: #f3f6f9; }
.timeline-controls #scrub { grid-column: 1 / -1; width: 100%; }
.timeline-controls #speed { width: 76px; }
.timeline-controls label { grid-column: 2 / -1; }
.timeline-controls label input { width: 54px; }
#events { display: none; }
#eventLog {
  grid-column: 1;
  grid-row: 3;
  margin: 0;
  padding: 7px 0 0;
  max-height: 36px;
  overflow: hidden;
  border-top: 1px solid #21384a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#directorTimelineStage {
  position: relative;
  grid-column: 2;
  grid-row: 1 / 4;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid #294055;
}
.director-ruler {
  position: relative;
  height: 28px;
  margin-left: 132px;
  border-bottom: 1px solid #294156;
  color: #718ba2;
  font: 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.director-ruler span { position: absolute; bottom: 7px; transform: translateX(-50%); }
.director-ruler span::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  height: 190px;
  border-left: 1px solid rgba(69, 93, 114, .22);
}
.director-track-list { height: calc(100% - 28px); overflow: auto; scrollbar-width: thin; }
.director-track {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0,1fr);
  min-height: 35px;
  border-bottom: 1px solid #1d3244;
}
.director-track-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px 5px 12px;
  color: #a9bac9;
  background: #0a1927;
  font-size: 11px;
}
.director-track-label b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.director-team-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--team); box-shadow: 0 0 8px var(--team); }
.director-track-lane { position: relative; min-width: 0; background: rgba(9,25,39,.58); }
.director-event {
  position: absolute;
  top: 6px;
  width: max(38px, var(--event-width));
  height: 23px;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid var(--team);
  border-radius: 4px;
  background: var(--event-bg);
  color: #e9eef4;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 3px 0 var(--team);
}
.director-event:hover, .director-event.selected { z-index: 3; filter: brightness(1.2); box-shadow: inset 3px 0 var(--team), 0 0 16px color-mix(in srgb, var(--team) 28%, transparent); }
.director-playhead {
  position: absolute;
  z-index: 5;
  top: 21px;
  bottom: 0;
  left: calc(132px + (100% - 132px) * var(--progress));
  width: 1px;
  background: var(--director-gold);
  box-shadow: 0 0 9px rgba(232,184,94,.6);
  pointer-events: none;
}
.director-playhead::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -5px;
  width: 11px;
  height: 8px;
  background: var(--director-gold);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.director-timeline-empty {
  display: grid;
  place-items: center;
  height: 130px;
  color: #6f8599;
  font-size: 12px;
  letter-spacing: .04em;
}

body.timeline-compact { --director-timeline: 72px; }
body.timeline-compact .timeline { grid-template-rows: 42px; grid-template-columns: 292px 1fr; height: 72px; padding-top: 10px; }
body.timeline-compact .timeline-controls, body.timeline-compact #eventLog, body.timeline-compact .director-track-list { display: none; }
body.timeline-compact #directorTimelineStage { grid-row: 1; }
body.timeline-compact .director-ruler { height: 42px; }

@keyframes director-pop { from { opacity: 0; transform: translate(-50%,-92%) scale(.92); } to { opacity: 1; transform: translate(-50%,-100%) scale(1); } }
@keyframes director-live { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
body.sim-playing .board-header .live { animation: director-live 1.15s ease-in-out infinite; }
body.sim-playing .timeline-controls #play { background: #4a3820; box-shadow: 0 0 28px rgba(232,184,94,.24); }

body.export-capture header, body.export-capture .left, body.export-capture .right,
body.export-capture .tools, body.export-capture .timeline, body.export-capture .board-header,
body.export-capture .canvas-label, body.export-capture .camera-controls,
body.export-capture .minimap-wrap, body.export-capture #floatingSkills,
body.export-capture #statusBadge, body.export-capture .director-action-dock { display:none!important }
body.export-capture main { height:100vh;background:#050c14 }
body.export-capture .workspace { inset:0 }
body.export-capture .board-wrap {
  top:50%;right:auto;bottom:auto;left:50%;
  width:min(100vw,177.7778vh);height:min(100vh,56.25vw)!important;
  transform:translate(-50%,-50%);background:#050c14;
}
body.export-capture .board-wrap::after { display:none }

@media (max-width: 1180px) {
  :root { --director-timeline: 225px; }
  .header-actions #load, .header-actions #import { display: none; }
  .director-chip { padding: 8px 9px; }
  .timeline { grid-template-columns: 250px minmax(0,1fr); }
  .director-ruler { margin-left: 106px; }
  .director-track { grid-template-columns: 106px minmax(0,1fr); }
  .director-playhead { left: calc(106px + (100% - 106px) * var(--progress)); }
  .right { width: 286px; }
  body.inspector-open .director-action-dock { right: 310px; }
}

@media (max-width: 820px) {
  :root { --director-header: 58px; }
  html, body { overflow: auto; }
  header { min-height: 58px; height: auto; padding: 9px 10px; }
  .brand { min-width: 0; }
  .board-mode-nav { min-height: 40px; }
  .board-mode-nav button { padding: 0 12px; }
  .brand b { font-size: 16px; }
  .header-actions #roleStatus, .director-chip:not(#directorFog), #admin { display: none; }
  #directorFog { width: 38px; padding: 0; }
  #directorFog span { display: none; }
  .header-actions #exportVideo span { display:none }
  main { height: calc(100vh - 58px); min-height: 620px; }
  .left { left: 76px; width: min(304px, calc(100vw - 88px)); }
  .right { top: auto; right: 8px; bottom: calc(var(--director-timeline) + 8px); left: 76px; width: auto; max-height: 52vh; }
  .tools { left: 7px; width: 60px; }
  .board-header { left: 76px; }
  .canvas-label { display: none; }
  .timeline { grid-template-columns: 1fr; grid-template-rows: 48px 1fr; padding: 10px; }
  .timeline-title { grid-column: 1; grid-row: 1; }
  .timeline-controls { display: none; }
  #directorTimelineStage { grid-column: 1; grid-row: 2; }
  #eventLog { display: none; }
  .camera-controls { left: 74px; transform: none; }
  .minimap-wrap { width: 136px; }
  #minimap { height: 91px; }
  .director-action-dock { right:8px;top:8px;max-width:calc(100vw - 84px);overflow:auto }
  body.inspector-open .director-action-dock { right:8px }
  .director-action-dock button span { display:none }
}

@media (max-width: 700px) {
  :root { --director-header: 108px; }
  body[data-board-mode="bp"] { --director-header: 64px; }
  header { height: var(--director-header); align-content: center; gap: 4px 0; }
  .header-actions { width: 100%; min-height: 42px; }
  .board-mode-nav { align-self: auto; }
  main { height: calc(100vh - var(--director-header)); }
}

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

.director-shell .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.director-shell .skill-choice { display:flex; align-items:center; gap:8px; min-width:0; min-height:48px; padding:6px !important; text-align:left; }
.director-shell .skill-icon-clip, .director-shell .skill-letter { position:relative; display:block; width:36px; height:36px; flex:0 0 36px; overflow:hidden; border:1px solid #826f49; border-radius:6px; background:#081521; color:#f5d99f; text-align:center; line-height:34px; font-weight:800; box-shadow:inset 0 0 0 1px #ffffff0a; }
.director-shell .skill-icon-atlas { position:absolute; left:0; top:0; width:48px; height:48px; background-repeat:no-repeat; transform:scale(.75); transform-origin:0 0; }
.director-shell .skill-icon-clip>b { position:absolute; right:1px; bottom:1px; min-width:14px; height:14px; padding:0 2px; border-radius:3px; background:#07101be6; color:#ffe0a3; font:700 9px/14px ui-monospace,monospace; text-align:center; }
.director-shell .skill-copy { display:flex; min-width:0; flex-direction:column; }
.director-shell .skill-copy>b { font:700 10px/1.2 ui-monospace,monospace; color:#d9bc82; }
.director-shell .skill-copy small { display:block; max-width:82px; overflow:hidden; color:#edf3f8; font-size:11px; font-weight:600; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.director-shell #floatingSkills { gap:5px; padding:5px; }
.director-shell #floatingSkills .skill-choice { width:36px; height:36px; min-height:0; padding:2px !important; border-color:#8b7448; background:#081521; }
.director-shell #floatingSkills .skill-icon-clip, .director-shell #floatingSkills .skill-letter { width:30px; height:30px; flex-basis:30px; line-height:28px; border:0; }
.director-shell #floatingSkills .skill-icon-atlas { transform:scale(.625); }
.director-shell #floatingSkills .skill-copy { display:none; }

/* Playback quality and actionable route feedback. */
#renderQuality { min-width: 94px; max-width: 120px; font-size: 12px; color: #d9e7ef; }
.route-warning { padding: 10px 12px; border: 1px solid #e7aa66; border-radius: 6px; background: #372719; color: #ffe2b7; font-size: 13px; line-height: 1.6; }
