



@font-face {
  font-family: "Playfair Display";
  src: url("fonts/PlayfairDisplay-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-VF.woff2") format("woff2-variations");
  font-weight: 300 800;
  font-display: swap;
}







:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  --bar-h: calc(58px + var(--sat));



  --room-top: calc(var(--bar-h) + 12px);


  --notice-top: calc(var(--bar-h) + 12px);
}

main {
  position: fixed;
  inset: 0;
}

#map-pane {
  position: absolute;
  inset: 0;


  touch-action: pan-x pan-y;
}



#chip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#map { position: relative; }

#streaks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;

  opacity: var(--weather-share, 1);
}


#bolts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}



#panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(380px, 100vw);
  z-index: 40;
  overflow-y: auto;
  background: var(--bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--bar-shadow);
  padding: calc(22px + var(--sat)) 26px calc(30px + var(--sab)) calc(26px + var(--sal));
  transform: translateX(-102%);
  transition: transform 160ms ease-out;
}

#panel.open { transform: none; }

@media (prefers-reduced-motion: reduce) {
  #panel { transition: none; }
}



body.planning-new :is(#move-points, #edit-route, #fit-route, #watch-route, #partial-bar) { display: none; }




.round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 0;
  background: var(--bg);
  color: var(--accent-dark);
  box-shadow: var(--bar-shadow);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.round:hover { border-color: var(--accent); color: var(--accent); }
.round:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#round-buttons {
  position: absolute;
  top: calc(12px + var(--sat));
  left: calc(12px + var(--sal));
  z-index: 30;
}

#map-controls { top: calc(12px + var(--sat)); right: calc(11px + var(--sar)); gap: 4px; }
#map-controls button { width: 40px; height: 40px; font-size: 20px; }


#my-position[hidden] { display: none; }
#my-position svg { display: block; margin: auto; }

#drawer-close {
  background: var(--bg);
  color: var(--muted);
  box-shadow: none;
  width: 32px;
  height: 32px;
  font-size: 18px;
}



#appbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + var(--sat)) calc(64px + var(--sar)) 8px calc(12px + var(--sal));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--bar-shadow);
}

#appbar .round { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent-dark); font-size: 22px; }
#appbar .round:hover { background: var(--bg-soft); }

.appbar-text { flex: 1; min-width: 0; text-align: center; }


#appbar-title { font-weight: 700; font-size: 16px; line-height: 1.3; color: var(--ink);
                overflow-wrap: break-word; }
#appbar-sub { font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: break-word; }
#appbar-sub .sub-part { white-space: nowrap; }



@media (min-width: 601px) {
  main:has(> #panel.open) #appbar { padding-left: calc(392px + var(--sal)); }
}

#appbar:not([hidden]) ~ #round-buttons { display: none; }
#appbar:not([hidden]) ~ #map-controls { top: calc(var(--bar-h) + 12px); }



.faces {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  padding: 2px;
}

#appbar:not(.route) .faces { display: none; }

.faces button {
  border: none;
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  padding: 5px 14px;
}

.faces button[aria-pressed="true"] {
  background-color: var(--accent);
  color: var(--bg);
}



#layer-panel {
  position: absolute;
  right: calc(11px + var(--sar));
  bottom: calc(92px + var(--tl-extra, 0px) + var(--sab));
  z-index: 20;
  width: 44px;
  padding: 8px 0;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--accent-dark);
  box-shadow: var(--bar-shadow);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#streaks-toggle {
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-size: 20px;
  padding: 0 4px;
}

#streaks-toggle[aria-pressed="false"] { opacity: .45; }

#streaks-toggle { min-width: 26px; }
#streaks-toggle svg { width: 16px; height: 16px; vertical-align: middle; }

#layer-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--accent-dark);
  font-size: 10px;
  line-height: 1.2;
  padding: 0 2px;
  letter-spacing: .04em;
}

#layer-pick svg { display: block; }
#layer-pick.with-satellite svg { color: var(--accent); }
#layer-pick:focus-visible, #streaks-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }



