/* ========================================
   Tutsy — Theme & Component Styles
   ======================================== */

.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; touch-action: pan-x; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

.no-spinner { -moz-appearance: textfield; appearance: textfield; }
.no-spinner::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

html { background: var(--paper); }


/* Smooth scroll for anchor links */
html { scroll-behavior: smooth; }

/* Theme variables */
:root {
  --ink: #0a0a0a;
  --paper: #fafaf9;
  --muted: #78716c;
  --border: #e7e5e4;
  --accent: #059669;
  --accent-light: #d1fae5;
  --accent-dark: #047857;
  --accent-muted: #059669;
  --surface: #ffffff;
  --surface-raised: #f5f5f4;
  --card-gradient-opacity: 1;
  --frosted-bg: color-mix(in srgb, #dddde1 60%, transparent);
  --featured-glow: #2a2a2a;
  --sheen: linear-gradient(160deg,
    rgba(15,23,42,0.16) 0%,
    rgba(15,23,42,0.07) 34%,
    rgba(255,255,255,0) 62%,
    rgba(255,255,255,0.55) 86%,
    rgba(255,255,255,0.95) 100%);
  --sheen-edge: rgba(255,255,255,0.95);
}

.dark {
  --ink: #f5f5f4;
  --paper: #0c0c0c;
  --muted: #a8a29e;
  --border: #292524;
  --accent: #059669;
  --accent-light: #064e3b;
  --accent-dark: #047857;
  --accent-muted: #059669;
  --surface: #171717;
  --surface-raised: #1c1c1c;
  --card-gradient-opacity: 0.4;
  --frosted-bg: color-mix(in srgb, #222225 70%, transparent);
  --featured-glow: var(--accent);
  --sheen: linear-gradient(160deg,
    rgba(255,255,255,0.14) 0%,
    rgba(255,255,255,0.05) 14%,
    rgba(255,255,255,0) 38%,
    rgba(0,0,0,0.10) 66%,
    rgba(0,0,0,0.22) 100%);
  --sheen-edge: rgba(255,255,255,0.10);
}

#icon-sun, .mobile-sun { display: none; }
#icon-moon, .mobile-moon { display: block; }
.dark #icon-sun, .dark .mobile-sun { display: block; }
.dark #icon-moon, .dark .mobile-moon { display: none; }

/* Dark mode overrides */
.dark ::-webkit-scrollbar-thumb { background: #44403c; }
.dark .tag { background: var(--surface-raised); border-color: var(--border); color: var(--muted); }
.dark .tag-accent { background: #064e3b; border-color: #065f46; color: #34d399; }
.dark .hero-gradient { background: radial-gradient(ellipse 80% 60% at 50% -20%, #05966920 0%, transparent 70%); }
.dark .pricing-highlight::before { background: linear-gradient(135deg, #059669, #065f46); }
.dark .toggle-track { background: #44403c; }
.dark .toggle-track.active { background: #059669; }
.dark input:not([readonly]), .dark textarea:not([readonly]), .dark select { background: var(--surface) !important; border-color: var(--border) !important; color: var(--ink) !important; }
.dark input[readonly], .dark textarea[readonly] { color: var(--ink) !important; }
.dark input::placeholder, .dark textarea::placeholder { color: var(--muted) !important; }
.dark [class*="from-"][class*="to-"] { opacity: 0.3; }
.dark .card-hover:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.3); }

/* Base typography */
* { font-family: 'DM Sans', sans-serif; transition: background-color 0.2s ease, border-color 0.2s ease; }
h1, h2, h3, h4, h5, h6, .font-display { font-family: 'Outfit', sans-serif; }

/* Disable transition on entrance animations to prevent flash */
.animate-fade-up { transition: none !important; }

/* Entrance animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
  animation: fadeUp 0.5s ease-out forwards;
  opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d6d3d1; border-radius: 3px; }

/* Tag / pill */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #e7e5e4;
  color: #57534e;
  background: #fafaf9;
}
.tag-accent {
  border-color: #a7f3d0;
  color: #047857;
  background: #ecfdf5;
}

/* Card hover */
.card-hover {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-hover:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.featured-card.featured-card {
  border-color: transparent !important;
}
.featured-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(225deg, var(--accent) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 50;
}

/* ── Floating user pill (bottom-left) ── */
.user-pill {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 60;
  min-width: 220px;
  max-width: calc(100vw - 48px);
}
@media (max-width: 767px) {
  .user-pill { display: none !important; }
}

.user-card {
  padding: 10px 14px;
  border-radius: 999px;
  background:
    var(--sheen),
    color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0;
  cursor: pointer;
  transition: background-color 160ms ease;
  width: 100%;
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
}

.user-card.is-open { background-color: var(--surface); }
@media (hover: hover) {
  .user-card:hover { background-color: var(--surface); }
}

.user-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background:
    var(--sheen),
    color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 24px 60px -20px rgba(0, 0, 0, 0.35),
    0 8px 24px -12px rgba(0, 0, 0, 0.22);
  z-index: 70;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease;
}
.user-menu-item:hover { background: var(--surface-raised); }

/* Leading-icon micro-animations on hover — each item gets a fitting nudge. */
.user-menu-item > svg:first-child {
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}
.user-menu-item:hover > svg:first-child { transform: scale(1.12); }
.user-menu-item.umi-settings:hover > svg:first-child { transform: rotate(40deg); }
.user-menu-item.umi-messages > svg:first-child circle {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transition: opacity 200ms ease;
}
.user-menu-item.umi-messages:hover > svg:first-child { transform: none; }
.user-menu-item.umi-messages:hover > svg:first-child circle {
  animation: umi-typing 1s ease-in-out infinite;
}
.user-menu-item.umi-messages:hover > svg:first-child circle:nth-of-type(2) { animation-delay: 0.16s; }
.user-menu-item.umi-messages:hover > svg:first-child circle:nth-of-type(3) { animation-delay: 0.32s; }
@keyframes umi-typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-2px); opacity: 1; }
}
.user-menu-item.umi-saved > svg:first-child {
  fill: currentColor;
  fill-opacity: 0;
  transition: fill-opacity 450ms ease;
}
.user-menu-item.umi-saved:hover > svg:first-child { transform: none; fill-opacity: 1; }
.user-menu-item.umi-profile:hover > svg:first-child { transform: scale(1.16); }
/* Legal — the written lines are there at rest; hovering erases them and
   writes them back in from the left (second line staggered). */
.user-menu-item.umi-legal:hover > svg:first-child { transform: none; }
.user-menu-item.umi-legal > svg:first-child .umi-ln {
  transform-box: fill-box;
  transform-origin: left center;
}
.user-menu-item.umi-legal:hover > svg:first-child .umi-ln {
  animation: umi-rewrite 820ms ease;
}
.user-menu-item.umi-legal:hover > svg:first-child .umi-ln:nth-of-type(2) { animation-delay: 150ms; }
@keyframes umi-rewrite {
  0% { transform: scaleX(1); opacity: 1; }
  16% { transform: scaleX(1); opacity: 0; }
  17% { transform: scaleX(0); opacity: 0; }
  32% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}
.user-menu-item.umi-logout:hover > svg:first-child { transform: none; }
.user-menu-item.umi-logout > svg:first-child polyline,
.user-menu-item.umi-logout > svg:first-child line {
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.user-menu-item.umi-logout:hover > svg:first-child polyline,
.user-menu-item.umi-logout:hover > svg:first-child line {
  transform: translateX(3px);
}
/* Bookings — calendar holds still while a booked day pops onto the grid. */
.user-menu-item.umi-bookings:hover > svg:first-child { transform: none; }
.user-menu-item.umi-bookings > svg:first-child .umi-day {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.user-menu-item.umi-bookings:hover > svg:first-child .umi-day { transform: scale(1); }

/* My Listings — keep the icon still and ripple the four squares clockwise
   (top-left → top-right → bottom-right → bottom-left). DOM order of rects is
   TL, TR, BL, BR, so the delays skip to nth-of-type(4) before (3). */
.user-menu-item.umi-listings:hover > svg:first-child { transform: none; }
.user-menu-item.umi-listings > svg:first-child rect {
  transform-box: fill-box;
  transform-origin: center;
}
.user-menu-item.umi-listings:hover > svg:first-child rect {
  animation: umi-grid-pop 1.1s ease-in-out;
}
.user-menu-item.umi-listings:hover > svg:first-child rect:nth-of-type(1) { animation-delay: 0ms; }
.user-menu-item.umi-listings:hover > svg:first-child rect:nth-of-type(2) { animation-delay: 130ms; }
.user-menu-item.umi-listings:hover > svg:first-child rect:nth-of-type(4) { animation-delay: 260ms; }
.user-menu-item.umi-listings:hover > svg:first-child rect:nth-of-type(3) { animation-delay: 390ms; }
@keyframes umi-grid-pop {
  0%, 55%, 100% { transform: scale(1); opacity: 1; }
  28% { transform: scale(0.5); opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .user-menu-item > svg:first-child,
  .user-menu-item.umi-saved > svg:first-child,
  .user-menu-item.umi-messages > svg:first-child circle,
  .user-menu-item.umi-bookings > svg:first-child .umi-day,
  .user-menu-item.umi-legal > svg:first-child .umi-ln,
  .user-menu-item.umi-logout > svg:first-child polyline,
  .user-menu-item.umi-logout > svg:first-child line { transition: none; }
  .user-menu-item:hover > svg:first-child,
  .user-menu-item.umi-bookings:hover > svg:first-child .umi-day,
  .user-menu-item.umi-listings:hover > svg:first-child rect,
  .user-menu-item.umi-messages:hover > svg:first-child circle,
  .user-menu-item.umi-legal:hover > svg:first-child .umi-ln,
  .user-menu-item.umi-logout:hover > svg:first-child polyline,
  .user-menu-item.umi-logout:hover > svg:first-child line { transform: none; animation: none; }
}

/* Coming-soon modifier — greys the host element and floats a lock+SOON chip
   on the right. Works on any flex/inline-flex row (user-menu-item, button, etc). */
.is-coming-soon {
  position: relative;
  isolation: isolate;
  cursor: not-allowed;
  pointer-events: none;
}
.is-coming-soon > :not(.coming-soon-chip) {
  opacity: 0.4;
  filter: grayscale(1);
}
.is-coming-soon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--surface) 25%, transparent);
  pointer-events: none;
}
.coming-soon-chip {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink);
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 1;
  pointer-events: none;
  white-space: nowrap;
}
.coming-soon-chip svg {
  width: 11px;
  height: 11px;
  opacity: 0.8;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Logo (used in pill) */
.tutsy-logo { text-decoration: none; position: relative; }

/* Icon buttons (used in mobile sidebar dark-toggle) */
.nav-icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; background: transparent;
  transition: all 0.25s ease;
}
.nav-icon-btn:hover {
  background: var(--surface-raised);
  transform: translateY(-1px);
}
.nav-icon-btn:active { transform: translateY(1px) scale(0.85); transition-duration: 0.1s; }

/* Badge pulse */
.nav-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--paper);
  font-size: 10px; font-weight: 700;
  border-radius: 9999px; padding: 0 4px;
  animation: badgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes badgePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Hero gradient */
.hero-gradient {
  background: radial-gradient(ellipse 80% 60% at 50% -20%, #d1fae520 0%, transparent 70%);
}

/* Pricing card highlight */
.pricing-highlight {
  position: relative;
}
.pricing-highlight::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(135deg, #059669, #34d399);
  z-index: -1;
}

/* Toggle switch */
.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #d6d3d1;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}
.toggle-track.active { background: #059669; }
.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.toggle-track.active .toggle-thumb { transform: translateX(20px); }

/* ── Filter toggle buttons ── */
.filter-bar-actions {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.filter-toggle {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer; white-space: nowrap;
  transition: all 0.2s ease;
}
.filter-toggle:hover { background: var(--surface-raised); color: var(--ink); }
.filter-toggle.active { border-color: var(--accent); color: var(--accent); }
.filter-toggle.open { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }

.filter-bar-actions .filter-toggle,
.filter-toggle.filter-toggle-create {
  background: linear-gradient(135deg, var(--surface) 40%, color-mix(in srgb, #047857 40%, var(--surface)));
}
.filter-bar-actions .filter-toggle:hover,
.filter-toggle.filter-toggle-create:hover {
  background: linear-gradient(135deg, var(--surface-raised) 40%, color-mix(in srgb, #047857 50%, var(--surface-raised)));
}

/* Dropdown wrapper (anchors the floating panel to its toggle) */
.filter-toggle-wrap { position: relative; }

/* Frosted dropdown panel */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 320px;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: var(--frosted-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 40;
}
.filter-dropdown.open {
  opacity: 1;
  pointer-events: auto;
}
.filter-dropdown[data-panel="sort"],
.filter-dropdown[data-panel="filters"],
.filter-dropdown[data-panel="category"] {
  right: auto;
  left: 50%;
  margin-left: -70px;
}
.filter-dropdown[data-panel="filters"] {
  margin-left: -170px;
}
.filter-dropdown[data-panel="sort"],
.filter-dropdown[data-panel="category"] { min-width: 140px; }
.filter-dropdown[data-panel="filters"] { min-width: 340px; }

/* Subcategory panel — sibling of dropdown, inside toggle-wrap */
.filter-subcat-section {
  position: absolute;
  top: calc(100% + 8px);
  right: calc(50% + 78px);
  left: auto;
  min-width: 200px;
  padding: 16px;
  border-radius: 16px;
  background: var(--frosted-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.35), 0 8px 24px -12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 40;
}
.filter-subcat-section.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile: dropdowns become centered sheets */
@media (max-width: 768px) {
  .filter-bar-actions {
    transform: none;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
  }
  .filter-bar-actions .filter-toggle-wrap {
    display: flex;
    align-items: center;
  }
  .filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: auto;
    right: 0;
    min-width: 0;
    margin-left: 0;
    width: max-content;
    max-height: 70vh;
    overflow-y: auto;
  }
  .filter-dropdown[data-panel="filters"] {
    position: fixed;
    top: 123px;
    left: 50%;
    right: auto;
    margin-left: 0;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 340px;
  }
  .filter-dropdown[data-panel="category"] {
    left: auto;
    right: -50px;
    margin-left: 0;
  }
  .filter-subcat-section {
    position: absolute;
    top: calc(100% + 6px);
    left: auto;
    right: 120px;
    min-width: 150px;
    margin-left: 0;
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* Filter dropdown internal layout */
.filter-dropdown-section { margin-bottom: 14px; }
.filter-dropdown-section:last-child { margin-bottom: 0; }
.filter-dropdown-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.filter-dropdown-clear {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border-left: none; border-right: none; border-bottom: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.filter-dropdown-clear:hover { color: var(--accent); }

/* Price range slider */
.price-slider {
  padding: 4px 0 8px;
}
.price-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 12px;
}
.price-slider-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}
.price-slider-range {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}
.price-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: -7px;
  left: 0;
  width: 100%;
  height: 0;
  background: transparent;
  pointer-events: none;
  margin: 0;
  padding: 0;
  z-index: 3;
}
.price-slider-thumb::-webkit-slider-runnable-track {
  height: 0;
  background: transparent;
}
.price-slider-thumb::-moz-range-track {
  height: 0;
  background: transparent;
}
.price-slider-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.price-slider-thumb::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.price-slider-thumb::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.price-slider-thumb::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Chips inside dropdowns */
.filter-chip {
  padding: 6px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
  color: var(--muted); background: transparent;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s ease;
  text-align: center;
}
@media (min-width: 640px) {
  .filter-chip { padding: 8px 12px; font-size: 12px; }
}
.filter-chip:hover { background: var(--surface-raised); color: var(--ink); }
.filter-chip.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Icon chips (category grid) */
.filter-chip-icon {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 10px;
  font-size: 11px; font-weight: 500; line-height: 1.2;
  color: var(--muted); background: transparent;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s ease;
  text-align: center;
}
.filter-chip-icon:hover { background: var(--surface-raised); color: var(--ink); }
.filter-chip-icon.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* Stat counter */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* Animated SVG checkbox */
/* AI generate button */
.ai-gen-wrapper {
  position: relative;
  display: inline-block;
}
.ai-gen-btn {
  --border-radius: 24px;
  --padding: 4px;
  --transition: 0.4s;
  --button-color: #101010;
  --highlight-color-hue: 210deg;
  user-select: none;
  display: flex;
  justify-content: center;
  padding: 0.5em 0.5em 0.5em 1.1em;
  font-family: "Outfit", "DM Sans", sans-serif;
  font-size: 0.85em;
  font-weight: 400;
  background-color: var(--button-color);
  box-shadow:
    inset 0px 1px 1px rgba(255,255,255,0.2),
    inset 0px 2px 2px rgba(255,255,255,0.15),
    inset 0px 4px 4px rgba(255,255,255,0.1),
    inset 0px 8px 8px rgba(255,255,255,0.05),
    inset 0px 16px 16px rgba(255,255,255,0.05),
    0px -1px 1px rgba(0,0,0,0.02),
    0px -2px 2px rgba(0,0,0,0.03),
    0px -4px 4px rgba(0,0,0,0.05),
    0px -8px 8px rgba(0,0,0,0.06),
    0px -16px 16px rgba(0,0,0,0.08);
  border: solid 1px #fff2;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: box-shadow var(--transition), border var(--transition), background-color var(--transition);
}
.ai-gen-btn::before {
  content: "";
  position: absolute;
  top: calc(0px - var(--padding));
  left: calc(0px - var(--padding));
  width: calc(100% + var(--padding) * 2);
  height: calc(100% + var(--padding) * 2);
  border-radius: calc(var(--border-radius) + var(--padding));
  pointer-events: none;
  background-image: linear-gradient(0deg, #0004, #000a);
  z-index: -1;
  transition: box-shadow var(--transition), filter var(--transition);
  box-shadow:
    0 -8px 8px -6px #0000 inset,
    0 -16px 16px -8px #00000000 inset,
    1px 1px 1px #fff2,
    2px 2px 2px #fff1,
    -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.ai-gen-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  background-image: linear-gradient(
    0deg,
    #fff,
    hsl(var(--highlight-color-hue), 100%, 70%),
    hsla(var(--highlight-color-hue), 100%, 70%, 50%),
    8%,
    transparent
  );
  background-position: 0 0;
  opacity: 0;
  transition: opacity var(--transition), filter var(--transition);
}
.ai-gen-btn .btn-letter {
  position: relative;
  display: inline-block;
  color: #fff5;
  animation: ai-gen-letter 2s ease-in-out infinite;
  transition: color var(--transition), text-shadow var(--transition), opacity var(--transition);
}
@keyframes ai-gen-letter {
  50% { text-shadow: 0 0 3px #fff8; color: #fff; }
}
.ai-gen-btn .btn-svg {
  flex-grow: 1;
  height: 24px;
  margin-right: 0.5rem;
  fill: #e8e8e8;
  animation: ai-gen-flicker 2s linear infinite;
  animation-delay: 0.5s;
  filter: drop-shadow(0 0 2px #fff9);
  transition: fill var(--transition), filter var(--transition), opacity var(--transition);
}
@keyframes ai-gen-flicker {
  50% { opacity: 0.3; }
}
.ai-gen-btn .txt-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 6.4em;
}
.ai-gen-btn .txt-1,
.ai-gen-btn .txt-2 {
  position: absolute;
  word-spacing: -1em;
}
.ai-gen-btn .txt-1 {
  animation: ai-gen-appear 1s ease-in-out forwards;
}
.ai-gen-btn .txt-2 {
  opacity: 0;
}
@keyframes ai-gen-appear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.ai-gen-btn.generating .txt-1 {
  animation: ai-gen-opacity 0.3s ease-in-out forwards;
  animation-delay: 1s;
}
.ai-gen-btn.generating .txt-2 {
  animation: ai-gen-opacity 0.3s ease-in-out reverse forwards;
  animation-delay: 1s;
}
@keyframes ai-gen-opacity {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.ai-gen-btn.generating .btn-letter {
  animation:
    ai-gen-focused-letter 1s ease-in-out forwards,
    ai-gen-letter 1.2s ease-in-out infinite;
  animation-delay: 0s, 1s;
}
@keyframes ai-gen-focused-letter {
  0%, 100% { filter: blur(0px); }
  50% {
    transform: scale(2);
    filter: blur(10px) brightness(150%)
      drop-shadow(-36px 12px 12px hsl(var(--highlight-color-hue), 100%, 70%));
  }
}
.ai-gen-btn.generating .btn-svg {
  animation-duration: 1.2s;
  animation-delay: 0.2s;
}
.ai-gen-btn.generating::before {
  box-shadow:
    0 -8px 12px -6px #fff3 inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 20%) inset,
    1px 1px 1px #fff3,
    2px 2px 2px #fff1,
    -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.ai-gen-btn.generating::after {
  opacity: 0.6;
  mask-image: linear-gradient(0deg, #fff, transparent);
  filter: brightness(100%);
}
.ai-gen-btn .btn-letter:nth-child(1) { animation-delay: 0s; }
.ai-gen-btn .btn-letter:nth-child(2) { animation-delay: 0.08s; }
.ai-gen-btn .btn-letter:nth-child(3) { animation-delay: 0.16s; }
.ai-gen-btn .btn-letter:nth-child(4) { animation-delay: 0.24s; }
.ai-gen-btn .btn-letter:nth-child(5) { animation-delay: 0.32s; }
.ai-gen-btn .btn-letter:nth-child(6) { animation-delay: 0.4s; }
.ai-gen-btn .btn-letter:nth-child(7) { animation-delay: 0.48s; }
.ai-gen-btn .btn-letter:nth-child(8) { animation-delay: 0.56s; }
.ai-gen-btn .btn-letter:nth-child(9) { animation-delay: 0.64s; }
.ai-gen-btn .btn-letter:nth-child(10) { animation-delay: 0.72s; }
.ai-gen-btn.generating .btn-letter:nth-child(1) { animation-delay: 0s; }
.ai-gen-btn.generating .btn-letter:nth-child(2) { animation-delay: 0.08s; }
.ai-gen-btn.generating .btn-letter:nth-child(3) { animation-delay: 0.16s; }
.ai-gen-btn.generating .btn-letter:nth-child(4) { animation-delay: 0.24s; }
.ai-gen-btn.generating .btn-letter:nth-child(5) { animation-delay: 0.32s; }
.ai-gen-btn.generating .btn-letter:nth-child(6) { animation-delay: 0.4s; }
.ai-gen-btn.generating .btn-letter:nth-child(7) { animation-delay: 0.48s; }
.ai-gen-btn.generating .btn-letter:nth-child(8) { animation-delay: 0.56s; }
.ai-gen-btn.generating .btn-letter:nth-child(9) { animation-delay: 0.64s; }
.ai-gen-btn.generating .btn-letter:nth-child(10) { animation-delay: 0.72s; }
.ai-gen-btn:active {
  border: solid 1px hsla(var(--highlight-color-hue), 100%, 80%, 70%);
  background-color: hsla(var(--highlight-color-hue), 50%, 20%, 0.5);
}
.ai-gen-btn:active::before {
  box-shadow:
    0 -8px 12px -6px #fffa inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 80%) inset,
    1px 1px 1px #fff4,
    2px 2px 2px #fff2,
    -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.ai-gen-btn:active::after {
  opacity: 1;
  mask-image: linear-gradient(0deg, #fff, transparent);
  filter: brightness(200%);
}
.ai-gen-btn:active .btn-letter {
  text-shadow: 0 0 1px hsla(var(--highlight-color-hue), 100%, 90%, 90%);
  animation: none;
}
.ai-gen-btn:hover {
  border: solid 1px hsla(var(--highlight-color-hue), 100%, 80%, 40%);
}
.ai-gen-btn:hover::before {
  box-shadow:
    0 -8px 8px -6px #fffa inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 30%) inset,
    1px 1px 1px #fff2,
    2px 2px 2px #fff1,
    -1px -1px 1px #0002,
    -2px -2px 2px #0001;
}
.ai-gen-btn:hover::after {
  opacity: 1;
  mask-image: linear-gradient(0deg, #fff, transparent);
}
.ai-gen-btn:hover .btn-svg {
  fill: #fff;
  filter: drop-shadow(0 0 3px hsl(var(--highlight-color-hue), 100%, 70%))
    drop-shadow(0 -4px 6px #0009);
  animation: none;
}
.ai-gen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* AI loader */
.loader-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  font-size: 1.2em;
  font-weight: 300;
  color: var(--ink);
  border-radius: 50%;
  user-select: none;
}
.loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  animation: loader-rotate 2s linear infinite;
  z-index: 0;
}
@keyframes loader-rotate {
  0% {
    transform: rotate(90deg);
    box-shadow: 0 10px 20px 0 #fff inset, 0 20px 30px 0 #ad5fff inset, 0 60px 60px 0 #471eec inset;
  }
  50% {
    transform: rotate(270deg);
    box-shadow: 0 10px 20px 0 #fff inset, 0 20px 10px 0 #d60a47 inset, 0 40px 60px 0 #311e80 inset;
  }
  100% {
    transform: rotate(450deg);
    box-shadow: 0 10px 20px 0 #fff inset, 0 20px 30px 0 #ad5fff inset, 0 60px 60px 0 #471eec inset;
  }
}
.loader-letter {
  display: inline-block;
  opacity: 0.4;
  transform: translateY(0);
  animation: loader-letter-anim 2s infinite;
  z-index: 1;
}
.loader-letter:nth-child(1) { animation-delay: 0s; }
.loader-letter:nth-child(2) { animation-delay: 0.1s; }
.loader-letter:nth-child(3) { animation-delay: 0.2s; }
.loader-letter:nth-child(4) { animation-delay: 0.3s; }
.loader-letter:nth-child(5) { animation-delay: 0.4s; }
.loader-letter:nth-child(6) { animation-delay: 0.5s; }
.loader-letter:nth-child(7) { animation-delay: 0.6s; }
.loader-letter:nth-child(8) { animation-delay: 0.7s; }
.loader-letter:nth-child(9) { animation-delay: 0.8s; }
.loader-letter:nth-child(10) { animation-delay: 0.9s; }
@keyframes loader-letter-anim {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  20% { opacity: 1; transform: scale(1.15); }
  40% { opacity: 0.7; transform: translateY(0); }
}

/* Animated SVG checkbox */
.svg-checkbox { cursor: pointer; display: flex; align-items: center; }
.svg-checkbox svg { overflow: visible; }
.svg-checkbox .path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dasharray 0.5s ease, stroke-dashoffset 0.5s ease !important;
  stroke-dasharray: 241 9999999;
  stroke-dashoffset: 0;
}

/* ========================================
   Floating Pill Navbar (gpill-*)
   ======================================== */

:root {
  --gpill-dur: 600ms;
  --gpill-ease: cubic-bezier(.22, 1, .36, 1);
  --gpill-radius: 999px;
  --gpill-bg: color-mix(in srgb, var(--surface) 50%, transparent);
  --gpill-stroke: var(--border);
  --gpill-stroke-2: color-mix(in srgb, var(--ink) 12%, transparent);
  --gpill-fg: var(--ink);
  --gpill-muted: var(--muted);
  --gpill-inner: color-mix(in srgb, var(--ink) 4%, transparent);
}
.dark {
  --gpill-bg: color-mix(in srgb, var(--surface) 55%, transparent);
  --gpill-stroke: color-mix(in srgb, var(--ink) 10%, transparent);
  --gpill-stroke-2: color-mix(in srgb, var(--ink) 16%, transparent);
  --gpill-inner: color-mix(in srgb, var(--ink) 6%, transparent);
}

.gpill-wrap {
  position: sticky;
  top: 16px;
  z-index: 50;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 16px;
  margin-bottom: 24px;
  pointer-events: none;
}
.gpill-wrap > * { pointer-events: auto; }

.gpill {
  position: relative;
  height: 56px;
  background: var(--sheen), var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0;
  border-radius: var(--gpill-radius);
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
  overflow: hidden;
  will-change: width;
  transition: width var(--gpill-dur) var(--gpill-ease);
}

.gpill-layer {
  position: absolute;
  inset: 8px;
  pointer-events: none;
}
.gpill-layer > * { pointer-events: auto; }

.gpill-slot {
  position: absolute;
  top: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform, opacity;
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    opacity calc(var(--gpill-dur) * 0.55) var(--gpill-ease);
}

.gpill-logo {
  gap: 10px;
  padding: 0 14px 0 8px;
  text-decoration: none;
  color: var(--gpill-fg);
}
.gpill-logo .gpill-mark {
  width: 24px; height: 24px;
  flex: 0 0 auto;
  background: var(--ink);
  -webkit-mask: url("/static/img/logo-mark.3296278ef2e2.svg") center / contain no-repeat;
          mask: url("/static/img/logo-mark.3296278ef2e2.svg") center / contain no-repeat;
}
.gpill-logo .gpill-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 16px;
  line-height: 1;
}

.gpill-search {
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: var(--gpill-radius);
  padding: 0 16px;
  gap: 10px;
  color: var(--gpill-muted);
  will-change: transform, opacity, width;
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    opacity calc(var(--gpill-dur) * 0.55) var(--gpill-ease);
}
.gpill-search .gpill-ico { color: var(--gpill-muted); flex: 0 0 auto; display: inline-flex; }
.gpill-search input,
.dark .gpill-search input:not([readonly]) {
  flex: 1 1 auto;
  background: transparent !important;
  border: 0 !important;
  outline: none;
  color: var(--gpill-fg) !important;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  min-width: 0;
}
.gpill-search input::placeholder,
.dark .gpill-search input::placeholder { color: var(--gpill-muted) !important; }

.gpill-fbtn {
  position: absolute;
  top: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: var(--gpill-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
  padding: 0;
  will-change: transform, width;
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    width var(--gpill-dur) var(--gpill-ease),
    background-color 160ms ease,
    color 160ms ease;
  overflow: hidden;
}
.gpill-fbtn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.gpill-fbtn:active { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.gpill-fbtn.is-active { color: var(--accent); }
.gpill-fbtn .gpill-ico {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  color: currentColor;
}
.gpill-fbtn .gpill-label {
  display: inline-block;
  padding-right: 14px;
  line-height: 1;
  transition: opacity calc(var(--gpill-dur) * 0.5) var(--gpill-ease);
  will-change: opacity;
}
.gpill[data-compact="1"] .gpill-fbtn .gpill-label,
.gpill[data-compact="1"] .gpill-create .gpill-label {
  display: none;
}

.gpill-create {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gpill-fg);
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    opacity calc(var(--gpill-dur) * 0.55) var(--gpill-ease),
    background-color 160ms ease;
  will-change: transform, opacity;
}
.gpill-create:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.gpill-create .gpill-ico {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
}
.gpill-create .gpill-label { display: inline-block; padding-right: 14px; line-height: 1; }

.gpill-link {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--gpill-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform var(--gpill-dur) var(--gpill-ease), opacity calc(var(--gpill-dur) * 0.55) var(--gpill-ease);
}
.gpill-link:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.gpill-link.is-active { color: var(--accent); font-weight: 600; }

.gpill-divider {
  position: absolute;
  top: 10px;
  width: 1px;
  height: 20px;
  background: var(--gpill-stroke-2);
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    opacity calc(var(--gpill-dur) * 0.5) var(--gpill-ease);
  will-change: transform, opacity;
}

.gpill-icon-btn-wrap {
  position: absolute;
  top: 0;
  width: 40px; height: 40px;
  pointer-events: auto;
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    opacity calc(var(--gpill-dur) * 0.55) var(--gpill-ease);
  will-change: transform, opacity;
}

.gpill-icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: transparent;
  color: var(--gpill-fg);
  border: 0;
  cursor: pointer;
  position: relative;
  transition: background-color 160ms ease;
}
.gpill-icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.gpill-icon-btn.is-bare {
  position: absolute;
  top: 0;
  transition:
    transform var(--gpill-dur) var(--gpill-ease),
    opacity calc(var(--gpill-dur) * 0.55) var(--gpill-ease),
    background-color 160ms ease;
  will-change: transform, opacity;
}

.gpill-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--paper);
  font-size: 9px; font-weight: 700;
  border-radius: 9999px; padding: 0 4px;
  pointer-events: none;
}

.gpill-signin {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gpill-signin:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.18); }

.gpill[data-state="collapsed"] .gpill-logo,
.gpill[data-state="collapsed"] .gpill-search,
.gpill[data-state="collapsed"] .gpill-create,
.gpill[data-state="collapsed"] .gpill-divider,
.gpill[data-state="collapsed"] .gpill-icon-btn-wrap,
.gpill[data-state="collapsed"] .gpill-icon-btn.is-bare {
  opacity: 0;
  pointer-events: none;
}
.gpill[data-state="collapsed"] .gpill-fbtn .gpill-label {
  opacity: 0;
}

.gpill-mbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}
.gpill-mbar-left,
.gpill-mbar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.gpill-mbar-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 20px;
  line-height: 1;
  color: var(--gpill-fg);
  text-decoration: none;
  background: var(--sheen), var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0;
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
  transition: background-color 160ms ease;
}
.gpill-mbar-logo:hover { background-color: color-mix(in srgb, var(--ink) 10%, transparent); }
.gpill-mbar-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--sheen), var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0;
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
  color: var(--gpill-fg);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 160ms ease;
}
@media (hover: hover) {
  .gpill-mbar-btn:hover { background-color: color-mix(in srgb, var(--ink) 10%, transparent); }
}
.gpill-mbar-btn.gpill-mbar-create {
  width: auto;
  gap: 6px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
}
.gpill-mbar-create-label { line-height: 1; white-space: nowrap; }

.gpill-mbar-create svg,
.gpill-mbar-btn[data-modal-open="notifications"] svg {
  transition: transform 320ms cubic-bezier(0.34, 1.3, 0.5, 1);
}
.gpill-mbar-btn[data-modal-open="messages"] svg {
  fill: currentColor;
  fill-opacity: 0;
  transition: fill-opacity 340ms ease;
}
@media (hover: hover) {
  .gpill-mbar-create:hover svg { transform: rotate(90deg); }
  .gpill-mbar-btn[data-modal-open="notifications"]:hover svg {
    transform-origin: 50% 3px;
    animation: gpill-icon-swing 700ms ease;
  }
  .gpill-mbar-btn[data-modal-open="messages"]:hover svg { fill-opacity: 1; }
}
@keyframes gpill-icon-swing {
  20% { transform: rotate(14deg); }
  45% { transform: rotate(-10deg); }
  70% { transform: rotate(6deg); }
  100% { transform: rotate(0); }
}

.gpill-result-head { display: none; }
.gpill-result-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.gpill-result-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}
.gpill-result-meta {
  font-size: 12px;
  color: var(--muted);
}
.gpill-result-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.gpill-result-clear {
  font-size: 11px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0 0 0 4px;
  cursor: pointer;
}
.gpill-result-clear:hover { color: var(--ink); }
.gpill-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 16px;
  font-size: 14px;
  color: var(--ink);
  background: var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--gpill-stroke);
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.gpill-chip:hover { border-color: var(--accent); }
.gpill-chip-logo {
  border: 0;
  background: var(--sheen), var(--gpill-bg);
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
}
.gpill-chip-logo:hover { border-color: transparent; }
.gpill-chip-static { cursor: default; color: var(--muted); }
.gpill-chip-static:hover { border-color: var(--border); }
.gpill-chip-action { padding: 0 14px; color: var(--muted); }
.gpill-chip-action:hover { color: var(--ink); }
.gpill-chip-logo { padding: 0 14px; text-decoration: none; color: var(--ink); }
.gpill-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.gpill-chip:hover .gpill-chip-x { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.auth-tutsy-pill {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  margin-bottom: 24px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  background: var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--gpill-stroke);
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
}
.auth-tutsy-pill span,
.gpill-mbar-logo span,
.gpill-logo .gpill-name,
.gpill-chip-logo span {
  display: inline-block;
  background: linear-gradient(
    105deg,
    var(--gpill-fg) 0%,
    var(--gpill-fg) 20%,
    rgba(255,255,255,0.4) 32%,
    #ffffff 42%,
    #ffffff 58%,
    rgba(255,255,255,0.4) 68%,
    var(--gpill-fg) 80%,
    var(--gpill-fg) 100%
  );
  background-size: 350% 100%;
  background-position: 110% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: background-position 950ms cubic-bezier(0.34, 1.56, 0.64, 1),
              letter-spacing 400ms ease,
              filter 400ms ease;
}
.auth-tutsy-pill:hover span,
.gpill-mbar-logo:hover span,
.gpill-logo:hover .gpill-name,
.gpill-chip-logo:hover span {
  background-position: -40% 0;
  letter-spacing: 0.04em;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
}
.gpill-mbar-signin {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gpill-fg);
  text-decoration: none;
  background: var(--sheen), var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 0;
  border-radius: 999px;
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: background-color 160ms ease;
}
.gpill-mbar-signin:hover { background-color: color-mix(in srgb, var(--ink) 10%, transparent); }
.listing-tile {
  height: 160px;
  background: var(--surface) !important;
}
.listing-tile-image {
  width: 213px;
  align-self: stretch;
  background: var(--surface);
}
.listing-tile-price {
  font-size: 34px;
  align-self: stretch;
}
@media (max-width: 767px) {
  .listing-tile { height: 110px; }
  .listing-tile-image { width: 110px; }
  .listing-tile-price { font-size: 22px; padding-left: 14px; padding-right: 14px; }
}
.listing-tile-name {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
}

.listing-tile.is-inactive {
  border-style: dashed !important;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-raised) 100%) !important;
}
.listing-tile.is-inactive .listing-tile-image img,
.listing-tile.is-inactive .listing-tile-image .listing-placeholder,
.listing-tile.is-inactive .listing-tile-price {
  filter: grayscale(100%) contrast(0.92);
  opacity: 1 !important;
}
.listing-tile.is-inactive .listing-body {
  filter: grayscale(100%) contrast(0.92);
}
.listing-tile.is-inactive::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,251,247,0.04) 0%, rgba(120,113,108,0.16) 100%);
  pointer-events: none;
  z-index: 1;
}
.dark .listing-tile.is-inactive::after {
  background: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.30) 100%);
}

