/* Open Boat Life — Maritime Precision (Stitch) */
:root {
  --background: #f8f9ff;
  --on-background: #0d1c2e;
  --surface: #f8f9ff;
  --surface-lowest: #ffffff;
  --surface-low: #eff4ff;
  --surface-container: #e6eeff;
  --surface-high: #dce9ff;
  --surface-highest: #d5e3fc;
  --on-surface: #0d1c2e;
  --on-surface-variant: #44474c;
  --outline: #74777d;
  --outline-variant: #c4c6cd;
  --primary: #00050e;
  --primary-container: #0b1f33;
  --on-primary: #ffffff;
  --on-primary-container: #7587a0;
  --secondary: #006875;
  --secondary-fixed: #9defff;
  --secondary-fixed-dim: #76d4e5;
  --secondary-tint: #f0f9fa;
  --on-secondary: #ffffff;
  --error: #ba1a1a;
  --ok: #22c55e;
  --warn: #f59e0b;
  --line: #e2e8f0;
  --nav-h: 56px;
  --sidebar-w: 320px;
  --overlay-m: 24px;
  --radius: 0.25rem;
  --radius-card: 0.5rem;
  --radius-xl: 0.75rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(13, 28, 46, 0.14);
  --font: "Inter", system-ui, sans-serif;
  --display: "Lexend", system-ui, sans-serif;
  --mono: "Courier Prime", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  color: var(--on-surface);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

body.nav-open {
  overflow: hidden;
}

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

a {
  color: var(--secondary);
  text-decoration: none;
}

a:hover {
  color: #004e59;
}

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

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
  user-select: none;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.wrap.narrow {
  width: min(440px, calc(100% - 32px));
}

.wrap.mid {
  width: min(840px, calc(100% - 32px));
}

.muted {
  color: var(--on-surface-variant);
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 16px;
}

.label-caps {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

/* —— Top command nav (Stitch) —— */
.top-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1200;
  height: var(--nav-h);
  background: rgba(11, 31, 51, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 198, 205, 0.3);
  box-shadow: var(--shadow);
}

.top-nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
}

.top-nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.brand {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--secondary-fixed);
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--secondary-fixed-dim);
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-link {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(117, 135, 160, 0.85);
  padding: 8px 12px;
 /* border-radius: var(--radius-card);*/
  border-bottom: 2px solid transparent;
}

.top-link:hover {
  color: #d1e4ff;
  background: rgba(117, 135, 160, 0.12);
}

.top-link.is-active {
  color: var(--secondary-fixed);
  border-bottom-color: var(--secondary-fixed);
  background: transparent;
}

.top-nav-search {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.top-nav-search .search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--on-primary-container);
}

.top-nav-search input {
  width: 100%;
  border: 1px solid rgba(196, 198, 205, 0.3);
  background: rgba(117, 135, 160, 0.12);
  color: #d1e4ff;
  border-radius: var(--radius-card);
  padding: 8px 12px 8px 34px;
  font: inherit;
  font-size: 12px;
}

.top-nav-search input::placeholder {
  color: rgba(117, 135, 160, 0.7);
}

.top-nav-search input:focus {
  outline: none;
  border-color: var(--secondary-fixed);
  box-shadow: 0 0 0 1px var(--secondary-fixed);
}

.top-nav-spacer {
  flex: 1;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.top-msg-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(196, 198, 205, 0.28);
  background: rgba(117, 135, 160, 0.12);
  color: #d1e4ff;
  text-decoration: none;
}

.top-msg-link:hover,
.top-msg-link.is-active {
  background: rgba(117, 135, 160, 0.22);
  border-color: rgba(196, 198, 205, 0.45);
  color: #fff;
}

.top-msg-link .material-symbols-outlined {
  font-size: 22px;
}

.nav-msg-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff6b4a;
  color: #fff;
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #0b1f33;
  z-index: 2;
}

.top-msg-link .nav-msg-badge,
.site-chat-fab .nav-msg-badge,
.mf-tab .nav-msg-badge {
  position: absolute;
  top: -5px;
  right: -5px;
}

.user-menu-link .nav-msg-badge {
  margin-left: auto;
  box-shadow: none;
}

.footer-link--messages {
  display: inline-flex;
}

.footer-link--messages .nav-msg-badge {
  background: #ff6b4a;
  color: #fff;
  box-shadow: none;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid rgba(196, 198, 205, 0.28);
  border-radius: 999px;
  background: rgba(117, 135, 160, 0.12);
  color: #d1e4ff;
  cursor: pointer;
  font: inherit;
}

.user-menu-toggle:hover,
.user-menu.is-open .user-menu-toggle {
  background: rgba(117, 135, 160, 0.22);
  border-color: rgba(196, 198, 205, 0.45);
}

.user-menu-caret {
  font-size: 18px;
  opacity: 0.8;
  transition: transform 0.15s ease;
}

.user-menu.is-open .user-menu-caret {
  transform: rotate(180deg);
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1300;
  min-width: 240px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.12);
  box-shadow: 0 12px 32px rgba(8, 24, 40, 0.18);
}

.user-menu-head {
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.1);
  margin-bottom: 6px;
}

.user-menu-head strong {
  color: var(--on-surface, #1a2b33);
  font-size: 0.95rem;
}

.user-menu-head span {
  color: var(--on-surface-variant, #5b6b73);
  font-size: 0.8rem;
  word-break: break-all;
}

.user-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--on-surface, #1a2b33);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.user-menu-link .material-symbols-outlined {
  font-size: 18px;
  color: var(--secondary, #006875);
}

.user-menu-link:hover,
.user-menu-link.is-active {
  background: rgba(0, 104, 117, 0.08);
}

.user-menu-link--danger {
  color: #93000a;
}

.user-menu-link--danger .material-symbols-outlined {
  color: #93000a;
}

.user-menu-divider {
  height: 1px;
  margin: 6px 4px;
  background: rgba(15, 76, 92, 0.1);
}

.top-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(196, 198, 205, 0.3);
  overflow: hidden;
  flex-shrink: 0;
  object-fit: cover;
  padding: 0;
}

.top-avatar--photo {
  background: #d7e3e7;
}

.top-user-name {
  font-size: 12px;
  font-weight: 600;
}

.top-action {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-primary-container);
  padding: 8px 10px;
  border-radius: var(--radius-card);
}

.top-action:hover {
  color: var(--secondary-fixed);
  background: rgba(117, 135, 160, 0.12);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-card);
  background: rgba(117, 135, 160, 0.15);
  place-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #d1e4ff;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 14px;
  background: var(--primary-container);
  border-bottom: 1px solid rgba(196, 198, 205, 0.25);
}

.mobile-nav a {
  color: #d1e4ff;
  padding: 10px 12px;
  border-radius: var(--radius-card);
  font-weight: 600;
  font-size: 13px;
}

.mobile-nav a:hover {
  background: rgba(117, 135, 160, 0.15);
}

.site-main {
  padding-top: var(--nav-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main--map {
  position: relative;
  padding-top: 0;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

/* —— Buttons —— */
.btn,
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary-container);
  color: var(--on-primary);
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover,
.nav-cta:hover {
  background: var(--primary);
  color: #fff;
}

.btn:active {
  transform: scale(0.98);
}

.btn-compact {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: var(--radius-card);
  background: var(--secondary);
}

.btn-compact:hover {
  background: #004e59;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-card);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  background: #fff;
  color: var(--on-surface);
  box-shadow: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn-ghost:hover {
  background: var(--secondary-tint);
  border-color: rgba(0, 104, 117, 0.35);
  color: var(--secondary);
}

.btn.btn-ghost {
  min-height: auto;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: var(--radius);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: #93000a;
  color: #fff;
}

/* Shared tracking actions (Live track + My routes) */
.mf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.mf-btn .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 20;
}

.mf-btn--primary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 104, 117, 0.28);
}

.mf-btn--primary:hover {
  background: #004e59;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 104, 117, 0.28);
}

.mf-btn--ghost {
  background: #fff;
  color: var(--on-surface);
  border-color: var(--outline-variant);
}

.mf-btn--ghost:hover {
  background: var(--secondary-tint);
  border-color: rgba(0, 104, 117, 0.35);
  color: var(--secondary);
}

.mf-btn--soft {
  background: rgba(0, 104, 117, 0.08);
  color: var(--secondary);
}

.mf-btn--soft:hover {
  background: rgba(0, 104, 117, 0.14);
  color: #004e59;
}

.mf-btn--danger {
  background: #fff;
  color: #9b1c1c;
  border-color: rgba(186, 26, 26, 0.3);
}

.mf-btn--danger:hover {
  background: rgba(186, 26, 26, 0.08);
  border-color: rgba(186, 26, 26, 0.45);
  color: #7f1d1d;
}

.mf-btn--sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
  gap: 4px;
}

.mf-btn--sm .material-symbols-outlined {
  font-size: 16px;
}

.mf-btn--block {
  width: 100%;
}

.mf-btn:active {
  transform: scale(0.98);
}

.mf-btn:disabled,
.mf-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.boat-danger-zone {
  margin-top: 20px;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(186, 26, 26, 0.22);
  background: #fff8f7;
}

.boat-danger-zone h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--error);
}

.boat-danger-zone p {
  margin: 0;
  max-width: 42rem;
}

/* —— Content —— */
.flash {
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}

.flash-ok {
  background: #e8f8ef;
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.flash-error {
  background: #ffdad6;
  color: #93000a;
  border: 1px solid rgba(186, 26, 26, 0.2);
}

.flash-dismiss {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 18px;
  line-height: 1;
}

.section {
  padding: 32px 0 64px;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--on-surface);
}

.lede {
  color: var(--on-surface-variant);
  margin: 0 0 24px;
  max-width: 40rem;
}

.card {
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.field-label .material-symbols-outlined {
  font-size: 18px;
  line-height: 1;
  color: var(--secondary);
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.boat-links-fieldset > legend .field-label {
  margin-bottom: 0;
}

.data-row .field-label {
  margin-bottom: 0;
  color: inherit;
}

.data-row .field-label .material-symbols-outlined {
  font-size: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.boat-links-fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.55);
}

.boat-links-fieldset legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.boat-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .boat-links-grid {
    grid-template-columns: 1fr;
  }
}

label {
  display: grid;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--on-surface);
  background: var(--surface);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 1px var(--secondary);
}

.auth-hero {
  min-height: calc(100vh - var(--nav-h) - 120px);
  display: grid;
  place-items: center;
  padding: 40px 0;
  position: relative;
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(145, 238, 255, 0.25), transparent 42%),
    radial-gradient(circle at 80% 80%, rgba(213, 227, 252, 0.7), transparent 45%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
}

.auth-card h1 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand h1 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-footer {
  margin-top: auto;
  background:
    linear-gradient(180deg, rgba(0, 104, 117, 0.18), transparent 28%),
    var(--primary-container);
  color: rgba(209, 228, 255, 0.78);
  padding: 48px 0 28px;
  border-top: 1px solid rgba(145, 238, 255, 0.16);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(128px, 1fr));
  gap: 40px 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(196, 198, 205, 0.14);
}

.footer-grid--compact {
  grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 0.8fr);
}

.footer-brand {
  max-width: 280px;
}

.footer-logo {
  display: inline-block;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--secondary-fixed);
  text-decoration: none;
}

.footer-logo:hover {
  color: #fff;
}

.footer-tagline {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(209, 228, 255, 0.68);
}

.footer-col {
  display: grid;
  align-content: start;
  gap: 2px;
}

.footer-heading {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary-fixed);
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 5px 0;
  color: rgba(209, 228, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
}

.footer-link:hover {
  color: #fff;
}

.footer-link-btn {
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 20px;
  font-size: 0.8rem;
  color: rgba(209, 228, 255, 0.5);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom-note {
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

@media (max-width: 560px) {
  .footer-grid,
  .footer-grid--compact {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

.legal-page .legal-card {
  padding: 24px 28px;
  display: grid;
  gap: 8px;
}

.legal-page .legal-card h2 {
  margin: 18px 0 4px;
  font-size: 1.15rem;
  font-family: var(--display);
  color: var(--on-surface);
}

.legal-page .legal-card h2:first-child {
  margin-top: 0;
}

.legal-page .legal-card p,
.legal-page .legal-card li {
  color: var(--on-surface-variant);
  line-height: 1.55;
}

.legal-page .legal-card ul {
  margin: 0 0 8px;
  padding-left: 1.2rem;
}

.legal-related {
  margin-top: 20px !important;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.faq-wrap {
  max-width: 760px;
}

.page-faq .section {
  padding-top: 28px;
}

.faq-head {
  margin-bottom: 36px;
}

.faq-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
}

.faq-head .lede {
  margin-bottom: 20px;
}

.faq-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-toc-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--outline-variant);
  background: #fff;
  color: var(--on-surface);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.faq-toc-link:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.faq-section {
  scroll-margin-top: calc(var(--nav-h) + 16px);
  margin-bottom: 28px;
}

.faq-section-title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  background: var(--surface-lowest);
  box-shadow: var(--shadow);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--on-surface);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::marker {
  content: '';
}

.faq-q {
  min-width: 0;
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--secondary);
  transition: transform 0.18s ease;
}

.faq-item[open] summary {
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 4px 16px 16px;
}

.faq-answer p {
  margin: 10px 0 0;
  color: var(--on-surface-variant);
  line-height: 1.55;
}

.faq-related {
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--outline-variant);
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3000;
  max-width: 720px;
  margin: 0 auto;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--radius-xl);
  background: rgba(11, 31, 51, 0.96);
  color: #d1e4ff;
  border: 1px solid rgba(157, 239, 255, 0.2);
  box-shadow: 0 16px 40px rgba(8, 24, 40, 0.35);
  backdrop-filter: blur(12px);
}

.cookie-banner-copy {
  flex: 1 1 280px;
  min-width: 0;
}

