:root {
    --bg: #080b10;
    --bg-raised: #0d1218;
    --bg-wash: #111821;
    --ink: #f3f7fb;
    --ink-soft: #d6dee6;
    --muted: #8a96a3;
    --muted-strong: #bac5cf;
    --line: rgba(216, 229, 240, 0.1);
    --line-strong: rgba(216, 229, 240, 0.18);
    --panel: #10151c;
    --panel-tint: #151b23;
    --nav: rgba(9, 12, 17, 0.9);
    --accent: #48a6ff;
    --accent-deep: #227fe6;
    --accent-soft: rgba(72, 166, 255, 0.12);
    --accent-line: rgba(72, 166, 255, 0.32);
    --sea: #28c7bc;
    --blue: #48a6ff;
    --gold: #e2b154;
    --good: #54d693;
    --danger: #ff6b8a;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
    --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 26px 76px rgba(0, 0, 0, 0.46);
    --radius: 8px;
    --radius-sm: 6px;
    --content: 1160px;
    --font-ui: "Avenir Next", "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-brand: "Avenir Next Rounded", "Avenir Next", "Trebuchet MS", var(--font-ui);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(22, 32, 43, 0.84), rgba(8, 11, 16, 0.96) 280px),
        linear-gradient(90deg, rgba(72, 166, 255, 0.06), transparent 28%, rgba(40, 199, 188, 0.04) 74%, transparent),
        var(--bg);
    font-family: var(--font-ui);
    font-size: 15px;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
}

h1,
h2,
h3,
p {
    letter-spacing: 0;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--ink);
    line-height: 1.08;
}

h1 {
    font-size: clamp(1.75rem, 2.7vw, 2.75rem);
    font-weight: 760;
}

h2 {
    font-size: 1.12rem;
    font-weight: 730;
}

h3 {
    font-size: 0.98rem;
    font-weight: 720;
}

p {
    line-height: 1.55;
}

.page-shell {
    width: min(var(--content), calc(100% - 32px));
    margin: 0 auto;
    padding: 88px 0 48px;
}

.landing-body {
    background: #080c11;
}

.landing-body .page-shell {
    width: 100%;
    padding: 0;
}

.topbar {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 max(20px, calc((100vw - var(--content)) / 2));
    border-bottom: 1px solid rgba(216, 229, 240, 0.08);
    background: var(--nav);
    backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 148px;
    color: var(--ink);
    font-family: var(--font-brand);
    font-weight: 780;
    font-size: 1.04rem;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #84c9ff, var(--accent) 55%, #10151c 56%, #10151c);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 8px 18px rgba(72, 166, 255, 0.18);
}

.brand-mark::after {
    content: "";
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-left: 0;
    border-bottom: 0;
    transform: rotate(45deg) translate(-1px, 1px);
}

.brand-mark.large {
    width: 58px;
    height: 58px;
    border-radius: 8px;
}

.brand-mark.large::after {
    width: 27px;
    height: 27px;
    border-width: 3px;
}

.topbar-search {
    flex: 1 1 360px;
    max-width: 460px;
    min-width: 220px;
}

.topbar-search input {
    min-height: 40px;
    padding: 9px 12px;
    border-color: rgba(216, 229, 240, 0.14);
    background: rgba(11, 17, 24, 0.9);
}

.topbar-search-menu {
    top: calc(100% + 8px);
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 40px;
    padding: 4px;
    border: 1px solid rgba(216, 229, 240, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.026);
}

.desktop-nav a,
.ghost-button,
.chip-button,
.primary-button,
.icon-button {
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: transform 0.16s ease, background 0.16s ease, border 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.desktop-nav a {
    padding: 0 12px;
    color: var(--muted-strong);
    font-size: 0.88rem;
    font-weight: 690;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--ink);
    background: rgba(72, 166, 255, 0.12);
    border-color: var(--accent-line);
    box-shadow: var(--shadow-xs);
}

.desktop-nav .nav-cta,
.primary-button {
    color: #ffffff;
    font-weight: 760;
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    box-shadow: 0 10px 22px rgba(72, 166, 255, 0.22);
}

.primary-button:hover,
.desktop-nav .nav-cta:hover {
    transform: translateY(-1px);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 12px 26px rgba(72, 166, 255, 0.28);
}

.primary-button {
    padding: 0 18px;
}

.primary-button.compact {
    min-height: 36px;
    padding: 0 13px;
    font-size: 0.88rem;
}

.ghost-button {
    min-height: 36px;
    padding: 0 12px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.026);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
    font-size: 0.88rem;
    font-weight: 680;
}

.ghost-button:hover {
    color: var(--ink);
    border-color: var(--line-strong);
    background: var(--panel-tint);
}

.user-corner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 148px;
}

.mini-avatar,
.profile-avatar {
    overflow: hidden;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 780;
    background:
        linear-gradient(145deg, #0e1620 0%, #202d3a 55%, var(--accent-deep) 56%, #7fc3ff 100%);
}

.mini-avatar {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(244, 248, 251, 0.88);
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line), var(--shadow-xs);
}

.mini-avatar img,
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-nav {
    display: none;
}

.flash-stack {
    position: fixed;
    z-index: 80;
    top: 86px;
    right: max(16px, calc((100vw - var(--content)) / 2));
    display: grid;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
}

.flash {
    padding: 13px 14px;
    border: 1px solid var(--accent-line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
}

.landing-hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
    align-items: center;
    gap: 56px;
    padding: 54px max(24px, calc((100vw - 1180px) / 2));
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(7, 11, 16, 0.95), rgba(7, 11, 16, 0.64) 48%, rgba(7, 11, 16, 0.82)),
        linear-gradient(180deg, rgba(7, 11, 16, 0.18), rgba(7, 11, 16, 0.82)),
        url("../img/ocean-satellite.png") center / cover no-repeat,
        #080c11;
}

.landing-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 12px;
    background: linear-gradient(90deg, var(--accent), #6ec7ff 30%, var(--sea) 66%, #233a5a);
    z-index: -1;
}

.landing-copy {
    max-width: 710px;
    color: #ffffff;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.landing-copy h1 {
    margin: 0;
    color: #ffffff;
    font-family: var(--font-brand);
    font-size: clamp(3.2rem, 7.4vw, 6.4rem);
    line-height: 0.9;
    font-weight: 800;
}

.landing-copy p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.02rem;
    line-height: 1.58;
}

.landing-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 620px;
    margin-top: 28px;
}

