:root {
  color-scheme: dark;
  --ink: #f7f8ff;
  --muted: #858ca8;
  --panel: rgba(13, 17, 38, 0.94);
  --line: rgba(255, 255, 255, 0.1);
  --sea: #ff741f;
  --harbor: #6874ff;
  --slipway: #f26b1d;
  --shell: #080b1d;
  --shell-2: #11152d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--shell);
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.map-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--shell);
}

#map {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 54px;
  bottom: 52px;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* Critical Leaflet layout rules, kept locally so the map does not depend on CDN CSS. */
.leaflet-container {
  overflow: hidden;
  background: #b8d5df;
  outline: 0;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  box-sizing: content-box;
  max-width: none !important;
  width: 256px;
  height: 256px;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-popup {
  position: absolute;
  text-align: center;
  margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
  background: #11152d;
  border-radius: 8px;
  color: #f7f8ff;
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 13px 18px;
  min-width: 280px;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  margin-left: -20px;
  width: 40px;
  height: 20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  padding: 1px;
  margin: -10px auto 0;
  transform: rotate(45deg);
  background: #11152d;
}

.topbar {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 16px;
  background: var(--shell);
  pointer-events: none;
}

.topbar > div {
  min-width: 0;
  margin-right: auto;
}

.topbar h1,
.detail-header h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  color: #fff;
  text-shadow: none;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--sea);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: var(--slipway);
  text-shadow: none;
}

.app-guide-button,
.notification-bell {
  position: relative;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #10192a;
  color: #dce3f3;
  cursor: pointer;
  pointer-events: auto;
}

.app-guide-button {
  display: grid;
}

.notification-bell {
  display: none;
}

.notification-bell.open {
  display: grid;
}

.app-guide-button svg,
.notification-bell svg {
  width: 19px;
  height: 19px;
}

.notification-bell span,
#profileNotificationBadge {
  min-width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--slipway);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.notification-bell span {
  position: absolute;
  top: -5px;
  right: -5px;
}

.notification-bell span.open,
#profileNotificationBadge.open {
  display: grid;
}

.notification-drawer {
  position: fixed;
  z-index: 35;
  top: 54px;
  right: 10px;
  width: min(370px, calc(100vw - 20px));
  max-height: calc(100dvh - 126px);
  display: none;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1126;
  box-shadow: var(--shadow);
}

.notification-drawer.open {
  display: block;
}

.notification-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.notification-drawer-header h2 {
  margin: 0;
  font-size: 18px;
}

.notification-drawer-header button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #171b36;
  color: #fff;
  cursor: pointer;
}

.map-follow-toolbar {
  position: absolute;
  z-index: 35;
  top: 10px;
  right: 70px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-legend {
  display: grid;
  gap: 5px;
  min-width: 72px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f3f7ff;
  box-shadow: none;
  font-size: 11px;
}

.followed-markers-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: none;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(17, 21, 45, 0.92);
  color: #dce5f7;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.followed-markers-button.open {
  display: grid;
}

.followed-markers-button.active {
  border-color: rgba(255, 116, 31, 0.7);
  color: var(--sea);
}

.followed-markers-button svg {
  width: 18px;
  height: 18px;
}

.followed-markers-button > span {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--shell);
  border-radius: 999px;
  background: var(--sea);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.followed-markers-button > span.open {
  display: grid;
}

.followed-markers-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(330px, calc(100vw - 20px));
  max-height: min(430px, calc(100dvh - 128px));
  display: none;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1126;
  box-shadow: var(--shadow);
}

.followed-markers-menu.open {
  display: block;
}

.followed-markers-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.followed-markers-menu-header h2 {
  margin: 0;
  font-size: 17px;
}

.followed-markers-menu-header button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #171b36;
  color: #fff;
  cursor: pointer;
}

.followed-markers-menu-header svg {
  width: 16px;
  height: 16px;
}

.followed-markers-menu-state {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 11px;
}

.followed-markers-menu-state.error {
  color: #ff8d83;
}

.followed-markers-menu-list {
  display: grid;
  gap: 6px;
}

.followed-menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.followed-menu-location,
.followed-menu-unfollow {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.followed-menu-location {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 5px 7px;
  text-align: left;
}

.followed-menu-location strong,
.followed-menu-location span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followed-menu-location strong {
  font-size: 12px;
}

.followed-menu-location span {
  color: var(--muted);
  font-size: 10px;
}

.followed-menu-location:hover strong {
  color: var(--sea);
}

.followed-menu-unfollow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 5px;
  color: #ff8d83;
}

.followed-menu-unfollow:hover {
  background: rgba(255, 83, 71, 0.12);
}

.followed-menu-unfollow svg {
  width: 16px;
  height: 16px;
}

.map-legend div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.marina-dot {
  background: var(--harbor);
}

.slipway-dot {
  background: var(--slipway);
}

