:root {
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #f4f7fa;
  --ink: #0d2f4f;
  --ink-2: #56697e;
  --ink-3: #8fa0b2;
  --line: #dae2ea;
  --brand: #014171;
  --brand-ink: #014171;
  --brand-soft: #e1edf6;
  --on-brand: #ffffff;
  --accent: #fadf4a;
  --accent-edge: #ebba38;
  --on-accent: #012f52;
  --good: #0c9a6a;
  --good-soft: #e1f6ec;
  --warn: #c77f00;
  --warn-soft: #fff2d2;
  --bad: #db3438;
  --bad-soft: #fde7e7;
  --shadow: 0 8px 24px rgba(22, 50, 79, 0.14);
  --map-land: #e8eef1;
  --map-block: #d9e2e7;
  --map-bld: #c2ced7;
  --map-park: #cde7d1;
  --map-tree: #a8d3b0;
  --map-road: #ffffff;
  --map-road-edge: #bac7d2;
  --map-road2: #f5f8fa;
  --map-hwy: #ffedbd;
  --map-hwy-edge: #dfbd72;
  --map-exp: #efe3d1;
  --map-case: #ffffff;
  --map-water: #b4d7f1;
  --map-water-edge: #9ac6e8;
  --map-ink: #16324f;
  --map-muted: #7b8ea2;
  --map-pin: #ffffff;
  --map-fog: rgba(226, 233, 238, 0.66);
  --map-fog0: rgba(226, 233, 238, 0);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1522;
    --surface: #10213a;
    --surface-2: #162b47;
    --ink: #e8f0f8;
    --ink-2: #a6b7c9;
    --ink-3: #6e8399;
    --line: #233a56;
    --brand: #00adef;
    --brand-ink: #7dd3f7;
    --brand-soft: #0a3554;
    --on-brand: #06162a;
    --accent: #fadf4a;
    --accent-edge: #ebba38;
    --on-accent: #012f52;
    --good: #34d399;
    --good-soft: #0e392d;
    --warn: #fbbf24;
    --warn-soft: #3d2e0a;
    --bad: #f87171;
    --bad-soft: #41191c;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --map-land: #0d1b2b;
    --map-block: #13263b;
    --map-bld: #1d354f;
    --map-park: #11352a;
    --map-tree: #1a4c39;
    --map-road: #2c4561;
    --map-road-edge: #081320;
    --map-road2: #1b2f45;
    --map-hwy: #41607f;
    --map-hwy-edge: #06101b;
    --map-exp: #2a3c52;
    --map-case: #0a1725;
    --map-water: #0a3157;
    --map-water-edge: #0c3d6c;
    --map-ink: #e8f0f8;
    --map-muted: #8296ab;
    --map-pin: #f3f7fb;
    --map-fog: rgba(6, 13, 22, 0.66);
    --map-fog0: rgba(6, 13, 22, 0);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1522;
  --surface: #10213a;
  --surface-2: #162b47;
  --ink: #e8f0f8;
  --ink-2: #a6b7c9;
  --ink-3: #6e8399;
  --line: #233a56;
  --brand: #00adef;
  --brand-ink: #7dd3f7;
  --brand-soft: #0a3554;
  --on-brand: #06162a;
  --accent: #fadf4a;
  --accent-edge: #ebba38;
  --on-accent: #012f52;
  --good: #34d399;
  --good-soft: #0e392d;
  --warn: #fbbf24;
  --warn-soft: #3d2e0a;
  --bad: #f87171;
  --bad-soft: #41191c;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --map-land: #0d1b2b;
  --map-block: #13263b;
  --map-bld: #1d354f;
  --map-park: #11352a;
  --map-tree: #1a4c39;
  --map-road: #2c4561;
  --map-road-edge: #081320;
  --map-road2: #1b2f45;
  --map-hwy: #41607f;
  --map-hwy-edge: #06101b;
  --map-exp: #2a3c52;
  --map-case: #0a1725;
  --map-water: #0a3157;
  --map-water-edge: #0c3d6c;
  --map-ink: #e8f0f8;
  --map-muted: #8296ab;
  --map-pin: #f3f7fb;
  --map-fog: rgba(6, 13, 22, 0.66);
  --map-fog0: rgba(6, 13, 22, 0);
  color-scheme: dark;
}
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*,
*::before,
*::after {
  box-sizing: inherit;
}
html {
  height: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Lexend",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  line-height: 1.38;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
h2,
h3,
p {
  margin: 0;
}
#app {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

/* HUD */
#hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 9px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hg small {
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}
.hg b {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
}
.hg.cash b {
  font-size: 22px;
  letter-spacing: -0.01em;
}
.hg.cash .row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.chip {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--warn-soft);
  color: var(--warn);
  white-space: nowrap;
}
.bar {
  height: 5px;
  width: 96px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--brand);
  transition: width 0.25s linear;
}
.bar.stress i {
  background: var(--good);
  transition:
    width 0.3s linear,
    background-color 0.3s;
}
.bar.stress.s1 i {
  background: var(--warn);
}
.bar.stress.s2 i {
  background: var(--bad);
}
.hg.ctrl {
  flex-direction: row;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-2);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.seg button + button {
  border-left: 1px solid var(--line);
}
.seg button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}
.iconbtn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

