/* THIRDS — cave diving decision simulator. Dark expedition-instrument system. */

:root {
  --bg: #050d0b;
  --bg2: #07120f;
  --surface: #0a1714;
  --surface2: #0d1d19;
  --line: rgba(154, 196, 184, 0.14);
  --line-strong: rgba(154, 196, 184, 0.28);
  --text: #dbe9e2;
  --muted: #8aa39a;
  --dim: #5f776f;
  --amber: #e8b25c;
  --amber-soft: rgba(232, 178, 92, 0.14);
  --teal: #69e0c8;
  --teal-soft: rgba(105, 224, 200, 0.12);
  --red: #ff7a63;
  --red-soft: rgba(255, 122, 99, 0.12);
  --blue: #8fb7ff;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --display: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Noto Sans SC", sans-serif;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(20, 62, 52, 0.34), transparent 62%),
    radial-gradient(900px 700px at 0% 100%, rgba(12, 42, 35, 0.25), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(154, 196, 184, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 196, 184, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 75%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 75%);
}

::selection { background: var(--amber); color: #10130d; }

button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

h1, h2, h3, h4 { font-weight: 600; }
p { margin: 0; }

.hidden { display: none !important; }

/* ---------- shared ---------- */

.kicker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  padding: 11px 18px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
  user-select: none;
}
.btn:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #10130d;
}
.btn-primary:hover:not(:disabled) { background: #f2c477; border-color: #f2c477; color: #10130d; }

.btn-ghost { color: var(--muted); }
.btn-danger { color: var(--red); border-color: rgba(255, 122, 99, 0.45); background: rgba(255, 122, 99, 0.05); }
.btn-danger:hover:not(:disabled) { border-color: var(--red); color: #ffb3a4; background: rgba(255, 122, 99, 0.12); }
.btn-lg { padding: 16px 26px; font-size: 13px; letter-spacing: 0.16em; }
.btn-block { width: 100%; }
.btn-mini { padding: 7px 10px; font-size: 10px; letter-spacing: 0.08em; }

.view {
  display: none;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px) clamp(16px, 4vw, 54px) 80px;
  position: relative;
  z-index: 1;
}
.view.active { display: block; animation: viewIn 0.3s ease both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(255, 122, 99, 0.8); }
  50% { opacity: 0.45; box-shadow: 0 0 3px rgba(255, 122, 99, 0.4); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- header / footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
  padding: 0 clamp(16px, 4vw, 44px);
  background: rgba(5, 13, 11, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--amber);
  cursor: pointer;
  text-align: left;
}
.brand-mark { display: flex; }
.brand-text strong {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.22em;
  color: var(--text);
  line-height: 1;
}
.brand-text em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav button {
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.main-nav button:hover { color: var(--amber); }
.main-nav button.nav-active { color: var(--amber); border-bottom-color: var(--amber); }

.header-sim {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--amber);
  border: 1px solid rgba(232, 178, 92, 0.35);
  padding: 5px 8px;
  white-space: nowrap;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 54px);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

/* ---------- safety gate ---------- */

#view-gate.active {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  min-height: 100vh;
  padding: clamp(24px, 5vh, 64px) clamp(16px, 5vw, 64px);
  overflow: hidden;
}

.gate-grid {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(154, 196, 184, 0.04) 79px 80px),
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(154, 196, 184, 0.04) 79px 80px),
    radial-gradient(900px 520px at 70% 0%, rgba(20, 62, 52, 0.4), transparent 65%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 78%);
  pointer-events: none;
}

.gate-inner { width: min(960px, 100%); position: relative; z-index: 1; }

.gate-head { margin-bottom: 26px; }
.gate-head h1 {
  font-family: var(--display);
  font-size: clamp(62px, 11vw, 122px);
  line-height: 0.84;
  letter-spacing: 0.015em;
  margin: 14px 0 12px;
  color: var(--text);
}
.gate-head h1 span {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(17px, 2.6vw, 26px);
  font-weight: 400;
  letter-spacing: 0.42em;
  color: var(--amber);
  vertical-align: super;
  margin-left: clamp(10px, 2vw, 26px);
}
.gate-sub {
  font-family: var(--mono);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 0.12em;
  color: var(--muted);
}

.gate-warning {
  border: 1px solid rgba(232, 178, 92, 0.32);
  border-left: 3px solid var(--amber);
  background: linear-gradient(180deg, rgba(14, 32, 27, 0.92), rgba(7, 17, 14, 0.92));
  padding: clamp(20px, 3vw, 34px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.warn-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px dashed rgba(232, 178, 92, 0.25);
}
.warn-stamp {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--amber);
}
.warn-fatal {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--red);
  text-align: right;
}

.gate-warning h2 {
  font-family: var(--display);
  font-size: clamp(24px, 3.3vw, 36px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--text);
}
.gate-lede { font-size: 14px; line-height: 1.9; color: #b6cbc2; max-width: 78ch; }
.gate-lede strong { color: var(--amber); font-weight: 600; }

.gate-list { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; gap: 9px; }
.gate-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
}
.gate-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: rgba(232, 178, 92, 0.7);
}
.gate-list strong { color: var(--text); font-weight: 600; }

