:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --stone: #efede6;
  --stone-hover: #e5e2d8;
  --border: #e6e3da;
  --ink: #141413;
  --ink-muted: #71706a;
  --yellow: #f2c94c;
  --yellow-hover: #eab92f;
  --yellow-soft: #fcf4d9;
  --danger: #d9483b;
  --danger-soft: #fdeceb;
  --shadow-sm: 0 2px 8px rgba(20, 20, 19, 0.05);
  --shadow-md: 0 12px 32px rgba(20, 20, 19, 0.11);
  --shadow-lg: 0 18px 42px rgba(20, 20, 19, 0.16);
  --radius-card: 24px;
  --radius-sm: 14px;
  --topbar-h: 62px;
  --bottomnav-h: 66px;
  /* Papercraft FlapSpring easings (xikhar/papercraft web-2d.md) */
  --paper-up: linear(
    0, 0.024, 0.087, 0.18, 0.297, 0.431, 0.574, 0.72, 0.861, 0.993, 1.091, 1.124,
    1.095, 1.032, 0.971, 0.936, 0.936, 0.964, 1.003, 1.033, 1.043, 1.032, 1.009,
    0.986, 0.974, 0.975, 0.987, 1.002, 1.013, 1.016, 1.011, 1.003, 0.995, 0.992,
    0.993, 0.996, 1, 1.002, 1.003, 1.002, 1
  );
  --paper-down: linear(
    0, -0.02, -0.017, 0.003, 0.031, 0.065, 0.105, 0.15, 0.199, 0.251, 0.306, 0.362,
    0.419, 0.477, 0.536, 0.594, 0.652, 0.708, 0.764, 0.818, 0.871, 0.922, 0.971,
    0.997, 0.989, 0.986, 0.987, 0.991, 0.998, 1, 1, 1, 1
  );
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85 .6' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .24 0 0 0 0 .15 .32 0 0 0 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.025em;
}

em {
  font-style: normal;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

/* Minimal Alabaster Top Bar */
.topbar {
  height: var(--topbar-h);
  padding: 0 14px;
  background: var(--bg);
  border-bottom: 1px solid rgba(20, 20, 19, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 500;
  flex-shrink: 0;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-nav {
  display: none;
  gap: 4px;
  background: var(--stone);
  padding: 4px;
  border-radius: 999px;
}

.nav-pill {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-pill.active {
  background: var(--ink);
  color: var(--surface);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Language Pill Switcher (EU / ES) */
.lang-switch {
  display: inline-flex;
  background: var(--stone);
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.lang-btn.active {
  background: var(--ink);
  color: var(--surface);
}

.lang-switch-lg .lang-btn {
  font-size: 0.82rem;
  padding: 7px 14px;
}

.circle-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--stone);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.circle-btn:hover {
  background: var(--stone-hover);
}

.circle-btn:active {
  transform: scale(0.95);
}

.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  border: 2px solid var(--bg);
}

/* Main Content */
.main-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
  width: 100%;
  height: 100%;
}

.view.active {
  display: block;
}

.view-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 36px;
}

.container {
  max-width: 980px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 580px;
}

/* MAP VIEW */
#view-map {
  position: relative;
}

.map-canvas {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-canvas .leaflet-top.leaflet-right {
  display: none;
}

/* Subtle warm tint on IGN grayscale tiles to harmonize with #F5F4F0 */
.map-canvas .leaflet-tile-pane {
  filter: sepia(8%) contrast(98%) brightness(101%);
}

.map-kpi-strip {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 400;
  pointer-events: none;
}

.kpi-pill {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(20, 20, 19, 0.06);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow-md);
  font-size: 0.8rem;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

.kpi-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}

.kpi-pill strong {
  color: var(--ink);
  font-weight: 800;
}

.kpi-dot {
  opacity: 0.35;
}

.scope-pill {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(20, 20, 19, 0.06);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  flex-shrink: 0;
}

.scope-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.scope-btn.active {
  background: var(--ink);
  color: var(--surface);
}

.map-filter-banner {
  position: absolute;
  top: 56px;
  left: 12px;
  right: 12px;
  max-width: 440px;
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 400;
  box-shadow: var(--shadow-sm);
}

.link-btn {
  border: 0;
  background: var(--ink);
  color: var(--surface);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.74rem;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
}

.pick-mode-banner {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 460px;
  background: var(--ink);
  color: var(--surface);
  padding: 11px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  z-index: 450;
  box-shadow: var(--shadow-lg);
}

.btn-small-ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: var(--surface);
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* Floating Bottom Dock over Map */
.map-bottom-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 410;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

/* PWA Install Floating Banner */
.pwa-install-banner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(20, 20, 19, 0.08);
  border-radius: 20px;
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  max-width: 440px;
  animation: sheetSlideUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pwa-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  flex-shrink: 0;
}