.landing-stats div {
    min-height: 78px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

.landing-stats span {
    display: block;
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 780;
    line-height: 1;
}

.landing-stats small {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.auth-grid {
    display: grid;
    gap: 14px;
    align-self: center;
}

.auth-panel,
.dive-card,
.empty-state,
.dive-form,
.profile-hero,
.stats-grid > div,
.feed-rail-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.auth-panel {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.auth-panel.accent {
    border-color: var(--accent-line);
    background: linear-gradient(180deg, rgba(72, 166, 255, 0.12), rgba(17, 24, 32, 0.98));
}

.auth-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(210, 226, 239, 0.2);
    background:
        linear-gradient(180deg, rgba(72, 166, 255, 0.12), transparent 34%),
        rgba(17, 24, 32, 0.94);
    backdrop-filter: blur(18px);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #6ec7ff, var(--sea));
}

.auth-card > * {
    position: relative;
    z-index: 1;
}

.auth-header {
    display: grid;
    gap: 4px;
}

.auth-panel h2 {
    margin: 0;
    font-size: 1.32rem;
}

.auth-panel .primary-button {
    width: 100%;
}

.auth-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.auth-toggle button {
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted-strong);
    background: transparent;
    font-weight: 720;
}

.auth-toggle button.active {
    color: var(--ink);
    border-color: var(--accent-line);
    background: rgba(72, 166, 255, 0.16);
    box-shadow: var(--shadow-xs);
}

.auth-form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: var(--muted-strong);
    font-size: 0.82rem;
    font-weight: 670;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: #0b1118;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

input[type="date"] {
    display: block;
    inline-size: 100%;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}

textarea {
    resize: vertical;
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(72, 166, 255, 0.16);
}

.content-column,
.profile-layout,
.log-layout {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.activity-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) 300px;
    align-items: start;
    gap: 22px;
}

.feed-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.feed-column {
    max-width: 780px;
}

.feed-rail {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 12px;
}

.feed-rail-card {
    overflow: hidden;
}

.profile-rail-card {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.profile-rail-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    color: var(--ink);
}

.profile-rail-head strong {
    display: block;
    overflow: hidden;
    font-size: 1rem;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-rail-head small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 680;
    text-transform: uppercase;
}

.profile-rail-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border: 2px solid rgba(244, 248, 251, 0.88);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 780;
    background:
        linear-gradient(145deg, #0e1620 0%, #202d3a 55%, var(--accent-deep) 56%, #7fc3ff 100%);
    box-shadow: 0 0 0 1px var(--line), var(--shadow-xs);
}

.profile-rail-avatar img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
}

.feed-rail-hero {
    display: grid;
}

.feed-rail-card > div {
    padding: 14px;
}

.feed-rail-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.feed-rail-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

.rail-metric {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.rail-metric span {
    display: block;
    color: var(--accent);
    font-size: 1.24rem;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
}

.rail-metric small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 680;
    text-transform: uppercase;
}

.rail-latest {
    display: grid;
    gap: 6px;
    padding: 14px;
}

.rail-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.rail-latest strong {
    color: var(--ink);
    font-size: 0.96rem;
    font-weight: 720;
    overflow-wrap: anywhere;
}

.rail-latest span {
    color: var(--muted);
    font-size: 0.88rem;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.section-head.slim {
    margin-top: 4px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.section-copy {
    margin: 8px 0 0;
    color: var(--muted);
}

.feed-toolbar {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 680;
}

.feed-list {
    display: grid;
    gap: 12px;
}

.compact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dive-card {
    display: grid;
    gap: 12px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.dive-card:hover,
.dive-card:focus-visible {
    transform: translateY(-1px);
    border-color: var(--accent-line);
    background: #121923;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}

.dive-card-head,
.dive-card-title,
.dive-actions,
.species-row {
    margin-left: 16px;
    margin-right: 16px;
}

.dive-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
}

.dive-card-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.dive-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
}

.dive-card-head strong {
    color: var(--ink);
    font-size: 0.94rem;
    font-weight: 720;
}

.dive-author-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 4px;
}

.dive-author-line > span {
    font-weight: 400;
}

.username-link {
    color: inherit;
    font: inherit;
    text-decoration: inherit;
}

.username-link:hover,
.username-link:focus-visible {
    color: inherit;
    text-decoration: inherit;
}

.dive-card-head p,
.dive-card-head strong,
.profile-hero h1 {
    overflow-wrap: anywhere;
}

.dive-type-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-strong);
    font-size: 0.76rem;
    font-weight: 680;
    line-height: 1;
    text-transform: uppercase;
}

.dive-type-label::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.58;
}

.dive-card-meta .gas-mix-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-strong);
    font-size: 0.76rem;
    font-weight: 680;
    line-height: 1;
    text-transform: uppercase;
}

.dive-card-meta .gas-mix-label::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.58;
}

.dive-type-icon {
    position: relative;
    width: 15px;
    height: 15px;
    border: 1.7px solid currentColor;
    border-radius: 50%;
    opacity: 0.86;
}

.dive-type-icon::before,
.dive-type-icon::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    height: 1.7px;
    border-radius: 999px;
    background: currentColor;
}

.dive-type-icon::before {
    top: 5px;
}

.dive-type-icon::after {
    top: 8px;
    opacity: 0.62;
}

.dive-card-title {
    display: grid;
    gap: 4px;
}

.dive-card-title h2 {
    font-size: 1.18rem;
    line-height: 1.15;
}

.site-name-link {
    color: inherit;
    font: inherit;
    text-decoration: inherit;
}

.dive-card-title p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.dive-location-line a,
.dive-center-line a,
.center-info-grid a {
    color: var(--accent);
}

.dive-location-line a:hover,
.dive-center-line a:hover,
.center-info-grid a:hover {
    text-decoration: underline;
}

.dive-location-line {
    margin: 0;
}

.dive-center-line {
    display: block;
    margin: 1px 0 0;
    color: var(--muted);
}

.dive-center-line > span:first-child {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.activity-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 212px;
    gap: 8px;
    margin: 0 16px;
}

.activity-media.no-photos {
    grid-template-columns: 1fr;
}

.photo-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 8px;
    overflow: hidden;
    min-height: 198px;
    max-height: 198px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b1219;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--accent-line) transparent;
}

.photo-strip img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    scroll-snap-align: start;
}

.dive-card-grid {
    display: grid;
    gap: 12px;
}

.mini-map {
    position: relative;
    overflow: hidden;
    min-height: 198px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b1219;
}

.map-tile-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.map-tile-layer {
    z-index: 1;
    background: #0b1219;
}

.map-tile {
    position: absolute;
    width: 256px;
    height: 256px;
    max-width: none;
    user-select: none;
    filter: brightness(0.62) saturate(0.72);
}

.mini-map::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 44%),
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    pointer-events: none;
    z-index: 2;
}

.map-pin {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid #eaf5ff;
    border-radius: 50% 50% 50% 0;
    background: var(--accent);
    transform: translate(-50%, -78%) rotate(-45deg);
    box-shadow: 0 0 0 5px rgba(72, 166, 255, 0.22), 0 8px 16px rgba(0, 0, 0, 0.28);
}

.map-pending .map-pin {
    display: none;
}

.coordinate-label {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 4;
    max-width: calc(100% - 20px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    color: #ffffff;
    background: rgba(20, 22, 23, 0.64);
    font-size: 0.74rem;
    font-weight: 680;
    backdrop-filter: blur(8px);
}

.map-attribution {
    position: absolute;
    z-index: 4;
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 6px;
    border-radius: 6px;
    color: rgba(244, 248, 251, 0.76);
    background: rgba(5, 8, 12, 0.62);
    font-size: 0.66rem;
}

.map-attribution a {
    color: inherit;
}

.stat-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 16px;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
}