/* Stage */
#stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  min-height: 0;
}
#mapwrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--map-land);
}
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#panel {
  position: relative;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 12px 8px 10px;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 3px solid transparent;
}
.tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
}
.tabs .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  margin-left: 6px;
  vertical-align: 2px;
}
#pbody {
  overflow: auto;
  padding: 12px 14px 150px;
  -webkit-overflow-scrolling: touch;
}
#pbody h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 14px 0 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#pbody h3 b {
  color: var(--ink);
  font-size: 13px;
}
.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.vchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
}
.vchip i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}
.vchip small {
  color: var(--ink-2);
  font-weight: 400;
}
.vchip.free {
  border-color: var(--good);
  background: var(--good-soft);
}
.vchip.free small {
  color: var(--good);
}
.schip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
}
.schip svg {
  width: 14px;
  height: 14px;
}
.schip.low {
  border-color: var(--bad);
  color: var(--bad);
  background: var(--bad-soft);
}
.empty {
  color: var(--ink-2);
  font-size: 13px;
  padding: 10px 0;
}
.orow {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.orow:hover {
  border-color: var(--brand);
}
.orow svg {
  width: 20px;
  height: 20px;
}
.orow .nm {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.orow small.ad {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.orow small {
  display: block;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 400;
}
.orow .tm {
  font-size: 11px;
  color: var(--ink-2);
  text-align: right;
}
.orow .tm .bar {
  width: 100%;
  margin-bottom: 4px;
}
.orow .tm .bar i {
  transition: none;
}
.orow .ok i {
  background: var(--good);
}
.orow .wn i {
  background: var(--warn);
}
.orow .bd i {
  background: var(--bad);
}
.orow.planned {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.orow.road {
  cursor: default;
  background: var(--surface-2);
}
.orow.road:hover {
  border-color: var(--line);
}
.orow .eta-ok {
  color: var(--good);
  font-weight: 500;
}
.orow .eta-late {
  color: var(--bad);
  font-weight: 500;
}
.orow .eta-none {
  color: var(--ink-3);
}

/* Shop */
.sec {
  margin-bottom: 6px;
}
.kit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 8px;
}
.kit-head img {
  height: 30px;
  width: auto;
  display: block;
}
.kit-head span {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.logo-dark {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-dark {
    display: block !important;
  }
  :root:not([data-theme="light"]) .logo-light {
    display: none !important;
  }
}
:root[data-theme="dark"] .logo-dark {
  display: block !important;
}
:root[data-theme="dark"] .logo-light {
  display: none !important;
}
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 8px;
  background: var(--surface);
}
.card.own {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.card .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.card .top b {
  font-size: 14px;
  font-weight: 600;
}
.card .top em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.card p {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 3px 0 8px;
}
.card .pain {
  font-size: 12px;
  font-weight: 500;
  color: var(--bad);
  margin: -3px 0 8px;
}
.card.own .pain {
  color: var(--good);
}
.card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card .foot small {
  font-size: 11.5px;
  color: var(--ink-2);
}
.btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 9px;
  padding: 8px 13px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent-edge);
  color: var(--on-accent);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}
.btn.big {
  padding: 12px 22px;
  font-size: 15px;
  border-radius: 11px;
}
.btn.on {
  background: var(--good-soft);
  border-color: var(--good);
  color: var(--good);
}
.chain {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 4px 9px;
  align-items: center;
}
.chain svg {
  width: 18px;
  height: 18px;
}
.flow {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
}
.flow.tight {
  color: var(--bad);
  font-weight: 500;
}
.muted {
  color: var(--ink-2);
  font-size: 12.5px;
}

/* Map overlays */
#strip {
  display: grid;
  grid-template-columns: minmax(230px, 330px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 7px 16px;
  min-height: 54px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
#goal {
  font-size: 13px;
  min-width: 0;
}
#goal small {
  color: var(--ink-2);
  display: block;
  font-size: 11px;
}
#goal b {
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#goal .bar {
  width: 100%;
  margin-top: 4px;
  height: 4px;
}
#coach {
  justify-self: start;
  display: flex;
  gap: 9px;
  align-items: center;
  background: var(--ink);
  color: var(--surface);
  border-radius: 11px 11px 11px 3px;
  padding: 8px 13px;
  font-size: 13px;
  line-height: 1.3;
  transition:
    opacity 0.25s,
    transform 0.25s;
}
#coach.off {
  opacity: 0;
  transform: translateY(4px);
  visibility: hidden;
}
#coach .who {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  padding: 2px 7px;
}
#inbox {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 26px 12px 12px;
  pointer-events: none;
  background: linear-gradient(to top, var(--surface) 72%, transparent);
}
#inbox:empty {
  display: none;
}
.icard {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--bad);
  border-left-width: 5px;
  border-radius: 11px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
}
.icard.disp {
  border-color: var(--warn);
}
.icard b {
  font-weight: 600;
  display: block;
  font-size: 13px;
}
.icard p {
  margin: 1px 0 0;
  color: var(--ink-2);
}
.icard .irow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.icard .row {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.icard .btn {
  padding: 7px 12px;
  font-size: 12.5px;
}
.icard .row .btn {
  flex: 1;
}
.icard .bar {
  width: 100%;
  margin-bottom: 6px;
  height: 4px;
}
.icard .bar i {
  background: var(--bad);
  transition: none;
}
.icard.disp .bar i {
  background: var(--warn);
}
.icard.call b::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  margin-right: 6px;
  animation: ring 0.5s infinite alternate;
}
@keyframes ring {
  from {
    transform: scale(0.7);
    opacity: 0.5;
  }
  to {
    transform: scale(1.25);
    opacity: 1;
  }
}
.imore {
  pointer-events: none;
  align-self: center;
  background: var(--bad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 99px;
  padding: 3px 10px;
}
#tray {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: fit-content;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  max-width: calc(100% - 24px);
}
#tray[hidden] {
  display: none;
}
#tray .info {
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
}
#tray .info i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
#tray .info span {
  color: var(--ink-2);
}
#tray .sep {
  width: 1px;
  align-self: stretch;
  background: var(--line);
}
#toasts {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 24px);
}
.toast {
  background: var(--ink);
  color: var(--surface);
  border-radius: 99px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: tin 0.22s ease-out;
  text-align: center;
}
.toast.good {
  background: var(--good);
  color: #fff;
}
.toast.bad {
  background: var(--bad);
  color: #fff;
}
@keyframes tin {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Modal */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 34, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
  overflow: auto;
}
#modal[hidden] {
  display: none;
}
.sheet {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 24px 26px;
}
.sheet.narrow {
  width: min(470px, 100%);
}
.sheet h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.sheet .lede {
  color: var(--ink-2);
  margin: 6px 0 16px;
  font-size: 14.5px;
  max-width: 58ch;
}
.sheet .logo {
  height: 34px;
  width: auto;
  margin-bottom: 18px;
}
.sheet .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.sheet .foot small {
  color: var(--ink-2);
  font-size: 12px;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl td {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.tbl td:last-child {
  text-align: right;
  font-weight: 500;
}
.tbl tr.sum td {
  border-bottom: 0;
  font-weight: 700;
  font-size: 15px;
  padding-top: 8px;
}
.tbl .neg {
  color: var(--bad);
}
.tbl .pos {
  color: var(--good);
}
.tbl .d {
  font-size: 11.5px;
  font-weight: 500;
  margin-left: 6px;
}
.tbl .d.up {
  color: var(--good);
}
.tbl .d.dn {
  color: var(--bad);
}
.tbl .d.eq {
  color: var(--ink-3);
}
.boxh {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.headache {
  margin-top: 16px;
  border-radius: 14px;
  background: var(--surface-2);
  padding: 13px 14px;
}
.headache > b {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 3px;
}
.headache > p {
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 10px;
}
.headache .card {
  margin-bottom: 0;
}
details.more {
  margin-top: 12px;
}
details.more summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--brand-ink);
  padding: 4px 0;
}
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  #stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: min(58%, calc(72vw + 52px)) minmax(0, 1fr);
  }
  #panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  #hud {
    display: grid;
    grid-template-columns: repeat(5, auto);
    justify-content: space-between;
    gap: 6px 10px;
    padding: 6px 10px;
  }
  .hg {
    gap: 1px;
  }
  .hg small {
    font-size: 10px;
  }
  .hg b {
    font-size: 13px;
  }
  .hg.cash b {
    font-size: 17px;
  }
  .bar {
    width: 44px;
    height: 4px;
  }
  #unpaid {
    display: none;
  }
  .seg button,
  .iconbtn {
    padding: 6px 11px;
    font-size: 12px;
  }
  .hg.ctrl {
    margin-left: 0;
    grid-column: 1/-1;
    justify-content: space-between;
  }
  #tray {
    gap: 6px;
    padding: 6px 8px;
    bottom: 8px;
  }
  #tray .btn {
    padding: 7px 10px;
    font-size: 12.5px;
  }
  #tray .info {
    font-size: 12px;
    padding: 0 2px;
  }
  .toast {
    font-size: 11.5px;
    padding: 6px 12px;
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .sheet {
    padding: 18px 16px;
  }
  .sheet h2 {
    font-size: 22px;
  }
  #strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding: 6px 10px;
  }
  #goal small {
    display: inline;
    margin-right: 6px;
  }
  #goal b {
    display: inline;
    font-size: 12px;
  }
  #goal .bar {
    display: none;
  }
  #coach {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 44px;
    align-items: flex-start;
  }
  #pbody {
    padding-bottom: 120px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .icard.call b::before,
  .toast {
    animation: none;
  }
  #coach {
    transition: none;
  }
}
.sheet.mid {
  width: min(580px, 100%);
}
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 2px 0 4px;
}
.mode {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mode b {
  font-size: 15px;
  font-weight: 600;
}
.mode p {
  font-size: 12.5px;
  color: var(--ink-2);
  flex: 1;
}
.mode .sub {
  font-size: 11.5px;
  color: var(--good);
  font-weight: 500;
}
.mode .btn {
  text-align: center;
}
.score {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--brand-ink);
  margin: -8px 0 4px;
}
.tbl.cmp td:not(:first-child) {
  text-align: right;
  font-weight: 500;
  padding-left: 6px;
  white-space: nowrap;
}
.tbl.cmp tr:first-child td {
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 600;
}
a.btn {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}
@media (max-width: 560px) {
  .modes {
    grid-template-columns: 1fr;
  }
  .score {
    font-size: 36px;
  }
}

