/* ============================================================
   JoinCoupons design system v3
   Token driven. Geist type stack. Light + dark themes.
   Every interactive component defines default / hover /
   focus-visible / active / disabled / loading / error states.
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  /* type */
  --font-sans: Geist, "Geist Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 18px;
  --fs-xl: 20px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;
  --fs-4xl: 36px;
  --fs-5xl: 48px;
  --lh-base: 24px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* space */
  --space-1: 2px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;

  /* shape */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --maxw: 1240px;
  --maxw-prose: 68ch;

  /* elevation */
  --shadow-xs: 0 1px 2px rgba(16, 18, 22, .06);
  --shadow-sm: 0 1px 3px rgba(16, 18, 22, .08), 0 1px 2px rgba(16, 18, 22, .04);
  --shadow-md: 0 4px 16px rgba(16, 18, 22, .08);
  --shadow-lg: 0 12px 40px rgba(16, 18, 22, .12);

  /* motion */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease: cubic-bezier(.2, 0, .2, 1);

  /* semantic colour - light theme */
  --text-primary: #252525;
  --text-secondary: #7f7f88;
  --text-tertiary: #078a48;
  --text-inverse: #ffffff;
  --surface-base: #ffffff;
  --surface-muted: #f7f5f3;
  --surface-sunken: #f2f0ee;
  --surface-raised: #ffffff;
  --surface-inverse: #000000;
  --border-default: #e8e5e1;
  --border-strong: #d6d2cd;
  --border-inverse: #2a2a2a;
  --accent: #078a48;
  --accent-soft: #e7f5ed;
  --accent-hover: #05713b;
  --focus-ring: #1a56db;
  --pro: #8b5cf6;
  --pro-soft: #f2ecff;
  --warn: #b45309;
  --warn-soft: #fdf3e7;
  --danger: #c0392f;
  --danger-soft: #fdecea;
  --star: #f0a92c;
  --skeleton: #eeebe7;
}

[data-theme="dark"] {
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #34d399;
  --text-inverse: #0a0a0a;
  --surface-base: #08090a;
  --surface-muted: #101113;
  --surface-sunken: #0c0d0f;
  --surface-raised: #16181b;
  --surface-inverse: #f4f4f5;
  --border-default: #26282d;
  --border-strong: #35383f;
  --border-inverse: #e4e4e7;
  --accent: #34d399;
  --accent-soft: #0d2b20;
  --accent-hover: #6ee7b7;
  --focus-ring: #7aa2ff;
  --pro: #a78bfa;
  --pro-soft: #241b3d;
  --warn: #fbbf24;
  --warn-soft: #2b2113;
  --danger: #f87171;
  --danger-soft: #2d1615;
  --star: #fbbf24;
  --skeleton: #1c1e22;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .55);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .7);
}

/* ---------- 2. Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Smooth global theme transition during toggle */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 300ms cubic-bezier(0.2, 0, 0.2, 1),
              border-color 300ms cubic-bezier(0.2, 0, 0.2, 1),
              color 300ms cubic-bezier(0.2, 0, 0.2, 1),
              fill 300ms cubic-bezier(0.2, 0, 0.2, 1),
              stroke 300ms cubic-bezier(0.2, 0, 0.2, 1),
              box-shadow 300ms cubic-bezier(0.2, 0, 0.2, 1) !important;
  transition-delay: 0s !important;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-primary); }

h1, h2, h3, h4, h5 {
  margin: 0 0 var(--space-3);
  font-weight: var(--fw-semibold);
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 var(--space-3); }

hr { border: 0; border-top: 1px solid var(--border-default); margin: var(--space-5) 0; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-4); }
.container-wide { max-width: 1480px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface-raised); color: var(--text-primary);
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
.skip-link:focus { left: var(--space-3); top: var(--space-3); }

