/* lotElevation Modern Design System */
:root {
  --bg-primary: #0a0f1d;
  --bg-card: rgba(18, 26, 45, 0.85);
  --bg-card-hover: rgba(26, 37, 62, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-main: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Space Grotesk", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px 12px;
}

.app-container {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-version-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.app-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.chip-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
}

/* Status Bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(18, 26, 45, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-dim);
  transition: background-color 0.3s ease;
}

.status-dot.active {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: pulse-ring 1.5s infinite;
}

.status-dot.locked, .status-dot.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease;
}

.section-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  width: fit-content;
}

.section-tag.green {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.section-tag.purple {
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.1);
}

/* Hero Section */
.hero-card {
  text-align: center;
  padding: 28px 20px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(180deg, rgba(18, 26, 45, 0.95) 0%, rgba(13, 20, 36, 0.9) 100%);
}

.hero-header h2 {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 6px;
}

.elevation-display {
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.elevation-value-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.elevation-number {
  font-family: var(--font-mono);
  font-size: 4.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 40%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 35px rgba(56, 189, 248, 0.3);
}

.elevation-unit {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.elevation-source {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.accuracy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-top: 6px;
}

/* Sampling Box */
.sampling-box {
  background: var(--bg-glass);
  border: 1px dashed var(--border-focus);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sampling-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.sampling-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: left;
}

/* Buttons */
.action-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(56, 189, 248, 0.6);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-earth {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
}

.btn-earth:hover:not(:disabled) {
  background: #1e293b;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.btn-topo {
  background: linear-gradient(135deg, #064e3b, #065f46);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.btn-topo:hover:not(:disabled) {
  background: #047857;
  border-color: #34d399;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.full-width {
  width: 100%;
}

.btn-full {
  width: 100%;
}

/* Manual / Desktop Coordinates */
.manual-coords-container {
  margin-top: 14px;
  width: 100%;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text-link:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
}

.manual-coords-panel {
  margin-top: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

.manual-coords-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
}

.manual-coords-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.preset-locations-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.manual-coords-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.manual-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.manual-input-group label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.manual-input-group input {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
}

.manual-input-group input:focus {
  border-color: var(--accent-cyan);
  outline: none;
  background: rgba(2, 6, 23, 0.9);
}

/* Preset Chips */
.descriptor-lead {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.preset-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--accent-emerald);
  color: var(--text-main);
}

.chip.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Form inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-group input, .select-box {
  background: rgba(13, 20, 36, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.input-group input:focus, .select-box:focus {
  border-color: var(--accent-cyan);
}

/* Workout Tracker Card */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-row h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.workout-selectors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .workout-selectors-grid {
    grid-template-columns: 1fr;
  }
}

.workout-trip-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric-pill {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-title {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.metric-num.highlight {
  color: var(--accent-purple);
}

.lap-counter-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.lap-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
}

.lap-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.lap-buttons-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lap-step-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lap-step-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lap-step-btn.plus {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}

.lap-step-btn.plus:hover {
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
}

.lap-display-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

/* Workout Summary Banner */
.workout-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
}

.summary-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.summary-divider {
  width: 1px;
  height: 50px;
  background: var(--border-subtle);
}

.summary-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.summary-big {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
}

.summary-big.climb {
  color: #c084fc;
}

.summary-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Canvas Area */
.canvas-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #090e18;
  border: 1px solid var(--border-subtle);
}

#lot-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.canvas-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(9, 14, 24, 0.85);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.canvas-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-color.high { background-color: #f59e0b; }
.legend-color.low { background-color: #38bdf8; }
.legend-color.line { background-color: #10b981; border-radius: 2px; height: 3px; width: 14px; }

/* Relief Bar */
.lot-relief-bar {
  display: flex;
  justify-content: space-between;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
}

.relief-title { color: var(--text-dim); }
.relief-val { font-family: var(--font-mono); font-weight: 700; color: var(--text-main); margin-left: 4px; }
.relief-val.highlight { color: var(--accent-emerald); }

/* Points List */
.points-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
}

.point-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.point-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.point-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.point-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.point-coords {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.point-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.point-elev {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.point-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

.point-del-btn:hover {
  color: var(--accent-rose);
}

.point-edit-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.point-edit-btn:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
}

.point-offset-tag {
  display: block;
  font-size: 0.7rem;
  color: #a78bfa;
  font-weight: 500;
  margin-top: 1px;
}

.empty-list-placeholder {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.btn-text {
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text.danger {
  color: var(--accent-rose);
}

.btn-text.danger:hover {
  text-decoration: underline;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* Animations */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0.3; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header Action Chips */
.header-action-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-btn-accent {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-btn-accent:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

/* Footer Help Link */
.footer-help-row {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.footer-help-btn {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-help-btn:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
}

/* Modal: Review & Debugging */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-card {
  max-width: 540px;
  width: 100%;
  background: linear-gradient(180deg, #131d33 0%, #0d1526 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.modal-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon svg {
  width: 20px;
  height: 20px;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 0.8;
  padding: 4px;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-field label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.user-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .user-identity-grid {
    grid-template-columns: 1fr;
  }
}

.modal-field input {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-main);
  padding: 8px 12px;
  font-size: 0.88rem;
}

.modal-field input:focus {
  border-color: var(--accent-cyan);
  outline: none;
  background: rgba(2, 6, 23, 0.9);
}

.network-identity-badge {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.net-badge-icon {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.net-badge-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.76rem;
  overflow: hidden;
}

.net-badge-row {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.net-label {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.net-val {
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-field textarea {
  width: 100%;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-main);
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  resize: vertical;
}

.modal-field textarea:focus {
  border-color: var(--accent-cyan);
  outline: none;
  background: rgba(2, 6, 23, 0.9);
}

.review-data-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-badge-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-value {
  font-size: 0.88rem;
  color: var(--accent-cyan);
  font-weight: 700;
  font-family: var(--font-mono);
}

.review-options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-options-lead {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-subactions-row {
  display: flex;
  gap: 10px;
}

.btn-half {
  flex: 1;
}

.review-toast {
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  animation: fadeIn 0.2s ease;
}

/* Foundation & Height Offset Controls */
.offset-controls-box {
  margin-top: 14px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.offset-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e2e8f0;
}

.offset-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
  font-family: var(--font-mono);
}

.offset-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.effective-elev-preview {
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.effective-elev-preview strong {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.preview-breakdown {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Absolute Elevation Comparison Row (Workout Tracker) */
.workout-elev-comparison {
  margin-top: 14px;
  margin-bottom: 6px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.elev-compare-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.elev-compare-col.origin {
  text-align: left;
}

.elev-compare-col.dest {
  text-align: right;
}

.elev-compare-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.elev-compare-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.elev-compare-col.dest .elev-compare-name {
  margin-left: auto;
}

.elev-compare-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-top: 2px;
}

.elev-compare-arrow-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.elev-compare-arrow {
  color: #a78bfa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.elev-compare-delta-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  white-space: nowrap;
}

.elev-compare-delta-badge.drop {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Edit Point Modal */
.modal-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions-row .btn {
  flex: 1;
}

/* ==========================================================================
   ChangeLog Displayer (The Sarah Edition)
   ========================================================================== */

.clickable-version {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.clickable-version:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.footer-inline-link {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0 2px;
  display: inline;
}

.footer-inline-link:hover {
  color: #7dd3fc;
}

.footer-help-btn.accent-link {
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 14px;
}

.footer-help-btn.accent-link:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.changelog-modal-card {
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #131c33 0%, #0c1322 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
}

.changelog-icon {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.changelog-modal-body {
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.3) rgba(15, 23, 42, 0.5);
}

.changelog-modal-body::-webkit-scrollbar {
  width: 6px;
}

.changelog-modal-body::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 9999px;
}

/* Sarah Welcome Card */
.sarah-welcome-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(139, 92, 246, 0.12) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.welcome-badge {
  background: linear-gradient(90deg, #f59e0b, #ec4899);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.welcome-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.welcome-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 6px;
}

.welcome-text {
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.55;
  margin: 0;
}

/* Individual Story Cards */
.changelog-story-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.changelog-story-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.story-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.story-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.86rem;
  flex-shrink: 0;
}

.story-title-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.story-title-group h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin: 0;
}

.story-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.story-tag.tag-sarah {
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
}

.story-tag.tag-tool {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.story-tag.tag-fix {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.story-tag.tag-map {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.story-tag.tag-fitness {
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #c084fc;
}

/* Sarah Quote Bubble */
.sarah-quote-bubble {
  position: relative;
  background: rgba(30, 41, 59, 0.7);
  border-left: 3px solid #f59e0b;
  padding: 10px 14px 10px 32px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.sarah-quote-bubble .quote-mark {
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 1.8rem;
  color: #f59e0b;
  opacity: 0.7;
  line-height: 1;
  font-family: Georgia, serif;
}

.sarah-quote-bubble p {
  margin: 0;
}

.story-explanation {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.story-explanation strong {
  color: #e2e8f0;
}

/* Demo Side-by-Side Box */
.story-demo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  gap: 10px;
  margin: 4px 0;
}

.demo-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-side.right {
  text-align: right;
}

.demo-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.demo-name {
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 600;
}

.demo-val {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.demo-val.highlight {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.demo-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.demo-arrow-icon {
  color: #a78bfa;
  font-size: 1.15rem;
  font-weight: 800;
}

.demo-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 7px;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Feature Callout Box */
.story-feature-highlight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.feature-icon-badge {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.story-feature-highlight strong {
  font-size: 0.88rem;
  color: #e2e8f0;
}

.story-feature-highlight p {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 4px 0 0 0;
  line-height: 1.45;
}

/* Chip Preview Row */
.chip-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.sample-chip {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.sample-chip-active {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.story-takeaway {
  font-size: 0.86rem;
  color: #34d399;
  font-weight: 600;
  margin: 0;
}

/* Past Releases Accordion */
.past-releases-accordion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  margin-top: 4px;
}

.btn-toggle-archive {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  padding: 6px 0;
  text-align: left;
  transition: color 0.2s ease;
}

.btn-toggle-archive:hover {
  color: #7dd3fc;
}

.archive-chevron {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.archive-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.archive-release-item {
  font-size: 0.82rem;
  color: #cbd5e1;
}

.archive-header {
  font-weight: 700;
  color: #e2e8f0;
}

.archive-date {
  color: var(--text-muted);
  font-weight: 400;
}

.archive-list {
  margin: 6px 0 0 18px;
  padding: 0;
  line-height: 1.45;
  color: #94a3b8;
  font-size: 0.8rem;
}

.archive-list li {
  margin-bottom: 4px;
}

/* Modal Signoff */
.changelog-signoff {
  text-align: center;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.signoff-author {
  color: var(--accent-cyan);
  font-weight: 600;
  margin: 4px 0 0 0;
}

