/* CSP Safe Styles - Replacing inline styles for security compliance */

/* The HTML hidden state must override component display declarations. */
[hidden] {
  display: none !important;
}

.badge.is-visible {
  display: inline-block;
}

/* Layout utilities */
.layout-flex-main {
  flex: 1;
}

.layout-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--ring);
}

.layout-footer-content {
  padding: 16px 0;
  text-align: center;
  color: #64748B;
  font-size: 12px;
}

.layout-footer-links {
  margin-top: 6px;
  font-size: 11px;
}

.layout-footer-link {
  color: #64748B;
  text-decoration: none;
  transition: color 0.2s;
}

/* Form and Input utilities */
.form-flex-input {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 15px;
}

.form-email-input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  font-size: 16px;
}

.form-status-text {
  margin-top: 10px;
}

.btn-full-width {
  width: 100%;
}

/* Text utilities */
.text-muted {
  color: var(--muted);
}

/* Margin utilities */
.margin-0-0-12-0 {
  margin: 0 0 12px 0;
}

.margin-6-0-8-0 {
  margin: 6px 0 8px 0;
}

/* Feature card styles */
.feature-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px 0;
}

.feature-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c7d2fe;
  border-radius: 11px;
  background: #eef2ff;
  color: #4338ca;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-description {
  margin: 0;
  color: var(--muted);
}