.muted { color: var(--text-secondary); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.row { display: flex; align-items: center; gap: var(--space-2); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: var(--space-2); } .mt-16 { margin-top: var(--space-3); }
.mt-24 { margin-top: var(--space-4); } .mt-32 { margin-top: var(--space-5); }
.mb-0 { margin-bottom: 0; }
.section { padding: var(--space-7) 0; }
.section-tight { padding: var(--space-5) 0; }
.hp { position: absolute !important; left: -9999px !important; }

/* ---------- 3. Buttons ---------- */
.btn {
  --btn-bg: var(--surface-base);
  --btn-fg: var(--text-primary);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-3);
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-sans);
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap;
  transition: background var(--motion-fast) linear, border-color var(--motion-fast) linear,
              color var(--motion-fast) linear, transform var(--motion-fast) linear;
}
.btn:hover { background: var(--surface-muted); color: var(--text-primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.is-loading { color: transparent; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; color: var(--btn-fg);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary { --btn-bg: var(--surface-inverse); --btn-fg: var(--text-inverse); --btn-bd: var(--surface-inverse); font-weight: var(--fw-semibold); }
.btn-primary:hover { --btn-bg: #2b2b2b; --btn-fg: var(--text-inverse); }
[data-theme="dark"] .btn-primary:hover { --btn-bg: #d4d4d8; }
.btn-dark { --btn-bg: var(--surface-inverse); --btn-fg: var(--text-inverse); --btn-bd: var(--surface-inverse); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #ffffff; --btn-bd: var(--accent); font-weight: var(--fw-semibold); }
.btn-accent:hover { --btn-bg: var(--accent-hover); --btn-fg: #ffffff; }
[data-theme="dark"] .btn-accent { --btn-fg: #05231a; }
.btn-pro { --btn-bg: var(--pro); --btn-fg: #ffffff; --btn-bd: var(--pro); font-weight: var(--fw-semibold); }
.btn-pro:hover { --btn-bg: #7c3aed; --btn-fg: #ffffff; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-soft { --btn-bg: var(--surface-muted); --btn-bd: var(--border-default); }
.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: var(--danger-soft); }
.btn-sm { min-height: 34px; padding: 0 var(--space-2) 0 var(--space-2); font-size: var(--fs-xs); }
.btn-lg { min-height: 48px; padding: 0 var(--space-4); font-size: var(--fs-md); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-width: 36px; height: 36px; padding: 0 var(--space-2);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); font-family: var(--font-sans);
  color: var(--text-secondary); background: transparent;
  border: 1px solid var(--border-default); border-radius: var(--radius-sm); cursor: pointer;
  transition: color var(--motion-fast) linear, background var(--motion-fast) linear;
}
.icon-btn:hover { color: var(--text-primary); background: var(--surface-muted); }

.link { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.link-accent { color: var(--accent); font-weight: var(--fw-medium); }

/* ---------- 4. Badges and chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px var(--space-2); border-radius: var(--radius-xs);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 18px;
  background: var(--surface-muted); color: var(--text-secondary); border: 1px solid var(--border-default);
}
.badge-green { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-pro { background: var(--pro-soft); color: var(--pro); border-color: transparent; font-weight: var(--fw-semibold); }
.badge-free { background: var(--surface-muted); color: var(--text-secondary); }
.badge-amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-blue { background: var(--pro-soft); color: var(--pro); border-color: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: var(--surface-base);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary);
  transition: background var(--motion-fast) linear, border-color var(--motion-fast) linear;
}
.chip:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.chip.is-active { background: var(--surface-inverse); color: var(--text-inverse); border-color: var(--surface-inverse); }

/* ---------- 5. Header, mega menu, footer ---------- */
.topbar {
  background: var(--surface-inverse); color: var(--text-inverse);
  font-size: var(--fs-xs); text-align: center; padding: var(--space-2) var(--space-3);
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface-base) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-default);
}
.header-inner { display: flex; align-items: center; gap: var(--space-4); min-height: 68px; }

.brand, .admin-brand { display: inline-flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; }
.brand-mark { height: 26px; width: auto; max-width: 100%; display: block; }
.brand-mark.on-dark,
.brand img.on-dark,
.admin-brand img.on-dark { display: none !important; }
.brand-mark.on-light,
.brand img.on-light,
.admin-brand img.on-light { display: block !important; }

[data-theme="dark"] .brand-mark.on-light,
[data-theme="dark"] .brand img.on-light,
[data-theme="dark"] .admin-brand img.on-light { display: none !important; }

[data-theme="dark"] .brand-mark.on-dark,
[data-theme="dark"] .brand img.on-dark,
[data-theme="dark"] .admin-brand img.on-dark { display: block !important; }
.brand-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -.03em; }

.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav > a, .nav-item > button {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-secondary);
  background: none; border: 0; font-family: var(--font-sans); cursor: pointer;
}
.nav > a:hover, .nav-item > button:hover { color: var(--text-primary); background: var(--surface-muted); }
.nav > a.is-active, .nav-item.is-open > button { color: var(--text-primary); background: var(--surface-muted); }
.nav-item { position: relative; }
.caret { width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform var(--motion-fast) linear; }
.nav-item.is-open .caret { transform: rotate(225deg) translateY(-2px); }



/* Theme Toggle Pill Switch */
.theme-switch {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 4px; cursor: pointer;
  border-radius: var(--radius-pill); transition: transform var(--motion-fast) var(--ease);
  user-select: none; position: relative; touch-action: manipulation;
}
.theme-switch:hover { transform: scale(1.05); }
.theme-switch:active { transform: scale(0.95); }
.theme-switch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

/* Track */
.theme-track {
  width: 62px; height: 32px; border-radius: 999px; position: relative;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
  background: linear-gradient(135deg, #70b8ff 0%, #bae6fd 60%, #e0f2fe 100%);
  border: 1.5px solid #7dd3fc;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(56, 189, 248, 0.2);
  transition: background 350ms cubic-bezier(0.4, 0, 0.2, 1), border-color 350ms ease, box-shadow 350ms ease;
  box-sizing: border-box; overflow: hidden;
}

[data-theme="dark"] .theme-track,
.theme-switch[aria-checked="true"] .theme-track {
  background: linear-gradient(135deg, #0b0f19 0%, #172554 60%, #1e1b4b 100%);
  border-color: #3b82f6;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(59, 130, 246, 0.35);
}

/* Sky Stars in Night Mode */
.theme-sky-stars {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  transition: opacity 350ms ease;
}
[data-theme="dark"] .theme-sky-stars,
.theme-switch[aria-checked="true"] .theme-sky-stars {
  opacity: 1;
}
.star {
  position: absolute; background: #ffffff; border-radius: 50%;
  box-shadow: 0 0 4px #ffffff; animation: starTwinkle 2s ease-in-out infinite alternate;
}
.star-1 { width: 3px; height: 3px; top: 7px; left: 14px; animation-delay: 0.2s; }
.star-2 { width: 2px; height: 2px; bottom: 8px; left: 24px; animation-delay: 0.8s; }
.star-3 { width: 3px; height: 3px; top: 12px; left: 32px; animation-delay: 1.4s; }

@keyframes starTwinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* Fixed Base Icons (Left/Right) */
.theme-ico {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; z-index: 1; pointer-events: none;
  transition: opacity 300ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), color 300ms ease;
}
.theme-sun {
  color: #ea580c; opacity: 0.85; transform: scale(1) rotate(0deg);
}
[data-theme="dark"] .theme-sun,
.theme-switch[aria-checked="true"] .theme-sun {
  color: #38bdf8; opacity: 0; transform: scale(0.4) rotate(-90deg);
}

.theme-moon {
  color: #93c5fd; opacity: 0; transform: scale(0.4) rotate(90deg);
}
[data-theme="dark"] .theme-moon,
.theme-switch[aria-checked="true"] .theme-moon {
  color: #e0e7ff; opacity: 0.85; transform: scale(1) rotate(0deg);
}

/* Sliding Knob */
.theme-knob {
  position: absolute; top: 2.5px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25), 0 0 10px rgba(251, 191, 36, 0.6);
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
  z-index: 2; display: flex; align-items: center; justify-content: center;
}

[data-theme="dark"] .theme-knob,
.theme-switch[aria-checked="true"] .theme-knob {
  transform: translateX(30px); background: #0f172a; border: 1px solid #3b82f6;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7), 0 0 12px rgba(96, 165, 250, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Icons Inside Knob */
.knob-icon {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 13px; height: 13px;
  transition: opacity 280ms ease, transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.knob-sun {
  color: #d97706; opacity: 1; transform: scale(1) rotate(0deg);
}
[data-theme="dark"] .knob-sun,
.theme-switch[aria-checked="true"] .knob-sun {
  opacity: 0; transform: scale(0.2) rotate(180deg);
}

.knob-moon {
  color: #60a5fa; opacity: 0; transform: scale(0.2) rotate(-180deg);
}
[data-theme="dark"] .knob-moon,
.theme-switch[aria-checked="true"] .knob-moon {
  opacity: 1; transform: scale(1) rotate(0deg);
}

.header-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.menu-toggle { display: none; }

/* ---------- Modern Search Bar ---------- */
.header-search {
  flex: 1 1 340px; max-width: 440px; position: relative;
  display: flex; align-items: center;
}
.header-search input[type="search"],
.header-search input {
  width: 100%; height: 42px; padding: 0 54px 0 42px;
  border: 1.5px solid var(--border-default); border-radius: 999px;
  background: var(--surface-muted); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.01em; outline: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all var(--motion-fast) var(--ease);
}
.header-search input::placeholder {
  color: var(--text-secondary); font-size: 13px; font-weight: 450;
  opacity: 0.95; letter-spacing: 0;
}
.header-search input:hover {
  border-color: var(--border-strong); background: var(--surface-base);
}
.header-search input:focus {
  background: var(--surface-base); border-color: #00c06d;
  box-shadow: 0 0 0 3.5px rgba(0, 192, 109, 0.16), 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .header-search input {
  background: #11141d; border-color: #232838; color: #f3f4f6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .header-search input::placeholder {
  color: #9ca3af; opacity: 0.9;
}
[data-theme="dark"] .header-search input:hover {
  background: #151924; border-color: #374151;
}
[data-theme="dark"] .header-search input:focus {
  background: #161b27; border-color: #00c06d;
  box-shadow: 0 0 0 3.5px rgba(0, 192, 109, 0.25), 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Search Icon */
.header-search .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-secondary); pointer-events: none; display: flex;
  align-items: center; justify-content: center;
  transition: color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
  z-index: 2;
}
.header-search:focus-within .search-icon {
  color: #00c06d; transform: translateY(-50%) scale(1.06);
}

/* Search Actions Right (Clear button + KBD shortcut) */
.search-actions-right {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px; z-index: 2;
}
.search-clear-btn {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-muted); border: 1px solid var(--border-default);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: all var(--motion-fast) var(--ease);
}
.search-clear-btn:hover {
  background: var(--surface-base); color: var(--text-primary); border-color: var(--border-strong);
}

.search-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600;
  color: var(--text-secondary); background: var(--surface-base);
  border: 1px solid var(--border-default); border-radius: 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06); pointer-events: none;
  user-select: none; transition: all var(--motion-fast) var(--ease);
}
[data-theme="dark"] .search-kbd {
  background: #1e2433; border-color: #334155; color: #94a3b8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.header-search:focus-within .search-kbd {
  opacity: 0.4;
}

/* Autocomplete Suggestion Dropdown */
.autocomplete {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface-base); border: 1.5px solid var(--border-default);
  border-radius: 16px; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden; z-index: 100; display: none; padding: 6px;
  backdrop-filter: blur(16px); max-height: 420px; overflow-y: auto;
}
[data-theme="dark"] .autocomplete {
  background: #11141d; border-color: #232838;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
}
.autocomplete.is-open {
  display: flex; flex-direction: column; gap: 2px;
  animation: acDropIn 160ms cubic-bezier(0.2, 0, 0.2, 1);
}
@keyframes acDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.autocomplete a, .ac-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px; text-decoration: none;
  color: var(--text-primary); font-size: 13.5px; transition: all var(--motion-fast) var(--ease);
}
.autocomplete a:hover, .autocomplete a.is-active {
  background: var(--surface-muted); color: var(--text-primary); transform: translateX(2px);
}
[data-theme="dark"] .autocomplete a:hover,
[data-theme="dark"] .autocomplete a.is-active {
  background: #181d2a;
}
.ac-item-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ac-logo-circle {
  width: 28px; height: 28px; border-radius: 8px; background: #ffffff;
  border: 1px solid var(--border-default); display: flex; align-items: center;
  justify-content: center; overflow: hidden; flex-shrink: 0;
}
.ac-logo-img { width: 100%; height: 100%; object-fit: contain; }
.ac-item-title { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item-offer { font-size: 12px; color: #00c06d; font-weight: 600; white-space: nowrap; flex-shrink: 0; }

.site-footer { border-top: 1px solid var(--border-default); background: var(--surface-muted); padding: var(--space-7) 0 var(--space-4); margin-top: var(--space-7); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--space-5); }
.footer-grid h4 { font-size: var(--fs-sm); margin-bottom: var(--space-2); }
.footer-grid a { display: block; padding: var(--space-1) 0; font-size: var(--fs-sm); color: var(--text-secondary); }
.footer-grid a:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between;
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--border-default); font-size: var(--fs-xs); color: var(--text-secondary);
}

/* ---------- 6. Forms ---------- */
.field { display: block; margin-bottom: var(--space-3); }
.field > span, label.label { display: block; margin-bottom: var(--space-1); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 42px; padding: var(--space-2) var(--space-3);
  font: var(--fw-regular) var(--fs-sm)/1.5 var(--font-sans);
  color: var(--text-primary); background: var(--surface-base);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--motion-fast) linear, box-shadow var(--motion-fast) linear;
}
textarea { min-height: 120px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--text-secondary); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-muted); color: var(--text-secondary); cursor: not-allowed; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.help { display: block; margin-top: var(--space-1); font-size: var(--fs-xs); color: var(--text-secondary); }
.help-error { color: var(--danger); }
.inline-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: var(--fs-2xl); font-family: var(--font-mono); }
.checkline { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--fs-sm); }
.checkline input { width: 16px; min-height: 16px; height: 16px; margin-top: 4px; }