.cookie-banner-copy strong {
  display: block;
  color: var(--secondary-fixed);
  font-family: var(--display);
  margin-bottom: 4px;
}

.cookie-banner-copy p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(209, 228, 255, 0.82);
}

.cookie-banner-copy a {
  color: var(--secondary-fixed);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-banner-actions .btn-ghost {
  color: #d1e4ff;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(209, 228, 255, 0.35);
}

.cookie-banner-actions .btn-ghost:hover {
  background: rgba(117, 135, 160, 0.2);
  color: #fff;
}

.cookie-banner-actions .btn {
  background: var(--secondary);
}

.cookie-banner-actions .btn:hover {
  background: #004e59;
}

body.page-map .cookie-banner,
body.page-chat .cookie-banner,
body.page-messages .cookie-banner {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 600px) {
  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions .btn,
  .cookie-banner-actions .btn-ghost {
    flex: 1;
  }
}

/* —— Map —— */
html:has(body.page-map),
body.page-map {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body.page-map {
  height: 100dvh;
  background: #e6eeff;
}

.page-map {
  overflow: hidden;
  background: #e6eeff;
}

.page-map .flash {
  position: absolute;
  top: calc(var(--nav-h) + 16px);
  right: var(--overlay-m);
  z-index: 40;
  width: min(320px, calc(100% - 48px));
  margin: 0;
}

.map-shell {
  position: relative;
  width: 100%;
  height: calc(100dvh - var(--nav-h));
}

.page-map .map-shell {
  position: absolute;
  inset: var(--nav-h) 0 0 0;
  width: 100%;
  height: auto;
  min-height: 0;
}

#map,
#edit-map,
#profile-map {
  width: 100%;
  height: 100%;
  background: #dce9ff;
}

#edit-map {
  height: 280px;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--line);
}

.edit-map-wrap {
  position: relative;
  isolation: isolate;
}

.edit-map-wrap #edit-map {
  width: 100%;
}

.edit-map-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-map-tools .map-tool-btn {
  pointer-events: auto;
  box-shadow: var(--shadow);
}

.page-map #map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.page-map .leaflet-container {
  width: 100% !important;
  height: 100% !important;
  font: inherit;
}

.map-panel {
  position: absolute;
  top: var(--overlay-m);
  left: var(--overlay-m);
  width: min(var(--sidebar-w), calc(100% - 48px));
  max-height: calc(100% - 48px);
  overflow: auto;
  z-index: 500;
  background: var(--surface-lowest);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.map-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--secondary-tint);
  border-bottom: 1px solid rgba(196, 198, 205, 0.5);
}

.map-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.map-panel-collapse {
  display: grid;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--on-surface-variant);
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.map-panel-collapse:hover {
  background: rgba(0, 104, 117, 0.1);
  color: var(--secondary);
}

.map-panel-collapse .material-symbols-outlined {
  font-size: 20px;
}

.map-panel.is-collapsed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
}

.map-panel-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: var(--overlay-m);
  left: var(--overlay-m);
  z-index: 520;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(15, 76, 92, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--secondary);
  box-shadow: 0 6px 18px rgba(13, 28, 46, 0.16);
  cursor: pointer;
  padding: 0;
}

.map-panel-fab[hidden] {
  display: none !important;
}

.map-panel-fab:hover {
  background: #fff;
}

.map-panel-fab:active {
  transform: scale(0.96);
}

.map-panel-fab .material-symbols-outlined {
  font-size: 26px;
}

.map-panel-fab-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-container);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(13, 28, 46, 0.2);
}

.map-panel h1 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--on-surface);
}

.map-count {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-container);
  color: #fff;
}

.map-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--on-surface-variant);
}

.map-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

.map-status-dot.is-loading {
  background: var(--warn);
}

.map-status-dot.is-error {
  background: var(--error);
}

.map-tools {
  padding: 12px 16px;
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.page-map .map-tools #boat-search {
  display: none;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid transparent;
  background: var(--surface-low);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.chip.active {
  background: var(--primary-container);
  color: #fff;
}

#boat-list {
  padding: 4px 0;
}

.boat-mini {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  min-height: 40px;
  color: inherit;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.boat-mini:nth-child(even) {
  background: rgba(239, 244, 255, 0.55);
}

.boat-mini:hover,
.boat-mini.is-active {
  background: var(--surface-container);
  color: inherit;
}

.boat-mini img,
.photo-fallback {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-high);
}

.photo-fallback {
  display: grid;
  place-items: center;
  font-size: 16px;
}

.boat-mini strong {
  display: block;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
}

.boat-mini span {
  color: var(--on-surface-variant);
  font-size: 11px;
}

.boat-mini-meta {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--secondary);
  white-space: nowrap;
}

.map-tools-right {
  position: absolute;
  top: calc(var(--overlay-m) + 8px);
  right: var(--overlay-m);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

.map-tool-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(15, 76, 92, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--on-surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 28, 46, 0.12);
  transition: background 0.15s ease, transform 0.12s ease;
}

.map-tool-btn:hover {
  background: #fff;
  color: var(--secondary);
}

.map-tool-btn:active {
  transform: scale(0.96);
}

.map-tool-btn.is-loading {
  opacity: 0.7;
}

.map-tool-btn .material-symbols-outlined {
  font-size: 22px;
}

.map-search-mobile {
  display: none;
}

.map-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 104, 117, 0.12);
  color: var(--secondary);
}

.badge-motor {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.badge-other {
  background: rgba(100, 116, 139, 0.14);
  color: #475569;
}

.badge-status-underway {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.badge-status-anchored {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.badge-status-moored {
  background: rgba(117, 135, 160, 0.18);
  color: #36485e;
}

.badge-admin {
  background: rgba(15, 76, 92, 0.16);
  color: var(--primary, #0f4c5c);
}

.leaflet-container {
  font-family: var(--font);
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: none !important;
  display: none !important;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--outline-variant);
  padding: 0;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0;
  line-height: 1.4;
}

.leaflet-popup-tip-container {
  margin-top: -1px;
}

.popup-card {
  width: 280px;
}

.popup-head {
  background: var(--secondary-tint);
  border-bottom: 1px solid rgba(196, 198, 205, 0.5);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.popup-head strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--on-surface);
}

.popup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}

.popup-dot.is-moored {
  background: var(--outline);
}

.popup-dot.is-anchored {
  background: var(--warn);
}

.popup-body {
  padding: 12px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
}

.popup-body img,
.popup-body .photo-fallback {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(196, 198, 205, 0.35);
  background: var(--surface);
}

.popup-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.popup-stats span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.popup-stats b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--on-surface);
}

.popup-foot {
  padding: 8px 12px;
  border-top: 1px solid rgba(196, 198, 205, 0.35);
  background: var(--surface);
  display: flex;
  justify-content: flex-end;
}

.popup-foot a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.boat-marker {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
  cursor: pointer;
}

.boat-marker.is-highlighted {
  overflow: visible !important;
}

.marker-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}

.marker-wrap.is-highlighted {
  width: 56px;
  height: 56px;
}

.marker-ring {
  display: none;
}

.marker-wrap.is-highlighted .marker-ring {
  display: block;
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 3px solid #00c2d2;
  background: rgba(0, 104, 117, 0.18);
  box-shadow:
    0 0 0 6px rgba(0, 194, 210, 0.2),
    0 10px 24px rgba(15, 76, 92, 0.35);
  animation: mf-marker-pulse 1.5s ease-out infinite;
}

.marker-wrap.is-highlighted .marker-icon {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
}

@keyframes mf-marker-pulse {
  0% {
    transform: scale(0.92);
    opacity: 1;
  }
  70% {
    transform: scale(1.18);
    opacity: 0.35;
  }
  100% {
    transform: scale(0.92);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marker-wrap.is-highlighted .marker-ring {
    animation: none;
  }
}

.marker-icon {
  width: 24px;
  height: 24px;
  transform-origin: 50% 60%;
  filter: drop-shadow(0 2px 3px rgba(11, 31, 51, 0.35));
}

.boat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.boat-card {
  background: var(--surface-lowest);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.boat-card:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.boat-card img,
.boat-card .photo-fallback {
  width: 100%;
  height: 148px;
  object-fit: cover;
  border-radius: 0;
}

.boat-card-body {
  padding: 12px 14px 14px;
}

.boat-card-body h2 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  margin: 6px 0 4px;
}

.profile-page {
  background: var(--background);
}

.profile-hero-bleed {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  padding: 40px clamp(24px, 5vw, 56px) 48px;
  background:
    linear-gradient(180deg, rgba(11, 31, 51, 0.2) 0%, rgba(11, 31, 51, 0.55) 45%, rgba(11, 31, 51, 0.9) 100%),
    var(--hero-image, none) center / cover no-repeat,
    linear-gradient(145deg, #0b1f33, #16324a 55%, #006875);
  color: #fff;
}

.profile-hero-bleed--empty {
  min-height: 320px;
}

.profile-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(11, 31, 51, 0.55) 50%, rgba(11, 31, 51, 0.88) 100%);
  pointer-events: none;
}

.profile-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
}

.profile-hero-bleed .wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0;
}

.profile-crumb {
  margin: 0 0 32px;
  font-size: 12px;
  color: rgba(209, 228, 255, 0.8);
}

.profile-crumb a {
  color: var(--secondary-fixed);
}

.profile-crumb span {
  margin: 0 8px;
  opacity: 0.5;
}

.profile-hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}

.profile-hero-bottom > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 44rem;
}

.profile-chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.profile-title {
  font-family: var(--display);
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: #fff;
  line-height: 1.1;
}

.profile-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0;
  color: #d7e6f5;
  font-size: 0.95rem;
}

.profile-owner .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.9;
}

.profile-owner a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.profile-owner a:hover {
  border-bottom-color: #fff;
}

.profile-owner-handle {
  opacity: 0.75;
  font-size: 0.88rem;
}

.profile-meta {
  margin: 0;
  color: #c9d8ee;
  font-size: 13px;
  line-height: 1.55;
}

.profile-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.profile-social-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(8, 22, 36, 0.28);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.profile-social-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  color: #fff;
  transform: translateY(-1px);
}

.profile-social-btn:focus-visible {
  outline: 2px solid #9defff;
  outline-offset: 3px;
}

.profile-social-btn .material-symbols-outlined {
  font-size: 22px;
}

.profile-social-svg {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 2px;
  align-items: center;
}

.profile-hero-actions .btn {
  margin: 0;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-chat-form {
  display: inline;
  margin: 0;
}

.boat-chat-fab-form {
  margin: 0;
}

.boat-chat-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1150;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--secondary, #006875);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(8, 24, 40, 0.28);
  cursor: pointer;
}

.boat-chat-fab:hover {
  filter: brightness(1.06);
  color: #fff;
}

.boat-chat-fab .material-symbols-outlined {
  font-size: 20px;
}

.site-chat-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 1150;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--secondary, #006875);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(8, 24, 40, 0.28);
}

.site-chat-fab:hover {
  filter: brightness(1.06);
  color: #fff;
}

.site-chat-fab .material-symbols-outlined {
  font-size: 20px;
}

body.page-map .site-chat-fab {
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 24px));
}