#layer-picker {
  position: absolute;
  right: calc(63px + var(--sar));
  bottom: calc(92px + var(--tl-extra, 0px) + var(--sab));
  z-index: 35;
  min-width: 150px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--bg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;

  max-height: calc(100% - 92px - var(--tl-extra, 0px) - var(--sab) - var(--bar-h) - 12px);
  overflow-y: auto;
}
#layer-picker > * { flex: none; }

#layer-picker button {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 20px 0 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
}

#layer-picker button:hover, #layer-picker button:focus-visible { background: var(--bg-soft); color: var(--accent-dark); outline: none; }
#layer-picker button[aria-checked="true"] { font-weight: 700; }
#layer-picker .lp-tick { display: inline-block; width: 22px; color: var(--accent); }
#layer-picker hr { width: 100%; margin: 4px 0; border: none; border-top: 1px solid var(--border); }

#layer-picker .lp-sat { display: flex; align-items: center; gap: 2px; }
#layer-picker .lp-sat-name { flex: 1; padding: 0 8px 0 28px; font-size: 15px; }
#layer-picker .lp-sat button { justify-content: center; min-width: 44px; padding: 0 9px; border: 1px solid transparent; }
#layer-picker .lp-sat button[aria-checked="true"] { border-color: var(--chrome-line, var(--border)); }
#layer-picker .lp-sat-note { max-width: 210px; margin: 0 0 4px; padding: 0 8px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.4; }


#field-note, #here-note, #obs-note, #ascat-note, #lightning-note, #locate-box {
  position: absolute;
  top: var(--room-top);
  left: calc(12px + var(--sal));
  right: calc(64px + var(--sar));
  max-width: 460px;
  z-index: 29;
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-card);
  background: var(--bg);
  box-shadow: var(--card-shadow);
  font-size: 14px;
  white-space: pre-line;
}

#locate-box { display: flex; align-items: flex-start; gap: 8px; padding-right: 8px; white-space: normal; }
#locate-box[hidden] { display: none; }
#locate-box .locate-body { flex: 1; min-width: 0; }
#locate-box .locate-body p { margin: 0; }
#locate-box .locate-body p + p { margin-top: 2px; }
#locate-box .locate-close { background: transparent; border: none; color: inherit;
                            font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; }
#field-note .note-line, #field-note .note-rule { display: block; }
#field-note .note-rule { margin-top: 2px; font-size: 12px; color: var(--muted, #656565); }
#field-note .note-about { display: inline-block; margin-top: 4px; padding: 2px 10px; font-size: 12px; background: transparent;
  border: 1px solid var(--border); border-radius: 12px; color: var(--accent-dark); cursor: pointer; }
#field-note .note-rule { margin-top: 6px; }
#field-note.note-tap { cursor: pointer; }
#field-note.note-tap .note-line:first-child::after { content: " \25BE"; color: var(--muted, #656565); }

@media (min-width: 601px) and (min-height: 501px) {
  main:has(> #panel.open) :is(#field-note, #here-note, #obs-note, #ascat-note, #lightning-note, #locate-box) { left: calc(392px + var(--sal)); }
}

#field-note.note-low { top: auto; bottom: calc(var(--timeline-h, 72px) + 84px); }



#partial-bar {
  position: absolute;
  top: var(--room-top);
  left: calc(12px + var(--sal));
  right: calc(64px + var(--sar));

  max-width: 420px;
  z-index: 29;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 8px 10px 14px;
  border-radius: var(--radius-card);
  border-left: 4px solid var(--warning);
  background: var(--bg);
  color: var(--warning);
  box-shadow: var(--card-shadow);
  font-size: 14px;
}



#partial-bar {
  max-height: min(40%, calc(100% - var(--room-top) - 88px - var(--tl-extra, 0px) - var(--sab)));
  overflow-y: auto;
  overscroll-behavior: contain;
}
#partial-bar .partial-body { flex: 1; min-width: 0; }
#partial-bar .partial-details .partial-source { font-size: 12px; color: var(--muted); }
#partial-bar .partial-text { margin: 0; }
#partial-bar .partial-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#partial-bar .partial-actions[hidden] { display: none; }
#partial-bar .partial-details { margin-top: 8px; }
#partial-bar .partial-details[hidden] { display: none; }
#partial-bar .partial-details p { margin: 0 0 6px; }
#partial-bar .partial-actions button { padding: 5px 12px; }
#partial-bar .partial-close { background: transparent; border: none; color: inherit;
                              font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; }
