body[data-ak-ui] {
  --ak-surface-canvas: #e9e8e2;
  --ak-surface-panel: #f8f7f1;
  --ak-surface-muted: #dedfd8;
  --ak-surface-raised: #30363a;
  --ak-surface-inverse: #1e2428;
  --ak-text-primary: #252c30;
  --ak-text-secondary: #687279;
  --ak-text-inverse: #f8f7f1;
  --ak-signal-info: #087e91;
  --ak-signal-action: #f2ce49;
  --ak-signal-danger: #aa3838;
  --ak-font-sans: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ak-font-command: "Songti SC", serif;
  --ak-focus-color: #087e91;
  margin: 0;
  background: var(--ak-surface-canvas);
  color: var(--ak-text-primary);
  font: 15px/1.6 var(--ak-font-sans);
}
[data-ak-ui] * {
  box-sizing: border-box;
}
[data-ak-ui] button,
[data-ak-ui] input,
[data-ak-ui] select {
  font: inherit;
}
[data-ak-ui] button {
  cursor: pointer;
  min-height: 44px;
}
[data-ak-ui] button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
[data-ak-ui] button:focus-visible,
[data-ak-ui] input:focus-visible,
[data-ak-ui] select:focus-visible {
  outline: 3px solid var(--ak-signal-info);
  outline-offset: 3px;
}
[data-ak-ui] button.ak-button {
  color: var(--ak-text-primary);
  border: 1px solid #969d9c;
  background: transparent;
  padding: 10px 18px;
  font-weight: 700;
}
[data-ak-ui] button.primary {
  background: var(--ak-signal-action);
  border-color: var(--ak-signal-action);
  color: #222a2e;
}
[data-ak-ui] h1,
[data-ak-ui] h2,
[data-ak-ui] h3,
[data-ak-ui] p {
  margin: 0;
}
[data-ak-ui] h1 {
  font: 800 clamp(38px, 5vw, 72px) / 1.2 var(--ak-font-command);
  letter-spacing: 0.03em;
}
[data-ak-ui] h2 {
  font-size: 24px;
  font-weight: 850;
}
[data-ak-ui] h3 {
  font-size: 17px;
}
[data-ak-ui] small,
.muted {
  color: var(--ak-text-secondary);
}
[data-ak-ui] input,
[data-ak-ui] select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #9da5a6;
  border-radius: 0;
  color: #252c30;
  background: var(--ak-surface-panel);
}
[data-ak-ui] label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
[data-ak-ui] .eyebrow {
  font: 600 11px var(--ak-font-mono);
  letter-spacing: 0.16em;
  color: var(--ak-signal-info);
}
[data-ak-ui] .topbar {
  min-height: 76px;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--ak-surface-inverse);
  color: #f5f4ed;
  border-bottom: 4px solid var(--ak-signal-action);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border: 3px solid #f5f4ed;
  transform: rotate(45deg);
  position: relative;
}
.brand-mark:after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--ak-signal-action);
}
.brand b {
  font-size: 18px;
  letter-spacing: 0.08em;
}
.brand small {
  display: block;
  color: #a9b6bb;
  font-size: 10px;
  letter-spacing: 0.18em;
}
.topbar .eyebrow {
  color: #86cbd6;
}
.top-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
}
.top-meta button.ak-button {
  color: #f5f4ed;
  border-color: #6d797f;
}
.landing {
  max-width: 1440px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(330px, 0.85fr) 1.2fr;
  min-height: calc(100vh - 80px);
}
.intro {
  padding: 70px 45px 55px;
  z-index: 1;
}
.intro h1 {
  margin: 20px 0;
}
.intro > p {
  max-width: 390px;
  color: #59666d;
  font-size: 16px;
  margin-bottom: 30px;
}
.entry {
  max-width: 420px;
  padding-top: 24px;
  border-top: 3px solid #2e373c;
}
.entry .fields {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 12px;
}
.entry .primary {
  width: 100%;
  margin: 16px 0;
}
.entry .join-row {
  display: flex;
  gap: 8px;
}
.entry .join-row input {
  text-transform: lowercase;
  min-width: 0;
}
.preview {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #d6dbd7;
  border-left: 1px solid #b7c0bd;
}
.preview:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49.8%, #bcc7c340 50%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, #bcc7c340 50%, transparent 50.2%);
  background-size: 75px 75px;
}
.preview .map-svg {
  width: 100%;
  position: relative;
  opacity: 0.8;
}
.preview-caption {
  position: absolute;
  bottom: 35px;
  left: 35px;
  border-left: 4px solid var(--ak-signal-info);
  padding-left: 16px;
}
.preview-caption strong {
  font-size: 24px;
  display: block;
}
.footnote {
  font-size: 12px;
  margin-top: 24px;
  color: #647077;
}
.lobby {
  max-width: 1040px;
  margin: 60px auto;
  padding: 0 24px;
}
.room-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.room-heading h1 {
  font-size: 40px;
}
.players {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.seat {
  min-height: 170px;
  padding: 24px 20px;
  border-top: 5px solid var(--player-color, #9ba5a3);
  background: var(--ak-surface-panel);
}
.seat.empty {
  background: transparent;
  border: 1px dashed #aab2ae;
  color: #6b7779;
}
.seat strong {
  display: block;
  font-size: 24px;
  margin: 10px 0;
}
.lobby-command {
  background: #30383c;
  color: #f7f7ef;
  margin-top: 30px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.lobby-command p {
  color: #b8c3c7;
}
.command-buttons {
  display: flex;
  gap: 12px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  max-width: 1800px;
  margin: auto;
}
.playfield {
  min-width: 0;
  padding: 24px 28px 0;
}
.phasebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid #30383c;
  padding-bottom: 16px;
}
.phase-title {
  font-size: 24px;
  font-weight: 850;
}
.phase-title span {
  font: 400 14px var(--ak-font-sans);
  margin-left: 16px;
}
.round {
  font: 700 28px var(--ak-font-mono);
}
.round small {
  font: 400 12px var(--ak-font-sans);
}
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  font-size: 12px;
}
.map-toolbar button {
  padding: 0 12px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 18px;
}
.map-viewport {
  position: relative;
  overflow: auto;
  background: #dce1db;
  background-image:
    linear-gradient(#657a6a0c 1px, transparent 1px),
    linear-gradient(90deg, #657a6a0c 1px, transparent 1px);
  background-size: 30px 30px;
  border: 1px solid #bcc6bf;
  max-height: calc(100vh - 285px);
  min-height: 480px;
}
.map-svg {
  display: block;
  width: 100%;
  min-width: 650px;
  height: auto;
}
.map-svg text {
  font-family: var(--ak-font-sans);
}
.map-svg .route-line {
  stroke: #8f9e98;
  stroke-width: 5;
  fill: none;
}
.map-svg .route-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 32;
  cursor: pointer;
}
.map-svg .route-label {
  font-size: 10px;
  fill: #5f7068;
}
.map-svg .node {
  cursor: pointer;
}
.map-svg .node rect.main {
  fill: #f7f7ef;
  stroke: #8e9c96;
  stroke-width: 1;
}
.map-svg .node-id {
  font-size: 15px;
  font-weight: 800;
  fill: #293a39;
}
.map-svg .event-label {
  font-size: 10px;
  fill: #566964;
}
.map-svg .node.selected rect.main {
  stroke: #087e91;
  stroke-width: 4;
}
.map-svg .node.legal rect.main {
  stroke: #9a760c;
  stroke-width: 3;
  fill: #fff9da;
}
.map-svg .route-select.legal > rect:nth-of-type(2) {
  stroke: #9a760c;
  stroke-width: 3;
  fill: #fff9da;
}
.map-svg .route-select {
  cursor: pointer;
}
.map-svg .city-pin {
  font-size: 10px;
  fill: white;
  font-weight: 700;
}
.map-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 10px 0;
  color: #5d6b66;
  font-size: 11px;
}
.signal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: currentColor;
  margin-right: 6px;
}
.command-panel {
  padding: 24px;
  background: var(--ak-surface-panel);
  border-left: 1px solid #bdc5bf;
  min-width: 0;
}
.command-panel h2 {
  margin: 16px 0 8px;
}
.connection {
  font-size: 11px;
  color: #66746e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.connection:before {
  content: "";
  width: 6px;
  height: 6px;
  background: #198273;
}
.self-name {
  font-size: 22px;
  font-weight: 800;
}
.score {
  font: 700 36px var(--ak-font-mono);
}
.self-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}
.resource-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 15px 0;
  border-block: 1px solid #c9d0cb;
}
.resource {
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}
.resource strong {
  font: 700 21px var(--ak-font-mono);
  display: block;
}
.resource svg {
  height: 22px;
  width: 22px;
  display: block;
  margin: 0 auto 5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
}
.section-heading h3 {
  font-size: 13px;
  letter-spacing: 0.05em;
}
.section-heading small {
  font-size: 11px;
}
.actions {
  display: grid;
  gap: 8px;
}
.action-button {
  width: 100%;
  text-align: left;
  border: 1px solid #adb8b1;
  background: transparent;
  padding: 12px 14px;
  color: #2e3936;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.action-button span {
  font-size: 12px;
  font-weight: 400;
}
.action-button[aria-pressed="true"] {
  background: #30383c;
  color: #fff;
  border-color: #30383c;
}
.action-form {
  padding: 18px 0;
}
.action-form label {
  font-size: 13px;
}
.action-form .field {
  margin-bottom: 14px;
}
.action-form p {
  margin-bottom: 12px;
  color: #65716b;
  font-size: 12px;
}
.action-form button.primary {
  width: 100%;
}
.prompt {
  border-top: 4px solid var(--ak-signal-action);
  padding-top: 16px;
}
.prompt h3 {
  font-size: 21px;
}
.prompt > p {
  font-size: 13px;
  margin: 8px 0 16px;
}
.choice {
  background: #f8f7f1;
  border: 1px solid #aeb7af;
  text-align: left;
  padding: 12px;
  display: block;
  width: 100%;
  margin: 8px 0;
}
.choice small {
  display: block;
  font-weight: 400;
}
.choice:hover {
  background: #fff8d3;
  border-color: #9a760c;
}
.waiting {
  padding: 22px 0;
  color: #64726a;
  font-size: 14px;
}
.other-players {
  margin-top: 24px;
  border-top: 1px solid #bbc4bd;
  padding-top: 12px;
}
.other-player {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  padding: 9px 0;
  align-items: center;
  font-size: 12px;
}
.player-dot {
  width: 8px;
  height: 8px;
  background: var(--player-color, #5b8eac);
}
.other-player.active {
  font-weight: 800;
}
.library {
  padding: 20px 28px 30px;
  grid-column: 1/-1;
  border-top: 1px solid #b6c0b9;
}
.library-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  border-bottom: 1px solid #aeb9b1;
}
.library-tabs button,
.mobile-tabs button {
  border: 0;
  background: transparent;
  border-bottom: 3px solid transparent;
  padding: 10px 2px;
  color: #647169;
  font-weight: 700;
}
.library-tabs button[aria-selected="true"],
.mobile-tabs button[aria-selected="true"] {
  border-bottom-color: #087e91;
  color: #243a34;
}
.card-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 3px 2px 14px;
}
.game-card {
  flex: 0 0 178px;
  min-height: 155px;
  background: var(--ak-surface-panel);
  border: 1px solid #b3beb6;
  border-top: 5px solid var(--card-color, #4e6565);
  padding: 14px;
  text-align: left;
}
.game-card h3 {
  font-size: 16px;
  margin: 5px 0 10px;
}
.game-card p {
  font-size: 11px;
  color: #68776d;
  line-height: 1.6;
}
.game-card small {
  font-size: 10px;
}
.game-card:hover {
  transform: translateY(-2px);
  border-color: #087e91;
}
.city-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 190px));
  gap: 8px;
}
.city-cell {
  min-height: 105px;
  border: 1px solid #a8b5ac;
  padding: 10px;
  text-align: left;
  background: #dce1da;
}
.city-cell.occupied {
  background: #f9f8f0;
  border-top: 4px solid var(--card-color, #5e7469);
}
.city-cell.legal {
  outline: 3px solid #a68720;
  background: #fff7cf;
}
.city-cell small {
  display: block;
  font-size: 10px;
}
.city-cell b {
  font-size: 13px;
}
.empty-city {
  color: #8b988f;
  font-size: 12px;
}
.journal {
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
}
.journal p {
  padding: 8px 0;
  border-bottom: 1px solid #c4cdc5;
}
.mobile-tabs {
  display: none;
}
.help-bar {
  background: #d5ded5;
  padding: 12px 16px;
  font-size: 12px;
  margin-top: 16px;
  border-left: 3px solid #087e91;
}
.help-bar button {
  border: 0;
  background: transparent;
  float: right;
  font-size: 18px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: #283431;
  color: #fff;
  z-index: 20;
  box-shadow: 0 8px 32px #0003;
  max-width: 90vw;
}
.toast.error {
  background: #863e37;
}
dialog {
  border: 0;
  background: #f5f5ed;
  color: #24382e;
  padding: 30px;
  max-width: 560px;
  width: calc(100% - 32px);
  box-shadow: 0 12px 80px #0004;
}
dialog::backdrop {
  background: #14251fc0;
}
dialog h2 {
  margin-bottom: 14px !important;
}
dialog p {
  margin: 12px 0 !important;
  white-space: pre-line;
}
dialog button {
  margin-top: 20px;
}
.detail-cost {
  font-size: 14px;
  padding: 14px;
  background: #e1e7dd;
}
.error-box {
  padding: 14px;
  margin: 12px 0;
  background: #f0dcd5;
  border-left: 3px solid #a13930;
  font-size: 13px;
}
.loading-screen {
  padding: 100px 30px;
  text-align: center;
}
.mobile-only {
  display: none;
}
.board-subtitle {
  font-size: 12px;
  color: #6b7c6e;
  margin-bottom: 14px;
}
.selected-info {
  margin: 12px 0;
  padding: 12px;
  border-left: 3px solid #087e91;
  background: #d8e5df;
  font-size: 12px;
}
.details-link {
  border: 0;
  background: transparent;
  color: #087e91;
  padding: 0 8px;
  font-size: 12px;
  text-decoration: underline;
}
.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.offline {
  color: #a63831 !important;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400 !important;
}
.inline-check input {
  width: 20px;
  min-height: 20px;
}
.pattern-shape {
  display: grid;
  grid-template-columns: repeat(3, 16px);
  gap: 3px;
  margin: 10px 0;
}
.pattern-shape i {
  width: 16px;
  height: 20px;
  background: var(--card-color);
}
@media (min-width: 1500px) {
  .map-viewport {
    max-height: 750px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
  .command-panel {
    padding: 28px;
  }
}
@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .playfield {
    padding: 20px 16px 0;
  }
  .command-panel {
    padding: 20px 16px;
  }
  .topbar {
    padding: 14px 20px;
  }
  .landing {
    grid-template-columns: 1fr 1fr;
  }
  .intro {
    padding: 55px 28px;
  }
  .preview .map-svg {
    min-width: 600px;
    margin-left: -110px;
  }
  .players {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  body[data-ak-ui] {
    font-size: 14px;
  }
  .topbar {
    min-height: 66px;
    padding: 12px 16px;
    gap: 10px;
  }
  .brand b {
    font-size: 15px;
  }
  .brand-mark {
    width: 25px;
    height: 25px;
  }
  .brand small {
    font-size: 8px;
  }
  .top-meta {
    gap: 8px;
  }
  .top-meta .room-id-label {
    display: none;
  }
  .top-meta button.ak-button {
    padding: 7px 10px;
    font-size: 11px;
  }
  .landing {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }
  .intro {
    padding: 40px 24px 28px;
  }
  .intro h1 {
    font-size: 46px;
  }
  .intro > p {
    font-size: 14px;
  }
  .entry {
    max-width: none;
  }
  .preview {
    height: 280px;
    border-left: 0;
    border-top: 1px solid #b7c0bd;
  }
  .preview .map-svg {
    width: 450px;
    min-width: 450px;
    margin: -70px 0 0 auto;
    opacity: 0.55;
  }
  .preview-caption {
    bottom: 25px;
    left: 25px;
  }
  .preview-caption strong {
    font-size: 23px;
  }
  .lobby {
    margin: 34px auto;
  }
  .room-heading {
    align-items: flex-start;
  }
  .room-heading h1 {
    font-size: 32px;
  }
  .players {
    gap: 8px;
  }
  .seat {
    padding: 16px;
    min-height: 135px;
  }
  .seat strong {
    font-size: 21px;
  }
  .lobby-command {
    display: block;
    padding: 20px;
  }
  .command-buttons {
    margin-top: 18px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .playfield {
    padding: 16px 12px 0;
  }
  .phasebar {
    padding-bottom: 12px;
  }
  .phase-title {
    font-size: 20px;
  }
  .phase-title span {
    display: block;
    margin: 0;
    font-size: 12px;
  }
  .round {
    font-size: 24px;
  }
  .map-viewport {
    min-height: 440px;
    max-height: 60vh;
  }
  .map-svg {
    min-width: 700px;
  }
  .map-toolbar {
    font-size: 11px;
  }
  .map-legend {
    font-size: 10px;
    gap: 9px;
  }
  .command-panel {
    order: 2;
    border-left: 0;
    border-top: 2px solid #30383c;
    padding: 18px 20px;
  }
  .self-summary {
    margin: 8px 0 14px;
  }
  .resource-strip {
    padding: 10px 0;
  }
  .resource strong {
    font-size: 22px;
  }
  .resource svg {
    height: 18px;
  }
  .connection {
    float: right;
  }
  .section-heading {
    margin: 18px 0 10px;
  }
  .actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-button {
    font-size: 13px;
    padding: 10px;
  }
  .action-button span {
    display: none;
  }
  .library {
    order: 3;
    padding: 20px 16px;
  }
  .library-tabs {
    gap: 22px;
    overflow: auto;
    white-space: nowrap;
  }
  .card-row {
    gap: 10px;
  }
  .game-card {
    flex-basis: 160px;
    min-height: 145px;
  }
  .other-players {
    display: none;
  }
  .mobile-tabs {
    display: flex;
    background: #30383c;
    gap: 28px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 4;
    overflow: auto;
  }
  .mobile-tabs button {
    color: #b9c6c0;
    white-space: nowrap;
  }
  .mobile-tabs button[aria-selected="true"] {
    color: #fff;
    border-color: #f2ce49;
  }
  .workspace[data-mobile-tab="city"] .playfield,
  .workspace[data-mobile-tab="market"] .playfield,
  .workspace[data-mobile-tab="hand"] .playfield {
    display: none;
  }
  .workspace[data-mobile-tab="map"] .library {
    display: none;
  }
  .workspace:not([data-mobile-tab="map"]) .command-panel {
    order: 3;
  }
  .workspace:not([data-mobile-tab="map"]) .library {
    order: 1;
    border: 0;
    min-height: 300px;
  }
  .workspace:not([data-mobile-tab="map"]) .library-tabs {
    display: none;
  }
  .workspace[data-mobile-tab="map"] .command-panel {
    order: 1;
  }
  .workspace[data-mobile-tab="map"] .playfield {
    order: 0;
  }
  .city-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }
  .city-cell {
    min-height: 110px;
  }
  .toast {
    bottom: 15px;
    width: max-content;
  }
  .help-bar {
    font-size: 11px;
  }
  .footnote {
    font-size: 11px;
  }
  .mobile-only {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-ak-ui] *,
  [data-ak-ui] *:before,
  [data-ak-ui] *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Ark's multi-zone command shell and Rhine's bounded diagnostic bench share the neutral foundation. */
[data-ark-theme="ark"] {
  --ark-ink: #242b2f;
  --ark-paper: #f3f5f3;
  --ark-signal: var(--ak-signal-info);
}
[data-ak-ui] .map-svg {
  min-width: 850px;
}
[data-ak-ui] .map-svg .node-id {
  font-size: 18px;
}
[data-ak-ui] .map-svg .event-label {
  font-size: 12px;
}
.choice-list {
  max-height: 460px;
  overflow: auto;
  padding: 2px 4px 4px 0;
  scrollbar-width: thin;
}
.result-board {
  margin-top: 20px;
  border-top: 3px solid #303b36;
  padding-top: 14px;
}
.result-player {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #c4cdc7;
}
.result-player small {
  flex-basis: 100%;
}
.city-bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 24px;
  max-width: 1120px;
}
.specimen-stage {
  background: #eef1ef;
  border: 1px solid #b4bfbb;
  padding: 18px;
  position: relative;
}
.specimen-lintel {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #75847e;
  font-size: 11px;
}
.sample-tray {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-top: 18px;
  border-top: 1px solid #b4bfbb;
  padding-top: 12px;
}
.caliper {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border: 2px solid #75847e;
}
.caliper button {
  background: transparent;
  border: 0;
  padding: 0 12px;
  width: 44px;
  color: #34443c;
}
.caliper output {
  display: block;
  min-width: 75px;
  text-align: center;
  font: 600 13px var(--ak-font-mono);
  border-inline: 1px solid #b1bdb5;
}
.caliper button:hover {
  background: #d1dfae;
}
.review-dock {
  border-left: 2px solid #9ba89f;
  padding: 8px 0 8px 20px;
  align-self: start;
}
.review-dock h3 {
  margin: 14px 0 10px;
}
.review-dock p {
  font-size: 13px;
  color: #53655a;
  margin-bottom: 16px;
}
.sample-state {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 24px;
}
.sample-state strong {
  font: 700 20px var(--ak-font-mono);
}
.sample-state meter {
  grid-column: 1/-1;
  width: 100%;
  height: 12px;
  margin-top: 12px;
  accent-color: #8da739;
}
.review-status {
  border-block: 1px solid #a2b096;
  margin-top: 18px;
  padding: 12px 0;
  font-size: 11px;
  color: #4c6051;
}
.library[data-terra-faction="rhine-lab"],
dialog[data-terra-faction="rhine-lab"] {
  --terra-field: #edf1ef;
  --terra-ink: #2f4038;
  --terra-surface: #e2e9e4;
  --terra-rule: #9eafa4;
  --terra-signal: #aecb4a;
  --ak-focus-color: #5f7c13;
  background: var(--terra-field);
  color: var(--terra-ink);
}
[data-terra-faction="rhine-lab"] .eyebrow {
  color: #597324;
}
[data-terra-faction="rhine-lab"] button.ak-button {
  border: 2px solid #80947f;
  box-shadow: inset 3px 0 0 #d0deba;
  color: #34442d;
  background: #f5f7f1;
}
[data-terra-faction="rhine-lab"] button.ak-button:hover {
  background: #dce8bf;
  box-shadow: inset 6px 0 0 #acc447;
}
[data-terra-faction="rhine-lab"] .game-card {
  background: #f7f9f6;
  border-inline: 0;
  border-bottom: 1px solid #a5b3aa;
}
[data-terra-faction="rhine-lab"] .city-cell.inspected {
  outline: 2px solid #5e7c21;
  outline-offset: -6px;
  box-shadow: inset 6px 0 #aecb4a;
}
[data-terra-faction="rhine-lab"] .city-cell.dimmed {
  opacity: 0.4;
}
[data-terra-faction="rhine-lab"] .library-tabs button[aria-selected="true"] {
  border-color: #7b9b25;
  color: #394e2a;
}
[data-terra-faction="rhine-lab"] .detail-cost {
  background: #e1e8df;
  border-left: 4px solid #a7c240;
}
[data-terra-faction="rhine-lab"] .city-cell:active {
  transform: scale(0.98);
}
[data-ak-ui] .action-button:hover {
  border-color: #087e91;
  box-shadow: inset 4px 0 #087e91;
}
[data-ak-ui] .choice:active {
  transform: translateX(3px);
}
[data-ak-ui] .map-svg [role="button"]:focus-visible {
  outline: none;
}
[data-ak-ui] .map-svg .node:focus-visible rect.main {
  stroke: #087e91;
  stroke-width: 5;
}
[data-ak-ui] .map-svg .route-select:focus-visible > rect:nth-of-type(2) {
  stroke: #087e91;
  stroke-width: 4;
}
@media (prefers-reduced-motion: no-preference) {
  .intro,
  .lobby {
    animation: command-arrival 0.5s cubic-bezier(0.2, 0, 0, 1);
  }
  .command-panel .prompt {
    animation: command-wipe 0.3s ease-out;
  }
  .specimen-stage,
  .review-dock {
    animation: diagnostic-aperture 0.42s ease-in-out;
  }
  .review-dock {
    animation-delay: 60ms;
    animation-fill-mode: both;
  }
  .sample-state meter {
    transition: all 0.24s ease-in-out;
  }
  .ak-button,
  .choice,
  .city-cell,
  .action-button {
    transition:
      background 0.16s ease-out,
      box-shadow 0.16s ease-out,
      transform 0.16s ease-out;
  }
  .map-svg .node.legal rect.main {
    stroke-dasharray: 7 3;
    animation: target-attention 2s ease-in-out infinite;
  }
  .map-svg .node.selected rect.main {
    stroke-dasharray: none;
    animation: none;
  }
}
@keyframes command-arrival {
  from {
    clip-path: inset(0 12% 0 0);
    translate: -10px 0;
  }
  to {
    clip-path: inset(0);
    translate: 0 0;
  }
}
@keyframes command-wipe {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0);
  }
}
@keyframes diagnostic-aperture {
  from {
    clip-path: inset(3% 0 3% 0);
    translate: 0 6px;
  }
  to {
    clip-path: inset(0);
    translate: 0 0;
  }
}
@keyframes target-attention {
  50% {
    stroke-width: 4;
    fill: #fff2b3;
  }
}
@media (max-width: 760px) {
  .city-bench {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .specimen-stage {
    padding: 12px;
  }
  .review-dock {
    padding-left: 14px;
  }
  .sample-tray {
    gap: 10px;
    flex-wrap: wrap;
  }
  .sample-tray .inline-check {
    font-size: 12px;
  }
  .sample-state {
    margin-bottom: 14px;
  }
  .choice-list {
    max-height: 340px;
  }
  .review-dock h3 {
    margin: 8px 0;
  }
  .specimen-lintel {
    font-size: 10px;
  }
  .library[data-terra-faction="rhine-lab"] .city-cell {
    min-height: 108px;
  }
}
@media (min-width: 761px) {
  html,
  body[data-ak-ui] {
    height: 100%;
    overflow: hidden;
  }
  .topbar {
    height: 70px;
    min-height: 70px;
    padding-block: 10px;
  }
  .workspace {
    height: calc(100dvh - 70px);
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: minmax(0, 1fr) 54px;
    position: relative;
    overflow: hidden;
  }
  .playfield {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 16px 22px 0;
    position: relative;
    grid-row: 1;
    grid-column: 1;
  }
  .phasebar {
    padding-bottom: 10px;
    flex-shrink: 0;
  }
  .phase-title {
    font-size: 21px;
  }
  .phase-title span {
    font-size: 12px;
  }
  .round {
    font-size: 26px;
  }
  .map-toolbar {
    margin: 5px 0;
    flex-shrink: 0;
    min-height: 38px;
  }
  .map-toolbar button {
    min-height: 38px;
  }
  .map-viewport {
    flex: 1;
    min-height: 0;
    max-height: none;
    height: auto;
    overflow: auto;
  }
  .map-viewport #map-scale {
    min-width: 0;
    min-height: 0;
  }
  .map-viewport .map-svg {
    min-width: 0;
    width: 100%;
    height: 100%;
    display: block;
  }
  .map-legend {
    font-size: 10px;
    gap: 10px;
    padding: 7px 0;
    flex-shrink: 0;
  }
  .command-panel {
    grid-column: 2;
    grid-row: 1/-1;
    overflow: auto;
    padding: 18px 22px;
    min-height: 0;
  }
  .self-summary {
    margin: 12px 0;
  }
  .resource-strip {
    padding: 10px 0;
  }
  .resource strong {
    font-size: 20px;
  }
  .resource svg {
    height: 18px;
  }
  .section-heading {
    margin: 18px 0 10px;
  }
  .command-panel .choice-list {
    max-height: none;
    overflow: visible;
  }
  .library {
    grid-column: 1;
    grid-row: 2;
    padding: 0 22px;
    background: #e9e8e2;
    z-index: 5;
    min-width: 0;
    position: relative;
    border-top: 1px solid #9fab9f;
  }
  .library-tabs {
    margin: 0;
    gap: 30px;
    height: 54px;
    border: 0;
    align-items: stretch;
  }
  .library-tabs button {
    font-size: 13px;
    padding: 8px 2px;
    min-height: 44px;
  }
  .library-content {
    display: none;
    position: absolute;
    bottom: 54px;
    left: 0;
    right: 0;
    max-height: min(55vh, 420px);
    overflow: auto;
    background: #e9e8e2;
    border-top: 2px solid #303e35;
    padding: 20px 22px;
    box-shadow: 0 -16px 40px #1b2b2025;
  }
  .workspace[data-library-open="true"] .library-content {
    display: block;
  }
  .library[data-terra-faction="rhine-lab"] .library-content {
    background: #edf1ef;
  }
  .playfield > .help-bar {
    display: none;
  }
  .playfield > .selected-info {
    position: absolute;
    left: 35px;
    bottom: 50px;
    max-width: 390px;
    background: #f7fbf4eb;
    box-shadow: 0 5px 20px #1b2b2020;
    padding: 10px 14px;
    font-size: 12px;
    pointer-events: none;
  }
  .landing,
  .lobby {
    overflow: auto;
    max-height: calc(100dvh - 70px);
  }
  .landing .map-svg {
    min-width: 0;
  }
  .preview .map-svg {
    min-width: 0;
  }
  .city-bench {
    grid-template-columns: minmax(0, 1fr) 220px;
  }
  .specimen-stage {
    padding: 12px;
  }
  .city-cell {
    min-height: 85px;
  }
  .review-dock {
    padding-left: 14px;
  }
  .review-dock h3 {
    font-size: 16px;
  }
  .review-dock p {
    font-size: 12px;
  }
  .sample-tray {
    gap: 10px;
    flex-wrap: wrap;
  }
}
@media (min-width: 761px) and (max-height: 760px) {
  .playfield {
    padding-top: 10px;
  }
  .phase-title {
    font-size: 19px;
  }
  .phasebar .eyebrow {
    font-size: 10px;
  }
  .phasebar {
    padding-bottom: 5px;
  }
  .round {
    font-size: 24px;
  }
  .map-legend {
    padding: 4px 0;
  }
  .topbar {
    height: 64px;
    min-height: 64px;
  }
  .workspace {
    height: calc(100dvh - 64px);
  }
  .self-summary {
    margin: 8px 0;
  }
  .command-panel {
    padding-top: 14px;
  }
  .choice {
    padding: 9px 12px;
  }
  .command-panel h3 {
    font-size: 19px;
  }
}
@media (max-width: 760px) {
  .map-viewport {
    height: 490px;
    max-height: 58vh;
    min-height: 400px;
  }
  .map-viewport #map-scale {
    height: 100%;
  }
  .map-viewport .map-svg {
    width: 900px;
    min-width: 900px;
    height: 100%;
    object-fit: contain;
  }
  .library-content {
    display: block;
  }
  .preview .map-svg {
    min-width: 450px;
    height: auto;
  }
}
[data-ak-ui] button.ak-button {
  min-width: 0;
}
.other-player {
  border: 0;
  border-bottom: 1px solid #d3dbd4;
  background: transparent;
  width: 100%;
  text-align: left;
  min-height: 48px;
  color: #2b3b31;
}
.other-player:hover {
  background: #e6eee4;
}
.public-heading {
  margin-top: 22px !important;
  margin-bottom: 12px !important;
}
.public-score {
  font-size: 13px;
  color: #566b5b;
  margin-bottom: 12px;
}
.public-city {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.public-city button {
  border: 1px solid #aab9ac;
  border-top: 4px solid var(--card-color);
  background: #edf2e9;
  text-align: left;
  padding: 10px;
  min-height: 92px;
  color: #2b3b31;
}
.public-city small {
  font-size: 10px;
  display: block;
}
.public-city b {
  font-size: 12px;
  display: block;
  margin: 5px 0;
}
.shape-labels {
  font-size: 13px;
  color: #58694f;
}
.result-board .button-row {
  margin-top: 16px;
}
.phase-title span {
  display: block;
  margin-left: 0;
  white-space: normal;
}
.phasebar > div:first-child {
  min-width: 0;
}
.phase-title {
  overflow-wrap: anywhere;
}
.round {
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .topbar {
    gap: 8px;
    min-width: 0;
    padding-inline: 12px;
  }
  .brand {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }
  .brand b {
    font-size: 14px;
    white-space: nowrap;
  }
  .brand b span {
    display: none;
  }
  .brand small {
    font-size: 7px;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  .brand-mark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
  }
  .top-meta {
    flex: 0 0 auto;
    gap: 5px;
    max-width: 195px;
  }
  .top-meta button.ak-button {
    min-width: 44px;
    padding: 5px 8px;
    font-size: 11px;
    letter-spacing: 0;
  }
  .top-meta > .eyebrow {
    font-size: 9px;
    letter-spacing: 0;
    max-width: 110px;
  }
  .map-viewport {
    height: 290px;
    min-height: 260px;
    max-height: none;
  }
  .map-viewport #map-scale {
    height: auto;
    min-height: 100%;
  }
  .map-viewport .map-svg {
    width: 100%;
    min-width: 0;
    height: 100%;
  }
  .map-viewport[data-zoomed="false"] .node-id {
    font-size: 32px;
  }
  .map-viewport[data-zoomed="false"] .event-label {
    display: none;
  }
  .map-viewport[data-zoomed="false"] .route-label {
    font-size: 24px;
  }
  .map-viewport[data-zoomed="true"] .node-id {
    font-size: 23px;
  }
  .map-viewport[data-zoomed="true"] .event-label {
    font-size: 18px;
  }
  .map-viewport[data-zoomed="true"] .route-label {
    font-size: 18px;
  }
  .map-toolbar {
    min-width: 0;
    font-size: 11px;
  }
  .map-toolbar > span {
    min-width: 0;
    max-width: 62%;
  }
  .map-toolbar > div {
    display: flex;
    flex-shrink: 0;
  }
  .map-toolbar button {
    padding: 0 9px;
    font-size: 15px;
  }
  .phase-title {
    font-size: 19px;
  }
  .phase-title span {
    font-size: 11px;
  }
  .round {
    font-size: 22px;
  }
  .playfield > .selected-info {
    font-size: 12px;
  }
  .entry .join-row input {
    width: 0;
    flex: 1;
  }
  .public-city button {
    min-height: 85px;
  }
  .public-city b {
    font-size: 11px;
  }
  .sample-tray {
    flex-wrap: wrap;
  }
  .caliper button {
    min-width: 44px;
  }
}
@media (max-width: 760px) {
  .brand small {
    display: none;
  }
  .mobile-tabs {
    gap: 27px;
    justify-content: space-between;
  }
  .mobile-tabs button {
    padding-inline: 2px;
    flex-shrink: 0;
  }
  .workspace[data-mobile-tab="commands"] .playfield,
  .workspace[data-mobile-tab="commands"] .library {
    display: none;
  }
  .workspace[data-mobile-tab="commands"] .command-panel {
    order: 0;
    min-height: calc(100dvh - 115px);
    border-top: 0;
  }
}