@media (max-width: 900px) {
  body.page-map .site-chat-fab {
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
    right: 16px;
  }

  .site-chat-fab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .site-chat-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

.chat-boat-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.chat-boat-banner .material-symbols-outlined {
  color: var(--secondary, #006875);
  font-size: 28px;
}

.chat-boat-banner p {
  margin: 2px 0 0;
  font-size: 0.88rem;
}

.chat-boat-banner > div {
  flex: 1;
  min-width: 0;
}

.thread-empty {
  list-style: none;
  padding: 24px 8px;
  text-align: center;
}

/* —— Messages / pro chat desk —— */
body.page-messages {
  background:
    radial-gradient(900px 320px at 100% 0%, rgba(0, 104, 117, 0.07), transparent 55%),
    var(--background);
}

.site-main--messages {
  background: transparent;
}

body.page-messages .messages-desk.section {
  padding-top: 20px;
  padding-bottom: 20px;
}

.messages-desk {
  padding-bottom: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messages-desk-wrap {
  max-width: 1120px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.messages-desk-head {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.messages-desk-title {
  margin: 0;
}

.messages-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  height: calc(100dvh - var(--nav-h) - 8.5rem);
  min-height: 460px;
  max-height: 820px;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.12);
  border-radius: calc(var(--radius-xl) + 2px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.messages-list-pane,
.messages-thread-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.messages-list-pane {
  border-right: 1px solid rgba(15, 76, 92, 0.1);
  background: #fcfdfe;
}

.messages-search {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 14px 14px 10px;
  padding: 0 12px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: #fff;
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.messages-search:focus-within {
  border-color: rgba(0, 104, 117, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 104, 117, 0.1);
}

.messages-search .material-symbols-outlined {
  color: var(--on-surface-variant);
  font-size: 20px;
}

.messages-search input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 2px !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  font: inherit;
  font-size: 0.95rem;
  color: var(--on-surface);
  outline: none;
  width: 100%;
}

.messages-list {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.messages-list-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background 0.15s ease;
}

.messages-list-row:hover {
  background: rgba(0, 104, 117, 0.05);
}

.messages-list-row.is-active {
  background: rgba(0, 104, 117, 0.08);
  border-left-color: var(--secondary);
}

.messages-list-row.is-unread .messages-list-preview {
  color: var(--on-surface);
  font-weight: 600;
}

.chat-avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-avatar--md {
  width: 42px;
  height: 42px;
  font-size: 0.95rem;
}

.messages-list-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.messages-list-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.messages-list-top strong {
  color: var(--secondary);
  font-size: 0.98rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-list-top time {
  color: var(--on-surface-variant);
  font-size: 0.74rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.messages-list-preview {
  color: var(--on-surface-variant);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-list-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff6b4a;
  color: #fff;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.messages-filter-empty {
  margin: 0;
  padding: 18px 16px;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.92rem;
}

.messages-list-empty,
.messages-thread-empty {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 40px 28px;
  text-align: center;
  color: var(--on-surface-variant);
}

.messages-list-empty .material-symbols-outlined,
.messages-thread-empty .material-symbols-outlined {
  font-size: 40px;
  color: rgba(15, 76, 92, 0.28);
}

.messages-thread-empty h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--on-surface);
}

.messages-thread-empty p {
  margin: 0;
  max-width: 28rem;
  line-height: 1.55;
  font-size: 0.95rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background: #fff;
}

.chat-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.1);
  background: #fff;
  flex-shrink: 0;
}

.chat-back {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  color: var(--secondary);
  text-decoration: none;
  background: #fff;
}

.chat-peer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.chat-peer-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-peer-text strong {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-peer-text span {
  font-size: 0.82rem;
  color: var(--on-surface-variant);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-menu {
  position: relative;
}

.chat-menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: #fff;
  color: var(--on-surface-variant);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-menu-toggle:hover,
.chat-menu-toggle[aria-expanded="true"] {
  color: var(--secondary);
  border-color: rgba(0, 104, 117, 0.28);
  background: rgba(0, 104, 117, 0.06);
}

.chat-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 200px;
  padding: 8px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 2px;
}

.chat-menu-panel[hidden] {
  display: none;
}

.chat-menu-panel form {
  margin: 0;
}

.chat-menu-panel a,
.chat-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--on-surface);
  text-decoration: none;
  font: inherit;
  font-size: 0.94rem;
  text-align: left;
  cursor: pointer;
}

.chat-menu-panel a:hover,
.chat-menu-panel button:hover {
  background: rgba(0, 104, 117, 0.08);
}

.chat-menu-panel .material-symbols-outlined {
  font-size: 20px;
  color: var(--secondary);
}

.chat-menu-panel .is-danger {
  color: #93000a;
}

.chat-menu-panel .is-danger .material-symbols-outlined {
  color: #93000a;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px 18px;
  background:
    radial-gradient(700px 240px at 50% 0%, rgba(0, 104, 117, 0.05), transparent 55%),
    #f5f8fa;
}

.chat-thread {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 720px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--on-surface-variant);
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 48px 16px;
}

.chat-empty .material-symbols-outlined {
  font-size: 36px;
  color: var(--secondary);
}

.chat-empty strong {
  color: var(--on-surface);
  font-family: var(--display);
}

.chat-day {
  display: grid;
  place-items: center;
  margin: 4px 0;
}

.chat-day span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 76, 92, 0.1);
  color: var(--on-surface-variant);
  font-size: 0.75rem;
  font-weight: 600;
}

.chat-bubble {
  display: grid;
  gap: 4px;
  max-width: min(72%, 440px);
  justify-items: start;
}

.chat-bubble.is-mine {
  margin-left: auto;
  justify-items: end;
}

.chat-bubble.is-stacked {
  margin-top: -4px;
}

.chat-bubble.has-media {
  max-width: min(78%, 320px);
}

.chat-bubble-body {
  padding: 11px 14px;
  border-radius: 16px;
  border-top-left-radius: 5px;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.1);
  color: var(--on-surface);
  font-size: 0.96rem;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 76, 92, 0.05);
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.chat-bubble.has-media .chat-bubble-body {
  padding: 0;
  gap: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.chat-bubble.has-media .chat-bubble-text {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.1);
  box-shadow: 0 1px 2px rgba(15, 76, 92, 0.05);
}

.chat-bubble.is-mine .chat-bubble-body {
  background: linear-gradient(160deg, #007988 0%, #006875 100%);
  color: #fff;
  border-color: transparent;
  border-top-left-radius: 16px;
  border-top-right-radius: 5px;
  box-shadow: 0 6px 16px rgba(0, 104, 117, 0.2);
}

.chat-bubble.is-mine.has-media .chat-bubble-body {
  background: transparent;
  box-shadow: none;
  color: var(--on-surface);
}

.chat-bubble.is-mine.has-media .chat-bubble-text {
  background: linear-gradient(160deg, #007988 0%, #006875 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 104, 117, 0.2);
}

.chat-bubble.is-stacked:not(.is-mine) .chat-bubble-body {
  border-top-left-radius: 12px;
}

.chat-bubble.is-stacked.is-mine .chat-bubble-body {
  border-top-right-radius: 12px;
}

.chat-bubble-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  line-height: 0;
  background: #e8eef0;
  cursor: zoom-in;
  box-shadow: 0 4px 14px rgba(15, 76, 92, 0.12);
}

.chat-bubble-media img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  pointer-events: none;
}

.chat-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 10000;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  justify-items: center;
  padding: 56px 20px 16px;
  box-sizing: border-box;
  margin: 0;
  background: rgba(8, 22, 36, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.chat-lightbox[hidden] {
  display: none !important;
}

body.chat-lightbox-open {
  overflow: hidden;
}

.chat-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  cursor: default;
}

.chat-lightbox-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(960px, calc(100vw - 120px));
  max-height: calc(100dvh - 180px);
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.chat-lightbox-count {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.chat-lightbox-count[hidden] {
  display: none;
}

.chat-lightbox-close,
.chat-lightbox-nav {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-lightbox-close:hover,
.chat-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.chat-lightbox-close {
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
}

.chat-lightbox-prev {
  top: 50%;
  left: max(10px, env(safe-area-inset-left, 0px));
  transform: translateY(-50%);
}

.chat-lightbox-next {
  top: 50%;
  right: max(10px, env(safe-area-inset-right, 0px));
  transform: translateY(-50%);
}

.chat-lightbox-nav[hidden] {
  display: none;
}

.chat-lightbox-close .material-symbols-outlined,
.chat-lightbox-nav .material-symbols-outlined {
  font-size: 24px;
}

.chat-lightbox-thumbs {
  display: flex;
  gap: 8px;
  max-width: min(920px, 100%);
  overflow-x: auto;
  padding: 10px 4px 4px;
  scrollbar-width: thin;
  cursor: default;
}

.chat-lightbox-thumbs[hidden] {
  display: none;
}

.chat-lightbox-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.chat-lightbox-thumb:hover {
  opacity: 1;
}

.chat-lightbox-thumb.is-active {
  opacity: 1;
  border-color: #9defff;
  transform: translateY(-2px);
}

.chat-lightbox-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@media (max-width: 720px) {
  .chat-lightbox {
    padding: 52px 12px 12px;
  }

  .chat-lightbox-img {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 170px);
  }

  .chat-lightbox-prev,
  .chat-lightbox-next {
    display: none;
  }

  .chat-lightbox-thumb {
    width: 56px;
    height: 56px;
  }
}

.chat-bubble-time {
  font-size: 0.7rem;
  color: var(--on-surface-variant);
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.chat-composer {
  flex-shrink: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(15, 76, 92, 0.1);
  background: #fff;
  display: grid;
  gap: 10px;
}

.chat-attach-preview {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: #f3f7f8;
}

.chat-attach-preview[hidden] {
  display: none;
}

.chat-attach-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-attach-clear {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.72);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-attach-clear .material-symbols-outlined {
  font-size: 16px;
}

.chat-compose {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px 8px 8px 8px;
  border-radius: 18px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: #f7fbfc;
}

.chat-compose:focus-within {
  border-color: rgba(0, 104, 117, 0.4);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 104, 117, 0.1);
}

.chat-compose-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-bottom: 2px;
}

.chat-emoji {
  position: relative;
}

.chat-tool {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--on-surface-variant);
  display: grid;
  place-items: center;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.chat-tool:hover,
.chat-tool[aria-expanded="true"] {
  color: var(--secondary);
  background: rgba(0, 104, 117, 0.08);
}

.chat-tool .material-symbols-outlined {
  font-size: 22px;
}

.chat-emoji-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 50;
  width: min(280px, calc(100vw - 48px));
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  border-radius: 16px;
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.chat-emoji-panel[hidden] {
  display: none;
}

.chat-emoji-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.chat-emoji-btn:hover {
  background: rgba(0, 104, 117, 0.08);
}

.chat-compose textarea {
  width: 100%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  resize: none;
  min-height: 24px !important;
  max-height: 140px;
  padding: 10px 0 !important;
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--on-surface);
}

.chat-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--secondary);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}

.chat-send:hover:not(:disabled) {
  background: #004e59;
  transform: translateY(-1px);
}

.chat-send:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.chat-send .material-symbols-outlined {
  font-size: 20px;
  margin-left: 1px;
}

.page-messages .mf-tabbar {
  display: none;
}

@media (max-width: 900px) {
  .messages-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - var(--nav-h) - 9rem);
    max-height: none;
  }

  .messages-list-pane {
    border-right: 0;
  }

  .messages-thread-pane {
    display: none;
  }

  body.page-messages.has-thread .messages-list-pane {
    display: none;
  }

  body.page-messages.has-thread .messages-thread-pane {
    display: flex;
  }

  body.page-messages.has-thread .messages-desk-head {
    display: none;
  }

  body.page-messages.has-thread .messages-shell {
    height: calc(100dvh - var(--nav-h) - 1.5rem);
    max-height: none;
    border-radius: var(--radius-xl);
  }

  .chat-top {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .chat-back {
    display: inline-grid;
  }

  .page-messages .mf-tabbar {
    display: grid;
  }

  body.page-messages.has-thread .mf-tabbar,
  body.page-messages.has-thread .site-footer {
    display: none;
  }
}

/* Legacy mobile messages shell (chat-only pages) */
body.page-chat {
  background: var(--background);
  overflow: hidden;
}

body.page-chat .top-nav {
  display: none;
}

.flash--overlay {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 80;
}

.site-main--chat {
  padding-top: 0;
  min-height: 100dvh;
  height: var(--mf-vvh, 100dvh);
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--on-surface);
}

.mf-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--display);
  color: var(--secondary-fixed);
  background: linear-gradient(145deg, #16324a, var(--primary-container));
  border: 1px solid rgba(157, 239, 255, 0.18);
}

.mf-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* Inbox */
.mf-messages {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  background:
    radial-gradient(700px 240px at 100% 0%, rgba(0, 104, 117, 0.08), transparent 55%),
    var(--background);
}

.mf-messages-head {
  padding: 18px 20px 12px;
  display: grid;
  gap: 14px;
}

.mf-messages-head-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.mf-messages-back {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--on-surface);
  text-decoration: none;
}

.mf-messages-back:hover {
  border-color: rgba(0, 104, 117, 0.35);
  color: var(--secondary);
}

.mf-messages-titles h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
}

.mf-messages-titles p {
  margin: 4px 0 0;
  color: var(--on-surface-variant);
  font-size: 0.92rem;
}

.mf-inbox-search {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.mf-inbox-search .material-symbols-outlined {
  color: var(--on-surface-variant);
  font-size: 20px;
}

.mf-inbox-search input {
  border: 0;
  background: transparent;
  padding: 10px 4px;
  font: inherit;
  color: var(--on-surface);
  outline: none;
  width: 100%;
}

.mf-inbox-search input::placeholder {
  color: var(--on-surface-variant);
}

.mf-inbox-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 20px 8px;
}

.mf-inbox-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  font-weight: 700;
}

.mf-inbox-count {
  font-size: 0.82rem;
  color: var(--on-surface-variant);
  font-weight: 600;
}

.mf-inbox {
  list-style: none;
  margin: 0 12px 0;
  padding: 0 0 96px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border: 1px solid rgba(15, 76, 92, 0.1);
  border-bottom: 0;
  box-shadow: var(--shadow);
}

.mf-inbox li {
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
}

.mf-inbox li:last-child {
  border-bottom: 0;
}

.mf-inbox-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.mf-inbox-row:hover,
.mf-inbox-row:active,
.mf-inbox-row.is-active {
  background: rgba(0, 104, 117, 0.07);
}

.mf-inbox-row.is-unread {
  background: rgba(0, 104, 117, 0.05);
}

.mf-inbox-row.is-unread .mf-inbox-top strong,
.mf-inbox-row.is-unread .mf-inbox-preview {
  color: var(--on-surface);
  font-weight: 700;
}

.mf-avatar--unread {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff6b4a;
}

.mf-inbox-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mf-inbox-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.mf-inbox-top strong {
  font-size: 1.02rem;
  color: var(--on-surface);
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-inbox-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mf-inbox-top time {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.mf-inbox-row .nav-msg-badge {
  position: static;
  box-shadow: none;
}

.mf-inbox-place {
  font-size: 0.82rem;
  color: var(--secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-inbox-preview {
  font-size: 0.9rem;
  color: var(--on-surface-variant);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-inbox-empty-filter {
  margin: 0 20px;
  padding: 18px 0;
  text-align: center;
  color: var(--on-surface-variant);
  font-size: 0.95rem;
}

.mf-messages-empty {
  margin: 24px 20px 96px;
  padding: 36px 24px;
  text-align: center;
  color: var(--on-surface-variant);
  display: grid;
  gap: 10px;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 76, 92, 0.1);
  box-shadow: var(--shadow);
}

.mf-messages-empty .material-symbols-outlined {
  font-size: 42px;
  color: var(--secondary);
}

.mf-messages-empty h2 {
  margin: 0;
  color: var(--on-surface);
  font-family: var(--display);
}

.mf-messages-empty p {
  margin: 0;
  max-width: 260px;
}

.mf-messages-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.mf-btn--ghost-inbox {
  background: transparent;
  color: var(--secondary);
  border: 1px solid rgba(0, 104, 117, 0.28);
}

.mf-btn--ghost-inbox:hover {
  background: rgba(0, 104, 117, 0.08);
  color: var(--secondary);
}

.mf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-card);
  background: var(--secondary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.mf-btn:hover {
  background: #004e59;
  color: #fff;
}

/* Bottom tab bar */
.mf-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 31, 51, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(196, 198, 205, 0.25);
  max-width: 560px;
  margin: 0 auto;
}

.mf-tab {
  position: relative;
  display: grid;
  gap: 2px;
  place-items: center;
  text-decoration: none;
  color: rgba(117, 135, 160, 0.9);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px;
}

.mf-tab .material-symbols-outlined {
  font-size: 24px;
}

.mf-tab.is-active {
  color: var(--secondary-fixed);
}

.mf-tab:hover {
  color: #d1e4ff;
}

/* Thread */
.mf-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface-low);
  color: var(--on-surface);
  position: relative;
}

.mf-chat-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 12px;
  background: rgba(11, 31, 51, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(196, 198, 205, 0.25);
  color: #fff;
  z-index: 20;
  position: relative;
  box-shadow: var(--shadow);
}

.mf-chat-back {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  border: 1px solid rgba(157, 239, 255, 0.28);
  color: var(--secondary-fixed);
  text-decoration: none;
  transition: background 0.15s ease;
}

.mf-chat-back:hover {
  background: rgba(117, 135, 160, 0.15);
  color: var(--secondary-fixed-dim);
}

.mf-chat-back .material-symbols-outlined {
  font-size: 22px;
}

.mf-chat-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: #fff;
}