#partial-bar[hidden], #data-face:not([hidden]) ~ #partial-bar { display: none; }



#timeline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  color: var(--body-text);
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: var(--bar-shadow);
}


#timeline::after {
  content: "";
  display: block;
  height: var(--sab);
}

.tl-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal));
}


.tl-hatch {
  overflow: hidden;
  position: absolute;
  top: 50%;
  height: 10px;
  margin-top: -5px;
  pointer-events: none;
  box-sizing: border-box;
  border-radius: 5px;
  font-size: 10px;
  line-height: 10px;
  text-align: center;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-shadow: 0 0 2px var(--bg);
}

.tl-play { flex: none; width: 32px; height: 32px; font-size: 15px; background: transparent; box-shadow: none; }

.tl-track { flex: 1; min-width: 0; accent-color: var(--accent); }
.tl-time { flex: none; min-width: 96px; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }

.tl-step { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; background: transparent; box-shadow: none; }
.tl-step[aria-disabled="true"] { opacity: .45; }



.tl-speed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal));
  transform: translateX(var(--tl-bar-shift, 0px));
}
.tl-speed[hidden] { display: none; }
.tl-speed-step { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; box-shadow: none; }
.tl-speed-step[aria-disabled="true"] { opacity: .45; }
.tl-speed-now { min-width: 64px; font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }

.tl-legend { position: relative; height: 26px; color: var(--muted); }
.tl-legend-bar { position: absolute; left: calc(14px + var(--sal)); right: calc(58px + var(--sar)); top: 0; height: 8px; }
.tl-legend-ticks { position: absolute; left: calc(14px + var(--sal)); right: calc(58px + var(--sar)); top: 9px; height: 15px; }
.tl-legend-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; }
.tl-legend-unit { position: absolute; right: calc(8px + var(--sar)); top: 7px; font-size: 11px; }


.tl-legend.tl-legend-sourced { height: 40px; }
.tl-legend-source { position: absolute; left: calc(14px + var(--sal)); right: calc(8px + var(--sar)); top: 24px;
                    font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#timeline:not([hidden]) ~ .map-credits { bottom: calc(72px + var(--tl-extra, 0px) + var(--sab)); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}








#panel > .brand {
  position: sticky;
  top: calc(-22px - var(--sat));
  z-index: 2;
  background: var(--bg);
  margin-top: calc(-22px - var(--sat));
  padding: calc(22px + var(--sat)) 0 8px;
  margin-bottom: 10px;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand select {
  width: auto;
  margin-left: auto;
  font-size: 12px;
  padding: 4px 6px;
}

h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--ink);
  margin: 0;
}



#tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}


#tabs button {
  flex: 1;
  border: none;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  padding: 8px 0 7px;
  font-size: 13px;
  letter-spacing: .04em;
}

#tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

#tabs button:hover { color: var(--accent); }



details.section > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
}

details.section > summary::-webkit-details-marker { display: none; }

details.section > summary h2 { margin: 22px 0 10px; }

details.section > summary::after {
  content: "";
  margin: 12px 0 0 auto;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  padding: 3.5px;
  transform: rotate(45deg);
}

details.section:not([open]) > summary::after {
  transform: rotate(-45deg);
}

details.section:not([open]) > summary h2 { color: var(--muted); }

.job-bar {
  height: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  margin-top: 6px;
  overflow: hidden;
}

.job-bar div {
  height: 100%;
  background: var(--accent);
}

#mode-row { margin-bottom: 14px; }
#mode-row button { flex: 1; }




#table-sheet { left: 0; right: 0; top: 0; bottom: 0; max-height: none; z-index: 45;
               padding: var(--sat) var(--sar) 0 var(--sal); }


#table-columns { flex: none; max-height: 50%; overflow-y: auto; overscroll-behavior: contain; }
#table-scroll { flex: 1; min-height: 0; }



