body[data-app="hamster-delivery"] {
  --paper: #eceee8;
  --surface: #fafbf7;
  --ink: #26393f;
  --muted: #4c6165;
  --line: #d0d9d4;
  --accent: #205d79;
  --wash: #e5eff2;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

.delivery-layout {
  grid-template-columns: minmax(0,1.62fr) minmax(0,1fr);
  grid-template-areas: "header header" "map manifest" "actions manifest";
  grid-template-rows: auto auto 1fr;
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #c2d0cb;
  border-radius: 14px;
}

.delivery-head {
  grid-area: header;
  background: #263e48;
  color: #f5f8f7;
  padding: 8px 14px;
}

.delivery-head strong { color: inherit; }
.delivery-head .departure { color: #dce7e9; font-size: .77rem; }
.delivery-head .map-title { gap: 10px; }
.delivery-head .map-title img { width: 37px; height: 28px; }

.map-area { grid-area: map; border: 0; border-radius: 0; }
.map-area .map-key { justify-content: flex-start; gap: 13px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.map-area .map-key .congestion::before { background: #c68b50; }
.map-area .map-key .your-path::before { background: var(--accent); }
.map-area[data-route="suggested"] .map-key .your-path::before { background: #39745d; }

.delivery-map .map-stop {
  --pin: #f8fbfb;
  --pin-ink: #204e61;
  --pin-edge: #517b8a;
  width: 49px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #293d43;
  background: transparent;
  transform: translate(-50%, -48%);
  transition: none;
}

.delivery-map .map-stop .pin-face {
  display: grid;
  place-items: center;
  min-width: 27px;
  padding: 1px 3px;
  height: 26px;
  border: 1px solid var(--pin-edge);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--pin);
  color: var(--pin-ink);
  font-size: .74rem;
  font-weight: 790;
}

.delivery-map .map-stop small {
  display: block;
  padding: 1px 3px;
  background: #f8faf2;
  border-radius: 2px;
  color: #263d45;
  font: 750 .65rem/1.23 system-ui,sans-serif;
  white-space: nowrap;
}

.delivery-map .map-stop[aria-pressed="true"] {
  --pin: #205d79;
  --pin-ink: #fff;
  --pin-edge: #15475f;
  background: transparent;
}

.map-area[data-route="suggested"] .delivery-map .map-stop[aria-pressed="true"] {
  --pin: #39745d;
  --pin-edge: #28503f;
  background: transparent;
}

.delivery-map .map-stop[data-late] {
  --pin: #973e32;
  --pin-edge: #783126;
  --pin-ink: #fff;
  background: transparent;
}

.delivery-map .map-stop.depot {
  width: auto;
  min-height: 0;
  padding: 5px 7px;
  border: 1px solid #273d44;
  background: #314e57;
  color: #f9fcfa;
  white-space: nowrap;
  font-size: .69rem;
}

.delivery-map .map-stop:focus-visible { outline: 3px solid #26677f; outline-offset: 0; }
.delivery-map button.map-stop:not(:disabled):hover .pin-face { box-shadow: 0 0 0 2px #5f849c5c; }

.delivery-side {
  grid-area: manifest;
  align-self: stretch;
  padding: 14px 13px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.delivery-side .side-title {
  padding: 0 0 9px;
  border-bottom: 1px solid var(--line);
}

.delivery-side .stop-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; margin: 0; }
.delivery-side .stop-card {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 5px;
  min-height: 53px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.delivery-side .stop-card[aria-pressed="true"] { background: #eaf2f3; }
.delivery-side .stop-card:disabled { opacity: 1; }
.stop-card strong, .stop-card small { display: block; line-height: 1.4; }
.stop-card strong { font-size: .84rem; }
.stop-card small { font-size: .69rem; white-space: nowrap; }
.stop-badge {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #c5d8db;
  border-radius: 6px;
  background: #e4eff1;
  color: #235869;
  font-size: .69rem;
  font-weight: 790;
}

.stop-card[aria-pressed="true"] .stop-badge { color: #fff; background: var(--accent); border-color: var(--accent); }
.stop-card[data-late] .stop-badge { background: #973e32; border-color: #973e32; }
.stop-timing { text-align: right; font-variant-numeric: tabular-nums; }
.stop-card[data-late] .stop-timing { color: #8e392e; }

.delivery-actions { grid-area: actions; }
.delivery-actions .route-strip { border-top: 0; padding: 10px 13px; }
.delivery-actions .game-panel-footer { padding-bottom: 12px; }
.delivery-actions .game-actions .primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.delivery-actions .route-list li { padding: 4px 7px; }

@media (min-width: 731px) {
  body[data-app="hamster-delivery"] .street-wrap { max-width: 920px; }
  .street-wrap .intro { padding-block: 16px; }
  .street-wrap .intro h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
  .street-wrap .intro p { margin: 7px 0 0; }
}
@media (max-width: 730px) {
  .delivery-layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "header" "map" "manifest" "actions"; grid-template-rows: auto; }
  .delivery-side { border-left: 0; padding: 10px; border-bottom: 1px solid var(--line); }
  .delivery-side .stop-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 7px; }
  .delivery-side .stop-card { grid-template-columns: 24px minmax(0,1fr) auto; min-height: 50px; padding: 5px 1px; gap: 4px; }
  .stop-badge { width: 23px; height: 23px; font-size: .62rem; }
  .stop-card strong { font-size: .74rem; }
  .stop-card small { font-size: .61rem; }
  .delivery-side .aside-help { margin-top: 7px; }
}

@media (max-width: 355px) {
  .delivery-side .stop-card { grid-template-columns: minmax(0,1fr) auto; padding-inline: 4px; }
  .delivery-side .stop-badge { display: none; }
}

.courier {
  position: absolute;
  left: var(--x, 13.3%);
  top: var(--y, 15.7%);
  width: clamp(27px, 7%, 42px);
  pointer-events: none;
}

.courier img {
  display: block;
  width: 100%;
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--bearing, 0deg));
  filter: drop-shadow(0 2px 1px #2037384f);
}

.map-stop .pin-face,
.delivery-side .stop-card {
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .map-stop .pin-face, .delivery-side .stop-card { transition: none; }
}