.mf-chat .mf-avatar--sm {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.mf-chat-peer-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.mf-chat-peer-text strong {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--display);
  line-height: 1.15;
  color: var(--secondary-fixed);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-chat-peer-text span {
  font-size: 0.75rem;
  color: rgba(209, 228, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-chat-menu {
  position: relative;
  justify-self: end;
}

.mf-chat-more {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--secondary-fixed);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mf-chat-more[aria-expanded="true"],
.mf-chat-more:hover {
  background: rgba(117, 135, 160, 0.18);
}

.mf-chat-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 8px;
  border-radius: var(--radius-xl);
  background: var(--surface-lowest);
  border: 1px solid rgba(15, 76, 92, 0.12);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 2px;
  z-index: 40;
  animation: mf-menu-in 0.14s ease-out;
}

.mf-chat-menu-panel[hidden] {
  display: none;
}

@keyframes mf-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.mf-chat-menu-panel form {
  margin: 0;
}

.mf-chat-menu-panel a,
.mf-chat-menu-panel button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--on-surface);
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.mf-chat-menu-panel a:hover,
.mf-chat-menu-panel button:hover:not(:disabled) {
  background: rgba(0, 104, 117, 0.08);
}

.mf-chat-menu-panel button:disabled {
  opacity: 0.4;
  cursor: default;
}

.mf-chat-menu-panel .material-symbols-outlined {
  font-size: 20px;
  color: var(--secondary);
}

.mf-chat-menu-panel .is-danger {
  color: var(--error);
}

.mf-chat-menu-panel .is-danger .material-symbols-outlined {
  color: var(--error);
}

.mf-chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 16px 20px;
  background:
    radial-gradient(ellipse 80% 45% at 50% -5%, rgba(0, 104, 117, 0.08), transparent 55%),
    var(--surface-low);
}

.mf-thread {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.mf-thread-empty {
  margin: auto;
  text-align: center;
  color: var(--on-surface-variant);
  padding: 40px 12px;
  display: grid;
  gap: 6px;
  place-items: center;
}

.mf-thread-empty .material-symbols-outlined {
  font-size: 36px;
  color: var(--secondary);
  margin-bottom: 4px;
}

.mf-thread-empty strong {
  color: var(--on-surface);
  font-size: 1rem;
  font-family: var(--display);
}

.mf-thread-empty span:last-child {
  font-size: 0.88rem;
}

.mf-day {
  display: grid;
  place-items: center;
  margin: 2px 0 4px;
}

.mf-day span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-lowest);
  border: 1px solid rgba(15, 76, 92, 0.12);
  color: var(--on-surface-variant);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.mf-bubble {
  display: grid;
  gap: 5px;
  max-width: min(78%, 340px);
  justify-items: start;
}

.mf-bubble.is-mine {
  margin-left: auto;
  justify-items: end;
}

.mf-bubble.is-stacked {
  margin-top: -6px;
}

.mf-bubble-body {
  padding: 12px 15px;
  border-radius: 18px;
  background: var(--surface-lowest);
  color: var(--on-surface);
  font-size: 0.98rem;
  line-height: 1.45;
  border-top-left-radius: 6px;
  word-break: break-word;
  border: 1px solid rgba(15, 76, 92, 0.1);
  box-shadow: var(--shadow);
}

.mf-bubble.is-mine .mf-bubble-body {
  background: var(--secondary);
  color: #fff;
  border-color: transparent;
  border-top-left-radius: 18px;
  border-top-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 104, 117, 0.28);
}

.mf-bubble.is-stacked:not(.is-mine) .mf-bubble-body {
  border-top-left-radius: 12px;
}

.mf-bubble.is-stacked.is-mine .mf-bubble-body {
  border-top-right-radius: 12px;
}

.mf-bubble-time {
  font-size: 0.72rem;
  color: var(--on-surface-variant);
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}

.mf-chat-footer {
  flex: 0 0 auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(248, 249, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(15, 76, 92, 0.1);
}

.mf-compose {
  display: grid;
  grid-template-columns: auto 1fr 46px;
  gap: 8px;
  align-items: end;
}

.mf-compose-tools {
  display: flex;
  gap: 2px;
  align-items: center;
  height: 46px;
}

.mf-compose-ico {
  width: 38px;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  border-radius: var(--radius-card);
}

.mf-compose-ico:hover {
  color: var(--secondary);
  background: rgba(0, 104, 117, 0.08);
}

.mf-compose-ico .material-symbols-outlined {
  font-size: 24px;
}

.mf-compose textarea {
  margin: 0;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  border: 0;
  border-radius: var(--radius-xl);
  padding: 13px 16px;
  background: var(--surface-lowest);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--on-surface);
  box-shadow: inset 0 0 0 1px rgba(15, 76, 92, 0.14);
}

.mf-compose textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 104, 117, 0.28);
}

.mf-compose textarea::placeholder {
  color: var(--outline);
}

.mf-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-container);
  color: var(--on-surface-variant);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.mf-send:not(:disabled) {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 104, 117, 0.3);
}

.mf-send:not(:disabled):active {
  transform: scale(0.94);
}

.mf-send:disabled {
  cursor: default;
  opacity: 0.85;
}

.mf-send .material-symbols-outlined {
  font-size: 20px;
  margin-left: 2px;
}

@media (min-width: 720px) {
  .site-main--chat,
  .site-main--messages {
    background: var(--surface-low);
  }

  .mf-chat,
  .mf-messages {
    box-shadow: var(--shadow-lg);
    border-left: 1px solid rgba(15, 76, 92, 0.08);
    border-right: 1px solid rgba(15, 76, 92, 0.08);
  }

  .mf-tabbar {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

.btn-outline-light {
  background: transparent;
  color: var(--secondary-fixed);
  box-shadow: inset 0 0 0 1px var(--secondary-fixed);
}

.btn-outline-light:hover {
  background: rgba(157, 239, 255, 0.12);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: #004e59;
  color: #fff;
}

.profile-body {
  padding: 20px 0 56px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric-grid--5 {
  grid-template-columns: repeat(5, 1fr);
}

.metric-card {
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.metric-value {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  margin: 4px 0 0;
  color: var(--on-surface);
  line-height: 1.2;
}

.metric-value small {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--on-surface-variant);
}

.metric-value--text {
  font-size: 18px;
}

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

.bento-card {
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.bento-card--map {
  min-height: 380px;
}

.bento-card--wide {
  grid-column: 1 / -1;
}

.bento-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(213, 227, 252, 0.35);
  border-bottom: 1px solid var(--outline-variant);
}

.bento-card-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-ghost-sm {
  font-size: 12px;
  padding: 4px 10px;
  white-space: nowrap;
}

.profile-routes {
  display: grid;
  gap: 12px;
}

.profile-route-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  font-size: 14px;
}

.profile-route-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.profile-route-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}

.profile-route-list a:hover {
  background: rgba(213, 227, 252, 0.45);
  border-color: var(--outline-variant);
}

.profile-route-list a span:last-child {
  font-size: 12px;
  flex-shrink: 0;
}

.my-routes-list {
  display: grid;
  gap: 18px;
}

.page-my-routes .site-main,
.my-routes-page {
  background:
    radial-gradient(1200px 420px at 8% -10%, rgba(0, 104, 117, 0.1), transparent 55%),
    radial-gradient(900px 360px at 100% 0%, rgba(213, 227, 252, 0.7), transparent 50%),
    var(--background);
}

.my-routes-wrap {
  max-width: 920px;
}

.my-routes-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(196, 198, 205, 0.65);
}

.my-routes-kicker {
  margin: 0 0 8px;
  color: var(--secondary);
}

.my-routes-hero .page-title {
  margin-bottom: 8px;
}

.my-routes-hero .lede {
  margin-bottom: 0;
}

.my-routes-hero-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.my-routes-stats {
  display: flex;
  gap: 8px;
}

.my-routes-stat {
  min-width: 72px;
  padding: 10px 14px;
  border-radius: var(--radius-card);
  border: 1px solid var(--outline-variant);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  text-align: center;
}

.my-routes-stat strong {
  display: block;
  margin-top: 2px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.1;
}

.my-routes-empty-card {
  text-align: center;
  padding: 40px 28px;
  max-width: 420px;
  margin: 0 auto;
}

.my-routes-empty-ico {
  font-size: 40px;
  color: var(--secondary);
  margin-bottom: 8px;
}

.my-routes-empty-card h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.25rem;
}

.my-routes-boat {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.my-routes-boat:hover {
  box-shadow: var(--shadow-lg);
}

.my-routes-boat.is-live {
  border-color: rgba(0, 104, 117, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 104, 117, 0.08),
    var(--shadow);
}

.my-routes-boat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(213, 227, 252, 0.5) 0%, rgba(255, 255, 255, 0.35) 100%);
  border-bottom: 1px solid rgba(196, 198, 205, 0.55);
}

.my-routes-boat-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.my-routes-boat-identity:hover .my-routes-boat-title {
  color: var(--secondary);
}

.my-routes-boat-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-card);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--outline-variant);
  background: var(--surface-high);
}

.my-routes-boat-thumb--fallback {
  display: grid;
  place-items: center;
  font-size: 22px;
}

.my-routes-boat-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.my-routes-boat-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  transition: color 0.15s ease;
}

.my-routes-boat-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.my-routes-boat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.my-routes-boat-actions .mf-btn {
  flex: 0 1 auto;
}

.my-routes-route-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.my-routes-route-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.my-routes-route-item:hover {
  background: rgba(213, 227, 252, 0.4);
  border-color: rgba(196, 198, 205, 0.8);
}

.my-routes-route-item.is-active {
  background: rgba(0, 104, 117, 0.06);
  border-color: rgba(0, 104, 117, 0.22);
  box-shadow: inset 3px 0 0 var(--secondary);
}

.my-routes-route-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 12px 12px 12px 10px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-card);
}

.my-routes-route-ico {
  font-size: 20px;
  color: var(--secondary);
  opacity: 0.85;
  flex-shrink: 0;
}

.my-routes-route-item.is-active .my-routes-route-ico {
  opacity: 1;
}

.my-routes-route-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.my-routes-route-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.my-routes-route-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--on-surface);
}

.my-routes-route-meta {
  font-size: 12px;
}

.my-routes-route-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 8px 0;
  flex-shrink: 0;
  opacity: 0.78;
  transition: opacity 0.15s ease;
}

.my-routes-route-item:hover .my-routes-route-actions,
.my-routes-route-item:focus-within .my-routes-route-actions {
  opacity: 1;
}

.my-routes-empty-item {
  padding: 18px 14px;
  list-style: none;
  text-align: center;
  border: 1px dashed rgba(196, 198, 205, 0.9);
  border-radius: var(--radius-card);
  background: rgba(248, 249, 255, 0.7);
  font-size: 14px;
}

.my-routes-empty {
  margin: 0;
}

.bento-card-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bento-card-body {
  padding: 16px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--secondary);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 0 rgba(0, 104, 117, 0.45);
  animation: pulseLive 2s ease infinite;
}

.profile-map-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  isolation: isolate;
}

.profile-map-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-map-tools .map-tool-btn {
  pointer-events: auto;
  box-shadow: var(--shadow);
}

.profile-map-wrap #profile-map {
  position: absolute;
  inset: 0;
  height: 100%;
  border: 0;
  border-radius: 0;
  z-index: 1;
}

.profile-map-wrap .leaflet-container {
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

.profile-map-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  pointer-events: none;
}

.profile-map-bar p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--on-surface);
}

.profile-map-bar-right {
  text-align: right;
}

.data-list {
  padding: 8px 16px 16px;
}

.data-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--outline-variant);
  font-size: 13px;
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row span {
  color: var(--on-surface-variant);
}

.data-row strong {
  color: var(--on-surface);
  font-weight: 600;
  text-align: right;
}

.profile-about {
  margin: 0 0 14px;
  color: var(--on-surface);
  line-height: 1.6;
  font-size: 15px;
}

.profile-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.boat-album-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.boat-album-chip {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 92, 0.1);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.boat-album-chip:hover {
  border-color: rgba(0, 104, 117, 0.3);
  box-shadow: 0 8px 20px rgba(15, 40, 60, 0.08);
}

.boat-hero-field {
  display: grid;
  gap: 10px;
}

.boat-hero-preview {
  width: min(100%, 320px);
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: var(--surface-high, #eef3f7);
}

.boat-hero-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.boat-hero-upload input[type="file"] {
  display: block;
  margin-bottom: 6px;
}

.boat-album-chip-cover {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-high);
  color: var(--secondary);
}

