/* =============================================================
   钓了么 DiaoLeMe — Design System
   Palette inspired by deep water + fresh catch
   ============================================================= */

:root {
  color-scheme: only light;

  /* Colors — brighter, airy ocean palette */
  --c-bg: #ffffff;
  --c-bg-2: #f7fbfd;
  --c-surface: #ffffff;
  --c-surface-2: #f3f8fc;
  --c-border: #e3ecf2;
  --c-border-strong: #cfdce5;
  --c-text: #0e2433;
  --c-text-muted: #55697a;
  --c-text-soft: #8798a6;

  --c-primary: #0a7ea4;        /* brighter water */
  --c-primary-2: #0995c1;
  --c-primary-soft: #e3f4fb;
  --c-accent: #00c2d9;          /* fresh turquoise */
  --c-accent-2: #4fd8e6;
  --c-coral: #ff7a6b;           /* fresh catch */
  --c-coral-2: #ffb199;
  --c-sun: #ffc94d;
  --c-leaf: #30b8a3;
  --c-grad-a: #00c2d9;
  --c-grad-b: #0a7ea4;
  --c-grad-c: #2a9d8f;

  --c-ok: #2a9d8f;
  --c-warn: #fbb13c;
  --c-err: #ef4b5a;

  /* Radii */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 28px;

  /* Shadows — softer, layered */
  --sh-1: 0 1px 2px rgba(14, 36, 51, .04), 0 2px 6px rgba(14, 36, 51, .05);
  --sh-2: 0 6px 18px rgba(10, 126, 164, .10), 0 2px 6px rgba(14, 36, 51, .04);
  --sh-3: 0 18px 48px rgba(10, 126, 164, .20);
  --sh-glow: 0 0 0 4px rgba(0, 194, 217, .18);

  /* Layout */
  --bar-h: 60px;
  --drawer-w: 280px;
  --max-w: 1280px;

  /* Motion */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Force light — user requested to lighten the dark filter */

/* =========== Reset =========== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  color-scheme: only light;
  background: #ffffff;
  forced-color-adjust: none;
}
/* Subtle hero-area accent band behind the hero, white everywhere else */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 520px;
  background:
    radial-gradient(60% 80% at 85% 0%, rgba(0, 194, 217, .08), transparent 60%),
    radial-gradient(50% 70% at 0% 10%, rgba(10, 126, 164, .06), transparent 60%);
  pointer-events: none; z-index: -1;
}
/* Nuke any inherited filter/backdrop on the root — fights user-agent
   auto-darken in Samsung/Edge "Force Dark Mode" and some extensions. */
html, body {
  filter: none !important;
  -webkit-filter: none !important;
  mix-blend-mode: normal !important;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #ffffff;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; color: var(--c-text); }
p { margin: 0 0 .6em; color: var(--c-text-muted); }
small { color: var(--c-text-soft); }
ul { padding-left: 1.2em; margin: .4em 0 .8em; color: var(--c-text-muted); }
li { margin: .25em 0; }

.hidden { display: none !important; }

/* =========== App Bar =========== */
.app-bar {
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow .3s var(--ease);
}
.app-bar.is-scrolled { box-shadow: 0 4px 20px rgba(10, 126, 164, .08); }
.app-bar__left, .app-bar__right { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: baseline; gap: 6px; padding-left: 4px; }
.brand__logo {
  font-size: 24px; display: inline-block;
  animation: fishSwim 4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes fishSwim {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(2px) rotate(-6deg); }
  50% { transform: translateX(0) rotate(0); }
  75% { transform: translateX(-2px) rotate(6deg); }
}
.brand__name {
  font-weight: 800; font-size: 19px; letter-spacing: .5px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand__sub { font-size: 11px; color: var(--c-text-soft); letter-spacing: 2px; font-weight: 500; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  color: var(--c-text); position: relative;
  transition: background .18s var(--ease);
}
.icon-btn:hover { background: var(--c-surface-2); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-coral); box-shadow: 0 0 0 2px var(--c-surface);
}
.avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}