/* Tile-wide overflow visible — image needs to pop out on hover, ribbon needs to peek */
.listing-tile { overflow: visible; }
.listing-tile[data-saved] .listing-tile-price { overflow: visible; }

/* Desktop hover: image scales up from its center, body content gets frosted veil,
   action buttons appear over the body area only. Price column and saved ribbon stay sharp. */
@media (min-width: 768px) {
  .listing-tile .listing-tile-image {
    transform-origin: center center;
    transition: transform 260ms cubic-bezier(0.3, 0.7, 0.2, 1),
                box-shadow 260ms ease;
  }
  .listing-tile:hover .listing-tile-image {
    transform: scale(1.12);
    box-shadow:
      0 18px 40px -12px rgba(0, 0, 0, 0.32),
      0 6px 14px -6px rgba(0, 0, 0, 0.18);
    z-index: 6;
  }

  .listing-tile-body-veil {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
    opacity: 0;
    transition: opacity 280ms ease;
    pointer-events: none;
    z-index: 4;
  }
  .listing-tile:hover .listing-tile-body-veil { opacity: 1; }

  .listing-tile-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    opacity: 0;
    pointer-events: none;
    z-index: 22;
    transition: opacity 260ms ease;
  }
  .listing-tile:hover .listing-tile-actions {
    opacity: 1;
    transition-delay: 100ms;
  }
  .listing-tile:hover .listing-tile-actions > * { pointer-events: auto; }
}

