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

/* Access gate */
#access-gate {
  position: fixed;
  inset: 0;
  background: #060f1e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.gate-card {
  background: #0c2a4a;
  border: 1px solid rgba(77,142,255,0.2);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 340px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.gate-logo { font-size: 2.5rem; }
.gate-card h2 { color: #fff; font-size: 1.3rem; }
.gate-card p { color: rgba(255,255,255,0.55); font-size: 0.9rem; }
#gate-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(77,142,255,0.3);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.1em;
  outline: none;
}
#gate-input:focus { border-color: #00e5a0; }
#gate-btn {
  padding: 0.75rem;
  background: #00e5a0;
  color: #060f1e;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
#gate-btn:hover { background: #00cfb4; }
.gate-error { color: #e74c3c; font-size: 0.85rem; min-height: 1.2em; }

:root {
  --bg: #0a1628;
  --surface: #0f2040;
  --surface-2: #162a50;
  --border: rgba(77,142,255,0.15);
  --text: #e8f0ff;
  --text-light: rgba(232,240,255,0.5);
  --primary: #00e5a0;
  --primary-dark: #00b37d;
  --accent: #4d8eff;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --radius: 12px;
  --green: #27ae60;
  --red: #e74c3c;
  --yellow: #f39c12;
  --blue: #3498db;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Ambient teal glow — top of page */
body::after {
  content: '';
  position: fixed;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 420px;
  background: radial-gradient(ellipse, rgba(0,229,160,0.07) 0%, rgba(0,201,212,0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

/* Region selector */
#region-selector {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9998;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.region-selector-inner {
  width: 100%;
  max-width: 560px;
}

.region-selector-header {
  text-align: center;
  margin-bottom: 28px;
}

.region-selector-logo {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.region-selector-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #00e5a0 0%, #00c9d4 50%, #4d8eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.region-selector-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.region-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.region-card {
  background: linear-gradient(160deg, #132440 0%, #0f2040 100%);
  border: 1px solid rgba(77,142,255,0.15);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.region-card.region-live {
  border-color: rgba(0,229,160,0.2);
}

.region-card.region-live:hover {
  border-color: rgba(0,229,160,0.5);
  box-shadow: 0 4px 20px rgba(0,229,160,0.1);
}

.region-card.region-coming-soon {
  opacity: 0.5;
  cursor: default;
}

.region-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.region-card-desc {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.region-card-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0,229,160,0.15);
  color: var(--primary);
}

.region-coming-soon .region-card-badge {
  background: rgba(77,142,255,0.12);
  color: var(--text-light);
}

.region-selector-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.region-selector-footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Region switcher button in header */
.region-switch-btn {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(0,229,160,0.25);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}

.region-switch-btn:hover {
  background: rgba(0,229,160,0.08);
  border-color: rgba(0,229,160,0.5);
}

/* Header */
header {
  background: rgba(10,22,40,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, #00e5a0 0%, #00c9d4 50%, #4d8eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.hidden {
  display: none !important;
}

/* Main content */
main {
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  border: none;
  background: var(--surface);
  color: var(--text-light);
  transition: all 0.2s;
}

.tab.active {
  background: linear-gradient(135deg, #00e5a0 0%, #00c4b4 60%, #1a9fd4 100%);
  color: #050e1c;
  text-shadow: none;
}

/* Search bar */
.search-bar {
  margin-bottom: 12px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(77,142,255,0.2);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
}

.search-input::placeholder {
  color: var(--text-light);
}

/* Map controls */
.map-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

/* Depth filter buttons */
.depth-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.depth-btn {
  padding: 8px 14px;
  border: 1px solid rgba(77,142,255,0.25);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.depth-btn.active {
  background: var(--primary);
  color: #0a1628;
  border-color: var(--primary);
}

.depth-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--text);
}

/* Map style dropdown — lives inline with depth filter pills */
.map-style-select {
  padding: 6px 10px;
  border: 1px solid rgba(77,142,255,0.25);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(232,240,255,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.map-style-select:focus {
  border-color: var(--primary);
}

/* Result count */
.result-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-left: 4px;
}

/* Map */
#reef-map {
  width: 100%;
  height: 450px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1;
  border: 1px solid var(--border);
}

.map-popup {
  font-size: 0.85rem;
  line-height: 1.5;
}

.map-popup strong {
  font-size: 0.95rem;
  color: var(--primary);
}

.popup-id {
  color: var(--text-light);
}

.popup-depth {
  color: var(--accent);
  font-weight: 600;
}

.popup-area {
  color: var(--text-light);
  font-style: italic;
}

.popup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(77,142,255,0.15);
}

.popup-nav-btn {
  display: inline-block;
  padding: 5px 12px;
  background: var(--primary);
  color: #0a1628;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.popup-fav-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px 4px;
  line-height: 1;
}

.popup-fav-btn.fav-active {
  color: #f39c12;
}

/* Leaflet popup dark override */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-popup-tip {
  background: var(--surface) !important;
}

.leaflet-popup-close-button {
  color: var(--text-light) !important;
}

.map-legend {
  background: rgba(10,22,40,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 0.65rem;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  max-width: calc(100% - 20px);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ramp-legend-dot {
  border-radius: 2px;
}

/* Collapsible county headers */
.collapsible {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.collapsible:hover {
  opacity: 0.85;
}

.collapse-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-arrow {
  font-size: 0.7rem;
  color: var(--text-light);
  width: 12px;
  flex-shrink: 0;
}

.county-items {
  transition: none;
}

.county-items.hidden {
  display: none;
}

/* Ramp map markers */
.ramp-marker-icon {
  background: none;
  border: none;
}

.ramp-dot {
  width: 10px;
  height: 10px;
  background: #e67e22;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Bait shop map marker */
.shop-marker-icon {
  background: none;
  border: none;
}

.shop-dot {
  width: 12px;
  height: 12px;
  background: #ff9800;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Shop service tags */
.shop-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}

.shop-tag {
  background: rgba(255,152,0,0.15);
  border: 1px solid rgba(255,152,0,0.3);
  color: #ff9800;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
}

.shop-phone {
  color: var(--primary);
  text-decoration: none;
}

/* Ramp fee badges */
.ramp-fee-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fee-free {
  background: rgba(39,174,96,0.2);
  color: #27ae60;
}

.fee-paid {
  background: rgba(230,126,34,0.2);
  color: #e67e22;
}

/* Reef list */
.reef-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reef-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-top: 8px;
  background: linear-gradient(90deg, rgba(0,229,160,0.06) 0%, var(--surface) 60%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,229,160,0.12);
}

.reef-area-header h2 {
  font-size: 1rem;
  color: var(--primary);
}

.reef-count {
  font-size: 0.8rem;
  color: var(--text-light);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 20px;
}

.reef-item {
  background: linear-gradient(160deg, #132440 0%, #0f2040 100%);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(77,142,255,0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.reef-item:hover {
  border-color: rgba(0,229,160,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,229,160,0.08);
}

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

.reef-item h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--primary);
}

.reef-item .reef-id {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.reef-item .reef-coords {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: 'Courier New', monospace;
}

.reef-item .reef-depth {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.reef-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* Reef category badges */
.reef-cat-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
}
.cat-reef      { background: rgba(79,142,255,0.15); color: #4f8eff; }
.cat-wreck     { background: rgba(245,166,35,0.15); color: #f5a623; }
.cat-structure { background: rgba(160,160,160,0.12); color: #999; }

/* Navigate button */
.nav-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--primary);
  color: #0a1628;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.nav-btn:hover {
  background: var(--primary-dark);
}

/* Favorite button */
.fav-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}

.fav-btn:hover {
  transform: scale(1.2);
}

.fav-btn.fav-active {
  color: #f39c12;
}

.card-fav {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(10,22,40,0.75);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
}

/* Fish grid */
.fish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.fish-card {
  background: linear-gradient(160deg, #132440 0%, #0f2040 100%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(77,142,255,0.15);
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.fish-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,229,160,0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,229,160,0.1);
}

.fish-card-top {
  position: relative;
}

.fish-card-top::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(transparent, rgba(10,22,40,0.85));
  pointer-events: none;
}

.fish-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: var(--surface-2);
}

.fish-card .fish-info {
  padding: 12px;
}

.fish-card h3 {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}

.fish-card .fish-limits {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.4;
}

.fish-card .fish-limits span {
  display: block;
}

/* Season badges */
.season-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fish-card-top .season-badge {
  position: absolute;
  top: 6px;
  left: 6px;
}

.badge-open {
  background: var(--green);
  color: white;
}

.badge-closed {
  background: var(--red);
  color: white;
}

.badge-limited {
  background: var(--yellow);
  color: white;
}

.badge-catch-release {
  background: var(--blue);
  color: white;
}

/* Fish detail modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  background: linear-gradient(180deg, #132440 0%, #0f2040 100%);
  border-top: 3px solid var(--primary);
  box-shadow: 0 -4px 40px rgba(0,229,160,0.12), 0 -1px 0 rgba(0,201,212,0.3);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--surface-2);
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
  color: var(--text);
}

.modal .scientific-name {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.9rem;
}

.modal-title-row .season-badge {
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 0.75rem;
  padding: 5px 12px;
}

.modal .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(77,142,255,0.12);
  font-size: 0.95rem;
}

.modal .detail-row .label {
  color: var(--text-light);
}

.modal .detail-row .value {
  font-weight: 600;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.modal-actions .share-btn,
.modal-actions .nav-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
}

/* Report issue button — subtle text link on cards */
.report-link {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.report-link:hover { opacity: 1; color: #e67e22; }

/* Report modal form */
.report-modal h2 { font-size: 1.2rem; margin-bottom: 4px; }
.report-subtitle { color: var(--text-light); font-size: 0.88rem; margin-bottom: 20px; }

.report-field { margin-bottom: 16px; }
.report-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

.report-location-name {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-section-tag {
  background: rgba(77,142,255,0.15);
  border: 1px solid rgba(77,142,255,0.3);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
}

.report-select,
.report-input,
.report-textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  box-sizing: border-box;
}
.report-select:focus,
.report-input:focus,
.report-textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.report-select option { background: #0f2040; }
.report-textarea { resize: vertical; min-height: 72px; }

.report-submit-btn {
  display: block;
  width: 100%;
  padding: 13px;
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.report-submit-btn:disabled { opacity: 0.5; cursor: default; }

.report-success { color: var(--primary); font-weight: 600; margin: 8px 0; }
.report-error { color: #e74c3c; font-size: 0.88rem; margin: 8px 0; }

.report-close-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 0.95rem;
  cursor: pointer;
}

.modal .close-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  background: var(--primary);
  color: #0a1628;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

/* Tides */
.tide-station-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tide-station-select label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
}

.tide-station-select select {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(77,142,255,0.2);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.tide-station-select select:focus {
  border-color: var(--primary);
}

.tide-chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 12px;
  margin-bottom: 16px;
}

#tide-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.tide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tide-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
  border-top: 3px solid transparent;
  transition: opacity 0.2s;
}

.tide-card.tide-high {
  border-top-color: var(--primary);
}

.tide-card.tide-low {
  border-top-color: var(--accent);
}

.tide-card.tide-past {
  opacity: 0.45;
}

.tide-card.tide-next {
  opacity: 1;
  box-shadow: 0 2px 12px rgba(0,229,160,0.2);
}

.tide-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.tide-high .tide-card-label {
  color: var(--primary);
}

.tide-low .tide-card-label {
  color: var(--accent);
}

.tide-card-time {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.tide-card-height {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

.tide-card-day {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

.tide-source {
  font-size: 0.7rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 8px;
}

/* Weather */
.wx-current-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 14px;
}

.wx-main {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(77,142,255,0.12);
}

.wx-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 4px;
}

.wx-temp {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.wx-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 2px;
}

.wx-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.wx-detail-item {
  text-align: center;
}

.wx-detail-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.wx-detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Sea Conditions */
.wx-sea-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 14px;
}

.wx-sea-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.wx-sea-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.wx-sea-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.wx-sea-item {
  text-align: center;
}

.wx-sea-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.wx-sea-label {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}

#wave-chart,
#wind-chart {
  width: 100%;
  height: 180px;
  display: block;
}

/* Forecast */
.wx-forecast-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 14px;
}

.wx-forecast-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.wx-forecast-period {
  padding: 10px 0;
  border-bottom: 1px solid rgba(77,142,255,0.1);
}

.wx-forecast-period:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wx-forecast-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}

.wx-forecast-detail {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.wx-forecast-temp {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.wx-forecast-wind {
  font-size: 0.8rem;
  color: var(--text-light);
}

.wx-forecast-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Go/No-Go Offshore Indicator */
.gonogo-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 16px 20px 12px;
  margin-bottom: 14px;
}
.gonogo-card h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 12px;
}
.gonogo-strip {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gonogo-strip::-webkit-scrollbar { display: none; }
.gonogo-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 60px;
  padding: 10px 4px;
  border-radius: 8px;
  background: rgba(77,142,255,0.06);
  border: 1px solid rgba(77,142,255,0.1);
  gap: 4px;
}
.gonogo-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-light);
}
.gonogo-icon {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}
.gonogo-status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}
.gonogo-factor {
  font-size: 0.65rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.2;
}
.gonogo-footer {
  font-size: 0.65rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 10px;
}

/* Saved tab — empty state */
.saved-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.saved-empty-icon {
  font-size: 3rem;
  color: rgba(243,156,18,0.4);
  margin-bottom: 16px;
}

.saved-empty p {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text);
}

.saved-empty-sub {
  font-size: 0.85rem;
  color: var(--text-light) !important;
}

/* Trip Planner Modal */
.trip-modal { max-width: 440px; }
.trip-stops-empty {
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 8px 0;
  font-style: italic;
}
.trip-stop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.trip-stop-controls { display: flex; flex-direction: column; gap: 2px; }
.trip-ctrl-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 0.7rem;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trip-ctrl-btn:disabled { opacity: 0.25; cursor: default; }
.trip-remove-btn { margin-left: auto; border-color: transparent; }
.trip-stop-info { flex: 1; }
.trip-stop-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.trip-stop-meta { font-size: 0.72rem; color: var(--text-light); }
.trip-leg-dist {
  font-size: 0.72rem;
  color: var(--text-light);
  padding: 3px 0 3px 30px;
}
.trip-total-dist {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  padding: 8px 0 4px;
}
.trip-search-result {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.trip-search-result:active { background: rgba(79,142,255,0.08); }
.trip-result-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.trip-result-meta { font-size: 0.72rem; color: var(--text-light); }
.trip-no-results { font-size: 0.8rem; color: var(--text-light); padding: 8px 12px; }

/* Trip cards in Saved tab */
.trip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.trip-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.trip-card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}
.trip-card-actions { display: flex; gap: 6px; align-items: center; }
.trip-edit-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0,229,160,0.08);
  border: 1px solid rgba(0,229,160,0.25);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}