/* Account card styles */
.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-username {
  font-weight: 800;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-description {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0;
  line-height: 1.5;
  font-style: italic;
  min-height: 21px;
  display: flex;
  align-items: center;
}

/* Contact page styles */
.contact-icon {
  height: 40px;
  width: 40px;
  margin-bottom: 8px;
}

/* Admin panel styles */
.admin-title {
  text-align: center;
  margin-bottom: 24px;
}

.admin-upload-btn {
  margin-top: 8px;
}

.admin-cell-description {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cart utilities */
.cart-empty {
  display: none;
}

.cart-empty.show {
  display: block;
}

.state-message {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid #dbe7ff;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  color: var(--text, #0f172a);
  padding: 18px;
}

.state-message-title {
  margin: 0;
  font-family: var(--font-heading, 'Inter');
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.state-message-text {
  margin: 8px 0 0;
  color: var(--muted, #64748b);
  font-size: 14px;
  line-height: 1.55;
}

.state-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.state-message-actions .btn {
  width: auto;
  min-width: 120px;
}

/* Email display utilities */
.email-current-display {
  font-weight: 600;
  color: var(--text);
}

/* Mobile Navigation Styles */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
  background: var(--muted-100, #f1f5f9);
}

.mobile-menu-btn:focus-visible,
.cart:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  color: var(--text);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--ring, #e2e8f0);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  display: none;
  padding: 16px 0;
}

.mobile-menu.show {
  display: block;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.mobile-menu-links a {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
  background: #EEF2FF;
  color: var(--primary);
}

.mobile-nav-container {
  position: relative;
}

/* Show mobile elements only on mobile screens */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope Fallback';
  font-style: normal;
  font-weight: 400 800;
  src: local('Arial');
  size-adjust: 105%;
  ascent-override: 96%;
  descent-override: 24%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Space Grotesk Fallback';
  font-style: normal;
  font-weight: 500 700;
  src: local('Arial');
  size-adjust: 103%;
  ascent-override: 97%;
  descent-override: 24%;
  line-gap-override: 0%;
}

:root {
  --font-heading: 'Space Grotesk', 'Space Grotesk Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Manrope', 'Manrope Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --primary: #6366f1;
  --primary-600: #4f46e5;
  --accent: #22c55e;
  --danger: #ef4444;
  --status-success: #15803d;
  --status-error: #b91c1c;
  --bg: #f8fafc;
  --surface: #ffffff;
  --muted: #6b7280;
  --text: #0f172a;
  --ring: #e5e7eb;

  --button-ink-start: rgba(79, 70, 229, 0.96);
  --button-ink-end: rgba(67, 56, 202, 0.96);
  --button-border: rgba(79, 70, 229, 0.72);
  --button-hover-border: rgba(67, 56, 202, 0.9);
  --button-shadow: 0 14px 28px rgba(79, 70, 229, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --button-shadow-hover: 0 18px 30px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  --button-outline-bg-start: rgba(255, 255, 255, 0.94);
  --button-outline-bg-end: rgba(224, 231, 255, 0.84);
  --button-outline-border: rgba(129, 140, 248, 0.42);
  --button-outline-hover-bg-start: rgba(255, 255, 255, 0.98);
  --button-outline-hover-bg-end: rgba(224, 231, 255, 0.92);
  --button-outline-hover-border: rgba(99, 102, 241, 0.62);
  --button-outline-text: #4f46e5;
  --button-outline-hover-text: #4338ca;

  --cta-surface-start: rgba(255, 255, 255, 0.78);
  --cta-surface-end: rgba(224, 231, 255, 0.9);
  --cta-border: rgba(129, 140, 248, 0.62);
  --cta-hover-surface-start: rgba(255, 255, 255, 0.94);
  --cta-hover-surface-end: rgba(199, 210, 254, 0.94);
  --cta-hover-border: rgba(99, 102, 241, 0.78);
  --cta-shadow: 0 16px 32px rgba(79, 70, 229, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  --cta-shadow-hover: 0 20px 36px rgba(79, 70, 229, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 16px 34px rgba(15, 23, 42, 0.14);

  --motion-fast: 180ms;
  --motion-base: 320ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: var(--font-body);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.title,
.brand {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
}

h1,
h2,
h3,
.title {
  text-wrap: balance;
}

.brand.brand-home {
  text-decoration: none;
  color: inherit;
}

.brand.brand-home:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.45);
  outline-offset: 3px;
  border-radius: 12px;
}

.nav .links > a {
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #334155;
}

.nav .links > a:hover,
.nav .links > a.active {
  background: linear-gradient(180deg, #eef2ff, #e0e7ff);
  border-color: #c7d2fe;
  color: #1e1b4b;
}

.nav .links > a.contact-link {
  position: relative;
  margin-left: 14px;
}

.nav .links > a.contact-link::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: #cbd5e1;
}

.price,
.chip,
.badge,
.tag-chip,
#subtotal-price,
#total-price {
  font-family: var(--font-mono);
}

.muted,
.subtitle,
.small-text {
  font-weight: 500;
}

.card .account-username {
  color: #0f172a;
  font-weight: 800;
}

.card .row strong {
  color: #0f172a;
  font-weight: 700;
}

.card .muted {
  color: #475569;
}

.catalog-intro {
  max-width: 760px;
  padding: 42px 0 18px;
}

.catalog-intro h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.catalog-intro p,
.section-header p {
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.6;
}

.seo-content {
  position: relative;
  margin-top: 42px;
  margin-bottom: 48px;
  padding: clamp(28px, 4vw, 46px);
  overflow: hidden;
  border: 1px solid #dbe4ed;
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(14, 116, 144, 0.08), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.08);
  isolation: isolate;
}

.container.seo-content {
  padding: clamp(28px, 4vw, 46px);
}

.seo-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: clamp(28px, 4vw, 46px);
  width: 72px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #0f766e, #e85d3f);
}

.seo-content-compact {
  margin-top: 0;
  background: linear-gradient(145deg, #fbfdff, #f1f5f9);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.seo-content-heading {
  display: grid;
  max-width: none;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  column-gap: clamp(28px, 5vw, 72px);
  align-items: end;
}

.seo-eyebrow {
  grid-column: 1 / -1;
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 10px;
  border: 1px solid #bddbd7;
  border-radius: 999px;
  background: #edf8f6;
  color: #0f655f;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.seo-content-heading h2 {
  margin: 0;
  color: #152238;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.seo-content-heading > p:last-child {
  max-width: 62ch;
  margin: 0;
  color: #526077;
  font-size: 0.96rem;
  line-height: 1.72;
}

.seo-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(26px, 4vw, 38px);
  counter-reset: guide-card;
}

.seo-card {
  position: relative;
  min-height: 174px;
  padding: 24px 24px 22px 70px;
  border: 1px solid #dfe7ee;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
  counter-increment: guide-card;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.seo-card::before {
  content: counter(guide-card, decimal-leading-zero);
  position: absolute;
  top: 24px;
  left: 22px;
  color: #e85d3f;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.seo-card h3 {
  margin: 0;
  color: #172033;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
}

.seo-card p {
  max-width: 58ch;
  margin: 9px 0 0;
  color: #5b687c;
  font-size: 0.91rem;
  line-height: 1.68;
}

.seo-card a,
.seo-support-note a {
  display: inline-flex;
  margin-top: 14px;
  align-items: center;
  gap: 6px;
  color: #0f6b65;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.seo-card a::after {
  content: '\2192';
  transition: transform 180ms ease;
}

.seo-card a:hover,
.seo-support-note a:hover {
  color: #0a4f4b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .seo-card:hover {
    border-color: #bfd6d3;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
  }

  .seo-card a:hover::after {
    transform: translateX(3px);
  }
}

.seo-step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: seo-step;
}

.seo-step-grid li {
  position: relative;
  min-height: 148px;
  padding: 52px 20px 20px;
  border: 1px solid #dbe7ff;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f8fbff, #ffffff);
  counter-increment: seo-step;
}

.seo-step-grid li::before {
  content: counter(seo-step, decimal-leading-zero);
  position: absolute;
  top: 18px;
  left: 20px;
  color: var(--primary-600);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.seo-step-grid strong,
.seo-step-grid span {
  display: block;
}

.seo-step-grid strong {
  color: var(--text);
  font-family: var(--font-heading);
}

.seo-step-grid span {
  margin-top: 8px;
  color: #475569;
  line-height: 1.65;
}

.seo-support-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 3px solid #0f766e;
  border-radius: 4px 12px 12px 4px;
  background: #edf8f6;
  color: #425466;
  font-size: 0.88rem;
  line-height: 1.65;
}

.seo-support-note a {
  margin-top: 0;
}

.card,
.summary,
.checkout-panel,
.filters {
  border-radius: var(--radius-lg);
}

.card {
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.btn {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--button-border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--button-ink-start), var(--button-ink-end));
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  touch-action: manipulation;
  transition:
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) var(--ease-out),
    background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out),
    color var(--motion-fast) var(--ease-out);
}