.stat-stack > div,
.stats-grid > div {
    display: grid;
    align-content: center;
    min-height: 70px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.stat-stack span,
.stats-grid span {
    display: block;
    color: var(--ink);
    font-size: 1.32rem;
    font-weight: 760;
    line-height: 1;
}

.stat-stack small,
.stats-grid small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 680;
    text-transform: uppercase;
}

.species-row,
.tag-row,
.suggestion-row,
.dive-actions,
.preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.species-row span,
.tag,
.suggestion-pill {
    max-width: 100%;
    border-radius: 999px;
    padding: 6px 9px;
    border: 1px solid rgba(40, 199, 188, 0.24);
    color: #bff8f2;
    background: rgba(40, 199, 188, 0.09);
    font-size: 0.76rem;
    font-weight: 680;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tag button {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: var(--sea);
}

.suggestion-pill {
    opacity: 0.54;
}

.suggestion-pill.is-selected {
    opacity: 1;
    border-color: rgba(40, 199, 188, 0.48);
}

.dive-actions {
    justify-content: space-between;
    align-items: center;
    padding: 0 0 14px;
}

.chip-button {
    min-width: 70px;
    min-height: 34px;
    padding: 0 11px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.024);
    border-color: var(--line);
    font-size: 0.84rem;
    font-weight: 680;
}

.chip-button:hover,
.chip-button.liked {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.heart-icon {
    position: relative;
    width: 14px;
    height: 14px;
    transform: rotate(-45deg);
    background: currentColor;
}

.heart-icon::before,
.heart-icon::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: currentColor;
}

.heart-icon::before {
    top: -7px;
    left: 0;
}

.heart-icon::after {
    top: 0;
    left: 7px;
}

.comment-icon {
    position: relative;
    width: 16px;
    height: 13px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.comment-icon::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: -5px;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    background: transparent;
    transform: rotate(45deg);
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 24px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.log-layout {
    max-width: 980px;
    min-width: 0;
}

.dive-form {
    display: grid;
    gap: 18px;
    min-width: 0;
    padding: 20px;
}

.form-actions,
.form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.form-footer {
    padding-top: 2px;
}

.form-section {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.form-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--line);
}

.form-section-title h2 {
    font-size: 0.96rem;
}

.form-section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.form-grid > label:not(.autocomplete-field) {
    max-width: 100%;
    overflow: hidden;
}

.form-grid .wide {
    grid-column: span 2;
}

.autocomplete-field {
    position: relative;
    min-width: 0;
}

.autocomplete-menu {
    position: absolute;
    z-index: 25;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    overflow: hidden;
    max-height: 280px;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #0c1219;
    box-shadow: var(--shadow-lg);
}

.autocomplete-menu button {
    width: 100%;
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-align: left;
    background: transparent;
}

.autocomplete-menu button:hover,
.autocomplete-menu button:focus {
    background: var(--accent-soft);
}

.autocomplete-menu small {
    color: var(--muted);
}