.alert { padding: var(--space-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); border: 1px solid transparent; }
.alert-ok { background: var(--accent-soft); color: var(--accent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* ---------- 7. Search hero and autocomplete ---------- */
.hero { padding: var(--space-7) 0 var(--space-6); }
.hero h1 { font-size: var(--fs-5xl); max-width: 24ch; letter-spacing: -.035em; }
.hero p.lede { font-size: var(--fs-lg); color: var(--text-secondary); max-width: 62ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-default); max-width: 780px; }
.hero-stat b { display: block; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.02em; }
.hero-stat span { font-size: var(--fs-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }

.searchbar { position: relative; display: flex; gap: var(--space-2); max-width: 620px; }
.searchbar input { height: 52px; border-radius: var(--radius-pill); padding-left: var(--space-4); }
.searchbar .btn { border-radius: var(--radius-pill); min-height: 52px; padding: 0 var(--space-4); }



/* ---------- 8. Cards ---------- */
.card {
  background: var(--surface-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow-xs);
}
.card-flat { background: var(--surface-muted); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-4); }
.grid { display: grid; gap: var(--space-3); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* logo tile: official vendor icon with initials fallback underneath */
.logo-badge {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; overflow: hidden;
  background: var(--surface-base); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.logo-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #ffffff; font-weight: var(--fw-bold); letter-spacing: -.02em;
  opacity: 0; transition: opacity var(--motion-fast) linear;
}
.logo-badge.logo-failed .logo-fallback { opacity: 1; }
.logo-img { position: relative; z-index: 1; width: 68%; height: 68%; object-fit: contain; }
[data-theme="dark"] .logo-badge { background: #ffffff; border-color: var(--border-default); }

/* deal card - grid variant */
.deal-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); background: var(--surface-raised);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  transition: border-color var(--motion-base) linear, box-shadow var(--motion-base) linear, transform var(--motion-base) linear;
}
.deal-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.deal-card:focus-within { border-color: var(--focus-ring); }
.deal-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.deal-title { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -.02em; }
.deal-title a:hover { color: var(--accent); }
.deal-members { font-size: var(--fs-xs); color: var(--text-secondary); }
.deal-summary { font-size: var(--fs-sm); color: var(--text-primary); min-height: 40px; }
.offer-line { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-tertiary); letter-spacing: -.01em; }
.save-line { font-size: var(--fs-sm); color: var(--text-secondary); }
.deal-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.deal-card.is-locked .offer-line { filter: blur(5px); user-select: none; }
.lock-pill { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--pro); background: var(--pro-soft); padding: 2px var(--space-2); border-radius: var(--radius-xs); }

