:root {
  color-scheme: light;
  --paper: #f7f3e8; --white: #fffcf4; --ink: #1c3634; --muted: #495e55;
  --rule: #bcbba6; --red: #a3442d; --gold: #dfb556; --sea: #244d4f;
  --book: 'Baskervville', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Instrument Sans', 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}
* { box-sizing: border-box }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.48 var(--sans) }
button,input { font: inherit; color: inherit }
button { cursor: pointer }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #236c82; outline-offset: 4px }
[hidden] { display: none !important }
.wrap { width: min(1120px, calc(100% - 72px)); margin-inline: auto }
.skip { position: absolute; left: 12px; top: -65px; z-index: 3; background: var(--white); color: var(--ink); padding: 10px }
.skip:focus { top: 8px }
.masthead { border-top: 5px solid var(--ink); border-bottom: 1px solid var(--rule) }
.mast-row { display: flex; min-height: 59px; align-items: center; justify-content: space-between; gap: 1rem }
.imprint { display: inline-flex; align-items: center; gap: 12px; font: 700 .87rem var(--mono); letter-spacing: .14em; text-transform: uppercase }
.envelope { width: 30px; height: 20px; border: 2px solid var(--ink); position: relative; overflow: hidden; transform: rotate(-6deg) }
.envelope::after { content: ''; position: absolute; width: 18px; height: 18px; border: 1.6px solid var(--ink); transform: rotate(45deg); top: -12px; left: 3px }
.guide-button,.text-button { background: none; border: 0; padding: 9px 0; color: var(--ink); font-size: .90rem; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #879186 }
.guide-button:hover,.text-button:hover { color: var(--red); text-decoration-color: currentColor }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 35px 0 30px }
h1,h2,p { margin: 0 }
h1 { font: 600 clamp(2.7rem, 6.4vw, 5.25rem)/1.04 var(--book); letter-spacing: -.059em; color:#173634 }
.title-row p { max-width: 72ch; margin: 10px 0 0; color: var(--muted); font: 1.12rem/1.4 var(--book) }
#stamp { width: clamp(110px, 15vw, 180px); height: auto; flex: 0 0 auto }
.tabletop { display: grid; align-items: start; grid-template-columns: minmax(0,1.38fr) minmax(0,1fr); gap: clamp(22px,3.2vw,42px) }
.map-panel { border: 1px solid #819387; background: #edf0e1; box-shadow: 3px 4px 0 #d9d9c8 }
.map-top { background: #203f40; padding: 11px 16px; color: #f7efd4; display: flex; align-items: center; gap: 10px; justify-content: space-between }
.map-top h2,.route-line,.speaker { font: 700 .79rem/1.4 var(--mono); letter-spacing: .10em; text-transform: uppercase }
#gate-state { font: .81rem/1.35 var(--mono); color: #eed9aa }
#chart { display: block; width: 100%; height: auto; aspect-ratio: 640/343; background: var(--sea) }
.party { border-top: 1px solid #617e70; padding: 13px 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.party>span { display: grid; grid-template-columns: 13px 1fr; align-items: center; column-gap: 7px; line-height: 1.2; font-size: .88rem }
.party>span>span { grid-column: 2; margin-top: 3px; color: var(--muted) }
.token { display:inline-block; background:#edcb66; width: 11px; height: 11px; border: 1.5px solid #213e3a; border-radius:100% }
.token.keeper { background:#eb9861; border-radius:0; transform: rotate(45deg); width:9px; height:9px; margin-left:1px }
.dispatch { min-width: 0; padding-top: 1px }
.route-line { display:flex; align-items:center; gap: 9px; color: var(--red) }
.route-ticks { display:flex; gap:3px }
.route-ticks i { width:19px; height:3px; background:#bdbca8 }
.route-ticks i:first-child, .second .route-ticks i { background:var(--red) }
.dispatch h2 { margin: 6px 0 8px; font: 600 clamp(2.1rem,3.8vw,3rem)/1.07 var(--book); letter-spacing:-.045em }
#setting { color:var(--muted); font-size:1rem; line-height:1.48 }
.feedback { margin: 18px 0 16px; border-left:3px solid var(--red); background:#efe9d8; padding:10px 13px 12px; min-height: 83px }
.speaker { color:#88402d; font-size:.73rem }
.feedback p { margin: 3px 0 0; font: 1.05rem/1.42 var(--book) }
#orders label { display:block; margin-bottom:5px; font-size:.92rem; font-weight:700 }
.command-line { display:flex; border:1.5px solid var(--ink); background:var(--white); min-height:46px }
.command-line:focus-within { box-shadow:0 0 0 2px #deaa52 }
.command-line input { width:100%; min-width:0; border:0; border-radius:0; background:transparent; padding:9px 11px; font:1rem/1.3 var(--mono) }
.command-line input:focus-visible { outline:0 }
.command-line input::placeholder { color:#6b776d }
.command-line button,.solid { background:var(--ink); color:#fff9e5; border:0; border-radius:0; font-size:.94rem; font-weight:700; padding:10px 19px; min-height:44px }
.command-line button:hover,.solid:hover { background:#335a51 }
.suggestions { display:flex; flex-wrap:wrap; gap:6px; margin-top:7px }
.suggestions button { min-height:36px; padding:5px 8px; background:transparent; border:1px solid #aaaE99; border-radius:3px; font-size:.84rem; font-weight:580 }
.suggestions button:hover { border-color:var(--ink); background:#f0e9d5 }
.receipt { font: .85rem/1.5 var(--mono); margin:8px 0 11px; color:var(--muted) }
.journal { border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); margin-top:29px }
.journal summary { display:flex; align-items:center; gap:12px; padding:14px 2px; cursor:pointer; list-style:none }
.journal summary::-webkit-details-marker { display:none }
.journal summary::before { content:'+'; width:17px; color:var(--red); font:1.15rem/1 var(--mono) }
.journal[open] summary::before { content:'−' }
.journal summary span:first-child { font:600 1.24rem/1.2 var(--book) }
#log-count { margin-left:auto; color:var(--muted); font:.78rem/1.3 var(--mono) }
.journal ol { padding:0 12px 10px 32px; margin:0; list-style:none; max-height:18rem; overflow:auto }
.journal li { border-top:1px dotted var(--rule); padding:8px 0; font-size:.92rem }
.journal li b { display:block; color:var(--ink); font:600 .86rem/1.4 var(--mono) }
.save-note { color:var(--muted); margin:10px 0 22px; font:.79rem/1.4 var(--mono) }
dialog { width:min(460px,calc(100% - 30px)); max-height:85dvh; overflow:auto; background:var(--paper); color:var(--ink); border:2px solid var(--ink); padding:20px 23px }
dialog::backdrop { background:#19363199 }
.modal-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px }
.modal-title h2 { font:600 1.9rem var(--book); letter-spacing:-.04em }
dialog p,dialog dd { font-size:.95rem }
dialog dt { font-weight:700; margin-top:13px }
dialog dd { margin:3px 0 0; color:var(--muted) }
kbd { font:inherit; font-family:var(--mono); font-size:.89em; color:#783c2c }
.reset-row,#confirm-reset { border-top:1px solid var(--rule); padding-top:7px; margin-top:14px }
#confirm-reset p { margin:3px 0 9px }
@media (max-width: 820px) {
  .wrap { width:min(700px,calc(100% - 38px)) }
  .tabletop { grid-template-columns:minmax(0,1fr) }
  .dispatch { grid-row:1 }
  .title-row { padding:22px 0 20px }
  #stamp { width:105px }
  .dispatch h2 { font-size:2.25rem }
  .feedback { min-height:0; margin:12px 0 }
  .suggestions button,.guide-button,.text-button { min-height:44px }
  .tabletop { gap:20px }
}
@media (max-width: 510px) {
  .wrap { width:calc(100% - 30px) }
  .mast-row { min-height:50px }
  .imprint { gap:8px; font-size:.77rem }
  .envelope { width:25px; height:17px }
  .title-row { display:block; padding:20px 0 18px }
  h1 { font-size:clamp(2.65rem,10.4vw,3.4rem) }
  #stamp { display:none }
  .title-row p { margin-top:7px; font-size:1rem }
  .dispatch h2 { font-size:2.03rem }
  .suggestions { gap:5px }
  .suggestions button { padding:4px 7px }
  .party { padding:10px 12px }
  .journal { margin-top:23px }
}
@media (forced-colors:active) {
  .token,.route-ticks i,.feedback { border:1px solid CanvasText }
}
