:root {
  --ink: #f7fbfc;
  --muted: #a9c2c9;
  --deep: #07141a;
  --deep-2: #0b2229;
  --panel: rgba(13, 41, 49, 0.86);
  --panel-2: rgba(18, 58, 68, 0.72);
  --line: rgba(177, 232, 236, 0.16);
  --aqua: #53d7d1;
  --aqua-2: #8df2eb;
  --coral: #ff8066;
  --good: #6ee7a8;
  --bad: #ff9a7f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--deep); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 4%, rgba(83, 215, 209, 0.16), transparent 28rem),
    radial-gradient(circle at 12% 35%, rgba(255, 128, 102, 0.07), transparent 24rem),
    linear-gradient(180deg, #061218 0%, #092129 46%, #061218 100%);
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(141, 242, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(141, 242, 235, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 34px);
  background: rgba(5, 18, 23, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px;
  aspect-ratio: 1;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #062025;
  background: linear-gradient(145deg, var(--aqua-2), var(--aqua));
  box-shadow: 0 10px 26px rgba(83, 215, 209, 0.24);
}
.brand strong { display: block; font-size: clamp(0.94rem, 2.8vw, 1.08rem); }
.brand span { display: block; margin-top: 2px; max-width: 470px; color: var(--muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-actions { display: flex; align-items: center; gap: 9px; }

.text-button, .icon-button, .refresh-button, .bottom-nav-button, .btn-primary, .btn-secondary {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.text-button { padding: 9px 13px; font-weight: 750; font-size: .84rem; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; }
.text-button:hover, .icon-button:hover, .refresh-button:hover, .bottom-nav-button:hover { transform: translateY(-1px); border-color: rgba(141,242,235,.42); }
.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(110,231,168,.24);
  border-radius: 999px;
  color: #b8f7d3;
  background: rgba(110,231,168,.08);
  font-size: .76rem;
  font-weight: 800;
}
.pill-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 12px var(--good); }

.dashboard-grid {
  width: min(1160px, calc(100% - 28px));
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, .8fr);
  gap: 18px;
}
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(18,58,68,.9), rgba(8,29,36,.9));
  box-shadow: var(--shadow);
}
.card::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83,215,209,.15), transparent 65%);
  pointer-events: none;
}
.intelligence-card { padding: clamp(20px, 4vw, 34px); }
.catches-card { padding: 24px; align-self: start; }

.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.eyebrow { margin: 0 0 8px; color: var(--aqua-2); text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; font-weight: 900; }
h1, h2 { margin: 0; line-height: .98; letter-spacing: -.045em; }
h1 { font-size: clamp(2.2rem, 7vw, 4.8rem); max-width: 9ch; }
h2 { font-size: clamp(1.65rem, 4vw, 2.6rem); }

.weather-badge {
  min-width: 150px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  text-align: right;
}
.weather-badge strong { display: block; font-size: 2rem; color: var(--aqua-2); }
.weather-badge span, .weather-badge small { display: block; }
.weather-badge span { margin-top: 4px; font-weight: 800; }
.weather-badge small { margin-top: 5px; color: var(--muted); }