body.printing #panel,
body.printing #map-controls,
body.printing #wx-bar,
body.printing #boat-box,
body.printing #map-hint,
body.printing #drag-readout,
body.printing #table-sheet { display: none; }





#signin { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
          background: var(--bg);
          padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); }
#signin-form { width: 100%; max-width: 380px; background: var(--bg); padding: 28px;
               border-radius: var(--radius-card); box-shadow: var(--card-shadow); }
#signin-form h1 { margin: 8px 0 10px; }
#signin-form input { width: 100%; }
#signin-form button { margin-top: 14px; width: 100%; }
.signin-badge { width: 56px; height: 56px; }
.signin-error { color: var(--fail); margin: 12px 0 0; }
.signin-note { font-size: 12px; margin-top: 16px; }
.signout { margin-left: auto; font-size: 13px; padding: 4px 10px; }


#route-key { left: calc(12px + var(--sal)); right: auto; top: auto; }
.key-motor { background: var(--data-motor); }



.map-credits { position: absolute; left: calc(8px + var(--sal)); right: calc(64px + var(--sar));
               bottom: calc(4px + var(--sab)); z-index: 21; margin: 0;
               font-size: 10px; line-height: 11px; color: var(--bg);
               text-shadow: 0 0 2px var(--ink), 0 0 1px var(--ink);
               pointer-events: none; }
.map-credits a { color: inherit; pointer-events: auto; }
.map-credits > span:not([hidden]) ~ span:not([hidden])::before { content: " · "; }
main:has(> #panel.open) .map-credits { left: calc(392px + var(--sal)); }


[hidden] { display: none !important; }




#map { touch-action: none; }

#map-controls { align-items: flex-end; }




.map-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px 0 12px;
  border: 2px solid var(--accent);
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  white-space: nowrap;
  box-shadow: var(--bar-shadow);
}


#map-controls .map-pill { width: auto; padding: 0 16px 0 12px; font-size: 12px; }

.map-pill:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.map-pill:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.map-pill svg { display: block; flex: none; }

.map-pill.pulse { animation: pill-pulse 1.6s ease-in-out 3; }

@keyframes pill-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .map-pill.pulse { animation: none; }
}

#move-bar {
  position: absolute;
  top: var(--room-top);
  left: calc(12px + var(--sal));
  right: calc(64px + var(--sar));
  max-width: 460px;
  z-index: 30;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: var(--bg);
  box-shadow: var(--card-shadow);
  font-size: 14px;
}

#move-bar p { margin: 0 0 6px; }
#move-title { font-weight: 700; }
#move-readout { display: flex; flex-wrap: wrap; gap: 4px 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
#move-readout .held { color: var(--ink); font-weight: 700; }
#move-note { color: var(--fail); }
.move-buttons { display: flex; gap: 12px; margin-top: 8px; }






.depth-box { top: auto; right: auto; bottom: max(calc(84px + var(--sab)), var(--key-clear, 0px)); left: calc(12px + var(--sal)); width: 252px;
             max-width: calc(100vw - 64px - 12px - var(--sal) - var(--sar)); }
main:has(> #panel.open) .depth-box { left: calc(392px + var(--sal)); }
@media (max-width: 600px), (pointer: coarse) and (max-height: 500px) {
  .depth-box, main:has(> #panel.open) .depth-box { top: var(--room-top); bottom: auto; left: calc(12px + var(--sal));
                                                   width: min(240px, calc(100vw - 150px - var(--sal) - var(--sar))); }
}
@media (pointer: coarse) and (max-height: 500px) {
  .depth-box, main:has(> #panel.open) .depth-box { left: calc(164px + var(--sal)); width: 230px;
    max-height: calc(100dvh - var(--room-top) - 92px - var(--tl-extra, 0px) - var(--sab)); overflow-y: auto; }
}




#grib-loading {
  position: absolute;
  left: 50%;
  bottom: calc(72px + var(--tl-extra, 0px) + var(--sab) + 8px);
  transform: translateX(-50%);
  z-index: 28;
  padding: 4px 14px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
}
#grib-loading:has(~ #timeline[hidden]) { bottom: calc(16px + var(--sab)); }
#grib-loading[hidden] { display: none; }
#grib-loading .loading-spoken {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.loading-spin {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin .9s linear infinite;
}