.boat-album-chip-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.boat-album-chip-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.boat-album-chip-copy strong {
  font-size: 0.95rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 6px;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  flex: 0 0 auto;
}

.profile-thumb {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  background: var(--surface-high);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.profile-thumb:hover {
  box-shadow: 0 0 0 2px var(--secondary);
}

.profile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero-zoom {
  position: absolute;
  top: clamp(24px, 4vw, 48px);
  right: clamp(24px, 5vw, 56px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(11, 31, 51, 0.55);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.profile-hero-zoom:hover {
  background: rgba(11, 31, 51, 0.75);
}

.profile-hero-zoom .material-symbols-outlined {
  font-size: 18px;
}

/* Fullscreen photo lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 5, 14, 0.92);
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #d1e4ff;
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-nav .material-symbols-outlined {
  font-size: 28px;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}

@media (max-width: 900px) {
  .metric-grid,
  .metric-grid--5 {
    grid-template-columns: 1fr 1fr;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .profile-route-list a {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .my-routes-hero {
    align-items: flex-start;
  }

  .my-routes-hero-aside {
    width: 100%;
    justify-content: space-between;
  }

  .my-routes-boat-head {
    align-items: flex-start;
  }

  .my-routes-boat-actions {
    width: 100%;
  }

  .my-routes-boat-actions .mf-btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }

  .my-routes-boat-actions .mf-btn--primary {
    flex: 1 1 100%;
  }

  .my-routes-route-item {
    flex-direction: column;
    align-items: stretch;
  }

  .my-routes-route-main {
    padding-bottom: 6px;
  }

  .my-routes-route-actions {
    opacity: 1;
    padding: 0 10px 10px;
    justify-content: flex-end;
    border-top: 0;
  }

  .profile-hero-bleed {
    min-height: 360px;
    padding: 28px 20px 32px;
  }

  .profile-hero-content {
    padding: 0;
  }

  .profile-crumb {
    margin-bottom: 24px;
  }

  .profile-hero-zoom {
    top: 20px;
    right: 20px;
  }

  .profile-map-wrap {
    min-height: 280px;
  }
}


.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

tbody tr:nth-child(even) {
  background: rgba(239, 244, 255, 0.5);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--outline-variant, rgba(15, 76, 92, 0.16));
  background: rgba(255, 255, 255, 0.7);
  color: var(--on-surface, #1a2b33);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.admin-nav-link:hover {
  background: var(--surface-highest, #eef3f6);
}

.admin-nav-link.is-active {
  background: var(--secondary, #006875);
  border-color: transparent;
  color: #fff;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.admin-metric {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius-card, 12px);
  border: 1px solid var(--outline-variant, rgba(15, 76, 92, 0.14));
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

a.admin-metric:hover {
  border-color: var(--secondary, #006875);
}

.admin-metric-value {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface, #1a2b33);
}

.admin-card {
  padding: 18px;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-card-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.admin-actions form {
  display: inline-flex;
  margin: 0;
}

.admin-actions .mf-btn,
.admin-actions .btn-ghost {
  flex-shrink: 0;
}

.admin-user-active {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}

.admin-user-active input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-user-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-user-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--secondary-tint);
  border: 1px solid rgba(196, 198, 205, 0.45);
  color: var(--secondary);
  font-weight: 700;
  text-decoration: none;
}

.admin-user-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-photo.is-fallback {
  font-size: 14px;
}

.admin-user-copy {
  min-width: 0;
}

.admin-user-name {
  font-weight: 600;
  color: var(--on-surface);
  text-decoration: none;
}

.admin-user-name:hover {
  color: var(--secondary);
}

.profile-avatar-preview {
  text-decoration: none;
  color: inherit;
}

/* —— Admin boats —— */
.page-admin-boats .admin-boats-toolbar {
  align-items: flex-start;
}

.admin-boats-count {
  align-self: center;
}

.admin-boats-card {
  padding: 0;
  overflow: hidden;
}

.admin-boats-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.admin-boats-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-boats-table th,
.admin-boats-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(15, 76, 92, 0.1);
}

.admin-boats-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  background: linear-gradient(180deg, #f4fafb 0%, #eef6f8 100%);
}

.admin-boats-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-boats-table tbody tr:hover {
  background: rgba(0, 104, 117, 0.04);
}

.admin-boat-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.admin-boat-photo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #0b1f33, #006875);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

.admin-boat-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-boat-photo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-boat-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.admin-boat-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--on-surface);
  text-decoration: none;
}

.admin-boat-name:hover {
  color: var(--secondary);
}

.admin-boat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 0.86rem;
}

.admin-boat-owner {
  display: grid;
  gap: 2px;
  min-width: 140px;
}

.admin-boat-owner strong {
  font-size: 0.95rem;
}

.admin-boat-owner .muted {
  font-size: 0.84rem;
  word-break: break-all;
}

.admin-boat-updated {
  display: grid;
  gap: 2px;
  min-width: 120px;
  font-size: 0.9rem;
}

.admin-boat-updated .muted {
  font-size: 0.82rem;
}

.admin-boats-table .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-boats-table .badge .material-symbols-outlined {
  font-size: 12px;
  font-variation-settings: 'FILL' 1;
}

.admin-boats-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 28px 22px;
}

.admin-boats-empty .material-symbols-outlined {
  color: var(--secondary);
  font-size: 32px;
}

.admin-boats-empty h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
}

.admin-boats-empty p {
  margin: 0;
}

@media (max-width: 900px) {
  .admin-boats-table thead {
    display: none;
  }

  .admin-boats-table,
  .admin-boats-table tbody,
  .admin-boats-table tr,
  .admin-boats-table td {
    display: block;
    width: 100%;
  }

  .admin-boats-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(15, 76, 92, 0.1);
  }

  .admin-boats-table tr:last-child {
    border-bottom: 0;
  }

  .admin-boats-table td {
    padding: 6px 0;
    border: 0;
  }

  .admin-boats-table td:last-child .admin-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.admin-photo-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-photo-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-high);
  overflow: hidden;
}

.admin-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-photo-thumb .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--secondary);
  color: #fff;
}

.admin-photo-meta {
  padding: 12px;
  display: grid;
  gap: 4px;
}

.admin-photo-meta strong {
  font-size: 0.95rem;
}

.admin-photo-meta .admin-actions {
  margin-top: 8px;
  justify-content: flex-start;
}

.admin-photos-page .admin-card-head {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-photos-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-photos-search input[type="search"] {
  min-width: 220px;
  margin: 0;
}

.admin-photo-album-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-photo-album-cell .admin-photo-thumb {
  width: 56px;
  aspect-ratio: 1;
  border-radius: 10px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--secondary);
}

.admin-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding-top: 8px;
}

.admin-photos-grid .admin-photo-card {
  border: 1px solid rgba(15, 76, 92, 0.1);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.admin-photo-card-media {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--surface-high);
  overflow: hidden;
}

.admin-photo-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-photo-card-body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.admin-photo-caption {
  margin: 0;
  font-size: 0.88rem;
}

.admin-photo-edit-form {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

/* —— Independent fleet photo gallery —— */
.gallery-desk {
  padding-bottom: 48px;
}

.gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.gallery-head-meta {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.gallery-filters.chip-row {
  margin: 0;
}

.gallery-empty {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed rgba(15, 76, 92, 0.22);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.55);
}

.gallery-empty .material-symbols-outlined {
  font-size: 42px;
  color: var(--secondary);
}

.gallery-empty h2 {
  margin: 0;
  font-size: 1.25rem;
}

.gallery-empty p {
  margin: 0;
  max-width: 36ch;
}

.gallery-masonry {
  columns: 4 240px;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 16px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.1);
  box-shadow: 0 8px 24px rgba(15, 40, 60, 0.06);
}

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-high);
  cursor: zoom-in;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  transition: transform 0.35s ease;
}

.gallery-item:hover .gallery-thumb img {
  transform: scale(1.03);
}

.gallery-caption {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
}

.gallery-caption a {
  font-weight: 700;
  color: var(--on-surface);
  text-decoration: none;
}

.gallery-caption a:hover {
  color: var(--secondary);
}

.gallery-caption .muted {
  font-size: 0.82rem;
}

.gallery-admin-form {
  margin-top: 6px;
}

.gallery-crumb {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.gallery-crumb a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 600;
}

.gallery-album-desc {
  margin: 10px 0 0;
  max-width: 56ch;
  color: var(--muted);
}

.gallery-albums {
  margin-bottom: 32px;
}

.gallery-albums-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gallery-albums-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.album-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.album-card-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.album-card,
.album-card--link {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.1);
  box-shadow: 0 8px 24px rgba(15, 40, 60, 0.06);
  text-decoration: none;
  color: inherit;
}

.album-card-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-high);
}

.album-card-cover.is-empty {
  color: var(--secondary);
}

.album-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-card-body {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
}

.album-card-body h2,
.album-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-surface);
}

.album-card-body a {
  color: inherit;
  text-decoration: none;
}

.album-card-body a:hover,
.album-card--link:hover .album-card-title {
  color: var(--secondary);
}

.album-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.album-edit-photos h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.album-edit-desk .wrap.mid {
  max-width: 980px;
}

.album-edit-toolbar .gallery-crumb {
  margin-bottom: 4px;
}

.album-edit-layout {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 900px) {
  .album-edit-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 24px;
  }
}

.album-edit-form,
.album-edit-photos {
  margin: 0;
  padding: 22px 22px 20px;
  border-radius: 18px;
  border: 1px solid rgba(15, 76, 92, 0.1);
  box-shadow: 0 10px 28px rgba(15, 40, 60, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 252, 0.96));
}

.album-edit-form-head {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
}

.album-edit-form-head h2,
.album-edit-photos .photo-manager-head h2 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.album-edit-form-head .muted,
.album-edit-photos .photo-manager-head .muted {
  margin: 0;
  font-size: 0.88rem;
}

.album-edit-photos .photo-manager-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
}

.album-hero-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.album-hero-actions .mf-btn.is-hero-active {
  background: rgba(0, 104, 117, 0.12);
  color: var(--secondary);
  border-color: rgba(0, 104, 117, 0.28);
}

.album-hero-actions .photo-manager-status {
  margin: 0;
  text-align: right;
  font-size: 0.82rem;
}

.album-photo-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
  padding: 36px 16px;
  border: 1px dashed rgba(15, 76, 92, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.album-photo-empty[hidden] {
  display: none !important;
}

.album-photo-empty .material-symbols-outlined {
  font-size: 32px;
  color: var(--secondary);
}

.album-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
}

.album-edit-item {
  margin: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 76, 92, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.album-edit-item:hover {
  border-color: rgba(0, 104, 117, 0.28);
  box-shadow: 0 10px 22px rgba(15, 40, 60, 0.08);
}

.album-edit-item.sortable-chosen,
.album-edit-item.sortable-drag {
  box-shadow: 0 16px 30px rgba(15, 40, 60, 0.14);
  transform: scale(1.02);
  cursor: grabbing;
}

.album-edit-item.is-boat-hero {
  border-color: rgba(0, 104, 117, 0.45);
  background: linear-gradient(180deg, rgba(0, 104, 117, 0.1), rgba(255, 255, 255, 0.92));
}

.album-edit-actions .album-edit-primary-label.muted {
  color: var(--muted, #627485);
  font-weight: 500;
}

.album-edit-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-high);
  aspect-ratio: 1;
}

.album-edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-edit-primary-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 104, 117, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.album-edit-primary-badge .material-symbols-outlined {
  font-size: 14px;
}

.album-edit-thumb .photo-drag-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.58);
  color: #fff;
  cursor: grab;
  backdrop-filter: blur(4px);
}

.album-edit-thumb .photo-drag-handle .material-symbols-outlined {
  font-size: 18px;
}

.album-edit-thumb .photo-drag-handle:hover {
  background: rgba(15, 23, 42, 0.78);
}

.album-edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.album-edit-actions .mf-btn {
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
  min-height: 32px;
  min-width: 0;
  padding-inline: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.album-edit-actions .mf-btn .material-symbols-outlined {
  font-size: 16px;
}

.album-edit-primary-label {
  flex: 1 1 calc(50% - 3px);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
  padding: 6px 4px;
}

.album-boat-cover-field {
  display: grid;
  gap: 6px;
}

.album-boat-cover-field[hidden] {
  display: none !important;
}

.album-edit-danger {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 0;
  padding: 18px 20px;
}

.album-edit-danger h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.album-edit-danger p {
  margin: 0;
}

.album-category-field {
  display: grid;
  gap: 10px;
}

.album-category-new[hidden] {
  display: none !important;
}

.lightbox-caption {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.lightbox-title-link,
#lightbox-title {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.lightbox-title-link:hover,
a#lightbox-title:hover {
  color: #9be7ef;
  text-decoration: underline;
}

a#lightbox-title[aria-disabled="true"] {
  pointer-events: none;
  text-decoration: none;
}

.lightbox-subtitle {
  color: rgba(209, 228, 255, 0.75);
  font-size: 12px;
}

@media (max-width: 900px) {
  .gallery-head-meta {
    justify-items: start;
    width: 100%;
  }

  .gallery-masonry {
    columns: 2 160px;
    column-gap: 12px;
  }
}

@media (max-width: 560px) {
  .gallery-masonry {
    columns: 1;
  }
}

@media (max-width: 800px) {
  .admin-metrics {
    grid-template-columns: 1fr;
  }
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.boat-edit-toolbar {
  align-items: flex-end;
}

.boat-edit-toolbar .lede {
  margin-bottom: 0;
}

.boat-edit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.photo-manager {
  margin-top: 18px;
  padding: 18px;
}

.photo-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.photo-manager-head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.photo-manager-status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted, #5b6b73);
  white-space: nowrap;
}

.photo-manager-status.is-error {
  color: #93000a;
}

