:root {
  --bg: #07131a;
  --bg-deep: #041016;
  --card: rgba(8, 20, 28, 0.9);
  --card-strong: rgba(10, 24, 33, 0.96);
  --line: rgba(175, 208, 200, 0.14);
  --line-strong: rgba(175, 208, 200, 0.28);
  --text: #eef8f6;
  --muted: #9bb4b0;
  --accent: #8ce7d0;
  --accent-strong: #6ee2ff;
  --accent-warm: #f7cf6d;
  --danger: #f1907b;
  --shadow: rgba(0, 0, 0, 0.4);
  --radius: 18px;
  --radius-lg: 22px;
  --panel-width: min(430px, calc(100vw - 24px));
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 10%, rgba(110, 226, 255, 0.14), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(140, 231, 208, 0.12), transparent 20%),
    linear-gradient(160deg, var(--bg-deep), var(--bg) 56%, #0b1c23);
  color: var(--text);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

body {
  overscroll-behavior: none;
  min-height: 100dvh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

#map {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(110, 226, 255, 0.16), transparent 24%),
    radial-gradient(circle at 84% 26%, rgba(140, 231, 208, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(5, 16, 22, 0.96), rgba(8, 20, 28, 0.98));
}

#hamburger-btn,
.ctrl-btn,
.layer-toggle,
.ghost-button,
.ui-btn,
.base-layer-btn,
.panel-footer-btn,
.popup-close-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#hamburger-btn:hover,
.ctrl-btn:hover,
.layer-toggle:hover,
.ghost-button:hover,
.ui-btn:hover,
.base-layer-btn:hover,
.panel-footer-btn:hover,
.popup-close-btn:hover,
.chip:hover,
.search-item:hover,
.spot-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

#hamburger-btn:active,
.ctrl-btn:active,
.layer-toggle:active,
.ghost-button:active,
.ui-btn:active,
.base-layer-btn:active,
.panel-footer-btn:active,
.popup-close-btn:active,
.chip:active,
.search-item:active,
.spot-card:active {
  transform: translateY(1px);
}

#hamburger-btn,
.top-right-controls,
#map-hud,
.map-status,
#left-controls {
  z-index: 20;
}

.fish-toast {
  z-index: 200;
}

/* Drawer + popups above the dim-overlay (z-index: 90) */
#left-panel,
#species-panel,
#bottom-sheet,
#settings-panel,
#search-panel {
  z-index: 100;
}

#hamburger-btn,
.ctrl-btn {
  width: 46px;
  height: 46px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 32px var(--shadow);
}

#map-hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  width: min(720px, calc(100vw - 190px));
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  display: grid;
  gap: 10px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(8, 20, 28, 0.96), rgba(5, 16, 22, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.map-hud-meta,
.map-hud-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

#map-hud h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: -0.04em;
}

.map-hud-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

#hamburger-btn {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
}

#hamburger-btn svg,
.ctrl-btn svg,
.layer-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-right-controls {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  gap: 10px;
}

.ctrl-btn[aria-expanded="true"],
.ctrl-btn[aria-pressed="true"],
.ctrl-btn.active,
.layer-toggle.active,
.base-layer-btn.is-active,
.ghost-button--primary,
.ui-btn-secondary {
  border-color: rgba(140, 231, 208, 0.34);
  background: linear-gradient(135deg, rgba(140, 231, 208, 0.16), rgba(110, 226, 255, 0.12));
}

#panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 90;
}

#panel-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

