.dive-page {
  --paper: #f9f8f4;
  --accent: #0f6e6e;
  --cobalt: #0f6e6e;
  --chart-ink: #154643;
  --chart-rule: #b8c4b7;
  --chart-panel: #fdfcf7;
}
.dive-page .wrap { max-width: 1176px; }
.dive-page .masthead-inner { min-height: 56px; }
.dive-page .brand { font-size: 1.28rem; }
.dive { padding-bottom: 66px; }
.dive-hero { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; padding-block: 27px 18px; border-bottom: 1px solid var(--chart-rule); }
.dive-hero h1 { color: var(--chart-ink); font-size: clamp(2.32rem, 5.7vw, 4.35rem); letter-spacing: -.055em; }
.dive-hero p { margin-top: 3px; color: #4a625b; font: italic 1.2rem/1.4 Georgia, serif; }
.dive-settings, .dive-modes { display: flex; flex-wrap: wrap; align-items: center; }
.dive-settings { gap: 8px; }
.dive-modes { border: 1px solid #aebdb3; border-radius: 8px; }
.dive-modes button, .dive-sound, .dive-text-button { min-width: 44px; min-height: 44px; padding: 0 11px; border: 0; background: transparent; color: var(--chart-ink); border-radius: 6px; font-size: .82rem; font-weight: 700; }
.dive-modes button[aria-pressed="true"] { background: var(--accent); color: white; }
.dive-sound { padding-inline: 8px; border-bottom: 1px solid var(--chart-rule); border-radius: 0; white-space: nowrap; }
.dive-sound:hover, .dive-text-button:hover { color: var(--accent); text-decoration: underline; }
.dive button:disabled { opacity: .62; cursor: default; }

.dive-board { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 18px; align-items: stretch; margin-top: 15px; }
.dive-station { min-width: 0; }
.dive-instrument { margin: 0; padding: 7px 8px 8px; border: 1px solid #758d85; border-radius: 9px; background: #eeeee3; }
.dive-instrument figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; min-height: 30px; padding-inline: 6px; color: var(--chart-ink); font: 600 .76rem/1.5 var(--font-mono); }
.dive-instrument figcaption > span:first-child { text-transform: uppercase; letter-spacing: .15em; }
.dive-depth { white-space: nowrap; font-size: .93rem; font-variant-numeric: tabular-nums; }
.dive-chart {
  --probe-y: 5%;
  position: relative;
  height: clamp(295px, 31vw, 418px);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #617b72;
  border-radius: 5px;
  background: linear-gradient(180deg, #cfe8e5 0%, #afdbd8 24%, #2a7b88 30%, #2a7b88 48%, #163a5f 54%, #163a5f 74%, #0a192f 81%, #0a192f 100%);
}
.dive-underwater, .dive-zones, .dive-bubbles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.dive-zones { display: grid; grid-template-rows: repeat(4, 1fr); }
.dive-zones > div { display: flex; align-content: center; flex-wrap: wrap; align-items: baseline; gap: 3px 9px; padding-left: clamp(18px, 4.5vw, 43px); color: #eef6ef; box-shadow: inset 0 1px #d3efdf41; }
.dive-zones > div:first-child { color: #174c4a; }
.dive-zones > div:last-child { color: #f5deaa; }
.dive-zones strong { font: 700 clamp(1.2rem, 2.45vw, 1.75rem)/1.05 var(--font-heading); letter-spacing: -.02em; }
.dive-zones span { font: 500 .73rem/1.25 var(--font-mono); }
.dive-plumb { position: absolute; left: 59%; top: 4px; bottom: 7px; width: 1px; background: #faedbd94; color: #f9e2a2; }
.dive-plumb::after { content: ""; position: absolute; inset: 0 -5px 0 auto; width: 5px; opacity: .55; background: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 11px); }
.dive-plumb span { display: block; position: absolute; top: 0; left: 50%; width: 8px; height: 8px; border: 1px solid #7c602c; border-radius: 50%; background: #f9e7ad; transform: translateX(-50%); }
.dive-probe { position: absolute; z-index: 1; top: var(--probe-y); left: 59%; inline-size: 23px; aspect-ratio: 1; border: 2px solid #785b2a; border-radius: 100%; transform: translate(-50%, -50%); background: radial-gradient(circle at 33% 28%, #fff8cc 0%, #e4bb6b 32%, #9f6d32 72%); box-shadow: 0 0 0 2px #ffe4a778, 0 0 0 5px #152b3073; }
.dive-probe::after { content: ""; position: absolute; inset: 2px; border: 1px solid #fff1b7ca; border-radius: 50%; }
.dive-chart[data-result-tier="midnight"] .dive-probe { box-shadow: 0 0 0 2px #d1f4df, 0 0 0 8px #abf2df2b; }
.dive-chart[data-result-tier="abyss"] .dive-probe { background-color: #f9dda2; box-shadow: 0 0 0 2px #fff0b1d9, 0 0 26px 3px #ffca6bd9; }

.dive-result { position: absolute; z-index: 2; right: min(5%, 30px); bottom: 7%; display: flex; gap: 6px; align-items: center; max-width: 47%; padding: 6px 10px; border: 1px solid #e2d3a8; border-radius: 7px; background: #fdf9eb; color: #244641; box-shadow: 0 3px 15px #0b1d3440; font: 600 clamp(.68rem, 1.2vw, .88rem)/1.2 var(--font-mono); }
.dive-result svg { display: block; width: 30px; height: 30px; }
.dive-result[data-tier="abyss"] { color: #674618; border-color: #f0ce72; background: #fae8ae; }
.dive-chart[data-result-tier="surface"] { animation: atlas-rattle 260ms ease-out; }
.dive-chart[data-result-tier="midnight"] .dive-probe::after { animation: sonar-ring 550ms ease-out; }
.dive-chart[data-result-tier="abyss"] { animation: atlas-rattle 310ms ease-out; }
.dive-chart[data-result-tier="abyss"] .dive-result { animation: atlas-stamp 400ms cubic-bezier(.15,.85,.23,1.14); }
.dive-bubbles { z-index: 1; }
.dive-bubbles i { --dx: -9px; --delay: 0ms; position: absolute; top: var(--probe-y); left: 59%; width: 6px; height: 6px; border: 1px solid #fce5a2; border-radius: 50%; animation: atlas-bubble 820ms ease-out var(--delay) both; }
.dive-bubbles i:nth-child(2n) { --dx: 16px; --delay: 40ms; width: 5px; height: 5px; }
.dive-bubbles i:nth-child(3n) { --dx: -32px; --delay: 90ms; width: 7px; height: 7px; }
.dive-bubbles i:nth-child(4n) { --dx: 36px; --delay: 145ms; }
.dive-bubbles i:nth-child(5n) { --dx: -49px; --delay: 165ms; }
.dive-bubbles i:nth-child(7n) { --dx: 49px; --delay: 200ms; }
@keyframes atlas-rattle { 25% { transform: translateX(-2px); } 55% { transform: translateX(2px); } 80% { transform: translateX(-1px); } }
@keyframes atlas-stamp { 0% { transform: scale(.9, 1.16); opacity: .35; } 70% { transform: scale(1.06, .93); } }
@keyframes sonar-ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(3.6); opacity: 0; } }
@keyframes atlas-bubble { 0% { transform: translate(-50%, -50%) scale(.5); opacity: 0; } 17% { opacity: 1; } 100% { transform: translate(var(--dx), -95px) scale(1.12); opacity: 0; } }

.dive-console { display: grid; grid-template-columns: minmax(124px, .53fr) minmax(0, 1.47fr); gap: 6px 12px; padding-top: 11px; }
.dive-topic, .dive-form { min-width: 0; }
.dive-topic > span, .dive-form > label { display: block; margin-bottom: 3px; color: var(--chart-ink); font-weight: 700; font-size: .82rem; }
.dive-form > label { font-weight: 700; }
.dive-cast input { display: block; width: 100%; min-width: 0; min-height: 46px; padding: 0 9px; border: 1px solid #90a69a; border-radius: 6px; background: var(--chart-panel); color: #183933; font-size: 1rem; }
.dive-topic-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 7px 11px;
  border: 1px solid #99ac9e;
  border-radius: 7px;
  background: #fcfaf3;
  color: var(--chart-ink);
  text-align: start;
  font-size: .92rem;
  font-weight: 700;
}
.dive-topic-trigger:hover:not(:disabled), .dive-topic-trigger[aria-expanded="true"] { border-color: var(--accent); background: #edf4ed; }
.dive-topic-trigger, .dive-topic-menu button { -webkit-tap-highlight-color: transparent; }
.dive-topic-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dive-topic-trigger svg { flex: none; }
.dive-topic-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.dive-topic-menu {
  position: fixed;
  inset: var(--topic-top, 12px) auto auto var(--topic-left, 12px);
  width: var(--topic-width, 360px);
  max-width: none;
  height: var(--topic-height, min(438px, calc(100dvh - 24px)));
  margin: 0;
  padding: 13px 14px 9px;
  overflow: hidden;
  border: 1px solid #aabaae;
  border-radius: 13px;
  background: #fcfaf4;
  color: var(--chart-ink);
  box-shadow: 0 14px 42px #26372a30, 0 1px 3px #26372a18;
}
.dive-topic-menu[open] { display: flex; flex-direction: column; }
.dive-topic-menu::backdrop { background: #15262020; }
.dive-topic-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding-inline-start: 3px; }
.dive-topic-menu-head h2 { font-size: 1.42rem; }
.dive-topic-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--chart-ink);
}
.dive-topic-close:hover { background: #e9eee6; }
.dive-topic-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 4px 0 8px;
  padding: 0 10px;
  border: 1px solid #b3bfb1;
  border-radius: 7px;
  background: #fffdf7;
  color: #4b6b60;
}
.dive-topic-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dive-topic-search input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--chart-ink);
  font: 500 1rem var(--font-body);
}
.dive-topic-search svg { flex: none; }
.dive-topic-choices { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #acbeb0 transparent; }
.dive-topic-choices ul { margin: 0; padding: 0; list-style: none; }
.dive-topic-choices li + li { border-top: 1px solid #e6e3d6; }
.dive-topic-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #21382f;
  text-align: start;
  font-size: .94rem;
  font-weight: 650;
}
.dive-topic-choice:hover { background: #f0f0e5; }
.dive-topic-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dive-topic-choice[aria-current="true"] { background: #e1efe7; color: #155950; }
.dive-topic-choice svg { flex: none; visibility: hidden; }
.dive-topic-choice[aria-current="true"] svg { visibility: visible; }
.dive-topic-choices p { padding: 12px 7px 18px; color: #58695e; font-size: .9rem; }
@media (max-width: 620px) {
  .dive-topic-menu::backdrop { background: #15262075; }
}
.dive-cast { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.dive-cast input:disabled { color: #49625b; }
.dive-cast button, .dive-primary, .dive-secondary { min-height: 46px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font-size: .9rem; font-weight: 700; }
.dive-cast button:hover:not(:disabled), .dive-primary:hover { background: #0b5959; }
.dive-secondary { background: transparent; color: var(--accent); }
.dive-secondary:hover { background: #e9f1ed; }
.dive-feedback { min-height: 1.15em; color: #46625a; font-size: .84rem; overflow-wrap: anywhere; }
.dive-console > .dive-feedback, .dive-console > button { grid-column: 1 / -1; }
.dive-console > button { justify-self: start; }

.dive-log { min-width: 0; padding: 17px 18px; border: 1px solid #a2b3a5; border-radius: 9px; background: var(--chart-panel); }
.dive-log h2 { color: var(--chart-ink); text-align: center; font-size: clamp(1.45rem, 3vw, 1.95rem); }
.dive-points { margin-top: 2px; color: var(--chart-ink); text-align: center; font-family: var(--font-heading); }
.dive-points output { font-size: clamp(3rem, 6vw, 4.9rem); font-weight: 700; line-height: 1.12; font-variant-numeric: tabular-nums; }
.dive-points > span { font-size: 1.17rem; }
.dive-hooks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 11px; padding: 0; list-style: none; }
.dive-hooks li { display: grid; place-items: center; height: 39px; min-width: 0; border: 1px solid #c9d2c6; border-radius: 4px; color: #567069; background: #f5f5eb; font: 600 .8rem/1 var(--font-mono); }
.dive-hooks li:not([data-tier])::before { content: ""; width: 9px; height: 16px; border: 1.5px solid currentColor; border-top: 0; border-radius: 2px 2px 7px 7px; transform: rotate(8deg); }
.dive-hooks li[data-tier="reef"] { color: #21594f; background: #e2f0e7; }
.dive-hooks li[data-tier="midnight"] { color: #1e4669; background: #e7f0fa; }
.dive-hooks li[data-tier="abyss"] { color: #6c4819; background: #f4e6b5; }
.dive-hooks li[data-tier="miss"] { color: #753930; background: #f7e9df; }
.dive-log-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5px 12px; margin: 15px 0 0; padding-block: 9px; border-block: 1px solid #d6dcd0; }
.dive-log-stats dt { color: #54645c; font-size: .76rem; }
.dive-log-stats dd { margin: 0; color: var(--chart-ink); font: 600 .9rem/1.6 var(--font-mono); }
.dive-log-catches { margin-top: 13px; }
.dive-log-catches h3 { color: var(--chart-ink); font-size: 1.22rem; }
.dive-log-catches p { margin-top: 5px; color: #5e675f; font-size: .83rem; }
.dive-log-catches ol { padding: 0; list-style: none; }
.dive-log-catches li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 6px; align-items: baseline; padding-block: 6px; border-bottom: 1px solid #e6e8dc; font-size: .87rem; }
.dive-log-catches li > strong, .dive-log-catches li > small { overflow-wrap: anywhere; }
.dive-log-catches li > span { color: #3f5c54; font: 500 .73rem/1.3 var(--font-mono); }
.dive-log-catches li > small { grid-column: 1 / -1; color: #54645c; }
.dive-score-note { margin-top: 13px; font-size: .73rem; color: #5b655b; }

.dive-codex { margin-top: 24px; border-block: 1px solid var(--chart-rule); }
.dive-codex > summary { display: flex; justify-content: space-between; align-items: center; min-height: 53px; gap: 8px; list-style: none; color: var(--chart-ink); }
.dive-codex summary::-webkit-details-marker { display: none; }
.dive-codex summary > span:first-child { font: 700 1.35rem/1.1 var(--font-heading); }
.dive-codex summary > span:last-child { font-size: .79rem; font-weight: 700; }
.dive-codex[open] summary b { display: inline-block; transform: rotate(180deg); }
.dive-codex > p { color: #4c655b; font-size: .88rem; }
.dive-specimens { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin: 9px 0 14px; padding: 0; list-style: none; gap: 6px; }
.dive-specimens li { display: grid; justify-items: center; align-content: start; text-align: center; min-width: 0; padding: 5px 3px; border: 1px solid #d4dfd4; background: var(--chart-panel); color: var(--chart-ink); font-size: .72rem; line-height: 1.25; overflow-wrap: anywhere; }
.dive-specimens li[data-locked] { color: #596c63; background: #f0f2e9; }
.dive-specimens svg { width: 43px; height: 43px; }
.dive-specimens li[data-locked] svg { opacity: .38; }

.dive-summary { width: min(510px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 19px 20px; border: 1px solid #8caa9a; border-radius: 9px; background: var(--paper); color: var(--chart-ink); }
.dive-summary::backdrop { background: #0a192fb0; }
.dive-summary-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dive-summary-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 15px; padding-block: 5px 10px; font-size: .9rem; }
.dive-summary-stats strong { font: 700 1.42rem/1 var(--font-heading); }
.dive-summary h3 { margin-top: 7px; }
.dive-summary-ideas { padding: 3px 0 0 20px; }
.dive-summary-ideas li { padding-block: 4px; font-size: .86rem; }
.dive-summary-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.dive-summary .dive-feedback { margin-top: 5px; }
.dive-manual-share { display: block; margin-top: 5px; }
.dive-manual-share textarea { display: block; width: 100%; min-height: 90px; font: inherit; background: var(--chart-panel); color: inherit; }

.dive-guide { max-width: 48rem; margin: 40px auto 0; }
.dive-guide h2 { color: var(--chart-ink); }
.dive-faq { margin-top: 29px; }

@media (max-width: 820px) {
  .dive-board { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .dive-log { padding: 14px; }
  .dive-hero { flex-wrap: wrap; }
  .dive-specimens { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .dive-page .wrap { padding-inline: 13px; }
  .dive-page .masthead-inner { flex-direction: row; align-items: center; flex-wrap: wrap; min-height: 43px; gap: 0 8px; padding-block: 0; }
  .dive-page .brand { align-self: center; font-size: 1.1rem; }
  .dive-page .primary-nav { gap: 8px; }
  .dive-page .primary-nav a { font-size: .71rem; }
  .dive-hero { padding-block: 17px 9px; gap: 7px; }
  .dive-hero p { font-size: 1rem; }
  .dive-board { margin-top: 10px; }
  .dive-chart { height: clamp(246px, 43svh, 293px); }
  .dive-zones > div { display: grid; gap: 2px; align-content: center; }
  .dive-plumb, .dive-probe, .dive-bubbles i { left: 61%; }
  .dive-result { right: 7px; bottom: 5%; max-width: 47%; }
  .dive-result svg { width: 23px; height: 23px; }
  .dive-console { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .dive-topic { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
  .dive-topic > span { margin: 0; }
  .dive-form { scroll-margin-top: 12px; }
  .dive-guide { margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .dive-chart, .dive-chart .dive-probe::after, .dive-chart .dive-result, .dive-bubbles i { animation: none !important; }
  .dive-bubbles { display: none; }
}
