:root {
  color-scheme: light;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-border: rgba(148, 163, 184, 0.35);
  --sky-primary: #0284c7;
  --sky-dark: #0369a1;
  --sky-light: #e0f2fe;
  --warn-bg: #fffbeb;
  --warn-border: #f59e0b;
  --warn-ink: #78350f;
  --error-bg: #fef2f2;
  --error-border: #ef4444;
  --error-ink: #7f1d1d;
  --shadow-float: 0 8px 24px rgba(15, 23, 42, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background: var(--sky-light);
}

[hidden] {
  display: none !important;
}

#app-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

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

/* Top header & non-blocking banners */
.top-overlay {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 500;
  pointer-events: none;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-header {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  box-shadow: var(--shadow-float);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--sky-primary);
  color: #ffffff;
}

.app-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--sky-dark);
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.status-pill[data-mode="live"] {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.status-pill[data-mode="live"] .status-dot {
  background: #10b981;
}

.status-pill[data-mode="fallback"] {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.status-pill[data-mode="fallback"] .status-dot {
  background: #f59e0b;
}

.notice-banner {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-float);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
}

.notice-banner--warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

.notice-banner--error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-ink);
}

.notice-banner--offline {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.notice-banner__text {
  flex: 1 1 180px;
}

.notice-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-action-btn,
.banner-dismiss-btn {
  min-width: 48px;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.banner-action-btn {
  padding: 0 14px;
  background: #b45309;
  color: #ffffff;
}

.banner-dismiss-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  flex-shrink: 0;
  background: rgba(120, 53, 15, 0.14);
  color: var(--warn-ink);
  font-size: 1.15rem;
}

.banner-dismiss-btn--error {
  background: rgba(127, 29, 29, 0.12);
  color: var(--error-ink);
}

.banner-dismiss-btn--offline {
  background: rgba(30, 41, 59, 0.12);
  color: #1e293b;
}

/* Bottom floating controls */
.bottom-controls {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 500;
  pointer-events: none;
  padding: 0 12px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 10px;
}

.control-btn {
  pointer-events: auto;
  min-width: 48px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-float);
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.control-btn:active {
  transform: scale(0.97);
}

.control-btn--primary {
  background: var(--sky-primary);
  color: #ffffff;
  border-color: #0369a1;
}

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

/* Leaflet safe-area & 48px+ zoom touch targets */
.leaflet-top {
  top: calc(72px + env(safe-area-inset-top));
}

.leaflet-bottom {
  bottom: calc(74px + env(safe-area-inset-bottom));
}

.leaflet-control-zoom {
  border: 1px solid var(--surface-border) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: var(--shadow-float) !important;
}

.leaflet-control-zoom a {
  min-width: 48px !important;
  min-height: 48px !important;
  width: 48px !important;
  height: 48px !important;
  line-height: 48px !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  color: var(--ink-primary) !important;
  background: var(--surface-glass) !important;
}

/* User location marker */
.user-location-icon {
  background: transparent;
  border: none;
}

.user-dot-marker {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dot-marker__pulse {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.35);
  animation: pulse-ring 2s ease-out infinite;
}

.user-dot-marker__core {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.6);
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.65);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

/* Custom Puddle Markers (48px+ touch target wrapper) */
.puddle-div-icon {
  background: transparent;
  border: none;
}

.puddle-marker {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: var(--freshness-opacity, 1);
  transform: scale(var(--freshness-scale, 1));
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.puddle-marker__ripple {
  display: none;
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2.5px solid rgba(14, 165, 233, 0.55);
  pointer-events: none;
}

.puddle-marker--fresh .puddle-marker__ripple,
.puddle-marker[data-freshness-tier="fresh"] .puddle-marker__ripple {
  display: block;
  animation: fresh-ripple 2.4s ease-out infinite;
}

.puddle-marker--mini_lake.puddle-marker--fresh .puddle-marker__ripple,
.puddle-marker--mini_lake[data-freshness-tier="fresh"] .puddle-marker__ripple {
  width: 56px;
  height: 56px;
}

@keyframes fresh-ripple {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

.puddle-marker__body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
  transition: transform 0.14s ease;
}

.puddle-marker:hover .puddle-marker__body,
.puddle-marker:active .puddle-marker__body {
  transform: scale(1.08);
}

/* Depth scale & tone */
.puddle-marker--ankle .puddle-marker__body {
  width: 38px;
  height: 38px;
  background: #e0f2fe;
}

.puddle-marker--half_boot .puddle-marker__body {
  width: 46px;
  height: 46px;
  background: #bae6fd;
}

.puddle-marker--mini_lake .puddle-marker__body {
  width: 54px;
  height: 54px;
  background: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25), 0 5px 14px rgba(3, 105, 161, 0.42);
}

