:root {
  --ink: #0a0d0c;
  --panel: #11161a;
  --panel-edge: #1c252b;
  --amber: #ffb02e;
  --amber-dim: #8a5e17;
  --cyan: #4fd9d4;
  --paper: #d8e2e0;
  --paper-dim: #6f8480;
  --danger: #ff5d5d;
  --mono: 'JetBrains Mono', 'Consolas', monospace;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  overflow: hidden;
}

#app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh; /* fallback for browsers that don't support dvh */
  height: 100dvh; /* accounts for mobile Safari's address bar — 100vh assumes
                      it's hidden, which pushes content (like the footer's
                      speed buttons) below the actually-visible area with no
                      way to scroll to it, since this layout deliberately
                      disables page scrolling */
}

/* ---------- Header / Tape ---------- */

#tape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-edge);
  font-family: var(--display);
}

#tape .brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#tape .brand .mark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--amber);
  text-transform: uppercase;
  text-decoration: none;
}
a.mark:hover { color: #ffc158; }

/* Route name on the shared page — same size/weight as the brand mark
   above, but white, so it echoes the "Drop your" (white) + "GPS logs"
   (amber) pairing on the upload page. */
#tape .brand .trip-name { color: var(--paper); font-size: 22px; margin-left: 28px; }

#tape .brand .sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

#tape .rec {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 1px;
}

.tape-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---------- Segmented control (map style) ---------- */

.seg-group {
  display: flex;
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  overflow: hidden;
}

.segbtn {
  background: #161d22;
  border: none;
  border-right: 1px solid var(--panel-edge);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
}

.segbtn:last-child { border-right: none; }

.segbtn.active {
  background: rgba(255,176,46,0.12);
  color: var(--amber);
}

.segbtn:hover:not(.active) { color: var(--paper); }

.statsbtn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #161d22;
  border: 1px solid var(--panel-edge);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}

.statsbtn svg { width: 13px; height: 13px; }

.statsbtn:hover { color: var(--paper); }

.statsbtn.active {
  background: rgba(255,176,46,0.12);
  border-color: var(--amber);
  color: var(--amber);
}

/* When a light basemap is active, dim the HUD/markers slightly less harshly */
body.light-basemap .leaflet-control-attribution {
  background: rgba(255,255,255,0.7) !important;
  color: #555 !important;
}

#tape .rec .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-dim);
}

#tape .rec.live .dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Main stage ---------- */

#stage {
  position: relative;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  background: #0d1113;
}

/* Leaflet dark tuning */
.leaflet-container { background: #0d1113; }
.leaflet-control-attribution {
  background: rgba(10,13,12,0.7) !important;
  color: var(--paper-dim) !important;
  font-family: var(--mono);
  font-size: 10px;
}
.leaflet-control-attribution a { color: var(--cyan) !important; }
.leaflet-bar a {
  background: var(--panel) !important;
  color: var(--paper) !important;
  border-color: var(--panel-edge) !important;
}
.leaflet-bar a:hover { background: #1a2329 !important; color: var(--amber) !important; }

/* Car marker */
.car-icon {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 6px rgba(79,217,212,0.65));
}

/* Day flag markers */
.day-flag {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid #1a1206;
  color: #1a1206;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.leaflet-tooltip.leaflet-tooltip-top {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  border-radius: 2px;
}

/* ---------- Drop zone overlay ---------- */

#dropzone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(20,28,30,0.92), rgba(8,10,10,0.97));
  z-index: 1200;
  transition: opacity 0.25s ease;
}

#shareBtn.hidden { display: none; }
#shareBtn.working { opacity: 0.6; pointer-events: none; }
#shareBtn.done { color: #4fd9d4; }
#dropzone.hidden { display: none; }

/* --- Shared/read-only trip view (trip.html) --- */
body.shared-view #app { grid-template-rows: auto 1fr auto; }

/* Floating map-style switcher, present on both the upload page and the
   shared trip page — z-index follows the same reasoning as the About/Tips
   buttons: Leaflet's own panes/controls go up to z-index 1000, and #map
   doesn't isolate its own stacking context, so anything meant to sit
   above the map needs to clear that bar. */
#mapStyleGroup {
  position: absolute; top: 16px; right: 16px; z-index: 1500;
  background: rgba(10,14,13,0.72); backdrop-filter: blur(2px);
}

.segbtn.locked { opacity: 0.55; cursor: pointer; }
.segbtn.locked:hover { opacity: 0.85; }
.segbtn .lock { font-size: 9px; margin-left: 2px; }