.dial-button { display: block; width: min(100%, 540px); margin: 26px auto 18px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.dial {
  position: relative;
  width: 100%;
  aspect-ratio: 1.42;
  border-radius: 300px 300px 38px 38px;
  overflow: hidden;
  border: 1px solid rgba(141,242,235,.2);
  background:
    radial-gradient(circle at 50% 94%, rgba(83,215,209,.24), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 18px 46px rgba(0,0,0,.28);
}
.tick-ring {
  position: absolute;
  inset: 12% 8% -44%;
  border: 2px solid rgba(141,242,235,.23);
  border-radius: 50%;
  background: repeating-conic-gradient(from 225deg, rgba(141,242,235,.66) 0 1deg, transparent 1deg 9deg);
  mask: radial-gradient(circle, transparent 0 68%, black 69% 72%, transparent 73%);
}
.needle { position: absolute; left: 50%; bottom: 12%; width: 3px; height: 37%; transform-origin: 50% 100%; transform: translateX(-50%) rotate(0deg); background: linear-gradient(to top, var(--coral), #ffd0c5); border-radius: 999px; box-shadow: 0 0 14px rgba(255,128,102,.58); transition: transform .55s cubic-bezier(.2,.8,.2,1); }
.needle-cap { position: absolute; left: 50%; bottom: 10.5%; width: 22px; height: 22px; transform: translateX(-50%); border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 6px rgba(255,128,102,.14); }
.optimal-dot { position: absolute; right: 14%; top: 30%; width: 10px; height: 10px; border-radius: 50%; background: var(--good); box-shadow: 0 0 16px var(--good); }
.dial-center { position: absolute; inset: auto 10% 12% 10%; text-align: center; }
.status-pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: rgba(141,242,235,.1); border: 1px solid rgba(141,242,235,.2); color: var(--aqua-2); font-size: .7rem; font-weight: 900; letter-spacing: .12em; }
.status-pill.good { color: #bff7d5; border-color: rgba(110,231,168,.3); background: rgba(110,231,168,.1); }
.status-pill.bad { color: #ffd0c5; border-color: rgba(255,154,127,.3); background: rgba(255,154,127,.1); }
.dial-center strong { display: block; margin-top: 6px; font-size: clamp(3.2rem, 10vw, 5.8rem); line-height: .92; letter-spacing: -.07em; }
.dial-center small { display: block; color: var(--muted); font-weight: 800; }
.dial-center > span:last-child { display: block; margin: 10px auto 0; max-width: 460px; color: #d8e9ec; font-size: .92rem; line-height: 1.4; }

.timeline-wrap { margin-top: 18px; }
.timeline-header { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .77rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.timeline { margin-top: 10px; padding: 10px 12px 4px; border: 1px solid var(--line); border-radius: 16px; color: var(--aqua); background: rgba(0,0,0,.12); }
.timeline svg { display: block; width: 100%; height: 70px; }
.grid-lines line { stroke: rgba(255,255,255,.07); stroke-width: 1; }

.depth-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.depth-card { text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.045); }
.depth-card:disabled { opacity: .74; }
.metric-label, .metric-meta { display: block; }
.metric-label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 850; }
.metric-value { display: flex; align-items: baseline; gap: 4px; margin: 8px 0 5px; font-size: 2.25rem; }
.metric-value small { font-size: .9rem; color: var(--muted); }
.metric-meta { color: #bdd2d6; font-size: .78rem; line-height: 1.35; }
.depth-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 3px; }
.location-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .83rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #70838a; box-shadow: 0 0 0 5px rgba(112,131,138,.11); }
.status-dot.locked { background: var(--good); box-shadow: 0 0 0 5px rgba(110,231,168,.12); }
.status-dot.error { background: var(--bad); }
.refresh-button { padding: 10px 15px; font-weight: 800; }

.catches-list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.catches-list li { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.04); line-height: 1.45; }
.catches-list span, .catches-empty { color: var(--muted); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(5,18,23,.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.bottom-nav-button { padding: 13px 16px; font-weight: 850; }
.bottom-nav-button.primary, .btn-primary { color: #062025; border-color: transparent; background: linear-gradient(145deg, var(--aqua-2), var(--aqua)); }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: end center; padding: 18px; background: rgba(0,0,0,.62); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(560px,100%); max-height: 90vh; overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 26px; background: #0b252d; box-shadow: var(--shadow); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.field { display: grid; gap: 8px; margin-top: 14px; color: var(--muted); font-weight: 800; font-size: .82rem; }
.field input, .field select, .field textarea { width: 100%; padding: 13px 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.055); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(141,242,235,.5); box-shadow: 0 0 0 4px rgba(83,215,209,.09); }
.weight-stepper, .location-field { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.weight-stepper button, .location-field button { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.06); color: var(--ink); padding: 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-primary, .btn-secondary { padding: 12px 17px; font-weight: 900; }

@media (max-width: 820px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .catches-card { order: 2; }
}

@media (max-width: 600px) {
  .top-nav { padding: 11px 14px; }
  .brand span { max-width: 155px; }
  .nav-actions .text-button { display: none; }
  .pill-status { padding: 7px 9px; }
  .dashboard-grid { width: min(100% - 18px, 680px); margin-top: 10px; gap: 10px; }
  .card { border-radius: 22px; }
  .intelligence-card { padding: 18px 14px; }
  .catches-card { padding: 18px 14px; }
  .section-heading { gap: 12px; }
  h1 { font-size: clamp(2.2rem, 12vw, 3.25rem); }
  .weather-badge { min-width: 112px; padding: 12px; border-radius: 16px; }
  .weather-badge strong { font-size: 1.65rem; }
  .weather-badge small { font-size: .65rem; }
  .dial-button { margin-top: 18px; }
  .dial { aspect-ratio: 1.22; border-radius: 220px 220px 28px 28px; }
  .dial-center strong { font-size: clamp(3.15rem, 17vw, 4.6rem); }
  .dial-center > span:last-child { font-size: .78rem; margin-top: 6px; }
  .depth-grid { grid-template-columns: 1fr; }
  .depth-footer { grid-column: auto; flex-wrap: wrap; }
  .metric-value { font-size: 1.85rem; }
}

@media (max-width: 410px) {
  .brand strong { font-size: .88rem; }
  .brand-mark { width: 40px; border-radius: 12px; }
  .pill-status { font-size: .68rem; }
  .section-heading { align-items: flex-start; }
  .weather-badge { min-width: 102px; }
  h1 { max-width: 7ch; }
}
