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

:root {
  --ocean-50: #eef9fb;
  --ocean-100: #d5f0f5;
  --ocean-300: #77cad9;
  --ocean-400: #44abbf;
  --ocean-500: #2a8fa4;
  --ocean-600: #247389;
  --ocean-700: #225d70;
  --ocean-800: #234e5c;
  --ocean-900: #21424f;
  --ocean-950: #112a35;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 12px;
  --header-h: 64px;
  --panel-w: 380px;
  --font: "Inter", system-ui, sans-serif;
  --font-display: "Outfit", system-ui, sans-serif;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: var(--font);
  background: var(--ocean-950);
  color: var(--ocean-50);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  overflow-x: hidden;
  max-width: 100%;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: var(--header-h);
  min-width: 0;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(35, 78, 92, 0.6);
  background: rgba(17, 42, 53, 0.92);
  backdrop-filter: blur(12px);
  z-index: 1000;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.header-brand > div {
  min-width: 0;
  overflow: hidden;
}

.logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ocean-500);
  border-radius: var(--radius);
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(17, 42, 53, 0.5);
}

.header h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tagline {
  font-size: 0.7rem;
  color: var(--ocean-300);
  display: none;
}

@media (min-width: 640px) {
  .header {
    padding: 0 1.5rem;
  }

  .header h1 {
    font-size: 1.25rem;
  }

  .tagline {
    display: block;
  }
}