#left-panel,
#species-panel,
#bottom-sheet,
#settings-panel,
#search-panel,
.map-status,
.stat-card,
.spot-card,
.search-item {
  background: linear-gradient(180deg, rgba(11, 25, 33, 0.96), rgba(7, 19, 26, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

#left-panel {
  position: fixed;
  top: 70px;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: var(--panel-width);
  padding: 18px;
  border-radius: var(--radius-lg);
  overflow: auto;
  transform: translateX(calc(-100% - 24px));
  transition: transform 220ms ease, opacity 180ms ease;
  scrollbar-width: thin;
}

#left-panel.open {
  transform: translateX(0);
}

.panel-header,
.section-head,
.sheet-header,
.settings-header,
.search-header,
.species-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h1,
#bottom-sheet h2,
#left-panel h2,
#search-panel h2,
#settings-panel h2,
.stat-value,
.spot-card h3,
.search-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.panel-header h1 {
  font-size: 1.42rem;
}

.subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-section {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-section:first-of-type {
  margin-top: 18px;
}

.panel-section--callout {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(140, 231, 208, 0.18);
  background: linear-gradient(180deg, rgba(140, 231, 208, 0.07), rgba(255, 255, 255, 0.02));
}

.panel-section-title {
  color: var(--accent-warm);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.badge,
.section-badge,
.legend-pill,
.spot-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge {
  color: #042128;
  background: linear-gradient(135deg, var(--accent), #b6fff0);
}

.badge--muted,
.section-badge,
.legend-pill {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.legend-pill--clearable {
  gap: 6px;
  padding-inline: 10px 8px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.legend-pill--clearable:hover,
.legend-pill--clearable:focus-visible {
  border-color: rgba(241, 144, 123, 0.4);
  background: rgba(241, 144, 123, 0.12);
}

.legend-pill__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(241, 144, 123, 0.22);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 800;
}

.ui-btn,
.panel-footer-btn,
.ghost-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
}

.panel-footer-btn {
  width: 100%;
  margin-top: 18px;
}

.base-layer-group,
.overlay-control-group,
.chip-row,
.sheet-chip-row,
.spot-tags,
.actions,
.settings-actions,
.species-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-stack {
  display: grid;
  gap: 12px;
}

.filter-block {
  display: grid;
  gap: 8px;
}

.filter-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.base-layer-btn,
.chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
}

.overlay-control-group {
  display: grid;
  gap: 8px;
}

.overlay-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: left;
}

.overlay-btn.is-active {
  border-color: rgba(140, 231, 208, 0.34);
  background: rgba(140, 231, 208, 0.1);
}

.overlay-btn--advisory.is-active {
  border-color: rgba(247, 207, 109, 0.38);
  background: rgba(247, 207, 109, 0.12);
}

.overlay-label,
.overlay-description {
  display: block;
}

.overlay-label {
  font-weight: 800;
}

.overlay-description {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.chip {
  font-size: 0.88rem;
}

.species-legend:empty::before {
  content: "Ei aktiivista suodatinta";
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-grid,
.detail-grid,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.detail-item {
  padding: 14px;
  border-radius: 16px;
}

.stat-value {
  display: block;
  margin-bottom: 6px;
  font-size: 1.02rem;
}

.stat-label,
.stat-source,
.panel-copy,
.bullet-list,
.spot-copy,
.search-detail {
  color: var(--muted);
}

.stat-label,
.panel-copy,
.spot-copy,
.search-detail,
.bullet-list li,
.detail-grid dd,
.map-status p {
  line-height: 1.5;
}

.stat-source {
  display: block;
  margin-top: 8px;
  font-size: 0.74rem;
}

.source-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.source-item {
  display: grid;
  gap: 4px;
}

.source-link {
  color: var(--text);
  text-decoration-color: rgba(140, 231, 208, 0.5);
  text-underline-offset: 0.15em;
}

.source-link:hover,
.source-link:focus-visible {
  color: var(--accent);
}

.source-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.spot-list,
#search-results {
  display: grid;
  gap: 10px;
}

.spot-card,
.search-item {
  padding: 12px;
  border-radius: 16px;
}

.spot-card.is-active,
.search-item.is-active {
  border-color: rgba(140, 231, 208, 0.34);
  background: rgba(140, 231, 208, 0.1);
}

.spot-card h3,
.search-name {
  font-size: 1rem;
}

.spot-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.spot-copy {
  margin: 0;
  font-size: 0.93rem;
}

.spot-callout {
  margin: 0;
  color: var(--accent-warm);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spot-tag {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.spot-tag--accent {
  border-color: rgba(110, 226, 255, 0.18);
  background: rgba(110, 226, 255, 0.12);
}

.spot-tag--warn {
  border-color: rgba(247, 207, 109, 0.18);
  background: rgba(247, 207, 109, 0.12);
}

.spot-tag--danger {
  border-color: rgba(241, 144, 123, 0.2);
  background: rgba(241, 144, 123, 0.12);
}

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

.spot-tag--distance {
  border-color: rgba(140, 231, 208, 0.18);
  background: rgba(140, 231, 208, 0.1);
}

.spot-tag--demo {
  border-color: rgba(247, 207, 109, 0.24);
  background: rgba(247, 207, 109, 0.14);
  color: var(--accent-warm);
}

.spot-tag--local {
  border-color: rgba(140, 231, 208, 0.26);
  background: rgba(140, 231, 208, 0.14);
  color: var(--accent);
}

.spot-editor {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field--wide {
  grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select,
.search-bar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.search-bar input {
  min-height: 52px;
  padding-inline: 16px;
  font-size: 1rem;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.search-bar input::placeholder {
  color: rgba(155, 180, 176, 0.75);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-bar input:focus {
  outline: 2px solid rgba(110, 226, 255, 0.28);
  outline-offset: 2px;
}

#left-controls {
  position: fixed;
  top: 76px;
  left: max(12px, env(safe-area-inset-left));
  display: grid;
  gap: 10px;
}

.layer-toggle {
  width: 52px;
  min-height: 52px;
  padding: 0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 14px 32px var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.layer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.layer-tip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 19, 26, 0.92);
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.layer-toggle:hover .layer-tip,
.layer-toggle:focus-visible .layer-tip {
  opacity: 1;
}

/* Shared popup base class */
.fish-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  border-radius: 20px;
  padding: 24px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.fish-popup.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* Popup close button */
.popup-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}

.popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.popup-footer {
  display: flex;
  justify-content: center;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

#species-panel {
  display: grid;
  gap: 14px;
}

#search-panel {
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 14px;
}

#search-hint {
  color: var(--muted);
  font-size: 0.96rem;
}

.search-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.search-main {
  display: grid;
  gap: 4px;
}

.search-extra {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.search-chevron {
  color: var(--accent-strong);
  font-size: 1.1rem;
  line-height: 1;
}

/* Settings panel uses .fish-popup base */

/* Bottom sheet uses .fish-popup base */
#bottom-sheet {
  display: grid;
  gap: 12px;
}

/* drag-handle removed — popups use close buttons */

.sheet-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-empty {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.detail-notice {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(247, 207, 109, 0.2);
  background: rgba(247, 207, 109, 0.08);
  color: var(--text);
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-grid {
  margin: 0;
}

.detail-item {
  border: 1px solid var(--line);
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-grid dd {
  margin: 4px 0 0;
  font-size: 0.96rem;
}

.map-status {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
  border-radius: var(--radius-lg);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.map-status strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.06rem;
}

.fish-toast {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top)) + 56px);
  left: 50%;
  transform: translate(-50%, -12px);
  min-width: 200px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(7, 19, 26, 0.94);
  border: 1px solid rgba(140, 231, 208, 0.24);
  box-shadow: 0 14px 30px var(--shadow);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.fish-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.marker {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

/* GPS follow-mode marker (dot + heading cone) */
.fish-gps-marker {
  position: relative;
  width: 72px;
  height: 96px;
  pointer-events: none;
  transform: translateY(0);
}

.fish-gps-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #6ee2ff;
  border: 3px solid #eef8f6;
  box-shadow: 0 0 0 4px rgba(110, 226, 255, 0.32), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.fish-gps-cone {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 52px;
  transform: translate(-50%, -100%);
  background: linear-gradient(180deg, rgba(110, 226, 255, 0.65), rgba(110, 226, 255, 0.05));
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 2px;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.fish-gps-cone.is-hidden {
  display: none;
}

#gps-btn.is-track {
  border-color: rgba(110, 226, 255, 0.45);
  background: linear-gradient(135deg, rgba(110, 226, 255, 0.18), rgba(140, 231, 208, 0.12));
}

#gps-btn.is-follow {
  border-color: rgba(110, 226, 255, 0.7);
  background: linear-gradient(135deg, rgba(110, 226, 255, 0.32), rgba(140, 231, 208, 0.16));
  color: #062129;
}

#gps-btn.is-heading {
  border-color: rgba(247, 207, 109, 0.6);
  background: linear-gradient(135deg, rgba(247, 207, 109, 0.26), rgba(110, 226, 255, 0.16));
  color: #062129;
}

.trip-indicator {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top)) + 60px + var(--hud-height, 0px));
  right: max(12px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(241, 144, 123, 0.12);
  border: 1px solid rgba(241, 144, 123, 0.4);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  z-index: 25;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.trip-indicator__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(241, 144, 123, 0.25);
  animation: trip-pulse 1.4s ease-in-out infinite;
}

.trip-indicator__stats {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  opacity: 0.88;
}

.trip-indicator__stop {
  border: 1px solid rgba(241, 144, 123, 0.6);
  background: rgba(241, 144, 123, 0.18);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.trip-indicator__stop:hover {
  background: rgba(241, 144, 123, 0.3);
}

@keyframes trip-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
}

#trip-toggle-btn.active {
  border-color: rgba(241, 144, 123, 0.6);
  background: linear-gradient(135deg, rgba(241, 144, 123, 0.22), rgba(247, 207, 109, 0.14));
  color: var(--text);
}

.fish-gps-recenter {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  width: auto;
  height: auto;
  padding: 10px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 14px 30px var(--shadow);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.marker--active {
  transform: scale(1.18);
  box-shadow: 0 0 0 8px rgba(110, 226, 255, 0.16);
}

.marker--river {
  background: var(--danger);
}

.marker--lake {
  background: var(--accent-warm);
}

.marker--coast {
  background: var(--accent-strong);
}

.marker--spot {
  background: var(--accent);
}

.marker--saved {
  background: var(--accent);
  border-color: #083237;
  box-shadow: 0 0 0 4px rgba(140, 231, 208, 0.2);
}

#settings-panel .detail-item {
  margin-top: 10px;
}

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

.is-hidden {
  display: none !important;
}

/* In-app modal (showConfirm / showAlert) */
.ui-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ui-modal-card {
  width: min(420px, 100%);
  padding: 22px;
  display: grid;
  gap: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 25, 33, 0.98), rgba(7, 19, 26, 0.96));
  box-shadow: 0 24px 60px var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.ui-modal-title {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
  font-size: 1.18rem;
  font-weight: 700;
}

.ui-modal-copy {
  color: var(--text);
  line-height: 1.5;
  font-size: 0.96rem;
}

.ui-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ghost-button--danger {
  border-color: rgba(241, 144, 123, 0.4);
  background: rgba(241, 144, 123, 0.14);
  color: var(--danger);
}

.ghost-button--danger:hover {
  border-color: rgba(241, 144, 123, 0.7);
  background: rgba(241, 144, 123, 0.22);
}

/* MapLibre control overrides — dark theme */
.maplibregl-ctrl-scale {
  background: rgba(8, 21, 31, 0.7) !important;
  color: var(--text) !important;
  border-color: rgba(166, 195, 204, 0.3) !important;
  font-size: 11px !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 4px;
}

.maplibregl-ctrl-group {
  background: rgba(8, 21, 31, 0.85) !important;
  border: 1px solid rgba(166, 195, 204, 0.14) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 12px !important;
  box-shadow: 0 8px 24px var(--shadow) !important;
}

.maplibregl-ctrl-group button {
  color: var(--text);
  width: 36px !important;
  height: 36px !important;
}

.maplibregl-ctrl-group button + button {
  border-top-color: rgba(166, 195, 204, 0.14) !important;
}

.maplibregl-ctrl-group button:hover {
  background: rgba(140, 231, 208, 0.12) !important;
}

.maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.2);
}