.gate-checks { display: grid; gap: 8px; margin: 22px 0; }
.ack {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: rgba(5, 13, 11, 0.6);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.ack:hover { border-color: var(--line-strong); }
.ack:has(input:checked) { border-color: rgba(105, 224, 200, 0.45); background: var(--teal-soft); }
.ack input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--teal); flex: 0 0 15px; cursor: pointer; }
.ack span { font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.ack span b { font-family: var(--mono); font-size: 9px; color: var(--amber); margin-right: 8px; letter-spacing: 0.1em; }
.ack strong { color: var(--text); }
.ack:has(input:checked) span { color: var(--text); }

#btn-enter { width: 100%; }
.gate-foot {
  margin-top: 14px;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

/* ---------- home ---------- */

.home-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(20px, 4vh, 54px) 0 54px;
  border-bottom: 1px solid var(--line);
}
.hero-copy h1 {
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  margin: 16px 0 20px;
  letter-spacing: 0.01em;
}
.hero-copy h1 span { color: var(--amber); }
.hero-lede { max-width: 56ch; color: var(--muted); line-height: 1.9; font-size: 14.5px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 28px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
}
.hero-meta span::before { content: "▪"; color: var(--amber); margin-right: 6px; font-size: 7px; vertical-align: 1px; }

.hero-frame {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 10px;
}
#hero-canvas { display: block; width: 100%; height: clamp(260px, 32vw, 380px); }
.corner { position: absolute; width: 12px; height: 12px; border-color: var(--amber); border-style: solid; pointer-events: none; }
.corner.tl { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.corner.tr { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }
.corner.br { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.hero-readout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.hero-readout .blink { color: var(--amber); }
.hero-readout .blink::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--amber);
  border-radius: 50%;
  margin-right: 6px;
  animation: blink 1.8s infinite;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin: 52px 0 24px;
}
.section-head h1, .section-head h2 {
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  margin: 8px 0 0;
  letter-spacing: 0.01em;
}
.section-head p { max-width: 52ch; color: var(--muted); font-size: 13px; line-height: 1.75; }

.mission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.mission-card {
  --tone: var(--teal);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 29, 25, 0.92), rgba(7, 18, 15, 0.72));
  padding: 22px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.mission-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: var(--tone);
  opacity: 0.85;
}
.mission-card:hover { border-color: rgba(232, 178, 92, 0.4); transform: translateY(-2px); }

.mc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mc-code { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--amber); }
.mc-level {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--tone);
  border: 1px solid currentColor;
  padding: 4px 6px;
  opacity: 0.85;
}
.mc-title { margin: 12px 0 4px; font-family: var(--display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1; letter-spacing: 0.02em; }
.mc-title span { color: var(--tone); font-family: var(--sans); font-size: 14px; font-weight: 400; margin-left: 10px; letter-spacing: 0.12em; }
.mc-site { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--dim); }

.mc-route {
  display: block;
  width: 100%;
  height: 116px;
  margin: 14px 0;
  border: 1px solid var(--line);
  background: #06100e;
}

.mc-tagline { font-size: 13px; line-height: 1.7; color: var(--muted); min-height: 2.4em; }

.mc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 14px 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mc-stats dt { font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--dim); }
.mc-stats dd { margin: 3px 0 0; font-family: var(--mono); font-size: 12px; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 7px;
}
.mission-card .btn { margin-top: auto; }

.ladder {
  margin-top: 56px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(7, 18, 15, 0.55);
}
.ladder-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 14px;
}
.ladder-step { background: var(--bg2); padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.ladder-step b { font-family: var(--mono); font-size: 10px; color: var(--amber); padding-top: 2px; }
.ladder-step strong { display: block; font-family: var(--display); font-size: 14px; letter-spacing: 0.08em; }
.ladder-step span { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.ladder-note { margin-top: 14px; font-size: 11px; color: var(--dim); line-height: 1.7; }

/* ---------- plan ---------- */

.back-link {
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.back-link:hover { color: var(--amber); }

.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.plan-head h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  margin: 10px 0 8px;
  letter-spacing: 0.015em;
}
.plan-head h1 span { color: var(--amber); font-family: var(--sans); font-size: 0.4em; font-weight: 400; letter-spacing: 0.16em; margin-left: 14px; vertical-align: middle; }
.plan-site { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--dim); }
.plan-tagline { margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 60ch; line-height: 1.7; }

.plan-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.badge.tone { color: var(--tone, var(--amber)); border-color: currentColor; opacity: 0.9; }
.badge.amber { color: var(--amber); border-color: rgba(232, 178, 92, 0.4); }

.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}
.plan-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.plan-side { display: flex; flex-direction: column; gap: 16px; }

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 29, 25, 0.86), rgba(7, 18, 15, 0.7));
}
.panel > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.panel > header span { font-family: var(--mono); font-size: 9px; color: var(--amber); letter-spacing: 0.1em; }
.panel-warn { border-color: rgba(232, 178, 92, 0.3); }
.panel-warn p { padding: 16px 18px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }

.briefing { padding: 20px; }
.briefing p { color: #b6cbc2; font-size: 13.5px; line-height: 1.95; }
.briefing p + p { margin-top: 12px; }
.briefing p:first-child { color: var(--text); }
.briefing strong { color: var(--amber); font-weight: 600; }
.briefing .briefing-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
  color: var(--dim);
}

.route-canvas { display: block; width: 100%; height: 230px; background: #06100e; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.stat-strip > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.stat-strip > div:nth-child(4n) { border-right: 0; }
.stat-strip > div:nth-child(n + 5) { border-top: 1px solid var(--line); }
.stat-strip span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.12em; color: var(--dim); }
.stat-strip b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text); }

.checks { padding: 8px 18px 12px; }
.check-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(154, 196, 184, 0.1);
}
.check-row:last-child { border-bottom: 0; }
.check-state {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-align: center;
  padding: 3px 0;
  border: 1px solid;
}
.check-state.pass { color: var(--teal); border-color: rgba(105, 224, 200, 0.35); background: var(--teal-soft); }
.check-state.fail { color: var(--red); border-color: rgba(255, 122, 99, 0.4); background: var(--red-soft); }
.check-label { font-size: 12.5px; color: var(--muted); }
.check-value { font-family: var(--mono); font-size: 10px; color: var(--text); text-align: right; }

.ascent-note { padding: 16px 18px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.ascent-note strong { color: var(--amber); }
.data-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11px; }
.data-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 8px;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}
.data-table td { padding: 9px 12px; border-bottom: 1px dashed rgba(154, 196, 184, 0.1); color: var(--muted); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.hi { color: var(--text); }
.data-table td.amber { color: var(--amber); }
.data-table td.teal { color: var(--teal); }

.switch-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.switch-chip {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--amber);
  border: 1px solid rgba(232, 178, 92, 0.35);
  padding: 5px 8px;
}

.rmv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 4px;
}
.rmv-row label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); white-space: nowrap; }
.rmv-row label span { color: var(--dim); font-size: 8px; }
.rmv-row input[type="range"] { flex: 1; accent-color: var(--amber); height: 18px; cursor: pointer; }
.rmv-row output { font-family: var(--mono); font-size: 15px; color: var(--amber); width: 28px; text-align: right; }
.field-note { padding: 0 18px 14px; font-size: 10.5px; line-height: 1.65; color: var(--dim); }

.gases { padding: 0 18px; }
.gas-line { padding: 11px 0; border-bottom: 1px dashed rgba(154, 196, 184, 0.1); }
.gas-line:last-child { border-bottom: 0; }
.gas-line-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.gas-line-name { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--text); }
.gas-line-name .dot { width: 8px; height: 8px; border-radius: 50%; }
.gas-line-role { font-family: var(--mono); font-size: 8px; color: var(--dim); letter-spacing: 0.1em; }
.gas-line-pressure { font-family: var(--mono); font-size: 11px; color: var(--teal); }
.gas-line-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 5px; font-family: var(--mono); font-size: 9px; color: var(--dim); }

.pressure-block { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.pressure-cell { padding: 11px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pressure-cell:nth-child(2n) { border-right: 0; }
.pressure-cell span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; color: var(--dim); }
.pressure-cell b { display: block; margin-top: 3px; font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--text); }
.pressure-cell.warn b { color: var(--red); }
.pressure-cell.good b { color: var(--teal); }

.objective-list { list-style: none; margin: 0; padding: 10px 18px 16px; }
.objective-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  border-bottom: 1px dashed rgba(154, 196, 184, 0.08);
}
.objective-list li:last-child { border-bottom: 0; }
.obj-box {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border: 1px solid var(--dim);
  position: relative;
}
.objective-list li.done { color: var(--text); }
.objective-list li.done .obj-box { border-color: var(--teal); background: var(--teal); }
.objective-list li.done .obj-box::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0px;
  width: 4px;
  height: 7px;
  border: solid #05100d;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.objective-list li.missed { color: var(--red); }
.objective-list li.missed .obj-box { border-color: var(--red); }

.pre-dive { padding: 6px 18px 12px; }
.pre-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(154, 196, 184, 0.1);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  cursor: pointer;
}
.pre-check:last-child { border-bottom: 0; }
.pre-check input { margin-top: 2px; width: 14px; height: 14px; accent-color: var(--teal); flex: 0 0 14px; cursor: pointer; }
.pre-check:has(input:checked) { color: var(--text); }

.note-panel p { padding: 16px 18px; font-size: 12px; line-height: 1.85; color: var(--muted); border-left: 2px solid rgba(232, 178, 92, 0.35); margin: 14px 18px 16px; padding: 0 0 0 12px; }

.plan-start {
  border: 1px solid rgba(232, 178, 92, 0.35);
  background: rgba(232, 178, 92, 0.05);
  padding: 14px;
}
#plan-start-note { margin-top: 10px; font-size: 10.5px; line-height: 1.65; color: var(--muted); }
#plan-start-note.bad { color: var(--red); }
#plan-start-note.good { color: var(--teal); }

/* ---------- dive ---------- */

#view-dive { max-width: none; padding: 8px clamp(12px, 2vw, 26px) 26px; }