/* deal card - list variant */
.view-list .deal-grid { grid-template-columns: 1fr; }
.view-list .deal-card { flex-direction: row; align-items: center; gap: var(--space-4); }
.view-list .deal-card .deal-summary { min-height: 0; }
.view-list .deal-foot { border: 0; padding: 0; margin: 0; flex: 0 0 auto; }

.stars { display: inline-flex; gap: 2px; font-size: var(--fs-sm); line-height: 1; white-space: nowrap; color: var(--star); }
.stars .star { opacity: .25; }
.stars .star.on { opacity: 1; }

/* ---------- 9. Marketplace / explore shell ---------- */
.explore-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: var(--space-5); align-items: start; padding: var(--space-5) 0 var(--space-7); }
.cat-side { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; padding-right: var(--space-2); }
.cat-side h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); }
.cat-group { border-bottom: 1px solid var(--border-default); }
.cat-group > a, .cat-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary); list-style: none;
}
.cat-group > summary::-webkit-details-marker { display: none; }
.cat-group > summary:hover, .cat-group > a:hover { background: var(--surface-muted); }
.cat-group[open] > summary { color: var(--text-primary); font-weight: var(--fw-semibold); }
.cat-group .sub { padding: 0 0 var(--space-2) var(--space-3); display: grid; gap: 2px; }
.cat-group .sub a { display: block; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-secondary); }
.cat-group .sub a:hover { color: var(--text-primary); background: var(--surface-muted); }
.cat-group .sub a.is-active { color: var(--accent); font-weight: var(--fw-medium); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); justify-content: space-between; margin-bottom: var(--space-4); }
.sort-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sort-tabs a {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); background: var(--surface-base);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary);
}
.sort-tabs a:hover { background: var(--surface-muted); }
.sort-tabs a.is-active { background: var(--surface-inverse); color: var(--text-inverse); border-color: var(--surface-inverse); }
.results-count { font-size: var(--fs-sm); color: var(--text-secondary); }
.view-toggle { display: inline-flex; border: 1px solid var(--border-default); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { width: 38px; height: 34px; display: grid; place-items: center; background: var(--surface-base); border: 0; cursor: pointer; color: var(--text-secondary); }
.view-toggle button + button { border-left: 1px solid var(--border-default); }
.view-toggle button.is-active { background: var(--surface-inverse); color: var(--text-inverse); }
.deal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.notice-strip { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-muted); margin-bottom: var(--space-4); font-size: var(--fs-sm); }
.empty { padding: var(--space-6); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-secondary); }
.skeleton { background: var(--skeleton); border-radius: var(--radius-sm); height: 14px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- 10. Deal detail (JoinSecret 1:1 Standard) ---------- */
.js-deal-page { width: 100%; }

/* Header Hero with Gray Background */
.js-header-hero {
  background-color: var(--surface-muted); border-bottom: 1px solid var(--border-default);
  padding: 32px 0 48px; position: relative;
}

/* Breadcrumbs */
.js-breadcrumb {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-secondary); margin-bottom: 24px; flex-wrap: wrap;
}
.js-breadcrumb a { color: var(--text-secondary); text-decoration: none; transition: color var(--motion-fast) var(--ease); }
.js-breadcrumb a:hover { color: var(--text-primary); }
.js-breadcrumb .sep { color: var(--border-strong); }
.js-breadcrumb .current { color: var(--text-primary); font-weight: var(--fw-semibold); }

/* Hero Grid: Left Content (60%) + Right Aside (40%) */
.js-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  gap: 48px; align-items: start;
}

.js-hero-left { display: flex; flex-direction: column; }

/* Dual Circular Logos (Vendor & Platform) */
.js-partner-logos { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.js-logo-circle {
  width: 48px; height: 48px; border-radius: 50%; background: #ffffff;
  border: 2px solid var(--border-default); display: flex; align-items: center;
  justify-content: center; overflow: hidden; box-shadow: var(--shadow-xs);
}
.js-logo-platform { background: var(--surface-inverse); color: var(--text-inverse); }
.js-platform-symbol { font-weight: 800; font-size: 14px; letter-spacing: -0.02em; }
.js-ampersand { font-size: 20px; font-weight: 600; color: var(--text-secondary); }

.js-deal-title {
  font-size: 38px; font-weight: 800; letter-spacing: -0.035em;
  color: var(--text-primary); margin: 0 0 10px; line-height: 1.15;
}
.js-deal-tagline { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin: 0 0 10px; }
.js-deal-desc { font-size: 14.5px; line-height: 1.6; color: var(--text-primary); margin: 0 0 18px; }

/* Social proof stack */
.js-social-proof { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 13.5px; }
.js-avatar-stack { display: flex; }
.js-stacked-avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface-base);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  margin-left: -8px; background: var(--surface-base); box-shadow: var(--shadow-xs);
}
.js-stacked-avatar:first-child { margin-left: 0; }
.js-proof-text { margin: 0; }