.photo-dropzone {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 120px;
  padding: 22px 16px;
  border: 1.5px dashed rgba(15, 76, 92, 0.35);
  border-radius: var(--radius-card, 12px);
  background: rgba(15, 76, 92, 0.04);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 14px;
}

.photo-dropzone strong {
  font-size: 1rem;
}

.photo-dropzone span {
  color: var(--ink-muted, #5b6b73);
  font-size: 0.9rem;
}

.photo-dropzone:hover,
.photo-dropzone:focus-visible,
.photo-dropzone.is-dragover {
  border-color: var(--brand, #0f4c5c);
  background: rgba(15, 76, 92, 0.08);
  outline: none;
}

.photo-dropzone.is-busy,
.photo-list.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

.photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.photo-item {
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 76, 92, 0.1);
  border-radius: var(--radius-card, 12px);
  padding: 8px;
}

.photo-item.is-ghost {
  opacity: 0.35;
}

.photo-item.is-chosen {
  box-shadow: 0 8px 24px rgba(15, 40, 50, 0.16);
}

.photo-item-thumb {
  position: relative;
}

.photo-item img {
  height: 110px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius, 8px);
  display: block;
}

.photo-drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(8, 24, 32, 0.72);
  color: #fff;
  font-size: 0.75rem;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
}

.photo-drag-handle:active {
  cursor: grabbing;
}

.photo-item-thumb .badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
}

.photo-item-actions {
  display: grid;
  gap: 6px;
}

.photo-empty {
  margin: 8px 0 0;
}

/* —— Community —— */
.community-hero {
  position: relative;
  min-height: min(62vh, 520px);
  display: grid;
  align-items: end;
  color: #f4f8fc;
  background:
    linear-gradient(160deg, rgba(8, 28, 44, 0.55), rgba(8, 28, 44, 0.82)),
    radial-gradient(1200px 500px at 20% 10%, rgba(0, 160, 176, 0.35), transparent 55%),
    linear-gradient(180deg, #0b1f33 0%, #12384f 45%, #0f4c5c 100%);
  overflow: hidden;
}

.community-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 20%, rgba(8, 24, 40, 0.55) 100%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.015) 18px,
      rgba(255, 255, 255, 0.015) 19px
    );
  pointer-events: none;
}

.community-hero-inner {
  position: relative;
  z-index: 1;
  padding: 72px 0 48px;
  max-width: 720px;
}

.community-kicker {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--secondary-fixed, #9ee7ef);
}

.community-hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.community-hero-lede {
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(232, 240, 246, 0.88);
  max-width: 36rem;
}

.community-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.community-crumb {
  margin: 0 0 10px;
  color: var(--on-surface-variant);
  font-size: 0.9rem;
}

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

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.group-grid--roomy {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.group-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-card, 12px);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.group-card:hover {
  border-color: var(--secondary, #006875);
  transform: translateY(-1px);
}

.group-card--wide {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px;
}

.group-card--wide p {
  margin: 6px 0 8px;
  font-size: 0.92rem;
}

.group-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0, 104, 117, 0.12);
  color: var(--secondary, #006875);
  font-size: 22px;
}

.group-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-picker {
  border: 0;
  margin: 0;
  padding: 0;
}

.icon-picker legend {
  font-weight: 600;
  margin-bottom: 8px;
}

.icon-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-picker-option {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(15, 76, 92, 0.16);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
}

.icon-picker-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.icon-picker-option .material-symbols-outlined {
  font-size: 22px;
  color: var(--secondary, #006875);
}

.icon-picker-option:has(input:checked) {
  border-color: var(--secondary, #006875);
  background: rgba(0, 104, 117, 0.12);
}

.group-card strong .badge {
  margin-left: 6px;
  vertical-align: middle;
}

.group-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  flex-wrap: wrap;
}

.group-hero-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.group-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.group-members {
  padding: 18px;
}

.group-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.group-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 76, 92, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.group-member-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.group-member-photo {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(15, 76, 92, 0.14);
}

.group-member-photo--fallback {
  display: grid;
  place-items: center;
  background: var(--secondary, #006875);
  color: #fff;
  font-weight: 700;
}

.group-member-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-member-text strong {
  font-size: 0.98rem;
}

.group-member-boat {
  flex-shrink: 0;
}

.post-feed {
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.feed-card {
  padding: 16px 18px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: #fff;
  box-shadow: var(--shadow);
}

.feed-card-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.feed-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

.feed-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-card-who {
  min-width: 0;
}

.feed-card-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
}

.feed-card-name {
  font-weight: 700;
  color: var(--on-surface);
  text-decoration: none;
}

.feed-card-name:hover {
  color: var(--secondary);
}

.feed-card-time {
  font-size: 0.82rem;
  color: var(--on-surface-variant);
}

.feed-card-tagline {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--on-surface-variant);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-card-actions-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.feed-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--secondary);
  background: transparent;
  color: var(--secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.feed-follow:hover,
.feed-follow.is-on {
  background: var(--secondary);
  color: #fff;
}

.feed-menu {
  position: relative;
}

.feed-menu summary {
  list-style: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
  color: var(--on-surface-variant);
}

.feed-menu summary::-webkit-details-marker {
  display: none;
}

.feed-menu summary:hover {
  background: var(--surface-low);
  color: var(--on-surface);
}

.feed-menu-panel {
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 8;
  min-width: 160px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--outline-variant);
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.feed-menu-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--on-surface);
  text-decoration: none;
  font-size: 0.88rem;
}

.feed-menu-panel a:hover {
  background: var(--surface-low);
  color: var(--secondary);
}

.feed-card-body {
  margin: 12px 0 4px;
}

.feed-card-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.feed-card-title a {
  color: inherit;
  text-decoration: none;
}

.feed-card-title a:hover {
  color: var(--secondary);
}

.feed-card-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--on-surface);
  white-space: pre-wrap;
}

.feed-see-more {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--secondary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.feed-see-more:hover {
  text-decoration: underline;
}

.feed-card-photo {
  display: block;
  margin: 10px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f4c5c;
}

.feed-card-photo img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.feed-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding-top: 6px;
}

.feed-card-react {
  display: flex;
  align-items: center;
  gap: 4px;
}

.feed-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
}

.feed-icon-btn:hover {
  background: var(--surface-low);
  color: var(--on-surface);
}

.feed-icon-btn.is-on {
  color: #e11d48;
}

.feed-icon-btn.is-on .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

.feed-icon-btn .material-symbols-outlined {
  font-size: 22px;
}

.feed-likes-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  font-size: 0.82rem;
  color: var(--on-surface-variant);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
}

.feed-likes-meta:hover {
  background: var(--surface-low);
  color: var(--on-surface);
}

.feed-likes-meta.is-empty {
  display: none;
}

.feed-likes-meta.is-empty:not([hidden]) {
  display: inline-flex;
}

.feed-like-stack {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
}

.feed-like-face {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0f4c5c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  position: relative;
  z-index: var(--z, 1);
  box-shadow: 0 0 0 1px rgba(15, 76, 92, 0.08);
}

.feed-like-stack .feed-like-face:last-child {
  margin-left: 0;
}

.feed-like-face--more {
  background: #e8eef3;
  color: #0f4c5c;
  font-size: 8px;
  letter-spacing: -0.02em;
}

.feed-like-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.likes-modal-open {
  overflow: hidden;
}

.likes-modal[hidden] {
  display: none !important;
}

.likes-modal {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 16px;
}

.likes-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 28, 46, 0.4);
}

.likes-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(13, 28, 46, 0.22);
  overflow: hidden;
}

.likes-modal-head {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 12px 48px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.1);
}

.likes-modal-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
}

.likes-modal-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.likes-modal-close:hover {
  background: var(--surface-low);
  color: var(--on-surface);
}

.likes-modal-list {
  overflow: auto;
  padding: 8px 0 12px;
}

.likes-modal-empty,
.likes-modal-status {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  color: var(--on-surface-variant);
}

.likes-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}

.likes-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

.likes-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.likes-row-copy {
  min-width: 0;
  flex: 1;
}

.likes-row-copy a {
  color: inherit;
  text-decoration: none;
}

.likes-row-copy strong {
  display: block;
  font-size: 0.95rem;
}

.likes-row-copy span {
  display: block;
  color: var(--on-surface-variant);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 700px) {
  .feed-card {
    padding: 14px 12px 10px;
  }

  .feed-card-head {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .feed-card-actions-top {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.post-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  border-radius: var(--radius-card, 12px);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-card--text {
  grid-template-columns: 1fr;
}

.post-card-media {
  display: block;
  min-height: 120px;
  background: #0f4c5c;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 140px;
}

.post-card-body {
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}

.post-card-body h3 {
  margin: 0;
  font-size: 1.1rem;
}

.post-card-body h3 a {
  color: inherit;
  text-decoration: none;
}

.post-card-excerpt {
  margin: 0;
  font-size: 0.92rem;
}

.post-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--on-surface-variant);
}

.community-post {
  padding: 22px;
}

.post-byline {
  margin: 0 0 16px;
  color: var(--on-surface-variant);
}

.community-post-body {
  font-size: 1.02rem;
  line-height: 1.65;
}

.community-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.community-photo-grid img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius, 8px);
}

.community-post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.comment-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 4px;
}

/* —— Community post detail —— */
.page-community-post .post-page {
  padding-top: 28px;
  padding-bottom: 56px;
  background:
    radial-gradient(900px 320px at 100% 0%, rgba(0, 104, 117, 0.08), transparent 55%),
    linear-gradient(180deg, #f3f7fb 0%, var(--background) 42%);
}

.post-page-wrap {
  max-width: 760px;
}

.post-page .community-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.post-article {
  padding: clamp(22px, 3vw, 32px);
  border-radius: calc(var(--radius-xl) + 2px);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.post-article-header {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.1);
}

.post-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.post-type-badge--tip {
  background: rgba(0, 104, 117, 0.12);
  color: var(--secondary);
}

.post-type-badge--story {
  background: rgba(15, 76, 92, 0.1);
  color: #0f4c5c;
}

.post-type-badge--photo {
  background: rgba(118, 212, 229, 0.28);
  color: #0b4a55;
}

.post-group-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--on-surface-variant);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.post-group-link:hover {
  color: var(--secondary);
}

.post-group-link .material-symbols-outlined {
  font-size: 18px;
}

.post-article-title {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--on-surface);
  text-wrap: balance;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author-avatar,
.comment-avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-author-avatar:hover,
.comment-avatar:hover {
  color: #fff;
  filter: brightness(1.08);
}

.post-author-copy {
  min-width: 0;
}

.post-author-name {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  color: var(--on-surface);
  text-decoration: none;
}

.post-author-name:hover {
  color: var(--secondary);
}

.post-author-meta {
  margin: 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  color: var(--on-surface-variant);
  font-size: 0.88rem;
}

.post-author-meta a {
  color: inherit;
  font-weight: 600;
}

.post-author-meta a:hover {
  color: var(--secondary);
}

.post-article-body {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--on-surface);
  white-space: normal;
}

.post-article-body br + br {
  display: block;
  content: "";
  margin-top: 0.55em;
}

.post-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.post-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #0f4c5c;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.post-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.post-photo:hover img {
  transform: scale(1.04);
}

.post-photo:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
}

.post-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(15, 76, 92, 0.1);
}

.post-comments,
.post-related {
  margin-top: 22px;
  padding: clamp(20px, 3vw, 28px);
  border-radius: calc(var(--radius-xl) + 2px);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.post-comments-head,
.post-related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.post-comments-head h2,
.post-related-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
}

.post-comments-count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 104, 117, 0.12);
  color: var(--secondary);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
}

.post-comments-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px 0 8px;
  color: var(--on-surface-variant);
}

.post-comments-empty .material-symbols-outlined {
  color: var(--secondary);
  font-size: 28px;
}

.post-comments-empty p {
  margin: 0;
}

.page-community-post .comment-list {
  gap: 16px;
  margin-bottom: 18px;
}

.comment-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

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

.comment-item--reply {
  border-bottom: 0;
  padding-bottom: 0;
}

.comment-item:target .comment-body {
  background: rgba(0, 104, 117, 0.06);
  border-radius: 10px;
  margin: -4px -8px 0;
  padding: 4px 8px 8px;
}

.comment-main {
  min-width: 0;
}

.comment-body p {
  margin: 0;
  line-height: 1.55;
  color: var(--on-surface);
}

.comment-reply-toggle {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--secondary);
  cursor: pointer;
  text-decoration: none;
}

.comment-reply-toggle:hover {
  text-decoration: underline;
}

.comment-reply-form {
  display: none;
  gap: 8px;
  margin-top: 10px;
}

.comment-reply-form.is-open {
  display: grid;
}

.comment-reply-form textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border-radius: var(--radius-xl);
  border: 1px solid var(--outline-variant);
  padding: 10px 12px;
  font: inherit;
  line-height: 1.5;
  background: #fff;
}

.comment-reply-form textarea:focus {
  outline: 2px solid rgba(0, 104, 117, 0.35);
  border-color: var(--secondary);
}

.comment-reply-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.comment-replies {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 12px;
  display: grid;
  gap: 12px;
  border-left: 2px solid rgba(15, 76, 92, 0.12);
}

.post-comment-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 76, 92, 0.1);
}

.post-comment-form label {
  font-weight: 700;
  font-size: 0.92rem;
}

.post-comment-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border-radius: var(--radius-xl);
  border: 1px solid var(--outline-variant);
  padding: 12px 14px;
  font: inherit;
  line-height: 1.5;
  background: #fff;
}

.post-comment-form textarea:focus {
  outline: 2px solid rgba(0, 104, 117, 0.35);
  border-color: var(--secondary);
}

.post-comment-form-actions {
  display: flex;
  justify-content: flex-end;
}

.post-comment-login {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 76, 92, 0.1);
}

