:root {
  --ink: #141414;
  --muted: #6b7280;
  --line: #e8e8e8;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --accent: #0f766e;
  --accent-soft: #e6f3f1;
  --safe: #0f766e;
  --risk: #b42318;
  --warn: #a15c07;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.04);
  --font-display: "Prompt", sans-serif;
  --font-body: "Prompt", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }

html, body,
button, input, select, textarea,
pre, code, .zone-json, .btn, .badge, .nav-list a {
  font-family: "Prompt", sans-serif !important;
}

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

.app-shell,
.main,
.grid,
.panel,
.kpi,
.chart-box,
.table-wrap,
.tracker-layout,
.tracker-stage {
  min-width: 0;
  max-width: 100%;
}

.chart-box {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-box canvas {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-x: clip;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topnav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-text { min-width: 0; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-list a {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background .15s ease, color .15s ease;
}

.nav-list a:hover { color: var(--ink); background: #f0f0ee; }
.nav-list a.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.6rem 0 3rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.topbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  letter-spacing: -0.04em;
}

.topbar .sub {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.kpi, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi {
  padding: 1rem 1.05rem;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.kpi .value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.kpi .hint {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.panel { padding: 1.05rem 1.1rem 1.15rem; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.chart-box { height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 320px; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:focus-visible, .seg button:focus-visible, .nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2a2a; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-danger {
  background: var(--risk);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-sm { padding: 0.38rem 0.65rem; font-size: 0.82rem; }

.table-wrap { overflow: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th, table.data td {
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

table.data th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.ok { background: var(--accent-soft); color: var(--safe); }
.badge.warn { background: #fff4e5; color: var(--warn); }
.badge.err { background: #fdecec; color: var(--risk); }
.badge.info { background: #f1f1ef; color: #444; }

.app-shell .progress {
  display: block;
  height: 8px;
  background: #ecece8;
  border-radius: 999px;
  overflow: hidden;
}

.app-shell .progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width .3s ease;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.86rem; }
.field .help { color: var(--muted); font-size: 0.78rem; }

.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.68rem 0.78rem;
  font: inherit;
}

.field textarea { min-height: 110px; resize: vertical; }
.switch { display: flex; align-items: center; gap: 0.55rem; }

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  background: var(--accent-soft);
  color: var(--safe);
  border: 1px solid #cfe8e4;
}

.rec-list { display: grid; gap: 0.7rem; }
.rec-item {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.rec-item h4 { margin: 0 0 0.25rem; font-family: var(--font-display); font-size: 0.98rem; }
.rec-item p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.stat-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  background: #f1f1ef;
  font-size: 0.8rem;
  font-weight: 700;
}
.chip.safe { background: var(--accent-soft); color: var(--safe); }
.chip.risk { background: #fdecec; color: var(--risk); }

/* Tracker stage */
.tracker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.7fr);
  gap: 1rem;
}

.tracker-stage {
  position: relative;
  background: #0d0d0d;
  border-radius: 12px;
  overflow: hidden;
  min-height: 320px;
  aspect-ratio: 16 / 10;
}

.tracker-stage video,
.tracker-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d0d0d;
  z-index: 1;
}

.tracker-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

.tracker-stage canvas.is-hidden { display: none !important; }

.tracker-stage img {
  opacity: 0;
  transition: opacity .2s ease;
}
.tracker-stage img.is-visible { opacity: 1; }

.tracker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.seg button {
  border: 0;
  background: transparent;
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

.seg button.active {
  background: var(--ink);
  color: #fff;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbb;
  display: inline-block;
}
.status-dot.live {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(15,118,110,0.5);
  animation: ping 1.4s infinite;
}
.status-dot.ok { background: var(--safe); }
.status-dot.risk { background: var(--risk); }

@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(15,118,110,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(15,118,110,0); }
  100% { box-shadow: 0 0 0 0 rgba(15,118,110,0); }
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 420px;
  overflow: auto;
}

.track-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fafafa;
}

.track-row.is-ok { border-color: #cfe8e4; background: #f4fbfa; }
.track-row.is-risk { border-color: #f3c7c3; background: #fff8f7; }

.track-id {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.track-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.track-meta strong { color: var(--ink); font-size: 0.86rem; }

.track-empty, .track-stamp {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.1rem;
}

.zone-hero {
  padding: 0;
  overflow: hidden;
}
.zone-hero-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: end;
}
.zone-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.zone-hero-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.zone-hero-copy p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.zone-hero-controls {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}
.zone-hero-controls .field { min-width: 200px; margin: 0; }
.zone-actions { display: flex; gap: 0.4rem; }

.zone-stage {
  position: relative;
  width: 100%;
  background:
    linear-gradient(180deg, rgba(15,118,110,0.08), transparent 40%),
    #111;
  min-height: 280px;
  overflow: hidden;
}
.zone-stage img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}
.zone-stage canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
}
.zone-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(20,20,20,0.72);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.zone-card h4 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1rem;
}
.zone-card-help {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.zone-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  margin-bottom: 0.7rem;
  background: #f1f1ef;
  position: relative;
}
.zone-card-icon.is-on {
  background: var(--accent-soft);
}
.zone-card-icon.is-on::after {
  content: "";
  position: absolute;
  inset: 11px 8px;
  border-radius: 999px;
  background: var(--accent);
}
.zone-card-icon.is-band {
  background: #fdecec;
}
.zone-card-icon.is-band::after {
  content: "";
  position: absolute;
  left: 7px; right: 7px; top: 15px;
  height: 4px;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 -5px 0 rgba(220,38,38,0.25), 0 5px 0 rgba(220,38,38,0.25);
}
.zone-card-icon.is-coord {
  background: #eef2ff;
}
.zone-card-icon.is-coord::after {
  content: "";
  position: absolute;
  left: 10px; top: 10px;
  width: 14px; height: 14px;
  border: 2px solid #334155;
  border-radius: 4px;
}
.zone-band-value {
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 0.86rem;
}
.zone-card input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.zone-json {
  margin: 0;
  padding: 0.7rem 0.75rem;
  background: #f6f6f4;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.78rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mobile-topbar,
.tabbar,
.sheet,
.sheet-backdrop { display: none; }

.mobile-cards { display: none; }
.desktop-only { display: block; }

.app-card-list {
  display: grid;
  gap: 0.7rem;
}
.app-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
}
.app-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.55rem;
}
.app-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.app-card-meta {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
.app-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0.75rem;
}
.app-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.app-card-actions .btn {
  min-height: 44px;
  width: 100%;
}
.app-card-actions .btn.span-2 { grid-column: 1 / -1; }

.fab {
  display: none;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .grid-3, .grid-2, .tracker-layout, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .main {
    width: min(100%, calc(100% - 1.2rem));
    max-width: 100%;
    padding-top: 1.1rem;
    box-sizing: border-box;
  }
  .topbar, .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .chart-box { height: 240px; }
  .chart-box.lg { height: 260px; }
  .track-list { max-height: 260px; }
}

/* ===== Mobile app shell (iOS / Android feel) ===== */
@media (max-width: 768px) {
  html, body {
    background: #efefed;
    overscroll-behavior-y: none;
  }

  .desktop-nav { display: none !important; }
  .desktop-only { display: none !important; }
  .mobile-cards { display: grid; }

  .mobile-topbar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: calc(0.55rem + var(--safe-top)) 1rem 0.65rem;
    background: rgba(246, 246, 244, 0.88);
    backdrop-filter: saturate(1.2) blur(16px);
    -webkit-backdrop-filter: saturate(1.2) blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .mobile-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
  }
  .mobile-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .mobile-title {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
  }
  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .mobile-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 36px;
  }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding: 0.35rem 0.35rem calc(0.35rem + var(--safe-bottom));
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(1.25) blur(18px);
    -webkit-backdrop-filter: saturate(1.25) blur(18px);
    border-top: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 -8px 24px rgba(0,0,0,0.04);
  }
  .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    border: 0;
    background: transparent;
    color: #8a8f98;
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none;
    min-height: 48px;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
  }
  .tab-item.active { color: var(--accent); }
  .tab-ico {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
  }
  .tab-ico svg { width: 22px; height: 22px; }

  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity .2s ease;
  }
  .sheet-backdrop.is-open { opacity: 1; }
  .sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 0.65rem 1rem calc(1rem + var(--safe-bottom));
    transform: translateY(110%);
    transition: transform .22s ease;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.15);
  }
  .sheet.is-open { transform: translateY(0); }
  .sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d5d5d1;
    margin: 0.2rem auto 0.85rem;
  }
  .sheet-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
  }
  .sheet-link {
    display: block;
    padding: 0.9rem 0.85rem;
    border-radius: 14px;
    background: #f6f6f4;
    margin-bottom: 0.55rem;
  }
  .sheet-link strong { display: block; font-size: 0.98rem; }
  .sheet-link span { color: var(--muted); font-size: 0.8rem; }
  .sheet-close {
    width: 100%;
    min-height: 46px;
    margin-top: 0.35rem;
  }

  .main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.85rem 0.9rem calc(var(--tabbar-h) + var(--safe-bottom) + 1.2rem);
    overflow-x: clip;
  }

  /* Hide redundant desktop page titles on mobile (topbar already shows title) */
  .topbar {
    display: none;
  }

  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    width: 100%;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .kpi {
    border-radius: 16px;
    padding: 0.85rem 0.8rem;
    overflow: hidden;
  }
  .kpi .value {
    font-size: 1.35rem;
    word-break: break-word;
  }
  .kpi .hint { display: none; }

  .panel {
    border-radius: 18px;
    padding: 0.95rem;
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
  }
  .panel-head {
    gap: 0.5rem;
    min-width: 0;
  }
  .panel-head h3 {
    font-size: 1.02rem;
    min-width: 0;
  }

  .btn, .btn-sm {
    min-height: 44px;
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
  }
  .btn-sm { font-size: 0.86rem; }

  .tracker-stage {
    min-height: 210px;
    aspect-ratio: 16 / 11;
    border-radius: 16px;
  }
  .track-list { max-height: 220px; }
  .chart-box, .chart-box.sm, .chart-box.lg { height: 220px; }

  .seg {
    width: 100%;
    border-radius: 12px;
    background: #efefed;
    border: 0;
    padding: 3px;
  }
  .seg button {
    flex: 1;
    border-radius: 10px;
    min-height: 36px;
  }
  .seg button.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  .zone-hero { border-radius: 18px; }
  .zone-hero-bar { align-items: stretch; padding: 0.95rem; }
  .zone-hero-controls { width: 100%; }
  .zone-hero-controls .field { min-width: 0; flex: 1; }
  .zone-actions { width: 100%; }
  .zone-actions .btn { flex: 1; }
  .zone-hint { left: 10px; right: 10px; bottom: 10px; text-align: center; }

  .fab {
    display: flex;
    position: fixed;
    right: 1rem;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 0.85rem);
    z-index: 35;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0,0,0,0.22);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
  }
}

@media (max-width: 480px) {
  .mobile-title { font-size: 1.4rem; }
  .grid-4 { gap: 0.55rem; }
  .kpi .value { font-size: 1.25rem; }
  .chart-box, .chart-box.sm, .chart-box.lg { height: 200px; }
  .tracker-stage { min-height: 180px; }
}