/* =========== Drawer =========== */
.drawer {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: var(--drawer-w); height: 100vh;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  transform: translateX(-100%);
  transition: transform .28s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(6, 22, 30, .4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.drawer-scrim.show { opacity: 1; pointer-events: auto; }
.drawer__header {
  padding: 20px 18px; border-bottom: 1px solid var(--c-border);
  background: linear-gradient(135deg, var(--c-primary-soft), transparent);
}
.drawer__user { display: flex; gap: 12px; align-items: center; }
.drawer__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.drawer__name { font-weight: 600; }
.drawer__role { font-size: 12px; color: var(--c-text-soft); }
.drawer__nav { padding: 10px; flex: 1; overflow-y: auto; }
.drawer__link {
  display: block; padding: 11px 14px; margin: 2px 0;
  border-radius: var(--r); color: var(--c-text); text-decoration: none;
  font-size: 15px;
}
.drawer__link:hover { background: var(--c-surface-2); text-decoration: none; }
.drawer__link.active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
.drawer__footer { padding: 14px 18px; border-top: 1px solid var(--c-border); }
.drawer__version { font-size: 11px; color: var(--c-text-soft); margin-top: 8px; }

/* =========== Main / Views =========== */
.main { max-width: var(--max-w); margin: 0 auto; padding: 0 16px 80px; }
.view { padding-top: 20px; animation: fadeUp .25s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { padding: 8px 0 16px; }
.page-head h2 { font-size: 22px; }
.page-head p { margin: 0; }

/* =========== Buttons =========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: var(--r);
  font-weight: 600; font-size: 14px; line-height: 1;
  transition: transform .18s var(--ease-spring), box-shadow .2s var(--ease), background .2s var(--ease), filter .2s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn--primary {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 120%);
  color: #fff; box-shadow: 0 6px 18px rgba(10, 126, 164, .28);
}
.btn--primary:hover {
  filter: brightness(1.08); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(10, 126, 164, .36);
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
}
.btn--primary:hover::after { transform: translateX(100%); }
.btn--secondary { background: var(--c-surface); color: var(--c-primary); border-color: var(--c-border-strong); }
.btn--secondary:hover { background: var(--c-surface-2); }
.btn--ghost { background: transparent; color: var(--c-text-muted); }
.btn--ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn--danger { background: var(--c-err); color: #fff; }
.btn--block { display: flex; width: 100%; }
.btn--sm { padding: 6px 10px; font-size: 12px; border-radius: var(--r-sm); }

.link-btn { color: var(--c-primary); font-weight: 600; font-size: 14px; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

/* =========== Hero =========== */
.hero {
  position: relative; border-radius: var(--r-xl); overflow: hidden; margin-top: 8px;
  color: #fff;
  min-height: 360px;
  display: flex; align-items: center;
  box-shadow: var(--sh-3);
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(135deg, rgba(10, 126, 164, .72) 0%, rgba(0, 194, 217, .62) 100%),
    url("https://images.unsplash.com/photo-1504389648007-cd801fff6b5c?auto=format&fit=crop&w=1600&q=80") center/cover;
  background-color: #0a7ea4;
}
.hero__bg--fallback {
  background:
    radial-gradient(120% 80% at 80% 10%, rgba(79, 216, 230, .55), transparent 60%),
    radial-gradient(100% 80% at 10% 90%, rgba(42, 157, 143, .45), transparent 60%),
    linear-gradient(135deg, #0a7ea4 0%, #0995c1 45%, #00c2d9 100%);
}
/* Animated bubbles */
.hero__bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.18) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,.12) 0 10px, transparent 11px),
    radial-gradient(circle at 85% 85%, rgba(255,255,255,.15) 0 4px, transparent 5px),
    radial-gradient(circle at 40% 20%, rgba(255,255,255,.10) 0 8px, transparent 9px),
    radial-gradient(circle at 55% 70%, rgba(255,255,255,.14) 0 5px, transparent 6px);
  animation: bubbleFloat 10s linear infinite;
}
@keyframes bubbleFloat {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}
/* Three wave layers riding at the bottom */
.hero__bg::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -10px; height: 90px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'><path d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='%23ffffff22'/></svg>") repeat-x,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'><path d='M0,80 C200,20 400,140 600,80 C800,20 1000,140 1200,80 L1200,120 L0,120 Z' fill='%23ffffff33'/></svg>") repeat-x;
  background-size: 50% 100%, 33% 100%;
  animation: waveSlide 8s linear infinite;
}
@keyframes waveSlide {
  from { background-position: 0 0, 0 0; }
  to   { background-position: -1200px 0, 800px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__bg::before, .hero__bg::after { animation: none; }
}
.hero__content { position: relative; padding: 48px 32px; max-width: 720px; animation: heroFadeIn .8s var(--ease) both; }
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hero h1 {
  font-size: clamp(26px, 4.2vw, 44px); color: #fff; font-weight: 800;
  letter-spacing: -.5px;
  text-shadow: 0 2px 14px rgba(6, 52, 72, .25);
}
.hero p { color: rgba(255,255,255,.92); max-width: 540px; font-size: 16px; }
.hero__cta { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hero__cta .btn--primary {
  background: #fff; color: var(--c-primary);
  box-shadow: 0 10px 28px rgba(0, 60, 85, .22);
}
.hero__cta .btn--primary:hover {
  background: #eaf8fd; transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 60, 85, .28);
}
.hero__cta .btn--secondary {
  background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero__cta .btn--secondary:hover { background: rgba(255,255,255,.24); transform: translateY(-2px); }
.hero__stats { display: flex; gap: 28px; margin-top: 28px; }
.hero__stats div {
  display: flex; flex-direction: column; padding-right: 22px;
  border-right: 1px solid rgba(255,255,255,.2);
}
.hero__stats div:last-child { border-right: 0; }
.hero__stats strong {
  font-size: 28px; color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #d9f4fc 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__stats span { font-size: 11px; color: rgba(255,255,255,.75); letter-spacing: 2px; text-transform: uppercase; }

/* =========== Home sections =========== */
.home-section { margin-top: 32px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 18px; margin: 0; }

.scroll-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}
.scroll-row::-webkit-scrollbar { height: 6px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 3px; }

.grid-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.info-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.info-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1);
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease), border-color .2s var(--ease);
  position: relative; overflow: hidden;
}
.info-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent), var(--c-leaf));
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: var(--c-primary-soft); }
.info-card:hover::before { transform: scaleX(1); }
.info-card:hover .info-card__icon { transform: scale(1.15) rotate(-6deg); }
.info-card__icon {
  font-size: 34px; margin-bottom: 12px; display: inline-block;
  transition: transform .4s var(--ease-spring);
}