.dive-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 4px 2px 10px;
}
.dive-id {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; }
#dive-code { color: var(--amber); }
#dive-name { color: var(--text); }
.sim-tag {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--amber);
  border: 1px solid rgba(232, 178, 92, 0.35);
  padding: 3px 6px;
}
.dive-actions { display: flex; gap: 6px; }

.dive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 12px;
  align-items: start;
}
.dive-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.dive-canvas-wrap {
  position: relative;
  height: clamp(400px, calc(100vh - 320px), 760px);
  border: 1px solid var(--line);
  background: #06100e;
  overflow: hidden;
}
#dive-canvas { display: block; width: 100%; height: 100%; }

.fp-canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  background: #020706;
}
.fp-vignette {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 78% 72% at 50% 48%, rgba(0, 0, 0, 0) 46%, rgba(0, 2, 2, 0.42) 100%);
}
.dive-canvas-wrap.mode-pov #dive-canvas { display: none; }
.dive-canvas-wrap.mode-pov #fp-canvas { display: block; }
.dive-canvas-wrap.mode-pov .fp-vignette { display: block; }
.fp-canvas.dragging { cursor: grabbing; }

.fp-hud {
  position: absolute;
  top: 44px;
  left: 12px;
  z-index: 3;
  display: flex;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  pointer-events: none;
}
.fp-hud > div { background: rgba(4, 12, 10, 0.86); padding: 5px 8px; min-width: 62px; }
.fp-hud span { display: block; font-family: var(--mono); font-size: 7px; letter-spacing: 0.14em; color: var(--dim); }
.fp-hud b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--text); }
.fp-hud b.warn { color: var(--red); }
.fp-hud b.amber { color: var(--amber); }

.view-toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: flex;
  border: 1px solid var(--line-strong);
  background: rgba(4, 12, 10, 0.86);
}
.view-toggle button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 7px 10px;
  cursor: pointer;
}
.view-toggle button:last-child { border-right: 0; }
.view-toggle button:hover { color: var(--amber); }
.view-toggle button.active { background: var(--amber); color: #10130d; }

.fp-hint {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  max-width: min(640px, calc(100% - 200px));
  padding: 5px 9px;
  border: 1px solid var(--line);
  background: rgba(4, 12, 10, 0.72);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--dim);
  pointer-events: none;
}

.fp-pad { display: none; }
.fp-pad button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(105, 224, 200, 0.4);
  background: rgba(4, 14, 12, 0.78);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.fp-pad button:active, .fp-pad button.holding { background: var(--amber); border-color: var(--amber); color: #10130d; }
.fp-pad button small { display: block; margin-top: 2px; font-size: 7px; font-weight: 400; color: inherit; opacity: 0.8; }
.fp-pad .pad-line { font-size: 10px; letter-spacing: 0.04em; line-height: 1.2; }
.fp-pad .pad-up { grid-area: 1 / 2; }
.fp-pad .pad-line { grid-area: 1 / 3; }
.fp-pad .pad-left { grid-area: 2 / 1; }
.fp-pad .pad-down { grid-area: 2 / 2; }
.fp-pad .pad-right { grid-area: 2 / 3; }

@media (max-width: 900px), (pointer: coarse) {
  .fp-pad:not(.hidden) {
    display: grid;
    position: absolute;
    left: 10px;
    bottom: 54px;
    z-index: 6;
    grid-template-columns: repeat(3, 48px);
    grid-template-rows: repeat(2, 48px);
    gap: 6px;
  }
  .fp-hint { display: none; }
  .fp-hud { top: 42px; left: 10px; }
  .fp-hud > div { min-width: 54px; padding: 4px 6px; }
  .fp-hud b { font-size: 9px; }
  .view-toggle { right: 10px; bottom: 10px; }
  .view-toggle button { padding: 8px 9px; }
}

.phase-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--amber);
  border: 1px solid rgba(232, 178, 92, 0.35);
  background: rgba(4, 12, 10, 0.75);
  padding: 5px 8px;
  pointer-events: none;
}
.phase-tag.alarm { color: var(--red); border-color: rgba(255, 122, 99, 0.4); }

.zero-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--red);
  border: 1px solid rgba(255, 122, 99, 0.5);
  background: rgba(30, 8, 5, 0.8);
  padding: 5px 8px;
  animation: blink 1.4s infinite;
}

.switch-banner {
  position: absolute;
  top: 46px;
  right: 12px;
  z-index: 4;
  max-width: min(340px, calc(100% - 24px));
  border: 1px solid rgba(105, 224, 200, 0.45);
  background: rgba(4, 14, 12, 0.94);
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.switch-label { font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--teal); }
.switch-banner strong { display: block; margin-top: 4px; font-family: var(--display); font-size: 15px; letter-spacing: 0.04em; }
.switch-banner small { display: block; margin-top: 3px; font-family: var(--mono); font-size: 9px; color: var(--muted); line-height: 1.5; }
.switch-banner .switch-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.switch-banner button {
  border: 1px solid var(--teal);
  background: rgba(105, 224, 200, 0.1);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  cursor: pointer;
}
.switch-banner button:hover { background: var(--teal); color: #05100d; }

.turn-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: min(480px, calc(100% - 32px));
  border: 1px solid var(--amber);
  background: rgba(5, 14, 11, 0.96);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}