.control-panel {
  position: absolute;
  z-index: 6;
  top: var(--map-panel-top, 66px);
  left: var(--map-panel-left, 78px);
  width: var(--map-panel-width, min(315px, calc(100vw - 84px)));
  height: var(--map-panel-height, auto);
  max-height: calc(100dvh - 112px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.control-panel-collapse,
.control-panel-drag-handle,
.control-panel-launcher,
.map-zoom-controls {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10192a;
  color: #dce3f3;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.control-panel-collapse {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
}

.control-panel-toolbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: -4px;
}

.control-panel-drag-handle {
  width: 38px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: grab;
  touch-action: none;
}

.control-panel-drag-handle svg {
  width: 20px;
  height: 20px;
}

.control-panel.dragging .control-panel-drag-handle {
  cursor: grabbing;
}

.control-panel-resize-handle {
  position: sticky;
  z-index: 4;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  justify-self: end;
  margin-top: -20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: #18243a;
  color: #f7f8ff;
  cursor: nwse-resize;
  touch-action: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.control-panel-resize-handle svg {
  width: 13px;
  height: 13px;
}

.control-panel-resize-handle:hover,
.control-panel-resize-handle:focus-visible,
.control-panel-drag-handle:hover,
.control-panel-drag-handle:focus-visible {
  border-color: var(--slipway);
  color: var(--slipway);
}

.control-panel-launcher {
  width: var(--map-control-size);
  height: var(--map-control-size);
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.layer-control-wrap {
  position: relative;
  width: var(--map-control-size);
  height: var(--map-control-size);
}

.map-control-rail {
  --map-control-size: 46px;
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 18px;
  display: grid;
  justify-items: center;
  gap: 8px;
  transform: translateY(-50%);
}

.map-control-rail.dragging .control-panel-launcher {
  cursor: grabbing;
}

.control-resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  z-index: 2;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: #18243a;
  color: #f7f8ff;
  cursor: nwse-resize;
  touch-action: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.control-resize-handle svg {
  width: 11px;
  height: 11px;
}

.control-resize-handle:hover,
.control-resize-handle:focus-visible {
  border-color: var(--slipway);
  color: var(--slipway);
}

.map-zoom-controls {
  width: 30px;
  overflow: hidden;
  border-radius: 4px;
}

.map-zoom-controls button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: rgba(9, 12, 28, 0.96);
  color: #f7f8ff;
  cursor: pointer;
}

.map-zoom-controls button + button {
  border-top: 1px solid var(--line);
}

.map-zoom-controls svg {
  width: 18px;
  height: 18px;
}

.map-zoom-controls button:hover {
  color: var(--slipway);
}

.control-panel-collapse svg {
  width: 18px;
  height: 18px;
}

.control-panel-launcher svg {
  width: clamp(20px, calc(var(--map-control-size) * 0.52), 34px);
  height: clamp(20px, calc(var(--map-control-size) * 0.52), 34px);
}

.control-panel-collapse:hover,
.control-panel-launcher:hover {
  border-color: rgba(255, 116, 31, 0.7);
  color: var(--slipway);
}

.map-stage.control-panel-collapsed .control-panel {
  display: none;
}

.map-crosshair {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  display: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.map-crosshair::before,
.map-crosshair::after {
  content: "";
  position: absolute;
  background: #101820;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.map-crosshair::before {
  left: 50%;
  top: 0;
  width: 2px;
  height: 42px;
  transform: translateX(-50%);
}

.map-crosshair::after {
  left: 0;
  top: 50%;
  width: 42px;
  height: 2px;
  transform: translateY(-50%);
}

.map-stage.targeting .map-crosshair,
.map-stage.moving-place .map-crosshair {
  display: block;
}

.map-stage.targeting #map,
.map-stage.moving-place #map {
  cursor: crosshair;
}

.field {
  display: grid;
  gap: 6px;
  color: #aab0cb;
  font-size: 12px;
  font-weight: 700;
}

.field select,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: #f7f8ff;
  background: #171b36;
  outline-color: var(--sea);
}

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

.overlay-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  font-size: 12px;
  font-weight: 800;
}

.overlay-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--sea);
}