.trip-delete-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}
.trip-stop-list-view {
  margin: 0;
  padding-left: 20px;
}
.trip-stop-list-view li {
  font-size: 0.82rem;
  color: var(--text-light);
  padding: 2px 0;
}

/* Log Catch button (Saved tab + empty state) */
.log-catch-new-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(0,229,160,0.08);
  border: 1px dashed rgba(0,229,160,0.4);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.log-catch-new-btn:active { background: rgba(0,229,160,0.15); }

/* Log Catch button on reef cards */
.log-catch-btn {
  display: inline-block;
  margin-top: 8px;
  margin-right: 8px;
  padding: 6px 12px;
  background: rgba(0,229,160,0.08);
  border: 1px solid rgba(0,229,160,0.25);
  border-radius: 6px;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.log-catch-btn:active { background: rgba(0,229,160,0.18); }

/* Log Catch modal */
.log-catch-modal { max-width: 420px; }
.log-field { margin-bottom: 14px; }
.log-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.log-optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.log-input, .log-select, .log-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  box-sizing: border-box;
}
.log-textarea { resize: vertical; }
.log-toggle { display: flex; gap: 8px; }
.log-toggle-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.log-toggle-btn.active {
  background: rgba(0,229,160,0.12);
  border-color: rgba(0,229,160,0.4);
  color: var(--primary);
}
.log-save-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}
.log-cancel-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Catch log entries in Saved tab */
.catch-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.catch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.catch-species {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.catch-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}
.catch-delete-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
}
.catch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.catch-detail {
  font-size: 0.85rem;
  color: var(--text-light);
}
.catch-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 4px;
}
.catch-kept     { background: rgba(0,229,160,0.12); color: var(--primary); }
.catch-released { background: rgba(79,142,255,0.12); color: #4f8eff; }
.catch-notes {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
  font-style: italic;
}
.catch-conditions {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 3px;
}
.catch-photo {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* Catch log form — new fields */
.log-row {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
}
.log-field-half { flex: 1; margin-bottom: 14px; }
.log-conditions {
  display: flex;
  gap: 6px;
}
.log-select-sm {
  flex: 1;
  padding: 8px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.78rem;
  box-sizing: border-box;
}
.log-photo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.log-photo-btn {
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.log-photo-preview {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.log-photo-clear {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

/* GPX Export button */
.gpx-export-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(0,229,160,0.08);
  border: 1px solid rgba(0,229,160,0.3);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.gpx-export-btn:active {
  background: rgba(0,229,160,0.15);
}
.gpx-export-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-light);
}

/* Section headers inside saved / reef list */
/* GPX Export */
.gpx-export-btn {
  width: 100%;
  padding: 10px;
  margin: 6px 0 2px;
  background: rgba(0, 229, 160, 0.1);
  border: 1px solid rgba(0, 229, 160, 0.3);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.gpx-export-btn:active { background: rgba(0, 229, 160, 0.2); }

.gpx-modal .gpx-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0 0 16px;
}
.gpx-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.gpx-option-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.gpx-option-btn:active { background: rgba(0,229,160,0.1); border-color: var(--accent); }
.gpx-option-btn.disabled { opacity: 0.4; cursor: default; }
.gpx-opt-label { font-weight: 600; }
.gpx-opt-count { font-size: 0.78rem; color: var(--text-light); }
.gpx-tip {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.5;
}

.fish-group-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  padding: 18px 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}

.saved-section-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  padding: 16px 4px 6px;
}

/* Tighter tabs for 7-tab layout */
.tab {
  padding: 12px 6px;
  font-size: 0.85rem;
}

/* ── Quick-win features ── */

/* Find Me button — teal border to distinguish from filters */
.find-me-btn {
  border-color: rgba(0,229,160,0.35);
  color: var(--primary);
}

/* Distance badge on reef cards */
.reef-distance {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(77,142,255,0.12);
  padding: 1px 7px;
  border-radius: 10px;
  margin-top: 2px;
}

/* Distance in map popup */
.popup-dist {
  font-size: 0.8rem;
  color: var(--accent);
}

/* Share button on reef list cards */
.share-btn {
  display: inline-block;
  margin-top: 10px;
  margin-left: 8px;
  padding: 8px 14px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Share button in Leaflet popup */
.popup-share-btn {
  background: none;
  border: 1px solid rgba(77,142,255,0.3);
  color: var(--text-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.popup-share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.popup-log-btn {
  background: none;
  border: 1px solid rgba(0,229,160,0.35);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.popup-log-btn:hover {
  background: rgba(0,229,160,0.1);
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  z-index: 9999;
  white-space: nowrap;
  animation: toastFade 2.5s ease-in-out forwards;
}

@keyframes toastFade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Astro card (sun/moon/solunar) — tides tab */
.astro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.astro-sun-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(77,142,255,0.1);
}

.astro-item {
  font-size: 0.85rem;
  color: var(--text);
}

.astro-item strong {
  color: var(--primary);
}

.astro-label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.water-temp-row {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  padding: 0 0 12px;
  min-height: 28px;
}

.solunar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.solunar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.solunar-quality {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.q-excellent { background: rgba(0,229,160,0.18);  color: var(--primary); }
.q-good      { background: rgba(77,142,255,0.18);  color: var(--accent); }
.q-fair      { background: rgba(243,156,18,0.18);  color: #f39c12; }
.q-slow      { background: rgba(255,255,255,0.06); color: var(--text-light); }

.solunar-periods {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.solunar-period {
  text-align: center;
  padding: 10px 4px;
  border-radius: 8px;
  background: var(--surface-2);
  border-top: 2px solid transparent;
}

.solunar-period.major { border-top-color: var(--primary); }
.solunar-period.minor { border-top-color: var(--accent); }

.sp-type {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.solunar-period.major .sp-type { color: var(--primary); }
.solunar-period.minor .sp-type { color: var(--accent); }

.sp-time {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.sp-label {
  font-size: 0.68rem;
  color: var(--text-light);
}

@media (max-width: 480px) {
  #reef-map {
    height: 350px;
  }

  main {
    padding: 12px;
  }

  .fish-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .depth-filters {
    gap: 4px;
  }

  .depth-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  #tide-chart {
    height: 180px;
  }

  .tide-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .wx-details {
    grid-template-columns: repeat(2, 1fr);
  }

  .wx-sea-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  #wave-chart {
    height: 160px;
  }

  .solunar-periods {
    grid-template-columns: repeat(2, 1fr);
  }

  .astro-sun-row {
    gap: 6px;
  }

  .astro-item {
    font-size: 0.8rem;
  }
}

/* App footer */
.app-footer {
  text-align: center;
  padding: 20px 16px 32px;
  font-size: 0.7rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: 24px;
  line-height: 1.8;
}
.app-footer a {
  color: var(--text-light);
  text-decoration: none;
}
.app-footer a:hover { color: var(--primary); }
.footer-attr { display: inline; }

/* FWC disclaimer on Fish tab */
.fwc-disclaimer {
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}
.fwc-disclaimer strong { color: #f5a623; }
.fwc-disclaimer a { color: #f5a623; }

/* Water body map labels */
.water-body-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.water-body-label span {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(130, 190, 255, 0.75);
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.8);
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
  text-transform: uppercase;
}

/* USGS gauge reading on ramp cards */
.gauge-reading {
  font-size: 0.72rem;
  color: #4f8eff;
  font-weight: 600;
  margin-left: 4px;
}

/* ── Fish ID Button (Fish tab) ── */
.fish-id-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(0,229,160,0.15), rgba(79,142,255,0.15));
  border: 1px solid rgba(0,229,160,0.35);
  border-radius: var(--radius);
  color: #00e5a0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.fish-id-tab-btn:active { opacity: 0.8; }

/* ── Fish ID Modal ── */
.fish-id-modal { max-width: 420px; }
.fish-id-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.5;
}
.fish-id-preview-wrap {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface-2);
  max-height: 240px;
}
.fish-id-preview-wrap img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.fish-id-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #0d1117;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.fish-id-upload-btn:active { opacity: 0.85; }

/* Loading spinner */
.fish-id-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  color: var(--text-light);
  font-size: 0.9rem;
}
.fish-id-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,229,160,0.2);
  border-top-color: #00e5a0;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fish-id-error {
  color: #e74c3c;
  font-size: 0.85rem;
  padding: 10px 0;
}

/* Result card */
.fish-id-result-card {
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 6px;
}
.fish-id-species {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.fish-id-scientific {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 10px;
}
.fish-id-conf-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.fish-id-conf-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}
.fish-id-conf-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.fish-id-conf-pct {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
}
.fish-id-conf-label {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.fish-id-features {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
  margin-top: 0;
}

/* Regulations block within ID result */
.fish-id-regs {
  background: rgba(79,142,255,0.08);
  border: 1px solid rgba(79,142,255,0.18);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.fish-id-regs-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4f8eff;
  margin-bottom: 6px;
}
.fish-id-reg-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 3px 0;
  color: var(--text);
}
.fish-id-reg-row span:first-child { color: var(--text-light); }

/* Log catch button inside ID result */
.fish-id-log-btn {
  width: 100%;
  padding: 11px;
  background: rgba(0,229,160,0.12);
  border: 1px solid rgba(0,229,160,0.3);
  border-radius: 8px;
  color: #00e5a0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.fish-id-log-btn:active { opacity: 0.8; }