.post-comment-login p {
  margin: 0;
  color: var(--on-surface-variant);
}

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

.post-related-head a {
  font-weight: 600;
  font-size: 0.92rem;
}

.post-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: 56px 64px;
  background: rgba(8, 22, 36, 0.88);
  backdrop-filter: blur(6px);
}

.post-lightbox[hidden] {
  display: none;
}

body.post-lightbox-open {
  overflow: hidden;
}

.post-lightbox-img {
  max-width: min(960px, 100%);
  max-height: min(80vh, 100%);
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.post-lightbox-close,
.post-lightbox-nav {
  position: absolute;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.post-lightbox-close:hover,
.post-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.post-lightbox-close {
  top: 18px;
  right: 18px;
}

.post-lightbox-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.post-lightbox-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 700px) {
  .post-article,
  .post-comments,
  .post-related {
    padding: 18px;
  }

  .post-photo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .post-article-actions .mf-btn,
  .post-comment-login .mf-btn {
    flex: 1 1 100%;
  }

  .post-lightbox {
    padding: 64px 16px 24px;
  }

  .post-lightbox-prev,
  .post-lightbox-next {
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .post-lightbox-prev {
    left: 18px;
  }

  .post-lightbox-next {
    right: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-photo img {
    transition: none;
  }

  .post-photo:hover img {
    transform: none;
  }
}

.member-hero,
.member-hero-main {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.member-hero {
  padding: 20px;
}

.member-avatar {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-boat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.member-boat-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.member-boat-card:hover {
  border-color: rgba(0, 104, 117, 0.28);
}

.member-boat-photo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: #e8eef0;
  color: var(--secondary);
}

.member-boat-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-boat-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.member-boat-text strong {
  color: var(--secondary);
}

/* Community members directory */
.members-desk {
  padding-bottom: 48px;
}

.members-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.members-head .lede {
  margin: 6px 0 0;
}

.members-search {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: min(320px, 100%);
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 76, 92, 0.14);
  background: #fff;
  box-shadow: var(--shadow);
}

.members-search .material-symbols-outlined {
  color: var(--on-surface-variant);
  font-size: 20px;
}

.members-search input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 12px 2px !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  outline: none;
}

.members-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.member-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: calc(var(--radius-xl) + 2px);
  border: 1px solid rgba(15, 76, 92, 0.12);
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.member-card:hover {
  border-color: rgba(0, 104, 117, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.member-card-photo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
}

.member-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.member-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.member-card-top strong {
  color: var(--secondary);
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-role {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 104, 117, 0.1);
  color: var(--secondary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.member-role--skipper,
.member-role--captain,
.member-role--owner {
  background: rgba(0, 104, 117, 0.14);
  color: #004e59;
}

.member-role--first_mate,
.member-role--navigator,
.member-role--engineer {
  background: rgba(15, 76, 92, 0.1);
  color: #0f4c5c;
}

.member-role--crew,
.member-role--deckhand,
.member-role--cook,
.member-role--guest {
  background: rgba(117, 135, 160, 0.16);
  color: #3d4f63;
}

.member-card-handle {
  color: var(--on-surface-variant);
  font-size: 0.82rem;
}

.member-handle {
  margin: 4px 0 0;
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.95rem;
}

.member-bio {
  margin: 12px 0 0;
  max-width: 40rem;
  line-height: 1.55;
  color: var(--on-surface);
}

.member-card-boat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--on-surface-variant);
  font-size: 0.9rem;
  min-width: 0;
}

.member-card-boat .material-symbols-outlined {
  font-size: 18px;
  color: var(--secondary);
}

.member-card-boat.is-empty {
  font-style: italic;
}

.members-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--on-surface-variant);
  border: 1px dashed rgba(15, 76, 92, 0.2);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.6);
}

.members-empty .material-symbols-outlined {
  font-size: 40px;
  color: rgba(15, 76, 92, 0.3);
}

.profile-avatar-field {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-avatar-preview {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

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

.profile-avatar-upload {
  display: grid;
  gap: 6px;
  min-width: min(240px, 100%);
}

.inbox-list,
.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 700px) {
  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card-media img {
    min-height: 180px;
  }
}

.error-list {
  background: #ffdad6;
  color: #93000a;
  border-radius: var(--radius-card);
  padding: 12px 14px;
  margin: 0 0 12px;
  border: 1px solid rgba(186, 26, 26, 0.18);
}

.location-prompt {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 24, 40, 0.45);
}

.location-prompt-card {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 76, 92, 0.12);
  box-shadow: 0 16px 40px rgba(8, 24, 40, 0.22);
}

.location-prompt-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.location-prompt-card > p {
  margin: 0 0 14px;
  color: var(--on-surface-variant, #5b6b73);
  line-height: 1.45;
}

.location-prompt-label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 600;
}

.location-prompt-label select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 76, 92, 0.2);
}

.location-prompt-status {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--secondary, #006875);
}

.location-prompt-status.is-error {
  color: #93000a;
}

.location-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .top-nav-links,
  .top-nav-search,
  .top-user-name,
  .user-menu-caret,
  .top-action {
    display: none;
  }

  .user-menu {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .mobile-nav:not([hidden]) {
    display: flex;
  }

  .map-panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(58vh, calc(100% - 88px));
    border-radius: 16px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .map-panel #boat-list {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
  }

  .map-panel.is-collapsed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px);
  }

  .map-panel-fab {
    top: 12px;
    left: 12px;
  }

  .map-search-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    top: 12px;
    left: 68px;
    right: 12px;
    z-index: 510;
    height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 76, 92, 0.12);
    box-shadow: 0 6px 18px rgba(13, 28, 46, 0.12);
  }

  .map-search-mobile .material-symbols-outlined {
    color: var(--on-surface-variant);
    font-size: 22px;
    flex-shrink: 0;
  }

  .map-search-mobile input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.95rem;
    color: var(--on-surface);
    outline: none;
  }

  .map-search-mobile input::placeholder {
    color: var(--outline);
  }

  .map-shell.is-fleet-open .map-search-mobile {
    opacity: 0.35;
    pointer-events: none;
  }

  .map-shell.is-fleet-open .map-tools-right {
    opacity: 0;
    pointer-events: none;
  }

  .map-tools-right {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    gap: 10px;
  }

  .map-tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .map-tool-btn .material-symbols-outlined {
    font-size: 24px;
  }

  .page-map .leaflet-bottom.leaflet-right {
    bottom: 8px;
    right: 64px;
  }

  .page-map .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(6px);
    border-radius: 8px;
    margin: 0 !important;
    font-size: 10px;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Live route tracking —— */
.live-track {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.page-live-track {
  background:
    radial-gradient(1000px 380px at 0% -8%, rgba(0, 104, 117, 0.09), transparent 55%),
    radial-gradient(800px 320px at 100% 0%, rgba(213, 227, 252, 0.65), transparent 50%),
    var(--background);
}

.live-track-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(196, 198, 205, 0.55);
}

.live-track-head .page-title {
  margin: 0;
}

.live-track-head .lede {
  margin-bottom: 0;
}

.live-track-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.live-track-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.live-track-map-pane {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.live-track-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.live-control {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.live-control select {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--outline-variant);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--on-surface);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.live-control select:focus {
  outline: none;
  border-color: rgba(0, 104, 117, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 104, 117, 0.12);
}

.live-control-hint {
  margin: 0;
  font-size: 0.82rem;
  align-self: center;
}

.live-track-map-wrap {
  position: relative;
  height: min(62vh, 560px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-lg);
}

#track-map {
  width: 100%;
  height: 100%;
  background: #dce9ff;
}

.live-map-tools {
  top: 12px;
  right: 12px;
}

.live-map-tools .map-tool-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--outline-variant);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.live-map-tools .map-tool-btn:hover {
  background: var(--secondary-tint);
  color: var(--secondary);
  border-color: rgba(0, 104, 117, 0.35);
}

.live-track-map-wrap.is-fullscreen,
.live-track-map-wrap:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 4000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.live-track-map-wrap:fullscreen .live-map-tools,
.live-track-map-wrap.is-fullscreen .live-map-tools {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}

body.live-map-fullscreen {
  overflow: hidden;
}

.live-track-legend {
  margin: 0;
  font-size: 0.82rem;
}

.live-track-panel {
  display: grid;
  gap: 12px;
}

.live-panel-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.live-panel-card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-family: var(--display);
}

.live-stats {
  margin: 0;
  display: grid;
  gap: 8px;
}

.live-stats > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(15, 76, 92, 0.08);
  padding-bottom: 6px;
}

.live-stats > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.live-stats dt {
  color: var(--on-surface-variant);
  font-size: 0.85rem;
}

.live-stats dd {
  margin: 0;
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.live-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}

.live-owner-actions {
  background:
    linear-gradient(180deg, rgba(0, 104, 117, 0.06) 0%, rgba(255, 255, 255, 0.95) 42%);
}

.live-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.live-action-row .mf-btn {
  flex: 1 1 calc(50% - 8px);
}

.live-owner-hint {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

.tracking-settings {
  margin-top: 18px;
  padding: 18px;
}

.tracking-settings .photo-manager-head {
  align-items: flex-start;
  gap: 12px;
}

.boat-edit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tracking-token-box {
  margin-top: 12px;
}

.tracking-token-value {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface-low);
  border-radius: var(--radius-card);
  word-break: break-all;
  font-size: 0.85rem;
}

.tracking-curl {
  margin: 12px 0 0;
  padding: 12px;
  background: var(--surface-low);
  border-radius: var(--radius-card);
  overflow: auto;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .live-track-shell {
    grid-template-columns: 1fr;
  }

  .live-track-map-wrap {
    height: 48vh;
  }

  .live-track-head-actions {
    width: 100%;
  }

  .live-track-head-actions .mf-btn {
    flex: 1 1 auto;
  }

  .live-action-row .mf-btn {
    flex: 1 1 100%;
  }

  .boat-edit-links {
    width: 100%;
  }

  .boat-edit-links .mf-btn {
    flex: 1 1 calc(50% - 8px);
  }
}

/* —— Landing / first page —— */
.page-landing .site-main {
  padding: 0;
}

.page-landing .site-footer {
  margin-top: 0;
  padding-top: 56px;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: linear-gradient(145deg, #0b1f33, #16324a 50%, #006875);
  overflow: hidden;
}

.landing-hero-media {
  position: absolute;
  inset: -8% 0 -8%;
  z-index: 0;
  will-change: transform;
  transform: translate3d(0, 0, 0) scale(1.06);
}

.landing-hero-media-zoom {
  position: absolute;
  inset: 0;
  background: var(--landing-hero, none) center / cover no-repeat;
  transform-origin: center center;
  animation: landingKen 22s ease-in-out infinite alternate;
}

.landing-hero--fallback .landing-hero-media-zoom {
  background:
    radial-gradient(1000px 480px at 78% 18%, rgba(118, 212, 229, 0.22), transparent 50%),
    linear-gradient(145deg, #0b1f33 0%, #16324a 45%, #006875 100%);
  animation: none;
}

@keyframes landingKen {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.landing-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(8, 22, 36, 0.9) 0%, rgba(8, 22, 36, 0.58) 42%, rgba(8, 22, 36, 0.28) 100%),
    linear-gradient(0deg, rgba(8, 22, 36, 0.78) 0%, transparent 48%);
  pointer-events: none;
}

.landing-hero-glow {
  position: absolute;
  z-index: 1;
  width: 50vw;
  max-width: 640px;
  height: 50vw;
  max-height: 640px;
  right: -8%;
  bottom: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 104, 117, 0.45) 0%, transparent 68%);
  pointer-events: none;
  animation: landingGlow 8s ease-in-out infinite alternate;
}

@keyframes landingGlow {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 0.9; transform: scale(1.08); }
}

.landing-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(48px, 8vh, 88px) 0 clamp(72px, 11vh, 108px);
  max-width: 40rem;
}

.landing-hero-item {
  opacity: 1;
  animation: landingIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms + 80ms);
}

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

.landing-brand {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: clamp(2.35rem, 6.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: #fff;
  text-wrap: balance;
}

.landing-title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.96);
  max-width: 18ch;
  text-wrap: balance;
}

.landing-lede {
  margin: 0 0 28px;
  max-width: 34rem;
  font-size: clamp(1.02rem, 2vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  text-wrap: pretty;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-cta {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.landing-cta:hover {
  transform: translateY(-1px);
}

.landing-cta:focus-visible,
.landing-group-list a:focus-visible,
.landing-scroll:focus-visible,
.landing-join-actions .mf-btn:focus-visible,
.landing-invite-actions .mf-btn:focus-visible {
  outline: 2px solid #9defff;
  outline-offset: 3px;
}

.landing-cta--light.mf-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
  backdrop-filter: blur(8px);
}

.landing-cta--light.mf-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  color: #fff;
}

.landing-cta--light.mf-btn--soft {
  background: rgba(157, 239, 255, 0.14);
  color: #9defff;
}

.landing-cta--light.mf-btn--soft:hover {
  background: rgba(157, 239, 255, 0.24);
  color: #fff;
}

.landing-scroll {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 22, 36, 0.28);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  animation: landingScrollPulse 2.2s ease-in-out infinite;
}

.landing-scroll:hover {
  background: rgba(8, 22, 36, 0.48);
  color: #fff;
}

.landing-scroll.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.landing-scroll .material-symbols-outlined {
  font-size: 26px;
}

@keyframes landingScrollPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.landing-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.landing-reveal.is-in {
  opacity: 1;
  transform: none;
}

.landing-section-head {
  max-width: 40rem;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.landing-section-head h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  text-wrap: balance;
}

.landing-section-head p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 1.05rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.landing-section-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  max-width: none;
}