.overlay-note {
  margin: -6px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.conditional-field {
  display: none;
}

.conditional-field.open {
  display: grid;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.segmented button,
.chat-form button,
.upload-button,
.target-button,
.form-actions button,
.detail-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  padding: 10px 11px;
  cursor: pointer;
}

.segmented button.active,
.chat-form button,
.target-button.active,
.form-actions button:first-child,
.detail-actions button.primary {
  color: #fff;
  background: var(--slipway);
  border-color: var(--slipway);
}

.target-button {
  width: 100%;
  font-weight: 800;
  background: var(--slipway);
  border-color: var(--slipway);
  color: #fff;
}

.mobile-target-button {
  display: none;
}

.add-panel,
.move-panel {
  display: none;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.add-panel.open,
.move-panel.open {
  display: grid;
}

.target-coords {
  border: 1px solid rgba(255, 116, 31, 0.28);
  border-radius: 6px;
  background: rgba(255, 116, 31, 0.1);
  color: #ffb17e;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-strip {
  position: absolute;
  z-index: 5;
  left: 10px;
  right: 10px;
  bottom: 52px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  max-height: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-width: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.result-card {
  flex: 0 0 230px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.result-card strong {
  display: block;
  margin-bottom: 4px;
}

.result-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.list-view,
.weather-view,
.ai-view,
.profile-view {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 54px;
  bottom: 52px;
  display: none;
  overflow: auto;
  padding: 0 10px 18px;
  background: var(--shell);
}

.list-view.open,
.weather-view.open,
.ai-view.open,
.profile-view.open {
  display: block;
}

.map-stage.list-mode #map,
.map-stage.weather-mode #map,
.map-stage.ai-mode #map,
.map-stage.profile-mode #map,
.map-stage.list-mode .map-legend,
.map-stage.weather-mode .map-legend,
.map-stage.ai-mode .map-legend,
.map-stage.profile-mode .map-legend,
.map-stage.list-mode .map-follow-toolbar,
.map-stage.weather-mode .map-follow-toolbar,
.map-stage.ai-mode .map-follow-toolbar,
.map-stage.profile-mode .map-follow-toolbar,
.map-stage.list-mode .map-control-rail,
.map-stage.weather-mode .map-control-rail,
.map-stage.ai-mode .map-control-rail,
.map-stage.profile-mode .map-control-rail,
.map-stage.list-mode .mobile-target-button,
.map-stage.weather-mode .mobile-target-button,
.map-stage.ai-mode .mobile-target-button,
.map-stage.profile-mode .mobile-target-button,
.map-stage.list-mode .control-panel,
.map-stage.weather-mode .control-panel,
.map-stage.ai-mode .control-panel,
.map-stage.profile-mode .control-panel,
.map-stage.list-mode .result-strip,
.map-stage.weather-mode .result-strip,
.map-stage.ai-mode .result-strip,
.map-stage.profile-mode .result-strip,
.map-stage.weather-mode .list-view,
.map-stage.ai-mode .list-view,
.map-stage.ai-mode .weather-view,
.map-stage.profile-mode .list-view,
.map-stage.profile-mode .weather-view,
.map-stage.list-mode .map-crosshair {
  display: none;
}

.map-stage.weather-mode .map-crosshair,
.map-stage.ai-mode .map-crosshair,
.map-stage.profile-mode .map-crosshair {
  display: none;
}

.list-search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -10px;
  padding: 0 14px;
  background: #141832;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #747b9a;
}

.list-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f7f8ff;
  font-size: 13px;
}

.list-search input::placeholder {
  color: #747b9a;
}

.list-filters {
  display: flex;
  gap: 8px;
  padding: 10px 2px 12px;
}

.list-filters button {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: #171b36;
  color: #8990b2;
  padding: 7px 15px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.list-filters button.active {
  color: #fff;
  background: var(--slipway);
  border-color: var(--slipway);
}

.list-count {
  margin: -2px 2px 10px;
  color: #747b9a;
  font-size: 12px;
  font-weight: 800;
}

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

.location-row {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #151936;
  color: #f7f8ff;
  padding: 11px 14px 11px 11px;
  text-align: left;
  cursor: pointer;
}

.location-row:hover {
  border-color: rgba(255, 116, 31, 0.36);
  background: #191e3e;
}

.location-row-highlight {
  border-color: rgba(255, 93, 31, 0.88);
  box-shadow: 0 0 0 2px rgba(255, 93, 31, 0.16);
}

.location-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.location-icon.marina {
  background: var(--harbor);
}

.location-icon.slipway {
  background: var(--slipway);
}

.location-main {
  min-width: 0;
}

.location-main strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-main .area {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #aab0cb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 6px;
  color: #747b9a;
  font-size: 10px;
}

.location-meta em {
  color: var(--slipway);
  font-style: normal;
  font-weight: 900;
}

.location-meta .free {
  color: #43d17a;
  font-weight: 900;
}

.location-meta .water {
  color: #7f8cff;
  font-weight: 900;
}

.location-arrow {
  color: #747b9a;
  font-size: 24px;
}

.empty-list {
  padding: 34px 10px;
  color: #858ca8;
  text-align: center;
  font-size: 13px;
}

.weather-view {
  padding: 12px 10px 92px;
}

.weather-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
}

.weather-tabs button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: #171b36;
  color: #9299b8;
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.weather-tabs button.active {
  color: #fff;
  background: var(--slipway);
  border-color: var(--slipway);
}

.weather-hero {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #151936;
  padding: 20px 28px 18px 18px;
}

.weather-hero strong {
  display: block;
  color: #fff;
  font-size: clamp(42px, 7vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

.weather-hero span,
.weather-hero small {
  display: block;
  margin-top: 7px;
  color: #aab0cb;
  font-size: 13px;
}

.weather-hero small {
  margin-top: 4px;
  color: #747b9a;
}

.weather-sun {
  color: #f6b300;
  font-size: 54px;
  line-height: 1;
}

.weather-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.weather-hero-action {
  min-width: 82px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  background: #0d1227;
  color: #d9deef;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease, background 180ms ease;
}

.weather-hero-action:hover,
.weather-hero-action:focus-visible {
  border-color: rgba(255, 93, 31, 0.82);
  background: rgba(255, 93, 31, 0.12);
  color: #fff;
  transform: translateY(-1px);
  outline: none;
}

.weather-hero-action svg {
  width: 16px;
  height: 16px;
  color: var(--slipway);
  stroke-width: 2.7;
}

.weather-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.weather-tile {
  min-height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #151936;
  padding: 13px 15px;
}

.weather-tile .tile-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #9aa1bf;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.weather-tile .tile-icon {
  color: var(--slipway);
  font-size: 13px;
}

.weather-tile strong {
  display: block;
  margin-top: 9px;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}

.weather-tile strong small {
  color: #aab0cb;
  font-size: 13px;
}

.weather-tile span:last-child {
  display: block;
  margin-top: 6px;
  color: #747b9a;
  font-size: 11px;
}

.forecast-card {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #151936;
  padding: 13px 13px 9px;
}

.forecast-card h2 {
  margin: 0 0 12px;
  color: #9aa1bf;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.forecast-list {
  display: grid;
}

.forecast-row {
  min-height: 32px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 78px 86px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #f7f8ff;
  font-size: 12px;
}

.forecast-row:first-child {
  border-top: 0;
}

.forecast-row .condition {
  overflow: hidden;
  color: #aab0cb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forecast-row .wind {
  color: #43d17a;
  text-align: right;
  font-weight: 900;
}

.forecast-row .temps {
  color: #ffb000;
  text-align: right;
  font-weight: 900;
}

.ai-view {
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  padding: 0 10px 68px;
  background: #060c18;
}

.ai-view.open {
  display: grid;
}

.ai-header {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -10px;
  padding: 7px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #08101f;
}

.ai-logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 2px solid var(--slipway);
  border-radius: 50%;
  background: #10192a;
  color: var(--slipway);
}

.ai-header p {
  margin: 0 0 2px;
  color: var(--slipway);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.ai-header h2 {
  margin: 0;
  color: #fff;
  font-size: 17px;
}

.ai-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(110px, 1fr) minmax(110px, 1fr);
  gap: 8px;
  padding: 8px 0 0;
}

.ai-select,
.ai-input {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #10192a;
  padding: 0 12px;
}

.ai-select select,
.ai-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f7f8ff;
  font: inherit;
}

.ai-select span,
.ai-input span {
  color: var(--slipway);
}

.ai-chat-log {
  min-height: 0;
  display: grid;
  align-content: center;
  gap: 10px;
  overflow: auto;
  padding: 24px 14px;
}

.ai-welcome {
  max-width: 760px;
  justify-self: center;
  text-align: center;
}

.ai-anchor {
  color: #bfc6d6;
  font-size: 44px;
  line-height: 1;
}

.ai-welcome h3 {
  margin: 8px 0 8px;
  color: #fff;
  font-size: 20px;
}

.ai-welcome p {
  margin: 0;
  color: #8792ad;
  font-size: 13px;
}

.ai-message {
  max-width: min(780px, 92vw);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #10192a;
  padding: 12px 14px;
}

.ai-message.user {
  justify-self: end;
  border-color: rgba(255, 116, 31, 0.4);
}

.ai-message.assistant {
  justify-self: start;
}

.ai-message strong {
  display: block;
  margin-bottom: 5px;
  color: var(--slipway);
  font-size: 12px;
}

.ai-message p {
  margin: 0;
  color: #f7f8ff;
  line-height: 1.45;
}

.ai-message.loading {
  opacity: 0.72;
}

.safety-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 0 0 9px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #24304a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.ai-message.safety-safe {
  border-color: rgba(67, 209, 122, 0.5);
}

.ai-message.safety-safe .safety-badge {
  background: #15803d;
}

.ai-message.safety-caution {
  border-color: rgba(245, 158, 11, 0.55);
}

.ai-message.safety-caution .safety-badge {
  background: #b45309;
}

.ai-message.safety-danger {
  border-color: rgba(239, 68, 68, 0.6);
}

.ai-message.safety-danger .safety-badge {
  background: #b91c1c;
}

.ai-message ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #cbd2e3;
}

.ai-message li + li {
  margin-top: 5px;
}

.ai-quick-section {
  padding: 0 14px 12px;
}

.ai-quick-section h3 {
  margin: 0 0 8px;
  color: #6f7893;
  font-size: 12px;
}

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