.turn-banner h2 { font-family: var(--display); font-size: clamp(24px, 3.4vw, 34px); line-height: 1.05; margin: 8px 0 16px; letter-spacing: 0.02em; }
.turn-data { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); margin-bottom: 14px; }
.turn-data > div { background: #081411; padding: 9px 10px; }
.turn-data span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; color: var(--dim); }
.turn-data b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--amber); }
.turn-warn { color: var(--red); font-size: 11.5px; line-height: 1.6; margin-bottom: 12px; }
.turn-banner .btn { width: 100%; }
.turn-note { margin-top: 10px; font-size: 10px; line-height: 1.6; color: var(--dim); }

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 7, 0.82);
  backdrop-filter: blur(7px);
}
.pause-card {
  width: min(430px, 100%);
  border: 1px solid var(--line-strong);
  background: #081411;
  padding: 26px;
}
.pause-card h2 { font-family: var(--display); font-size: 28px; margin: 8px 0 10px; }
.pause-card p { font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.pause-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

.dive-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 12px;
}
.control-group { display: flex; flex-direction: column; gap: 5px; }
.ctrl-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
}
.seg { display: flex; border: 1px solid var(--line-strong); }
.seg button {
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  padding: 8px 11px;
  cursor: pointer;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--amber); }
.seg button.active { background: var(--amber); color: #10130d; }

.hold-btn {
  flex: 1 1 260px;
  min-height: 48px;
  font-size: 13px;
  letter-spacing: 0.18em;
  touch-action: none;
  user-select: none;
}
.hold-btn.holding { background: #f6cf8c; border-color: #f6cf8c; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }

.line-btn {
  flex: 0 1 200px;
  min-height: 48px;
  font-size: 10px;
  letter-spacing: 0.1em;
  touch-action: none;
  user-select: none;
  border-color: rgba(105, 224, 200, 0.4);
  color: var(--teal);
}
.line-btn.holding { background: var(--teal); border-color: var(--teal); color: #05100d; }
.line-btn:disabled { opacity: 0.4; }

.stop-readout {
  flex: 0 1 auto;
  min-width: 150px;
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--teal);
  text-align: right;
  padding-bottom: 2px;
}
.stop-readout.warn { color: var(--red); }
.stop-readout.amber { color: var(--amber); }

.notice-feed-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  background: rgba(8, 20, 17, 0.6);
  padding: 9px 12px;
  min-height: 72px;
  max-height: 96px;
  overflow: hidden;
}
.notice-feed-wrap > .ctrl-label { flex: 0 0 auto; padding-top: 2px; }
.notice-feed { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 10px; overflow: hidden; }
.notice-feed li { display: flex; gap: 8px; color: var(--muted); line-height: 1.45; }
.notice-feed time { flex: 0 0 46px; color: var(--dim); }
.notice.alarm { color: var(--red); }
.notice.warning { color: var(--amber); }
.notice.phase { color: var(--amber); }
.notice.info { color: var(--muted); }
.notice-empty { color: var(--dim); font-size: 10px; }

/* dive computer */

.hud {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #0a1814, #07110e);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  position: sticky;
  top: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.hud-primary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.hud-cell { background: #081411; padding: 9px 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px; min-width: 0; }
.hud-cell span { flex: 0 0 100%; font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--dim); }
.hud-cell strong { font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--text); line-height: 1.1; }
.hud-cell em { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--dim); }
.depth-cell { grid-column: 1 / -1; padding: 12px 14px; }
.depth-cell strong { font-size: clamp(42px, 5vw, 58px); color: var(--amber); letter-spacing: -0.02em; }
.depth-cell em { font-size: 12px; margin-left: 2px; }
#hud-runtime { color: var(--teal); font-size: 15px; }
#hud-tts { color: var(--amber); }
#hud-ceiling { color: var(--text); }

.hud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.hud-grid > div { background: #081411; padding: 7px 9px; }
.hud-grid span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; color: var(--dim); }
.hud-grid b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text); }

.hud-section { border-top: 1px solid var(--line); padding-top: 9px; }
.hud-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
}
.hud-title span { color: var(--amber); }

.hud-gases { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.gas-row {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 8px 10px;
  border: 1px solid var(--line);
  background: rgba(6, 16, 14, 0.7);
}
.gas-row.current { border-color: rgba(232, 178, 92, 0.5); background: rgba(232, 178, 92, 0.06); }
.gas-dot { width: 8px; height: 8px; border-radius: 50%; }
.gas-meta strong { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--text); }
.gas-meta em { display: block; margin-top: 1px; font-style: normal; font-family: var(--mono); font-size: 8px; color: var(--dim); letter-spacing: 0.04em; }
.gas-num { text-align: right; }
.gas-num b { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--teal); }
.gas-num span { font-family: var(--mono); font-size: 7px; color: var(--dim); margin-left: 2px; }
.gas-switch {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  padding: 4px 5px;
  cursor: pointer;
}
.gas-switch:hover:not(:disabled) { border-color: var(--amber); color: var(--amber); }
.gas-switch:disabled { opacity: 0.3; cursor: not-allowed; }
.gas-track { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(154, 196, 184, 0.08); }
.gas-track span { display: block; height: 100%; background: var(--teal); transition: width 0.2s linear; }
.gas-row.current .gas-track span { background: var(--amber); }
.gas-row.low .gas-track span { background: var(--red); }