/* SEAOIL's logo and the Locate2u credit, side by side at the top of the title screen. The SEAOIL logo
   is the official file, shown as it is on a white plate so it reads in the dark theme too. */
.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 18px;
}
.so-logo {
  height: 46px;
  width: auto;
  background: #fff;
  border-radius: 10px;
  padding: 6px 11px;
  box-shadow: 0 0 0 1px var(--line);
}
.pw {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.sheet .pw .logo {
  margin-bottom: 0;
}
.tl-ed {
  display: inline-block;
  vertical-align: top;
  margin: 6px 0 0 12px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
/* the stages: one to play now, the next one shown as coming */
.stages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 2px;
}
.stage {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.stage small {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stage b {
  font-size: 14.5px;
  font-weight: 600;
}
.stage i {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-2);
}
.stage.on {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: var(--brand-soft);
}
.stage.on small {
  color: var(--brand-ink);
}
.stage.soon {
  opacity: 0.62;
  border-style: dashed;
}

/* Title logo: the game's own wordmark. The route under it starts as a tangle and ends straight. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tl {
  display: inline-block;
  font-family: "Lexend", system-ui, sans-serif;
  font-weight: 700;
  font-size: 38px;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  padding-top: 0.24em;
}
.tl-a,
.tl-b {
  position: relative;
  display: inline-block;
  padding-bottom: 0.38em;
}
.tl-a {
  margin-right: 0.26em;
}
.tl-sc {
  position: absolute;
  left: 0;
  right: -0.26em;
  bottom: 0;
  height: 0.3em;
  background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 134 10' preserveAspectRatio='none'%3E%3Cpath d='M2 7C9 7 13 1.2 9 1.2 5 1.2 5 8.6 13 8.2 22 7.8 27 1.4 22.500 1.4 18.500 1.4 19 8.6 27 8.1 36 7.6 41 1.8 36.500 1.8 32.500 1.8 33 8.4 41 7.9 49 7.500 53.500 2.600 50 2.600 46.600 2.600 47 8 54 7.4 61 6.900 65 3.600 62 3.600 59.400 3.600 60 7.4 66 6.800 74 6 82 7.4 92 6 102 4.800 112 5.1 122 5.1L134 5.1' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 134 10' preserveAspectRatio='none'%3E%3Cpath d='M2 7C9 7 13 1.2 9 1.2 5 1.2 5 8.6 13 8.2 22 7.8 27 1.4 22.500 1.4 18.500 1.4 19 8.6 27 8.1 36 7.6 41 1.8 36.500 1.8 32.500 1.8 33 8.4 41 7.9 49 7.500 53.500 2.600 50 2.600 46.600 2.600 47 8 54 7.4 61 6.900 65 3.600 62 3.600 59.400 3.600 60 7.4 66 6.800 74 6 82 7.4 92 6 102 4.800 112 5.1 122 5.1L134 5.1' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.tl-st {
  position: absolute;
  left: -0.02em;
  right: 0.1em;
  bottom: 0.11em;
  height: 0.075em;
  border-radius: 1em;
  background: var(--brand);
}
.tl-st::after {
  content: "";
  position: absolute;
  right: -0.1em;
  top: 50%;
  width: 0.2em;
  height: 0.2em;
  margin-top: -0.1em;
  border-radius: 50%;
  background: var(--brand);
}
.tl-i {
  position: relative;
  display: inline-block;
}
.tl-i::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.8em;
  width: 0.3em;
  height: 0.4em;
  margin-left: -0.15em;
  background: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath fill-rule='evenodd' d='M12 0C5.4 0 0 5.3 0 11.9 0 20.4 12 32 12 32s12-11.6 12-20.1C24 5.3 18.6 0 12 0zm0 16.6a4.7 4.7 0 1 1 0-9.4 4.7 4.7 0 0 1 0 9.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath fill-rule='evenodd' d='M12 0C5.4 0 0 5.3 0 11.9 0 20.4 12 32 12 32s12-11.6 12-20.1C24 5.3 18.6 0 12 0zm0 16.6a4.7 4.7 0 1 1 0-9.4 4.7 4.7 0 0 1 0 9.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sheet h2.tl-h {
  margin: 0;
  line-height: 1;
}
.sheet .tagline {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.sheet .tagline + .lede {
  margin-top: 12px;
}
@media (max-width: 560px) {
  .tl {
    font-size: 32px;
  }
}

/* Map controls: zoom buttons, scale bar, credit */
#zoom {
  position: absolute;
  right: 10px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}
#zoom button {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 50, 79, 0.12);
}
#zoom button.fit {
  font-size: 12.5px;
}
#zoom button:hover {
  background: var(--surface-2);
}
#mapcap {
  position: absolute;
  left: 10px;
  top: 8px;
  display: flex;
  align-items: center;
  gap: 4px 9px;
  flex-wrap: wrap;
  max-width: calc(100% - 70px);
  font-size: 10.5px;
  color: var(--ink-2);
  pointer-events: none;
  text-shadow:
    0 0 3px var(--map-land),
    0 0 3px var(--map-land),
    0 0 3px var(--map-land);
}
#scale {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
}
#scale i {
  display: block;
  height: 5px;
  min-width: 8px;
  border: 1.5px solid var(--ink-2);
  border-top: 0;
}
#scale b {
  font-weight: 600;
}
@media (max-width: 560px) {
  #zoom {
    right: 8px;
    top: 8px;
  }
  #zoom button {
    width: 38px;
    height: 38px;
  }
  #mapcap {
    left: 8px;
    top: 6px;
    font-size: 9.5px;
    max-width: calc(100% - 60px);
  }
  #mapcap .place {
    display: none;
  }
}