/* Surface visual distinction */
.puddle-marker--clean .puddle-marker__body {
  border-color: #ffffff;
}

.puddle-marker--mud .puddle-marker__body {
  border-color: #92400e;
  background: #fef3c7;
  box-shadow: inset 0 0 0 2px #fde68a, 0 4px 12px rgba(120, 53, 15, 0.35);
}

.puddle-marker--leaves .puddle-marker__body,
.puddle-marker--has-leaves .puddle-marker__body {
  border-color: #15803d;
}

.puddle-marker__mud-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

.puddle-marker__leaf-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.38);
}

.puddle-marker__unsafe-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
}

/* Hebrew RTL Leaflet Popup */
.leaflet-popup-content-wrapper {
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  direction: rtl;
  text-align: right;
}

.leaflet-popup-content {
  margin: 12px 14px 14px;
  min-width: 256px;
  max-width: min(304px, calc(100vw - 44px));
  font-family: var(--font-sans);
}

.puddle-popup {
  direction: rtl;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.puddle-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.puddle-popup__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.puddle-popup__close {
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #f1f5f9;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.puddle-popup__close:active {
  transform: scale(0.95);
}

.puddle-popup__freshness {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.puddle-popup__freshness--fresh {
  background: #dcfce7;
  color: #166534;
}

.puddle-popup__freshness--fading {
  background: #fef3c7;
  color: #92400e;
}

.puddle-popup__freshness--dry {
  background: #f1f5f9;
  color: #475569;
}

.puddle-popup__depth {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--sky-primary);
}

.puddle-popup__depth--ankle {
  background: #0284c7;
}

.puddle-popup__depth--half_boot {
  background: #0369a1;
}

.puddle-popup__depth--mini_lake {
  background: #075985;
}

.puddle-popup__surface {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.puddle-popup__surface-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.puddle-popup__surface-dot--clean {
  background: #0ea5e9;
}

.puddle-popup__surface-dot--mud {
  background: #92400e;
}

.puddle-popup__surface-dot--leaves {
  background: #15803d;
}

.puddle-popup__surface-dot--clean-leaves {
  background: linear-gradient(135deg, #0ea5e9 50%, #16a34a 50%);
}

.puddle-popup__surface-dot--mud-leaves {
  background: linear-gradient(135deg, #92400e 50%, #16a34a 50%);
}

.puddle-popup__unsafe {
  padding: 5px 9px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 700;
}

.puddle-popup__time {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.puddle-popup__actions:empty {
  display: none;
}

/* Slice 3: Community voting inside puddle popup */
.puddle-vote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 2px;
}

.puddle-vote-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 6px 4px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.puddle-vote-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.puddle-vote-btn--wet {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #075985;
}

.puddle-vote-btn--dry {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

.puddle-vote-btn--unsafe {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
}

.puddle-vote-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.puddle-vote-btn.is-selected {
  opacity: 1;
  box-shadow: 0 0 0 2px currentColor;
}

.puddle-vote-locked {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-secondary);
  text-align: center;
}

/* Slice 3: Floating Report Action Button */
.leaflet-bottom.leaflet-right {
  bottom: calc(1px + env(safe-area-inset-bottom));
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

#slice3-fab-slot {
  position: fixed;
  bottom: calc(74px + env(safe-area-inset-bottom));
  right: 12px;
  z-index: 510;
  pointer-events: none;
  max-width: calc(100vw - 82px);
}

.report-fab {
  pointer-events: auto;
  min-width: 48px;
  min-height: 54px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid #0369a1;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.38);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.report-fab:active:not(:disabled) {
  transform: scale(0.97);
}

.report-fab:disabled,
.report-fab--cooldown {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #334155;
  box-shadow: var(--shadow-float);
  cursor: not-allowed;
}

/* Slice 3: RTL Reporting Bottom Sheet */
#slice3-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#slice3-sheet-root.is-open .report-backdrop {
  opacity: 1;
}

.report-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 36px - env(safe-area-inset-top));
  overflow-y: auto;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.22);
  transform: translateY(100%);
  transition: transform 0.22s ease-out;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#slice3-sheet-root.is-open .report-sheet {
  transform: translateY(0);
}

.report-sheet__handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 0 auto 2px;
}

.report-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-sheet__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink-primary);
}

.report-sheet__close {
  min-width: 48px;
  min-height: 48px;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #f1f5f9;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-sheet__close:active {
  transform: scale(0.95);
}

.sheet-gps-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.sheet-retry-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  background: #b45309;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.sheet-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-section__title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink-secondary);
}

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