.hud-objectives { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.hud-objectives li { display: flex; gap: 8px; align-items: flex-start; font-size: 10.5px; line-height: 1.45; color: var(--muted); }
.hud-objectives .obj-box { flex: 0 0 9px; width: 9px; height: 9px; margin-top: 3px; }
.hud-objectives li.done { color: var(--text); }
.hud-objectives li.done .obj-box { border-color: var(--teal); background: var(--teal); }
.hud-objectives li.done .obj-box::after { left: 1px; top: -1px; width: 3px; height: 6px; border-width: 0 1.5px 1.5px 0; }

.hud-plan { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0 0; }
.hud-plan dt { font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; color: var(--dim); }
.hud-plan dd { margin: 0; font-family: var(--mono); font-size: 9px; color: var(--text); text-align: right; }

.hud-keys { display: flex; flex-wrap: wrap; gap: 5px 10px; border-top: 1px solid var(--line); padding-top: 8px; font-family: var(--mono); font-size: 8px; color: var(--dim); letter-spacing: 0.04em; }

/* ---------- debrief ---------- */

.debrief-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.debrief-head h1 { font-family: var(--display); font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; margin: 8px 0; }
#db-sub { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--dim); }

.score-badge {
  min-width: 186px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 14px 18px 16px;
  text-align: right;
}
.score-badge strong { display: block; font-family: var(--mono); font-size: 54px; line-height: 1; color: var(--amber); font-weight: 500; }
.score-badge span { display: block; margin-top: 2px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--dim); }
.score-badge em {
  display: inline-block;
  margin-top: 9px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 4px 7px;
  border: 1px solid currentColor;
  color: var(--amber);
}
.score-badge.outcome-pass { border-color: rgba(105, 224, 200, 0.4); }
.score-badge.outcome-pass strong, .score-badge.outcome-pass em { color: var(--teal); }
.score-badge.outcome-fail { border-color: rgba(255, 122, 99, 0.45); }
.score-badge.outcome-fail strong, .score-badge.outcome-fail em { color: var(--red); }
.score-badge.outcome-conditional strong, .score-badge.outcome-conditional em { color: var(--amber); }

.db-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin-top: 24px; align-items: start; }
.db-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.db-side { display: flex; flex-direction: column; gap: 16px; }

.profile-canvas { display: block; width: 100%; height: 280px; background: #06100e; border-bottom: 1px solid var(--line); }
.chart-note { padding: 10px 18px 12px; font-size: 10px; color: var(--dim); line-height: 1.6; }

.violation-list, .decision-list { padding: 8px 18px 12px; }
.violation-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(154, 196, 184, 0.1);
}
.violation-row:last-child { border-bottom: 0; }
.violation-sev { font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; border: 1px solid; padding: 3px 5px; text-align: center; }
.violation-sev.critical { color: var(--red); border-color: rgba(255, 122, 99, 0.4); background: var(--red-soft); }
.violation-sev.warning { color: var(--amber); border-color: rgba(232, 178, 92, 0.4); background: var(--amber-soft); }
.violation-label { font-size: 12px; color: var(--text); line-height: 1.5; }
.violation-time { font-family: var(--mono); font-size: 9px; color: var(--dim); }
.violation-penalty { font-family: var(--mono); font-size: 10px; color: var(--red); text-align: right; }
.empty-note { padding: 10px 0 14px; font-size: 12px; color: var(--dim); line-height: 1.7; }

.decision-row { padding: 10px 0; border-bottom: 1px dashed rgba(154, 196, 184, 0.1); }
.decision-row:last-child { border-bottom: 0; }
.decision-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.decision-head strong { font-family: var(--display); font-size: 13px; letter-spacing: 0.04em; color: var(--text); }
.decision-head span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.decision-row.correct .decision-head span { color: var(--teal); }
.decision-row.wrong .decision-head span { color: var(--red); }
.decision-option { margin-top: 5px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.decision-time { margin-top: 4px; font-family: var(--mono); font-size: 8px; color: var(--dim); }

.data-list { margin: 0; padding: 8px 18px 14px; }
.data-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(154, 196, 184, 0.08); }
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { font-family: var(--mono); font-size: 9px; letter-spacing: 0.05em; color: var(--dim); }
.data-list dd { margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--text); text-align: right; }
.data-list dd.warn { color: var(--red); }
.data-list dd.good { color: var(--teal); }

.db-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- standards ---------- */

.standards-head { align-items: flex-end; }
.standards-head h1 { font-size: clamp(34px, 4.8vw, 52px); }

.std-banner {
  border: 1px solid rgba(232, 178, 92, 0.35);
  border-left: 3px solid var(--amber);
  background: rgba(232, 178, 92, 0.06);
  padding: 14px 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 22px;
}
.std-banner strong { color: var(--amber); }