.btn:hover:not([disabled]) {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  border-color: var(--button-hover-border);
  transform: translateY(-1px);
  box-shadow: var(--button-shadow-hover);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), var(--button-shadow-hover);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-outline {
  background: linear-gradient(180deg, var(--button-outline-bg-start), var(--button-outline-bg-end));
  color: var(--button-outline-text);
  border-color: var(--button-outline-border);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-outline:hover:not([disabled]) {
  background: linear-gradient(180deg, var(--button-outline-hover-bg-start), var(--button-outline-hover-bg-end));
  color: var(--button-outline-hover-text);
  border-color: var(--button-outline-hover-border);
  box-shadow: 0 14px 24px rgba(79, 70, 229, 0.14), 0 8px 18px rgba(15, 23, 42, 0.06);
}

.cart,
.mobile-menu-btn {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

.form-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 700;
}

.form-control-field {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--ring);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.form-control-field:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.22);
  outline-offset: 2px;
  border-color: var(--primary-600);
}

.form-control-field[aria-invalid='true'] {
  border-color: var(--status-error);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.status-success {
  color: var(--status-success);
}

.status-error {
  color: var(--status-error);
}

.card-action-feedback {
  min-height: 1.25rem;
  margin: 8px 0 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Stagger reveal for product grids and feature cards */
.ds-stagger > * {
  opacity: 0;
  transform: translateY(10px) scale(0.995);
  animation: ds-rise var(--motion-base) var(--ease-out) forwards;
}

.ds-stagger > *:nth-child(1) { animation-delay: 30ms; }
.ds-stagger > *:nth-child(2) { animation-delay: 70ms; }
.ds-stagger > *:nth-child(3) { animation-delay: 110ms; }
.ds-stagger > *:nth-child(4) { animation-delay: 150ms; }
.ds-stagger > *:nth-child(5) { animation-delay: 190ms; }
.ds-stagger > *:nth-child(6) { animation-delay: 230ms; }
.ds-stagger > *:nth-child(7) { animation-delay: 270ms; }
.ds-stagger > *:nth-child(8) { animation-delay: 310ms; }
.ds-stagger > *:nth-child(9) { animation-delay: 350ms; }
.ds-stagger > *:nth-child(10) { animation-delay: 390ms; }
.ds-stagger > *:nth-child(11) { animation-delay: 430ms; }
.ds-stagger > *:nth-child(12) { animation-delay: 470ms; }

@keyframes ds-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile comfort: larger inputs for checkout flow */
@media (max-width: 768px) {
  .catalog-intro {
    padding: 30px 0 12px;
  }

  .mobile-menu-links a.contact-link {
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    border-radius: 10px;
  }

  .form-email-input,
  .promo-input-row input,
  #buyer-email,
  #change-email-input,
  #promo-code-input {
    min-height: 48px;
    font-size: 16px;
    border-radius: 12px;
  }

  #set-email,
  #change-email-btn,
  #apply-promo-btn,
  #remove-promo-btn {
    min-height: 46px;
    border-radius: 12px;
  }

  .seo-content {
    margin-top: 26px;
    margin-bottom: 32px;
    padding: 28px 22px;
    border-radius: 22px;
  }

  .container.seo-content {
    padding: 28px 22px;
  }

  .seo-content::before {
    left: 22px;
  }

  .seo-content-heading {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .seo-eyebrow {
    margin-bottom: 2px;
  }

  .seo-content-heading > p:last-child {
    margin-top: 0;
  }

  .seo-card-grid,
  .seo-step-grid {
    grid-template-columns: 1fr;
  }

  .seo-card {
    min-height: 0;
    padding: 20px 18px 18px 56px;
  }

  .seo-card::before {
    top: 21px;
    left: 18px;
  }

  .seo-card a,
  .seo-support-note a,
  .layout-footer-link,
  .legal-links a {
    min-height: 44px;
    align-items: center;
  }

  .pool-qty,
  .pool-info-close,
  .filters input,
  .filters select {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .card .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
  }

  .card .row > div {
    min-width: 0;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  .ds-stagger > *,
  .card,
  .btn,
  .mobile-menu,
  .cookie-consent-modal {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .ds-stagger > * {
    opacity: 1;
    transform: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font-body, 'Inter'), system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ring);
}

.nav {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-heading, 'Inter');
  font-weight: 800;
  display: flex;
  gap: 8px;
  align-items: center;
}

.brand .mark {
  background: linear-gradient(135deg, #F43F5E, #F97316);
  color: #fff;
  padding: 4px 8px;
  border-radius: 10px;
}

.links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.links a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
}

.links a.active,
.links a:hover {
  background: #EEF2FF;
}

.cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--ring);
  cursor: pointer;
}

