.festival-overlay:has(#festival-postal-hud:not([hidden])) > .festival-card { display: none; }
#festival-postal-hud {
  width: min(100%, 244px);
  background: #23373cf5;
  color: #fff0d1;
  border: 1px solid #dabb88;
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 2px 0 #17292e94;
  font-size: 12px;
  line-height: 1.2;
}
.postal-live-head {
  display: flex; align-items: center; gap: 5px;
  min-height: 26px; padding: 3px 7px;
  background: #334b4f; border-bottom: 1px solid #ccb68355;
}
.postal-live-head > b {
  color: #24353a; background: var(--bay-color); border-radius: 3px; padding: 2px 3px; font-size: 11px;
}
.postal-live-head strong { font-size: 12px; }
.postal-live-head small { margin-left: auto; white-space: nowrap; color: #eed7ac; font-weight: 800; font-variant-numeric: tabular-nums; }
.postal-live-body { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 6px 1px; gap: 7px; }
.postal-route-map { width: 100%; max-height: 65px; overflow: visible; }
.postal-route-track, .postal-route-set { fill: none; stroke-width: 2.5px; stroke-linecap: round; }
.postal-route-track { stroke: #68787c; }
.postal-route-set { stroke: #e3bd7d; }
.postal-map-target { fill: none; stroke: #fff2c8; stroke-width: 1px; }
.postal-map-point circle { fill: #24373c; stroke: #b8c4b9; stroke-width: 1px; }
.postal-map-point text { fill: #fff0cc; text-anchor: middle; font: bold 8px system-ui,sans-serif; }
.postal-map-point.due circle { fill: #f7d38b; stroke: #ffe2a8; }
.postal-map-point.due text { fill: #283a3c; }
.postal-map-name { fill: #f2e5c9; font: bold 9px system-ui,sans-serif; }
.postal-live-readout { display: grid; gap: 4px; border-left: 1px solid #ebd6a93a; padding-left: 6px; }
.postal-hud-switches { display: flex; gap: 3px 6px; flex-wrap: wrap; font-size: 11px; }
.postal-hud-switches > span { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.postal-hud-switches em { font: 800 10px/1.3 system-ui; border: 1px solid #8fa6a5; padding: 0 3px; border-radius: 3px; }
.postal-hud-switches [data-next] em { background: #ffdb92; color: #27393a; border-color: #ffdb92; }
.postal-next { font-size: 11px; color: #bdcec5; }
.postal-next strong { color: #fff1cd; }
.postal-wrong { color: #ffbb9c; font-size: 11px; }
.postal-lineup { padding: 4px 7px; background: #293d41; border-top: 1px solid #dcc69340; display: flex; align-items: center; gap: 5px; font: 700 11px/1.2 system-ui,sans-serif; color: #c9d6cd; }
.postal-queue { white-space: nowrap; }
.postal-queue i { font-style: normal; padding: 0 1px; color: #97aca5; }
.postal-park { margin-left: auto; }
.postal-park b { color: #ffe1a1; }

#dialog:is([data-kind="postal-brief"], [data-kind="postal-result"]) { width: min(730px, calc(100% - var(--phone-left, 14px) - var(--phone-right, 14px))); }
#dialog:is([data-kind="postal-brief"], [data-kind="postal-result"]) .dialog-close,
#dialog [data-action="festival-postal-brief"] { min-width: 44px; min-height: 44px; }
#dialog[data-kind="postal-brief"] { background: #fbf4df; border-color: #314c4f; }
#dialog[data-kind="postal-brief"] .dialog-content { padding: clamp(14px, 2.7vw, 24px); }
.postal-brief header { padding-right: 48px; margin-bottom: 12px; }
#dialog .postal-brief h2 { margin: 0; color: #203c41; font-size: clamp(25px,3.7vw,37px); }
#dialog .postal-brief header p { margin: 3px 0 0; color: #475959; font-size: 13px; line-height: 1.45; }
.postal-brief-layout { display: grid; grid-template-columns: minmax(0,.86fr) minmax(0,1.24fr); align-items: stretch; gap: 10px; }
.postal-diagram {
  display: block; width: 100%; height: 100%; min-height: 100px; padding: 5px;
  border: 2px solid #425d5c; border-radius: 10px; background: #263c42;
}
.postal-diagram path { stroke-width: 3px; }
.postal-diagram path:first-child { stroke-width: 7px; }
.postal-diagram .postal-map-point text { font-size: 9px; }
.postal-guide-names { fill: #fff0d2; font: 800 10.5px system-ui,sans-serif; }
.postal-shifts { display: grid; gap: 7px; }
.postal-shift {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 6px;
  padding: 10px 9px; border: 1px solid #bbbfaa; border-radius: 8px; background: #f5efdc;
}
.postal-shift[data-featured] { border-color: #859992; background: #e9eddb; }
.postal-shift h3 { margin: 0 0 2px; font-size: 16px; line-height: 1.15; color: #274246; }
#dialog .postal-shift p, .postal-shift small { margin: 0; font-size: 12px; line-height: 1.4; color: #465856; }
.postal-shift small { display: block; margin-top: 2px; color: #61533a; font-size: 11px; }
.postal-shift button {
  min-width: 54px; min-height: 44px; padding: 5px 10px; border: 1px solid #2e5655; border-radius: 7px;
  background: #355d5a; color: #fff4d5; font-weight: 850; box-shadow: 0 2px 0 #23403e;
}
.postal-shift button:hover, .postal-shift button:focus-visible { background: #284e4b; outline-color: #b6813f; }
#dialog[data-kind="postal-brief"] .dialog-actions:empty { display: none; }

.postal-result > header { padding-right: 44px; }
#dialog .postal-result h2 { margin-bottom: 6px; }
.postal-result-order { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.postal-bay { display: inline-flex; align-items: center; gap: 4px; min-height: 21px; padding: 1px 6px; border-radius: 4px; background: #2d4247; color: #fff2d8; font-size: 11px; font-weight: 800; white-space: nowrap; }
.postal-bay > b { color: var(--bay-color); }
.postal-result-order .postal-bay + .postal-bay::before { content: '›'; color: #9cab9f; }
.postal-result-order[data-freight] { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.postal-result-order[data-freight] .postal-bay { gap: 3px; }
.postal-result-order[data-freight] .postal-bay + .postal-bay::before { content: none; }
.postal-bay i { color: #ddd2ad; font: 700 10px system-ui; }
.postal-bay strong { flex: 1; font-size: 11px; }
.postal-result-metrics { display: grid; grid-template-columns: repeat(var(--stat-count), minmax(0, 1fr)); gap: 5px; margin: 12px 0 0; }
.postal-result-metrics div { padding: 6px 8px; background: #edefde; border: 1px solid #bccab8; border-radius: 7px; }
.postal-result-metrics dt { color: #4a605c; font-size: 12px; }
.postal-result-metrics dd { margin: 2px 0 0; color: #294644; font-weight: 900; font-variant-numeric: tabular-nums; }
#dialog .postal-result-credit { display: flex; align-items: center; gap: 5px; margin: 7px 0 0; font-weight: 800; }
.postal-result-credit svg { width: 16px; height: 16px; color: #966135; }
#dialog:is([data-kind="postal-brief"], [data-kind="postal-result"]) .dialog-actions button { min-height: 44px; }

@media (orientation: landscape) and (max-height: 480px) {
  #festival-postal-hud { width: min(100%, 224px); }
  .postal-live-head { min-height: 21px; padding: 2px 5px; }
  .postal-route-map { height: 54px; }
  .postal-live-body { grid-template-columns: 92px 1fr; gap: 3px; }
  .postal-hud-switches { gap: 3px; }
  .postal-lineup { padding: 3px 5px; }
  .festival-overlay:has(#festival-postal-hud:not([hidden])) { gap: 2px; }
  #dialog[data-kind="postal-brief"] .dialog-content { padding: 9px 14px 12px; }
  .postal-brief header { margin-bottom: 6px; }
  #dialog .postal-brief h2 { font-size: 25px; }
  #dialog .postal-brief header p { font-size: 11px; }
  .postal-shift { padding: 4px 7px; }
  .postal-shift h3 { font-size: 14px; }
  #dialog .postal-shift p { font-size: 11px; line-height: 1.25; }
  #dialog:is([data-kind="postal-brief"], [data-kind="postal-result"]) .dialog-actions { margin-top: 6px; }
  .postal-result-metrics { margin-top: 6px; }
}
@media (orientation: portrait) and (max-width: 480px) {
  .postal-brief-layout { grid-template-columns: 1fr; }
  .postal-diagram { height: 118px; }
  .postal-result-order[data-freight] { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