/* Saved-listing ribbon — slim accent tab in price column, peeks above top edge */
.listing-saved-ribbon {
  position: absolute;
  top: -2px;
  right: 18px;
  width: 12px;
  height: 0;
  background: #f59e0b;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 65%, 0 100%);
  z-index: 51;
  pointer-events: none;
  transition: height 260ms cubic-bezier(0.55, 0, 0.55, 1);
}
.listing-tile[data-saved] .listing-saved-ribbon {
  height: 24px;
  transition: height 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.listing-inactive-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  white-space: nowrap;
}
.dark .listing-inactive-chip {
  background: rgba(28,25,23,0.72);
}
.listing-inactive-chip .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 22%, transparent);
}

.listing-fresh-pill {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rank-hue) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--rank-hue) 42%, transparent);
  color: var(--rank-ink);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .listing-fresh-pill { display: inline-flex; }
}
.listing-fresh-pill svg {
  width: 11px;
  height: 11px;
}

/* Podium tiers: gold (1st), silver (2nd), bronze (3rd). */
.listing-fresh-pill--rank-1 { --rank-hue: #f5b50a; --rank-ink: #946a00; }
.listing-fresh-pill--rank-2 { --rank-hue: #9aa6b4; --rank-ink: #5b6571; }
.listing-fresh-pill--rank-3 { --rank-hue: #cd7f43; --rank-ink: #8a4a20; }
.listing-fresh-pill--fast   { --rank-hue: #0ea5e9; --rank-ink: #0369a1; }
.dark .listing-fresh-pill--rank-1 { --rank-ink: #f0c44c; }
.dark .listing-fresh-pill--rank-2 { --rank-ink: #c3cdd9; }
.dark .listing-fresh-pill--rank-3 { --rank-ink: #e0a06a; }
.dark .listing-fresh-pill--fast   { --rank-ink: #5cc6f5; }
.dark .listing-fresh-pill {
  background: color-mix(in srgb, var(--rank-hue) 20%, transparent);
  border-color: color-mix(in srgb, var(--rank-hue) 38%, transparent);
}

/* Mobile drawer: the rank badge moves into a strip tucked beneath the tile
   (the inline badge beside the subcategory is desktop-only). */
.listing-tile-wrap { position: relative; }
.listing-tile-wrap > .listing-tile { z-index: 2; }
.listing-drawer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: -10px auto 0;
  padding: 13px 16px 4px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, var(--surface-raised) 0%, var(--surface) 100%);
}
.listing-drawer .listing-fresh-pill {
  display: inline-flex;
  padding: 0;
  background: none;
  border: 0;
}
@media (min-width: 768px) {
  .listing-drawer { display: none; }
}

.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  white-space: nowrap;
}
.freshness-badge .freshness-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
.freshness-badge .freshness-label { display: none; }
@media (min-width: 768px) {
  .freshness-badge .freshness-label { display: inline; }
}
.freshness-badge .freshness-value {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.freshness-badge .freshness-max { color: var(--muted); font-weight: 500; }
.freshness-badge.is-fresh { color: #15803d; }
.freshness-badge.is-mid   { color: #b45309; }
.freshness-badge.is-stale { color: #b91c1c; }
.dark .freshness-badge { background: rgba(28,25,23,0.72); }

.gpill-wrap { top: 8px; margin-bottom: 8px; }
.gpill-wrap:has(.gpill[data-mode="dashboard"]) { display: none; }
.gpill[data-mode="listings"] .gpill-logo,
.gpill[data-mode="dashboard"] .gpill-logo,
.gpill .gpill-divider,
.gpill .gpill-icon-btn-wrap,
.gpill .gpill-icon-btn.is-bare,
.gpill #dark-toggle,
.gpill .gpill-create,
.gpill .gpill-signin {
  display: none !important;
}

.gpill {
  width: 100% !important;
}
.gpill .gpill-layer {
  position: static;
  inset: auto;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.gpill .gpill-slot,
.gpill .gpill-fbtn {
  position: static !important;
  transform: none !important;
}
.gpill .gpill-search {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0;
}
.gpill .gpill-fbtn {
  flex: 0 0 auto;
  justify-content: center;
}
.gpill .gpill-link {
  flex: 1 1 auto;
  justify-content: center;
}

@media (max-width: 767px) {
  .gpill-mbar-desktop-only { display: none !important; }
  .gpill .gpill-fbtn .gpill-label { display: none !important; }
  .gpill .gpill-fbtn {
    flex: 0 0 40px;
    width: 40px !important;
  }
  .gpill-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: transparent;
    pointer-events: none;
  }
  .gpill-topbar > * { pointer-events: auto; }
  .gpill-mbar-logo {
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    background: var(--sheen), var(--gpill-bg);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 0;
    border-radius: 999px;
    box-shadow:
      0 1px 0 var(--sheen-edge) inset,
      0 12px 32px -14px rgba(0,0,0,0.45),
      0 2px 10px -3px rgba(0,0,0,0.25);
  }
  .gpill-wrap {
    position: static;
    top: auto;
    margin-bottom: 16px;
  }
}

@media (min-width: 768px) {
  .gpill-mbar-logo { display: none !important; }
  .gpill-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 24px;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    pointer-events: none;
  }
  .gpill-topbar > * { pointer-events: auto; }
  .gpill-result-head {
    display: block;
    position: absolute;
    left: 24px;
    top: 16px;
    max-width: calc(50% - 280px);
  }
  .gpill-mbar {
    display: flex;
    align-items: flex-start;
    position: absolute;
    right: 24px;
    top: 16px;
    padding: 0;
    margin: 0;
    width: auto;
    max-width: none;
  }
  .gpill-mbar-left { display: none !important; }
  .gpill-wrap {
    width: 100%;
    max-width: 36rem;
    position: static;
    top: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  .gpill { max-width: 100%; width: 100%; box-sizing: border-box; }
}

@media (prefers-reduced-motion: reduce) {
  .gpill, .gpill-slot, .gpill-fbtn, .gpill-fbtn .gpill-label,
  .gpill-create, .gpill-divider, .gpill-icon-btn, .gpill-icon-btn-wrap {
    transition-duration: 0ms !important;
  }
}

/* Pill modals (sort / filters / category) */
.gpill-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 88px 16px 16px;
  background: color-mix(in srgb, #000 35%, transparent);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
}
.gpill-modal-backdrop.open { display: flex; }

.gpill-modal {
  position: relative;
  background: var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--gpill-stroke);
  border-radius: 20px;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.5), 0 4px 12px -4px rgba(0,0,0,0.25);
  animation: gpillModalIn 220ms var(--gpill-ease);
}
@keyframes gpillModalIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gpill-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.gpill-modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.gpill-modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.gpill-modal-close:hover { background: var(--surface-raised); color: var(--ink); }

.gpill-scroll-top {
  background:
    var(--sheen),
    color-mix(in srgb, var(--surface) 35%, transparent) !important;
  color: var(--gpill-fg) !important;
  border: 0 !important;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 8px 24px -10px rgba(0,0,0,0.35);
  transition: background-color 160ms ease;
}
@media (hover: hover) {
  .gpill-scroll-top:hover {
    background-color: color-mix(in srgb, var(--ink) 12%, transparent) !important;
  }
}

.floating-scroll-up {
  opacity: 0;
  transform: translateY(12px) scale(.85);
  pointer-events: none;
  transition: opacity 240ms ease, transform 320ms cubic-bezier(.2,.7,.3,1);
}
.floating-scroll-up.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

[x-cloak] { display: none !important; }

.support-popover {
  background:
    var(--sheen),
    color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  color: var(--ink);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 24px 60px -20px rgba(0, 0, 0, 0.35),
    0 8px 24px -12px rgba(0, 0, 0, 0.22);
}

.support-chip {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease;
}
.support-chip:hover {
  background: var(--surface-raised);
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
}
.support-chip:active { transform: scale(0.98); }
.support-chip.is-selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.support-composer { overflow: hidden; }
.support-composer:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
}
.support-textarea {
  resize: none !important;
  overflow: auto;
  font-family: inherit;
  color: var(--ink);
}

.support-send {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease, opacity 160ms ease;
}
.support-send:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 88%, transparent);
}
.support-send:active:not(:disabled) { transform: scale(0.97); }
.support-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}


.gpill-modal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.gpill-modal-back:hover { background: var(--surface-raised); }
.gpill-modal-back svg { color: var(--muted); }

.gpill-modal-backdrop[data-step="category"] [data-step-show="subcategory"] { display: none; }
.gpill-modal-backdrop[data-step="subcategory"] [data-step-show="category"] { display: none; }

.gpill-modal.gpill-modal-list {
  width: 100%;
  max-width: min(420px, calc(100vw - 32px));
}

.gpill-modal.gpill-modal-cat {
  width: auto;
  max-width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.cat-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: flex-start;
}
.cat-col { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 0; }
.cat-subs { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; border-top: 1px solid var(--gpill-stroke); }
.cat-subs .filter-chip { text-align: left; padding: 6px 10px; }
.cat-all-btn {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--gpill-stroke);
  cursor: pointer;
  transition: all 0.15s ease;
}
.cat-all-btn:hover { background: var(--surface-raised); color: var(--ink); }
.cat-all-btn.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }

.gpill-modal .filter-subcat-section {
  position: static;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  min-width: 0;
  opacity: 1;
  pointer-events: auto;
  max-height: none;
}

@media (prefers-reduced-motion: reduce) {
  .gpill-modal { animation: none; }
}

/* Listing form progress checklist */
.progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  position: relative;
  flex-shrink: 0;
  transition: background 150ms ease, border-color 150ms ease;
}
[data-progress-item].is-done .progress-dot {
  background: var(--accent);
  border-color: var(--accent);
}
[data-progress-item].is-done .progress-dot::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
[data-progress-item].is-done > span:not(.progress-dot):not(.ml-auto) {
  color: var(--ink);
}