.cart:hover {
  border-color: #CBD5E1;
  background: #FFF;
}

.cart svg { width: 22px; height: 22px; }

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #F43F5E, #EF4444);
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  display: none;
}

.catalog-section {
  padding: 16px 0 8px;
}

.bulk-catalog-section {
  padding: 18px;
  border: 1px solid #DBE7FF;
  border-radius: 24px;
  background: linear-gradient(180deg, #F8FBFF, #FFFFFF);
}

.bulk-catalog-section .grid {
  padding: 10px 0 6px;
}

.unique-catalog-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed #CBD5E1;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-heading, 'Inter');
  font-size: 26px;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 24px 0;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 22px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition: .2s;
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.card:hover {
  transform: translateY(-2px);
  border-color: #C7D2FE;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

.thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #E2E8F0;
  border-radius: 50%;
  border: 1px solid #E2E8F0;
  flex: 0 0 auto;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.card .account-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.card .account-username {
  font-size: 18px;
}

.body {
  display: grid;
  gap: 10px;
  padding: 16px;
  flex: 1;
  align-content: start;
  grid-auto-rows: min-content;
}

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

.tag-chip {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  border: 1px solid transparent;
  background: #F8FAFC;
  color: #334155;
  display: inline-flex;
  align-items: center;
}

.tag-cqs-lowest { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }
.tag-cqs-low { background: #DBEAFE; color: #1D4ED8; border-color: #93C5FD; }
.tag-cqs-moderate { background: #DCFCE7; color: #15803D; border-color: #86EFAC; }
.tag-cqs-high,
.tag-cqs-highest { background: #EDE9FE; color: #6D28D9; border-color: #C4B5FD; }
.tag-access-ios { background: #ECFEFF; color: #0F766E; border-color: #99F6E4; }
.tag-access-web { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.tag-rating-nsfw { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.tag-rating-sfw { background: #ECFDF3; color: #15803D; border-color: #BBF7D0; }
.tag-badge { background: #FFFFFF; border-color: #CBD5E1; color: #475569; font-weight: 600; border-style: dashed; }

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

.chip {
  font-family: var(--font-mono, ui-monospace);
  background: #EEF2FF;
  border: 1px solid #E0E7FF;
  color: #3730A3;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.account-description,
.pool-description {
  color: var(--muted);
  line-height: 1.6;
}

.price {
  font-family: var(--font-mono, ui-monospace);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .2px;
  align-self: flex-start;
  display: inline-flex;
  width: fit-content;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #1E1B4B;
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.18);
}

.actions {
  padding: 16px;
  margin-top: auto;
}

.catalog-load-more {
  width: auto;
  min-width: 180px;
  margin: 0 auto 32px;
  display: block;
}

.btn-secondary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  border-color: #4338ca;
  color: #FFFFFF;
  box-shadow: 0 16px 28px rgba(79, 70, 229, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-secondary:hover:not([disabled]) {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  border-color: #3730a3;
  box-shadow: 0 18px 30px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-small {
  padding: 8px 12px;
  font-size: 12px;
}

.filters {
  margin: 10px 0 4px;
  padding: 16px 18px;
  border-radius: 22px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--ring);
  background: #FFFFFF;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filters-title {
  font-weight: 800;
  font-family: var(--font-heading, 'Inter');
}

.filters-body {
  display: grid;
  gap: 12px;
  max-height: 900px;
  opacity: 1;
  overflow: hidden;
  transition: max-height .28s ease, opacity .2s ease;
}

.filters.is-collapsed .filters-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.filters.is-collapsed {
  width: auto;
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.filters.is-collapsed .filters-title {
  display: none;
}

.filters-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.filter-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.filter-group input,
.filter-group select,
.pool-qty {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: var(--text);
}

.filter-group input:focus,
.filter-group select:focus,
.pool-qty:focus {
  outline: none;
  border-color: #C7D2FE;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.filters-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters-actions .btn,
.filters-toggle {
  width: auto;
}

.filters-actions .btn {
  padding: 10px 16px;
}

.pool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #FFFFFF, #F8FBFF);
  border: 1px solid #DBE7FF;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
}

.pool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pool-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.pool-summary {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.pool-tag-row {
  margin-top: -2px;
  gap: 6px;
}

.pool-info-btn {
  margin-top: 10px;
  border: 1px solid #C7D2FE;
  background: #EEF2FF;
  color: #3730A3;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  transition: .2s;
}

.pool-info-btn:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
  color: #1D4ED8;
}

.pool-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ECFDF3;
  color: #166534;
  border: 1px solid #BBF7D0;
  white-space: nowrap;
}

.pool-price {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono, ui-monospace);
  color: #1D4ED8;
}

.pool-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-qty {
  width: 84px;
  font-weight: 700;
  padding: 9px 10px;
}

.pool-cta { flex: 1; }

.pool-note {
  font-size: 12px;
  color: var(--muted);
}

.hidden { display: none; }
.pool-info-open { overflow: hidden; }

.pool-info-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}

.pool-info-modal.show {
  pointer-events: auto;
  opacity: 1;
}

.pool-info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.pool-info-dialog {
  position: relative;
  width: min(760px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
  margin: 20px auto;
  border-radius: 20px;
  border: 1px solid #DBE7FF;
  background: #FFFFFF;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
}

.pool-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #E2E8F0;
}

.pool-info-title-wrap h3 {
  margin: 0;
  font-size: 20px;
}

.pool-info-summary {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748B;
}

.pool-info-close {
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #334155;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.pool-info-content {
  padding: 16px 18px 20px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.pool-info-description {
  margin: 0;
  color: #475569;
  font-size: 14px;
}

.pool-info-body {
  margin: 0;
  color: #0F172A;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
}

.pool-info-description > *:first-child,
.pool-info-body > *:first-child { margin-top: 0; }

.pool-info-description > *:last-child,
.pool-info-body > *:last-child { margin-bottom: 0; }

.pool-info-description p,
.pool-info-body p {
  margin: 0 0 12px;
  line-height: 1.7;
}

.pool-info-description ul,
.pool-info-body ul {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.pool-info-description li,
.pool-info-body li {
  line-height: 1.65;
}

.pool-info-description h4,
.pool-info-body h4 {
  margin: 6px 0 10px;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #1D4ED8;
}

.pool-info-description strong,
.pool-info-body strong {
  color: #0F172A;
}

.pool-info-description em,
.pool-info-body em {
  color: #1E293B;
}

.pool-info-description code,
.pool-info-body code {
  font-family: var(--font-mono, ui-monospace);
  font-size: .95em;
  color: #1E1B4B;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 8px;
  padding: 2px 6px;
}

.pool-info-description a,
.pool-info-body a {
  color: #2563EB;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 700;
}

.pool-info-description a:hover,
.pool-info-body a:hover {
  color: #1D4ED8;
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav { height: 56px; flex-wrap: wrap; }
  .links { display: flex; }
  .links a { display: none; }
  .grid { grid-template-columns: 1fr; gap: 14px; padding: 16px 0; }
  .bulk-catalog-section { padding: 14px; }
  .unique-catalog-section { margin-top: 14px; padding-top: 12px; }
  .section-header h2 { font-size: 22px; }
  .card { margin: 0 auto; max-width: 340px; }
  .pool-card { margin: 0 auto; max-width: 340px; }
  .pool-controls { flex-direction: column; align-items: stretch; }
  .pool-qty { width: 100%; }
  .pool-info-dialog { width: min(620px, calc(100% - 20px)); margin: 10px auto; max-height: calc(100vh - 20px); }
  .pool-info-head { padding: 14px 14px 12px; }
  .pool-info-content { padding: 12px 14px 16px; }
  .thumb { width: 72px; height: 72px; }
  .body { padding: 12px; }
  .row { gap: 8px; }
  .row > div { flex: 1; min-width: 0; font-size: 12px; }
}

@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .grid { padding: 12px 0; }
  .card { max-width: 100%; }
  .pool-card { max-width: 100%; }
  .thumb { width: 64px; height: 64px; }
}