.choice-card {
  min-width: 48px;
  min-height: 92px;
  padding: 8px 6px;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.choice-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.choice-card:active {
  transform: scale(0.97);
}

.choice-card[aria-pressed="true"] {
  background: #e0f2fe;
  border-color: var(--sky-primary);
  color: var(--sky-dark);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.22);
}

.choice-card--mud[aria-pressed="true"] {
  background: #fef3c7;
  border-color: #b45309;
  color: #78350f;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.22);
}

.choice-card--leaves[aria-pressed="true"] {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.24);
}

.safety-switch {
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: right;
}

.safety-switch[aria-checked="true"] {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.safety-switch__track {
  position: relative;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: #94a3b8;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.safety-switch[aria-checked="true"] .safety-switch__track {
  background: #dc2626;
}

.safety-switch__thumb {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  transition: transform 0.15s ease;
}

.safety-switch[aria-checked="true"] .safety-switch__thumb {
  transform: translateX(-22px);
}

.sheet-error {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.report-submit-btn {
  min-width: 48px;
  min-height: 54px;
  width: 100%;
  border-radius: 16px;
  border: none;
  background: var(--sky-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.32);
}

.report-submit-btn:disabled {
  background: #cbd5e1;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

/* Slice 3: Toast notifications */
.toast-root {
  position: fixed;
  top: calc(74px + env(safe-area-inset-top));
  inset-inline: 12px;
  z-index: 950;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.toast-pill {
  max-width: min(440px, 100%);
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow-float);
  border: 1px solid transparent;
}

.toast-pill--success {
  background: #ecfdf5;
  border-color: #34d399;
  color: #065f46;
}

.toast-pill--warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

.toast-pill--error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-ink);
}

.future-slot:empty {
  display: none;
}

/* Slice 4: Treasure Compass */
#slice4-compass-root {
  position: fixed;
  bottom: calc(138px + env(safe-area-inset-bottom));
  right: 12px;
  width: min(380px, calc(100vw - 84px));
  z-index: 505;
  pointer-events: none;
}

.compass-card {
  pointer-events: auto;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--surface-border);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.compass-card--arrived {
  background: #ecfdf5;
  border-color: #10b981;
}

.compass-empty {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-secondary);
  text-align: center;
  padding: 6px 4px;
}

.compass-active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compass-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.compass-dial {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #38bdf8, #0284c7);
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  color: #fde047;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compass-card--arrived .compass-dial {
  background: radial-gradient(circle at 30% 30%, #34d399, #059669);
}

.compass-dial__north {
  position: absolute;
  top: 2px;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
}

.compass-arrow {
  transition: transform 0.2s ease-out;
  transform-origin: center;
  will-change: transform;
}

.compass-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compass-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.compass-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--sky-dark);
}

.compass-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sky-light);
  color: var(--sky-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.compass-sensor-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 800;
}

.compass-arrived {
  font-size: 0.95rem;
  font-weight: 900;
  color: #065f46;
}

.compass-distance {
  font-size: 1rem;
  font-weight: 900;
  color: var(--ink-primary);
  line-height: 1.25;
}

.compass-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-secondary);
  line-height: 1.3;
}

.compass-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compass-permission-btn,
.compass-reset-btn,
.puddle-compass-btn {
  min-width: 48px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.compass-permission-btn:active,
.compass-reset-btn:active,
.puddle-compass-btn:active {
  transform: scale(0.97);
}

.compass-permission-btn {
  flex: 1 1 auto;
  border: none;
  background: var(--sky-primary);
  color: #ffffff;
}

.compass-reset-btn {
  flex: 1 1 auto;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink-primary);
}

.compass-note {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-secondary);
  line-height: 1.3;
}

.puddle-compass-btn {
  width: 100%;
  margin-top: 8px;
  border: 1.5px solid #0284c7;
  background: #e0f2fe;
  color: #075985;
}

/* Playful Splash Burst Celebration Overlay */
.splash-celebration {
  position: fixed;
  inset: 0;
  z-index: 980;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-celebration__burst {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  animation: splash-pop 0.88s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.splash-celebration__text {
  padding: 5px 16px;
  border-radius: 999px;
  background: #0284c7;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.42);
}

.splash-drop {
  transform-origin: center;
  animation: splash-drop 0.82s ease-out forwards;
}

@keyframes splash-pop {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  28% {
    opacity: 1;
    transform: scale(1.08);
  }
  75% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.12) translateY(-10px);
  }
}

@keyframes splash-drop {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 420px) {
  .app-header {
    padding: 8px 10px;
  }

  .app-title {
    font-size: 1rem;
  }

  .status-pill {
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .control-btn {
    padding: 10px 12px;
    font-size: 0.86rem;
  }
}