@keyframes loading-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .loading-spin { animation-duration: 3s; }
}


.pdf-wrap { position: relative; }

#appbar-pdf {
  border: 2px solid var(--accent);
  border-radius: var(--pill);
  padding: 7px 16px;
  background: var(--accent);
  color: var(--bg);
}

#appbar-pdf:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
#appbar-pdf:disabled { opacity: .6; }

#pdf-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--bg);
  box-shadow: var(--card-shadow);
}

#pdf-menu button {
  border: none;
  background: none;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

#pdf-menu button:hover, #pdf-menu button:focus-visible { background: var(--bg-soft); color: var(--accent-dark); }


.get-app {
  display: inline-block;
  margin: 4px 0 6px;
  padding: 10px 22px;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
}

.get-app:hover { background: var(--accent-dark); }


.min-depth-row { display: flex; align-items: center; gap: 8px; }
.min-depth-row input { width: 90px; }
#min-depth-note.bad, #limits-note.bad, #current-note.bad,
#warn-uncertain-note.bad, #saillogger-note.bad { color: var(--fail); }
#saillogger { display: block; width: 100%; max-width: 260px; box-sizing: border-box; }






#run-box {
  position: absolute;
  left: 50%;
  top: var(--room-top);
  bottom: calc(92px + var(--tl-extra, 0px) + var(--sab));
  height: max-content;
  max-height: calc(100% - var(--room-top) - 92px - var(--tl-extra, 0px) - var(--sab));
  margin: auto 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-50%);
  z-index: 29;
  width: min(380px, calc(100vw - 32px));
  padding: 18px 20px;

  pointer-events: none;
}

.run-top { display: flex; align-items: center; gap: 14px; }
#run-head { font-weight: 700; font-size: 16px; color: var(--ink); }
#run-name { font-size: 13px; color: var(--body-text); margin-top: 2px; }
#run-clock { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.run-row-label { font-size: 13px; margin-top: 12px; }


#run-stage, .trip-box-stage { margin: 14px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink); }
#route-long, #run-long { margin: 8px 0; font-size: 13px; }
#run-aside, .trip-box-aside { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; min-height: calc(2 * 1.45em + 10px); }
.run-bar { height: 6px; margin-top: 4px; border-radius: var(--pill); background: var(--border); overflow: hidden; }
.run-bar span { display: block; height: 100%; border-radius: var(--pill); }
.run-bar .run-bar-wait { width: 30%; animation: run-wait 1.4s ease-in-out infinite alternate; }

@keyframes run-wait { from { margin-left: 0; } to { margin-left: 70%; } }

@media (prefers-reduced-motion: reduce) {
  .run-bar .run-bar-wait { animation: none; width: 100%; opacity: .5; }
}






@media (max-height: 500px) {
  #run-box { width: min(560px, calc(100vw - 340px)); padding: 12px 16px; }
  #run-box .run-error { font-size: 13px; margin: 4px 0 8px; }
}
@media (min-width: 601px) {

  main:has(> #panel.open) :is(#run-box, #grib-loading) { left: calc(50% + 164px + (var(--sal) - var(--sar)) / 2); }
  main:has(> #panel.open) #run-box { width: min(380px, calc(100vw - 392px - 76px - var(--sal) - var(--sar))); }
}



#run-box.run-failed { pointer-events: auto; }
#run-box.run-failed .loading-spin { display: none; }
#run-box .run-error { margin: 6px 0 10px; font-size: 14px; line-height: 1.4; white-space: normal; }
#run-box .run-actions { display: flex; gap: 8px; }
#run-box .run-clockrow { display: flex; align-items: center; gap: 10px; }
#run-box #run-cancel { font: inherit; font-size: 13px; padding: 0 4px; border: 0; background: none; text-decoration: underline; cursor: pointer; white-space: nowrap; }
#run-box #run-cancel[hidden] { display: none; }

#run-box #run-cancel { pointer-events: auto; }


.hatch-fill { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