.std-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.std-card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 29, 25, 0.7), rgba(7, 18, 15, 0.55));
  padding: 20px 22px;
  overflow: hidden;
}
.std-num {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: 0.04em;
  color: rgba(154, 196, 184, 0.09);
}
.std-card h3 { font-family: var(--display); font-size: 17px; letter-spacing: 0.04em; margin: 0 0 9px; color: var(--text); padding-right: 40px; }
.std-card p { font-size: 12.5px; line-height: 1.9; color: var(--muted); }

.pov-standard {
  border: 1px solid rgba(105, 224, 200, 0.3);
  background: rgba(8, 26, 22, 0.5);
  padding: clamp(18px, 2.6vw, 24px);
  margin-bottom: 22px;
}
.pov-standard h2 { font-family: var(--display); font-size: clamp(20px, 2.6vw, 26px); letter-spacing: 0.03em; margin: 7px 0 10px; }
.pov-standard > div > p { font-size: 12.5px; line-height: 1.9; color: var(--muted); max-width: 88ch; }
.pov-standard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 24px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.pov-standard-grid h4 { font-family: var(--display); font-size: 12px; letter-spacing: 0.1em; color: var(--teal); text-transform: uppercase; margin: 0 0 6px; }
.pov-standard-grid p { font-size: 11.5px; line-height: 1.85; color: var(--muted); }
.pov-warn { margin-top: 10px; color: var(--amber); font-size: 11.5px; line-height: 1.75; }

.limits {
  margin-top: 30px;
  border: 1px solid rgba(255, 122, 99, 0.35);
  background: linear-gradient(180deg, rgba(30, 12, 9, 0.5), rgba(8, 16, 14, 0.7));
  padding: clamp(20px, 3vw, 30px);
}
.limits-head h2 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 36px); margin: 8px 0 20px; }
.limits-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.limits-grid h4 { font-family: var(--display); font-size: 13px; letter-spacing: 0.1em; color: var(--red); margin: 0 0 7px; text-transform: uppercase; }
.limits-grid p { font-size: 12px; line-height: 1.85; color: var(--muted); }
.limits-foot { margin-top: 22px; padding-top: 16px; border-top: 1px dashed rgba(255, 122, 99, 0.3); font-size: 12px; line-height: 1.8; color: #e6b3aa; }

/* ---------- logbook ---------- */

.log-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.log-note { font-size: 11px; line-height: 1.7; color: var(--dim); margin-bottom: 18px; }
.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-entry {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(10, 23, 20, 0.75);
  padding: 14px 18px;
}
.log-date { font-family: var(--mono); font-size: 9px; color: var(--dim); line-height: 1.6; }
.log-name strong { display: block; font-family: var(--display); font-size: 14px; letter-spacing: 0.04em; color: var(--text); }
.log-name span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 9px; color: var(--dim); }
.log-metrics { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.log-metrics b { display: block; color: var(--text); font-size: 12px; font-weight: 500; margin-top: 2px; }
.log-outcome {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border: 1px solid;
  display: inline-block;
  margin-top: 6px;
}
.log-outcome.PASS { color: var(--teal); border-color: rgba(105, 224, 200, 0.4); }
.log-outcome.CONDITIONAL { color: var(--amber); border-color: rgba(232, 178, 92, 0.4); }
.log-outcome.FAIL, .log-outcome.FAILED { color: var(--red); border-color: rgba(255, 122, 99, 0.4); }
.log-outcome.INCOMPLETE { color: var(--muted); border-color: var(--line-strong); }
.log-empty {
  border: 1px dashed var(--line-strong);
  padding: 60px 24px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.8;
}
.log-empty strong { display: block; font-family: var(--display); font-size: 20px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.06em; }

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 7, 6, 0.84);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: min(650px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0c1d18, #07120f);
  border: 1px solid var(--line-strong);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.modal-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--amber); }

.event-stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--red);
  border: 1px solid rgba(255, 122, 99, 0.4);
  background: var(--red-soft);
  padding: 4px 7px;
  margin-bottom: 16px;
}
.event-card h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); line-height: 1; margin: 0 0 5px; letter-spacing: 0.015em; }
.event-cn { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: var(--amber); margin-bottom: 16px; }
.event-body {
  font-size: 13.5px;
  line-height: 1.9;
  color: #b6cbc2;
  border-left: 2px solid var(--line-strong);
  padding-left: 14px;
}
.event-prompt { font-family: var(--display); font-size: 16px; letter-spacing: 0.03em; color: var(--text); margin: 22px 0 10px; }
.event-options { display: flex; flex-direction: column; gap: 8px; }
.event-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: rgba(6, 16, 14, 0.7);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.event-option:hover { border-color: var(--amber); background: rgba(232, 178, 92, 0.06); }
.opt-key {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--amber);
  border: 1px solid rgba(232, 178, 92, 0.4);
  margin-top: 1px;
}

.event-feedback { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.fb-head { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; margin-bottom: 10px; }
.event-feedback.good .fb-head { color: var(--teal); }
.event-feedback.bad .fb-head { color: var(--red); }
.event-feedback > p { font-size: 13px; line-height: 1.85; color: #b6cbc2; }
.fb-standard { border: 1px solid var(--line); background: rgba(6, 16, 14, 0.6); padding: 12px; margin: 14px 0; }
.fb-standard span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--amber); }
.fb-standard p { margin-top: 6px; font-size: 12px; line-height: 1.75; color: var(--muted); }
.fb-fail { margin-top: 10px; color: var(--red); font-size: 12.5px; line-height: 1.7; }
.event-feedback .btn { margin-top: 16px; width: 100%; }