.ai-quick-list button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: #10192a;
  color: #f7f8ff;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.ai-quick-list button:hover {
  border-color: rgba(255, 116, 31, 0.45);
}

.ai-input-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 8px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-input-bar input {
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #10192a;
  color: #f7f8ff;
  padding: 0 16px;
  outline-color: var(--slipway);
}

.ai-input-bar button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--slipway);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.profile-view {
  padding: 14px 10px 92px;
}

.auth-card {
  max-width: 1120px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #151936;
  padding: 16px;
}

.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.auth-header h2 {
  margin: 0;
  font-size: 24px;
}

.auth-status {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #171b36;
  color: #aab0cb;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.auth-status.signed-in {
  color: #43d17a;
}

.auth-provider-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-provider,
.auth-actions button,
.profile-dashboard button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  padding: 11px 12px;
  cursor: pointer;
  font-weight: 900;
}

.auth-provider {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.auth-provider svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.auth-provider.google {
  border-color: rgba(255, 255, 255, 0.16);
  background: #f7f8ff;
  color: #151936;
}

.auth-provider:hover {
  transform: translateY(-1px);
}

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

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-actions .primary {
  background: var(--slipway);
  border-color: var(--slipway);
}

.profile-dashboard {
  display: none;
  gap: 12px;
}

.profile-dashboard.open {
  display: grid;
}

.profile-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #10192a;
  padding: 18px 14px;
}

.profile-avatar-picker {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #24304a;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  font-size: 24px;
  font-weight: 900;
}

.profile-avatar-picker img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.profile-avatar-picker img.open {
  display: block;
}

.profile-avatar-picker input {
  display: none;
}

.profile-avatar-picker::after {
  content: "+";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 2px solid #10192a;
  border-radius: 50%;
  background: var(--slipway);
  color: #fff;
  font-size: 14px;
}

.profile-avatar-picker img.open + span {
  display: none;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-name-row input {
  width: min(240px, 62vw);
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  outline-color: var(--slipway);
}

.profile-name-row button {
  padding: 7px 10px;
  font-size: 10px;
}

.profile-email {
  display: block;
  color: #aab0cb;
  font-size: 12px;
  font-weight: 800;
}

.profile-role,
.role-pill {
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 900;
}

.profile-menu-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  background: #10192a;
  text-align: left;
  letter-spacing: 0.08em;
}

.profile-menu-row.admin-only {
  display: none;
  background: #f59e0b;
  border-color: #f59e0b;
}

.profile-menu-row.admin-only.open {
  display: flex;
}

.profile-settings-panel {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: #10192a;
}

.profile-setting-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dce3f3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.profile-setting-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--slipway);
}

#unreadBadge {
  min-width: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #24304a;
  color: #aab0cb;
  padding: 3px 7px;
}

#unreadBadge.has-unread {
  background: var(--slipway);
  color: #fff;
}

.inbox-panel,
.notification-profile-panel,
.admin-panel {
  display: none;
  gap: 10px;
}

.inbox-panel.open,
.notification-profile-panel.open,
.admin-panel.open {
  display: grid;
}

.notification-settings {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notification-settings legend {
  padding: 0 6px;
  color: #aab0cb;
  font-size: 11px;
  font-weight: 800;
}

.notification-settings label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: #10192a;
  cursor: pointer;
  font-size: 12px;
}

.notification-settings input {
  accent-color: var(--slipway);
}

.notification-profile-actions {
  display: flex;
  justify-content: flex-end;
}

.notification-profile-actions button,
.followed-marker-item button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #fff;
  cursor: pointer;
}

.notification-profile-actions svg {
  width: 16px;
  height: 16px;
}

.notification-state {
  min-height: 18px;
  margin: 8px 0;
  color: #aab0cb;
  font-size: 12px;
}

.notification-state.error {
  color: #ff8b8b;
}

.notification-list,
.followed-marker-list {
  display: grid;
  gap: 7px;
}

.notification-empty {
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #7d86a5;
  font-size: 12px;
  text-align: center;
}

.notification-item,
.followed-marker-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: #10192a;
  color: #f7f8ff;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
  padding: 0;
  text-align: left;
}

.notification-item.unread {
  border-color: rgba(255, 116, 31, 0.62);
  background: #151b31;
}

.notification-item-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.notification-item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #24304a;
  color: var(--slipway);
}

.notification-item-icon svg {
  width: 16px;
  height: 16px;
}

.notification-item-content {
  min-width: 0;
}

.notification-item-content strong,
.notification-item-content span {
  display: block;
}

.notification-item-content p {
  margin: 4px 0;
  overflow-wrap: anywhere;
  color: #dce3f3;
  font-size: 12px;
}

.notification-item-content span {
  color: #7d86a5;
  font-size: 10px;
}

.notification-delete-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-right: 8px;
  border: 1px solid rgba(255, 92, 92, 0.36);
  border-radius: 50%;
  background: rgba(255, 92, 92, 0.08);
  color: #ff8f8f;
  cursor: pointer;
}

.notification-delete-button svg {
  width: 15px;
  height: 15px;
}

.notification-delete-button:hover {
  border-color: rgba(255, 92, 92, 0.68);
  background: rgba(255, 92, 92, 0.16);
}

.followed-marker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  font-size: 12px;
}

.followed-marker-item button {
  min-height: 30px;
  padding: 5px 8px;
  color: #ffb17e;
  font-size: 11px;
}

.notification-highlight {
  outline: 2px solid var(--slipway);
  outline-offset: 3px;
  animation: notification-pulse 900ms ease-in-out 2;
}

@keyframes notification-pulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(255, 116, 31, 0.18);
  }
}

.inbox-compose {
  display: grid;
  gap: 8px;
}

.inbox-compose input,
.inbox-compose textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #fff;
  padding: 10px;
}

.inbox-compose textarea {
  min-height: 82px;
  resize: vertical;
}

.inbox-list,
.admin-list {
  display: grid;
  gap: 8px;
}

.inbox-item,
.admin-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #10192a;
  padding: 12px;
}

.inbox-item.unread {
  border-color: rgba(255, 116, 31, 0.62);
}

.inbox-item span,
.admin-row span {
  display: block;
  margin-top: 3px;
  color: #7d86a5;
  font-size: 12px;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-tabs button.active {
  background: var(--slipway);
  border-color: var(--slipway);
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.admin-toolbar input,
.admin-user-fields input,
.admin-user-fields select,
.admin-actions select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  padding: 9px 10px;
}

.admin-toolbar button {
  display: grid;
  place-items: center;
  padding: 0;
}

.admin-toolbar svg {
  width: 17px;
  height: 17px;
}

.admin-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
}