/* Tips and hooks: explainers, map chips, stars, medals, badges, challenge, help */
.hg[data-act] {
  cursor: help;
}
#cash.pulse {
  animation: cashpulse 0.9s ease-out 3;
}
@keyframes cashpulse {
  0% {
    box-shadow: 0 0 0 0 rgba(235, 186, 56, 0.6);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(0, 173, 239, 0);
  }
}
#cash {
  border-radius: 8px;
}
.toast.warn {
  background: var(--warn);
  color: #fff;
}
#mapchips {
  position: absolute;
  left: 10px;
  top: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  z-index: 1;
}
.mchip {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(22, 50, 79, 0.12);
}
.mchip[hidden] {
  display: none;
}
.mchip.good {
  background: var(--good-soft);
  border-color: transparent;
  color: var(--good);
}
.mchip.on {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}
.stars {
  display: flex;
  gap: 4px;
  font-size: 30px;
  line-height: 1;
  margin: 6px 0 2px;
  color: var(--line);
}
.stars span.on {
  color: #f5b301;
  animation: starpop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes starpop {
  0% {
    transform: scale(0.2) rotate(-25deg);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
.medal {
  display: inline-block;
  border-radius: 99px;
  padding: 5px 16px;
  font-weight: 700;
  font-size: 14px;
  margin: 2px 0 6px;
  color: #3b2a00;
  background: #f5c542;
  animation: starpop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.medal.silver {
  background: #cfd8e3;
  color: #1f2f40;
}
.medal.bronze {
  background: #e2a36b;
  color: #3a1d05;
}
.sheet .next,
.sheet .vs,
.sheet .newbadge {
  margin: 2px 0 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.sheet .vs.win,
.sheet .newbadge {
  color: var(--good);
  font-weight: 600;
}
.challenge {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 14px;
}
.sharebox {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.sharebox input {
  flex: 1 1 150px;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.help h3 {
  font-size: 14px;
  margin: 16px 0 6px;
}
.help .steps {
  margin: 10px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
}
.help .steps b {
  color: var(--ink);
}
.help .legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.help .legend li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: center;
}
.help .fine {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 12px 0 0;
}
.lg {
  justify-self: center;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.lg.ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--map-pin);
  border: 3.5px solid var(--good);
}
.lg.ring.wn {
  border-color: var(--warn);
}
.lg.ring.bd {
  border-color: var(--bad);
}
.lg.bdg {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
}
.lg.bdg.call {
  background: var(--bad);
}
.lg.bdg.disp {
  background: var(--warn);
}
.lg.van {
  width: 22px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand) 0 66%, #012f52 66% 100%);
}
.lg.truck {
  width: 24px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ink-3) 0 62%, transparent 62% 68%, var(--ink) 68% 100%);
}
.lg.edge {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
  background: var(--map-pin);
  border: 3px solid var(--good);
  box-shadow: 9px 0 0 -5px var(--good);
}
.badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.badge {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: var(--surface-2);
  opacity: 0.55;
  display: grid;
  gap: 3px;
}
.badge.got {
  opacity: 1;
  border-color: #f5b301;
  background: var(--warn-soft);
}
.badge b {
  font-size: 13px;
}
.badge span {
  font-size: 11.5px;
  color: var(--ink-2);
}
#zoom button.q {
  font-size: 16px;
}
@media (max-width: 560px) {
  #mapchips {
    left: 8px;
    top: 24px;
  }
  .mchip {
    font-size: 11px;
    padding: 3px 9px;
  }
  .help .legend {
    grid-template-columns: 1fr;
  }
  .badges {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stars span.on,
  .medal,
  #cash.pulse {
    animation: none;
  }
}