#mapStyleUnlockPrompt {
  position: absolute; top: 54px; right: 16px; z-index: 1501;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 4px;
  padding: 9px 12px; font-family: var(--mono); font-size: 0.78rem; color: var(--paper-dim);
  max-width: 260px; text-align: right;
}
#mapStyleUnlockPrompt.hidden { display: none; }
#mapStyleUnlockPrompt a { color: var(--amber); text-decoration: none; }
#mapStyleUnlockPrompt a:hover { text-decoration: underline; }

#tripLoadingOverlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: #8a99a0; background: #10181a; z-index: 5;
}
#tripLoadingOverlay.hidden { display: none; }

.tape-right-simple { display: flex; align-items: center; gap: 10px; }

#createOwnLink {
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber); color: #1a1200;
  font-family: var(--display); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 8px 16px; border-radius: 4px;
}
#createOwnLink:hover { background: #ffc158; }

#dropzone .card {
  width: min(480px, 86vw);
  border: 1px dashed var(--panel-edge);
  border-radius: 4px;
  padding: 36px 30px;
  text-align: center;
  background: rgba(17,22,26,0.6);
}

#dropzone .card.drag {
  border-color: var(--amber);
  background: rgba(255,176,46,0.06);
}

#dropzone h1 {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.5px;
  color: var(--paper);
  margin: 0 0 6px;
  text-transform: uppercase;
}

#dropzone h1 span { color: var(--amber); }

#dropzone p {
  font-size: 12px;
  color: var(--paper-dim);
  line-height: 1.6;
  margin: 0 0 20px;
}

#dropzone .formats {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--paper-dim);
  text-transform: uppercase;
  margin-bottom: 20px;
}

#dropzone .formats code {
  color: var(--cyan);
  background: rgba(79,217,212,0.08);
  padding: 1px 5px;
  border-radius: 2px;
}

#fileBtn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--amber);
  color: #1a1206;
  border: none;
  padding: 11px 22px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: 700;
}

#fileBtn:hover { background: #ffc266; }

#dropzone .error {
  margin-top: 14px;
  font-size: 11px;
  color: var(--danger);
  min-height: 14px;
}

#fileInput { display: none; }

/* ---------- HUD telemetry overlay ---------- */

#hud {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 800;
  background: rgba(10,14,13,0.72);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 12px 16px;
  pointer-events: none;
  backdrop-filter: blur(2px);
  min-width: 200px;
}

#hud.hidden { display: none; }

/* ---------- Stats panel ---------- */

#statsPanel {
  position: absolute;
  top: 60px;
  right: 16px;
  z-index: 800;
  background: rgba(10,14,13,0.86);
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 14px 18px;
  backdrop-filter: blur(2px);
  min-width: 230px;
  max-width: 280px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
}

#statsPanel.hidden { display: none; }

.stats-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 0.3px;
}

.stat b {
  color: var(--paper);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}

.stats-subtitle {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-edge);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin-bottom: 8px;
}

.stats-days {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stats-day-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--paper-dim);
}

.stats-day-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stats-day-label {
  color: var(--paper);
  min-width: 52px;
}

.stats-day-val {
  color: var(--paper-dim);
  font-size: 10px;
  margin-left: auto;
  text-align: right;
}

.stats-empty {
  font-size: 11px;
  color: var(--paper-dim);
}

#hud .speed-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

#hud .speed-val {
  font-family: var(--display);
  font-size: 40px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
}

#hud .speed-unit {
  font-size: 11px;
  color: var(--paper-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.unit-seg {
  pointer-events: auto;
  align-self: center;
}

.unit-seg .segbtn {
  font-size: 10px;
  padding: 5px 8px;
}

#hud .row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 11px;
  color: var(--paper-dim);
  letter-spacing: 0.5px;
  margin-top: 3px;
}

#hud .row b { color: var(--paper); font-weight: 500; }

#hud .timestamp {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-edge);
  font-size: 13px;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

/* ---------- Transport controls ---------- */

#transport {
  background: var(--panel);
  border-top: 1px solid var(--panel-edge);
  padding: 10px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#transport.disabled { display: none; }

#scrubRow {
  display: flex;
  align-items: center;
  gap: 12px;
}

#scrub {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--panel-edge);
  border-radius: 2px;
  outline: none;
}

#scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255,176,46,0.18);
}

#scrub::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: none;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
}

.timecode {
  font-size: 12px;
  color: var(--paper-dim);
  min-width: 62px;
  text-align: center;
  letter-spacing: 0.5px;
}

#controlsRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-group {
  display: flex;
  gap: 6px;
}

.iconbtn {
  background: #161d22;
  border: 1px solid var(--panel-edge);
  color: var(--paper);
  width: 38px;
  height: 38px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

.iconbtn:hover { border-color: var(--cyan); color: var(--cyan); }

.iconbtn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a1206;
  width: 46px;
  height: 46px;
}