/* =========== Cards (spot / catch) =========== */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1);
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease), border-color .2s var(--ease);
  display: flex; flex-direction: column;
  scroll-snap-align: start;
  position: relative;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-3);
  border-color: var(--c-primary-soft);
}
.card__thumb img, .card__thumb { transition: transform .6s var(--ease); }
.card:hover .card__thumb::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 126, 164, .18));
  pointer-events: none;
}
.card:hover .card__thumb { transform: scale(1.04); }
.card__thumb {
  aspect-ratio: 16 / 10; background: #eaf3f8;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  background-size: cover; background-position: center;
}
.card__thumb--photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(14, 36, 51, .35) 100%);
  pointer-events: none;
}
/* Legacy placeholder blocks (kept as non-gray fallback) */
.card__thumb.fallback-catch { background: linear-gradient(135deg, #ffd8c4, #ff8f6b); }
.card__thumb.fallback-spot  { background: linear-gradient(135deg, #9fd3e6, #3a93b3); }
.card__thumb .badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.card__thumb .badge--legal { background: rgba(42, 157, 143, .85); }
.card__thumb .badge--permit { background: rgba(251, 177, 60, .9); color: #402a06; }
.card__thumb .badge--illegal { background: rgba(230, 57, 70, .9); }
.card__body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__title { font-size: 15px; font-weight: 600; margin: 0; }
.card__meta { font-size: 12px; color: var(--c-text-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.card__meta strong { color: var(--c-text); font-weight: 600; }
.card__price { font-size: 18px; color: var(--c-coral); font-weight: 700; margin-top: 4px; }
.card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--c-primary-soft); color: var(--c-primary);
  border: 1px solid transparent;
}
.tag--warn { background: #fff4de; color: #8a5a10; }
.tag--err { background: #fde4e6; color: #a11924; }
.tag--ghost { background: transparent; border-color: var(--c-border); color: var(--c-text-muted); }

/* =========== Spots layout =========== */
.spots-layout {
  display: grid; grid-template-columns: 300px 1fr; gap: 16px;
  height: calc(100vh - var(--bar-h) - 40px);
}
.spots-sidebar {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 14px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
}
.spots-filter { display: flex; flex-direction: column; gap: 10px; }
.spots-filter h3 { font-size: 15px; margin-bottom: 0; }
.spots-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.spot-item {
  padding: 10px; border-radius: var(--r); border: 1px solid var(--c-border);
  cursor: pointer; background: var(--c-surface-2);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.spot-item:hover { border-color: var(--c-primary); background: var(--c-primary-soft); }
.spot-item.active { border-color: var(--c-primary); background: var(--c-primary-soft); }
.spot-item__name { font-weight: 600; font-size: 14px; }
.spot-item__meta { font-size: 11px; color: var(--c-text-soft); display: flex; gap: 8px; margin-top: 2px; }

.spots-map-wrap {
  position: relative;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--c-border); background: var(--c-surface);
}
.spots-map { width: 100%; height: 100%; min-height: 500px; }
.map-legend {
  position: absolute; bottom: 12px; left: 12px;
  background: rgba(255,255,255,.95); border: 1px solid var(--c-border);
  border-radius: var(--r); padding: 8px 10px; font-size: 12px; z-index: 500;
  display: flex; gap: 14px;
}
.map-legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.dot--green { background: var(--c-leaf); }
.dot--amber { background: var(--c-sun); }
.dot--red { background: var(--c-err); }

/* Leaflet popup tweaks */
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.5; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: 14px; }
.leaflet-popup-content .popup-actions { display: flex; gap: 6px; margin-top: 8px; }
.leaflet-popup-content-wrapper { border-radius: var(--r); }

/* Custom map marker */
.map-marker {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  background: var(--c-primary); transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
}
.map-marker span { transform: rotate(45deg); font-size: 13px; }
.map-marker--legal { background: var(--c-leaf); }
.map-marker--permit { background: var(--c-sun); }
.map-marker--illegal { background: var(--c-err); }

/* =========== Market =========== */
.market-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.market-head__title h2 { margin: 0; }
.market-head__title p { margin: 0; font-size: 13px; }
.market-head__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease);
}
.chip.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

.market-sort {
  display: flex; gap: 18px; align-items: center; padding: 8px 0 14px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 14px;
  color: var(--c-text-muted); font-size: 13px;
}
.market-sort select { border: 1px solid var(--c-border); border-radius: var(--r-sm); padding: 4px 8px; background: var(--c-surface); }

.catch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.empty { padding: 40px 20px; text-align: center; color: var(--c-text-soft); }

/* Freshness dot */
.fresh {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
}
.fresh--a { background: #dff5ed; color: #0f6b5c; }
.fresh--b { background: #fff4de; color: #8a5a10; }
.fresh--c { background: #fde4e6; color: #a11924; }
.fresh::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* =========== Forms =========== */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--c-text-muted); }
.field > span:first-child { font-weight: 500; }
.field input, .field select, .field textarea {
  padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--c-border-strong); background: var(--c-surface);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  font-size: 14px; color: var(--c-text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 20%, transparent);
}
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.field.checkbox input { width: 16px; height: 16px; accent-color: var(--c-primary); }

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

/* =========== Orders / Tabs =========== */
.tabs { display: flex; gap: 2px; background: var(--c-surface-2); border-radius: var(--r); padding: 4px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px; border-radius: var(--r-sm); font-size: 13px;
  color: var(--c-text-muted); transition: background .15s var(--ease), color .15s var(--ease);
}
.tab.active { background: var(--c-surface); color: var(--c-text); font-weight: 600; box-shadow: var(--sh-1); }

.orders-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.order-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 16px;
}
.order-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.order-card__title { font-weight: 600; font-size: 15px; }
.order-card__id { font-size: 11px; color: var(--c-text-soft); font-family: 'SF Mono', Menlo, monospace; }
.order-card__body { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.order-card__thumb { width: 72px; height: 72px; border-radius: var(--r); background: linear-gradient(135deg, #ffd8c4, #ff8f6b); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.order-card__info { flex: 1; }
.order-card__info h4 { font-size: 14px; margin: 0; }
.order-card__info p { margin: 2px 0; font-size: 12px; }
.order-card__total { font-size: 18px; font-weight: 700; color: var(--c-coral); }
.order-card__actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }

.status-pill {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.status-pill--pending { background: #fff4de; color: #8a5a10; }
.status-pill--confirmed { background: var(--c-primary-soft); color: var(--c-primary); }
.status-pill--shipping { background: #e0f3ef; color: #0f6b5c; }
.status-pill--completed { background: #dff5ed; color: #0f6b5c; }
.status-pill--cancelled { background: #ededed; color: #555; }

/* =========== Messages =========== */
.msg-layout {
  display: grid; grid-template-columns: 280px 1fr;
  height: calc(100vh - var(--bar-h) - 40px);
  gap: 12px;
}
.msg-list {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); overflow-y: auto;
}
.msg-peer {
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--c-border); cursor: pointer;
  transition: background .15s var(--ease);
}
.msg-peer:hover { background: var(--c-surface-2); }
.msg-peer.active { background: var(--c-primary-soft); }
.msg-peer__avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.msg-peer__body { flex: 1; min-width: 0; }
.msg-peer__name { font-size: 14px; font-weight: 600; }
.msg-peer__last { font-size: 12px; color: var(--c-text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-peer__time { font-size: 11px; color: var(--c-text-soft); }

.msg-chat {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden;
}
.msg-chat__empty { margin: auto; color: var(--c-text-soft); }
.msg-chat__head { padding: 12px 16px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 10px; }
.msg-chat__scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 70%; padding: 8px 12px; border-radius: var(--r-lg); font-size: 14px; line-height: 1.45;
  word-break: break-word;
}
.bubble--me { align-self: flex-end; background: var(--c-primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble--them { align-self: flex-start; background: var(--c-surface-2); color: var(--c-text); border-bottom-left-radius: 4px; }
.bubble__time { font-size: 10px; margin-top: 2px; display: block; opacity: .6; }
.msg-chat__input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--c-border); }
.msg-chat__input input { flex: 1; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--c-border-strong); background: var(--c-surface-2); }
.msg-chat__input input:focus { outline: 0; border-color: var(--c-primary); }

/* =========== Profile =========== */
.profile { display: flex; flex-direction: column; gap: 18px; }
.profile__head {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 22px; display: flex; gap: 18px; align-items: center;
}
.profile__avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile__head > div:nth-child(2) { flex: 1; }
.profile__meta { font-size: 13px; color: var(--c-text-muted); margin-top: 2px; }
.profile__badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.badge-pill {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-text-muted);
}
.badge-pill--ok { background: #dff5ed; color: #0f6b5c; border-color: transparent; }

.profile__tabs { display: flex; gap: 2px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r); padding: 4px; overflow-x: auto; }
.profile__panel {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 20px; min-height: 260px;
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-box { padding: 14px; background: var(--c-surface-2); border-radius: var(--r); }
.stat-box strong { font-size: 22px; color: var(--c-primary); display: block; }
.stat-box span { font-size: 12px; color: var(--c-text-soft); }

/* =========== Compliance =========== */
.compliance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.compliance-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 20px;
}
.species-result { margin-top: 10px; min-height: 20px; font-size: 13px; }
.species-result.ok { color: var(--c-ok); }
.species-result.err { color: var(--c-err); }

/* =========== About =========== */
.about { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 20px; }
.about h3 { margin-top: 20px; }

/* =========== Modal =========== */
.modal-root {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(6, 22, 30, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .2s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--c-surface); border-radius: var(--r-lg);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--sh-3);
  animation: popIn .22s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--c-border); display: flex; justify-content: space-between; align-items: center; }
.modal__head h3 { margin: 0; font-size: 17px; }
.modal__body { padding: 20px; }
.modal__footer { padding: 12px 20px; border-top: 1px solid var(--c-border); display: flex; gap: 8px; justify-content: flex-end; }
.modal__close { font-size: 22px; color: var(--c-text-soft); }
.modal__close:hover { color: var(--c-text); }

.form-grid { display: flex; flex-direction: column; gap: 12px; }

/* Auth */
.auth { padding: 8px; }
.auth__tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--c-border); }
.auth__tab {
  flex: 1; padding: 10px 0; font-weight: 600; color: var(--c-text-soft);
  border-bottom: 2px solid transparent; transition: all .15s var(--ease);
}
.auth__tab.active { color: var(--c-primary); border-color: var(--c-primary); }
.auth__form { display: flex; flex-direction: column; gap: 12px; }
.auth__role { display: flex; gap: 8px; }
.role-radio { flex: 1; }
.role-radio input { position: absolute; opacity: 0; }
.role-radio span {
  display: block; padding: 10px; text-align: center;
  border: 1px solid var(--c-border-strong); border-radius: var(--r);
  cursor: pointer; font-size: 14px; transition: all .15s var(--ease);
}
.role-radio input:checked + span {
  border-color: var(--c-primary); background: var(--c-primary-soft);
  color: var(--c-primary); font-weight: 600;
}
.auth__hint { font-size: 11px; color: var(--c-text-soft); text-align: center; margin-top: 4px; }

/* =========== Toast =========== */
.toast-root {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--c-text); color: #fff;
  padding: 10px 18px; border-radius: var(--r);
  font-size: 13px; box-shadow: var(--sh-2);
  animation: toastIn .25s var(--ease);
  pointer-events: auto;
  max-width: 80vw;
}
.toast--ok { background: var(--c-ok); }
.toast--err { background: var(--c-err); }
.toast--warn { background: var(--c-warn); color: #402a06; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* =========== Back-to-top FAB =========== */
.fab-top {
  position: fixed; right: 18px; bottom: 22px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: #fff; box-shadow: 0 10px 24px rgba(10, 126, 164, .35);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(10px) scale(.9);
  transition: opacity .25s var(--ease), transform .25s var(--ease-spring), box-shadow .2s var(--ease);
  pointer-events: none;
}
.fab-top.show { opacity: 1; transform: none; pointer-events: auto; }
.fab-top:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(10, 126, 164, .45); }
.fab-top[hidden] { display: none !important; }
@supports (padding: env(safe-area-inset-bottom)) {
  .fab-top { bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* =========== Loading skeleton =========== */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--c-surface-2);
  border-radius: var(--r);
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* =========== Scroll reveal =========== */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Stagger home section cards */
.grid-row > *, .info-cards > *, .catch-grid > *, .scroll-row > * {
  animation: cardRise .5s var(--ease) both;
}
.grid-row > *:nth-child(2), .info-cards > *:nth-child(2), .catch-grid > *:nth-child(2), .scroll-row > *:nth-child(2) { animation-delay: .06s; }
.grid-row > *:nth-child(3), .info-cards > *:nth-child(3), .catch-grid > *:nth-child(3), .scroll-row > *:nth-child(3) { animation-delay: .12s; }
.grid-row > *:nth-child(4), .info-cards > *:nth-child(4), .catch-grid > *:nth-child(4), .scroll-row > *:nth-child(4) { animation-delay: .18s; }
.grid-row > *:nth-child(5), .catch-grid > *:nth-child(5), .scroll-row > *:nth-child(5) { animation-delay: .24s; }
.grid-row > *:nth-child(6), .catch-grid > *:nth-child(6), .scroll-row > *:nth-child(6) { animation-delay: .30s; }
@keyframes cardRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Chip & tab hover refinements */
.chip { transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease-spring), border-color .18s var(--ease); }
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); transform: translateY(-1px); }
.chip.active { box-shadow: 0 4px 12px rgba(10, 126, 164, .3); }

