*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #141416;
  --panel:   #1e2024;
  --border:  rgba(255,255,255,0.14);
  --accent:  #00e5ff;
  --red:     #ff3d71;
  --green:   #39ff14;
  --dim:     #aaa;
  --mid:     #bbb;
  --text:    #f0f0f0;
  --sans:    'DM Sans', sans-serif;
  --mono:    'DM Mono', monospace;
  --display: 'Syne', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
}

.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ── APP SHELL ── */
.app {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 430px;
  min-width: 320px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  padding: 0 12px;
  box-sizing: border-box;
}

/* On desktop, show a subtle border to frame the app */
@media (min-width: 500px) {
  .app {
    border-left: 1px solid rgba(255,255,255,0.04);
    border-right: 1px solid rgba(255,255,255,0.04);
    padding: 0 16px;
  }
}

/* ── SCREENS ── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  width: 100%;
}
.screen.active { display: flex; }

/* ── TOP BAR ── */
.top-bar {
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.app-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
}

.live-pill {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(57,255,20,0.1);
  border: 1px solid rgba(57,255,20,0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
}
.live-pill.visible { display: flex; }

.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 1s infinite;
}
.live-pill.paused {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--mid);
}
.live-pill.paused .live-dot {
  background: var(--mid);
  box-shadow: none;
  animation: none;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.25} }
@keyframes warmup-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,229,255,0.5); opacity: 0.5; }
  50%     { box-shadow: 0 0 0 8px rgba(0,229,255,0); opacity: 0.8; }
}
@keyframes tab-pulse {
  0%,100% { opacity: 0.6; text-shadow: 0 0 0px rgba(0,229,255,0); }
  50%     { opacity: 1;   text-shadow: 0 0 8px rgba(0,229,255,0.8); }
}
.tab-pulse { animation: tab-pulse 1.2s ease-in-out infinite; color: var(--accent) !important; opacity: 1 !important; }

/* ── HERO ── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 20px;
  min-height: 0;
  max-height: 165px;
}

.hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.04);
  pointer-events: none;
}

.distance-number {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -3px;
  color: var(--text);
  transition: color 0.4s, text-shadow 0.4s;
  position: relative;
  z-index: 1;
}
.distance-number.live {
  color: var(--green);
  text-shadow: 0 0 40px rgba(57,255,20,0.2);
}
.distance-number.zero { color: #444; }

.unit-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}
.unit-chip {
  padding: 5px 16px;
  border-radius: 20px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.unit-chip.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: var(--text);
}

.hero-status {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--dim);
  text-align: center;
  min-height: 18px;
  position: relative;
  z-index: 1;
  transition: color 0.3s;
  padding: 0 20px;
}
.hero-status.live-state { color: var(--green); }
.hero-status.error-state { color: var(--red); }
.hero-status.ok-state { color: var(--mid); }

/* ── POINT CARDS ── */
.points-section {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.point-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}
.point-card.set-a { border-color: rgba(0,229,255,0.25); }
.point-card.set-b { border-color: rgba(57,255,20,0.2); }

.point-btn {
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  min-width: 106px;
  text-align: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.point-btn:active { transform: scale(0.96); }
.point-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }

.btn-a         { background: var(--accent); color: #000; }
.btn-a:hover:not(:disabled) { background: #33eaff; }
.btn-a-warmup  { background: rgba(0,229,255,0.15); color: var(--accent); border: 1.5px solid rgba(0,229,255,0.4); animation: warmup-pulse 1.4s ease-in-out infinite; }
.btn-a-done    { background: rgba(0,229,255,0.1); color: var(--accent); border: 1.5px solid rgba(0,229,255,0.3); }
.btn-a-loading { background: #ffbe00; color: #000; animation: blink 0.7s infinite; }
.btn-b         { background: transparent; color: var(--green); border: 1.5px solid rgba(57,255,20,0.5); }
.btn-b:hover:not(:disabled) { background: rgba(57,255,20,0.08); }
.btn-b-loading { background: rgba(57,255,20,0.1); color: #ffbe00; border: 1.5px solid #ffbe00; animation: blink 0.7s infinite; }
.btn-b-done    { background: rgba(57,255,20,0.1); color: var(--green); border: 1.5px solid rgba(57,255,20,0.3); }

.point-info { flex: 1; min-width: 0; }
.point-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.point-coords {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.point-coords.set-a { color: var(--accent); }
.point-coords.set-b { color: var(--green); }
.point-acc {
  font-family: var(--mono);
  font-size: 10px;
  color: #999;
  margin-top: 2px;
}
.point-acc.visible { color: var(--dim); }

/* ── HELP SCREEN ── */
.help-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.help-scroll::-webkit-scrollbar { width: 3px; }
.help-scroll::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 2px; }

.help-section {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.help-section:last-child { border-bottom: none; }

.help-section-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.help-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.help-item:last-child { margin-bottom: 0; }

.help-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,229,255,0.15);
  border: 1px solid rgba(0,229,255,0.3);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
}
.help-body strong { color: var(--text); font-weight: 600; }
.help-body em { color: var(--accent); font-style: normal; }

.help-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}
.help-card-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.help-card-body {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--mid);
  line-height: 1.6;
}

.help-tip {
  background: rgba(57,255,20,0.05);
  border: 1px solid rgba(57,255,20,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--mid);
  line-height: 1.5;
  margin-top: 8px;
}
/* ── WELCOME SCREEN ── */
.welcome-screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 24px 32px;
  z-index: 200;
  text-align: center;
  overflow-y: auto;
}
.welcome-screen.hidden { display: none; }
.welcome-headline {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
  letter-spacing: 0.5px;
}
.welcome-sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 18px;
  line-height: 1.5;
}
.welcome-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  margin-bottom: 16px;
}
.welcome-feature-card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: left;
}
.welcome-feature-icon {
  font-size: 18px;
  margin-bottom: 5px;
}
.welcome-feature-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.welcome-feature-body {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--dim);
  line-height: 1.45;
}
.welcome-privacy-card {
  width: 100%;
  max-width: 360px;
  background: rgba(0,229,255,0.05);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.welcome-privacy-card-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}