/* Sound button: a speaker, the state in words, and bars that move while audio is really playing */
.iconbtn.snd {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.snd .spk {
  width: 17px;
  height: 17px;
  flex: none;
}
.snd .x,
.snd.off .w {
  display: none;
}
.snd.off .x {
  display: inline;
}
.snd.off {
  color: var(--ink-2);
}
.snd .eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.snd.live .eq {
  display: inline-flex;
}
.snd .eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--brand);
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}
.snd .eq i:nth-child(2) {
  animation-duration: 0.65s;
  animation-delay: -0.3s;
}
.snd .eq i:nth-child(3) {
  animation-duration: 1.1s;
  animation-delay: -0.55s;
}
@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .snd .eq i {
    animation: none;
    transform: scaleY(0.6);
  }
}

/* Traffic */
.mchip.jam {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad);
}
.lg.road {
  width: 24px;
  height: 5px;
  border-radius: 3px;
  background: var(--warn);
}
.lg.road.bd {
  background: var(--bad);
}

/* Leaderboard */
.iconbtn.lb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-ink);
}
.lb .tro {
  width: 17px;
  height: 17px;
  flex: none;
  color: #e0a100;
}
.rank {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
}
.sheet.board {
  width: min(720px, 100%);
}
.board .rank {
  max-height: min(42vh, 340px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.rank li {
  border-bottom: 1px solid var(--line);
}
.rank li.me {
  background: var(--brand-soft);
  border-radius: 8px;
  border-bottom-color: transparent;
  font-weight: 600;
}
.rank li.gap {
  text-align: center;
  color: var(--ink-3);
  line-height: 1;
  padding: 2px 0 6px;
}
.rank summary {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 2px;
  align-items: baseline;
  padding: 6px 8px;
  cursor: pointer;
  list-style: none;
}
.rank summary::-webkit-details-marker {
  display: none;
}
.rank .pos {
  color: var(--ink-2);
  font-weight: 600;
  text-align: right;
}
.rank li:nth-child(1) .pos {
  color: #e0a100;
}
.rank .who {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank b small {
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-3);
}
.board .tabs {
  margin: 2px 0 10px;
}
.sheet .unchecked {
  color: var(--warn);
  font-weight: 600;
}
.themepick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}
.themepick .lab {
  font-weight: 600;
  font-size: 13.5px;
}
.themepick + .fine {
  margin-top: 6px;
}
.rank b.none {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ink-3);
}
.rank .ach {
  grid-column: 2 / -1;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-2);
}
.rank .more {
  margin: 0;
  padding: 0 8px 8px 42px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-2);
}
.rank .md {
  display: inline-block;
  border-radius: 99px;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 700;
  color: #3b2a00;
  background: #f5c542;
}
.rank .md.silver {
  background: #cfd8e3;
  color: #1f2f40;
}
.rank .md.bronze {
  background: #e2a36b;
  color: #3a1d05;
}
.sheet .empty {
  color: var(--ink-2);
  font-size: 13px;
  margin: 8px 0;
}
.sheet .fine {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 12px 0 0;
}
.sheet button.link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 560px) {
  /* the top row is tight on a phone: icons carry the meaning */
  #bBoardLbl,
  #bSoundLbl {
    display: none;
  }
  .board .cols {
    grid-template-columns: 1fr;
  }
}