/* Hero Testimonial Quote Card */
.js-hero-quote-card {
  display: flex; gap: 16px; padding: 18px 22px; background: var(--surface-base);
  border: 1px solid var(--border-default); border-radius: 16px;
  box-shadow: var(--shadow-xs); margin-top: 10px;
}
.js-quote-mark {
  font-size: 52px; font-weight: 800; color: var(--text-tertiary);
  line-height: 0.8; font-family: Georgia, serif; user-select: none;
}
.js-quote-content { flex: 1; }
.js-quote-text {
  font-size: 13.5px; font-style: italic; color: var(--text-primary);
  line-height: 1.55; margin: 0 0 10px;
}
.js-quote-author { display: flex; align-items: center; gap: 10px; }
.js-author-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-inverse);
  color: var(--text-inverse); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.js-author-info strong { display: block; font-size: 13px; color: var(--text-primary); }
.js-author-info span { display: block; font-size: 11.5px; color: var(--text-secondary); }

/* Right Hero Aside Card (JoinSecret Dashed Border Signature) */
.js-aside-card {
  background: var(--surface-base); border: 2px dashed var(--border-strong);
  border-radius: 22px; padding: 28px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 18px;
}
.js-aside-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.js-aside-vendor { display: flex; align-items: center; gap: 12px; }
.js-aside-vendor-name { font-size: 18px; font-weight: 700; color: var(--text-primary); display: block; }
.js-aside-stars { display: flex; align-items: center; gap: 4px; font-size: 12.5px; margin-top: 2px; }
.js-aside-actions { display: flex; align-items: center; gap: 6px; }
.js-action-icon-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface-muted);
  border: 1px solid var(--border-default); display: flex; align-items: center;
  justify-content: center; color: var(--text-secondary); cursor: pointer;
  text-decoration: none; transition: all var(--motion-fast) var(--ease);
}
.js-action-icon-btn:hover {
  background: var(--surface-base); color: var(--text-primary);
  border-color: var(--border-strong); transform: translateY(-1px);
}
.js-action-icon-btn.is-saved { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.js-aside-savings { margin-top: 4px; }
.js-save-tag {
  font-size: 13.5px; font-weight: 700; color: #00c06d;
  letter-spacing: 0.02em; margin-bottom: 6px;
}
.js-save-offer {
  font-size: 22px; font-weight: 800; color: var(--text-primary);
  line-height: 1.3; margin: 0; letter-spacing: -0.02em;
}

.js-code-box {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px; background: var(--surface-muted);
  border: 1px solid var(--border-default); border-radius: 10px;
}
.js-code-text {
  font-family: var(--font-mono); font-size: 16px; font-weight: 700;
  color: var(--text-primary); letter-spacing: 0.06em;
}

/* JoinSecret Signature Button */
.btn-success-deal {
  background: #00c06d; color: #ffffff; font-size: 16px; font-weight: 700;
  padding: 14px 24px; border-radius: 12px; border: 0; display: inline-flex;
  align-items: center; justify-content: center; text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 192, 109, 0.3); transition: all var(--motion-fast) var(--ease);
  cursor: pointer; text-align: center;
}
.btn-success-deal:hover {
  background: #00a85f; transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 192, 109, 0.4); color: #ffffff;
}

.js-aside-specs {
  display: flex; flex-direction: column; gap: 8px; font-size: 13px;
  padding: 14px; background: var(--surface-muted); border-radius: 12px;
  border: 1px solid var(--border-default);
}
.js-spec-item { display: flex; justify-content: space-between; align-items: center; }
.js-spec-item .label { color: var(--text-secondary); }
.js-spec-item .val { font-weight: 600; color: var(--text-primary); }
.js-aside-guarantee {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--text-secondary); padding-top: 10px; border-top: 1px solid var(--border-default);
}
.js-aside-guarantee svg { color: #00c06d; flex-shrink: 0; }

/* Mid-Banner (Save Big on 300+ SaaS) */
.js-explore-banner-wrap {
  position: relative; z-index: 10; margin-top: -24px; margin-bottom: 24px;
}
.js-explore-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: var(--surface-base); border: 2px solid var(--border-default);
  border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); flex-wrap: wrap;
}
.js-banner-logos { display: flex; gap: 6px; flex-wrap: wrap; }
.js-pill-brand {
  padding: 4px 10px; background: var(--surface-muted); border-radius: 20px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border-default);
  color: var(--text-primary);
}
.js-banner-text { font-size: 14.5px; margin: 0; color: var(--text-primary); }

/* Sticky Navigation Tabs (JoinSecret Tab Bar) */
.js-sticky-nav {
  position: sticky; top: 60px; z-index: 30;
  background: color-mix(in srgb, var(--surface-base) 92%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-default);
}
.js-tabs-bar {
  display: flex; align-items: center; justify-content: center; gap: 28px;
  overflow-x: auto; padding: 14px 0; scrollbar-width: none;
}
.js-tabs-bar::-webkit-scrollbar { display: none; }
.js-tab {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  text-decoration: none; padding: 6px 0; position: relative; white-space: nowrap;
  transition: color var(--motion-fast) var(--ease);
}
.js-tab:hover, .js-tab.is-active { color: var(--text-primary); }
.js-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px;
  height: 3px; background: var(--text-primary); border-radius: 3px 3px 0 0;
}

/* Body Content Layout */
.js-body-layout { padding: 48px 0 80px; }
.js-main-content {
  display: flex; flex-direction: column; gap: 56px; max-width: 920px; margin: 0 auto;
}
.js-section { scroll-margin-top: 130px; }
.js-section-title {
  font-size: 24px; font-weight: 800; color: var(--text-primary);
  letter-spacing: -0.025em; margin: 0 0 16px;
}
.js-prose-text { font-size: 15px; line-height: 1.7; color: var(--text-primary); }
.js-prose-text p { margin: 0 0 12px; }

/* Deals Action Card */
.js-deal-action-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; background: var(--surface-base); border: 2px solid var(--border-default);
  border-radius: 18px; box-shadow: var(--shadow-sm); flex-wrap: wrap;
}
.js-deal-card-left { display: flex; align-items: center; gap: 16px; }
.js-action-card-title { font-size: 16px; font-weight: 700; margin: 0 0 2px; color: var(--text-primary); }

/* 3-Step Redemption Columns */
.js-steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.js-step-col {
  padding: 20px; background: var(--surface-muted); border-radius: 16px;
  border: 1px solid var(--border-default);
}
.js-step-number {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-inverse);
  color: var(--text-inverse); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; margin-bottom: 12px;
}
.js-step-col h4 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.js-step-col p { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }

/* Expert Review Card (JoinSecret Style) */
.js-expert-review-card {
  background: var(--surface-muted); border: 1px solid var(--border-default);
  border-radius: 20px; overflow: hidden;
}
.js-expert-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border-default);
  display: flex; align-items: center; gap: 14px;
}
.js-expert-logos { display: flex; align-items: center; gap: 8px; }
.js-expert-badge {
  width: 36px; height: 36px; border-radius: 50%; background: #111827;
  color: #ffffff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
}
.js-expert-title { font-size: 18px; font-weight: 700; margin: 0; color: var(--text-primary); }
.js-expert-body {
  padding: 24px; display: flex; flex-direction: column; gap: 16px;
  font-size: 14px; line-height: 1.6;
}
.js-expert-item strong { display: block; color: var(--text-primary); font-size: 14.5px; margin-bottom: 4px; }
.js-expert-item p { margin: 0; color: var(--text-secondary); }
.js-expert-footer {
  padding: 16px 24px; background: var(--surface-base); border-top: 1px solid var(--border-default);
  display: flex; align-items: center; gap: 12px;
}
.js-expert-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface-muted);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}

/* FAQ Accordion */
.js-faq-list { display: flex; flex-direction: column; }
.js-faq-item { border-bottom: 1px solid var(--border-default); padding: 18px 0; }
.js-faq-q {
  font-size: 16px; font-weight: 600; color: var(--text-primary); cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.js-faq-q::-webkit-details-marker { display: none; }
.js-faq-icon { font-size: 20px; font-weight: 400; color: var(--text-secondary); }
.js-faq-item[open] .js-faq-icon { transform: rotate(45deg); }
.js-faq-a { padding-top: 12px; font-size: 14.5px; color: var(--text-secondary); line-height: 1.6; }
.js-faq-a p { margin: 0; }

/* Pricing Table */
.js-pricing-table { display: flex; flex-direction: column; gap: 14px; }
.js-price-row {
  display: grid; grid-template-columns: 220px 1fr; border: 1px solid var(--border-default);
  border-radius: 14px; overflow: hidden; background: var(--surface-base);
}
.js-price-plan {
  padding: 24px; background: var(--surface-muted); border-right: 1px solid var(--border-default);
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.js-price-plan strong { font-size: 16px; color: var(--text-primary); }
.js-price-tag { font-size: 28px; font-weight: 800; color: var(--text-primary); margin-top: 4px; }
.js-price-perks {
  padding: 24px; display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; justify-content: center;
}
.js-price-perks p { margin: 0; color: var(--text-primary); }

/* Features List */
.js-features-list {
  list-style: none; padding: 0; margin: 0; display: flex;
  flex-direction: column; gap: 20px;
}
.js-feature-row { display: flex; gap: 14px; align-items: flex-start; }
.js-feature-bullet {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft);
  color: #00c06d; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0; margin-top: 2px;
}
.js-feature-row strong { font-size: 15px; color: var(--text-primary); display: block; margin-bottom: 2px; }
.js-feature-row p { margin: 0; font-size: 13.5px; line-height: 1.5; }

/* Reviews List */
.js-section-header-flex {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.js-reviews-summary-line { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.js-reviews-list {
  display: flex; flex-direction: column; gap: 24px;
  border-top: 1px solid var(--border-default); padding-top: 24px;
}
.js-review-item { border-bottom: 1px solid var(--border-default); padding-bottom: 24px; }
.js-review-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.js-review-headline { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 6px; }
.js-review-text { font-size: 14px; line-height: 1.6; color: var(--text-primary); margin: 0; }
.js-write-review-card {
  padding: 24px; background: var(--surface-muted);
  border-radius: 16px; border: 1px solid var(--border-default);
}
.js-review-form-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; }

/* Pros & Cons Grid */
.js-pros-cons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.js-pros-box, .js-cons-box {
  padding: 24px; background: var(--surface-base); border: 1px solid var(--border-default);
  border-radius: 16px;
}
.js-pro-label { color: #00c06d; font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.js-con-label { color: #ef4444; font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.js-pro-list, .js-con-list {
  list-style: none; padding: 0; margin: 0; display: flex;
  flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.5;
}
.icon-pro { color: #00c06d; font-weight: 800; margin-right: 6px; }
.icon-con { color: #ef4444; font-weight: 800; margin-right: 6px; }

/* Alternatives Cards */
.js-alt-card {
  padding: 22px; background: var(--surface-base); border: 2px solid var(--border-default);
  border-radius: 16px; display: flex; flex-direction: column; justify-content: space-between;
  gap: 14px; transition: border-color 120ms ease;
}
.js-alt-card:hover { border-color: var(--border-strong); }
.js-alt-head { display: flex; align-items: center; gap: 12px; }
.js-alt-name { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
.js-alt-name a { color: var(--text-primary); text-decoration: none; }
.js-alt-offer { font-size: 13.5px; color: var(--text-secondary); margin: 0; line-height: 1.45; }
.js-alt-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border-default);
}
.js-alt-save { font-size: 13px; font-weight: 700; color: #00c06d; }

@media (max-width: 1080px) {
  .js-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .js-price-row { grid-template-columns: 1fr; }
  .js-price-plan { border-right: 0; border-bottom: 1px solid var(--border-default); }
}
@media (max-width: 768px) {
  .js-deal-title { font-size: 28px; }
  .js-steps-row { grid-template-columns: 1fr; }
  .js-pros-cons-grid { grid-template-columns: 1fr; }
  .js-tabs-bar { justify-content: flex-start; gap: 18px; }
}

/* ---------- 11. Pricing ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; }
.plan-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--surface-raised); }
.plan-card.is-featured { border-color: var(--pro); box-shadow: var(--shadow-md); }
.plan-price { font-size: var(--fs-5xl); font-weight: var(--fw-semibold); letter-spacing: -.04em; line-height: 1; }
.plan-price small { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-secondary); letter-spacing: 0; }
.ticks { display: grid; gap: var(--space-2); font-size: var(--fs-sm); }
.ticks li, .check { display: flex; gap: var(--space-2); align-items: flex-start; list-style: none; }
.ticks { padding: 0; margin: 0; }
.check::before, .ticks li::before { content: "✓"; color: var(--accent); font-weight: var(--fw-bold); }

/* ---------- 12. Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: var(--space-6); align-items: center; padding: var(--space-6) 0 var(--space-7); }
.auth-card { background: var(--surface-raised); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.auth-aside { padding: var(--space-4); }

/* ---------- 13. Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--surface-muted); border-right: 1px solid var(--border-default); padding: var(--space-4) var(--space-3); }
.admin-brand {
  display: inline-flex; align-items: center; padding: 4px 8px;
  margin-bottom: var(--space-4); background: transparent; text-decoration: none;
}
.admin-main { padding: var(--space-4) var(--space-5) var(--space-7); min-width: 0; }
.admin-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.side-label { margin: var(--space-4) 0 var(--space-1); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); }
.nav-link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-primary); }
.nav-link:hover { background: var(--surface-base); }
.nav-link.is-active { background: var(--surface-inverse); color: var(--text-inverse); font-weight: var(--fw-medium); }
.stat-card { padding: var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-raised); }
.stat-card b { display: block; font-size: var(--fs-3xl); font-weight: var(--fw-semibold); letter-spacing: -.03em; }
.stat-card span { font-size: var(--fs-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 60px; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); padding: var(--space-1) 0; }
.bar { background: var(--surface-sunken); border-radius: var(--radius-pill); height: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--pro)); border-radius: var(--radius-pill); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-raised); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.data th, table.data td { padding: var(--space-2) var(--space-3); text-align: left; border-bottom: 1px solid var(--border-default); vertical-align: middle; }
table.data th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); background: var(--surface-muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-muted); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.tabs a { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); border: 1px solid var(--border-default); }
.tabs a.is-active { background: var(--surface-inverse); color: var(--text-inverse); border-color: var(--surface-inverse); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filters input, .filters select { min-height: 38px; width: auto; min-width: 160px; }

/* ---------- 14. Toast ---------- */
.toast-host { position: fixed; right: var(--space-3); bottom: var(--space-3); z-index: 90; display: grid; gap: var(--space-2); }
.toast { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface-inverse); color: var(--text-inverse); font-size: var(--fs-sm); box-shadow: var(--shadow-lg); animation: toast-in var(--motion-base) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- 15. Responsive ---------- */
@media (max-width: 1080px) {
  .explore-shell { grid-template-columns: 1fr; }
  .cat-side { position: static; max-height: none; }
  .deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deal-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--border-default); }
}
@media (max-width: 860px) {
  .header-search { display: none; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface-raised); border-bottom: 1px solid var(--border-default);
    padding: var(--space-2); box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .mega { position: static; width: auto; display: none !important; }
  .hero h1 { font-size: var(--fs-4xl); }
  .hero-stats { gap: var(--space-4); }
  .grid-3, .grid-4, .deal-grid { grid-template-columns: 1fr; }
  .view-list .deal-card { flex-direction: column; align-items: flex-start; }
  .section { padding: var(--space-5) 0; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: var(--fs-3xl); }
}
@media print {
  .site-header, .site-footer, .topbar, .toast-host { display: none; }
}

/* ============================================================
   16. v4 - logo stacks, category cards, mega menu, theme switch,
       auth modal, deal detail. Tokens only, no raw one-offs.
   ============================================================ */

.logo-badge.logo-sm { width: 34px; height: 34px; font-size: 11px; border-radius: var(--radius-sm); flex: 0 0 auto; }
.logo-stack { display: inline-flex; align-items: center; }
.logo-stack .logo-badge { margin-right: -10px; box-shadow: 0 0 0 2px var(--surface-base); }
.logo-stack .logo-badge:last-child { margin-right: 0; }
.clamp-1 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- category cards ---------------------------------------- */
.cat-card {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); background: var(--surface-base);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  text-decoration: none; color: var(--text-primary);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.cat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.cat-card:active { transform: translateY(0); }
.cat-name { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.cat-desc { font-size: var(--fs-sm); color: var(--text-secondary); }
.cat-meta { font-size: var(--fs-sm); color: var(--text-secondary); }
.cat-meta strong { color: var(--text-primary); }
.cat-subs { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: auto; }
.cat-subs .chip { font-size: var(--fs-xs); padding: 2px var(--space-2); }

/* --- mega menu: JoinSecret-style professional sticky & hover architecture --- */
.nav-item { position: relative; }
.nav-item > button .caret {
  display: inline-block; width: 7px; height: 7px; margin-left: 5px;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform var(--motion-fast) var(--ease);
}
.nav-item.is-open > button .caret { transform: rotate(225deg) translateY(-2px); }
.nav-item.is-open > button { color: var(--text-primary); background: var(--surface-muted); }

.mega {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 120;
  width: 960px; max-width: calc(100vw - 32px); min-height: 480px;
  background: var(--surface-base); border: 1px solid var(--border-default);
  border-radius: 16px; box-shadow: 0 20px 48px -10px rgba(16, 18, 22, 0.16), 0 1px 3px rgba(16, 18, 22, 0.06);
  opacity: 0; visibility: hidden; transform: translateY(6px); pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease), visibility var(--motion-fast);
  display: grid; grid-template-columns: 260px 1fr; grid-template-rows: 1fr auto;
  overflow: hidden;
}

/* Invisible hover bridge connecting button and dropdown */
.mega::before {
  content: ""; position: absolute; top: -16px; left: 0; right: 0; height: 16px;
  background: transparent; pointer-events: auto;
}

.nav-item.is-open > .mega {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}

/* Left categories column */
.mega-cats {
  background: var(--surface-muted); border-right: 1px solid var(--border-default);
  padding: 10px 8px; display: flex; flex-direction: column; gap: 2px;
  max-height: 490px; overflow-y: auto; scrollbar-width: thin;
}
.mega-cats::-webkit-scrollbar { width: 4px; }
.mega-cats::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.mega-cat-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 10px; font-size: 13.5px; font-weight: 500;
  color: var(--text-primary); text-decoration: none;
  transition: all var(--motion-fast) var(--ease); cursor: pointer;
  border: 1px solid transparent; user-select: none;
}
.mega-cat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; color: var(--text-secondary); flex-shrink: 0;
  transition: color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.mega-cat-name { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mega-cat-count {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--text-secondary) 14%, transparent);
  color: var(--text-secondary); transition: all var(--motion-fast) var(--ease);
}