.admin-edit-request-row {
  grid-template-columns: 1fr;
}

.admin-edit-request-meta {
  display: grid;
  gap: 4px;
}

.admin-edit-request-meta strong {
  font-size: 14px;
}

.admin-edit-request-email {
  color: #ffb17e !important;
  font-weight: 800;
}

.admin-edit-request-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-edit-request-fields label,
.place-edit-request-grid label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-edit-request-fields label.wide,
.place-edit-request-grid label.wide {
  grid-column: 1 / -1;
}

.admin-edit-request-fields input,
.admin-edit-request-fields select,
.admin-edit-request-fields textarea,
.place-edit-request-grid input,
.place-edit-request-grid select,
.place-edit-request-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  padding: 9px 10px;
}

.admin-edit-request-fields label.changed {
  color: #8ec5ff;
}

.admin-edit-request-fields label.changed input,
.admin-edit-request-fields label.changed select,
.admin-edit-request-fields label.changed textarea {
  border-color: rgba(56, 144, 255, 0.86);
  background: rgba(31, 111, 235, 0.16);
  box-shadow: inset 3px 0 0 rgba(56, 144, 255, 0.9);
}

.admin-edit-request-fields label.changed input:focus,
.admin-edit-request-fields label.changed select:focus,
.admin-edit-request-fields label.changed textarea:focus {
  border-color: #6fb5ff;
  box-shadow: 0 0 0 2px rgba(56, 144, 255, 0.22), inset 3px 0 0 rgba(56, 144, 255, 0.9);
}

.admin-edit-request-fields textarea,
.place-edit-request-grid textarea {
  min-height: 70px;
  resize: vertical;
}

.admin-edit-request-help {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.admin-edit-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-edit-request-actions .approve {
  border-color: #43d17a;
  background: rgba(67, 209, 122, 0.14);
  color: #78efa4;
}

.admin-edit-request-actions .reject {
  color: #ff8d83;
}

.admin-user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2563eb;
  font-weight: 900;
}

.admin-user-fields {
  display: grid;
  gap: 6px;
}

.admin-user-fields span {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-actions button {
  padding: 7px 10px;
  background: #080d1a;
  font-size: 11px;
}

.admin-actions select {
  width: auto;
  min-width: 112px;
  padding: 6px 8px;
  font-size: 11px;
}

.admin-actions button:disabled,
.admin-actions select:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.admin-actions button.danger {
  color: #ff5c5c;
}

.admin-error {
  color: #ff8b8b;
}

.logout-button {
  justify-self: center;
  border: 0;
  background: transparent !important;
  color: #ff5c5c !important;
}

.auth-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: #aab0cb;
  font-size: 13px;
  line-height: 1.45;
}

.auth-message.error {
  color: #ff9d8a;
}

.auth-message.success {
  color: #43d17a;
}

.bottom-nav {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: var(--shell-2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.bottom-nav button {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #747b9a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.bottom-nav button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

.bottom-nav button span {
  font-size: 10px;
}

.bottom-nav button.active {
  color: var(--slipway);
}

.user-badge {
  display: inline-block;
  margin-top: 7px;
  border-radius: 999px;
  background: #e8f7ef;
  color: #22623d;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.detail-panel {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100vh;
  overflow: auto;
  background: #0d1126;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(15, 28, 36, 0.22);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

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

.detail-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  background: #0d1126;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  font-size: 28px;
}

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

.detail-follow-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.detail-follow-button.active {
  border-color: var(--slipway);
  background: rgba(255, 116, 31, 0.14);
  color: var(--slipway);
}

.place-edit-request-toggle {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  border: 1px solid rgba(255, 116, 31, 0.35);
  border-radius: 6px;
  background: rgba(255, 116, 31, 0.08);
  color: #ffb17e;
  cursor: pointer;
  font-weight: 800;
}

.place-edit-request-toggle svg {
  width: 17px;
  height: 17px;
}

.place-edit-request-form {
  display: none;
  gap: 12px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.place-edit-request-form.open {
  display: grid;
}

.place-edit-request-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.place-edit-request-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.place-edit-request-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #43d17a;
  font-size: 12px;
}

.place-edit-request-status.error {
  color: #ff8d83;
}

.detail-follow-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.detail-follow-button svg {
  width: 16px;
  height: 16px;
}

.detail-actions {
  display: none;
  gap: 8px;
  padding: 12px 22px 0;
}

.detail-actions.open {
  display: flex;
  flex-wrap: wrap;
}

.detail-actions button.danger {
  border-color: rgba(255, 92, 92, 0.45);
  color: #ff8b8b;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #171b36;
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

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

.info-block {
  background: #151936;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.info-block.wide {
  grid-column: 1 / -1;
}

.info-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.weather-info-block {
  display: flex;
  flex-direction: column;
}

.info-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.info-block-heading h3 {
  min-width: 0;
  margin: 0;
}

.report-toggle-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 177, 126, 0.34);
  border-radius: 6px;
  background: transparent;
  color: #ffb17e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.report-toggle-button svg {
  width: 15px;
  height: 15px;
}

.place-report-form {
  display: none;
  gap: 8px;
  margin-top: 10px;
}

.place-report-form.open {
  display: grid;
}

.place-report-form textarea {
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f22;
  color: #fff;
  padding: 9px;
}

.report-status {
  min-height: 16px;
  margin: 7px 0 0;
  color: #aab0cb;
  font-size: 11px;
}

.report-status.error {
  color: #ff8b8b;
}

.detail-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-preview-actions-desktop {
  margin-top: auto;
}

.detail-preview-actions-mobile {
  display: none;
  flex: 0 0 auto;
}

.detail-preview-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 116, 31, 0.55);
  border-radius: 6px;
  background: rgba(9, 12, 28, 0.7);
  color: #f7f8ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.detail-preview-link:hover,
.detail-preview-link:focus-visible {
  border-color: var(--slipway);
  color: var(--slipway);
}

.detail-preview-link svg {
  width: 16px;
  height: 16px;
}

.weather-info-block .weather-grid {
  margin-bottom: 12px;
}

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

.metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

dl {
  margin: 0;
  display: grid;
  gap: 9px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dd {
  margin: 2px 0 0;
}

.photo-row {
  min-height: 86px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 10px;
}

.photo-item {
  position: relative;
  width: 112px;
  height: 82px;
  flex: 0 0 auto;
}

.photo-item img,
.photo-placeholder {
  width: 112px;
  height: 82px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #edf4f4;
}

.photo-item img {
  cursor: zoom-in;
}

.photo-item img:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 2px;
}

.photo-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: rgba(8, 11, 29, 0.82);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.photo-delete:hover {
  background: var(--slipway);
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.upload-button input {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

.welcome-guide {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.welcome-guide.open {
  display: grid;
}

.welcome-guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(14px);
  animation: welcome-fade 240ms ease both;
}

.welcome-guide-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100dvh - 28px));
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto auto;
  gap: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(255, 116, 31, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(16, 25, 42, 0.98), rgba(8, 12, 28, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  padding: 20px;
  animation: welcome-pop 260ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.welcome-guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.welcome-guide-close svg {
  width: 18px;
  height: 18px;
}

.welcome-guide-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 48px;
}

.welcome-guide-logo {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: linear-gradient(145deg, #ff741f, #39d0ff);
  color: #fff;
  box-shadow: 0 14px 30px rgba(57, 208, 255, 0.18);
}

.welcome-guide-logo svg {
  width: 29px;
  height: 29px;
  stroke-width: 2.6;
}

.welcome-guide-brand p {
  margin: 0 0 3px;
  color: var(--slipway);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.welcome-guide-brand h2 {
  margin: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1.05;
}

.welcome-guide-subtitle {
  margin: 0;
  color: #c8d1e7;
  font-size: 14px;
  line-height: 1.45;
}

.welcome-guide-progress {
  display: grid;
  gap: 7px;
  color: #aab0cb;
  font-size: 12px;
  font-weight: 800;
}

.welcome-guide-progress div {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.welcome-guide-progress span span,
.welcome-guide-progress div span {
  display: block;
}

#welcomeGuideProgressBar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff741f, #39d0ff);
  transition: width 220ms ease;
}

.welcome-guide-content {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.welcome-guide-content:focus-visible {
  outline: 2px solid rgba(57, 208, 255, 0.7);
  outline-offset: 3px;
}

.welcome-guide-step {
  min-height: 210px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 26px;
  text-align: center;
}

.welcome-guide-step-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255, 116, 31, 0.12);
  color: var(--slipway);
  box-shadow: inset 0 0 0 1px rgba(255, 116, 31, 0.22);
}

.welcome-guide-step-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 2.4;
}

.welcome-guide-step h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}

.welcome-guide-step p {
  max-width: 390px;
  margin: 8px auto 0;
  color: #c8d1e7;
  font-size: 15px;
  line-height: 1.5;
}

.welcome-guide-checkbox {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #dce3f3;
  font-size: 13px;
  font-weight: 800;
}

.welcome-guide-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--slipway);
}