#listing-preview-modal {
  align-items: center;
  padding: 16px 0;
}

@media (max-width: 767px) {
  [data-preview-pane="desktop"] {
    position: relative;
    height: calc(100vh - 180px);
    max-height: 760px;
    overflow: hidden;
  }
  [data-preview-pane="desktop"] > div {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100vh - 220px);
    max-width: 720px;
    flex: none;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }
}

/* ==========================================================================
   Search Pill — unified searchbar + filters + category mega-menu
   ========================================================================== */

:root {
  --sp-bg: var(--gpill-inner);
  --sp-border: var(--gpill-stroke);
  --sp-border-hover: var(--gpill-stroke-2);
  --sp-fg: var(--gpill-fg);
  --sp-mute: var(--gpill-muted);
  --sp-accent: var(--accent);
  --sp-card: color-mix(in srgb, var(--ink) 4%, transparent);
  --sp-line: color-mix(in srgb, var(--ink) 10%, transparent);
  --sp-line-2: color-mix(in srgb, var(--ink) 16%, transparent);
}
.dark {
  --sp-card: rgba(255,255,255,0.04);
  --sp-line: rgba(255,255,255,0.08);
  --sp-line-2: rgba(255,255,255,0.14);
}

.gpill-searchpill {
  position: relative;
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px;
  border-radius: var(--gpill-radius);
  background: var(--sheen), var(--gpill-bg);
  border: 0;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
  color: var(--gpill-fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  transition:
    width 440ms cubic-bezier(.22, .68, .32, 1),
    border-color 320ms ease,
    background-color 320ms ease,
    box-shadow 380ms ease,
    opacity 220ms ease-out,
    transform 220ms ease-out;
}
.gpill-searchpill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    260px 130px at var(--sp-mx, 50%) var(--sp-my, 50%),
    color-mix(in srgb, var(--accent) 26%, transparent) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
  z-index: 0;
}
.gpill-searchpill > * { position: relative; z-index: 1; }
.gpill-searchpill:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background-color: color-mix(in srgb, var(--accent) 5%, var(--gpill-bg));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent),
    0 24px 60px -22px color-mix(in srgb, var(--accent) 50%, transparent),
    0 2px 10px -3px rgba(0,0,0,0.25);
}
.gpill-searchpill:hover::before { opacity: 1; }
.gpill-searchpill:hover .sp-ico { color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.gpill-searchpill:hover .sp-kbd {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--sp-line));
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}
.gpill-searchpill.is-active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.gpill-searchpill.is-hidden {
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  pointer-events: none;
}