.welcome-privacy-card-text {
  font-family: var(--sans);
  font-size: 12px;
  color: #aaa;
  line-height: 1.55;
}
.welcome-privacy-card-text strong {
  color: var(--accent);
  font-weight: 600;
}
.welcome-go-btn {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #000;
  background: var(--accent);
  border: none;
  border-radius: 14px;
  padding: 18px 60px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 30px rgba(0,229,255,0.3);
  margin-bottom: 4px;
}
.welcome-go-btn:hover { background: #33eaff; box-shadow: 0 0 40px rgba(0,229,255,0.5); }
.welcome-go-btn:active { transform: scale(0.97); }
.welcome-privacy {
  font-family: var(--mono);
  font-size: 9px;
  color: #555;
  margin-top: 10px;
  letter-spacing: 0.5px;
  line-height: 1.5;
}
.welcome-privacy a { color: #aaa; text-decoration: underline; }

.speed-toggle-row {
  padding: 0 12px 8px;
  flex-shrink: 0;
}
.speed-toggle-btn {
  width: 100%;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--mid);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.speed-toggle-btn.speed-fast   { border-color: rgba(255,61,113,0.4);  color: var(--red);   background: rgba(255,61,113,0.06); }
.speed-toggle-btn.speed-medium { border-color: rgba(255,190,0,0.4);   color: #ffbe00;      background: rgba(255,190,0,0.06); }
.speed-toggle-btn.speed-slow   { border-color: rgba(57,255,20,0.4);   color: var(--green); background: rgba(57,255,20,0.06); }
.speed-toggle-msg {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--mid);
  line-height: 1.5;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 4px;
}
.speed-toggle-msg.visible {
  max-height: 60px;
  padding: 6px 4px 0;
}

/* ── RESET ── */
.reset-row {
  display: flex;
  justify-content: center;
  padding: 0 12px 10px;
  flex-shrink: 0;
}
.reset-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px 24px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.reset-btn:hover { border-color: var(--red); color: var(--red); }

/* ── TAB BAR ── */
.tab-bar {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  border-top: none;
  background: rgba(20,20,22,0.98);
  flex-shrink: 0;
  position: relative;
  margin: 0 -12px;
  padding: 0 12px;
}

@media (min-width: 500px) {
  .tab-bar { margin: 0 -16px; padding: 0 16px; }
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 14px;
  cursor: pointer;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.tab:active { opacity: 0.7; }
.tab-icon { font-size: 22px; opacity: 0.7; transition: opacity 0.2s; }
.tab-icon.active { opacity: 1; }
.tab-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  color: var(--text);
  opacity: 0.6;
  transition: color 0.2s, opacity 0.2s;
}
.tab-label.active { color: var(--text); opacity: 1; }

/* ── AD SLOTS ── */
.ad-top-wrap {
  width: 100%;
  background: #0e0e10;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  flex-shrink: 0;
  min-height: 62px;
  position: relative;
}

.ad-label-top {
  font-family: var(--mono);
  font-size: 8px;
  color: #2a2a2e;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: absolute;
  top: 2px;
  left: 6px;
}

.ad-banner {
  width: 100%;
  height: 60px;
  background: #0e0e10;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  padding: 4px 0;
}

.ad-banner-label {
  font-family: var(--mono);
  font-size: 8px;
  color: #2a2a2e;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: absolute;
  top: 2px;
  left: 6px;
}

.ad-in-log {
  background: #111113;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  position: relative;
  flex-shrink: 0;
}

.ad-in-log-label {
  font-family: var(--mono);
  font-size: 8px;
  color: #2a2a2e;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: absolute;
  top: 4px;
  left: 8px;
}

/* ── LOG SCREEN ── */
.log-top-bar {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.log-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}
.export-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 7px 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.export-btn:hover { border-color: var(--accent); color: var(--accent); }

.log-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-list::-webkit-scrollbar { width: 3px; }
.log-list::-webkit-scrollbar-track { background: transparent; }
.log-list::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 2px; }

.log-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--dim);
  letter-spacing: 0.5px;
}