.maplibregl-ctrl-compass .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.2);
}

/* Push MapLibre top-right controls below the custom top-right buttons */
.maplibregl-ctrl-top-right {
  top: 70px;
}

.solar-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(140, 231, 208, 0.06);
}

.weather-block {
  display: grid;
  gap: 8px;
}

.weather-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.weather-verdict {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid var(--line);
}

.weather-verdict--accent {
  color: var(--accent);
  background: rgba(140, 231, 208, 0.14);
  border-color: rgba(140, 231, 208, 0.4);
}

.weather-verdict--warn {
  color: var(--accent-warm);
  background: rgba(247, 207, 109, 0.14);
  border-color: rgba(247, 207, 109, 0.4);
}

.weather-verdict--danger {
  color: var(--danger);
  background: rgba(241, 144, 123, 0.14);
  border-color: rgba(241, 144, 123, 0.4);
}

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

.weather-rationale {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.weather-loading,
.weather-error {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 0;
}

.weather-footnote {
  color: var(--muted);
  font-size: 0.72rem;
}

.solar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.solar-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  min-width: 74px;
}

.solar-chip__label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.solar-chip__value {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.catch-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.catch-log {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.catch-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.catch-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.catch-item__date {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.catch-item__summary {
  grid-column: 1 / 2;
  font-weight: 700;
}

.catch-item__meta {
  grid-column: 2 / 3;
  color: var(--muted);
  font-size: 0.86rem;
}

.catch-item__remove {
  grid-column: 3 / 4;
  align-self: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.catch-item__remove:hover {
  border-color: rgba(241, 144, 123, 0.4);
  background: rgba(241, 144, 123, 0.12);
  color: var(--text);
}

/* City search result pin icon */
.search-item--city .search-name::before {
  content: "\2316"; /* ⌖ position indicator */
  margin-right: 6px;
  color: var(--accent-strong);
  font-size: 1.1em;
}

/* City search tag */
.spot-tag--city {
  border-color: rgba(110, 226, 255, 0.3);
  background: rgba(110, 226, 255, 0.12);
  color: var(--accent-strong);
}

/* Search section label (e.g., "Kaupungit") */
.search-section-label {
  padding: 8px 0 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  #map-hud {
    width: min(640px, calc(100vw - 170px));
  }
}

@media (max-width: 960px) {
  #map-hud {
    width: calc(100vw - 16px);
    top: 66px;
  }

  #left-panel {
    width: min(420px, calc(100vw - 16px));
  }

  .detail-grid,
  .field-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #hamburger-btn {
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
  }

  .top-right-controls {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    gap: 8px;
  }

  #map-hud {
    top: 62px;
    left: 8px;
    width: calc(100vw - 16px);
    transform: none;
  }

  .map-hud-meta,
  .map-hud-body {
    flex-direction: column;
  }

  #left-panel {
    top: calc(60px + var(--hud-height, 0px) + 12px);
    left: 8px;
    right: 8px;
    width: auto;
  }

  #left-controls {
    top: calc(60px + var(--hud-height, 0px) + 18px);
    left: 8px;
    gap: 8px;
  }

  .layer-toggle {
    width: 46px;
    min-height: 46px;
    border-radius: 16px;
  }

  .layer-tip {
    display: none;
  }

  .panel-header,
  .section-head,
  .sheet-header,
  .settings-header,
  .search-header,
  .species-panel-header {
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fish-popup {
    transition: none;
  }
  #panel-overlay {
    transition: none;
  }
}