/* When the search-pill is present, the outer .gpill is just a layout container — strip its pill chrome */
.gpill:has(.gpill-searchpill) {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  height: auto;
  overflow: visible;
}
.gpill:has(.gpill-searchpill) .gpill-layer { padding: 0; }
.gpill-searchpill .sp-ico { color: var(--sp-mute); display: inline-flex; flex: 0 0 auto; }
.gpill-searchpill.is-active .sp-ico { color: var(--accent); }
.gpill-searchpill .sp-label {
  color: var(--sp-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-weight: 500;
  transition: opacity 220ms ease, filter 220ms ease, color 220ms ease;
}
.gpill-searchpill .sp-label.is-swapping { opacity: 0; filter: blur(7px); }
.gpill-searchpill.is-active .sp-label { color: var(--accent); }
.gpill-searchpill .sp-counter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--sp-mute);
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  white-space: nowrap;
  min-height: 22px;
}


/* ---------- Clear-all-filters button ---------- */
.gpill .gpill-searchpill { position: relative !important; z-index: 2; }
.gpill-searchwrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}
.gpill-clearfilters {
  display: none;
  opacity: 0;
  transform: translateX(-64px);
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 8px;
  z-index: 1;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: var(--gpill-radius);
  background: var(--sheen), var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 1px 0 var(--sheen-edge) inset,
    0 12px 32px -14px rgba(0,0,0,0.45),
    0 2px 10px -3px rgba(0,0,0,0.25);
  color: var(--sp-mute);
  cursor: pointer;
  transition:
    opacity 440ms cubic-bezier(.22,.68,.32,1),
    transform 440ms cubic-bezier(.22,.68,.32,1),
    color 220ms ease,
    background-color 320ms ease,
    box-shadow 380ms ease,
    display 440ms allow-discrete;
}
.gpill-clearfilters svg { width: 18px; height: 18px; }
.gpill-searchpill.is-active ~ .gpill-clearfilters {
  display: inline-flex;
  opacity: 1;
  transform: translateX(0);
}
@starting-style {
  .gpill-searchpill.is-active ~ .gpill-clearfilters {
    opacity: 0;
    transform: translateX(-64px);
  }
}
.gpill-searchpill.is-active.is-hidden ~ .gpill-clearfilters {
  opacity: 0;
  transform: translateX(-64px);
  pointer-events: none;
}
.gpill-clearfilters:hover {
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  background-color: color-mix(in srgb, var(--accent) 5%, var(--gpill-bg));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent),
    0 24px 60px -22px color-mix(in srgb, var(--accent) 50%, transparent),
    0 2px 10px -3px rgba(0,0,0,0.25);
}
@media (prefers-reduced-motion: reduce) {
  .gpill-clearfilters { transition: none; }
}

