.voyage-map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-inline-start: auto;
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid #45665b;
  border-radius: 7px;
  background: #e2e6ce;
  color: #254b43;
  white-space: nowrap;
}
.voyage-map-button:hover { background: #d4e3c7; }
.voyage-map-button b { font-size: 13px; }
.voyage-map-button small { color: #44614b; font-size: 10px; }
.voyage-map-button .glyph { width: 16px; height: 16px; }

#dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-brief"], [data-kind="voyage-cargo"]) {
  color: #273e39;
  border: 2px solid #345049;
  border-radius: 13px;
  background: #f8f3e2;
  box-shadow: 0 5px 0 #344f45, 0 14px 60px #18333457;
}
#dialog[data-kind="voyage-log"] { width: min(92vw, 790px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px))); }
#dialog:is([data-kind="voyage-reward"], [data-kind="voyage-cargo"]) { width: min(90vw, 520px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px))); }
#dialog[data-kind="voyage-brief"] { width: min(88vw, 416px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px))); }
#dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-brief"], [data-kind="voyage-cargo"]) .dialog-content { padding: 0; }
#dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-brief"], [data-kind="voyage-cargo"]) .dialog-close {
  top: 5px;
  right: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #f9edd2;
  border-color: transparent;
  background: transparent;
}
#dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-brief"], [data-kind="voyage-cargo"]) .dialog-close:hover { background: #ffffff22; }
#dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-brief"], [data-kind="voyage-cargo"]) button:focus-visible,
.voyage-map-button:focus-visible { outline: 2px solid #b34c26; outline-offset: -3px; }
#dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-brief"], [data-kind="voyage-cargo"]) .dialog-close:focus-visible,
.voyage-directory .voyage-tab[aria-pressed="true"]:focus-visible,
#dialog .voyage-action:focus-visible { outline-color: #ffd78d; }

.voyage-head, .voyage-receipt > header, .voyage-cargo > header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 55px;
  padding: 8px 55px 8px 18px;
  color: #f9efd2;
  border-bottom: 3px solid #b69b69;
  background: #274c4a;
}
.voyage-head > .glyph { width: 24px; height: 24px; color: #eed49a; }
#dialog .voyage-head h2, #dialog .voyage-receipt h2, #dialog .voyage-cargo h2 {
  margin: 0;
  color: inherit;
  font-size: clamp(21px, 2.5vw, 28px);
  line-height: 1.2;
  letter-spacing: .04em;
}
.voyage-head > span { margin-inline-start: auto; color: #d8e7d2; font-size: 12px; font-weight: 750; white-space: nowrap; }
.voyage-book { display: grid; grid-template-columns: minmax(147px, .69fr) minmax(0, 2.5fr); }
.voyage-directory {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: clamp(10px, 1.5vw, 17px) 9px;
  border-right: 1px solid #b9b69c;
  background: #e9e7d5;
}
.voyage-tab {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 8px 10px;
  text-align: start;
  border: 1px solid #a3ac93;
  border-radius: 6px;
  background: #f6f3e5;
  color: #344e45;
}
.voyage-tab:hover { background: #fdf9e9; }
.voyage-tab[aria-pressed="true"] { color: #fbf2db; background: #355a50; border-color: #2b4b43; box-shadow: inset 3px 0 #e6c581; }
.voyage-tab > span { display: flex; align-items: center; gap: 5px; color: #546651; }
.voyage-tab[aria-pressed="true"] > span { color: #f3d797; }
.voyage-tab > span .glyph { width: 15px; height: 15px; }
.voyage-tab small { font-size: 10px; line-height: 1.3; font-weight: 800; }
.voyage-tab b { font-size: 14px; line-height: 1.4; }
.voyage-sheet {
  min-width: 0;
  padding: clamp(12px, 2.1vw, 23px);
  background: linear-gradient(90deg, #b7ac8714, transparent 14px);
}
.voyage-sheet h3, .voyage-receipt h3 { margin: 0; font-size: clamp(19px, 2.3vw, 25px); line-height: 1.28; letter-spacing: .025em; color: #28473f; }
.voyage-sheet header p, .voyage-sheet .voyage-route-note, .voyage-sheet li p, .voyage-receipt p { color: #4b5a4e; }
.voyage-sheet header p { margin: 5px 0 11px; line-height: 1.5; }
.voyage-choices { display: flex; gap: 5px; }
.voyage-choices button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid #b3b49a;
  border-radius: 6px;
  color: #42594c;
  background: #fff9e9;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
}
.voyage-choices button:hover { border-color: #6e8a71; }
.voyage-choices button[aria-pressed="true"] { border-color: #79927a; color: #2d5445; background: #e3ead6; }
.voyage-choice-mark { display: grid; flex: none; place-items: center; width: 15px; height: 15px; border: 1px solid #959e89; border-radius: 50%; }
.voyage-choices [aria-pressed="true"] .voyage-choice-mark { background: #386152; border-color: #386152; color: #fffadc; }
.voyage-choices [data-delivered] .voyage-choice-mark { background: #487059; border-color: #487059; color: #fffadc; }
.voyage-choice-mark .glyph { width: 13px; height: 13px; stroke-width: 2.5; }
.voyage-choices small { font-size: 10px; white-space: nowrap; }
.voyage-sheet .voyage-route-note { margin: 6px 0 10px; font-size: 12px; line-height: 1.45; }
.voyage-itinerary { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.voyage-itinerary li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  min-height: 43px;
  padding: 4px 0;
}
.voyage-itinerary li + li { border-top: 1px solid #bab59f7a; }
.voyage-itinerary small, .voyage-itinerary b { display: block; }
.voyage-itinerary small { color: #506454; font-size: 10px; line-height: 1.3; font-weight: 750; }
.voyage-itinerary b { color: #304b42; font-size: 14px; line-height: 1.45; }
.voyage-itinerary li[aria-current] b { color: #27543f; }
.voyage-sheet .voyage-itinerary p { margin: 2px 0 0; font-size: 12px; line-height: 1.45; }
.voyage-evidence { position: relative; display: block; width: 49px; }
.voyage-stamp { display: block; width: 100%; height: auto; }
.voyage-itinerary li:nth-child(2n) .voyage-stamp { transform: rotate(2deg); }
.voyage-evidence i { position: absolute; right: -2px; bottom: -1px; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #ecedc9; border-radius: 50%; background: #376052; color: #f5f5cf; }
.voyage-evidence i .glyph { width: 13px; height: 13px; stroke-width: 2.8; }
.voyage-log-footer, .voyage-receipt footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed #aaa58a;
}
.voyage-fee { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; color: #725526; font-size: 12px; font-weight: 800; }
.voyage-fee b { font: 850 17px/1.1 var(--rounded); color: #63491f; }
.voyage-fee small { display: block; color: #5c6457; font-size: 11px; }
.voyage-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 15px;
  border: 1px solid #36564a;
  border-radius: 7px;
  color: #fff6dc;
  background: #365d50;
  font-size: 14px;
  font-weight: 850;
  box-shadow: inset 0 1px #ffffff26, 0 2px #293f36;
}
.voyage-action:hover { background: #2b5045; }
.voyage-action:active { box-shadow: inset 0 1px 2px #243d34; }
.voyage-report { margin: 10px 0 0; padding: 8px 10px; color: #445444; border-left: 3px solid #ae9260; background: #eee9d5; font-size: 13px; line-height: 1.6; font-weight: 640; }
.voyage-receipt { padding: 0 22px 17px; }
.voyage-receipt > header { margin: 0 -22px 16px; }
.voyage-receipt-seal { display: grid; place-items: center; width: 29px; height: 29px; border: 1px double #ddc589; border-radius: 50%; color: #ecd598; }
.voyage-receipt-route { display: flex; align-items: center; gap: 11px; margin: 12px 0 5px; }
.voyage-receipt-route .voyage-stamp { width: clamp(50px, 13vw, 68px); transform: rotate(-4deg); }
.voyage-receipt-route .voyage-stamp:nth-child(2) { transform: rotate(3deg); }
.voyage-receipt p { margin: 7px 0; font-size: 12px; }
.voyage-receipt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.voyage-receipt-actions .voyage-action { padding-inline: 10px; font-size: 12px; }
.voyage-cargo-pin { color: #264c44; background: #e1ebd5; box-shadow: inset 0 1px #ffffff71, 0 2px #4a6b60; }
.voyage-cargo-pin:hover { background: #d1e1c4; }
#dialog .voyage-cargo-pin:focus-visible { outline-color: #814d30; }
.voyage-cargo > header { border-bottom-color: var(--cargo-color); }
.voyage-cargo > header .voyage-stamp { width: 47px; flex: none; transform: rotate(-4deg); }
.voyage-cargo > header small { color: #dcead9; font-size: 11px; font-weight: 750; }
.voyage-cargo .voyage-report { margin: 13px 17px 9px; background: #eee9d5; }
.voyage-cargo-record { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; padding: 2px 17px 14px; }
.voyage-cargo-record b { color: #416455; font-size: 13px; }

#voyage-hud {
  position: fixed;
  right: max(16px, var(--phone-right, 0px), env(safe-area-inset-right));
  top: max(76px, calc(var(--top) + 56px));
  width: max-content;
  max-width: min(39vw, 320px);
  pointer-events: none;
}
#app[data-sight-view] #voyage-hud { display: none; }
.voyage-hud-brief, .voyage-handoff {
  color: #f8f3dd;
  border: 1px solid #93a99c;
  border-radius: 9px;
  background: #244844;
  box-shadow: 0 2px 0 #243e3a9c, 0 3px 12px #18322f24;
}
.voyage-hud-brief {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  min-height: 47px;
  padding: 5px 9px;
  text-align: left;
  pointer-events: auto;
}
.voyage-hud-brief:hover { background: #2e554e; border-color: #e3cf93; }
.voyage-passage-stamp, .voyage-cancelled-stamp { display: block; width: 39px; flex: none; transform: rotate(-4deg); }
.voyage-passage-copy { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.voyage-passage-copy > small { color: #f1d296; font-size: 10px; font-weight: 760; }
.voyage-passage-copy > strong { color: #fff7de; font-size: 14px; font-weight: 850; }
.voyage-hud-link {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  flex: none;
  margin-inline-start: auto;
  padding-inline-start: 8px;
  border-inline-start: 1px solid #91aa9470;
  color: #eee1b3;
  font-size: 11px;
  font-weight: 750;
}
.voyage-hud-link .glyph, .voyage-handoff-foot button .glyph, .voyage-launch-card .launch-record .glyph { width: 14px; height: 14px; flex: none; }
.voyage-handoff { width: 263px; max-width: 100%; text-align: left; overflow: hidden; }
.voyage-passage-info { display: flex; align-items: center; gap: 10px; padding: 7px 11px; }
.voyage-cancelled-stamp { position: relative; width: 44px; }
.voyage-cancelled-stamp i {
  position: absolute;
  right: -2px;
  bottom: -1px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1.5px solid #fff0b6;
  border-radius: 50%;
  background: #346d55;
  color: #fff5ce;
}
.voyage-cancelled-stamp i .glyph { width: 13px; height: 13px; stroke-width: 3; }
.voyage-handoff-foot {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border-top: 1px dashed #8f9d83;
  background: #f7efd9;
}
.voyage-handoff-foot > span { align-self: center; display: grid; min-width: 0; gap: 1px; padding: 3px 9px; line-height: 1.3; }
.voyage-handoff-foot small { color: #5a6857; font-size: 10px; font-weight: 750; }
.voyage-handoff-foot b { color: #254c40; font-size: 12px; font-weight: 800; }
.voyage-handoff-foot button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 4px;
  min-height: 44px;
  padding: 4px 9px;
  border: 0;
  border-inline-start: 1px solid #a7a788;
  background: #e8d397;
  color: #35432e;
  font-size: 12px;
  font-weight: 850;
  pointer-events: auto;
}
.voyage-handoff-foot button:hover { background: #f3dea3; }
.voyage-handoff-foot button:focus-visible, .voyage-launch-card:focus-visible { outline: 2px solid #884124; outline-offset: -3px; }
.voyage-hud-brief:focus-visible { outline: 2px solid #ffe8aa; outline-offset: -3px; }
#dialog .voyage-handoff { width: 100%; margin: 8px 0; }
.voyage-brief-head { padding: 12px 56px 12px 19px; border-bottom: 3px solid #b69b69; background: #274c4a; }
.voyage-brief-head > span { color: #f0d59a; font-size: 12px; font-weight: 800; }
#dialog .voyage-brief-head h2 { margin: 3px 0 0; color: #fff3d7; font-size: clamp(20px, 3.3vw, 26px); line-height: 1.28; }
.voyage-brief-body { padding: 15px 19px; }
.voyage-brief-location { display: flex; align-items: center; gap: 11px; }
.voyage-brief-location > .voyage-stamp { width: 58px; transform: rotate(-4deg); }
.voyage-brief-location > div { display: grid; gap: 2px; }
.voyage-brief-location small { color: #586757; font-size: 11px; font-weight: 750; }
.voyage-brief-location strong { color: #2f5043; font-size: 15px; font-weight: 850; }
#dialog .voyage-brief-hint { margin: 11px 0 13px; color: #324b40; font-size: 15px; line-height: 1.7; }
.voyage-brief-track {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin: 0 0 13px;
  padding: 10px 0 0;
  border-top: 1px dashed #aaa98c;
  list-style: none;
}
.voyage-brief-track li { display: flex; align-items: center; gap: 4px; color: #636b59; font-size: 11px; font-weight: 700; }
.voyage-brief-track li[aria-current] { color: #2e5846; font-weight: 900; }
.voyage-brief-point { display: grid; flex: none; place-items: center; width: 18px; height: 18px; border: 1px solid #999e86; border-radius: 50%; font: 750 11px/1 var(--rounded); }
.voyage-brief-point .glyph { width: 13px; height: 13px; }
.voyage-brief-track [aria-current] .voyage-brief-point { border-color: #386451; background: #386451; color: #fff4d8; }
.voyage-brief-dismiss { display: flex; margin-inline-start: auto; }
.voyage-launch-card { min-height: 44px; background: #f4ecd9f8; border-color: #8a937d; }
.voyage-launch-card:hover { background: #fff5dd; border-color: #526f59; }
.voyage-launch-card > .voyage-stamp { flex: none; width: clamp(36px, 5vw, 57px); transform: rotate(-4deg); }
.voyage-launch-card .launch-name { min-width: 0; }
.voyage-launch-card .launch-name small { color: #546953; }
.voyage-launch-card .launch-name strong { white-space: normal; color: #2c4e41; line-height: 1.25; }
.voyage-launch-card .launch-record { flex: none; color: #3a5846; }
@media (prefers-reduced-motion: no-preference) {
  .voyage-handoff .voyage-cancelled-stamp { animation: voyage-postmark .3s ease-out backwards; }
  @keyframes voyage-postmark { from { opacity: 0; transform: translateY(-4px) scale(1.15) rotate(-9deg); } }
}

@media (orientation: portrait) and (max-width: 600px) {
  .voyage-book { grid-template-columns: minmax(0, 1fr); }
  .voyage-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 7px 10px; border: 0; border-bottom: 1px solid #b9b69c; }
  .voyage-tab { min-height: 44px; padding: 4px 7px; gap: 2px; }
  .voyage-tab b { font-size: 12px; }
  .voyage-head { gap: 6px; padding-inline-start: 11px; }
  .voyage-head > .glyph { width: 19px; }
  .voyage-head > span { font-size: 10px; }
  .voyage-sheet { background: none; }
  .voyage-choices button { flex: 1; gap: 3px; padding-inline: 5px; }
  #voyage-hud { position: static; max-width: 100%; }
  .voyage-map-button small { display: none; }
}
@media (max-width: 355px) and (orientation: portrait) {
  #dialog .station-map-head { gap: 4px; margin-inline-end: 51px; }
  .station-map-head > span { display: none; }
  .voyage-map-button { padding-inline: 6px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #dialog[data-kind="station-map"] .dialog-content { padding-block: 3px; }
  .voyage-head, .voyage-receipt > header, .voyage-cargo > header { min-height: 44px; padding-block: 5px; }
  #dialog:is([data-kind="voyage-log"], [data-kind="voyage-reward"], [data-kind="voyage-cargo"]) .dialog-close { top: 0; }
  .voyage-head h2 { font-size: 21px; }
  .voyage-sheet { padding: 8px 12px; }
  .voyage-sheet h3 { font-size: 17px; }
  .voyage-sheet header p { margin: 3px 0 5px; font-size: 11px; }
  .voyage-sheet .voyage-route-note { margin: 4px 0; font-size: 11px; }
  .voyage-evidence { width: 36px; }
  .voyage-itinerary li { min-height: 31px; padding-block: 2px; gap: 7px; }
  .voyage-itinerary li > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
  .voyage-itinerary b { font-size: 12px; }
  .voyage-sheet .voyage-itinerary p { flex-basis: 100%; font-size: 11px; }
  .voyage-log-footer { margin-top: 4px; padding-top: 4px; }
  .voyage-receipt { padding-bottom: 10px; }
  .voyage-receipt > header { margin-bottom: 8px; }
  .voyage-receipt-route { margin-block: 4px; }
  .voyage-receipt-route .voyage-stamp { width: 47px; }
  #voyage-hud { top: calc(var(--top) + 51px); max-width: min(40vw, 255px); }
  .voyage-hud-brief { min-height: 44px; gap: 6px; padding-inline: 7px; }
  .voyage-passage-stamp { width: 30px; }
  .voyage-hud-link { padding-inline-start: 5px; }
  .voyage-brief-head, .voyage-brief-body { padding-block: 8px; }
  #dialog .voyage-brief-hint { margin-block: 6px 8px; font-size: 14px; }
  .voyage-brief-track { padding-top: 6px; margin-bottom: 8px; }
}

.voyage-patrol-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0;
  padding: 0;
  border: 1px solid #b7b39a;
  border-radius: 7px;
  background: #f1eddc;
  list-style: none;
  overflow: hidden;
}
.voyage-patrol-strip li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 9px 3px 7px;
  text-align: center;
}
.voyage-patrol-strip li + li { border-inline-start: 1px dashed #b1ac91; }
.voyage-patrol-strip li[aria-current] { background: #e0e9d6; box-shadow: inset 0 -3px #486e57; }
.voyage-patrol-strip li.voyage-stamped { background: #e6ebdc; }
.voyage-patrol-strip .voyage-evidence { width: clamp(46px, 5.8vw, 68px); margin-bottom: 3px; }
.voyage-patrol-strip strong { font-size: 14px; line-height: 1.18; color: #284a41; }
.voyage-patrol-strip small, .patrol-stop-status { color: #4c6053; font-size: 11px; font-weight: 730; line-height: 1.3; }
.patrol-stop-status { margin-top: 3px; padding: 2px 5px; border-radius: 3px; color: #605f50; }
.voyage-patrol-strip [aria-current] .patrol-stop-status { background: #3c6450; color: #fff4d7; }
.voyage-stamped .patrol-stop-status { color: #315943; }

/* Patrol instruments already describe the activity. The title slot keeps the
   stamp and its briefing next to the map without taking more of the world. */
.race-top:has(> #voyage-hud[data-patrol]:not([hidden])) > .race-place { display: none; }
.race-top > #voyage-hud[data-patrol] {
  position: static; justify-self: start; align-self: start; min-width: 0; width: max-content; max-width: 100%;
}
.voyage-patrol-button {
  display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-height: 44px; max-width: 100%;
  padding: 3px 8px 3px 5px; border: 1px solid #a5b8a2; border-radius: 9px;
  color: #fff4d7; background: #294b49; box-shadow: 0 2px 0 #243e3aab;
  text-align: start; touch-action: manipulation;
}
.voyage-patrol-button > .voyage-stamp { width: 36px; flex: none; }
.voyage-patrol-button > span { display: grid; gap: 1px; white-space: nowrap; }
.voyage-patrol-button small { color: #f4d9a2; font: 750 10px/1.25 var(--rounded); }
.voyage-patrol-button b { font: 850 14px/1.25 var(--rounded); }
.voyage-patrol-button > .glyph { width: 16px; height: 16px; flex: none; color: #f4d9a2; }
.voyage-patrol-button:focus-visible { outline: 2px solid #ffe8aa; outline-offset: -3px; }
#dialog[data-kind="birdwatch-result"] .voyage-handoff { grid-column: 1 / -1; }
#dialog[data-kind="voyage-airdrop"] {
  width: min(90vw, 460px); border: 2px solid #345049; border-radius: 12px; background: #f8f3e2;
}
#dialog[data-kind="voyage-airdrop"] .dialog-content { padding: 0 16px 13px; }
#dialog[data-kind="voyage-airdrop"] .voyage-brief-head { margin-inline: -16px; }
#dialog[data-kind="voyage-airdrop"] .voyage-brief-head > p { margin: 4px 0 0; color: #e1edda; font-size: 13px; line-height: 1.4; }
#dialog[data-kind="voyage-airdrop"] .dialog-close { color: #fff2d1; background: #335451; border-color: #91a99a; }
#dialog[data-kind="voyage-airdrop"] .dialog-actions { margin-top: 7px; }
@media (orientation: portrait) and (max-width: 600px) {
  .voyage-directory:has([data-voyage="dusk-patrol"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .voyage-patrol-button { gap: 4px; padding-inline: 4px; }
  .voyage-patrol-button > .voyage-stamp { width: 30px; }
}
@media (orientation: landscape) and (max-height: 410px) {
  .voyage-patrol-strip { margin-block: 5px; }
  .voyage-patrol-strip li { grid-template-columns: auto auto; align-items: center; align-content: center; justify-content: center; column-gap: 4px; padding-block: 4px; }
  .voyage-patrol-strip .voyage-evidence { grid-row: 1 / 4; width: 39px; margin: 0; }
  .voyage-patrol-strip strong { font-size: 12px; }
  .voyage-patrol-strip small, .patrol-stop-status { font-size: 10px; }
  .patrol-stop-status { margin: 0; padding: 0 3px; }
  #dialog[data-kind="voyage-brief"]:has(.voyage-patrol-strip) { width: min(90vw, 520px); }
  .voyage-patrol-button > .voyage-stamp { width: 32px; }

  #dialog[data-kind="fireflies-result"]:has(.voyage-handoff[data-kind="fireflies"]) {
    width: min(93vw, 724px, calc(100% - var(--phone-left, 12px) - var(--phone-right, 12px)));
  }
  #dialog[data-kind="fireflies-result"]:has(.voyage-handoff[data-kind="fireflies"]) .dialog-content {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(166px, .73fr);
    grid-template-areas: "summary summary" "metrics handoff" "routes handoff" "best handoff" "bonus handoff" "other activity";
    align-items: center; gap: 3px 12px; padding: 9px 14px;
  }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .result-summary { grid-area: summary; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .result-summary h2 { margin-block: 0; font-size: 24px; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) p { margin: 0; font-size: 12px; line-height: 1.3; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .ff-result { grid-area: metrics; margin: 3px 0 0; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .ff-journeys { grid-area: routes; margin-top: 0; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .dialog-content > p { grid-area: best; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .dialog-content > .result-reward { grid-area: bonus; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .voyage-handoff { grid-area: handoff; align-self: center; margin: 0; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .dialog-actions { grid-area: other; margin: 0; }
  #dialog:has(.voyage-handoff[data-kind="fireflies"]) .result-activity-footer { grid-area: activity; margin: 0; border: 0; padding: 0; }
  #dialog[data-kind="birdwatch-result"] .voyage-handoff[data-kind="birdwatch"] {
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); margin: 1px 0;
  }
  #dialog[data-kind="birdwatch-result"] .voyage-handoff[data-kind="birdwatch"] .voyage-handoff-foot {
    border-top: 0; border-inline-start: 1px dashed #9cae95;
  }
  #dialog[data-kind="voyage-airdrop"] .dialog-content { display: grid; grid-template-columns: auto auto; align-items: center; gap: 6px; }
  #dialog[data-kind="voyage-airdrop"] :is(.voyage-brief-head, .voyage-handoff) { grid-column: 1 / -1; }
  #dialog[data-kind="voyage-airdrop"] :is(.voyage-handoff, .dialog-actions, .result-activity-footer) { margin-block: 0; }
  #dialog[data-kind="voyage-airdrop"] .result-activity-footer { border: 0; padding: 0; }
}

@media (orientation: landscape) and (max-height: 375px) {
  .voyage-sheet:not(.voyage-patrol-sheet) {
    display: grid;
    padding-block: 6px;
    grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
    grid-template-areas: "intro intro" "choices choices" "note itinerary" "footer itinerary" "report itinerary";
    align-content: start;
    gap: 4px 12px;
  }
  .voyage-sheet:not(.voyage-patrol-sheet) > header { grid-area: intro; }
  .voyage-sheet > .voyage-choices { grid-area: choices; }
  .voyage-sheet:not(.voyage-patrol-sheet) > .voyage-route-note { grid-area: note; margin: 2px 0 0; }
  .voyage-sheet > .voyage-itinerary { grid-area: itinerary; align-content: start; }
  .voyage-sheet:not(.voyage-patrol-sheet) > .voyage-log-footer { grid-area: footer; margin-top: 0; }
  .voyage-sheet:not(.voyage-patrol-sheet) > .voyage-report { grid-area: report; margin-top: 2px; padding: 5px 7px; font-size: 11px; line-height: 1.4; }
}

@media (orientation: landscape) and (max-height: 310px) {
  #dialog[data-kind="voyage-log"]:has(.voyage-patrol-sheet) .voyage-directory { gap: 4px; padding: 6px; }
  #dialog[data-kind="voyage-log"]:has(.voyage-patrol-sheet) .voyage-tab { min-height: 44px; padding: 5px 7px; gap: 2px; }
  #dialog[data-kind="voyage-log"]:has(.voyage-patrol-sheet) .voyage-tab b { font-size: 13px; line-height: 1.18; }
  #dialog .voyage-patrol-sheet { padding-block: 6px; }
  #dialog .voyage-patrol-sheet .voyage-route-note { margin: 3px 0; line-height: 1.3; }
  #dialog .voyage-patrol-sheet .voyage-log-footer { margin-top: 3px; padding-top: 3px; }
  #dialog:has(.voyage-patrol-strip) .voyage-brief-head {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 47px; padding-block: 4px;
  }
  #dialog:has(.voyage-patrol-strip) .voyage-brief-head h2 { margin: 0; }
  #dialog:has(.voyage-patrol-strip) .voyage-brief-location > div { display: flex; align-items: baseline; gap: 7px; }
  #dialog:has(.voyage-patrol-strip) .voyage-brief-hint { font-size: 13px; line-height: 1.45; margin: 4px 0 5px; }
  #dialog:has(.voyage-patrol-strip) .voyage-brief-body { padding-block: 6px; }
  #dialog:has(.voyage-patrol-strip) .voyage-receipt { padding-bottom: 5px; }
  #dialog:has(.voyage-patrol-strip) .voyage-receipt > header { margin-bottom: 5px; }
  #dialog:has(.voyage-patrol-strip) .voyage-receipt .voyage-report { padding-block: 5px; }
  #dialog:has(.voyage-patrol-strip) .voyage-receipt footer { margin-top: 5px; padding-top: 5px; }
  #dialog[data-kind="birdwatch-result"]:has(.voyage-handoff) .dialog-content { padding-block: 6px; row-gap: 5px; }
  #dialog[data-kind="birdwatch-result"]:has(.voyage-handoff) .bird-plate { min-height: 60px; }
}