/* log item with swipe-delete */
.log-item-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
}
.log-item-delete-bg {
  position: absolute;
  inset: 0;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 20px;
  border-radius: 16px;
}
.log-item-delete-bg span {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.log-item {
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transform: translateX(0);
  transition: transform 0.2s ease;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}
.log-item.swiped { transform: translateX(-80px); }

.log-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  min-width: 22px;
}
.log-info { flex: 1; min-width: 0; }
.log-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.log-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}
.log-dist-wrap { text-align: right; }
.log-dist {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.log-dist-unit {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--dim);
  text-align: right;
}
.log-chevron { color: #999; font-size: 16px; margin-left: 2px; }

.swipe-hint {
  text-align: center;
  font-family: var(--sans);
  font-size: 10px;
  color: #999;
  padding: 6px 0 4px;
  letter-spacing: 1px;
}

/* ── DETAIL SCREEN ── */
.detail-top-bar {
  padding: 14px 20px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.back-btn {
  font-size: 24px;
  color: var(--accent);
  cursor: pointer;
  padding: 0 4px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.detail-name {
  flex: 1;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rename-btn {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: none;
  border: none;
  padding: 4px 0;
}

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px 14px;
  flex-shrink: 0;
}
.detail-dist {
  font-family: var(--display);
  font-size: 68px;
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1;
  color: var(--text);
}
.detail-unit {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--dim);
  margin-top: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.detail-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 6px;
}

/* ── SPEED SELECTOR ── */
.speed-row {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  flex-shrink: 0;
}
.speed-chip {
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--dim);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.speed-chip.active-fast  { border-color: rgba(255,61,113,0.5); color: var(--red); background: rgba(255,61,113,0.07); }
.speed-chip.active-medium { border-color: rgba(255,190,0,0.5); color: #ffbe00; background: rgba(255,190,0,0.07); }
.speed-chip.active-slow  { border-color: rgba(57,255,20,0.5); color: var(--green); background: rgba(57,255,20,0.07); }
.speed-chip-label { font-size: 11px; font-weight: 600; display: block; }
.speed-chip-sub   { font-size: 9px; color: inherit; opacity: 0.7; display: block; margin-top: 2px; }

/* ── SPEED TOOLTIP ── */
.speed-tooltip {
  margin: 0 12px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--mid);
  line-height: 1.5;
  flex-shrink: 0;
  transition: all 0.2s;
}
.speed-tooltip strong { font-weight: 600; }
.speed-tooltip.fast-tip   { border-color: rgba(255,61,113,0.25); }
.speed-tooltip.medium-tip { border-color: rgba(255,190,0,0.25); }
.speed-tooltip.slow-tip   { border-color: rgba(57,255,20,0.25); }
.detail-card {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
}
.detail-card-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}
.detail-key { font-family: var(--sans); font-size: 13px; color: var(--mid); }
.detail-val { font-family: var(--mono); font-size: 12px; color: var(--text); }

.elev-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.elev-arrow { font-size: 14px; }
.elev-val { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.elev-label { font-family: var(--sans); font-size: 11px; color: var(--dim); }
.elev-up .elev-arrow, .elev-up .elev-val { color: var(--red); }
.elev-down .elev-arrow, .elev-down .elev-val { color: var(--green); }
.elev-flat .elev-arrow, .elev-flat .elev-val { color: var(--dim); }

/* ── DIM OVERLAY ─────────────────────────────────────────── */
#dimOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#dimOverlay.active { display: block; }

/* Keep Awake prompt */
#keepAwakePrompt {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--panel);
  border-top: 1px solid rgba(0,229,255,0.2);
  border-radius: 18px 18px 0 0;
  padding: 20px 24px 36px;
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  pointer-events: none;
}
#keepAwakePrompt.visible { transform: translateY(0); pointer-events: all; }
.kap-icon { font-size: 28px; margin-bottom: 8px; }
.kap-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.kap-body {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--dim);
  line-height: 1.55;
  margin-bottom: 18px;
}
.kap-btns { display: flex; gap: 10px; }
.kap-btn-yes {
  flex: 1;
  background: var(--accent);
  color: #000;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  border: none;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kap-btn-no {
  flex: 1;
  background: transparent;
  color: var(--dim);
  font-family: var(--sans);
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 480px) {
  .logo-header { display: none !important; }
}