/* Invite a friend */
.share .fld {
  display: block;
  margin: 14px 0 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.share input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.share input[readonly] {
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
}
.share .rowf {
  display: flex;
  gap: 8px;
}
.share .rowf input {
  flex: 1 1 auto;
}
.share .rowf .btn {
  flex: none;
  white-space: nowrap;
}
.share .hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}
.share .hint.bad {
  color: var(--bad);
  font-weight: 600;
}
.share .btn.wide {
  width: 100%;
  margin-top: 14px;
}

/* Help legend: the two rings round the depot */
.lg.zone {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px dashed var(--brand);
}
.lg.zone.sight {
  width: 14px;
  height: 14px;
  border-color: var(--ink-3);
}

/* Grow tab: the one purchase that would help most */
.growhint {
  background: var(--brand-soft);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.growhint p {
  margin: 3px 0 0;
  color: var(--ink-2);
  font-size: 12.5px;
}

.sheet .lede.away {
  color: var(--warn);
  font-weight: 600;
}
/* The player's email and nickname, asked before the first game */
.sharebox .playas {
  flex: 1 1 180px;
  margin: 0;
  align-self: center;
}
.namesheet .pstatus {
  margin: 8px 0 0;
  font-weight: 600;
}
.namesheet .pstatus:empty {
  display: none;
}
.namesheet .pstatus.ok {
  color: var(--good);
}
.namesheet .hint a {
  color: var(--brand-ink);
  font-weight: 600;
}
.namesheet .fld:first-of-type {
  margin-top: 4px;
}
/* The player's name, asked before the first game */
.namesheet input {
  margin-top: 6px;
  font-size: 17px;
  padding: 11px 13px;
}
.namesheet .hint {
  margin-top: 8px;
}
.sheet .playas {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.sheet .playas b {
  color: var(--ink);
}

/* Proof of delivery */
.podrow {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.podrow svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--good);
}
.podrow span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}
.podrow em {
  white-space: nowrap;
}
.podrow b {
  margin-left: 4px;
}
.podrow em {
  font-style: normal;
  font-weight: 600;
  color: var(--brand-ink);
}
.card button.link {
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-ink);
  text-decoration: underline;
  cursor: pointer;
}
.pod .podtop {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.pod .podtop h2 {
  margin: 0;
}
.pod .tag {
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--good-soft);
  color: var(--good);
}
.pod .tag.late {
  background: var(--warn-soft);
  color: var(--warn);
}
.pod .tag.ex {
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.podgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.podgrid figure {
  margin: 0;
}
.podphoto {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.podgrid figcaption {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.sigbox {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 8px 12px 9px;
  color: var(--ink);
}
.sigbox small {
  display: block;
  font-size: 11px;
  color: var(--ink-2);
}
.podsig {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
}
.sigbox b {
  font-size: 13px;
}
.pod dl {
  margin: 10px 0 0;
  font-size: 12.5px;
}
.pod dl div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.pod dt {
  color: var(--ink-2);
}
.pod dd {
  margin: 0;
  font-weight: 500;
}
.podwin {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--good-soft);
  color: var(--good);
  font-size: 13px;
  font-weight: 600;
}
.podnav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.podnav small {
  margin-left: 4px;
}
@media (max-width: 560px) {
  .podgrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Lifelines, from city level 7: three round buttons at the bottom left of the map */
#lifelines {
  position: absolute;
  left: 10px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
#lifelines[hidden] {
  display: none;
}
#lifelines .lfh {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--surface);
  border-radius: 99px;
  padding: 1px 7px;
}
.life {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: var(--surface);
  color: var(--brand-ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.life svg {
  width: 20px;
  height: 20px;
}
.life:disabled {
  cursor: default;
  opacity: 0.45;
  border-color: var(--line);
  color: var(--ink-2);
}
/* used today: crossed out, game-show style */
.life.used {
  opacity: 0.75;
}
.life.used::before,
.life.used::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: var(--bad);
  transform: rotate(45deg);
}
.life.used::after {
  transform: rotate(-45deg);
}
/* days of rest left, on a lifeline that was used */
.life .rest {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--bad);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  z-index: 1;
}
.lifelist {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
.lifelist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.lifelist .lic {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lifelist .lic svg {
  width: 20px;
  height: 20px;
}
.lifelist b {
  font-size: 14.5px;
}
.lifelist p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}
.lifeintro .howto {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}
.lifeintro .howto b {
  color: var(--ink);
}
#lifelines.pulse .life {
  animation: lifepulse 0.9s ease-out 3;
}
@keyframes lifepulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 173, 239, 0.6);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(0, 173, 239, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #lifelines.pulse .life {
    animation: none;
  }
}
.lifesheet h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lifesheet h2 svg {
  width: 26px;
  height: 26px;
  color: var(--brand);
  flex: none;
}
.oncall {
  list-style: none;
  margin: 6px 0 4px;
  padding: 0;
}
.oncall li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.oncall li span {
  color: var(--ink-2);
  text-align: right;
}
.oncall li.ring span {
  color: var(--brand-ink);
  font-weight: 600;
}
.oncall li.yes span {
  color: var(--good);
  font-weight: 600;
}
.oncall li.wait {
  opacity: 0.5;
}
.vchip.backup {
  border-style: dashed;
}
@media (max-width: 700px) {
  /* above the run tray at the bottom */
  #lifelines {
    bottom: 64px;
    gap: 4px;
  }
  .life {
    width: 52px;
    height: 52px;
    font-size: 8.5px;
    letter-spacing: -0.01em;
  }
  .life svg {
    width: 16px;
    height: 16px;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  /* a short map: under the zoom buttons on the right, clear of the run tray */
  #lifelines {
    left: auto;
    right: 6px;
    top: 152px;
    bottom: auto;
    gap: 4px;
  }
  #lifelines .lfh {
    display: none;
  }
  .life {
    width: 44px;
    height: 44px;
    font-size: 8px;
  }
  /* the run tray keeps clear of the button column on the right */
  #tray {
    right: 58px;
  }
}