.iconbtn.primary:hover { background: #ffc266; border-color: #ffc266; color: #1a1206; }

.iconbtn svg { width: 16px; height: 16px; }
.iconbtn.primary svg { width: 18px; height: 18px; }

#speedGroup {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--paper-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.speedbtn {
  background: #161d22;
  border: 1px solid var(--panel-edge);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}

.speedbtn.active {
  background: rgba(79,217,212,0.1);
  border-color: var(--cyan);
  color: var(--cyan);
}

.rate-input {
  width: 88px;
  background: #161d22;
  border: 1px solid var(--panel-edge);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 3px;
}

.rate-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.rate-input::placeholder { color: var(--paper-dim); }

/* Hide native spinner arrows for a cleaner look */
.rate-input::-webkit-outer-spin-button,
.rate-input::-webkit-inner-spin-button { opacity: 0.5; }

#followToggle,
#smoothToggle,
#revealToggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--paper-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
}

#followToggle input,
#smoothToggle input,
#revealToggle input { accent-color: var(--cyan); }

#loadAnotherBtn {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}

#loadAnotherBtn:hover { color: var(--paper); border-color: var(--paper-dim); }

/* ---------- Day jump row ---------- */

#dayRow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 2px;
}

#dayRow.hidden { display: none; }

.daybtn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #161d22;
  border: 1px solid var(--panel-edge);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}

.daybtn:hover { border-color: var(--amber); color: var(--paper); }

.daybtn-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  color: #1a1206;
  font-weight: 700;
  font-size: 10px;
}

.day-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #161d22;
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  padding: 0 4px 0 0;
}

.day-group .daybtn {
  background: none;
  border: none;
  border-radius: 3px 0 0 3px;
}

.day-swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--panel-edge);
  border-radius: 50%;
  padding: 0;
  background: none;
  cursor: pointer;
}

.day-swatch::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.day-swatch::-webkit-color-swatch { border: none; border-radius: 50%; }
.day-swatch::-moz-color-swatch { border: none; border-radius: 50%; }

@media (max-width: 640px) {
  #hud { left: 10px; top: 10px; min-width: 160px; padding: 9px 12px; }
  #hud .speed-val { font-size: 30px; }
  #statsPanel { right: 10px; top: 54px; min-width: 180px; max-width: 220px; padding: 11px 14px; }
  #tape .sub { display: none; }
  #tape { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .tape-right { width: 100%; justify-content: space-between; }
  .segbtn { padding: 5px 7px; font-size: 9px; }
  #controlsRow { gap: 8px; }
  #speedGroup { order: 3; width: 100%; justify-content: flex-start; }

  /* The header and footer both grow with wrapped content on a narrow
     screen — without a floor on the map area, a tall footer (lots of
     controls wrapping to several rows) can squeeze #stage down to almost
     nothing. Guarantee the map keeps a real minimum share of the screen,
     and let the footer scroll within itself instead. */
  #stage { min-height: 38vh; min-height: 38dvh; }
  #transport { max-height: 42vh; max-height: 42dvh; overflow-y: auto; }
  html, body { overflow-y: auto; overflow-x: hidden; } /* defensive fallback — #transport's own scroll is the primary mechanism, this just ensures nothing can ever become permanently unreachable */

  /* Route name + distance in the header is sized to match the brand mark
     on desktop — far too wide for a phone screen alongside everything
     else in the header. Let it wrap onto its own line, smaller. */
  #tape .brand .trip-name { font-size: 15px; margin-left: 0; display: block; width: 100%; }

  /* Four map-style buttons at full desktop size don't fit a phone's width. */
  #mapStyleGroup { flex-wrap: wrap; max-width: calc(100vw - 32px); height: auto; }
  #mapStyleGroup .segbtn { padding: 5px 8px; font-size: 8px; }

  /* Icon-only on mobile — text labels alongside everything else in the
     header don't leave enough room and cause awkward wrapping. */
  #statsToggle, #shareBtn, a[href="/my-trips"].statsbtn { padding: 7px 9px; }
  .btn-label, #shareBtnLabel { display: none; }
}

@media (max-width: 400px) {
  /* Very narrow phones need one more notch down. */
  #dropzone h1 { font-size: 22px; }
  #dropzone .card { padding: 28px 18px; }
  .statsbtn, #createOwnLink { font-size: 9px; padding: 6px 8px; }
  #utilityBar { bottom: 12px; right: 12px; }
}

/* Generic hidden utility — placed last so it wins the cascade over any
   earlier display rule for the same element (e.g. .statsbtn's display:flex).
   The one-off #id.hidden rules above predate this and are now redundant
   but harmless. */