.pwa-banner-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pwa-banner-text strong {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-text span {
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-install-cta {
  height: 34px;
  padding: 0 13px;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.pwa-dismiss-btn {
  border: 0;
  background: var(--stone);
  color: var(--ink-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ios-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ios-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.86rem;
  font-weight: 600;
}

.ios-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.heat-legend {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(20, 20, 19, 0.06);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.heat-bar {
  width: 72px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, #84cc16 0%, #f2c94c 45%, #f97316 78%, #d9483b 100%);
}

.map-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.map-controls-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.segmented {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(20, 20, 19, 0.06);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-md);
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--ink);
  color: var(--surface);
}

.map-round-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(20, 20, 19, 0.06);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.fab-primary {
  pointer-events: auto;
  height: 50px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 12px 28px rgba(20, 20, 19, 0.22);
  cursor: pointer;
  flex-shrink: 0;
}

.fab-primary:active {
  transform: scale(0.96);
}

/* Custom Leaflet Popup */
.leaflet-popup-content-wrapper {
  border-radius: 20px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 2px;
}

.popup-card {
  min-width: 210px;
  max-width: 255px;
  font-family: inherit;
}

.popup-badge {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--stone);
  color: var(--ink);
  margin: 0 4px 6px 0;
}

.popup-badge.yellow {
  background: var(--yellow);
  color: var(--ink);
}

.popup-badge.warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.popup-card h4 {
  margin: 0 0 3px;
  font-size: 0.95rem;
  font-weight: 800;
}

.popup-meta {
  font-size: 0.77rem;
  color: var(--ink-muted);
  margin: 0 0 6px;
}

.popup-notes {
  font-size: 0.83rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.popup-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 6px;
}

.popup-delete {
  border: 0;
  background: var(--danger-soft);
  color: var(--danger);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

/* Bottom Navigation (Dribbble clean white bar) */
.bottom-nav {
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid rgba(20, 20, 19, 0.06);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 500;
  flex-shrink: 0;
}

.bottom-nav.has-admin {
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
}

.bottom-nav-btn.active {
  color: var(--ink);
  font-weight: 800;
}

.bottom-nav-btn.active svg {
  stroke-width: 2.3;
}

/* Buttons */
.btn-primary,
.btn-yellow,
.btn-stone,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s, background 0.15s;
}

.btn-primary:active,
.btn-yellow:active,
.btn-stone:active,
.btn-outline:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--ink);
  color: var(--surface);
}

.btn-primary:hover {
  background: #2b2b28;
}

.btn-primary:disabled,
.btn-yellow:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-yellow {
  background: var(--yellow);
  color: var(--ink);
}

.btn-yellow:hover {
  background: var(--yellow-hover);
}

.btn-stone {
  background: var(--stone);
  color: var(--ink);
}

.btn-stone:hover {
  background: var(--stone-hover);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

/* Pills */
.yellow-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
}

.stone-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--stone);
  color: var(--ink-muted);
}

/* Cards & Sections */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0 0 3px;
  font-size: 1.4rem;
  font-weight: 800;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(20, 20, 19, 0.04);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 800;
}

.card-hero {
  background: var(--surface);
  border: 1px solid rgba(242, 201, 76, 0.45);
}

.card-subtle {
  background: var(--stone);
  border: 0;
  box-shadow: none;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-yellow {
  background: var(--yellow);
  color: var(--ink);
}

.stat-card-yellow .stat-label,
.stat-card-yellow .stat-sub {
  color: rgba(20, 20, 19, 0.72);
}

.stat-card-warn {
  background: var(--danger-soft);
}

.stat-card-warn .stat-value {
  color: var(--danger);
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.stat-value-sm {
  font-size: 1.1rem;
  line-height: 1.25;
}

.stat-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.charts-grid .card {
  margin-bottom: 0;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr 38px;
  align-items: center;
  gap: 10px;
  font-size: 0.83rem;
}

.bar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-weight: 600;
}

.bar-track {
  height: 10px;
  background: var(--stone);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ink);
  min-width: 5px;
}