.welcome-guide-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 9px;
}

.welcome-guide-actions button {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.welcome-guide-actions button.primary {
  border-color: var(--slipway);
  background: var(--slipway);
}

.welcome-guide-actions button:disabled {
  opacity: 0.48;
  cursor: default;
}

body.welcome-guide-open {
  overflow: hidden;
}

@keyframes welcome-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes welcome-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  visibility: hidden;
  opacity: 0;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.image-lightbox.open {
  visibility: visible;
  opacity: 1;
}

.image-lightbox.closing {
  visibility: visible;
  opacity: 0;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 15, 0.94);
  backdrop-filter: blur(4px);
}

.image-lightbox-dialog {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  display: grid;
  grid-template: 56px minmax(0, 1fr) auto / 64px minmax(0, 1fr) 64px;
  overflow: hidden;
  transform: scale(0.985);
  transition: transform 240ms ease;
}

.image-lightbox.open .image-lightbox-dialog {
  transform: scale(1);
}

.image-lightbox-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  color: #fff;
}

.image-lightbox-counter {
  min-width: 54px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.image-lightbox-tools {
  display: flex;
  gap: 6px;
}

.image-lightbox-tools button,
.image-lightbox-nav {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(17, 21, 45, 0.86);
  color: #fff;
  cursor: pointer;
}

.image-lightbox-tools button:hover,
.image-lightbox-nav:hover {
  border-color: rgba(255, 116, 31, 0.72);
  background: rgba(255, 116, 31, 0.18);
}

.image-lightbox-tools button:focus-visible,
.image-lightbox-nav:focus-visible,
.image-lightbox-viewport:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 2px;
}

.image-lightbox-tools svg,
.image-lightbox-nav svg {
  width: 21px;
  height: 21px;
}

.image-lightbox-nav {
  align-self: center;
  justify-self: center;
  z-index: 2;
}

.image-lightbox-nav.previous {
  grid-column: 1;
  grid-row: 2;
}

.image-lightbox-nav.next {
  grid-column: 3;
  grid-row: 2;
}

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

.image-lightbox-viewport {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.image-lightbox-viewport.dragging {
  cursor: grabbing;
}

.image-lightbox-viewport img {
  display: none;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
  transition: transform 180ms ease, opacity 180ms ease;
}

.image-lightbox-viewport img.loaded {
  display: block;
}

.image-lightbox-viewport.interacting img {
  transition: none;
}

.image-lightbox-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--sea);
  border-radius: 50%;
  animation: lightbox-spin 800ms linear infinite;
}

.image-lightbox-spinner[hidden],
.image-lightbox-error {
  display: none;
}

.image-lightbox-error.visible {
  display: block;
  margin: 0;
  color: #fff;
  text-align: center;
}

.image-lightbox-info {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 14px;
  padding: 10px 18px 14px;
  color: #fff;
  text-align: center;
}

.image-lightbox-info strong {
  font-size: 14px;
}

.image-lightbox-info span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

@keyframes lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .image-lightbox-dialog {
    grid-template: 52px minmax(0, 1fr) auto / 46px minmax(0, 1fr) 46px;
  }

  .image-lightbox-toolbar {
    padding: 6px 8px;
  }

  .image-lightbox-tools {
    gap: 4px;
  }

  .image-lightbox-tools button {
    width: 38px;
    height: 38px;
  }

  .image-lightbox-nav {
    width: 36px;
    height: 48px;
    border: 0;
    background: rgba(8, 11, 29, 0.62);
  }

  .image-lightbox-info {
    min-height: 64px;
    padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-lightbox,
  .image-lightbox-dialog,
  .image-lightbox-viewport img {
    transition: none;
  }
}

.chat-block {
  min-height: 300px;
}

.chat-log {
  height: 210px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0f22;
}