/* A phone held sideways: short and wide. The map and the panel sit side by side as on a computer,
   and the bars above shrink to one slim row each, so the map gets the height. */
@media (orientation: landscape) and (max-height: 520px) {
  #hud {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px 14px;
    padding: 4px 10px;
  }
  .hg {
    gap: 0;
  }
  .hg small {
    font-size: 9.5px;
  }
  .hg b {
    font-size: 12.5px;
  }
  .hg.cash b {
    font-size: 15px;
  }
  #hud .bar {
    width: 36px;
    height: 3px;
  }
  #unpaid {
    display: none;
  }
  .hg.ctrl {
    margin-left: auto;
    grid-column: auto;
    justify-content: flex-end;
    gap: 5px;
  }
  .seg button,
  .iconbtn {
    padding: 5px 8px;
    font-size: 11.5px;
  }
  #bBoardLbl,
  #bSoundLbl {
    display: none;
  }
  #strip {
    grid-template-columns: minmax(120px, 240px) minmax(0, 1fr);
    gap: 10px;
    padding: 3px 10px;
    min-height: 0;
  }
  #goal small {
    display: inline;
    margin-right: 6px;
    font-size: 10px;
  }
  #goal b {
    display: inline;
    font-size: 11.5px;
  }
  #goal .bar {
    display: none;
  }
  #coach {
    font-size: 11.5px;
    padding: 4px 9px;
    min-height: 0;
    align-items: center;
  }
  #stage {
    grid-template-columns: minmax(0, 1fr) min(40%, 300px);
    grid-template-rows: minmax(0, 1fr);
  }
  #panel {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  #pbody {
    padding-bottom: 16px;
  }
  #zoom {
    right: 6px;
    top: 6px;
    gap: 4px;
  }
  #zoom button {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 17px;
  }
  #zoom .fit {
    font-size: 11px;
  }
  .sheet {
    padding: 14px 16px;
  }
}