@media (max-width: 767px) {
  .gpill-searchwrap {
    flex: 1 1 100%;
    width: 100%;
    transition: margin-right 380ms cubic-bezier(.4, 0, .2, 1);
  }
  .gpill-searchwrap:has(.gpill-searchpill.is-active) { margin-right: 64px; }
  .gpill-searchpill { width: 100%; flex: 1 1 auto; }
}

/* ---------- Mega-menu shell ---------- */
.sp-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: var(--gpill-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--sp-line-2);
  border-radius: 20px;
  box-shadow: 0 24px 80px -16px rgba(0,0,0,0.5), 0 4px 12px -4px rgba(0,0,0,0.25);
  overflow: hidden;
  color: var(--ink);
  animation: sp-morph-in 300ms cubic-bezier(.2,.85,.3,1) both;
  transform-origin: top center;
}
@keyframes sp-morph-in {
  0%   { opacity: 0; transform: translateY(-8px) scaleX(.85) scaleY(.92); }
  40%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scaleX(1) scaleY(1); }
}
.gpill-modal-backdrop.is-closing .sp-modal {
  animation: sp-morph-out 160ms cubic-bezier(.4,0,.7,.5) both;
  transform-origin: top center;
}
@keyframes sp-morph-out {
  0%   { opacity: 1; transform: translateY(0) scaleX(1) scaleY(1); }
  100% { opacity: 0; transform: translateY(-8px) scaleX(.85) scaleY(.92); }
}
.gpill-modal-backdrop.sp-backdrop.is-closing {
  animation: sp-backdrop-out 180ms ease-out both;
}
@keyframes sp-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.gpill-modal-backdrop.sp-backdrop {
  padding: 80px 16px 16px;
  align-items: flex-start;
}