.chat-message {
  display: grid;
  gap: 3px;
  padding: 9px;
  border-radius: 6px;
  background: #171b36;
  border: 1px solid rgba(19, 124, 139, 0.16);
}

.chat-message-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.chat-message-header strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-message span {
  color: var(--muted);
  font-size: 12px;
}

.chat-message-delete {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 92, 92, 0.35);
  border-radius: 50%;
  background: transparent;
  color: #ff8b8b;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.chat-message-delete:hover,
.chat-message-delete:focus-visible {
  border-color: #ff8b8b;
  background: rgba(255, 92, 92, 0.14);
}

.chat-form {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.chat-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171b36;
  color: #f7f8ff;
  padding: 10px;
}

.marker-shell {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
}

.harbor-marker,
.slipway-marker {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 10%;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 0 18px currentColor, 0 4px 12px rgba(0, 0, 0, 0.42);
}

.marker-activity-badge {
  position: absolute;
  z-index: 2;
  top: -9px;
  right: -10px;
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--slipway);
  color: #fff;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.45);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.harbor-marker b,
.slipway-marker b {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(45deg);
}

.harbor-marker {
  background: var(--harbor);
  color: rgba(104, 116, 255, 0.86);
}

.slipway-marker {
  background: var(--slipway);
  color: rgba(242, 107, 29, 0.86);
}

.user-marker {
  outline: 3px solid rgba(35, 180, 113, 0.72);
  outline-offset: 2px;
}

.cluster-shell {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
}

.marine-cluster {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: #10192a;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 116, 31, 0.34), 0 8px 20px rgba(0, 0, 0, 0.42);
  font-size: 12px;
  font-weight: 900;
}

.cluster-activity-badge {
  position: absolute;
  top: -8px;
  right: -9px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--slipway);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.info-block dd a {
  color: #ff9b5c;
  font-weight: 800;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.popup-title {
  margin: 0 0 8px;
  font-weight: 800;
}

.popup-meta {
  margin: 0;
  color: #aab0cb;
  line-height: 1.45;
}

.popup-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 10px 0;
  text-align: left;
}

.popup-facts div {
  min-width: 0;
}

.popup-facts dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.popup-facts dd {
  margin: 2px 0 0;
  color: #f7f8ff;
  font-size: 12px;
}

.popup-hint {
  margin: 8px 0 0;
  color: var(--sea);
  font-size: 12px;
  font-weight: 800;
}

.route-panel {
  position: absolute;
  z-index: 36;
  right: 14px;
  bottom: 66px;
  width: min(360px, calc(100vw - 28px));
  display: none;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(57, 208, 255, 0.42);
  border-radius: 8px;
  background: rgba(13, 17, 38, 0.96);
  box-shadow: var(--shadow);
}

.route-panel.open {
  display: grid;
}

.route-panel.error {
  border-color: rgba(255, 92, 92, 0.55);
}

.route-panel div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.route-panel strong,
.route-panel span,
.route-panel small {
  overflow-wrap: anywhere;
}

.route-panel strong {
  color: #fff;
  font-size: 13px;
}

.route-panel span,
.route-panel small {
  color: var(--muted);
  font-size: 11px;
}