.control-panel,
.species-panel {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.control-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.range-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.range-control > div {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.range-control label {
    display: block;
}

.range-control output {
    color: var(--muted-strong);
    font-size: 0.84rem;
    font-weight: 620;
    line-height: 1.2;
}

.range-control input[type="number"] {
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 610;
}

.discrete-range-control {
    grid-template-columns: minmax(0, 1fr);
}

.range-ticks {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 620;
    line-height: 1.15;
    text-align: center;
}

.current-strength-ticks {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.current-strength-control.is-disabled input[type="range"] {
    accent-color: var(--muted);
    cursor: not-allowed;
    opacity: 0.42;
}

.current-strength-control.is-disabled .current-strength-ticks {
    opacity: 0.48;
}

.current-strength-control.is-disabled output {
    color: var(--muted);
}

input[type="range"] {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0;
    accent-color: var(--accent);
    background: transparent;
    border: 0;
    box-shadow: none;
}

.upload-box {
    min-width: 0;
    padding: 14px;
    border: 1px dashed var(--accent-line);
    border-radius: 8px;
    background: var(--accent-soft);
}

.preview-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.preview-row img,
.editable-photo {
    width: 88px;
    height: 88px;
}

.preview-row img {
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.editable-photo {
    position: relative;
    flex: 0 0 auto;
}

.editable-photo img {
    width: 100%;
    height: 100%;
}

.photo-remove-button {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 50%;
    background: rgba(8, 11, 16, 0.92);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 760;
    line-height: 1;
    box-shadow: var(--shadow-xs);
}

.photo-remove-button:hover,
.photo-remove-button:focus-visible {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
}

.profile-layout {
    max-width: 980px;
}

.profile-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    min-height: 218px;
    padding: 0 22px 22px;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(7, 10, 14, 0.08), rgba(7, 10, 14, 0.84)),
        url("../img/ocean-satellite.png") center / cover no-repeat;
}

.profile-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #6ec7ff, var(--sea));
}

.profile-hero > * {
    position: relative;
    z-index: 1;
}

.profile-hero h1 {
    color: #ffffff;
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    font-weight: 780;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.profile-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.profile-hero .eyebrow {
    color: #8fc7ff;
}

.profile-photo-form {
    margin: 0;
}

.profile-avatar {
    width: 106px;
    height: 106px;
    border: 3px solid rgba(239, 248, 255, 0.9);
    border-radius: 50%;
    font-size: 2.3rem;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.profile-avatar input {
    display: none;
}

.static-avatar {
    cursor: default;
}

.center-avatar {
    width: 106px;
    height: 106px;
    display: inline-grid;
    place-items: center;
    border: 3px solid rgba(239, 248, 255, 0.9);
    border-radius: 8px;
    color: #ffffff;
    font-size: 2.3rem;
    font-weight: 780;
    background:
        linear-gradient(145deg, rgba(11, 18, 25, 0.96), rgba(32, 45, 58, 0.92) 55%, var(--sea) 56%, #8debe5 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.center-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.center-info-grid > div {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.center-info-grid small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.center-info-grid span,
.center-info-grid a {
    overflow-wrap: anywhere;
}

.center-map {
    min-height: 300px;
}

.site-avatar {
    background:
        linear-gradient(145deg, rgba(11, 18, 25, 0.96), rgba(32, 45, 58, 0.92) 55%, var(--accent-deep) 56%, #8ccfff 100%);
}

.site-chart-block {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.site-sightings-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.site-sightings-panel h2 {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.site-sightings-panel p {
    margin: 0;
}

.site-sightings-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-sightings-tags strong {
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 760;
}

.site-conditions-panel {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.site-conditions-panel h2 {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.site-conditions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.site-conditions-grid > div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.site-conditions-grid small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.site-conditions-grid span {
    overflow-wrap: anywhere;
}

.site-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.site-chart-head span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 680;
}

.site-line-chart,
.site-bar-chart {
    width: 100%;
    min-height: 180px;
    overflow: visible;
}

.site-line-chart line,
.site-bar-chart line {
    stroke: var(--line-strong);
    stroke-width: 1;
}

.site-line-chart polyline {
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.site-line-chart circle {
    fill: var(--ink);
    stroke: var(--accent);
    stroke-width: 2;
}

.site-bar-chart rect {
    fill: var(--sea);
    rx: 3;
}

.site-chart-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 680;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.dive-detail {
    display: grid;
    gap: 18px;
    max-width: 980px;
    min-width: 0;
    margin: 0 auto;
}

.dive-detail-head,
.dive-detail-title,
.detail-headline-stats,
.detail-panel,
.detail-social {
    min-width: 0;
}

.dive-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dive-detail-author {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dive-detail-author strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 730;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dive-detail-author .dive-author-line {
    display: flex;
    flex-wrap: wrap;
    white-space: normal;
    text-overflow: clip;
}

.dive-detail-author p,
.dive-detail-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.dive-detail-author p,
.dive-detail-title p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.dive-detail-title {
    display: grid;
    gap: 6px;
    padding-bottom: 2px;
}

.dive-detail-title h1 {
    max-width: 840px;
    overflow-wrap: anywhere;
}

.dive-detail-title a,
.detail-metric-list a {
    color: var(--accent);
}

.dive-detail-title a:hover,
.detail-metric-list a:hover {
    text-decoration: underline;
}

.dive-detail-media {
    display: grid;
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
    align-items: stretch;
    gap: 10px;
    min-width: 0;
}

.dive-detail-media.no-photos {
    grid-template-columns: minmax(0, 1fr);
}

.detail-map {
    min-height: 360px;
}

.detail-photo-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    min-height: 360px;
    max-height: 360px;
    min-width: 0;
    scroll-padding: 0;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--accent-line) transparent;
}

.detail-photo-slide {
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0b1219;
    scroll-snap-align: start;
}

.detail-photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-photo-slide:only-child img {
    object-fit: contain;
}

.detail-headline-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(90deg, rgba(72, 166, 255, 0.1), rgba(40, 199, 188, 0.06)),
        var(--panel);
    box-shadow: var(--shadow-sm);
}

.detail-headline-stats div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.detail-headline-stats small,
.detail-panel h2 {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 720;
    text-transform: uppercase;
}

.detail-headline-stats span {
    color: var(--ink);
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 760;
    line-height: 0.95;
}

.detail-headline-stats em {
    margin-left: 8px;
    color: var(--muted-strong);
    font-size: 1rem;
    font-style: normal;
    font-weight: 690;
    text-transform: uppercase;
}

.detail-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.detail-panel,
.detail-social {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.detail-panel h2 {
    margin: 0;
    letter-spacing: 0;
}

.detail-metric-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin: 0;
}

.detail-metric-list div {
    min-width: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.detail-metric-list dt,
.detail-metric-list dd {
    margin: 0;
}

.detail-metric-list dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 690;
    text-transform: uppercase;
}

.detail-metric-list dd {
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 0.96rem;
    font-weight: 590;
    overflow-wrap: anywhere;
}

.detail-species {
    margin: 0;
}

.detail-social .dive-actions {
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.icon-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    color: var(--ink);
    background: rgba(12, 18, 25, 0.84);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.icon-button:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    background: rgba(72, 166, 255, 0.12);
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.danger-button {
    color: var(--danger);
}

.danger-button:hover {
    color: #ffffff;
    border-color: rgba(255, 107, 138, 0.42);
    background: rgba(255, 107, 138, 0.14);
}

.existing-photo-row {
    margin-top: 0;
    padding: 2px 7px 8px 0;
}

.notes-block,
.comments-block {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-tint);
}

.notes-block p,
.comment p {
    margin: 0;
    white-space: pre-wrap;
}

.comments-block {
    display: grid;
    gap: 12px;
}

.comment {
    display: grid;
    gap: 3px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.comment:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.comment strong {
    color: var(--accent);
    font-size: 0.9rem;
}

.comment-form {
    display: flex;
    gap: 8px;
}

.comment-form input {
    min-width: 0;
}

.muted {
    color: var(--muted);
}

@media (max-width: 1040px) {
    .activity-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .feed-rail {
        position: static;
        grid-template-columns: minmax(0, 1fr);
    }

    .feed-rail-card img {
        max-height: 170px;
    }
}

@media (max-width: 820px) {
    .page-shell {
        width: min(680px, calc(100% - 24px));
        padding-top: 86px;
        padding-bottom: 92px;
    }

    .topbar {
        height: 62px;
        padding: 0 14px;
    }

    .desktop-nav,
    .user-corner form {
        display: none;
    }

    .brand {
        min-width: 0;
    }

    .feed-topbar .brand {
        flex: 0 0 auto;
    }

    .topbar-search {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }

    .user-corner {
        min-width: 0;
    }

    .mobile-nav {
        position: fixed;
        z-index: 60;
        left: 12px;
        right: 12px;
        bottom: 12px;
        display: grid;
        grid-template-columns: 1fr 1fr 56px 1fr;
        align-items: center;
        gap: 6px;
        padding: 6px;
        border: 1px solid var(--line-strong);
        border-radius: 8px;
        background: rgba(12, 18, 25, 0.9);
        backdrop-filter: blur(18px);
        box-shadow: var(--shadow-lg);
    }

    .mobile-nav a {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        color: var(--muted-strong);
        font-weight: 720;
    }

    .mobile-nav a.active {
        color: var(--ink);
        background: var(--panel-tint);
    }

    .mobile-nav .mobile-log {
        color: #ffffff;
        font-size: 1.6rem;
        background: var(--accent-deep);
        box-shadow: 0 8px 18px rgba(72, 166, 255, 0.24);
    }

    .feed-rail {
        display: none;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 28px;
        padding: 38px 16px 48px;
    }

    .landing-copy h1 {
        font-size: 4rem;
    }

    .landing-stats {
        grid-template-columns: 1fr;
        max-width: 460px;
    }

    .auth-grid {
        max-width: 460px;
    }

    .section-head {
        align-items: start;
    }

    .log-layout {
        width: 100%;
    }

    .activity-media,
    .dive-card-grid,
    .dive-detail-media,
    .detail-lower-grid,
    .form-grid,
    .control-panel,
    .compact-list,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .wide {
        grid-column: auto;
    }

    .stat-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-hero {
        grid-template-columns: 1fr;
        align-items: end;
        min-height: 300px;
        width: 100%;
    }

    .profile-avatar,
    .center-avatar {
        width: 96px;
        height: 96px;
    }

    .center-info-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dive-detail {
        width: 100%;
    }

    .detail-map {
        min-height: 280px;
    }

    .detail-photo-carousel {
        min-height: 280px;
        max-height: 300px;
    }

    .stats-grid > div {
        width: 100%;
        min-width: 0;
    }

}

@media (max-width: 520px) {
    h1 {
        font-size: 1.85rem;
    }

    .section-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .section-head .primary-button,
    .form-actions,
    .form-footer .primary-button {
        width: 100%;
    }

    .form-actions,
    .form-footer {
        justify-content: stretch;
    }

    .dive-form {
        gap: 16px;
        padding: 14px;
    }

    input[type="date"] {
        padding-right: 8px;
    }

    .feed-topbar .brand > span:last-child {
        display: none;
    }

    .topbar-search input {
        padding-left: 10px;
        padding-right: 10px;
    }

    .control-panel,
    .species-panel,
    .upload-box {
        padding: 12px;
    }

    .landing-copy h1 {
        font-size: 3.15rem;
    }

    .stat-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .range-control {
        grid-template-columns: minmax(0, 1fr) 76px;
    }

    .comment-form {
        display: grid;
    }

    .dive-card-head,
    .dive-card-title,
    .dive-actions,
    .species-row,
    .activity-media,
    .stat-stack {
        margin-left: 14px;
        margin-right: 14px;
    }

    .dive-detail-head {
        align-items: start;
    }

    .detail-headline-stats,
    .detail-metric-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-panel,
    .detail-social {
        padding: 14px;
    }

    .detail-species,
    .detail-social .dive-actions {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 380px) {
    .page-shell {
        width: calc(100% - 16px);
    }

    .dive-form {
        padding: 12px;
    }

    .range-control {
        grid-template-columns: minmax(0, 1fr);
    }

    .range-control input[type="number"] {
        max-width: 9rem;
    }
}

/* --------------------------------------------------------------------------
   Pelagia Current — 2026 visual system
   A crisp, ocean-performance layer built over the original component model.
   -------------------------------------------------------------------------- */

:root {
    --bg: #f3f7fa;
    --bg-raised: #ffffff;
    --bg-wash: #eaf1f5;
    --ink: #09243a;
    --ink-soft: #294457;
    --muted: #718492;
    --muted-strong: #506675;
    --line: rgba(7, 49, 78, 0.09);
    --line-strong: rgba(7, 49, 78, 0.17);
    --panel: #ffffff;
    --panel-tint: #f6f9fb;
    --nav: rgba(5, 38, 64, 0.96);
    --accent: #0878f9;
    --accent-deep: #0766e5;
    --accent-soft: rgba(8, 120, 249, 0.09);
    --accent-line: rgba(8, 120, 249, 0.25);
    --sea: #00a9ad;
    --blue: #0878f9;
    --gold: #d6941e;
    --good: #149b65;
    --danger: #e23f55;
    --coral: #ff5f57;
    --navy: #062a46;
    --navy-deep: #031e33;
    --shadow-xs: 0 1px 2px rgba(4, 34, 55, 0.06);
    --shadow-sm: 0 8px 28px rgba(4, 34, 55, 0.08);
    --shadow-lg: 0 22px 64px rgba(4, 34, 55, 0.16);
    --radius: 18px;
    --radius-sm: 12px;
    --content: 1180px;
    --font-ui: "Avenir Next", Avenir, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-brand: "Avenir Next", Avenir, Inter, "Segoe UI", system-ui, sans-serif;
    color-scheme: light;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 2% 4%, rgba(8, 120, 249, 0.055), transparent 26rem),
        linear-gradient(180deg, #eef5f8 0, var(--bg) 24rem, var(--bg) 100%);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    z-index: -1;
    inset: 72px 0 auto;
    height: 180px;
    opacity: 0.42;
    pointer-events: none;
    background:
        radial-gradient(80% 120px at 12% -25%, transparent 69%, rgba(8, 120, 249, 0.09) 70%, transparent 72%),
        radial-gradient(90% 150px at 86% -48%, transparent 70%, rgba(0, 169, 173, 0.07) 71%, transparent 73%);
}

::selection {
    color: #ffffff;
    background: var(--accent);
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.dive-card:focus-visible {
    outline: 3px solid rgba(8, 120, 249, 0.26);
    outline-offset: 3px;
}

h1,
h2,
h3 {
    color: var(--ink);
    letter-spacing: -0.028em;
}

h1 {
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 800;
}

h2 {
    font-size: 1.18rem;
    font-weight: 760;
}

.page-shell {
    padding: 104px 0 64px;
}

/* Navigation and wordmark */

.topbar {
    height: 72px;
    gap: 22px;
    padding-inline: max(24px, calc((100vw - var(--content)) / 2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(90deg, rgba(3, 30, 51, 0.98), rgba(6, 50, 82, 0.96)),
        var(--navy);
    box-shadow: 0 8px 30px rgba(1, 24, 40, 0.13);
    backdrop-filter: blur(20px) saturate(130%);
}

.brand {
    gap: 11px;
    min-width: 150px;
    color: #ffffff;
    font-family: var(--font-brand);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 11px;
    background: linear-gradient(145deg, #22a7ff 0%, #0878f9 50%, #0757cf 100%);
    box-shadow: 0 8px 20px rgba(0, 15, 36, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.brand-mark::after {
    display: none;
}

.brand-mark svg {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.3;
    stroke-linecap: round;
}

.brand-mark.large {
    width: 66px;
    height: 66px;
    border-radius: 20px;
    box-shadow: 0 18px 44px rgba(0, 20, 46, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.brand-mark.large svg {
    width: 52px;
    height: 52px;
    stroke-width: 2.15;
}

.topbar-search {
    flex-basis: 330px;
    max-width: 420px;
}

.topbar-search::before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 15px;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.68);
    border-radius: 50%;
    transform: translateY(-58%);
    pointer-events: none;
}

.topbar-search::after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 26px;
    top: 25px;
    width: 6px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.68);
    transform: rotate(45deg);
    pointer-events: none;
}

.topbar-search input {
    min-height: 42px;
    padding: 9px 14px 9px 43px;
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.topbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.58);
}

.topbar-search input:focus {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(87, 179, 255, 0.15);
}

.desktop-nav {
    gap: 2px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.desktop-nav a {
    position: relative;
    gap: 7px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 700;
}

.desktop-nav a svg,
.mobile-nav a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: #ffffff;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: none;
}

.desktop-nav a.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -15px;
    height: 3px;
    border-radius: 4px 4px 0 0;
    background: #3db7ff;
}

.desktop-nav .nav-cta,
.primary-button {
    color: #ffffff;
    border-color: var(--accent);
    background: linear-gradient(180deg, #1386ff, #076be9);
    box-shadow: 0 8px 18px rgba(8, 120, 249, 0.2);
}

.desktop-nav .nav-cta {
    margin-left: 5px;
    padding-inline: 15px;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 20px rgba(0, 15, 36, 0.24);
}

.desktop-nav .nav-cta.active::after {
    display: none;
}

.primary-button:hover,
.desktop-nav .nav-cta:hover {
    transform: translateY(-1px);
    border-color: #198bff;
    background: linear-gradient(180deg, #2895ff, #0878f9);
    box-shadow: 0 11px 24px rgba(8, 120, 249, 0.26);
}

.ghost-button {
    color: var(--muted-strong);
    border-color: var(--line-strong);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.topbar .ghost-button {
    color: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.ghost-button:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.topbar .ghost-button:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
}

.mini-avatar {
    width: 38px;
    height: 38px;
    border: 2px solid #ffffff;
    color: #ffffff;
    background: linear-gradient(145deg, #0b3657 0 52%, #1597ff 52% 100%);
    box-shadow: 0 0 0 1px rgba(5, 38, 64, 0.12), 0 5px 14px rgba(5, 38, 64, 0.12);
}

.flash-stack {
    top: 90px;
}

.flash {
    padding: 14px 16px;
    border: 1px solid rgba(8, 120, 249, 0.18);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

/* Landing */

.landing-body {
    background: var(--navy-deep);
}

.landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 420px);
    gap: clamp(42px, 8vw, 120px);
    padding: 64px max(28px, calc((100vw - 1240px) / 2));
    background:
        linear-gradient(90deg, rgba(2, 24, 42, 0.9) 0%, rgba(2, 30, 52, 0.57) 48%, rgba(2, 25, 44, 0.52) 100%),
        linear-gradient(180deg, rgba(0, 24, 43, 0.12), rgba(0, 22, 39, 0.42)),
        url("../img/ocean-hero-v2.jpg") 46% center / cover no-repeat,
        #062a46;
}

.landing-hero::after {
    height: 7px;
    background: linear-gradient(90deg, #0878f9, #2ab6ff 40%, #17c5bd 76%, #88e6d6);
}

.landing-copy {
    max-width: 730px;
    text-shadow: 0 2px 20px rgba(0, 19, 37, 0.28);
}

.landing-brand {
    gap: 18px;
    margin-bottom: 24px;
}

.landing-copy h1 {
    font-size: clamp(3.8rem, 8vw, 7.4rem);
    font-weight: 840;
    letter-spacing: -0.075em;
    line-height: 0.86;
}

.landing-copy p.landing-kicker {
    margin: 0 0 9px;
    color: #6fd1ff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.landing-copy p.landing-tagline {
    max-width: 590px;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.35rem, 2.7vw, 2.2rem);
    font-weight: 650;
    letter-spacing: -0.028em;
    line-height: 1.18;
}

.auth-grid {
    width: 100%;
}

.auth-panel,
.dive-card,
.empty-state,
.dive-form,
.profile-hero,
.stats-grid > div,
.feed-rail-card {
    border-color: var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow-sm);
}

.auth-panel {
    gap: 22px;
    padding: 28px;
}

.auth-card {
    overflow: visible;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 30px 80px rgba(0, 22, 42, 0.32);
    backdrop-filter: blur(24px) saturate(125%);
}

.auth-card::before {
    top: 16px;
    bottom: 16px;
    left: -5px;
    right: auto;
    width: 5px;
    height: auto;
    border-radius: 999px;
    background: linear-gradient(180deg, #0c8cff, #00b7b5);
}

.auth-panel h2 {
    color: var(--ink);
    font-size: 1.5rem;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.auth-toggle {
    gap: 3px;
    padding: 4px;
    border-color: transparent;
    border-radius: 12px;
    background: #edf3f7;
}

.auth-toggle button {
    min-height: 39px;
    border-radius: 9px;
    color: var(--muted-strong);
}

.auth-toggle button.active {
    color: var(--ink);
    border-color: rgba(6, 65, 101, 0.06);
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(4, 34, 55, 0.1);
}

/* Inputs and controls */

label {
    gap: 7px;
    color: var(--muted-strong);
    font-size: 0.77rem;
    font-weight: 760;
    letter-spacing: 0.01em;
}

input,
select,
textarea {
    min-height: 46px;
    border-color: var(--line-strong);
    border-radius: 11px;
    color: var(--ink);
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(4, 34, 55, 0.035);
}

input::placeholder,
textarea::placeholder {
    color: #9aabb6;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(7, 49, 78, 0.28);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(8, 120, 249, 0.11);
}

/* Feed */

.activity-layout {
    grid-template-columns: minmax(0, 730px) 310px;
    gap: 30px;
}

.feed-list {
    gap: 18px;
}

.feed-rail {
    top: 96px;
    gap: 16px;
}

.feed-rail-card {
    overflow: hidden;
    border: 0;
}

.profile-rail-card {
    gap: 18px;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(8, 120, 249, 0.08), transparent 44%),
        #ffffff;
}

.profile-rail-head {
    gap: 13px;
}

.profile-rail-head strong {
    font-size: 1.03rem;
    font-weight: 780;
}

.profile-rail-head small,
.rail-metric small,
.rail-label {
    letter-spacing: 0.07em;
}

.profile-rail-avatar {
    width: 58px;
    height: 58px;
    border-color: #ffffff;
    color: #ffffff;
    background: linear-gradient(145deg, #0b3657 0 52%, #1597ff 52% 100%);
    box-shadow: 0 0 0 1px var(--line), 0 7px 18px rgba(4, 34, 55, 0.11);
}

.rail-metric {
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.rail-metric span {
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 800;
}

.rail-latest {
    gap: 8px;
    padding: 19px;
    border-left: 4px solid var(--accent);
}

.rail-label {
    color: var(--accent);
}

.dive-card {
    gap: 15px;
    border: 1px solid rgba(7, 49, 78, 0.075);
    cursor: pointer;
    box-shadow: 0 7px 24px rgba(4, 34, 55, 0.075);
}

.dive-card:hover,
.dive-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(8, 120, 249, 0.2);
    background: #ffffff;
    box-shadow: 0 16px 38px rgba(4, 34, 55, 0.12);
}

.dive-card-head,
.dive-card-title,
.dive-actions,
.species-row {
    margin-inline: 20px;
}

.dive-card-head {
    gap: 12px;
    padding-top: 20px;
}

.dive-card-head strong {
    color: var(--ink);
    font-size: 0.97rem;
    font-weight: 770;
}

.dive-card-head p {
    color: var(--muted);
    font-size: 0.8rem;
}

.dive-card-title {
    gap: 5px;
}

.dive-card-title h2 {
    font-size: clamp(1.25rem, 2vw, 1.48rem);
    font-weight: 810;
    letter-spacing: -0.035em;
}

.dive-card-title p {
    color: var(--muted);
    font-size: 0.87rem;
}

.dive-type-label,
.dive-card-meta .gas-mix-label {
    color: var(--muted-strong);
    font-size: 0.68rem;
    font-weight: 780;
    letter-spacing: 0.055em;
}

.dive-type-icon {
    color: var(--accent);
}

.dive-center-line a,
.dive-location-line a,
.center-info-grid a,
.dive-detail-title a,
.detail-metric-list a {
    color: var(--accent-deep);
    font-weight: 680;
}

.activity-media {
    grid-template-columns: minmax(0, 1fr) 218px;
    gap: 10px;
    margin-inline: 20px;
}

.photo-strip,
.mini-map,
.detail-photo-slide {
    border-color: rgba(7, 49, 78, 0.1);
    border-radius: 14px;
    background: #dbe6ec;
}

.photo-strip,
.mini-map {
    min-height: 216px;
    max-height: 216px;
}

.map-tile-layer {
    background: #dbe6ec;
}

.map-tile {
    filter: saturate(0.72) contrast(0.94) brightness(1.05);
}

.mini-map::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%, rgba(4, 34, 55, 0.08));
}

.map-pin {
    border-color: #ffffff;
    background: var(--coral);
    box-shadow: 0 0 0 5px rgba(255, 95, 87, 0.2), 0 8px 16px rgba(4, 34, 55, 0.25);
}

.coordinate-label,
.map-attribution {
    border-color: rgba(255, 255, 255, 0.3);
    border-radius: 9px;
    color: #ffffff;
    background: rgba(3, 30, 51, 0.78);
    box-shadow: 0 4px 12px rgba(3, 30, 51, 0.12);
}

.stat-stack {
    gap: 0;
    margin-inline: 20px;
    padding-top: 15px;
    border-top-color: var(--line);
}

.stat-stack > div {
    min-height: 68px;
    padding: 8px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.stat-stack > div + div {
    border-left: 1px solid var(--line);
}

.stat-stack span,
.stats-grid span {
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 820;
    letter-spacing: -0.035em;
}

.stat-stack small,
.stats-grid small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 760;
    letter-spacing: 0.075em;
}

.species-row span,
.tag,
.suggestion-pill {
    border-color: rgba(0, 169, 173, 0.16);
    color: #087d83;
    background: rgba(0, 169, 173, 0.08);
    font-weight: 700;
}

.dive-actions {
    padding: 14px 0 18px;
    border-top: 1px solid var(--line);
}

.chip-button {
    min-width: 66px;
    min-height: 36px;
    border-color: transparent;
    border-radius: 999px;
    color: var(--muted-strong);
    background: #f1f5f7;
    box-shadow: none;
}

.chip-button:hover {
    color: var(--accent);
    border-color: transparent;
    background: var(--accent-soft);
}

.chip-button.liked {
    color: #e94450;
    border-color: transparent;
    background: rgba(255, 95, 87, 0.1);
}

.heart-icon {
    width: 12px;
    height: 12px;
}

.heart-icon::before,
.heart-icon::after {
    width: 12px;
    height: 12px;
}

.heart-icon::before {
    top: -6px;
}

.heart-icon::after {
    left: 6px;
}

.empty-state {
    gap: 12px;
    padding: 36px;
    border-style: dashed;
    box-shadow: none;
}

/* Profiles, sites, and activity detail */

.profile-layout,
.log-layout,
.dive-detail {
    gap: 22px;
}

.profile-hero {
    min-height: 260px;
    padding: 0 28px 28px;
    border: 0;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(2, 28, 49, 0.04) 5%, rgba(2, 27, 47, 0.82) 100%),
        linear-gradient(90deg, rgba(3, 33, 55, 0.18), transparent),
        url("../img/ocean-hero-v2.jpg") 50% 45% / cover no-repeat;
    box-shadow: 0 14px 38px rgba(4, 34, 55, 0.14);
}

.profile-hero::after {
    height: 6px;
    background: linear-gradient(90deg, #0878f9, #36bfff 52%, #17c5bd);
}

.profile-hero h1 {
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 820;
}

.profile-meta {
    color: rgba(255, 255, 255, 0.82);
}

.profile-avatar,
.center-avatar {
    width: 116px;
    height: 116px;
    border: 4px solid #ffffff;
    color: #ffffff;
    background: linear-gradient(145deg, #0b3657 0 52%, #1597ff 52% 100%);
    box-shadow: 0 14px 34px rgba(0, 22, 42, 0.3);
}

.profile-avatar {
    border-radius: 50%;
}

.center-avatar {
    border-radius: 28px;
    background: linear-gradient(145deg, #063d5c, #047c91 52%, #13c2b5 52%);
}

.site-avatar {
    background: linear-gradient(145deg, #073a62, #0867ae 52%, #18a9f5 52%);
}

.profile-actions .primary-button {
    border-color: rgba(255, 255, 255, 0.22);
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.stats-grid > div {
    min-height: 108px;
    padding: 19px;
    border: 0;
    background: #ffffff;
}

.feed-toolbar {
    min-height: 48px;
    color: var(--muted-strong);
    font-size: 0.78rem;
    font-weight: 780;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.compact-list {
    gap: 18px;
}

.center-info-grid,
.site-conditions-grid {
    gap: 12px;
}

.center-info-grid > div,
.site-chart-block,
.site-sightings-panel,
.site-conditions-panel {
    border-color: var(--line);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 5px 20px rgba(4, 34, 55, 0.05);
}

.center-info-grid > div {
    padding: 17px;
}

.center-info-grid small,
.site-sightings-panel h2,
.site-conditions-panel h2,
.site-conditions-grid small {
    color: var(--muted);
    letter-spacing: 0.07em;
}

.site-line-chart polyline {
    stroke: var(--accent);
    stroke-width: 3.5;
}

.site-line-chart circle {
    fill: #ffffff;
    stroke: var(--accent);
}

.site-bar-chart rect {
    fill: var(--sea);
}

.dive-detail-head {
    min-height: 50px;
}

.dive-detail-author strong {
    font-weight: 780;
}

.dive-detail-title {
    gap: 8px;
}

.dive-detail-title h1 {
    font-weight: 830;
}

.dive-detail-media {
    gap: 12px;
}

.detail-map,
.detail-photo-carousel {
    min-height: 390px;
    max-height: 390px;
}

.detail-headline-stats {
    gap: 0;
    padding: 24px;
    border: 0;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 94% 10%, rgba(56, 191, 255, 0.18), transparent 38%),
        linear-gradient(135deg, #062f4e, #074c75);
    box-shadow: 0 14px 34px rgba(4, 34, 55, 0.16);
}

.detail-headline-stats div {
    padding: 5px 20px;
}

.detail-headline-stats div + div {
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.detail-headline-stats small {
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.08em;
}

.detail-headline-stats span {
    color: #ffffff;
    font-weight: 830;
    letter-spacing: -0.055em;
}

.detail-headline-stats em {
    color: #61caff;
}

.detail-panel,
.detail-social {
    padding: 20px;
    border-color: var(--line);
    background: #ffffff;
    box-shadow: 0 7px 24px rgba(4, 34, 55, 0.065);
}

.detail-panel h2 {
    color: var(--muted-strong);
    letter-spacing: 0.075em;
}

.detail-metric-list div {
    border-bottom-color: var(--line);
}

.detail-metric-list dt {
    color: var(--muted);
    letter-spacing: 0.06em;
}

.detail-metric-list dd {
    color: var(--ink-soft);
}

.notes-block,
.comments-block {
    border-color: var(--line);
    border-radius: 14px;
    background: var(--panel-tint);
}

.comment strong {
    color: var(--ink);
}

.comment {
    border-bottom-color: var(--line);
}

/* Forms */

.dive-form {
    gap: 24px;
    padding: 28px;
    border: 0;
}

.section-head {
    align-items: center;
}

.form-section {
    gap: 15px;
}

.form-section-title {
    padding-bottom: 10px;
    border-bottom-color: var(--line);
}

.form-section-title h2 {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 790;
}

.form-grid {
    gap: 15px;
}

.autocomplete-menu {
    border-color: var(--line-strong);
    border-radius: 13px;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.autocomplete-menu button {
    border-bottom-color: var(--line);
    color: var(--ink);
}

.autocomplete-menu button:hover,
.autocomplete-menu button:focus {
    background: var(--accent-soft);
}

.control-panel,
.species-panel {
    gap: 16px;
    padding: 18px;
    border-color: var(--line);
    border-radius: 14px;
    background: #f5f8fa;
}

.range-control output {
    color: var(--accent-deep);
    font-weight: 750;
}

.range-control input[type="number"] {
    color: var(--ink);
    font-weight: 650;
}

input[type="range"] {
    accent-color: var(--accent);
}

.upload-box {
    padding: 18px;
    border-color: rgba(8, 120, 249, 0.3);
    border-radius: 14px;
    color: var(--muted-strong);
    background: rgba(8, 120, 249, 0.055);
}

.preview-row img {
    border-color: var(--line);
    border-radius: 12px;
}

.photo-remove-button {
    border-color: #ffffff;
    color: #ffffff;
    background: var(--navy);
    box-shadow: 0 4px 10px rgba(4, 34, 55, 0.2);
}

.icon-button {
    border-color: var(--line-strong);
    border-radius: 11px;
    color: var(--ink-soft);
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

.icon-button:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    background: var(--accent-soft);
}

.danger-button {
    color: var(--danger);
}

.danger-button:hover {
    color: #ffffff;
    border-color: var(--danger);
    background: var(--danger);
}

/* Responsive tuning */

@media (max-width: 1040px) {
    .activity-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 22px;
    }

    .topbar {
        gap: 14px;
    }

    .topbar-search {
        flex-basis: 230px;
    }
}

@media (max-width: 900px) {
    .activity-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .feed-rail {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .page-shell {
        width: min(700px, calc(100% - 28px));
        padding-top: 90px;
        padding-bottom: 108px;
    }

    .topbar {
        height: 66px;
        padding-inline: 15px;
    }

    body::before {
        inset-block-start: 66px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
    }

    .topbar-search::after {
        top: 22px;
    }

    .mobile-nav {
        left: 16px;
        right: 16px;
        bottom: max(14px, env(safe-area-inset-bottom));
        grid-template-columns: 1fr 68px 1fr;
        gap: 4px;
        padding: 7px;
        border-color: rgba(255, 255, 255, 0.08);
        border-radius: 20px;
        background: rgba(4, 35, 58, 0.96);
        box-shadow: 0 18px 42px rgba(1, 24, 40, 0.28);
        backdrop-filter: blur(20px) saturate(130%);
    }

    .mobile-nav a {
        flex-direction: column;
        gap: 3px;
        min-height: 48px;
        border-radius: 14px;
        color: rgba(255, 255, 255, 0.62);
        font-size: 0.65rem;
        font-weight: 750;
    }

    .mobile-nav a svg {
        width: 20px;
        height: 20px;
    }

    .mobile-nav a.active {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-nav .mobile-log {
        width: 56px;
        min-height: 56px;
        justify-self: center;
        margin-top: -22px;
        border: 4px solid var(--bg);
        border-radius: 50%;
        color: #ffffff;
        font-size: 2rem;
        line-height: 1;
        background: linear-gradient(180deg, #168bff, #0768e5);
        box-shadow: 0 9px 22px rgba(8, 120, 249, 0.34);
    }

    .landing-hero {
        grid-template-columns: 1fr;
        align-content: center;
        gap: 32px;
        padding: 44px 20px 56px;
        background-position: 36% center;
    }

    .landing-copy h1 {
        font-size: clamp(3.7rem, 14vw, 5.3rem);
    }

    .landing-copy p.landing-tagline {
        max-width: 480px;
    }

    .auth-grid {
        max-width: 480px;
    }

    .profile-hero {
        min-height: 320px;
        padding: 24px;
        background-position: 42% center;
    }

    .profile-avatar,
    .center-avatar {
        width: 100px;
        height: 100px;
    }

    .activity-media,
    .dive-detail-media,
    .form-grid,
    .control-panel,
    .compact-list {
        grid-template-columns: 1fr;
    }

    .detail-map,
    .detail-photo-carousel {
        min-height: 300px;
        max-height: 320px;
    }
}

@media (max-width: 560px) {
    .page-shell {
        width: calc(100% - 20px);
    }

    .feed-topbar .brand > span:last-child {
        display: none;
    }

    .topbar-search input {
        padding-left: 39px;
    }

    .topbar .mini-avatar {
        width: 35px;
        height: 35px;
    }

    .auth-panel {
        padding: 22px;
    }

    .landing-brand {
        gap: 13px;
    }

    .brand-mark.large {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }

    .brand-mark.large svg {
        width: 43px;
        height: 43px;
    }

    .dive-card {
        border-radius: 16px;
    }

    .dive-card-head,
    .dive-card-title,
    .dive-actions,
    .species-row,
    .activity-media,
    .stat-stack {
        margin-inline: 15px;
    }

    .activity-media {
        gap: 8px;
    }

    .photo-strip,
    .mini-map {
        min-height: 205px;
        max-height: 205px;
    }

    .stat-stack > div {
        padding-inline: 10px;
    }

    .dive-form {
        padding: 18px;
        border-radius: 16px;
    }

    .section-head {
        align-items: start;
    }

    .section-head .form-actions {
        width: 100%;
    }

    .section-head .form-actions .primary-button {
        flex: 1;
    }

    .profile-hero {
        min-height: 340px;
        border-radius: 16px;
    }

    .stats-grid {
        gap: 9px;
    }

    .stats-grid > div {
        min-height: 96px;
        padding: 15px;
        border-radius: 14px;
    }

    .stats-grid span {
        font-size: 1.3rem;
    }

    .detail-headline-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 17px;
    }

    .detail-headline-stats div {
        padding-inline: 10px;
    }

    .detail-headline-stats span {
        font-size: clamp(2.1rem, 13vw, 3.5rem);
    }

    .detail-headline-stats em {
        display: block;
        margin: 6px 0 0;
        font-size: 0.78rem;
    }
}

@media (max-width: 380px) {
    .topbar {
        gap: 9px;
        padding-inline: 10px;
    }

    .topbar-search::before {
        left: 12px;
    }

    .topbar-search::after {
        left: 23px;
    }

    .topbar-search input {
        padding-left: 35px;
    }

    .mobile-nav {
        left: 9px;
        right: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