.landing-why {
  padding: clamp(48px, 8vw, 88px) 0;
  background:
    radial-gradient(700px 260px at 0% 0%, rgba(0, 104, 117, 0.08), transparent 60%),
    linear-gradient(180deg, #eef5f7 0%, var(--background) 100%);
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.landing-why-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(0, 104, 117, 0.14);
}

.landing-why-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 28px 24px 28px 0;
  border-bottom: 1px solid rgba(0, 104, 117, 0.14);
}

.landing-why-list li:nth-child(odd) {
  padding-right: 32px;
  border-right: 1px solid rgba(0, 104, 117, 0.14);
}

.landing-why-list li:nth-child(even) {
  padding-left: 32px;
}

.landing-why-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(0, 104, 117, 0.1);
  color: var(--secondary);
  flex-shrink: 0;
}

.landing-why-icon .material-symbols-outlined {
  font-size: 24px;
}

.landing-why-list strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--on-surface);
}

.landing-why-list p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 0.98rem;
  line-height: 1.55;
}

.landing-groups {
  padding: clamp(48px, 7vw, 80px) 0;
  background:
    linear-gradient(180deg, #fff 0%, #f7fbfc 100%);
  border-top: 1px solid rgba(196, 198, 205, 0.45);
  border-bottom: 1px solid rgba(196, 198, 205, 0.45);
}

.landing-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.landing-group-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 104, 117, 0.1);
  background: linear-gradient(180deg, #f4fafb 0%, #eef6f8 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.landing-group-list a:hover {
  border-color: rgba(0, 104, 117, 0.3);
  background: #fff;
  color: inherit;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.landing-group-list a:hover .landing-group-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.landing-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(0, 104, 117, 0.1);
  color: var(--secondary);
}

.landing-group-icon .material-symbols-outlined {
  font-size: 24px;
}

.landing-group-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.landing-group-copy strong {
  font-family: var(--display);
  font-size: 1.02rem;
}

.landing-group-copy span {
  color: var(--on-surface-variant);
  font-size: 0.86rem;
}

.landing-group-arrow {
  color: var(--secondary);
  font-size: 20px !important;
  opacity: 0.45;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.landing-empty {
  margin: 0;
  color: var(--on-surface-variant);
}

.landing-invite {
  padding: clamp(48px, 8vw, 88px) 0;
  background:
    radial-gradient(900px 320px at 100% 0%, rgba(0, 104, 117, 0.1), transparent 55%),
    linear-gradient(180deg, #f3f7fb 0%, var(--background) 100%);
}

.landing-invite-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
}

.landing-invite-copy h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
  text-wrap: balance;
}

.landing-invite-copy p {
  margin: 0 0 20px;
  max-width: 36rem;
  color: var(--on-surface-variant);
  font-size: 1.02rem;
  line-height: 1.55;
}

.landing-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.landing-invite-stats > div {
  padding: 18px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--outline-variant);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.landing-invite-stats > div:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 104, 117, 0.28);
}

.landing-invite-stats dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.landing-invite-stats dd {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.landing-join {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 80px) 0;
  color: #fff;
  background:
    radial-gradient(700px 280px at 15% 0%, rgba(118, 212, 229, 0.22), transparent 55%),
    linear-gradient(135deg, #0b1f33 0%, #16324a 48%, #006875 100%);
}

.landing-join::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% 40%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 239, 255, 0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: landingGlow 9s ease-in-out infinite alternate;
}

.landing-join-inner {
  position: relative;
  z-index: 1;
  max-width: 40rem;
}

.landing-join h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.landing-join p {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.55;
}

.landing-join-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-cta--on-dark.mf-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.landing-cta--on-dark.mf-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  color: #fff;
}

@media (max-width: 900px) {
  .landing-hero {
    min-height: calc(100svh - var(--nav-h));
  }

  .landing-hero-inner {
    padding: 40px 0 64px;
  }

  .landing-title {
    max-width: none;
  }

  .landing-actions .mf-btn {
    flex: 1 1 100%;
  }

  .landing-why-list {
    grid-template-columns: 1fr;
  }

  .landing-why-list li,
  .landing-why-list li:nth-child(odd),
  .landing-why-list li:nth-child(even) {
    padding: 22px 0;
    border-right: 0;
  }

  .landing-group-list {
    grid-template-columns: 1fr;
  }

  .landing-invite-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .landing-invite-stats {
    grid-template-columns: 1fr 1fr;
  }

  .landing-join-actions .mf-btn {
    flex: 1 1 100%;
  }
}

.page-invite .top-nav {
  display: none;
}

.page-invite .site-main {
  padding-top: 0;
}

.landing-gate {
  min-height: 100svh;
  align-items: center;
}

.landing-gate-inner {
  max-width: 28rem;
  padding: clamp(48px, 10vh, 96px) 0;
}

.landing-gate-kicker {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary-fixed);
}

.landing-gate-form {
  display: grid;
  gap: 8px;
}

.landing-gate-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.landing-gate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-gate-input {
  flex: 1 1 12rem;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(8, 22, 36, 0.42);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px);
}

.landing-gate-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0;
}

.landing-gate-input:focus {
  outline: none;
  border-color: #9defff;
  box-shadow: 0 0 0 2px rgba(157, 239, 255, 0.28);
}

.landing-gate-row .mf-btn {
  min-height: 46px;
  padding: 0 18px;
}

.landing-gate-hint {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.landing-gate-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(186, 26, 26, 0.22);
  border: 1px solid rgba(255, 218, 214, 0.35);
  color: #ffdad6;
  font-size: 0.9rem;
}

.landing-gate-legal {
  margin: 22px 0 0;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.landing-gate-legal a {
  color: rgba(255, 255, 255, 0.78);
}

.landing-gate-legal a:hover {
  color: #9defff;
}

.landing-welcome-inner {
  max-width: 34rem;
  padding: clamp(48px, 10vh, 96px) 0;
}

.landing-welcome-letter {
  margin: 0 0 28px;
  max-width: 34rem;
}

.landing-welcome-letter p {
  margin: 0 0 14px;
  font-size: clamp(1.02rem, 2vw, 1.15rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  text-wrap: pretty;
}

.landing-welcome-letter p:last-child {
  margin-bottom: 0;
}

.landing-welcome-sign {
  margin-top: 8px !important;
  font-family: var(--display);
  font-weight: 600;
  color: #fff;
}

.landing-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 900px) {
  .landing-welcome-actions .mf-btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 900px) {
  .landing-gate-row .mf-btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-media-zoom,
  .landing-hero-item,
  .landing-hero-glow,
  .landing-scroll,
  .landing-join::before {
    animation: none;
  }

  .landing-hero-item {
    opacity: 1 !important;
    transform: none !important;
  }

  .landing-hero-media,
  .landing-hero-media-zoom {
    transform: none;
  }

  .landing-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }

  .landing-cta:hover,
  .landing-group-list a:hover,
  .landing-invite-stats > div:hover {
    transform: none;
  }
}

/* —— Mobile layout (all pages) —— */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.page-invite .site-main {
  min-height: 100dvh;
  overflow: auto;
}

.page-invite .landing-hero.landing-gate {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100dvh;
  align-items: stretch;
}

.page-invite .landing-gate-inner,
.page-invite .landing-welcome-inner {
  margin-top: auto;
  margin-bottom: auto;
  padding-top: max(32px, env(safe-area-inset-top, 0px));
  padding-bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 28px));
}

@media (max-width: 900px) {
  .brand {
    font-size: 18px;
    max-width: min(58vw, 12rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-nav-inner {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .wrap {
    width: min(1120px, calc(100% - 24px));
  }

  input,
  select,
  textarea,
  .landing-gate-input {
    font-size: 16px;
  }

  .auth-hero {
    min-height: auto;
    padding: 28px 0 48px;
  }

  .auth-brand h1 {
    font-size: 1.6rem;
  }

  .community-hero {
    min-height: auto;
  }

  .community-hero-inner {
    padding: 36px 0 28px;
  }

  .community-hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .members-search {
    width: 100%;
    min-width: 0;
  }

  .members-grid,
  .boat-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .btn,
  .toolbar select {
    width: 100%;
  }

  .profile-hero-actions {
    width: 100%;
  }

  .profile-hero-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .profile-avatar-field {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-head,
  .members-head,
  .community-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-grid,
  .footer-grid--compact {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .page-invite .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .page-invite .landing-gate-inner,
  .page-invite .landing-welcome-inner {
    padding-bottom: max(160px, calc(env(safe-area-inset-bottom, 0px) + 140px));
  }

  .landing-hero {
    min-height: calc(100dvh - var(--nav-h));
    overflow-x: hidden;
  }

  .page-invite .landing-hero {
    min-height: 100dvh;
  }

  .section {
    padding: 24px 0 48px;
  }

  .card,
  .auth-card {
    max-width: 100%;
  }

  html,
  body {
    max-width: 100%;
  }

  body.page-map,
  body.page-chat,
  body.page-messages {
    max-width: 100%;
  }
}

/* —— Groups hub —— */
.page-groups .site-main {
  padding-top: var(--nav-h);
  background:
    radial-gradient(900px 280px at 0% 0%, rgba(0, 104, 117, 0.07), transparent 55%),
    linear-gradient(180deg, #eef4f8 0%, var(--background) 28%);
}

.groups-hero {
  color: #fff;
  background:
    radial-gradient(700px 280px at 85% 0%, rgba(118, 212, 229, 0.22), transparent 55%),
    linear-gradient(135deg, #0b1f33 0%, #16324a 48%, #0f4c5c 100%);
}

.groups-hero-inner {
  padding: clamp(28px, 5vw, 44px) 0 clamp(32px, 5vw, 48px);
  max-width: 40rem;
}

.groups-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary-fixed);
}

.groups-hero-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.groups-hero-lede {
  margin: 12px 0 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.groups-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.groups-hero-meta span,
.groups-hero-meta a {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(157, 239, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}

.groups-hero-meta a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.groups-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.groups-hero-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.groups-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  color: #fff;
}

.groups-desk {
  padding: clamp(24px, 4vw, 40px) 0 64px;
}

.groups-desk-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.2fr);
  gap: clamp(22px, 3vw, 36px);
  align-items: start;
}

.groups-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.groups-pane-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.groups-pane-head p {
  margin: 4px 0 0;
  color: var(--on-surface-variant);
  font-size: 0.92rem;
}

.groups-topic-list {
  display: grid;
  gap: 8px;
}

.group-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 76, 92, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.group-tile:hover {
  border-color: rgba(0, 104, 117, 0.28);
  transform: translateY(-1px);
  color: inherit;
  box-shadow: var(--shadow-lg);
}

.group-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(0, 104, 117, 0.1);
  color: var(--secondary);
}

.group-tile-icon .material-symbols-outlined {
  font-size: 22px;
}

.group-tile-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-tile-copy strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.98rem;
}

.groups-pane-head--next {
  margin-top: 28px;
}

#my-groups {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.groups-empty {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px dashed rgba(15, 76, 92, 0.2);
  background: rgba(255, 255, 255, 0.55);
}

.groups-empty p {
  margin: 0;
  color: var(--on-surface-variant);
  font-size: 0.92rem;
}

.group-tile--mine {
  border-color: rgba(0, 104, 117, 0.22);
  background: linear-gradient(180deg, #f4fbfc 0%, #fff 100%);
}

.group-tile-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 104, 117, 0.1);
  color: var(--secondary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-tile-badge--joined {
  background: rgba(34, 197, 94, 0.14);
  color: #15803d;
}

.group-tile-desc {
  color: var(--on-surface-variant);
  font-size: 0.86rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.group-tile-stats {
  color: var(--on-surface-variant);
  font-size: 0.78rem;
}

.group-tile-arrow {
  color: var(--secondary);
  opacity: 0.35;
  font-size: 20px !important;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.group-tile:hover .group-tile-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.page-groups .post-feed--groups {
  max-width: none;
}

.page-groups .feed-card {
  border-radius: 16px;
}

@media (max-width: 980px) {
  .groups-desk-grid {
    grid-template-columns: 1fr;
  }

  .groups-topic-list {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 640px) {
  .groups-hero-actions .mf-btn {
    flex: 1 1 100%;
  }

  .groups-topic-list {
    grid-template-columns: 1fr;
  }

  .groups-pane-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* —— Single group page —— */
.page-group .groups-hero-inner,
.group-page-hero .wrap {
  max-width: none;
  padding-top: clamp(22px, 3.5vw, 32px);
}

.groups-crumb {
  margin: 0 0 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.62);
}

.groups-crumb a {
  color: var(--secondary-fixed);
  text-decoration: none;
}

.groups-crumb a:hover {
  color: #fff;
}

.group-page-hero-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding-bottom: clamp(28px, 4vw, 40px);
}

.group-page-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(157, 239, 255, 0.14);
  color: var(--secondary-fixed);
}

.group-page-icon .material-symbols-outlined {
  font-size: 30px;
}

.group-page-hero-copy .groups-hero-title {
  font-size: clamp(1.7rem, 3.5vw, 2.35rem);
}

.group-page-hero-copy .groups-hero-lede {
  max-width: 40rem;
}

.group-page-joined {
  border-color: rgba(34, 197, 94, 0.45) !important;
  background: rgba(34, 197, 94, 0.18) !important;
}

.group-page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.group-page-hero-actions form {
  margin: 0;
}

.group-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
  gap: clamp(22px, 3vw, 36px);
  align-items: start;
}

.page-group .post-feed--groups {
  max-width: none;
}

.group-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.group-person {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 76, 92, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

.group-person-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.group-person-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.group-person-photo--fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #006875, #0f4c5c);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.group-person-copy {
  display: grid;
  min-width: 0;
}

.group-person-copy strong {
  font-size: 0.92rem;
}

.group-person-copy span {
  color: var(--on-surface-variant);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-person-boat {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
  text-decoration: none;
}

.group-person-boat:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .group-page-hero-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .group-page-hero-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .group-page-grid {
    grid-template-columns: 1fr;
  }
}
