:root {
  color-scheme: dark;
  --bg: #0b111a;
  --panel: #131e2a;
  --edge: #2d3a46;
  --gold: #e8c68b;
  --text: #eaf1f6;
  --muted: #acbdcc;
  --mint: #9fdfca;
  --red: #ffb4ae;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
select,
input,
textarea {
  font: inherit;
}
button,
select {
  min-height: 44px;
  border: 1px solid var(--edge);
  border-radius: 9px;
  color: inherit;
  background: #1a2836;
  padding: 8px 12px;
}
button {
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled) {
  background: #2b3c49;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #8ed9ff;
  outline-offset: 2px;
}
button.primary {
  background: var(--gold);
  color: #191713;
  font-weight: 750;
  border-color: var(--gold);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(22px, 2.4vw, 38px);
  font-weight: 500;
}
h2 {
  font-size: 19px;
}
small,
.muted {
  color: var(--muted);
}
.brand {
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  border-bottom: 1px solid var(--edge);
}
.brand b {
  letter-spacing: 0.18em;
  font-size: 14px;
}
.brand small {
  display: block;
  letter-spacing: 0.15em;
  font-size: 10px;
  margin-top: 4px;
}
.sigil {
  font-size: 32px;
  color: var(--gold);
}
.prototype {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
  border: 1px solid #6c5a3b;
  border-radius: 20px;
  padding: 7px 12px;
}
.lab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  background: #101923;
}
.concepts {
  display: flex;
  gap: 4px;
}
.concepts button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.concepts button[aria-pressed="true"] {
  background: #26323d;
  color: var(--gold);
  border-color: #65583f;
}
.concepts span {
  margin-left: 6px;
}
.scenario-label {
  margin-left: auto;
}
select {
  max-width: 100%;
}
#main {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 14px 28px 22px;
  gap: 16px;
}
.phase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.eyebrow {
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 5px;
}
.phase-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.phase-meta span {
  font-size: 12px;
}
.connection {
  color: var(--mint);
}
.offline {
  color: var(--red);
}
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--table-width, 75fr)) minmax(
      260px,
      var(--rail-width, 25fr)
    );
  gap: 18px;
}
.board {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr 1.25fr 1fr;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--edge);
  border-radius: 20px;
  background: radial-gradient(
    ellipse at center,
    #213c3d 0,
    #15272b 45%,
    #111c25 75%
  );
  overflow: hidden;
}
.board:before {
  content: "";
  position: absolute;
  inset: 15% 5%;
  border: 1px solid #be9f6438;
  border-radius: 50%;
  pointer-events: none;
}
.seat-row {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: 12px;
  position: relative;
  align-items: center;
  z-index: 1;
}
.seat {
  width: 100%;
  min-width: 0;
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: #142029e8;
  border-color: #3a4e58;
  position: relative;
  padding: 8px 4px;
}
.seat.selected {
  border-color: var(--gold);
  background: #4a4028;
}
.seat.in-team {
  box-shadow: inset 0 -3px 0 var(--mint);
}
.seat.actor {
  border-color: var(--gold);
}
.seat b {
  font-size: 13px;
  font-weight: 550;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.portrait {
  height: 34px;
  width: 34px;
  border-radius: 50%;
  background: linear-gradient(150deg, #718b8f, #1a2b38);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  border: 1px solid #a3b6b861;
  font-family: Georgia, serif;
}
.seat:nth-child(2n) .portrait {
  background: linear-gradient(150deg, #aa8964, #302737);
}
.seat small {
  font-size: 10px;
  white-space: nowrap;
}
.seat .memory {
  color: var(--mint);
  letter-spacing: 3px;
  font-size: 11px;
}
.center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  z-index: 1;
  min-height: 0;
}
.mission-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 620px);
}
.mission {
  min-width: 0;
  background: #162630;
  border-color: #42565d;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  padding: 5px;
}
.mission.current {
  border-color: var(--gold);
  color: var(--gold);
}
.mission small {
  font-size: 10px;
}
.mission.success {
  color: var(--mint);
}
.mission.fail {
  color: var(--red);
}
.chest {
  text-align: center;
}
.chest-symbol {
  color: var(--gold);
  font-size: 24px;
}
.chest b {
  display: block;
  margin: 2px 0;
  font-size: 16px;
  font-weight: 550;
}
.chest p {
  font-size: 12px;
  color: var(--muted);
}
.team-chips {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 7px;
}
.chip {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border-radius: 5px;
  border: 1px solid #51606a;
  color: var(--gold);
  font-size: 11px;
}
.actions {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 18px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow: auto;
}
.action-heading {
  border-bottom: 1px solid var(--edge);
  padding-bottom: 18px;
}
.action-heading p {
  margin-top: 8px;
  line-height: 1.5;
  font-size: 13px;
  color: var(--muted);
}
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.action-buttons button {
  flex: 1;
  min-width: 0;
}
.action-buttons .card {
  min-height: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1b3335;
  color: var(--mint);
  border-color: #52736b;
  font-weight: 650;
}
.action-buttons .card.reject {
  background: #34292e;
  color: #ffb7b0;
  border-color: #795d60;
}
.card-symbol {
  font-size: 25px;
  font-family: Georgia, serif;
}
.action-status {
  padding: 12px;
  background: #0c1721;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.action-status.pending {
  color: var(--gold);
}
.action-status.error {
  color: var(--red);
}
.secondary-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.secondary-actions button {
  font-size: 12px;
  flex: 1;
}
.phase-work {
  display: none;
}
.fallback {
  font-size: 11px;
  color: var(--gold);
  padding: 5px 0;
}
.variant-B .board {
  background:
    linear-gradient(#0c101588, #0c101566),
    url("assets/stage.webp") center/cover;
}
.variant-B .board:before {
  border-color: #d8b47770;
  box-shadow: 0 0 65px #ecbe5330;
}
.variant-B .seat {
  background: #191c27df;
  border-color: #998368;
}
.variant-B .workspace {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}
.variant-B .actions {
  flex-direction: row;
  align-items: center;
  padding: 14px 22px;
  gap: 18px;
  overflow: visible;
}
.variant-B .action-heading {
  width: 24%;
  border: 0;
  padding: 0;
}
.variant-B .action-buttons {
  flex: 1;
}
.variant-B .card {
  min-height: 66px;
  flex-direction: row;
}
.variant-B .secondary-actions {
  margin: 0;
  width: 23%;
}
.variant-B .action-status {
  max-width: 23%;
}
.variant-B .seat {
  min-height: 68px;
}
.variant-B .seat .portrait {
  height: 28px;
  width: 28px;
}
.variant-B .board {
  padding: 12px 40px;
  gap: 5px;
}
.variant-C .workspace {
  grid-template-columns: minmax(310px, 37%) minmax(0, 1fr);
}
.variant-C .board {
  grid-column: 1;
  grid-row: 1;
  padding: 14px;
  gap: 8px;
  background: #101d2a;
}
.variant-C .seat {
  min-height: 85px;
}
.variant-C .portrait {
  width: 25px;
  height: 25px;
}
.variant-C .actions {
  grid-column: 2;
  grid-row: 1;
  background: radial-gradient(ellipse at top, #273c48, #131e2a);
  padding: 32px;
  justify-content: center;
}
.variant-C .phase-work {
  display: block;
  font-family: Georgia, serif;
  font-size: clamp(35px, 5vw, 66px);
  color: #dde8ed;
  line-height: 1.1;
}
.variant-C .action-heading {
  margin-top: 14px;
}
.variant-C .action-buttons {
  max-width: 660px;
}
.variant-C .action-status {
  max-width: 660px;
}
.variant-C .secondary-actions {
  margin-top: 10px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  top: -80px;
  z-index: 20;
  padding: 12px;
  background: white;
  color: black;
}
.skip:focus {
  top: 0;
}
dialog {
  color: var(--text);
  background: #14202c;
  border: 1px solid #4d5c65;
  border-radius: 16px;
  padding: 22px;
  width: min(620px, calc(100% - 24px));
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #050a11ba;
  backdrop-filter: blur(4px);
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.sheet-head button {
  flex-shrink: 0;
}
.sheet-head h2 {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
}
dialog p {
  line-height: 1.6;
  margin: 10px 0;
}
dialog label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
dialog .check {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tool-actions button {
  flex: 1 1 160px;
}
.public-label {
  color: var(--mint);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.private-label {
  color: var(--gold);
  font-size: 11px;
}
.private-card {
  padding: 24px;
  border: 1px solid #776445;
  border-radius: 12px;
  background: #29271f;
  margin: 15px 0;
}
.private-card h3 {
  font-family: Georgia, serif;
  font-size: 28px;
  color: var(--gold);
}
.history-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--edge);
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
#comparison {
  width: calc(100% - 24px);
  max-width: none;
}
#frames {
  display: flex;
  gap: 16px;
  overflow: auto;
  padding: 14px 0;
}
.frame-card {
  flex: 1;
  min-width: 260px;
}
.frame-window {
  position: relative;
  overflow: hidden;
  background: #080d14;
  border: 1px solid var(--edge);
  border-radius: 10px;
  margin-top: 10px;
}
.frame-window iframe {
  border: 0;
  transform-origin: top left;
  max-width: none;
}
.frame-card h3 {
  font-size: 13px;
  color: var(--gold);
}
.embed .prototype {
  display: none;
}
.reduced *,
.reduced *:before {
  animation: none !important;
  transition: none !important;
}
.action-status.ack {
  animation: ack 0.45s ease-out;
}
@keyframes ack {
  from {
    box-shadow: 0 0 0 3px var(--mint);
  }
  to {
    box-shadow: 0 0 0 0 transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before {
    animation: none !important;
    transition: none !important;
  }
}
.variant-B .board {
  grid-template-rows: minmax(84px, 1fr) auto minmax(84px, 1fr);
}
.variant-B .seat {
  gap: 2px;
  padding: 4px;
}
.variant-B .center {
  gap: 6px;
}
.variant-B .mission {
  min-height: 52px;
}
.variant-B .chest-symbol {
  font-size: 20px;
}
@media (max-width: 899px) and (orientation: portrait) {
  .brand {
    height: 48px;
    padding: 0 12px;
    gap: 7px;
  }
  .brand b {
    font-size: 11px;
    letter-spacing: 0.12em;
  }
  .brand small {
    font-size: 8px;
  }
  .sigil {
    font-size: 24px;
  }
  .prototype {
    font-size: 8px;
    padding: 5px 6px;
    letter-spacing: 0;
  }
  .lab {
    padding: 5px 8px;
    gap: 4px;
  }
  .lab button,
  .lab select {
    padding: 5px;
    min-height: 44px;
    font-size: 11px;
  }
  .concepts span,
  #settings-open span {
    display: none;
  }
  .concepts {
    gap: 1px;
  }
  .concepts button {
    min-width: 36px;
  }
  .scenario-label {
    flex: 1;
    min-width: 0;
  }
  .scenario-label select {
    width: 100%;
  }
  #main {
    padding: 6px 8px 8px;
    gap: 6px;
  }
  .phase-bar {
    min-height: 44px;
    gap: 4px;
  }
  h1 {
    font-size: 21px;
  }
  .eyebrow {
    font-size: 8px;
    margin-bottom: 2px;
  }
  .phase-meta {
    gap: 4px;
    justify-content: flex-end;
    max-width: 48%;
  }
  .phase-meta span {
    font-size: 10px;
  }
  .phase-meta button {
    font-size: 10px;
    padding: 4px;
    min-height: 44px;
  }
  .workspace,
  .variant-B .workspace,
  .variant-C .workspace {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
  }
  .board,
  .variant-B .board,
  .variant-C .board {
    flex: 1;
    min-height: 200px;
    border-radius: 12px;
    padding: 8px;
    gap: 5px;
    grid-template-rows: 1fr 1.1fr 1fr;
  }
  .seat-row {
    gap: 4px;
  }
  .seat,
  .variant-B .seat,
  .variant-C .seat {
    min-height: 63px;
    gap: 2px;
    padding: 3px 1px;
    border-radius: 7px;
  }
  .seat b {
    font-size: 10px;
  }
  .portrait,
  .variant-B .seat .portrait,
  .variant-C .portrait {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .seat small {
    font-size: 8px;
  }
  .seat .memory {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .center {
    gap: 5px;
  }
  .mission-rail {
    gap: 4px;
  }
  .mission {
    min-height: 44px;
    border-radius: 6px;
    gap: 1px;
    padding: 2px;
    font-size: 11px;
  }
  .mission small {
    font-size: 8px;
  }
  .chest-symbol {
    display: none;
  }
  .chest b {
    font-size: 12px;
  }
  .chest p {
    font-size: 10px;
  }
  .chip {
    height: 18px;
    min-width: 18px;
    font-size: 9px;
  }
  .team-chips {
    margin-top: 3px;
    gap: 3px;
  }
  .actions,
  .variant-B .actions,
  .variant-C .actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 9px;
    border-radius: 12px;
    overflow: visible;
    max-height: none;
  }
  .action-heading,
  .variant-B .action-heading,
  .variant-C .action-heading {
    width: auto;
    border: 0;
    padding: 0;
    margin: 0;
  }
  .action-heading h2 {
    font-size: 13px;
  }
  .action-heading p {
    font-size: 10px;
    margin-top: 2px;
    line-height: 1.25;
  }
  .action-heading .eyebrow {
    display: none;
  }
  .action-buttons {
    gap: 7px;
  }
  .action-buttons .card,
  .variant-B .card {
    min-height: 51px;
    padding: 5px;
    flex-direction: row;
    font-size: 12px;
    gap: 7px;
  }
  .card-symbol {
    font-size: 20px;
  }
  .action-status,
  .variant-B .action-status,
  .variant-C .action-status {
    max-width: none;
    padding: 6px;
    font-size: 10px;
    line-height: 1.3;
  }
  .secondary-actions,
  .variant-B .secondary-actions,
  .variant-C .secondary-actions {
    margin: 0;
    width: auto;
    gap: 5px;
  }
  .secondary-actions button {
    font-size: 10px;
    min-height: 44px;
    padding: 4px;
  }
  .phase-work {
    display: none !important;
  }
  .fallback {
    font-size: 9px;
    padding: 0;
  }
  .variant-B .board {
    background-position: center;
  }
  .variant-B .seat {
    min-height: 59px;
    background: #181e2cdd;
  }
  .variant-B .portrait {
    border-radius: 5px;
  }
  .variant-C .board {
    flex: 0.75;
    background: #142433;
  }
  .variant-C .seat {
    background: transparent;
  }
  .variant-C .actions {
    border-color: #66808e;
    background: #1b303d;
  }
  .variant-C .action-heading h2 {
    font-family: Georgia, serif;
    font-size: 20px;
  }
  .variant-C .action-heading p {
    font-size: 11px;
  }
  .form-grid {
    gap: 12px;
  }
  .private-card {
    padding: 15px;
  }
  dialog {
    padding: 16px;
  }
  .team-label {
    max-width: 100%;
  }
}
@media (max-height: 650px) and (orientation: portrait) {
  .seat,
  .variant-B .seat,
  .variant-C .seat {
    min-height: 54px;
  }
  .portrait,
  .variant-B .seat .portrait,
  .variant-C .portrait {
    display: none;
  }
  .board,
  .variant-B .board,
  .variant-C .board {
    min-height: 176px;
    padding: 5px;
  }
  .actions,
  .variant-B .actions,
  .variant-C .actions {
    gap: 4px;
    padding: 6px;
  }
  .action-heading p {
    display: none;
  }
  .variant-C .action-heading h2 {
    font-size: 15px;
  }
  .mission small {
    display: none;
  }
  .chest p {
    font-size: 9px;
  }
  .phase-meta {
    gap: 2px;
  }
  .phase-meta .reject-label {
    display: none;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .brand {
    height: 35px;
    padding: 0 12px;
  }
  .brand small,
  .prototype {
    display: none;
  }
  .sigil {
    font-size: 22px;
  }
  .lab {
    padding: 3px 12px;
  }
  .lab button,
  .lab select {
    font-size: 10px;
    padding: 3px;
    min-height: 36px;
  }
  #main {
    padding: 3px 12px 6px;
    gap: 4px;
  }
  .phase-bar {
    min-height: 32px;
  }
  h1 {
    font-size: 20px;
  }
  .phase-meta button {
    min-height: 32px;
  }
  .workspace,
  .variant-B .workspace,
  .variant-C .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
  }
  .board,
  .variant-B .board,
  .variant-C .board {
    grid-column: 1;
    grid-row: 1;
    padding: 4px;
    gap: 3px;
    grid-template-rows: 1fr 1.2fr 1fr;
  }
  .seat,
  .variant-B .seat,
  .variant-C .seat {
    min-height: 44px;
    gap: 0;
    padding: 2px;
  }
  .portrait,
  .seat small,
  .seat .memory {
    display: none;
  }
  .seat b {
    font-size: 10px;
  }
  .mission {
    min-height: 44px;
    font-size: 10px;
    padding: 2px;
  }
  .mission small,
  .chest-symbol,
  .team-chips {
    display: none;
  }
  .center {
    gap: 2px;
  }
  .chest b {
    font-size: 12px;
  }
  .chest p {
    font-size: 10px;
  }
  .actions,
  .variant-B .actions,
  .variant-C .actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 5px;
    align-items: stretch;
    overflow: auto;
  }
  .action-heading,
  .variant-B .action-heading,
  .variant-C .action-heading {
    width: auto;
    padding: 0;
    border: 0;
    margin: 0;
  }
  .action-heading h2 {
    font-size: 13px;
  }
  .action-heading p,
  .action-heading .eyebrow,
  .phase-work {
    display: none !important;
  }
  .action-buttons .card,
  .variant-B .card {
    min-height: 44px;
    flex-direction: row;
    padding: 3px;
    font-size: 11px;
  }
  .card-symbol {
    font-size: 17px;
  }
  .secondary-actions,
  .variant-B .secondary-actions,
  .variant-C .secondary-actions {
    width: auto;
    margin: 0;
    gap: 4px;
  }
  .secondary-actions button {
    padding: 3px;
    font-size: 10px;
    min-height: 44px;
  }
  .action-status,
  .variant-B .action-status {
    max-width: none;
    font-size: 10px;
    padding: 4px;
  }
  .phase-meta span {
    font-size: 10px;
  }
}
/* Reserve actual center content height: grid fractions alone can overlap mission memory. */
.variant-B .chest-symbol {
  display: none;
}
@media (max-width: 899px) and (orientation: portrait) {
  .board,
  .variant-B .board,
  .variant-C .board {
    grid-template-rows: minmax(54px, 1fr) auto minmax(54px, 1fr);
  }
  .variant-C .board {
    flex: 1;
  }
  .variant-B .mission {
    min-height: 44px;
  }
}
@media (max-height: 650px) and (orientation: portrait) {
  .action-status:not(.pending):not(.error):not(.ack) {
    display: none;
  }
  .chest .team-label {
    font-size: 9px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .variant-B .mission {
    min-height: 44px;
  }
}
@media (max-width: 899px) and (min-height: 651px) and (orientation: portrait) {
  .variant-C .board {
    flex: 0 0 45%;
    min-height: 280px;
  }
  .variant-C .actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .variant-C .phase-work {
    display: block !important;
    font-size: 26px;
    white-space: pre-line;
  }
  .variant-C .action-buttons .card {
    min-height: 60px;
  }
  .variant-C .secondary-actions {
    margin-top: auto;
  }
}
@media (max-width: 899px) and (orientation: portrait) {
  #settings-open {
    min-width: 44px;
  }
  #settings-open span[aria-hidden="true"] {
    display: inline;
  }
}
/* Repair: stable contrast surfaces and legible seat identity, independent of backdrop. */
.seat {
  background: #142029;
}
.seat b {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.15;
}
.seat-number {
  font-size: 11px;
  color: var(--gold);
}
.seat-name {
  font-size: 13px;
  white-space: nowrap;
}
.seat[data-viewer="true"]:after {
  content: "•";
  position: absolute;
  right: 4px;
  top: 1px;
  color: var(--gold);
}
.seat .portrait {
  display: none;
}
.seat .memory {
  font-size: 14px;
  letter-spacing: 2px;
  line-height: 1.1;
}
.mission small {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.center .team-label {
  color: #c9d5df;
}
.variant-B .board {
  background:
    linear-gradient(#080d18b3, #080d18b3),
    url("assets/stage.webp") center/cover;
}
.variant-B .seat,
.variant-B .seat:hover:not(:disabled) {
  background: #151e2c;
}
.variant-B .seat.selected {
  background: #4a4028;
}
.variant-B .mission {
  background: #14232f;
}
.variant-B .chest {
  background: #111d29;
  border: 1px solid #475765;
  border-radius: 10px;
  padding: 8px 14px;
}
.variant-C .action-heading {
  margin-top: 0;
}
.variant-C .action-heading h2 {
  font-family: Georgia, serif;
  font-size: clamp(22px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.15;
}
@media (max-width: 899px) and (orientation: portrait) {
  .seat b {
    gap: 1px;
  }
  .seat-name {
    font-size: 12px;
  }
  .seat-number {
    font-size: 10px;
  }
  .seat small {
    font-size: 10px;
    line-height: 1.1;
  }
  .seat .memory {
    font-size: 14px;
    letter-spacing: 1px;
  }
  .seat,
  .variant-B .seat,
  .variant-C .seat {
    padding: 3px 1px;
    gap: 2px;
    min-height: 66px;
  }
  .mission small {
    font-size: 11px;
    display: block;
  }
  .mission {
    font-size: 12px;
    min-height: 48px;
  }
  .variant-B .mission {
    min-height: 48px;
  }
  .chest p {
    font-size: 11px;
  }
  .variant-B .chest {
    padding: 4px 5px;
  }
  .variant-C .action-heading h2 {
    font-size: 24px;
  }
  .variant-C .board {
    min-height: 290px;
  }
}
@media (max-height: 650px) and (orientation: portrait) {
  .brand {
    height: 44px;
  }
  .lab {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .phase-bar {
    min-height: 40px;
  }
  .seat,
  .variant-B .seat,
  .variant-C .seat {
    padding: 2px 1px;
    gap: 1px;
    min-height: 62px;
  }
  .seat .memory {
    font-size: 13px;
  }
  .seat-number {
    font-size: 10px;
  }
  .seat-name {
    font-size: 12px;
  }
  .mission small {
    display: block;
    font-size: 11px;
  }
  .mission,
  .variant-B .mission {
    min-height: 46px;
  }
  .chest .team-label {
    font-size: 10px;
  }
  .variant-C .board {
    min-height: 220px;
  }
  .variant-C .action-heading h2 {
    font-size: 17px;
  }
  .variant-B .chest {
    padding: 3px;
    border: 0;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .seat b {
    flex-direction: row;
    gap: 3px;
  }
  .seat-number,
  .seat-name {
    font-size: 11px;
  }
  .seat small {
    display: none;
  }
  .variant-B .chest {
    padding: 2px;
  }
  .variant-C .action-heading h2 {
    font-size: 15px;
  }
}
.chest {
  background: #14232f;
  border-radius: 8px;
}
@media (max-height: 650px) and (orientation: portrait) {
  .phase-bar h1 {
    font-size: 19px;
  }
  .phase-bar .eyebrow {
    white-space: nowrap;
    font-size: 8px;
    letter-spacing: 0.08em;
  }
  .phase-meta {
    max-width: 35%;
  }
  .phase-meta .connection {
    white-space: nowrap;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .board,
  .variant-B .board,
  .variant-C .board {
    grid-template-rows: minmax(44px, 1fr) auto minmax(44px, 1fr);
  }
}
.variant-C .actions {
  background: #1b303d;
}
@media (max-height: 650px) and (orientation: portrait) {
  /* During delivery/recovery, keep the roster and ACK state instead of optional dock links.
    Seat detail remains available; full optional links return after the phase completes. */
  .actions.busy .secondary-actions {
    display: none;
  }
}