.route-panel > button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #171b36;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.route-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.route-panel .route-panel-action {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 116, 31, 0.52);
  border-radius: 6px;
  background: rgba(255, 116, 31, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.route-panel .route-panel-action:disabled {
  opacity: 0.58;
  cursor: default;
}

.route-steps {
  max-height: 108px;
  margin: 6px 0 0;
  padding-left: 18px;
  overflow: auto;
  color: #d7def4;
  font-size: 11px;
  line-height: 1.35;
}

.route-steps li + li {
  margin-top: 3px;
}

.user-location-marker {
  width: 22px;
  height: 22px;
  display: block;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #39d0ff;
  box-shadow: 0 0 0 5px rgba(57, 208, 255, 0.24), 0 0 18px rgba(57, 208, 255, 0.75);
}

.route-destination-marker {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 4px;
  background: #ff741f;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

@media (max-width: 760px) {
  #map {
    left: 0;
    right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .topbar {
    gap: 8px;
    padding: 7px 12px;
  }

  .topbar h1 {
    max-width: calc(100vw - 132px);
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .eyebrow {
    font-size: 8px;
  }

  .map-follow-toolbar {
    top: 8px;
    right: 58px;
    gap: 8px;
  }

  .map-legend {
    min-width: 76px;
    gap: 3px;
    padding: 0;
    font-size: 9px;
  }

  .map-legend div {
    gap: 5px;
  }

  .legend-dot {
    width: 8px;
    height: 8px;
  }

  .followed-markers-button {
    width: 36px;
    height: 36px;
  }

  .followed-markers-menu {
    top: calc(100% + 7px);
    right: -50px;
    max-height: calc(100dvh - 132px - env(safe-area-inset-bottom));
  }

  .control-panel {
    top: var(--map-panel-top, 66px);
    left: var(--map-panel-left, 64px);
    width: var(--map-panel-width, min(330px, calc(100vw - 76px)));
    height: var(--map-panel-height, auto);
    max-height: calc(100dvh - 144px - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
  }

  .map-control-rail {
    --map-control-size: 42px;
    left: 12px;
  }

  .control-panel > .target-button {
    display: none;
  }

  .mobile-target-button {
    position: fixed;
    z-index: 9;
    right: 16px;
    bottom: calc(94px + env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  }

  .mobile-target-button::before {
    content: "+";
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
  }

  .mobile-target-button.active::before {
    content: "\2713";
    font-size: 24px;
    font-weight: 900;
  }

  .map-stage.targeting:not(.target-form-open) .control-panel {
    height: auto;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  .map-stage.targeting:not(.target-form-open) .control-panel > :not(.target-button) {
    display: none;
  }

  .map-stage.targeting:not(.target-form-open) .target-button {
    pointer-events: auto;
  }

  .map-stage.target-form-open .control-panel {
    top: auto;
    right: 8px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    height: auto;
    max-height: 52dvh;
    padding: 12px;
    overscroll-behavior: contain;
  }

  .map-stage.target-form-open .control-panel > :not(.add-panel) {
    display: none;
  }

  .map-stage.target-form-open .mobile-target-button {
    display: none;
  }

  .map-stage.target-form-open .add-panel.open {
    display: grid;
    padding-top: 0;
    border-top: 0;
  }

  .map-stage.target-form-open .map-crosshair {
    z-index: 7;
    top: 26%;
  }

  .result-strip {
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
  }

  .route-panel {
    right: 10px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
  }

  .welcome-guide {
    align-items: end;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .welcome-guide-dialog {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
    padding: 16px;
    gap: 12px;
  }

  .welcome-guide-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .welcome-guide-brand h2 {
    font-size: 22px;
  }

  .welcome-guide-subtitle {
    font-size: 13px;
  }

  .welcome-guide-step {
    min-height: 190px;
    padding: 22px 16px;
  }

  .welcome-guide-step-icon {
    width: 66px;
    height: 66px;
    border-radius: 19px;
  }

  .welcome-guide-step h3 {
    font-size: 20px;
  }

  .welcome-guide-step p {
    font-size: 14px;
  }

  .welcome-guide-actions {
    grid-template-columns: 1fr 1fr;
  }

  .welcome-guide-actions button {
    min-height: 48px;
  }

  #welcomeGuideNext {
    grid-column: 1 / -1;
  }

  .list-view,
  .weather-view,
  .ai-view,
  .profile-view {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    height: calc(78px + env(safe-area-inset-bottom));
    padding: 6px 0 env(safe-area-inset-bottom);
  }

  .bottom-nav button {
    min-width: 0;
    min-height: 64px;
    flex-direction: column;
    gap: 5px;
    padding: 0;
  }

  .bottom-nav button svg {
    width: 27px;
    height: 27px;
    stroke-width: 2.4;
  }

  .bottom-nav button span {
    display: block;
    margin: 0;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .detail-panel {
    width: 100vw;
    height: 100dvh;
    border-left: 0;
  }

  .detail-header {
    padding: calc(14px + env(safe-area-inset-top)) 14px 14px;
  }

  .detail-header h2 {
    overflow-wrap: anywhere;
    font-size: 22px;
  }

  .detail-header-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

  .detail-follow-button {
    min-height: 34px;
    padding: 6px 8px;
  }

  .notification-drawer {
    right: 0;
    left: 0;
    width: 100vw;
    max-height: calc(100dvh - 78px - env(safe-area-inset-bottom));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .detail-actions {
    padding: 10px 14px 0;
  }

  .detail-actions button,
  .upload-button {
    min-height: 42px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    padding: 12px 10px calc(82px + env(safe-area-inset-bottom));
  }

  .detail-preview-actions-desktop {
    display: none;
  }

  .detail-preview-actions-mobile {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-preview-actions-mobile .detail-preview-link {
    width: 88px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form button {
    min-height: 42px;
  }

  .auth-provider-grid,
  .auth-actions {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-tabs button {
    min-width: 0;
    padding: 10px 4px;
    font-size: 9px;
  }

  .admin-edit-request-fields,
  .place-edit-request-grid {
    grid-template-columns: 1fr;
  }

  .admin-edit-request-fields label.wide,
  .place-edit-request-grid label.wide {
    grid-column: auto;
  }

  .auth-card {
    padding: 14px 12px;
  }

  .auth-header {
    align-items: center;
  }

  .auth-header h2 {
    font-size: 21px;
  }

  .auth-status {
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .auth-provider,
  .auth-actions button {
    min-height: 44px;
  }

  .profile-name-row {
    display: grid;
    width: 100%;
    justify-items: center;
  }

  .profile-name-row input {
    width: 100%;
    max-width: 280px;
  }

  .profile-email {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .profile-menu-row {
    min-height: 48px;
    letter-spacing: 0;
  }

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

  .admin-actions button {
    min-height: 38px;
    padding: 7px 5px;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }

  .weather-view {
    padding: 10px 10px 82px;
  }

  .weather-hero {
    padding: 18px;
    gap: 12px;
  }

  .weather-hero-actions {
    flex-direction: column;
    gap: 6px;
  }

  .weather-hero-action {
    min-width: 44px;
    width: 44px;
    min-height: 40px;
    padding: 0;
    border-radius: 14px;
  }

  .weather-hero-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .weather-metrics {
    grid-template-columns: 1fr;
  }

  .ai-view {
    padding-right: 8px;
    padding-left: 8px;
  }

  .ai-header {
    height: 50px;
    margin-right: -8px;
    margin-left: -8px;
    padding: 6px 10px;
  }

  .ai-logo {
    width: 32px;
    height: 32px;
  }

  .ai-header h2 {
    font-size: 15px;
  }

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

  .ai-select {
    grid-column: 1 / -1;
  }

  .ai-select,
  .ai-input {
    min-height: 42px;
    padding: 0 10px;
  }

  .ai-chat-log {
    padding: 18px 4px;
  }

  .ai-message {
    max-width: 94%;
    overflow-wrap: anywhere;
  }

  .ai-welcome h3 {
    font-size: 18px;
  }

  .ai-quick-section {
    padding-right: 4px;
    padding-left: 4px;
  }

  .ai-quick-list button {
    min-height: 44px;
    font-size: 12px;
    line-height: 1.35;
  }

  .ai-input-bar {
    padding-bottom: 4px;
  }

  .ai-input-bar input {
    min-width: 0;
  }

  .forecast-row {
    grid-template-columns: 92px minmax(0, 1fr) 58px 72px;
    gap: 6px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .control-panel {
    right: 8px;
    left: var(--map-panel-left, 58px);
    width: var(--map-panel-width, auto);
  }

  .map-control-rail {
    --map-control-size: 40px;
    left: 8px;
  }

  .segmented {
    gap: 4px;
  }

  .segmented button {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 11px;
  }

  .list-filters {
    gap: 6px;
    overflow-x: auto;
  }

  .list-filters button {
    flex: 0 0 auto;
  }

  .weather-hero strong {
    font-size: 42px;
  }

  .weather-sun {
    font-size: 44px;
  }

  .forecast-row {
    grid-template-columns: 76px minmax(0, 1fr) 50px 58px;
    gap: 4px;
    font-size: 10px;
  }

  .forecast-row .condition {
    white-space: normal;
  }

  .auth-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-status {
    max-width: 100%;
  }

  .profile-menu-row {
    padding-right: 10px !important;
    padding-left: 10px !important;
    font-size: 11px;
  }

  .admin-actions {
    grid-template-columns: 1fr;
  }

  .leaflet-popup-content {
    min-width: min(250px, calc(100vw - 64px));
    margin: 12px;
  }

  .popup-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .control-panel {
    max-height: calc(100dvh - 126px);
  }

  .ai-chat-log {
    align-content: start;
    padding-top: 12px;
  }

  .ai-quick-section {
    display: none;
  }
}