.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.modal-actions .btn { flex: 1 1 auto; }

.end-card { text-align: center; }
.end-card .kicker { color: var(--amber); }
.end-card h2 { font-family: var(--display); font-size: clamp(32px, 5vw, 52px); margin: 10px 0 6px; }
.end-reason { font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.end-score { margin: 18px 0; }
.end-score strong { font-family: var(--mono); font-size: 64px; line-height: 1; color: var(--amber); font-weight: 500; }
.end-score span { display: block; font-family: var(--mono); font-size: 8px; letter-spacing: 0.14em; color: var(--dim); }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); text-align: left; }
.end-stats > div { background: #081411; padding: 9px 11px; }
.end-stats span { display: block; font-family: var(--mono); font-size: 8px; color: var(--dim); letter-spacing: 0.08em; }
.end-stats b { display: block; margin-top: 3px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--text); }
.end-card.pass { border-color: rgba(105, 224, 200, 0.4); }
.end-card.pass::before { background: var(--teal); }
.end-card.pass .end-score strong { color: var(--teal); }
.end-card.fail { border-color: rgba(255, 122, 99, 0.45); }
.end-card.fail::before { background: var(--red); }
.end-card.fail .end-score strong { color: var(--red); }
.end-card .modal-actions { justify-content: center; }

.confirm-card h2 { font-family: var(--display); font-size: 25px; line-height: 1.2; margin: 8px 0 10px; }
.confirm-card > p { font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.confirm-card .modal-actions .btn-danger { flex: 1; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .dive-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .hud-primary .depth-cell strong { font-size: 46px; }
}

@media (max-width: 1020px) {
  .home-hero { grid-template-columns: 1fr; }
  .hero-vis { order: -1; }
  #hero-canvas { height: 300px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-side { position: static; }
  .plan-badges { justify-content: flex-start; }
  .dive-grid { grid-template-columns: 1fr; }
  .hud { position: static; max-height: none; order: 0; padding: 8px; gap: 8px; }
  .dive-main { order: 1; }
  .hud-objectives, .hud-plan, .hud-keys { display: none; }
  .hud .hud-grid > div:nth-child(3),
  .hud .hud-grid > div:nth-child(5),
  .hud .hud-grid > div:nth-child(6) { display: none; }
  .hud .hud-gas .gas-row:not(.current) { display: none; }
  .hud-primary { grid-template-columns: repeat(3, 1fr); }
  .hud-cell { padding: 6px 9px; }
  .depth-cell { padding: 6px 12px; }
  .depth-cell strong { font-size: 44px; }
  .hud-cell strong { font-size: 14px; }
  .dive-canvas-wrap { height: clamp(340px, 46vh, 520px); }
  .db-grid { grid-template-columns: 1fr; }
  .db-side { position: static; }
}

@media (max-width: 820px) {
  .site-header { gap: 12px; height: auto; min-height: 58px; padding: 8px 16px; flex-wrap: wrap; }
  .main-nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; }
  .header-sim { margin-left: auto; }
  .mission-grid { grid-template-columns: 1fr; }
  .std-grid { grid-template-columns: 1fr; }
  .pov-standard-grid { grid-template-columns: 1fr; }
  .limits-grid { grid-template-columns: 1fr; }
  .ladder-row { grid-template-columns: 1fr; }
  .log-entry { grid-template-columns: 1fr; gap: 8px; }
  .log-metrics { justify-content: flex-start; }
  .gate-head h1 span { display: block; margin: 10px 0 0; letter-spacing: 0.3em; }
  .section-head { margin-top: 38px; }
  .plan-head h1 span { display: block; margin: 8px 0 0; }
}

@media (max-width: 640px) {
  .view { padding-left: 14px; padding-right: 14px; }
  .gate-inner { width: 100%; }
  .gate-head h1 { font-size: 54px; }
  .gate-warning { padding: 18px 16px; }
  .hero-copy h1 { font-size: 42px; }
  .hero-vis { order: 1; }
  #hero-canvas { height: 240px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div:nth-child(2n) { border-right: 0; }
  .stat-strip > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .dive-controls { gap: 10px; }
  .hold-btn { flex: 1 1 100%; order: 5; }
  .line-btn { flex: 1 1 100%; order: 6; }
  .stop-readout { margin-left: 0; text-align: left; flex: 1 1 100%; }
  .dive-canvas-wrap { height: 42vh; min-height: 300px; }
  .turn-data { grid-template-columns: 1fr; }
  .hud-primary .depth-cell strong { font-size: 48px; }
  .notice-feed-wrap { display: none; }
  .score-badge { width: 100%; text-align: left; }
  .end-stats { grid-template-columns: 1fr 1fr; }
  .event-option { font-size: 12px; }
  .plan-head h1 { font-size: 36px; }
  .log-actions { width: 100%; }
  .log-actions .btn { flex: 1; }
  .modal { padding: 10px; }
  .modal-card { max-height: 94vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