.mega-cat-item:hover, .mega-cat-item.is-active {
  background: var(--surface-base); color: var(--text-primary);
  box-shadow: var(--shadow-xs); border-color: var(--border-default);
}
.mega-cat-item:hover .mega-cat-icon, .mega-cat-item.is-active .mega-cat-icon {
  color: var(--accent); transform: scale(1.08);
}
.mega-cat-item:hover .mega-cat-count, .mega-cat-item.is-active .mega-cat-count {
  background: var(--accent-soft); color: var(--accent);
}

/* Right Panels */
.mega-panels { position: relative; background: var(--surface-base); display: flex; flex-direction: column; }
.mega-panel {
  padding: 22px 26px; display: flex; flex-direction: column; gap: 18px; height: 100%;
}
.mega-panel[hidden] { display: none !important; }

/* Panel Header */
.mega-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border-default);
}
.mega-head-title { display: flex; align-items: center; gap: 10px; }
.mega-head-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); flex-shrink: 0;
}
.mega-head-title h4 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.badge-subtle {
  font-size: 11.5px; font-weight: 600; background: var(--surface-muted);
  color: var(--text-secondary); border: 1px solid var(--border-default);
  padding: 2px 8px; border-radius: 999px;
}
.mega-head-all {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--accent); text-decoration: none;
  transition: gap var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
  white-space: nowrap;
}
.mega-head-all:hover { color: var(--accent-hover); gap: 9px; }

