@font-face {
  font-family: Oficina;
  src: url(/assets/oficina-pixel.woff2) format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #10121b;
  --panel: #191c28;
  --raised: #222635;
  --border: #343849;
  --text: #f7f3ec;
  --muted: #b6b8c8;
  --gold: #f7c875;
  --mint: #a8d7c4;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --pixel: Oficina, var(--mono);
  --shadow: 0 8px 24px #06081233;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 17% -25%, #28263a 0%, transparent 53rem), var(--page);
  font: 1rem/1.48 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button { border: 0; background: none; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .4; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
i[data-icon] { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; font-style: normal; }
i svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.skip-link { position: fixed; z-index: 20; left: 1rem; top: .5rem; transform: translateY(-200%); padding: .6rem 1rem; background: var(--gold); color: #1c1820; }
.skip-link:focus { transform: none; }
.frame { width: min(calc(100% - clamp(32px, 6.1vw, 102px)), 1780px); margin-inline: auto; }

.topbar { border-bottom: 1px solid #2d303d; background: #141620; }
.bar-inner { min-height: 58px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px clamp(12px, 2vw, 28px); padding-block: 3px; }
.identity, .head-actions, .chrome, .local-time, .section-title, .panel-title, .views, .views button, .action-group, .action-group button,
.hint, .camera-controls, .rotation, .zoom, .overlay-button, .edit-tools, .edit-tools button, .primary, .secondary, .card-action,
.spark-intro, .back, .save-box, .placement, .placement label, summary { display: flex; align-items: center; }
.identity { gap: 9px; white-space: nowrap; }
.brand-star {
  width: 24px; height: 28px; background: var(--gold);
  clip-path: polygon(43% 0,57% 0,57% 17%,65% 17%,65% 29%,73% 29%,73% 38%,85% 38%,85% 44%,100% 44%,100% 56%,85% 56%,85% 62%,73% 62%,73% 71%,65% 71%,65% 83%,57% 83%,57% 100%,43% 100%,43% 83%,35% 83%,35% 71%,27% 71%,27% 62%,15% 62%,15% 56%,0 56%,0 44%,15% 44%,15% 38%,27% 38%,27% 29%,35% 29%,35% 17%,43% 17%);
}
.wordmark { font: 730 1.52rem/1 system-ui, sans-serif; letter-spacing: -.085em; color: #f7f4ee; }
.wordmark b, .wordmark small { color: var(--gold); }
.wordmark b { font-weight: 630; }
.wordmark small { font-size: .8em; }
.head-actions { gap: 3px; margin-inline-start: auto; }
.local-time { margin-right: 13px; padding-right: 16px; border-right: 1px solid var(--border); gap: 7px; color: var(--muted); }
.local-time i { width: 14px; height: 14px; }
#clock { font: .78rem/1.35 var(--mono); font-variant-numeric: tabular-nums; }
.chrome, .action-group button { justify-content: center; min-height: 44px; gap: 7px; border-radius: 7px; padding: 0 10px; color: #d1d2de; font-size: .875rem; font-weight: 570; }
.chrome i { width: 17px; height: 17px; }
.chrome:hover, .action-group button:hover:not(:disabled) { color: var(--text); background: #292c3b; }
.chrome[aria-pressed=true], .action-group button[aria-pressed=true] { color: var(--gold); }

.views { flex: none; padding: 3px; border: 1px solid #3c3e4c; border-radius: 10px; background: #191c27; gap: 3px; }
.views button { justify-content: center; gap: 7px; min-height: 44px; padding: 6px 17px; color: #c3c6d4; border-radius: 7px; font-weight: 650; font-size: .91rem; white-space: nowrap; }
.views button[aria-pressed=true] { color: #271e15; background: var(--gold); box-shadow: inset 0 1px #ffe0a1; }
.views button:hover:not([aria-pressed=true]):not(:disabled) { background: #2c2e40; color: #fff8eb; }
.views i { width: 17px; height: 17px; }

main.frame { padding-top: clamp(10px, 1.6vw, 22px); }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) clamp(270px, 23vw, 360px); align-items: start; gap: clamp(14px, 1.5vw, 23px); padding-bottom: clamp(22px, 3vw, 48px); }
.map-panel, .panel, .spark-card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); min-width: 0; }
.map-panel { position: sticky; top: 10px; overflow: hidden; }
.map-head, .map-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.map-head { min-height: 53px; padding: 3px 13px 3px 17px; border-bottom: 1px solid #373a4d; background: #1c1f2c; }
.section-title { min-width: 0; gap: 9px; }
.section-title i { color: var(--gold); }
.section-title :is(h1, h2) { font-size: 1rem; font-weight: 660; line-height: 1.25; letter-spacing: -.015em; }
.action-group { gap: 3px; flex: none; }
.action-group button { min-width: 44px; }
.action-group i { width: 15px; height: 15px; }
.viewport { position: relative; isolation: isolate; width: 100%; height: clamp(345px, min(67vw, calc(100svh - 198px)), 790px); background: #111326; overflow: hidden; }
.viewport > canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewport > canvas:focus-visible { outline-offset: -3px; }
.viewport #iso { cursor: grab; }
.viewport #iso:active { cursor: grabbing; }
.editing .viewport { height: clamp(316px, calc(100svh - 264px), 745px); }
.editing .map-panel:has(#placement:not([hidden])) .viewport { height: clamp(295px, calc(100svh - 321px), 690px); }
.overlay-button { position: absolute; top: 12px; left: 12px; min-height: 44px; padding: 0 13px; gap: 7px; color: #fff2d6; font-size: .875rem; border: 1px solid #706344; border-radius: 7px; background: #20202ff0; }
.overlay-button:hover { background: #302d3a; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; color: var(--muted); background: #141627; font: .9rem var(--mono); }
.map-foot { min-height: 59px; padding: 5px 12px 5px 17px; border-top: 1px solid #34374b; background: #1a1d2a; }
.hint { color: var(--muted); gap: 7px; font-size: .84rem; line-height: 1.35; min-width: 0; }
.hint i { color: #bfa674; width: 15px; height: 15px; }
.camera-controls { gap: 10px; flex: none; }
.rotation, .zoom { flex: none; }
.rotation { padding-right: 9px; border-right: 1px solid var(--border); }
.rotation-label { margin-right: 3px; color: var(--muted); font-size: .82rem; }
.rotation button, .zoom button { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 6px; padding: 0; }
.rotation button { color: var(--gold); }
.rotation i { width: 17px; height: 17px; }
#rotate-right i { transform: scaleX(-1); }
.rotation select, .zoom #fit { font: .84rem/1 var(--mono); color: #e4e2de; font-variant-numeric: tabular-nums; }
.rotation select { width: 4.25rem; min-height: 44px; padding: 0 18px 0 5px; text-align: center; color-scheme: dark; cursor: pointer; background-position: right 5px center; }
.rotation-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.zoom { background: #242837; border-radius: 7px; border: 1px solid #3a3e50; }
.zoom i { width: 16px; height: 16px; }
.zoom button { min-height: 42px; min-width: 43px; }
.zoom #fit { min-width: 51px; }
.rotation button:hover:not(:disabled), .zoom button:hover:not(:disabled) { background: #323748; }

.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel, .spark-card { padding: 15px; }
.panel-title { justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.count { font: .81rem var(--mono); color: #bec0cf; }
.count:empty { display: none; }
#stations { min-width: 0; }
.station { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; width: 100%; min-height: 52px; padding: 5px 4px; border: 1px solid transparent; border-radius: 7px; text-align: left; }
.station:hover, .station:focus-visible { background: #242837; border-color: #383e50; }
.tile { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--tint,#e5bd72) 25%, #242737); border-radius: 7px; background: color-mix(in srgb, var(--tint,#e5bd72) 16%, #1e2330); }
.tile img, .tile canvas { width: 35px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.station strong, .station small { display: block; overflow-wrap: anywhere; }
.station strong { font-size: .955rem; font-weight: 640; line-height: 1.23; }
.station small { font-size: .8rem; margin-top: 1px; color: var(--muted); line-height: 1.3; }
kbd { padding: 2px 5px; border: 1px solid #414452; border-bottom-width: 2px; border-radius: 4px; color: #b6b8c4; background: #202330; font: .74rem/1.15 var(--mono); }
.back, .secondary, .card-action { justify-content: center; min-height: 44px; padding: 7px 12px; gap: 7px; border: 1px solid #424759; border-radius: 7px; background: #242838; color: #ecebf1; font-size: .88rem; font-weight: 590; }
.back:hover, .secondary:hover, .card-action:hover { background: #303447; border-color: #626779; }
.back { margin: 5px 0 12px; }
.selected-name { overflow-wrap: anywhere; font: 400 1.35rem/1.22 var(--pixel); }
.room-details { margin: 9px 0 14px; font-size: .9rem; color: #d1d2df; }
.secondary { width: 100%; }
#crew-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
#crew-list > .note { grid-column: 1 / -1; }
#crew-list button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; min-height: 44px; min-width: 0; border-radius: 7px; padding: 5px 2px; text-align: center; color: #d9d9e4; font-size: .795rem; line-height: 1.25; overflow-wrap: anywhere; }
#crew-list button:hover, #crew-list button[aria-pressed=true] { color: #fff4da; background: #2b2d3b; }
.crew-portrait, .selection-portrait { display: block; object-fit: contain; image-rendering: pixelated; border-radius: 8px; background: #252a3d; }
.crew-portrait { width: 36px; height: 36px; }
#crew-list button[aria-pressed=true] img { outline: 1px solid var(--gold); }
.spark-card { position: relative; background: linear-gradient(115deg, #322b25 0, #24232a 70%); border-color: #564638; }
.spark-intro { gap: 10px; }
.spark-intro img { width: 39px; height: 39px; object-fit: contain; image-rendering: pixelated; }
.spark-intro h2 { color: var(--gold); font: 400 1.4rem/1.2 var(--pixel); }
.spark-intro span { display: block; color: #d5c6b1; font-size: .81rem; }
.spark-card p { margin: 10px 0 13px; color: #e4dbcb; font-size: .89rem; line-height: 1.4; }
.primary { width: 100%; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 7px; color: #2c2318; border: 1px solid #f6cf8d; background: var(--gold); font-size: .9rem; font-weight: 680; }
.primary:hover:not(:disabled) { background: #ffdb93; }
.primary i { width: 14px; height: 14px; }

.person-card { position: absolute; left: 13px; bottom: 13px; width: 31rem; max-width: calc(100% - 26px); display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 8px; border: 1px solid #7b6a53; border-radius: 9px; background: #1c1d2af5; box-shadow: 0 3px 14px #09091366; }
.selection-portrait { flex: none; width: 42px; height: 42px; }
.selection-info { flex: 1; min-width: 0; }
#iso.dragging { cursor: grabbing; }
.person-card strong, .person-card span { display: block; overflow-wrap: anywhere; }
.person-card strong { font-size: .94rem; line-height: 1.2; }
.person-card span { margin-top: 2px; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.card-action { flex: none; font-size: .82rem; padding: 5px 9px; }
.card-action i { width: 15px; height: 15px; }
#use-furniture { background: #eed09e; color: #302536; border-color: #e1bb84; }
@media (min-width: 581px) {
  .person-card:has(#use-furniture:not([hidden])) { width: 38rem; }
}
@media (max-width: 580px) {
  .person-card:has(#use-furniture:not([hidden])) { display: grid; grid-template-columns: auto minmax(0,1fr) auto; width: calc(100% - 26px); max-width: 34rem; right: auto; }
  .person-card:has(#use-furniture:not([hidden])) .dismiss { grid-column: 3; grid-row: 1; }
  .person-card:has(#use-furniture:not([hidden])) #use-furniture { grid-column: 1 / 3; grid-row: 2; }
  .person-card:has(#use-furniture:not([hidden])) #edit-person { grid-column: 3; grid-row: 2; }
}
.dismiss { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0; border-radius: 6px; color: var(--muted); }
.dismiss:hover { background: var(--raised); color: var(--text); }
.dismiss i { width: 16px; height: 16px; }

.edit-tools, .placement { flex-wrap: wrap; border-bottom: 1px solid var(--border); background: #202331; padding: 5px 10px; gap: 5px; }
.edit-tools button { justify-content: center; gap: 7px; min-height: 44px; border: 1px solid transparent; border-radius: 6px; padding: 5px 12px; font-size: .89rem; font-weight: 570; color: #d2d3e0; }
.edit-tools button[aria-pressed=true] { color: #ffe0a3; border-color: #695a42; background: #39322b; }
.edit-tools button:hover:not([aria-pressed=true]) { background: #2b2f41; }
.edit-tools i { width: 16px; height: 16px; }
.placement { gap: 9px; background: #1c202d; }
.placement label { gap: 7px; }
.placement label input, .placement label select { margin-top: 0; }
.placement input:not([type=color]), .placement select { width: min(165px, 100%); }
.placement input[type=color] { width: 44px; padding: 2px; }
.placement .inline-btn { min-height: 44px; padding-inline: 8px; color: var(--gold); font-size: .86rem; }
label { display: block; min-width: 0; color: #d8d9e4; font-size: .875rem; }
input, select { display: block; width: 100%; min-width: 0; min-height: 44px; background-color: #141722; border: 1px solid #41465c; border-radius: 6px; padding: 7px 10px; color: #f0edf2; font-size: .91rem; }
label input, label select { margin-top: 5px; }
select { appearance: none; padding-right: 31px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23c3bece' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.edit-panel > .section-title { margin-bottom: 15px; }
.edit-panel form, .expand-panel form { display: grid; gap: 10px; }
.note { font-size: .9rem; line-height: 1.45; color: var(--muted); }
.ins-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ins-section h3 { font-size: .95rem; margin-bottom: 7px; }
.ins-section > summary, .expand-panel summary { min-height: 44px; gap: 8px; font-size: .92rem; font-weight: 600; }
.ins-section > summary::after { content: "+"; margin-left: auto; color: var(--gold); }
.ins-section[open] > summary::after { content: "−"; }
.ins-section[open] > summary, .expand-panel [open] > summary { margin-bottom: 6px; }
.danger { display: block; min-height: 44px; margin-top: 6px; color: #ffaea9; padding: 4px 0; font-size: .86rem; }
.expand-panel { padding-block: 6px; }
.expand-panel summary i:first-child { color: var(--gold); }
.expand-panel summary i:last-child { margin-left: auto; width: 14px; }
.expand-panel [open] summary i:last-child { transform: rotate(180deg); }
.expand-panel form { margin: 2px 0 9px; }
.save-box { align-items: flex-start; gap: 8px; padding: 3px 5px; color: #c2c5ce; font-size: .84rem; }
.save-box i { margin-top: 2px; width: 17px; height: 17px; color: var(--mint); }
.save-box button { min-height: 44px; padding: 3px 8px 3px 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.toast { position: fixed; z-index: 10; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 11px 15px; border: 1px solid #947b51; border-radius: 8px; box-shadow: var(--shadow); color: #fff2d9; background: #292735; font-size: .9rem; pointer-events: none; }

@media (min-width: 1550px) {
  .panel, .spark-card { padding: 18px; }
  .expand-panel { padding-block: 8px; }
  .station { min-height: 57px; }
  .crew-portrait { width: 41px; height: 41px; }
  .map-head, .map-foot { padding-inline: 20px; }
}
@media (max-width: 1140px) {
  .frame { width: calc(100% - 32px); }
  .studio { grid-template-columns: minmax(0, 1fr) clamp(253px, 25vw, 280px); gap: 12px; }
  .panel, .spark-card { padding: 13px; }
  .expand-panel { padding-block: 5px; }
  .rotation-label { display: none; }
  .map-foot { padding-inline: 10px; }
  .hint { font-size: .81rem; }
}
@media (max-width: 960px) {
  .chrome { position: relative; min-width: 44px; padding: 0; }
  .chrome span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 820px) {
  .local-time { display: none; }
}
@media (max-width: 850px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .map-panel { position: relative; top: auto; }
  .side { gap: 10px; }
  #watch-side { display: grid; grid-template-columns: 1.15fr 1fr; align-items: start; }
  #watch-side .directory { grid-row: span 2; align-self: stretch; }
  .viewport, .editing .viewport, .editing .map-panel:has(#placement:not([hidden])) .viewport { height: clamp(290px, min(62vw, 64svh), 550px); }
  .rotation-label { display: inline; }
  #edit-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(215px, .65fr); align-items: start; }
  #edit-side .edit-panel { grid-row: span 2; }
}
@media (max-width: 600px) {
  .frame { width: calc(100% - 22px); }
  .bar-inner { min-height: 50px; gap: 2px 8px; }
  .wordmark { font-size: 1.35rem; }
  .brand-star { width: 22px; height: 25px; }
  .identity { gap: 7px; }
  .head-actions { gap: 1px; }
  .views button { padding-inline: 8px; }
  .studio { gap: 11px; }
  .map-head { min-height: 48px; padding: 1px 5px 1px 11px; gap: 4px; }
  .section-title { gap: 6px; }
  .section-title :is(h1, h2) { font-size: .94rem; }
  .section-title > i { width: 16px; height: 16px; }
  .action-group { gap: 1px; }
  .action-group button { gap: 5px; padding-inline: 7px; font-size: .82rem; }
  .viewport, .editing .viewport, .editing .map-panel:has(#placement:not([hidden])) .viewport { height: clamp(225px, min(76vw, 59svh), 385px); }
  .map-foot { flex-wrap: wrap; gap: 0; padding: 0 10px 4px; }
  .hint { width: 100%; min-height: 29px; padding-top: 2px; font-size: .8rem; }
  .hint i { width: 13px; height: 13px; }
  .camera-controls { justify-content: space-between; gap: 3px; width: 100%; }
  .rotation { border-right: 0; padding: 0; }
  .rotation-label { margin: 0 4px 0 1px; }
  .zoom { border-color: transparent; }
  .zoom button { min-width: 44px; min-height: 44px; }
  .map-foot:has(.rotation[hidden]) { flex-wrap: nowrap; gap: 5px; padding: 3px 7px 3px 10px; min-height: 52px; }
  .map-foot:has(.rotation[hidden]) .camera-controls { width: auto; }
  .map-foot:has(.rotation[hidden]) .hint { width: auto; min-height: auto; }
  .edit-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 3px; }
  .edit-tools button { gap: 4px; padding: 4px 2px; font-size: .835rem; }
  .edit-tools i { width: 15px; height: 15px; }
  #watch-side { grid-template-columns: 1fr; }
  #watch-side .directory { grid-row: auto; }
  #stations:has(.station) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 5px; }
  .station { grid-template-columns: 33px minmax(0, 1fr); gap: 6px; min-height: 51px; padding: 3px 1px; }
  .station .tile { width: 32px; height: 34px; }
  .station .tile img { width: 30px; height: 28px; }
  .station kbd { display: none; }
  .station strong { font-size: .875rem; }
  .station small { font-size: .76rem; line-height: 1.2; }
  #crew-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 85px), 1fr)); }
  #edit-side { display: flex; }
  .panel, .spark-card { padding: 12px; }
  .expand-panel { padding-block: 4px; }
  .panel-title { margin-bottom: 6px; }
  input, select { font-size: 1rem; }
  .person-card { right: 7px; left: 7px; bottom: 7px; width: auto; max-width: none; gap: 6px; padding: 4px; }
  .selection-portrait { width: 36px; height: 36px; }
  .person-card strong { font-size: .86rem; }
  .person-card span { font-size: .75rem; }
  .card-action { gap: 4px; padding: 5px 7px; font-size: .77rem; }
  .card-action i { display: none; }
}
@media (max-width: 490px) {
  .bar-inner { gap: 2px 5px; }
  .bar-inner .brand-star, .views i { display: none; }
  .bar-inner .wordmark { font-size: 1.22rem; }
  .views { padding: 2px; gap: 1px; }
  .views button { font-size: .875rem; padding-inline: 5px; }
}
@media (max-width: 440px) {
  .bar-inner { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 9px; }
  .bar-inner .brand-star { display: block; }
  .views { justify-self: start; }
  .head-actions { grid-column: 1 / -1; width: 100%; border-top: 1px solid var(--border); }
  .local-time { display: flex; margin-right: auto; padding-right: 0; border: 0; }
}
@media (max-width: 380px) {
  .bar-inner { width: calc(100% - 12px); column-gap: 5px; }
  .bar-inner .brand-star { display: none; }
  .bar-inner .wordmark { font-size: 1.05rem; }
  .rotation-label { display: none; }
  .camera-controls { flex-wrap: wrap; row-gap: 2px; }
  .rotation select { width: 3.85rem; }
}
@media (max-width: 365px) {
  .map-head .section-title i { display: none; }
  .map-head h1 { font-size: .875rem; }
  .edit-tools button { flex-direction: column; gap: 2px; font-size: .77rem; }
  .selection-portrait { width: 28px; height: 32px; }
}
@media (max-width: 319px) {
  .frame { width: calc(100% - 12px); }
  .map-head .action-group button span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .map-foot { padding-inline: 3px; }
  .person-card { flex-wrap: wrap; }
  .card-action { flex-basis: 100%; order: 1; }
  #stations:has(.station) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 540px) and (orientation: landscape) {
  .bar-inner { min-height: 44px; }
  .viewport, .editing .viewport, .editing .map-panel:has(#placement:not([hidden])) .viewport { height: clamp(220px, 64svh, 335px); }
}
@media (hover: none), (pointer: coarse) {
  .zoom button { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .station, .views button { transition: background-color .14s ease, border-color .14s ease, color .14s ease; }
}
body.focus-mode main.frame, :root:fullscreen main.frame { width: 100%; padding: 0; }
body.focus-mode .studio, :root:fullscreen .studio { padding: 0; }
body.focus-mode:not(.editing) .studio, :root:fullscreen body:not(.editing) .studio { display: block; }
body.focus-mode #watch-side, :root:fullscreen #watch-side { display: none; }
body.focus-mode .map-panel, :root:fullscreen .map-panel {
  top: 0; border-radius: 0; height: calc(100svh - var(--header-height, 59px)); min-height: 270px; display: flex; flex-direction: column;
}
body.focus-mode .map-panel > :not(.viewport), :root:fullscreen .map-panel > :not(.viewport) { flex: none; }
body.focus-mode .map-panel .viewport, :root:fullscreen .map-panel .viewport { flex: 1; min-height: 160px; height: auto; }
body.focus-mode.editing .side, :root:fullscreen .editing .side { padding: 10px; }
@media (max-width: 850px) {
  body.focus-mode.editing .map-panel, :root:fullscreen .editing .map-panel { height: auto; }
  body.focus-mode.editing .map-panel .viewport, :root:fullscreen .editing .map-panel .viewport { flex: none; height: clamp(220px, 58svh, 560px); }
}