.sp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sp-line);
}
.sp-search-ico { color: var(--sp-mute); display: inline-flex; flex: 0 0 auto; }
.sp-search input,
.dark .sp-search input:not([readonly]) {
  flex: 1 1 auto;
  background: transparent !important;
  border: 0 !important;
  outline: 0;
  color: var(--ink) !important;
  font: inherit;
  font-size: 16px;
  padding: 0;
  caret-color: var(--accent);
  min-width: 0;
}
.sp-search input::placeholder { color: var(--sp-mute) !important; }
.sp-esc-key {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--sp-mute);
  border: 1px solid var(--sp-line);
  border-radius: 4px;
  padding: 2px 6px;
  line-height: 1;
  cursor: pointer;
}

/* horizontal pill row (Sort/Price/Rating) */
.sp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--sp-line);
}
.sp-row-label {
  flex: 0 0 64px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sp-mute);
  font-weight: 600;
}
.sp-row-pills {
  flex: 1 1 auto;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  padding: 2px 4px;
}
.sp-row-pills::-webkit-scrollbar { display: none; }

.sp-chip {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 200ms ease, color 220ms ease;
}
.sp-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0;
  transform: scale(0.7);
  transform-origin: center;
  pointer-events: none;
  z-index: -1;
}
.sp-chip:hover:not(.active) { border-color: var(--sp-line-2); }
.sp-chip.active {
  color: var(--accent);
  border-color: transparent;
}
.sp-chip.active::before { opacity: 1; transform: scale(1); }
.sp-chip.is-activating::before {
  animation: sp-chip-activate 460ms cubic-bezier(.4,0,.2,1) both;
}
.sp-chip.is-deactivating::before {
  animation: sp-chip-deactivate 360ms cubic-bezier(.4,0,.2,1) both;
}
@keyframes sp-chip-activate {
  0%   { opacity: 0; transform: scale(0.92); filter: saturate(0.6); }
  55%  { opacity: 1; transform: scale(1.06); filter: saturate(1); }
  100% { opacity: 1; transform: scale(1);    filter: saturate(1); }
}
@keyframes sp-chip-deactivate {
  0%   { opacity: 1; transform: scale(1);    filter: saturate(1); }
  40%  { opacity: 0.6; transform: scale(0.94); filter: saturate(0.6); }
  100% { opacity: 0; transform: scale(0.9);  filter: saturate(1); }
}
@media (prefers-reduced-motion: reduce) {
  .sp-chip.is-activating::before,
  .sp-chip.is-deactivating::before { animation: none; }
}

/* Category section */
.sp-cat-section {
  padding: 14px 14px 12px;
}
.sp-cat-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sp-mute);
  margin: 0 0 10px 4px;
  font-weight: 600;
}

.sp-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  animation: sp-fade-in 260ms ease-out both;
}
@media (max-width: 640px) {
  .sp-cat-grid { grid-template-columns: repeat(2, 1fr); }
}

.sp-cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--sp-line);
  background: var(--sp-card);
  cursor: pointer;
  min-width: 0;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.sp-cat-card:hover { border-color: var(--sp-line-2); }
.sp-cat-tile {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--cat-tint, rgba(255,255,255,0.06));
  border: 1px solid var(--cat-border, var(--sp-line));
  color: var(--cat-color, var(--ink));
}
.sp-cat-tile svg { width: 60%; height: 60%; }
.sp-cat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-cat-name {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-cat-meta {
  display: block;
  font-size: 11px;
  color: var(--sp-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

/* Expanded category panel (B3) */
.sp-cat-expanded {
  background: var(--cat-tint, color-mix(in srgb, var(--accent) 8%, transparent));
  border: 1px solid var(--cat-border, color-mix(in srgb, var(--accent) 28%, transparent));
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
  min-height: 130px;
  transition: background 600ms ease, border-color 600ms ease;
  opacity: 1;
}
.sp-cat-expanded.is-entering { animation: sp-fade-in 340ms ease-out both 100ms; }
.sp-cat-expanded.is-closing { animation: sp-fade-out 220ms ease-out both; }
.sp-cat-expanded.is-blooming { animation: sp-bloom 600ms ease both; }
@keyframes sp-bloom {
  0%   { filter: brightness(1) saturate(1); }
  45%  { filter: brightness(1.4) saturate(1.6); }
  100% { filter: brightness(1) saturate(1); }
}

.sp-cat-content-out {
  position: absolute;
  inset: 14px;
  pointer-events: none;
  animation: sp-fade-out 220ms ease-out both;
}
.sp-content-in {
  animation: sp-content-in 460ms cubic-bezier(.2,.7,.3,1) both;
  animation-delay: 180ms;
  opacity: 0;
}
.sp-content-in-late {
  animation: sp-content-in 460ms cubic-bezier(.2,.7,.3,1) both;
  animation-delay: 220ms;
  opacity: 0;
}
@keyframes sp-content-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sp-cat-expanded-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sp-cat-expanded-header .sp-cat-tile { width: 48px; height: 48px; }
.sp-cat-expanded-title {
  flex: 1;
  min-width: 0;
}
.sp-cat-expanded-title .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.sp-cat-expanded-title .meta {
  font-size: 11.5px;
  color: var(--sp-mute);
  margin-top: 2px;
}
.sp-cat-close {
  align-self: flex-start;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.sp-cat-close:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}
.sp-cat-icon-anim { display: inline-flex; }
.sp-cat-icon-anim.is-flipping { animation: sp-icon-flip 540ms cubic-bezier(.4,0,.2,1) both; }
@keyframes sp-icon-flip {
  0%   { transform: scale(1) rotateY(0deg); }
  50%  { transform: scale(.7) rotateY(90deg); }
  100% { transform: scale(1) rotateY(0deg); }
}
.sp-cat-subchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  animation: sp-content-in 460ms cubic-bezier(.2,.7,.3,1) both 180ms;
}
@keyframes sp-content-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sp-cat-others {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  animation: sp-chips-in 360ms cubic-bezier(.2,.7,.3,1) both 180ms;
  opacity: 0;
}
.sp-cat-others.is-closing { animation: sp-fade-out 220ms ease-out both; opacity: 1; }
@keyframes sp-chips-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sp-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  background: var(--sp-card);
  transition: border-color 160ms ease;
}
.sp-cat-chip:hover { border-color: var(--sp-line-2); }
.sp-cat-chip .sp-cat-tile { width: 22px; height: 22px; border-radius: 7px; }
.sp-cat-chip .count {
  color: var(--sp-mute);
  font-size: 10.5px;
}

/* SmoothHeight wrapper */
.sp-smooth {
  transition: height 360ms cubic-bezier(.2,.85,.3,1);
  overflow: hidden;
}

@keyframes sp-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Footer */
.sp-foot {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-top: 1px solid var(--sp-line);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.sp-foot-count { font-size: 12px; color: var(--sp-mute); flex: 1; }
.sp-foot-count strong { color: var(--accent); font-weight: 600; }
.sp-foot-reset {
  background: transparent;
  border: 0;
  color: var(--sp-mute);
  padding: 6px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.sp-foot-reset:hover { color: var(--ink); }
.sp-foot-cta {
  background: var(--accent);
  border: 0;
  color: #fff;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.sp-foot-cta:hover { background: var(--accent-dark); }
.sp-foot-cta .sp-cta-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 4px;
}

/* Mobile sheet variant */
@media (max-width: 767px) {
  .gpill-modal-backdrop.sp-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .sp-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: sp-slide-up 320ms cubic-bezier(.2,.85,.3,1) both;
    transform-origin: bottom center;
  }
  .gpill-modal-backdrop.is-closing .sp-modal {
    animation: sp-slide-down 180ms cubic-bezier(.4,0,.7,.5) both;
    transform-origin: bottom center;
  }
  @keyframes sp-slide-down {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
  }
  .sp-modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--sp-line-2);
    border-radius: 999px;
    margin: 8px auto 6px;
  }
  .sp-cat-section {
    flex: 1;
    overflow: auto;
  }
  .sp-row-label { flex-basis: 50px; font-size: 9px; }
}
@keyframes sp-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-modal, .sp-cat-expanded, .sp-cat-others, .sp-cat-grid,
  .sp-cat-subchips, .sp-cat-icon-anim { animation: none !important; }
  .sp-smooth { transition: none !important; }
}