/* Input focus glow */
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: var(--sh-glow);
}

/* Section headings */
.section-head h2 {
  position: relative; padding-left: 14px;
}
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
}

/* Page head h2 same treatment */
.page-head h2 {
  position: relative; padding-left: 14px;
}
.page-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 2px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
}

/* =========== Responsive =========== */
@media (max-width: 900px) {
  .spots-layout { grid-template-columns: 1fr; height: auto; }
  .spots-sidebar { max-height: 320px; }
  .spots-map { min-height: 360px; }
  .msg-layout { grid-template-columns: 1fr; height: auto; }
  .msg-list { max-height: 260px; }
  .msg-chat { min-height: 400px; }
  .hero { min-height: 300px; }
  .hero__content { padding: 32px 22px; }
  .hero__stats { gap: 16px; }
  .hero__stats div { padding-right: 14px; }
  .hero__stats strong { font-size: 22px; }
  .main { padding: 0 14px 80px; }
}
@media (max-width: 560px) {
  :root { --bar-h: 56px; --r-xl: 20px; }
  .app-bar { padding: 0 12px; }
  .brand__sub { display: none; }
  .hero { min-height: 260px; border-radius: var(--r-lg); }
  .hero__content { padding: 28px 20px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 14px; }
  .hero__stats { gap: 10px; margin-top: 20px; }
  .hero__stats div { padding-right: 10px; }
  .hero__stats strong { font-size: 18px; }
  .hero__stats span { font-size: 10px; letter-spacing: 1px; }
  .hero__cta .btn { flex: 1; min-width: 0; padding: 10px 12px; font-size: 13px; }
  .market-head { flex-direction: column; align-items: stretch; }
  .market-sort { flex-wrap: wrap; gap: 10px; }
  .profile__head { flex-direction: column; text-align: center; align-items: center; }
  .profile__badges { justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 20px; }
  .section-head h2 { font-size: 16px; }
  .info-card { padding: 18px; }
  .catch-grid, .grid-row { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .scroll-row { grid-auto-columns: minmax(220px, 80%); }
  .card__body { padding: 12px; }
  .card__title { font-size: 14px; }
  .card__price { font-size: 16px; }
  .home-section { margin-top: 24px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; }
  .modal { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 95vh; align-self: flex-end; margin-top: auto; }
  .modal-root { align-items: flex-end; padding: 0; }
}