@media (max-width: 639px) {
  :root {
    --header-h: 52px;
  }

  .header {
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
    gap: 0.35rem;
  }

  .header h1 {
    font-size: 0.95rem;
  }

  .logo {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .header-brand {
    gap: 0.5rem;
  }

  .header-nav {
    flex-shrink: 0;
    gap: 0.35rem;
    font-size: 0.75rem;
  }

  .header-nav a:not(#nav-logout) {
    display: none;
  }

  .header-nav .nav-user {
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #toggle-panel-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

.mobile-only {
  display: flex;
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none;
  }
}

/* Main layout */
.main {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.map-section {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: var(--ocean-950);
}

.leaflet-container {
  font-family: var(--font);
  max-width: 100%;
  overflow: hidden;
}

.leaflet-pane.bathymetry-pane {
  mix-blend-mode: multiply;
  pointer-events: none;
}

.leaflet-container .leaflet-popup-pane {
  z-index: 800;
}

/* Let popup buttons receive clicks when they overlap map controls */
.map-section.popup-open .map-controls > *,
.map-section.popup-open .layer-control {
  pointer-events: none;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
}

.leaflet-popup-content {
  margin: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}

.popup-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ocean-100);
  color: var(--ocean-900);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.popup-badge-community {
  background: #f3e8ff;
  color: #6b21a8;
}

.popup-title {
  font-weight: 600;
  font-size: 1rem;
  color: #111;
}

.popup-desc {
  color: #555;
  margin-top: 4px;
}

.popup-meta {
  color: #888;
  font-size: 0.75rem;
  margin-top: 6px;
}

.catch-popup-details {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 0.8125rem;
}

.catch-popup-details dt {
  margin: 0;
  color: #888;
  font-weight: 500;
}

.catch-popup-details dd {
  margin: 0;
  color: #222;
  font-weight: 600;
}

.catch-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.leaflet-popup-content .catch-action-btn {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.catch-action-btn {
  background: transparent;
  border: 1px solid var(--ocean-600, #236e82);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  color: var(--ocean-600, #236e82);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}

.catch-action-btn:hover {
  background: rgba(35, 110, 130, 0.1);
}

.catch-like-btn,
.catch-action-btn.catch-like-btn {
  border-color: #c084fc;
  color: #7e22ce;
}

.catch-like-btn:hover,
.catch-action-btn.catch-like-btn:hover {
  background: rgba(192, 132, 252, 0.12);
}

.catch-like-btn.liked,
.catch-action-btn.catch-like-btn.liked {
  background: rgba(192, 132, 252, 0.18);
  border-color: #a855f7;
  color: #6b21a8;
}

.catch-popup-notes {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 1rem;
}

.photo-modal.hidden {
  display: none;
}

.photo-modal img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}

.photo-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.photo-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.photo-modal-share-btn {
  position: absolute;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(17, 42, 53, 0.88);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  font-family: inherit;
}

.photo-modal-share-btn:hover {
  background: rgba(35, 78, 92, 0.95);
}

/* Map controls */
.map-controls {
  position: absolute;
  top: max(8px, env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.map-controls > * {
  pointer-events: auto;
  min-width: 0;
  max-width: 100%;
}

.map-controls-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.location-search {
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(33, 66, 79, 0.95);
  border: 1px solid rgba(34, 93, 112, 0.5);
  border-radius: var(--radius);
  padding: 6px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.location-search input {
  flex: 1;
  min-width: 0;
  background: var(--ocean-950);
  border: 1px solid var(--ocean-700);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.8125rem;
  outline: none;
}

.location-search input::placeholder {
  color: var(--ocean-600);
  font-size: 0.75rem;
}

.location-search input:focus {
  border-color: var(--ocean-400);
  box-shadow: 0 0 0 1px var(--ocean-400);
}

.location-search .btn {
  flex-shrink: 0;
  padding: 10px 16px;
}

.location-search.loading .btn {
  opacity: 0.6;
  pointer-events: none;
}

.location-search.loading input {
  opacity: 0.7;
}

.layer-control {
  position: absolute;
  z-index: 520;
  pointer-events: auto;
  background: rgba(33, 66, 79, 0.95);
  border: 1px solid rgba(34, 93, 112, 0.5);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 220px;
}

.layer-control-panel {
  padding: 12px;
}

.layer-toggle-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(34, 93, 112, 0.5);
  border-radius: var(--radius);
  background: rgba(33, 66, 79, 0.95);
  color: var(--ocean-100);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.layer-toggle-btn[aria-expanded="true"] {
  background: rgba(35, 78, 92, 0.95);
  color: #fff;
}

.layer-toggle-btn svg {
  flex-shrink: 0;
  color: var(--ocean-300);
}

.layer-control-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ocean-300);
  margin-bottom: 8px;
}

.layer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ocean-300);
  font-size: 0.8125rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.layer-btn.active {
  background: rgba(35, 78, 92, 0.6);
  color: #fff;
}

.layer-btn:hover {
  background: rgba(35, 78, 92, 0.3);
}

.layer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-actions {
  display: flex;
  gap: 6px;
  align-self: flex-end;
  flex-shrink: 0;
}

.mark-label-short {
  display: none;
}

.btn-mark-catch {
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .map-controls {
    gap: 5px;
  }

  .map-controls-row {
    width: 100%;
  }

  .map-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 4px;
    width: 100%;
    min-width: 0;
  }

  .map-actions .btn-icon {
    width: 100%;
    max-width: 40px;
    height: 36px;
    min-width: 0;
    justify-self: center;
  }

  .map-actions .btn-icon svg {
    width: 18px;
    height: 18px;
  }

  .btn-mark-catch {
    height: 36px;
    padding: 0 10px;
    font-size: 0.7rem;
    min-width: 0;
    justify-self: end;
  }

  .mark-label-full {
    display: none;
  }

  .mark-label-short {
    display: inline;
  }

  .location-search {
    padding: 5px;
    gap: 4px;
  }

  .location-search input {
    padding: 7px 8px;
    font-size: 16px;
    min-width: 0;
  }

  .location-search input::placeholder {
    font-size: 0.75rem;
  }

  .location-search .btn {
    padding: 7px 10px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* Layers dock — bottom-left, panel opens upward */
  .layer-control {
    top: auto;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    right: auto;
    max-width: min(260px, calc(100% - 16px));
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
  }

  .layer-control:not(.open) .layer-control-panel {
    display: none;
  }

  .layer-control.open {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .layer-control.open .layer-control-panel {
    display: block;
    width: min(260px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: min(38vh, 240px);
    overflow-y: auto;
    margin-bottom: 8px;
    background: rgba(33, 66, 79, 0.95);
    border: 1px solid rgba(34, 93, 112, 0.5);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 10px;
    box-sizing: border-box;
  }

  .layer-control.open .layer-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }

  .layer-control.open .layer-btn {
    padding: 7px 6px;
    font-size: 0.72rem;
    gap: 6px;
  }

  .layer-toggle-btn.mobile-only {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: 36px;
    padding: 0 12px;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(33, 66, 79, 0.95);
    border: 1px solid rgba(34, 93, 112, 0.5);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }

  .layer-toggle-btn span {
    display: inline;
    font-size: 0.75rem;
  }

  .layer-toggle-btn svg {
    width: 16px;
    height: 16px;
  }

  .marine-data-status {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    max-width: none;
    font-size: 0.65rem;
    padding: 5px 10px;
    box-sizing: border-box;
  }

  .location-error {
    left: max(16px, env(safe-area-inset-left, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
    transform: none;
    max-width: none;
    box-sizing: border-box;
  }

  .side-panel {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }
}

@media (min-width: 640px) {
  .map-controls {
    top: 12px;
    padding-left: 12px;
    padding-right: 12px;
    gap: 8px;
  }

  .location-search {
    gap: 8px;
    padding: 8px;
  }

  .location-search input {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }

  .map-controls-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
  }

  .map-actions {
    gap: 8px;
    align-self: auto;
    display: flex;
    width: auto;
    grid-template-columns: none;
  }

  .map-actions .btn-icon {
    width: 44px;
    max-width: none;
    height: 44px;
  }

  .layer-control {
    top: 76px;
    left: 12px;
    bottom: auto;
    display: block;
    flex-direction: column;
  }

  .layer-control .layer-control-panel {
    display: block;
  }

  .layer-toggle-btn.mobile-only {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ocean-500);
  color: #fff;
  box-shadow: 0 4px 12px rgba(17, 42, 53, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: var(--ocean-400);
}

.btn-primary[aria-pressed="true"] {
  background: #ef4444;
}

.btn-secondary {
  background: rgba(35, 78, 92, 0.8);
  color: var(--ocean-100);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--ocean-700);
}

.btn-ghost {
  background: rgba(35, 78, 92, 0.8);
  color: var(--ocean-100);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(33, 66, 79, 0.95);
  color: var(--ocean-100);
  border: 1px solid rgba(34, 93, 112, 0.5);
  backdrop-filter: blur(12px);
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--ocean-300);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-icon-sm:hover {
  background: rgba(35, 78, 92, 0.6);
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* Location error */
.location-error {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(127, 29, 29, 0.92);
  color: #fecaca;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  max-width: calc(100% - 32px);
  text-align: center;
}

.location-error.success {
  background: rgba(20, 83, 45, 0.92);
  color: #bbf7d0;
}

/* Side panel */
.side-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 55vh;
  background: rgba(17, 42, 53, 0.97);
  border-top: 1px solid rgba(35, 78, 92, 0.6);
  backdrop-filter: blur(16px);
  z-index: 900;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.side-panel.open {
  transform: translateY(0);
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 850;
}

@media (min-width: 1024px) {
  .side-panel {
    position: relative;
    width: var(--panel-w);
    max-height: none;
    flex-shrink: 0;
    border-top: none;
    border-left: 1px solid rgba(35, 78, 92, 0.6);
    transform: none;
    overflow-y: auto;
  }

  .panel-overlay {
    display: none !important;
  }
}

.panel-section + .panel-section {
  margin-top: 1rem;
}

/* Catch form */
.catch-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(33, 66, 79, 0.6);
  border: 1px solid rgba(34, 93, 112, 0.5);
  border-radius: var(--radius);
  padding: 1rem;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.catch-form h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.form-meta {
  font-size: 0.7rem;
  color: var(--ocean-400);
  margin-top: 2px;
}

.coords-box {
  background: rgba(17, 42, 53, 0.6);
  border-radius: 8px;
  padding: 10px 12px;
}

.coords {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--ocean-300);
}

.coords-box .btn {
  margin-top: 8px;
  font-size: 0.75rem;
  padding: 8px;
}

.photo-preview-box {
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ocean-700);
  background: var(--ocean-950);
}

.photo-preview-box img {
  display: block;
  width: 100%;
  max-height: 140px;
  object-fit: cover;
}

.photo-preview-meta {
  padding: 6px 10px;
  font-size: 0.7rem;
  color: var(--ocean-400);
}

.import-photo-panel {
  margin-bottom: 1rem;
}

.import-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.import-photo-hint {
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--ocean-500);
  text-align: center;
}

.import-photo-panel .btn:disabled,
#import-photo-btn:disabled,
#camera-photo-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

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

@media (min-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.catch-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.catch-form label > span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ocean-300);
}

.catch-form select,
.catch-form input[type="text"],
.catch-form textarea {
  background: var(--ocean-950);
  border: 1px solid var(--ocean-700);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
}

.catch-form select:focus,
.catch-form input:focus,
.catch-form textarea:focus {
  border-color: var(--ocean-400);
  box-shadow: 0 0 0 1px var(--ocean-400);
}

.catch-form textarea {
  resize: vertical;
  min-height: 60px;
}

/* Catch list */
.catch-list-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgba(34, 93, 112, 0.5);
  border-radius: var(--radius);
  color: var(--ocean-300);
}

.catch-list-empty p:first-child {
  font-weight: 500;
  font-size: 0.875rem;
}

.catch-list-empty p:last-child {
  font-size: 0.75rem;
  color: var(--ocean-400);
  margin-top: 4px;
}

.catch-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.catch-list-source {
  display: flex;
  gap: 4px;
}

.catch-source-btn {
  border: 1px solid rgba(34, 93, 112, 0.5);
  background: transparent;
  color: var(--ocean-300);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.catch-source-btn.active {
  background: rgba(68, 171, 191, 0.2);
  border-color: var(--ocean-400);
  color: #fff;
}

.catch-list-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ocean-400);
  margin-bottom: 8px;
}

.catch-list-sort {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.catch-sort-btn {
  border: 1px solid rgba(34, 93, 112, 0.5);
  background: transparent;
  color: var(--ocean-300);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.catch-sort-btn.active {
  background: rgba(68, 171, 191, 0.2);
  border-color: var(--ocean-400);
  color: #fff;
}

.catch-sort-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.catch-list-hint {
  font-size: 0.7rem;
  color: var(--ocean-400);
  margin: 0 0 10px;
}

.catch-distance {
  color: var(--ocean-200);
  font-weight: 600;
}

.catch-meta .catch-distance::after {
  content: " ·";
  font-weight: 400;
  color: var(--ocean-400);
}

.catch-angler {
  color: var(--ocean-200);
  font-weight: 600;
}

.catch-angler-own {
  color: var(--ocean-300);
}

.catch-meta .catch-angler::after {
  content: " ·";
  font-weight: 400;
  color: var(--ocean-400);
}

.catch-list-sort {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.catch-item {
  border: 1px solid rgba(34, 93, 112, 0.4);
  border-radius: var(--radius);
  background: rgba(33, 66, 79, 0.5);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.catch-item:hover,
.catch-item.selected {
  border-color: var(--ocean-400);
}

.catch-item-body {
  width: 100%;
  padding: 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.catch-fish {
  font-weight: 600;
  color: #fff;
  font-size: 0.9375rem;
}

.catch-meta {
  font-size: 0.75rem;
  color: var(--ocean-300);
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catch-coords {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--ocean-400);
  margin-top: 4px;
}

.catch-notes {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--ocean-400);
  margin-top: 6px;
}

.catch-item-footer {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-top: 1px solid rgba(34, 93, 112, 0.3);
  padding: 6px 12px;
}

.catch-list-share-btn,
.catch-list-photo-btn,
.catch-like-btn {
  flex: 1;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--ocean-600);
  border-radius: 6px;
  background: transparent;
  color: var(--ocean-300);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.catch-like-btn {
  border-color: #a855f7;
  color: #d8b4fe;
}

.catch-like-btn.liked {
  background: rgba(168, 85, 247, 0.15);
  color: #f3e8ff;
}

.catch-list-share-btn:hover,
.catch-list-photo-btn:hover,
.catch-like-btn:hover {
  background: rgba(68, 171, 191, 0.15);
}

.catch-like-btn:hover {
  background: rgba(168, 85, 247, 0.15);
}

.delete-btn {
  background: none;
  border: none;
  color: rgba(248, 113, 113, 0.8);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.delete-btn:hover {
  color: var(--red);
}

/* Marking mode cursor */
#map.marking-mode {
  cursor: crosshair;
}

.marine-data-status {
  position: absolute;
  bottom: 16px;
  left: 12px;
  z-index: 600;
  background: rgba(33, 66, 79, 0.92);
  border: 1px solid rgba(34, 93, 112, 0.5);
  color: var(--ocean-300);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
  backdrop-filter: blur(8px);
  max-width: calc(100% - 24px);
  pointer-events: none;
}

.marine-data-status.loading {
  color: var(--ocean-200);
}

.marine-data-status.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.85);
  border-color: rgba(185, 28, 28, 0.5);
}

@media (min-width: 640px) {
  .location-error {
    bottom: 48px;
  }
}

/* Shared catch page */
.share-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.share-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.share-brand-link {
  text-decoration: none;
  color: inherit;
}

.share-tagline {
  opacity: 0.85;
}

.share-main {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
}

.share-status {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ocean-200);
}

.share-error {
  color: #fecaca;
}

.share-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.share-map {
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(35, 78, 92, 0.5);
}

.share-card {
  background: rgba(17, 42, 53, 0.92);
  border: 1px solid rgba(35, 78, 92, 0.5);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.share-byline {
  font-size: 0.8125rem;
  color: var(--ocean-300);
  margin-bottom: 0.35rem;
}

.share-fish {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.share-details {
  margin-bottom: 0.75rem;
}

.share-notes {
  font-size: 0.875rem;
  color: var(--ocean-200);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.share-photo-wrap {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
}

.share-photo-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .share-map {
    height: 280px;
  }
}