/* =========================================================
   Listbox — custom <select> replacement (variant B)
   Native <select> remains in DOM (sr-only) for form submission.
   ========================================================= */
.listbox { position: relative; }
.listbox-native {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.listbox-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--paper);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; color: var(--ink); cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .22s ease;
  font-family: inherit;
}
.listbox-trigger:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.listbox-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}
.listbox-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--paper));
}
.listbox-trigger .listbox-label.placeholder { color: var(--muted); }
.listbox-trigger .listbox-chevron {
  color: var(--muted); flex: none;
  transition: transform .25s cubic-bezier(.4,0,.2,1), color .2s ease;
}
.listbox-trigger[aria-expanded="true"] .listbox-chevron { transform: rotate(180deg); color: var(--accent); }
.listbox.invalid .listbox-trigger { border-color: #f87171; }

.listbox-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; z-index: 30;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.35), 0 4px 12px -4px rgba(0,0,0,.18);
  transform-origin: top center;
  opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.4,0,.2,1);
  max-height: 280px; overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent;
}
.listbox-panel::-webkit-scrollbar { width: 6px; }
.listbox-panel::-webkit-scrollbar-track { background: transparent; margin: 6px 0; }
.listbox-panel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 28%, transparent);
  border-radius: 999px;
  transition: background .2s ease;
}
.listbox-panel:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.listbox-panel::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.listbox-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.listbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; color: var(--ink);
  opacity: 0; transform: translateY(4px);
  transition: background .14s ease, color .14s ease;
}
.listbox-panel.open .listbox-item { animation: listbox-in .35s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes listbox-in { to { opacity: 1; transform: translateY(0); } }
.listbox-item:hover,
.listbox-item.cursor { background: var(--surface-raised); }
.listbox-item[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.listbox-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex: none; opacity: .85;
}
.listbox-item .listbox-check { margin-left: auto; opacity: 0; transition: opacity .15s ease; flex: none; }
.listbox-item[aria-selected="true"] .listbox-check { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .listbox-panel, .listbox-item, .listbox-trigger .listbox-chevron { transition: none !important; animation: none !important; }
}

/* =========================================================
   Toast — floating pill (variant 04)
   Drops from top-center, blurred surface, type-colored dot.
   ========================================================= */
#toast-container > * { pointer-events: auto; }

.gpill-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.25), 0 2px 8px -2px rgba(0,0,0,.12);
  transform: translateY(-12px);
  opacity: 0;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), opacity .4s cubic-bezier(.2,.8,.2,1);
}
.dark .gpill-toast {
  background: rgba(20,22,28,.85);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 12px 36px -12px rgba(0,0,0,.6), 0 2px 8px -2px rgba(0,0,0,.4);
}
.gpill-toast.show { transform: translateY(0); opacity: 1; }

.gpill-toast__dot {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gpill-toast-color, var(--accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gpill-toast-color, var(--accent)) 22%, transparent);
}
.gpill-toast__msg {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gpill-toast__close {
  flex: none;
  margin-left: 4px;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: color .15s ease, background .15s ease;
}
.gpill-toast__close:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

.gpill-toast--success { --gpill-toast-color: var(--accent); }
.gpill-toast--error   { --gpill-toast-color: #ef4444; }
.gpill-toast--warning { --gpill-toast-color: #f59e0b; }
.gpill-toast--info    { --gpill-toast-color: #0ea5e9; }

@media (prefers-reduced-motion: reduce) {
  .gpill-toast { transition: opacity .2s ease !important; transform: none !important; }
}

/* =========================================================
   Segmented control — sliding pill (e.g. dashboard lens switch)
   ========================================================= */
.seg-wrap {
  position: relative;
  display: inline-flex;
  padding: 4px;
  background: var(--surface-raised);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.seg-btn {
  position: relative;
  z-index: 1;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color 200ms ease;
}
.seg-btn[data-active="true"] { color: var(--ink); }
.seg-indicator {
  position: absolute;
  top: 4px; bottom: 4px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--border);
  transition: transform 280ms cubic-bezier(.32,.72,0,1), width 280ms cubic-bezier(.32,.72,0,1);
}

/* =========================================================
   Mobile menu — hamburger trigger + full-screen iris reveal
   ========================================================= */
.gpill-mbar-hamburger {
  position: relative;
  z-index: 101;
}
.gpill-mbar-hamburger-icon {
  position: absolute;
  inset: 0;
  margin: auto;
  transition: opacity 180ms ease, transform 320ms cubic-bezier(.32,.72,0,1);
}
.gpill-mbar-hamburger-close { opacity: 0; transform: rotate(-90deg); }
.gpill-mbar-hamburger.is-open .gpill-mbar-hamburger-bars { opacity: 0; transform: rotate(90deg); }
.gpill-mbar-hamburger.is-open .gpill-mbar-hamburger-close { opacity: 1; transform: rotate(0); }

.gpill-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  clip-path: circle(0% at calc(100% - 36px) 32px);
  opacity: 0;
  pointer-events: none;
  transition: clip-path 520ms cubic-bezier(.65,0,.35,1), opacity 200ms ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.gpill-mobile-menu.is-open {
  clip-path: circle(150% at calc(100% - 36px) 32px);
  opacity: 1;
  pointer-events: auto;
}
.gpill-mobile-menu-inner {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 72px 24px 32px;
  gap: 24px;
}
.gpill-mobile-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 280ms ease 220ms, transform 380ms cubic-bezier(.22,1,.36,1) 220ms;
}
.gpill-mobile-menu.is-open .gpill-mobile-menu-header { opacity: 1; transform: none; }

.gpill-mobile-menu-list {
  display: flex;
  flex-direction: column;
}
.gpill-mobile-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 320ms ease, transform 460ms cubic-bezier(.22,1,.36,1);
}
.gpill-mobile-menu-icon {
  flex-shrink: 0;
  color: var(--muted);
  margin-right: 4px;
}
.gpill-mobile-menu.is-open .gpill-mobile-menu-item { opacity: 1; transform: none; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(1) { transition-delay: 260ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(2) { transition-delay: 310ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(3) { transition-delay: 360ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(4) { transition-delay: 410ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(5) { transition-delay: 460ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(6) { transition-delay: 510ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(7) { transition-delay: 560ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(8) { transition-delay: 610ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(9) { transition-delay: 660ms; }
.gpill-mobile-menu.is-open .gpill-mobile-menu-item:nth-child(n+10) { transition-delay: 710ms; }

/* Mobile foot-button: render SOON chip inline next to the label rather than overlaid */
.gpill-mobile-menu-foot-btn .coming-soon-chip {
  position: static;
  transform: none;
  margin-left: 6px;
}

.gpill-mobile-menu-badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.gpill-mobile-menu-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease 480ms, transform 480ms cubic-bezier(.22,1,.36,1) 480ms;
}
.gpill-mobile-menu.is-open .gpill-mobile-menu-foot { opacity: 1; transform: none; }
.gpill-mobile-menu-foot-right { margin-left: auto; }
.gpill-mobile-menu-foot-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.gpill-mobile-menu-foot-btn--left { margin-right: auto; }
.gpill-mobile-menu-foot-btn--danger { color: #b91c1c; }
.dark .gpill-mobile-menu-foot-btn--danger { color: #f87171; }

/* Hide hamburger on desktop — user-pill handles nav there */
@media (min-width: 768px) {
  .gpill-mbar-hamburger { display: none !important; }
  .gpill-mobile-menu { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .gpill-mobile-menu {
    transition: opacity 200ms ease;
    clip-path: none;
  }
  .gpill-mobile-menu:not(.is-open) {
    visibility: hidden;
  }
  .gpill-mobile-menu .gpill-mobile-menu-item,
  .gpill-mobile-menu .gpill-mobile-menu-header,
  .gpill-mobile-menu .gpill-mobile-menu-foot {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* Prevent body scroll when menu is open */
.gpill-topbar.mobile-menu-open ~ * { /* no-op selector for safety */ }
body:has(.gpill-mobile-menu.is-open) { overflow: hidden; }