/* Columns: Subcategories & Top Deals */
.mega-cols {
  display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start;
}
.mega-subcats { display: flex; flex-direction: column; }
.mega-label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 10px;
}
.mega-subcat-links { display: flex; flex-direction: column; gap: 2px; }
.mega-subcat-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-primary); text-decoration: none;
  transition: all var(--motion-fast) var(--ease); line-height: 1.35;
}
.mega-subcat-bullet {
  width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong);
  flex-shrink: 0; transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.mega-subcat-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mega-subcat-item:hover { background: var(--surface-muted); color: var(--accent); transform: translateX(2px); }
.mega-subcat-item:hover .mega-subcat-bullet { background: var(--accent); transform: scale(1.4); }

/* Top Deals Grid */
.mega-deals-section { display: flex; flex-direction: column; }
.mega-deals-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mega-deal-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--surface-base); border: 1px solid var(--border-default);
  border-radius: 12px; text-decoration: none; color: var(--text-primary);
  transition: all var(--motion-fast) var(--ease); box-shadow: var(--shadow-xs);
  min-width: 0;
}
.mega-deal-card:hover {
  border-color: var(--border-strong); background: var(--surface-muted);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.mega-deal-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.mega-deal-title-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mega-deal-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge-sm { font-size: 10px; line-height: 14px; padding: 1px 5px; }
.mega-deal-offer {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mega-empty-deals {
  grid-column: 1 / -1; padding: 16px; text-align: center;
  font-size: 13px; color: var(--text-secondary); background: var(--surface-muted); border-radius: 8px;
}

/* Bottom Footer Bar */
.mega-foot {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px; background: var(--surface-muted); border-top: 1px solid var(--border-default);
}
.mega-foot-left { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.mega-label-inline {
  font-size: 11.5px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.mega-fresh-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mega-fresh-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--surface-base); border: 1px solid var(--border-default);
  border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text-primary);
  text-decoration: none; transition: all var(--motion-fast) var(--ease);
}
.mega-fresh-chip:hover {
  border-color: var(--border-strong); transform: translateY(-1px);
  box-shadow: var(--shadow-xs); color: var(--accent);
}
.mega-explore-btn { white-space: nowrap; border-radius: 999px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; }

/* --- theme switch ------------------------------------------ */
.theme-switch { border: 0; background: none; padding: 0; cursor: pointer; line-height: 0; border-radius: var(--radius-pill); }
.theme-switch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.theme-track { position: relative; display: inline-flex; align-items: center; justify-content: space-between;
  width: 62px; height: 30px; padding: 0 var(--space-2); border-radius: var(--radius-pill);
  background: var(--surface-muted); border: 1px solid var(--border-default); }
.theme-ico { position: relative; z-index: 2; display: inline-flex; color: var(--text-secondary);
  transition: color var(--motion-fast) var(--ease); }
.theme-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-base); box-shadow: var(--shadow-sm); z-index: 1;
  transition: transform var(--motion-base) var(--ease); }
[data-theme="dark"] .theme-knob { transform: translateX(30px); }
[data-theme="light"] .theme-sun { color: var(--accent); }
[data-theme="dark"] .theme-moon { color: var(--accent); }
.theme-switch:hover .theme-track { border-color: var(--border-strong); }

/* --- auth modal -------------------------------------------- */
.auth-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.auth-modal[hidden] { display: none; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 10, .55); backdrop-filter: blur(3px); }
.auth-dialog { position: relative; width: min(430px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--surface-base); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--space-5);
  animation: authIn var(--motion-base) var(--ease); }
@keyframes authIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-dialog { animation: none; } }
.auth-x { position: absolute; top: var(--space-3); right: var(--space-3); width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: none; color: var(--text-secondary); cursor: pointer; }
.auth-x:hover { background: var(--surface-muted); color: var(--text-primary); }
.auth-x:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.auth-modal-brand { margin-bottom: var(--space-4); }
.auth-tabs { display: flex; gap: var(--space-1); padding: var(--space-1); background: var(--surface-muted);
  border-radius: var(--radius-pill); margin-bottom: var(--space-4); }
.auth-tabs button { flex: 1 1 0; border: 0; background: none; cursor: pointer; padding: var(--space-2);
  border-radius: var(--radius-pill); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--text-secondary); transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease); }
.auth-tabs button[aria-selected="true"] { background: var(--surface-base); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.auth-tabs button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.auth-pane h2 { font-size: var(--fs-2xl); margin: 0 0 var(--space-1); }
.auth-pane[hidden] { display: none; }
.auth-modal-foot { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4);
  padding-top: var(--space-3); border-top: 1px solid var(--border-default);
  font-size: var(--fs-xs); color: var(--text-secondary); }
.tick::before { content: "¹3"; color: var(--accent); margin-right: 4px; font-weight: var(--fw-bold); }
body.is-modal-open { overflow: hidden; }

@media (max-width: 1080px) {
  .mega { width: min(860px, calc(100vw - 32px)); }
  .mega-cols { grid-template-columns: 180px 1fr; gap: 16px; }
  .mega-deals-grid { grid-template-columns: 1fr; }
  .deal-layout { grid-template-columns: 1fr; }
  .deal-sidebar-sticky { position: static; }
}
@media (max-width: 860px) {
  .nav-item > .mega { position: static; width: 100%; max-width: 100%; display: none !important; }
}
@media (max-width: 768px) {
  .deal-hero-card { padding: 20px; }
  .deal-hero-main { flex-direction: column; gap: 16px; }
  .redemption-steps-grid { grid-template-columns: 1fr; }
  .deal-features-grid { grid-template-columns: 1fr; }
  .deal-hero-title { font-size: 24px; }
}