.bar-fill.hot {
  background: var(--yellow);
}

.bar-count {
  text-align: right;
  font-weight: 800;
  color: var(--ink);
}

/* History / Sighting List (Dribbble Shipping History aesthetic) */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stone);
  border-radius: 999px;
  padding: 0 14px;
  height: 42px;
}

.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  background: transparent;
  color: var(--ink);
}

.sightings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sighting-item {
  background: var(--bg);
  border-radius: 20px;
  padding: 13px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sighting-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--stone);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sighting-icon-circle.warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.sighting-thumb {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
}

.sighting-body {
  flex: 1;
  min-width: 0;
}

.sighting-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.sighting-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sighting-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin: 0 0 6px;
}

.sighting-notes {
  font-size: 0.84rem;
  margin: 0 0 8px;
}

.sighting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-tiny {
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-tiny.danger {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: none;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-muted);
  background: var(--bg);
  border-radius: 20px;
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

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

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Modals & Floating Sheets */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.5);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  width: 100%;
  max-width: 580px;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-sheet-wide {
  max-width: 860px;
}

.modal-sheet-sm {
  max-width: 440px;
}

.modal-sheet-onboarding {
  max-width: 460px;
  padding: 22px 22px 26px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(20, 20, 19, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.close-btn {
  border: 0;
  background: var(--stone);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 18px 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(20, 20, 19, 0.06);
}

/* Onboarding & Smooth Animations */
@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheetSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes stepSlideForward {
  from {
    opacity: 0;
    transform: translateX(26px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stepSlideBack {
  from {
    opacity: 0;
    transform: translateX(-26px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes optionPop {
  0% { transform: scale(1); }
  45% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.modal-backdrop:not(.hidden) {
  animation: backdropFadeIn 0.22s ease-out both;
}

.modal-backdrop:not(.hidden) .modal-sheet {
  animation: sheetSlideUp 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.onb-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.onb-progress-track {
  flex: 1;
  height: 6px;
  background: var(--stone);
  border-radius: 999px;
  overflow: hidden;
}

.onb-progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Papercraft Pop-Up Diorama Stage inside Onboarding */
.pc-stage-wrap {
  margin-bottom: 14px;
}

.pc-stage {
  position: relative;
  width: 100%;
  height: 136px;
  border-radius: 20px;
  overflow: hidden;
  background: #efe7d8;
  border: 1px solid rgba(74, 44, 34, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(253, 244, 223, 0.85),
    inset 0 -10px 22px rgba(74, 44, 34, 0.08),
    0 3px 10px rgba(74, 44, 34, 0.08);
  perspective: 820px;
  perspective-origin: 50% 30%;
}

.pc-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--paper-grain);
  opacity: 0.55;
  pointer-events: none;
  z-index: 20;
}

.pc-ground {
  position: absolute;
  inset: 0;
}

.pc-ground-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pc-heat-print {
  opacity: 0;
  transition: opacity 0.65s ease;
}

.pc-stage.show-heat-print .pc-heat-print {
  opacity: 1;
}

.pc-scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  pointer-events: none;
}

.pc-piece {
  position: absolute;
  transform-style: preserve-3d;
  transform-origin: 50% 100%;
}

.pc-far { z-index: 2; }
.pc-mid { z-index: 5; }
.pc-near { z-index: 9; }

/* Bottom-crease hinge rotation: flat (88deg) -> standing (0deg) with FlapSpring overshoot */
.pc-flap {
  transform-origin: 50% 100%;
  transform: rotateX(89deg);
  opacity: 0;
  filter: drop-shadow(3px 5px 3px rgba(74, 44, 34, 0.28));
  transition:
    transform 0.52s var(--paper-down) 0ms,
    opacity 0.18s ease 0.28s;
  will-change: transform;
}

.pc-scene.is-open .pc-flap {
  transform: rotateX(0deg);
  opacity: 1;
  transition:
    transform 0.96s var(--paper-up) var(--d, 0ms),
    opacity 0.08s ease var(--d, 0ms);
}

/* Warm tinted contact + cast shadow on the printed paper ground */
.pc-shadow {
  position: absolute;
  left: 10%;
  right: 4%;
  bottom: -4px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(74, 44, 34, 0.36) 0%, rgba(74, 44, 34, 0.14) 55%, transparent 78%);
  transform: scaleX(0.35) translate(6px, 0);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.35s ease;
}

.pc-shadow-sm {
  left: 18%;
  right: 12%;
  height: 9px;
}

.pc-shadow-shoe {
  bottom: -24px;
  left: 12%;
  right: 8%;
  height: 12px;
}

.pc-scene.is-open .pc-shadow {
  transform: scaleX(1) translate(5px, 1px);
  opacity: 1;
  transition:
    transform 0.8s var(--paper-up) var(--d, 0ms),
    opacity 0.28s ease var(--d, 0ms);
}

.pc-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Subtle papercraft idle sway after settling */
@keyframes pcGentleSway {
  0%, 100% { transform: rotateX(0deg) rotateZ(0deg); }
  50% { transform: rotateX(0deg) rotateZ(1.6deg); }
}

@keyframes pcGentleSwayAlt {
  0%, 100% { transform: rotateX(0deg) rotateZ(0deg); }
  50% { transform: rotateX(0deg) rotateZ(-1.6deg); }
}

@keyframes pcShoeHover {
  0%, 100% { transform: rotateX(0deg) rotateZ(-6deg) translateY(0px); }
  50% { transform: rotateX(0deg) rotateZ(-2deg) translateY(5px); }
}

.pc-scene.is-open .pc-sway {
  animation: pcGentleSway 3.6s ease-in-out 1.1s infinite;
}

.pc-scene.is-open .pc-sway-alt {
  animation: pcGentleSwayAlt 4.1s ease-in-out 1.2s infinite;
}

.pc-scene.is-open .pc-shoe-hover {
  animation: pcShoeHover 2.2s ease-in-out 1.05s infinite;
}

.onb-stage {
  overflow: hidden;
}

.onboarding-step.anim-forward {
  animation: stepSlideForward 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.onboarding-step.anim-back {
  animation: stepSlideBack 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.onb-compact-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.onb-mini-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.onb-title {
  margin: 0 0 6px;
  font-size: 1.24rem;
  font-weight: 800;
  line-height: 1.2;
}

.onb-sub {
  margin: 0 0 14px;
  font-size: 0.86rem;
}

.onb-question {
  margin: 0 0 10px;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--ink);
}

.survey-options {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.survey-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid rgba(74, 44, 34, 0.14);
  background: var(--paper-grain), var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.91rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow:
    inset 1px 1px 0 rgba(253, 244, 223, 0.78),
    1px 2px 0 #dcd4c4,
    2px 4px 8px rgba(74, 44, 34, 0.08);
  transition: transform 0.09s ease, box-shadow 0.09s ease, background 0.15s ease;
}

.survey-opt:hover {
  background: var(--paper-grain), var(--stone);
  transform: translateY(-1px);
}

.survey-opt:active {
  transform: translate(1px, 2px);
  box-shadow:
    inset 1px 1px 0 rgba(253, 244, 223, 0.6),
    0 0 0 #dcd4c4,
    1px 1px 2px rgba(74, 44, 34, 0.14);
}

.survey-opt .opt-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.survey-opt.selected {
  background: var(--yellow);
  border-color: var(--ink);
  box-shadow: 0 6px 18px rgba(20, 20, 19, 0.1);
  animation: optionPop 0.24s ease;
}

.survey-opt.selected .opt-check {
  background: var(--ink);
  color: var(--yellow);
  transform: scale(1.06);
}

.onb-pulse-card {
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
  border-radius: 16px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

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

.mini-step {
  background: var(--bg);
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

/* Admin Survey & X/Twitter Box */
.survey-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.survey-kpi {
  background: var(--bg);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.survey-kpi-accent {
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
}

.survey-kpi strong {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.survey-kpi span {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.tweet-box {
  background: var(--bg);
  border-radius: 18px;
  padding: 13px;
}

.tweet-textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.45;
  resize: vertical;
}

.tweet-textarea:focus {
  outline: 2px solid var(--yellow);
  border-color: transparent;
}

@media (min-width: 768px) {
  .survey-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal-sheet,
  .onboarding-step,
  .survey-opt,
  .pc-flap,
  .pc-shadow,
  .pc-sway,
  .pc-sway-alt,
  .pc-shoe-hover {
    animation: none !important;
    transition: none !important;
  }
}

.link-btn-muted {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 8px 6px;
  cursor: pointer;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--stone);
  padding: 4px;
  border-radius: 999px;
  margin: 14px 0 16px;
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 9px;
  border-radius: 999px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--ink);
  color: var(--surface);
}

.form-error {
  margin: 0 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 10px 12px;
  border-radius: 14px;
}

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.label-row label {
  margin-bottom: 0;
}

.loc-actions {
  display: flex;
  gap: 6px;
}

.btn-chip-action {
  border: 0;
  background: var(--yellow-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.picker-map {
  width: 100%;
  height: 165px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.help-text {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

input[type='text'],
input[type='password'],
input[type='date'],
input[type='datetime-local'],
select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
}

input:focus,
select:focus {
  outline: 2px solid var(--yellow);
  border-color: transparent;
  background: var(--surface);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.chip {
  border: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
}

.chip.active {
  background: var(--ink);
  color: var(--surface);
}

.file-input {
  display: none;
}

.photo-trigger {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px dashed #c8c4b8;
  border-radius: 16px;
  padding: 13px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 0 !important;
}

.photo-preview-wrap {
  position: relative;
  margin-top: 8px;
  display: inline-block;
}

.photo-preview-wrap img {
  max-height: 150px;
  max-width: 100%;
  border-radius: 14px;
  display: block;
}

.btn-remove-photo {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  background: rgba(20, 20, 19, 0.82);
  color: #fff;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

/* Lightbox */
.lightbox-card {
  position: relative;
  margin: auto;
  max-width: 92vw;
  max-height: 90dvh;
  background: var(--ink);
  padding: 14px;
  border-radius: 24px;
  text-align: center;
}

.lightbox-card img {
  max-width: 100%;
  max-height: 76dvh;
  border-radius: 14px;
  display: block;
  margin: 0 auto;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.lightbox-caption {
  color: #efede6;
  font-size: 0.84rem;
  margin: 10px 0 0;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  z-index: 1200;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}

/* Printable ZU! Report */
.zu-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.printable-report {
  background: #fff;
  color: #141413;
  font-size: 0.9rem;
  line-height: 1.5;
}

.report-header {
  border-bottom: 2px solid #141413;
  padding-bottom: 12px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.report-header h1 {
  margin: 0 0 4px;
  font-size: 1.22rem;
}

.report-box {
  background: #f5f4f0;
  border: 1px solid #e6e3da;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.report-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.report-kpi {
  border: 1px solid #e6e3da;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.report-kpi strong {
  display: block;
  font-size: 1.25rem;
}

.report-kpi span {
  font-size: 0.72rem;
  color: #71706a;
}

.report-map-snapshot {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e6e3da;
  margin: 10px 0 14px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 10px 0 16px;
}

.report-table th,
.report-table td {
  border: 1px solid #e6e3da;
  padding: 6px 8px;
  text-align: left;
}

.report-table th {
  background: #f5f4f0;
  font-weight: 700;
}

.report-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.report-photo-card {
  border: 1px solid #e6e3da;
  border-radius: 10px;
  overflow: hidden;
  break-inside: avoid;
}

.report-photo-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.report-photo-card p {
  margin: 0;
  padding: 6px;
  font-size: 0.72rem;
  color: #4a4945;
}

/* Desktop Breakpoint */
@media (min-width: 768px) {
  .map-canvas .leaflet-top.leaflet-right {
    display: block;
    top: 12px;
  }
  .desktop-nav {
    display: inline-flex;
  }
  .bottom-nav {
    display: none;
  }
  .form-row-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
  .modal-sheet {
    border-radius: 26px;
  }
  .zu-toolbar {
    flex-direction: row;
    align-items: center;
  }
  .toast {
    bottom: 26px;
  }
}

/* Print Styles */
@media print {
  body {
    background: #fff;
  }
  .no-print {
    display: none !important;
  }
  #zu-modal {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
  }
  #zu-modal .modal-sheet {
    max-width: none !important;
    max-height: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  #zu-modal .modal-body {
    padding: 0 !important;
    overflow: visible !important;
  }
}