.hidden { display: none !important; }

/* ---------- About button + modal (injected by about.js) ---------- */
/* z-index is intentionally high (5000+) — Leaflet's own internal panes and
   controls go up to z-index 1000 (see node_modules/leaflet/dist/leaflet.css),
   and neither #app, #stage, nor #map establishes its own isolated stacking
   context, so anything meant to sit above the map needs to clear that bar.
   #dropzone (z-index 1200) is the existing precedent for this in this file. */
#utilityBar {
  position: fixed; right: 16px; bottom: 16px; z-index: 5000;
  display: flex; gap: 8px;
}
/* On pages with a footer controls row (index.html, trip.html), the bar
   lives inline in that row's normal document flow instead of floating
   fixed over the viewport — this guarantees it stays aligned with Load
   Another File regardless of footer height or scroll state, rather than
   an earlier attempt at fixed-position offsets that could drift and
   overlap other footer content depending on how much was visible. */
#utilityBar.in-footer { position: static; z-index: auto; }
#aboutBtn, #tipsBtn {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}
#aboutBtn:hover, #tipsBtn:hover { color: var(--paper); border-color: var(--paper-dim); }

#aboutOverlay {
  position: fixed; inset: 0; z-index: 5001;
  background: rgba(5,8,8,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#aboutOverlay.hidden { display: none; }

#aboutModal {
  position: relative;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px;
  max-width: 440px; width: 100%; padding: 28px 24px 22px;
  font-family: var(--mono); color: var(--paper);
}
#aboutModal h2 {
  font-family: var(--display); text-transform: uppercase; color: var(--amber);
  font-size: 1.3rem; margin: 0 0 12px;
}
#aboutModal h3 {
  font-family: var(--display); text-transform: uppercase; color: var(--paper-dim);
  font-size: 0.9rem; margin: 22px 0 10px; letter-spacing: 0.03em;
}
#aboutModal p { font-size: 0.88rem; line-height: 1.5; color: var(--paper-dim); margin: 0; }

#aboutCloseBtn {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--paper-dim);
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px;
}
#aboutCloseBtn:hover { color: var(--paper); }

#feedbackForm { display: flex; flex-direction: column; gap: 8px; }
#feedbackMessage, #feedbackEmail {
  width: 100%; background: #0d1113; border: 1px solid var(--panel-edge); color: var(--paper);
  font-family: var(--mono); font-size: 0.85rem; padding: 9px 11px; border-radius: 4px;
  box-sizing: border-box; resize: vertical;
}
#feedbackSubmitBtn {
  align-self: flex-start;
  background: var(--amber); color: #1a1200; border: none;
  font-family: var(--display); font-weight: 700; font-size: 0.8rem; text-transform: uppercase;
  padding: 9px 16px; border-radius: 4px; cursor: pointer;
}
#feedbackSubmitBtn:disabled { opacity: 0.5; cursor: default; }
#feedbackMsg { font-size: 0.8rem; }
#feedbackMsg.ok { color: #7fdd8f; }
#feedbackMsg.error { color: var(--danger); }

/* ---------- Tips button + modal (injected by tips.js) ---------- */
#tipsOverlay {
  position: fixed; inset: 0; z-index: 5001;
  background: rgba(5,8,8,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
#tipsOverlay.hidden { display: none; }

#tipsModal {
  position: relative;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 6px;
  max-width: 480px; width: 100%; padding: 28px 24px 22px;
  font-family: var(--mono); color: var(--paper);
  max-height: 80vh; overflow-y: auto;
}
#tipsModal h2 {
  font-family: var(--display); text-transform: uppercase; color: var(--amber);
  font-size: 1.3rem; margin: 0 0 12px;
}
#tipsModal h3 {
  font-family: var(--display); text-transform: uppercase; color: var(--paper-dim);
  font-size: 0.85rem; margin: 20px 0 8px; letter-spacing: 0.03em;
}
#tipsModal h3:first-of-type { margin-top: 0; }

#tipsCloseBtn {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--paper-dim);
  font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px;
}
#tipsCloseBtn:hover { color: var(--paper); }

.tips-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.tips-table td { padding: 5px 0; vertical-align: top; }
.tips-table td:first-child { color: var(--cyan); white-space: nowrap; padding-right: 14px; width: 1%; }
.tips-table td:last-child { color: var(--paper-dim); line-height: 1.4; }
.tips-table kbd {
  background: #0d1113; border: 1px solid var(--panel-edge); border-radius: 3px;
  padding: 2px 7px; font-family: var(--mono); font-size: 0.8rem; color: var(--paper);
}
