/* ============================================================
   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; }

/* Site-wide guard against accidental horizontal scroll on small screens.
   `clip` (not `hidden`) so it never creates a scroll container - keeps the
   sticky header working - with `hidden` as the fallback for old browsers. */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }

/* 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); }
/* Rating stars share the .star class with the decorative twinkling stars
   above - reset the absolute-positioning/glow so they lay out as inline glyphs. */
.stars .star { position: static; background: none; box-shadow: none; border-radius: 0; animation: none; 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; min-width: 0; }

/* 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;
  overflow-wrap: break-word;
}
.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;
}
/* Locked coupon teaser shown to signed-out visitors */
.js-code-locked { border-style: dashed; }
.js-code-blur { filter: blur(5px); user-select: none; pointer-events: none; }
.js-code-lock { font-size: 15px; line-height: 1; opacity: .75; }
.js-auth-hint { margin: 10px 0 0; text-align: center; font-size: var(--fs-sm); color: var(--text-secondary); }
.js-auth-hint a { color: var(--text-primary); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* 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 var(--space-4) 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; gap: 14px;
}
.js-faq-q > span:first-child { min-width: 0; overflow-wrap: break-word; }
.js-faq-q::-webkit-details-marker { display: none; }
.js-faq-icon { font-size: 20px; font-weight: 400; color: var(--text-secondary); flex-shrink: 0; }
.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: minmax(0, 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: 950; 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; }
}
/* Auth/account links that fold into the slide-out menu on phones (hidden elsewhere). */
.nav-mobile-actions { display: none; }

@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: repeat(2, minmax(0, 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-3, .grid-4, .deal-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: var(--fs-3xl); }
  /* 16px form controls stop iOS Safari from zooming in when a field is focused */
  input[type="text"], input[type="email"], input[type="password"], input[type="url"],
  input[type="number"], input[type="date"], input[type="search"], select, textarea { font-size: 16px; }
  /* comfortable min tap height for the small buttons on touch screens */
  .btn-sm { min-height: 40px; }

  /* The header row is too narrow for every action on a phone - keep only the
     primary CTA + hamburger in the bar, fold the rest into the slide-out menu
     so the hamburger can never be pushed off-screen. */
  .header-actions > .theme-switch,
  .header-actions > .btn-ghost,
  .header-actions > .btn-soft,
  .header-actions > .btn-pro,
  .header-actions > .badge,
  .header-actions > .icon-btn:not(.menu-toggle) { display: none; }
  .header-actions { gap: var(--space-2); }

  .nav-mobile-actions { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding: 8px 4px 2px; border-top: 1px solid var(--border-default); }
  .nav-mobile-actions a,
  .nav-mobile-actions button {
    width: 100%; text-align: left; padding: 12px; border: 0; background: none; cursor: pointer;
    border-radius: var(--radius-sm); text-decoration: none;
    font: var(--fw-medium) var(--fs-md)/1 var(--font-sans); color: var(--text-primary);
  }
  .nav-mobile-actions a:hover,
  .nav-mobile-actions button:hover { background: var(--surface-muted); }
  .nav-mobile-cta { background: var(--accent); color: #fff !important; font-weight: var(--fw-semibold); text-align: center !important; }
  .nav-mobile-theme { color: var(--text-secondary) !important; }
}
@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: "✓"; 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; }
}

/* ============================================================
   14. Live chat - launcher, panel, thread, composer
   Monochrome by design: ink (near-black), paper (white) and cream.
   No brand green or accent hues inside the chat surfaces.
   ============================================================ */
.chat-widget, .chat-admin {
  --chat-ink: #16150f;          /* primary solid: outgoing bubbles, buttons */
  --chat-on-ink: #fdfcf8;       /* text/icons on ink */
  --chat-cream: #f6f2e8;        /* thread background */
  --chat-paper: #ffffff;        /* incoming bubbles, composer */
  --chat-line: #e4ded1;         /* hairlines */
  --chat-line-strong: #cfc7b6;
  --chat-dim: #6f6a5d;          /* secondary text */
  --chat-head-bg: #16150f;
  --chat-head-fg: #fdfcf8;
  --chat-launch-bg: #16150f;
  --chat-launch-fg: #fdfcf8;
}
[data-theme="dark"] .chat-widget, [data-theme="dark"] .chat-admin {
  --chat-ink: #efe9db;
  --chat-on-ink: #14130f;
  --chat-cream: #131210;
  --chat-paper: #1c1b17;
  --chat-line: #2f2d27;
  --chat-line-strong: #434038;
  --chat-dim: #9c968a;
  --chat-head-bg: #1f1e19;
  --chat-head-fg: #f4efe4;
  --chat-launch-bg: #efe9db;
  --chat-launch-fg: #14130f;
}

.chat-widget {
  --chat-w: 384px;
  --chat-h: 626px;
  --chat-r: 20px;
  position: fixed; right: 24px; bottom: 24px; z-index: 940;
  font-family: var(--font-sans);
}

/* ---- launcher ---- */
.chat-launcher {
  position: relative; width: 62px; height: 62px; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--chat-launch-bg); border: 1px solid var(--chat-line-strong);
  box-shadow: 0 12px 32px rgba(22, 21, 15, .26), 0 2px 8px rgba(22, 21, 15, .14);
  display: grid; place-items: center;
  transition: transform var(--motion-slow) var(--ease), box-shadow var(--motion-slow) var(--ease);
}
.chat-launcher:hover { transform: translateY(-3px) scale(1.045); box-shadow: 0 18px 40px rgba(22, 21, 15, .32); }
.chat-launcher:active { transform: translateY(-1px) scale(.98); }
.chat-launcher:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

.chat-launcher-badge {
  position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--chat-launch-fg); color: var(--chat-launch-bg);
  font-size: 11px; font-weight: var(--fw-bold); line-height: 1;
  display: none; align-items: center; justify-content: center;
  border: 2.5px solid var(--chat-launch-bg); box-shadow: var(--shadow-sm);
}
.chat-launcher-badge.is-on { display: flex; animation: chat-pop .3s var(--ease); }
@keyframes chat-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.chat-ping { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.chat-ping.is-on::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--chat-launch-bg); animation: chat-ping 1.9s var(--ease) infinite;
}
@keyframes chat-ping { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---- panel ---- */
.chat-panel {
  position: absolute; right: 0; bottom: 78px;
  width: var(--chat-w); max-width: calc(100vw - 32px);
  height: min(var(--chat-h), calc(100vh - 152px));
  background: var(--chat-paper); border: 1px solid var(--chat-line); border-radius: var(--chat-r);
  box-shadow: 0 28px 68px rgba(22, 21, 15, .20), 0 4px 12px rgba(22, 21, 15, .07);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.96); transform-origin: 100% 100%;
  transition: opacity var(--motion-slow) var(--ease), transform var(--motion-slow) var(--ease), visibility var(--motion-slow);
}
.chat-widget.is-open .chat-panel { opacity: 1; visibility: visible; transform: none; }

/* ---- header ---- */
.chat-head-avatar { position: relative; width: 42px; height: 42px; flex-shrink: 0; }
.chat-head-avatar img { width: 42px; height: 42px; display: block; }
.chat-head-avatar::after {
  content: ""; position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--chat-head-fg); border: 2.5px solid var(--chat-head-bg);
}
.chat-widget[data-online="0"] .chat-head-avatar::after { background: var(--chat-dim); }
.chat-head-text { flex: 1; min-width: 0; line-height: 1.3; }
.chat-head-name { display: block; font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.chat-head-status { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .72; margin-top: 1px; }
.chat-head-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.chat-head-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 0; cursor: pointer; flex-shrink: 0;
  background: rgba(255, 255, 255, .10); color: var(--chat-head-fg); display: grid; place-items: center;
  transition: background var(--motion-fast) var(--ease);
}
[data-theme="dark"] .chat-head-btn { background: rgba(255, 255, 255, .07); }
.chat-head-btn:hover { background: rgba(255, 255, 255, .2); }
[data-theme="dark"] .chat-head-btn:hover { background: rgba(255, 255, 255, .14); }
.chat-head-btn:focus-visible { outline: 2px solid var(--chat-head-fg); outline-offset: 1px; }

/* ---- messages ---- */
.chat-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 14px 8px; background: var(--chat-cream);
  display: flex; flex-direction: column; gap: 3px;
  scrollbar-width: thin; scrollbar-color: var(--chat-line-strong) transparent;
}
.chat-body::-webkit-scrollbar { width: 7px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--chat-line-strong); border-radius: 999px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }

.chat-day {
  align-self: center; margin: 10px 0 12px; font-size: 11px; font-weight: var(--fw-medium);
  color: var(--chat-dim); background: var(--chat-paper); border: 1px solid var(--chat-line);
  padding: 3px 11px; border-radius: 999px;
}

.chat-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; margin-top: 9px; }
.chat-row + .chat-row.is-same { margin-top: 3px; }
.chat-row.is-out { flex-direction: row-reverse; }
.chat-avatar {
  width: 28px; height: 28px; flex-shrink: 0; margin-bottom: 22px; border-radius: 50%; overflow: hidden;
  background: var(--chat-cream); border: 1px solid var(--chat-line); display: grid; place-items: center;
}
.chat-avatar img { width: 26px; height: 26px; display: block; }
.chat-avatar.is-photo { background: var(--chat-line); }
.chat-avatar.is-photo img { width: 100%; height: 100%; object-fit: cover; }
.chat-head-avatar.is-photo img { border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, .22); }
.chat-avatar.is-agent { background: var(--chat-ink); color: var(--chat-on-ink); font-size: 11px; font-weight: var(--fw-bold); border-color: transparent; }
.chat-row.is-same .chat-avatar { visibility: hidden; }

.chat-stack { display: flex; flex-direction: column; min-width: 0; max-width: calc(100% - 46px); }
.chat-row.is-out .chat-stack { align-items: flex-end; }
.chat-sender { font-size: 11px; font-weight: var(--fw-semibold); color: var(--chat-dim); margin: 0 0 3px 2px; display: flex; align-items: center; gap: 5px; }
.chat-ai-chip {
  background: var(--chat-ink); color: var(--chat-on-ink); border-radius: var(--radius-xs);
  padding: 1px 5px; font-size: 10px; letter-spacing: .04em; font-weight: var(--fw-bold);
}

.chat-bubble {
  padding: 10px 14px; font-size: var(--fs-sm); line-height: 1.55; word-break: break-word; white-space: pre-wrap;
  border-radius: 16px;
}
.chat-row.is-in .chat-bubble {
  background: var(--chat-paper); border: 1px solid var(--chat-line); color: var(--text-primary);
  border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(22, 21, 15, .04);
}
.chat-row.is-in.is-same .chat-bubble { border-bottom-left-radius: 16px; border-top-left-radius: 5px; }
.chat-row.is-out .chat-bubble { background: var(--chat-ink); color: var(--chat-on-ink); border: 1px solid var(--chat-ink); border-bottom-right-radius: 5px; }
.chat-row.is-out.is-same .chat-bubble { border-bottom-right-radius: 16px; border-top-right-radius: 5px; }
.chat-row.is-bot .chat-bubble { border-style: dashed; border-color: var(--chat-line-strong); }
.chat-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.chat-time { font-size: 10px; color: var(--chat-dim); margin: 4px 2px 0; }
.chat-row.is-pending .chat-bubble { opacity: .55; }

.chat-typing { display: inline-flex; align-items: center; gap: 4px; padding: 13px 16px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--chat-dim); opacity: .45; animation: chat-dot 1.3s infinite var(--ease); }
.chat-typing span:nth-child(2) { animation-delay: .18s; }
.chat-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: .9; } }

/* ---- welcome / states ---- */
.chat-welcome { margin: auto 0; padding: 18px 8px 12px; text-align: center; }
.chat-welcome img { width: 108px; height: 116px; display: block; margin: 0 auto 12px; animation: chat-float 4.5s ease-in-out infinite; }
@keyframes chat-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.chat-welcome h4 { font-size: var(--fs-lg); margin: 0 0 6px; letter-spacing: -.01em; }
.chat-welcome p { font-size: var(--fs-sm); color: var(--chat-dim); margin: 0 auto; max-width: 30ch; line-height: 1.55; }
.chat-note { text-align: center; font-size: var(--fs-sm); color: var(--chat-dim); margin: auto 0; padding: 20px; }
.chat-note button { margin-top: 10px; }

.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 2px 4px; justify-content: center; }
.chat-chip {
  border: 1px solid var(--chat-line-strong); background: var(--chat-paper); color: var(--text-primary);
  font: inherit; font-size: 12.5px; font-weight: var(--fw-medium); padding: 7px 13px; border-radius: 999px; cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease);
}
.chat-chip:hover { background: var(--chat-ink); color: var(--chat-on-ink); border-color: var(--chat-ink); transform: translateY(-1px); }
.chat-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---- composer ---- */
.chat-foot { flex-shrink: 0; border-top: 1px solid var(--chat-line); background: var(--chat-paper); }
.chat-composer { display: flex; align-items: flex-end; gap: 9px; padding: 11px 12px 9px; }
.chat-input {
  flex: 1; min-width: 0; resize: none; max-height: 116px; min-height: 42px;
  border: 1px solid var(--chat-line); border-radius: 14px; padding: 11px 14px;
  font: inherit; font-size: var(--fs-sm); line-height: 1.45;
  background: var(--chat-cream); color: var(--text-primary);
  transition: border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.chat-input::placeholder { color: var(--chat-dim); }
.chat-input:focus { outline: none; border-color: var(--chat-ink); background: var(--chat-paper); }
.chat-send {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; border: 0; cursor: pointer;
  color: var(--chat-on-ink); background: var(--chat-ink); display: grid; place-items: center;
  transition: transform var(--motion-fast) var(--ease), opacity var(--motion-fast) var(--ease);
}
.chat-send:hover:not(:disabled) { transform: scale(1.07); }
.chat-send:disabled { opacity: .35; cursor: default; }
.chat-send:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chat-legal { text-align: center; font-size: 10.5px; color: var(--chat-dim); padding: 0 12px 9px; }
.chat-legal strong { color: var(--text-primary); font-weight: var(--fw-semibold); }

@media (max-width: 560px) {
  .chat-widget { right: 16px; bottom: 16px; }
  .chat-panel {
    position: fixed; inset: 0; width: 100%; max-width: 100%; height: 100%; border-radius: 0; border: 0;
    transform: translateY(100%); transform-origin: 50% 100%;
  }
  .chat-widget.is-open .chat-panel { transform: none; }
  .chat-hero { padding-top: max(16px, env(safe-area-inset-top)); }
  /* the panel is fullscreen here, so the floating launcher has nothing to do */
  .chat-widget.is-open .chat-launcher { opacity: 0; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-panel, .chat-launcher, .chat-launcher-bubble, .chat-launcher-x { transition-duration: .01ms; }
  .chat-welcome img, .chat-ping.is-on::after, .chat-typing span { animation: none; }
}

/* ============================================================
   15. Admin live chat inbox
   ============================================================ */
.switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: var(--chat-line-strong); display: block; position: relative; transition: background var(--motion-base) var(--ease); }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--chat-paper); box-shadow: var(--shadow-sm); transition: transform var(--motion-base) var(--ease); }
.switch input:checked + .switch-track { background: var(--chat-ink); }
.switch input:checked + .switch-track .switch-knob { background: var(--chat-on-ink); transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.chat-admin { display: grid; grid-template-columns: 336px 1fr; gap: 16px; height: calc(100vh - 176px); min-height: 520px; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--chat-line); border-radius: var(--radius-lg); background: var(--chat-paper); overflow: hidden; }

.chat-presence { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--chat-line); flex-shrink: 0; }
.chat-presence-text { flex: 1; min-width: 0; line-height: 1.3; }
.chat-presence-title { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.chat-presence-sub { display: block; font-size: 11.5px; color: var(--chat-dim); }

.chat-search { position: relative; padding: 10px 12px; border-bottom: 1px solid var(--chat-line); flex-shrink: 0; }
.chat-search input { width: 100%; border: 1px solid var(--chat-line); border-radius: var(--radius-sm); background: var(--chat-cream); padding: 8px 12px 8px 32px; font: inherit; font-size: var(--fs-sm); color: var(--text-primary); }
.chat-search input:focus { outline: none; border-color: var(--chat-ink); background: var(--chat-paper); }
.chat-search svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--chat-dim); pointer-events: none; }

.chat-list { flex: 1; min-height: 0; overflow-y: auto; }
.chat-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 14px;
  border: 0; border-bottom: 1px solid var(--chat-line); background: transparent; cursor: pointer;
  text-align: left; font: inherit; color: var(--text-primary); transition: background var(--motion-fast) var(--ease);
}
.chat-item:hover { background: var(--chat-cream); }
.chat-item.is-active { background: var(--chat-cream); }
.chat-item.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--chat-ink); }
.chat-item-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: var(--fw-semibold); color: var(--chat-on-ink); background: var(--chat-ink); }
.chat-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-item-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 11px; color: var(--chat-dim); flex-shrink: 0; }
.chat-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-item-preview { font-size: 12.5px; color: var(--chat-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.has-unread .chat-item-preview { color: var(--text-primary); font-weight: var(--fw-medium); }
.chat-tag { flex-shrink: 0; font-size: 10px; font-weight: var(--fw-bold); border-radius: var(--radius-xs); padding: 1px 5px; letter-spacing: .03em; }
.chat-tag-ai { color: var(--chat-on-ink); background: var(--chat-ink); }
.chat-tag-me { color: var(--chat-dim); background: transparent; border: 1px solid var(--chat-line-strong); }
.chat-item-pill { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--chat-ink); color: var(--chat-on-ink); font-size: 11px; font-weight: var(--fw-bold); display: grid; place-items: center; }

.chat-thread-head { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--chat-line); flex-shrink: 0; }
.chat-thread-head .chat-item-avatar { width: 38px; height: 38px; }
.chat-thread-meta { flex: 1; min-width: 0; line-height: 1.35; }
.chat-thread-meta strong { display: block; font-size: var(--fs-md); }
.chat-thread-meta span { display: block; font-size: 12px; color: var(--chat-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { display: none; }

.chat-empty { margin: auto; text-align: center; padding: 28px; max-width: 380px; }
.chat-empty img { width: 118px; height: 126px; margin-bottom: 14px; }
.chat-empty h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.chat-empty p { color: var(--chat-dim); font-size: var(--fs-sm); margin-bottom: 0; }

.chat-admin .chat-body { padding: 16px 18px 10px; }
.chat-admin .chat-stack { max-width: min(560px, calc(100% - 46px)); }

@media (max-width: 900px) {
  .chat-admin { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .chat-admin .chat-pane { height: 70vh; }
  .chat-admin.show-thread .chat-pane-list { display: none; }
  .chat-admin:not(.show-thread) .chat-pane-thread { display: none; }
  .chat-back { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--chat-line); background: var(--chat-paper); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-primary); }
}

/* ============================================================
   16. Live chat - human agent identity
   The agent photo leads the thread header and welcome state
   whenever a real person is answering.
   ============================================================ */
.chat-welcome img.chat-welcome-photo {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--chat-line); animation: none; margin-bottom: 14px;
}

/* ============================================================
   17. Content pages - shared shell
   Hero, prose, section headers and CTA bands used by the FAQ,
   blog, article, legal and contact pages.
   ============================================================ */

.page-hero {
  position: relative; overflow: hidden;
  padding: var(--space-7) 0 var(--space-6);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-muted);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 300px at 12% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(560px 280px at 88% 0%, color-mix(in srgb, var(--pro) 15%, transparent), transparent 72%);
}
.page-hero > .container { position: relative; }
.page-hero-inner { max-width: 720px; }
.page-hero-inner.is-center { max-width: 760px; margin: 0 auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 5px 12px 5px 8px; border-radius: var(--radius-pill);
  background: var(--surface-raised); border: 1px solid var(--border-default);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  letter-spacing: .01em; color: var(--text-primary); box-shadow: var(--shadow-xs);
}
.eyebrow svg { flex-shrink: 0; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.eyebrow-dot.is-live { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); animation: eyebrow-pulse 2.2s var(--ease) infinite; }
@keyframes eyebrow-pulse {
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.page-title {
  font-size: clamp(32px, 5vw, 52px); line-height: 1.06; letter-spacing: -.035em;
  margin: var(--space-3) 0 var(--space-3);
}
.page-lede {
  font-size: var(--fs-lg); line-height: 1.6; color: var(--text-secondary);
  max-width: 58ch; margin: 0;
}
.page-hero-inner.is-center .page-lede { margin-inline: auto; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.page-hero-inner.is-center .page-hero-actions { justify-content: center; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: var(--space-5);
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--border-default);
}
.hero-fact { display: flex; flex-direction: column; gap: 2px; }
.hero-fact b { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.03em; line-height: 1.1; }
.hero-fact span { font-size: var(--fs-sm); color: var(--text-secondary); }

.section-head { max-width: 640px; margin-bottom: var(--space-4); }
.section-head.is-center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: var(--space-2); letter-spacing: -.03em; }
.section-head p { color: var(--text-secondary); margin: 0; }

/* ---- prose ---- */
.prose { max-width: var(--maxw-prose); font-size: var(--fs-md); line-height: 1.72; color: var(--text-primary); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 var(--space-3); }
.prose .prose-h {
  font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.02em;
  margin: var(--space-5) 0 var(--space-2); scroll-margin-top: 96px;
}
.prose h3 { font-size: var(--fs-lg); margin: var(--space-4) 0 var(--space-2); }
.prose .prose-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px;
  border-radius: var(--radius-xs); background: var(--surface-muted); border: 1px solid var(--border-default);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-secondary); vertical-align: 2px;
}
.prose .prose-list { margin: 0 0 var(--space-3); padding-left: 0; list-style: none; display: grid; gap: var(--space-2); }
.prose .prose-list li { position: relative; padding-left: var(--space-4); }
.prose ul.prose-list li::before {
  content: ""; position: absolute; left: 3px; top: 11px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.prose ol.prose-list { counter-reset: prose-ol; }
.prose ol.prose-list li::before {
  counter-increment: prose-ol; content: counter(prose-ol) ".";
  position: absolute; left: 0; top: 0; font-weight: var(--fw-semibold); color: var(--accent);
}
.prose a { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose strong { font-weight: var(--fw-semibold); }
.prose blockquote {
  margin: var(--space-4) 0; padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent); background: var(--surface-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-primary);
}

/* ---- CTA band ---- */
.cta-band {
  position: relative; overflow: hidden;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-muted); padding: var(--space-6) var(--space-5);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-4);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 240px at 85% 0%, color-mix(in srgb, var(--pro) 16%, transparent), transparent 70%);
}
.cta-band > * { position: relative; }
.cta-band h3 { margin: 0 0 var(--space-1); letter-spacing: -.02em; }
.cta-band p { margin: 0; color: var(--text-secondary); max-width: 52ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---- author / agent chip ---- */
.agent-chip { display: flex; align-items: center; gap: var(--space-3); }
.agent-photo {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--surface-raised); box-shadow: var(--shadow-sm);
}
.agent-photo-lg { width: 64px; height: 64px; }
.agent-chip-text { line-height: 1.35; min-width: 0; }
.agent-chip-name { display: block; font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.agent-chip-role { display: block; font-size: var(--fs-xs); color: var(--text-secondary); }

/* ============================================================
   18. FAQ page
   ============================================================ */
.faq-layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-6);
  align-items: start; padding: var(--space-6) 0 var(--space-7);
}
.faq-side { position: sticky; top: 92px; display: grid; gap: var(--space-2); }
.faq-side-label {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-secondary); font-weight: var(--fw-semibold); margin-bottom: var(--space-1);
}
.faq-side-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-secondary); border: 1px solid transparent;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}
.faq-side-link:hover { background: var(--surface-muted); color: var(--text-primary); }
.faq-side-link.is-active { background: var(--surface-muted); border-color: var(--border-default); color: var(--text-primary); font-weight: var(--fw-medium); }
.faq-side-link span:last-child { font-size: var(--fs-xs); color: var(--text-secondary); }

.faq-search { position: relative; margin-bottom: var(--space-4); max-width: 520px; }
.faq-search input {
  width: 100%; height: 48px; padding: 0 var(--space-4) 0 44px;
  border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  background: var(--surface-raised); color: var(--text-primary); font-size: var(--fs-md);
  font-family: inherit; box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.faq-search input:hover { border-color: var(--border-strong); }
.faq-search input:focus { outline: none; border-color: var(--text-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 22%, transparent); }
.faq-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; display: flex; }

.faq-group { margin-bottom: var(--space-6); scroll-margin-top: 96px; }
.faq-group-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.faq-group-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md); flex-shrink: 0;
  display: grid; place-items: center; background: var(--surface-muted);
  border: 1px solid var(--border-default); color: var(--text-primary);
}
.faq-group-head h2 { margin: 0; font-size: var(--fs-xl); letter-spacing: -.02em; }
.faq-group-head p { margin: 0; font-size: var(--fs-sm); color: var(--text-secondary); }

.faq-list { display: grid; gap: var(--space-2); }
.faq-item {
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-raised); overflow: hidden;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.faq-item:hover { border-color: var(--border-strong); }
.faq-item[open] { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.faq-q {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); cursor: pointer; list-style: none;
  font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-primary);
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.faq-q-icon {
  position: relative; width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px;
  border-radius: 50%; background: var(--surface-muted); border: 1px solid var(--border-default);
  transition: transform var(--motion-base) var(--ease), background var(--motion-fast) var(--ease);
}
.faq-q-icon::before, .faq-q-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: var(--text-primary);
  transform: translate(-50%, -50%); border-radius: 1px;
}
.faq-q-icon::before { width: 9px; height: 1.6px; }
.faq-q-icon::after { width: 1.6px; height: 9px; transition: opacity var(--motion-fast) var(--ease); }
.faq-item[open] .faq-q-icon { transform: rotate(180deg); background: var(--accent-soft); }
.faq-item[open] .faq-q-icon::after { opacity: 0; }
.faq-a { padding: 0 var(--space-4) var(--space-4); font-size: var(--fs-sm); line-height: 1.68; color: var(--text-secondary); }
.faq-a p { margin: 0 0 var(--space-2); }
.faq-a > *:last-child { margin-bottom: 0; }
.faq-a a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }

.faq-empty { display: none; }
.faq-layout.is-empty .faq-empty { display: block; }
.faq-layout.is-empty .faq-group { display: none; }

/* ============================================================
   19. Blog index and article
   ============================================================ */
.blog-featured {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--space-5); align-items: center;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
}
.blog-featured:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-featured-media { position: relative; aspect-ratio: 16 / 10; min-height: 260px; }
.blog-featured-body { padding: var(--space-5) var(--space-5) var(--space-5) 0; }
.blog-featured-body h2 { font-size: var(--fs-3xl); letter-spacing: -.03em; margin-bottom: var(--space-2); }
.blog-featured-body h2 a::after { content: ""; position: absolute; inset: 0; }
.blog-featured-body p { color: var(--text-secondary); margin-bottom: var(--space-3); }

.post-cover { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface-muted); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-cover-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-4);
  text-align: center; color: #fff;
}
.post-cover-glyph {
  position: relative;
  font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.03em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25); line-height: 1.25; max-width: 22ch;
}
.post-cover-mesh {
  position: absolute; inset: 0;
  background:
    radial-gradient(240px 160px at 20% 20%, rgba(255, 255, 255, .35), transparent 65%),
    radial-gradient(220px 180px at 82% 78%, rgba(0, 0, 0, .22), transparent 70%);
}

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.post-card {
  position: relative;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised);
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease), border-color var(--motion-fast) var(--ease);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.post-card:focus-within { border-color: var(--focus-ring); }
.post-card-media { aspect-ratio: 16 / 9; }
.post-card-body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); flex: 1; }
.post-card-title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -.02em; line-height: 1.3; margin: 0; }
.post-card-title a::after { content: ""; position: absolute; inset: 0; }
.post-card-excerpt { font-size: var(--fs-sm); color: var(--text-secondary); margin: 0; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  font-size: var(--fs-xs); color: var(--text-secondary);
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.post-card-foot { margin-top: auto; padding-top: var(--space-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--accent); display: flex; align-items: center; gap: 6px; }
.post-card:hover .post-card-foot svg { transform: translateX(3px); }
.post-card-foot svg { transition: transform var(--motion-fast) var(--ease); }

/* ---- article ---- */
.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: var(--space-6);
  align-items: start; padding: var(--space-6) 0 var(--space-7);
}
.article-body { max-width: 72ch; }
.article-hero-media {
  aspect-ratio: 21 / 9; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-default); margin-bottom: var(--space-5);
}
.article-aside { position: sticky; top: 92px; display: grid; gap: var(--space-4); }
.article-toc { border-left: 2px solid var(--border-default); padding-left: var(--space-3); display: grid; gap: 6px; }
.article-toc a { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4; padding: 2px 0; }
.article-toc a:hover { color: var(--text-primary); }
.article-share { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.share-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center;
  border: 1px solid var(--border-default); background: var(--surface-raised); color: var(--text-secondary);
  cursor: pointer; transition: color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.share-btn:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--surface-muted); }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb svg { opacity: .6; }

/* ============================================================
   20. Legal / about pages
   ============================================================ */
.legal-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-6);
  align-items: start; padding: var(--space-6) 0 var(--space-7);
}
.legal-toc { position: sticky; top: 92px; display: grid; gap: 2px; }
.legal-toc a {
  font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
}
.legal-toc a:hover { color: var(--text-primary); background: var(--surface-muted); }
.legal-updated {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-xs); color: var(--text-secondary);
  padding: 5px 10px; border-radius: var(--radius-pill);
  background: var(--surface-muted); border: 1px solid var(--border-default);
}

/* ============================================================
   21. Support / contact page
   ============================================================ */
.support-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--space-6);
  align-items: start; padding: var(--space-6) 0 var(--space-7);
}
.support-cards { display: grid; gap: var(--space-3); }
.support-card {
  display: flex; gap: var(--space-3); padding: var(--space-4);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-raised);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.support-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.support-card-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--radius-md);
  display: grid; place-items: center; background: var(--surface-muted);
  border: 1px solid var(--border-default); color: var(--text-primary);
}
.support-card h3 { font-size: var(--fs-md); margin: 0 0 2px; }
.support-card p { font-size: var(--fs-sm); color: var(--text-secondary); margin: 0; }
.support-form {
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised); padding: var(--space-5); box-shadow: var(--shadow-sm);
}

/* ============================================================
   22. Category index
   ============================================================ */
.cat-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }

/* ============================================================
   23. Not found
   ============================================================ */
.nf-wrap { padding: var(--space-7) 0; text-align: center; }
.nf-code {
  font-size: clamp(76px, 16vw, 148px); font-weight: var(--fw-bold); letter-spacing: -.06em;
  line-height: .9; margin: 0 0 var(--space-3);
  background: linear-gradient(180deg, var(--text-primary) 0%, color-mix(in srgb, var(--text-primary) 22%, transparent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nf-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-6); text-align: left; }

/* ============================================================
   24. Content page responsive
   ============================================================ */
@media (max-width: 1080px) {
  .faq-layout, .legal-layout, .article-layout, .support-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .faq-side, .legal-toc, .article-aside { position: static; }
  .faq-side { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: var(--space-2); }
  .faq-side-label { display: none; }
  .faq-side-link { white-space: nowrap; border: 1px solid var(--border-default); }
  .legal-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-grid, .cat-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-featured { grid-template-columns: minmax(0, 1fr); }
  .blog-featured-media { min-height: 0; aspect-ratio: 16 / 8; }
  .blog-featured-body { padding: var(--space-4) var(--space-4) var(--space-5); }
}

@media (max-width: 720px) {
  .page-hero { padding: var(--space-6) 0 var(--space-5); }
  .hero-facts { gap: var(--space-4); }
  .blog-grid, .cat-index-grid, .nf-links { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { grid-template-columns: minmax(0, 1fr); }
  .cta-band { padding: var(--space-5) var(--space-4); }
  .faq-q { padding: var(--space-3); }
  .faq-a { padding: 0 var(--space-3) var(--space-3); }
}

/* ============================================================
   25. Newsletter signup
   One pill holding the field and the button. The global
   `input { width: 100% }` rule is beaten by the two-class
   selector below, which is what used to wrap the button onto
   its own line inside .inline-form.
   ============================================================ */
.newsletter { display: grid; gap: var(--space-2); min-width: 0; }
.newsletter-group {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 4px 4px 4px var(--space-3); min-width: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.newsletter-group:hover { border-color: var(--text-secondary); }
.newsletter-group:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 24%, transparent);
}
.newsletter-icon { display: flex; flex-shrink: 0; color: var(--text-secondary); }

/* two classes (0-2-0) outrank input[type="email"] (0-1-1) */
.newsletter-group .newsletter-input {
  flex: 1 1 auto; width: auto; min-width: 0; min-height: 38px;
  padding: 0; margin: 0;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  font-size: var(--fs-sm); color: var(--text-primary);
}
.newsletter-group .newsletter-input:hover,
.newsletter-group .newsletter-input:focus {
  border: 0; outline: none; box-shadow: none;
}
.newsletter-group .newsletter-input::placeholder { color: var(--text-secondary); }
/* keep the browser's yellow autofill plate from squaring off the pill */
.newsletter-group .newsletter-input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-primary);
  transition: background-color 100000s ease-in-out 0s;
}

.newsletter-btn {
  flex-shrink: 0; border-radius: var(--radius-pill);
  padding-inline: var(--space-4); min-height: 38px;
}
.newsletter-note { margin: 0; padding-left: var(--space-3); font-size: var(--fs-xs); color: var(--text-secondary); }
.newsletter-note.is-error { color: var(--danger); }

/* Inside a CTA band the form is the right-hand column and must not collapse. */
.cta-band .newsletter { flex: 0 1 420px; min-width: 300px; }

@media (max-width: 560px) {
  .newsletter-group {
    flex-direction: column; align-items: stretch; gap: var(--space-2);
    border-radius: var(--radius-md); padding: var(--space-2);
  }
  .newsletter-group .newsletter-input { min-height: 42px; padding: 0 var(--space-2); }
  .newsletter-icon { display: none; }
  .newsletter-btn { width: 100%; border-radius: var(--radius-sm); min-height: 42px; }
  .newsletter-note { padding-left: 0; text-align: center; }
  .cta-band .newsletter { flex: 1 1 100%; min-width: 0; }
}

/* ============================================================
   26. Live chat - home / messages shell
   Two-tab panel: a Welcome screen with a greeting hero and
   shortcuts, and the Messages thread. Still monochrome per
   section 14 - depth comes from a gradient, not a brand hue.
   ============================================================ */
.chat-widget {
  --chat-hero-from: #211f16;
  --chat-hero-to: #12110c;
}
[data-theme="dark"] .chat-widget {
  --chat-hero-from: #2a2820;
  --chat-hero-to: #17160f;
}

/* ---- launcher: bubble that becomes a chevron when open ---- */
.chat-launcher-bubble, .chat-launcher-x {
  grid-area: 1 / 1; color: var(--chat-launch-fg);
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-slow) var(--ease);
}
.chat-launcher-x { opacity: 0; transform: rotate(-90deg) scale(.4); }
.chat-widget.is-open .chat-launcher-bubble { opacity: 0; transform: rotate(90deg) scale(.4); }
.chat-widget.is-open .chat-launcher-x { opacity: 1; transform: none; }

/* ---- hero ---- */
.chat-hero {
  position: relative; flex-shrink: 0; overflow: hidden;
  padding: 16px 16px 20px;
  background: linear-gradient(160deg, var(--chat-hero-from) 0%, var(--chat-hero-to) 100%);
  color: var(--chat-head-fg);
}
.chat-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(320px 180px at 88% -10%, rgba(255, 255, 255, .13), transparent 70%);
}
.chat-hero > * { position: relative; }

.chat-hero-top { display: flex; align-items: center; gap: 10px; }
.chat-hero-brand { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: -.02em; }
.chat-hero-mark { width: 24px; height: 24px; display: block; }
.chat-hero-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-faces { display: flex; margin-left: auto; }
.chat-face {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--chat-hero-to); background: var(--chat-paper);
  display: grid; place-items: center;
}
.chat-face + .chat-face, .chat-faces .chat-face:not(:first-child) { margin-left: -10px; }
.chat-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-face.is-bot img { width: 78%; height: 78%; object-fit: contain; }

.chat-hero .chat-head-btn {
  background: rgba(255, 255, 255, .12); color: var(--chat-head-fg);
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
}
.chat-hero .chat-head-btn:hover { background: rgba(255, 255, 255, .22); }

.chat-hero-greeting { margin-top: 26px; }
.chat-hello, .chat-ask {
  margin: 0; font-size: 25px; line-height: 1.24; letter-spacing: -.03em; font-weight: var(--fw-semibold);
}
.chat-hello { opacity: .72; }

/* thread header replaces the greeting on the Messages tab */
.chat-hero-thread { display: flex; align-items: center; gap: 11px; margin-top: 16px; }
.chat-hero-thread[hidden] { display: none; }
.chat-hero .chat-head-avatar { width: 38px; height: 38px; }
.chat-hero .chat-head-avatar img { width: 38px; height: 38px; }
.chat-hero .chat-head-avatar::after { border-color: var(--chat-hero-to); }

/* ---- views ---- */
.chat-views { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--chat-cream); }
.chat-view { flex: 1; min-height: 0; display: none; flex-direction: column; }
.chat-view.is-active { display: flex; }
/* Block (not flex) so children always keep their natural height and the view
   scrolls when a short floating panel can't fit everything - a flex column here
   would shrink the "Popular" card and clip its own rows. The block display is
   gated on .is-active so the inactive view stays hidden (display:none from
   .chat-view) instead of bleeding through under the active one. */
.chat-view.is-active[data-chat-view="home"] { display: block; }
.chat-view[data-chat-view="home"] {
  overflow-y: auto; overscroll-behavior: contain; padding: 14px;
  scrollbar-width: thin; scrollbar-color: var(--chat-line-strong) transparent;
}
.chat-view[data-chat-view="home"] > * { margin-bottom: 12px; }
.chat-view[data-chat-view="home"] > *:last-child { margin-bottom: 0; }

/* ---- primary action card ---- */
.chat-action {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 15px 16px; cursor: pointer;
  background: var(--chat-paper); color: inherit;
  border: 1px solid var(--chat-line); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(22, 21, 15, .10);
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.chat-action:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(22, 21, 15, .15); }
.chat-action:active { transform: translateY(0); }
.chat-action:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.chat-action-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-action-text strong { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.chat-action-text span { font-size: 12.5px; color: var(--chat-dim); }
.chat-action-go { flex-shrink: 0; color: var(--chat-ink); display: flex; }

/* ---- shortcut card ---- */
.chat-panelcard {
  background: var(--chat-paper); border: 1px solid var(--chat-line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-xs);
}
.chat-panelcard-head {
  margin: 0; padding: 13px 16px 11px; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  letter-spacing: -.01em; border-bottom: 1px solid var(--chat-line);
}
.chat-linkrow {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--chat-line); color: inherit;
  transition: background var(--motion-fast) var(--ease);
}
.chat-linkrow:last-child { border-bottom: 0; }
.chat-linkrow:hover { background: var(--chat-cream); color: inherit; }
.chat-linkrow:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.chat-linkrow-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center;
  background: var(--chat-cream); border: 1px solid var(--chat-line); color: var(--chat-ink);
}
.chat-linkrow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-linkrow-text strong { font-size: 13.5px; font-weight: var(--fw-semibold); }
.chat-linkrow-text span { font-size: 12px; color: var(--chat-dim); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-linkrow-go { flex-shrink: 0; color: var(--chat-dim); transition: transform var(--motion-fast) var(--ease); }
.chat-linkrow:hover .chat-linkrow-go { transform: translateX(2px); color: var(--chat-ink); }

.chat-view[data-chat-view="home"] .chat-legal { margin: 2px 0 0; padding: 0 4px; }

/* ---- messages view keeps the existing thread + composer ---- */
.chat-view[data-chat-view="messages"] .chat-body { flex: 1; min-height: 0; }

/* ---- bottom tab bar ---- */
.chat-tabs {
  flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--chat-line); background: var(--chat-paper);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}
.chat-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border: 0; background: none; cursor: pointer;
  font: var(--fw-medium) 11.5px/1.2 var(--font-sans);
  color: var(--chat-dim); border-radius: 10px;
  transition: color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.chat-tab:hover { background: var(--chat-cream); color: var(--chat-ink); }
.chat-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.chat-tab.is-active { color: var(--chat-ink); font-weight: var(--fw-semibold); }
.chat-tab.is-active svg { stroke-width: 2.2; }
.chat-tab-ico { position: relative; display: flex; }
.chat-tab-badge {
  position: absolute; top: -5px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: var(--fw-bold); line-height: 18px; text-align: center;
  border: 2px solid var(--chat-paper);
}
.chat-tab-badge[hidden] { display: none; }

@media (max-width: 560px) {
  .chat-hero { padding: 14px 14px 18px; }
  .chat-hello, .chat-ask { font-size: 22px; }
  .chat-hero-greeting { margin-top: 20px; }
}

/* ============================================================
   27. Join Coupons admin app
   The same admin runs as a desktop panel (persistent sidebar) and
   as an installed Android app (app bar + drawer + bottom tabs).
   Breakpoint: 900px.
   ============================================================ */
.admin-body { padding-bottom: env(safe-area-inset-bottom); }

.app-bar, .app-tabs { display: none; }

.admin-side-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.drawer-x { display: none; }
.admin-nav { display: flex; flex-direction: column; gap: 1px; margin-top: var(--space-3); }
.admin-side-user {
  margin: var(--space-4) 0 0; padding-top: var(--space-3);
  border-top: 1px solid var(--border-default);
  font-size: var(--fs-xs); color: var(--text-secondary); word-break: break-all;
}

/* nav rows now carry an icon, a label and an optional count */
.nav-link { justify-content: flex-start; }
.nav-link-ico { display: flex; flex-shrink: 0; opacity: .75; }
.nav-link.is-active .nav-link-ico { opacity: 1; }
.nav-link-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: var(--fw-bold);
  line-height: 20px; text-align: center;
}
.nav-link.is-active .nav-count { background: var(--danger); }

.admin-h1 { font-size: 26px; margin-bottom: 2px; }

/* ---- install / notification prompt bars ---- */
.app-install {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-muted);
}
.app-install[hidden] { display: none; }
.app-install-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app-install-text strong { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.app-install-text span { font-size: var(--fs-xs); color: var(--text-secondary); }

.app-bar-btn {
  position: relative; width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center; cursor: pointer;
  border: 0; background: none; color: inherit; border-radius: var(--radius-sm);
  transition: background var(--motion-fast) var(--ease);
}
.app-bar-btn:hover { background: rgba(127, 127, 127, .16); }
.app-bar-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* ---- notification feed ---- */
.notif-list { display: flex; flex-direction: column; border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; background: var(--surface-raised); }
.notif-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default);
  color: inherit; transition: background var(--motion-fast) var(--ease);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: var(--surface-muted); color: inherit; }
.notif-row.is-unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif-row.is-unread:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.notif-ico {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-muted); border: 1px solid var(--border-default); color: var(--text-primary);
}
.notif-row.is-unread .notif-ico { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.notif-text { flex: 1; min-width: 0; }
.notif-text strong { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.notif-text p { margin: 2px 0 0; font-size: var(--fs-xs); color: var(--text-secondary); }
.notif-time { flex-shrink: 0; font-size: var(--fs-xs); color: var(--text-secondary); white-space: nowrap; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }

.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--space-3); }
.channel-card { border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--surface-raised); }
.channel-card h4 { margin: 0 0 var(--space-2); font-size: var(--fs-sm); }
.channel-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--fs-sm); border-top: 1px solid var(--border-default); }
.channel-row:first-of-type { border-top: 0; }

.is-offline .admin-main::before {
  content: "You are offline - showing the last loaded data.";
  display: block; margin-bottom: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn);
  font-size: var(--fs-sm);
}

/* ============================================================
   Phone layout: app bar, slide-in drawer, bottom tab bar
   ============================================================ */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }

  .app-bar {
    position: sticky; top: 0; z-index: 60;
    display: flex; align-items: center; gap: var(--space-2);
    padding: max(6px, env(safe-area-inset-top)) var(--space-2) 6px;
    background: var(--surface-base); border-bottom: 1px solid var(--border-default);
  }
  .app-bar-title {
    flex: 1; min-width: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold);
    letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .app-bar-dot {
    position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
    background: var(--danger); border: 2px solid var(--surface-base);
  }

  .admin-side {
    position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(304px, 86vw);
    border-right: 1px solid var(--border-default); border-bottom: 0;
    padding: max(var(--space-3), env(safe-area-inset-top)) var(--space-3) var(--space-4);
    overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-102%);
    transition: transform var(--motion-slow) var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .drawer-open .admin-side { transform: none; }
  .drawer-x { display: grid; }
  .drawer-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(8, 9, 10, .5); }
  .drawer-scrim[hidden] { display: none; }
  .drawer-open { overflow: hidden; }

  /* the app bar already shows the page title, so drop the duplicate heading */
  .admin-top { display: none; }
  .admin-main {
    padding: var(--space-3) var(--space-3)
             calc(var(--space-7) + 44px + env(safe-area-inset-bottom));
  }

  .app-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--surface-base); border-top: 1px solid var(--border-default);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .app-tab {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border: 0; background: none; cursor: pointer; border-radius: 10px;
    font: var(--fw-medium) 11px/1.2 var(--font-sans); color: var(--text-secondary);
    text-decoration: none;
  }
  .app-tab:hover { color: var(--text-primary); }
  .app-tab.is-active { color: var(--text-primary); font-weight: var(--fw-semibold); }
  .app-tab.is-active svg { stroke-width: 2.3; }
  .app-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
  .app-tab-ico { position: relative; display: flex; }
  .app-tab-badge {
    position: absolute; top: -5px; right: -10px; min-width: 17px; height: 17px; padding: 0 5px;
    border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: var(--fw-bold); line-height: 17px; text-align: center;
    border: 2px solid var(--surface-base);
  }
  .app-tab-badge[hidden] { display: none; }

  .table-wrap { border-radius: var(--radius-sm); }
  .admin-h1 { font-size: 21px; }
  .app-install { padding: var(--space-3); }
}

@media (min-width: 901px) {
  .drawer-scrim { display: none !important; }
  .admin-side { transform: none !important; }
}

/* ============================================================
   28. Admin app - native polish
   Segmented tabs, drawer profile + theme toggle, app-style
   dashboard header and quick tiles, richer stat cards, and a
   bottom tab bar with an active pill.
   ============================================================ */

/* ---- segmented pill tabs (settings, filters) ---- */
.seg {
  display: inline-flex; gap: 2px; padding: 4px; max-width: 100%;
  background: var(--surface-muted); border: 1px solid var(--border-default);
  border-radius: var(--radius-pill); overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-sans); color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.seg-btn:hover { color: var(--text-primary); }
.seg-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.seg-btn.is-active {
  background: var(--surface-inverse); color: var(--text-inverse);
  font-weight: var(--fw-semibold); box-shadow: var(--shadow-xs);
}
.seg-btn svg { flex-shrink: 0; }
.seg-btn .seg-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: var(--fw-bold);
  line-height: 18px; text-align: center;
}
.seg-btn.is-active .seg-count { background: var(--danger); }

.seg-panel { display: none; }
.seg-panel.is-active { display: block; animation: seg-fade var(--motion-base) var(--ease); }
@keyframes seg-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- dashboard greeting header ---- */
.app-greeting {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-lg); color: var(--chat-head-fg);
  background: linear-gradient(150deg, #211f16 0%, #12110c 100%);
  position: relative; overflow: hidden;
}
.app-greeting::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(360px 200px at 92% -20%, rgba(255,255,255,.12), transparent 70%);
}
.app-greeting > * { position: relative; }
.app-greeting-text { flex: 1; min-width: 0; }
.app-greeting-hi { margin: 0; font-size: var(--fs-sm); opacity: .7; }
.app-greeting-name { margin: 2px 0 0; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.02em; }
.app-greeting-av {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-md); font-weight: var(--fw-bold);
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.2);
}

/* ---- quick action tiles ---- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.quick-tile {
  display: flex; flex-direction: column; gap: 8px; padding: var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-raised); color: inherit;
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease), border-color var(--motion-fast) var(--ease);
}
.quick-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); color: inherit; }
.quick-tile:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.quick-tile-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-muted); border: 1px solid var(--border-default); color: var(--text-primary);
}
.quick-tile-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.quick-tile-sub { font-size: var(--fs-xs); color: var(--text-secondary); }
.quick-tile-count { margin-left: auto; font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -.02em; }
.quick-tile-top { display: flex; align-items: center; gap: 10px; }

/* ---- richer stat cards (icon on the right) ---- */
.stat-card.has-ico { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.stat-card.has-ico .stat-ico {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-muted); border: 1px solid var(--border-default); color: var(--text-primary);
}
.stat-card.has-ico > div { min-width: 0; }

/* ---- drawer footer: theme toggle + profile ---- */
.admin-side { display: flex; flex-direction: column; }
.admin-nav { flex: 1 1 auto; }
.admin-side-foot { flex-shrink: 0; margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.theme-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin-bottom: var(--space-3);
  background: var(--surface-muted); border: 1px solid var(--border-default); border-radius: var(--radius-pill);
}
.theme-seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px; border: 0; background: none; cursor: pointer; border-radius: var(--radius-pill);
  font: var(--fw-medium) 13px/1 var(--font-sans); color: var(--text-secondary);
  transition: color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.theme-seg-btn:hover { color: var(--text-primary); }
.theme-seg-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.theme-seg-btn.is-active { background: var(--surface-inverse); color: var(--text-inverse); font-weight: var(--fw-semibold); }

.admin-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-md); background: var(--surface-muted);
}
.admin-profile-av {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-inverse); color: var(--text-inverse);
  font-size: 13px; font-weight: var(--fw-bold);
}
.admin-profile-text { flex: 1; min-width: 0; line-height: 1.3; }
.admin-profile-text strong { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-profile-text span { display: block; font-size: 11.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-profile-out {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-sm); display: grid; place-items: center;
  color: var(--text-secondary); transition: color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.admin-profile-out:hover { color: var(--danger); background: var(--surface-base); }

/* the old plain email line is superseded by the profile block */
.admin-side-user { display: none; }

/* ---- bottom tab active pill ---- */
@media (max-width: 900px) {
  .app-tab { position: relative; }
  .app-tab-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 30px; border-radius: 999px;
    transition: background var(--motion-fast) var(--ease);
  }
  .app-tab.is-active .app-tab-ico { background: var(--accent-soft); }
  .app-tab.is-active svg { color: var(--accent); }
  .app-tab.is-active { color: var(--text-primary); }

  /* settings segmented tabs go full-width and scroll on phones */
  .seg.seg-full { display: flex; width: 100%; }
  .app-greeting { padding: var(--space-3) var(--space-4); }
  .app-greeting-name { font-size: var(--fs-xl); }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   29. Join Coupons app - Menu screen + native mobile sizing
   A full-screen, searchable, grouped menu (the app's "Menu"
   tab), plus larger touch targets and type on phones so the
   admin reads as an app, not a shrunk website.
   ============================================================ */

/* ---- Menu screen (all viewports; shines on mobile) ---- */
.menu-screen { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.menu-search { position: relative; }
.menu-search input {
  width: 100%; height: 48px; padding: 0 16px 0 44px;
  border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  background: var(--surface-muted); color: var(--text-primary);
  font-size: var(--fs-md); font-family: inherit;
}
.menu-search input:focus { outline: none; border-color: var(--text-primary); background: var(--surface-base); }
.menu-search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; display: flex; }

.menu-group { display: flex; flex-direction: column; gap: 8px; }
.menu-group-label {
  margin: 0 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary);
}
.menu-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.menu-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  color: var(--text-primary); border-bottom: 1px solid var(--border-default);
  transition: background var(--motion-fast) var(--ease);
}
.menu-row:last-child { border-bottom: 0; }
.menu-row:hover { background: var(--surface-muted); color: var(--text-primary); }
.menu-row:active { background: var(--surface-sunken); }
.menu-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.menu-row.is-active { background: var(--surface-inverse); }
.menu-row.is-active .menu-row-label { color: var(--text-inverse); font-weight: var(--fw-semibold); }
.menu-row.is-active .menu-row-ico { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }
.menu-row.is-active .menu-row-go { color: var(--text-inverse); }

.menu-row-ico {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tint, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint, var(--accent)) 22%, transparent);
  color: var(--tint, var(--accent));
}
.menu-row-label { flex: 1 1 auto; min-width: 0; font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row-badge {
  flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: var(--fw-bold);
  line-height: 22px; text-align: center;
}
.menu-row-go { flex-shrink: 0; color: var(--text-secondary); }
.menu-row.is-danger { color: var(--danger); }
.menu-row.is-danger .menu-row-ico { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

.menu-empty { text-align: center; padding: 24px; }
.menu-empty[hidden] { display: none; }

.menu-profile {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.menu-profile-av {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-inverse); color: var(--text-inverse); font-size: 15px; font-weight: var(--fw-bold);
}
.menu-profile-text { flex: 1; min-width: 0; line-height: 1.35; }
.menu-profile-text strong { display: block; font-size: var(--fs-md); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-profile-text span { display: block; font-size: var(--fs-sm); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* On desktop the Menu page is secondary to the sidebar, so keep it calm. */
@media (min-width: 901px) {
  .menu-screen { max-width: 560px; margin: 0; }
}

/* ============================================================
   Native mobile sizing - so the app never needs pinch-zoom
   ============================================================ */
@media (max-width: 900px) {
  /* taller app bar, bigger title */
  .app-bar { padding: max(8px, env(safe-area-inset-top)) 8px 8px; gap: 4px; }
  .app-bar-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -.02em; }
  .app-bar-btn { width: 44px; height: 44px; }

  /* comfortable reading size for content */
  .admin-main { font-size: 15px; }
  .admin-main .card { padding: var(--space-4); border-radius: var(--radius-lg); }
  .admin-main .card h3 { font-size: var(--fs-lg); }

  /* bigger bottom tab bar with roomy targets */
  .app-tabs { padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .app-tab { padding: 7px 2px; gap: 4px; font-size: 11.5px; }
  .app-tab-ico { width: 56px; height: 32px; }
  .app-tab-ico svg { width: 23px; height: 23px; }

  /* tables: let them scroll as cards rather than crush */
  .admin-main .table-wrap { border-radius: var(--radius-md); }
  table.data th, table.data td { padding: 12px 14px; font-size: 14px; }

  /* forms: full-size inputs, easy to tap */
  .admin-main input, .admin-main select, .admin-main textarea { min-height: 46px; font-size: 15px; }
  .admin-main .btn { min-height: 44px; }
  .admin-main .btn-lg { min-height: 50px; }

  /* segmented settings tabs: bigger, edge to edge */
  .seg-btn { padding: 10px 16px; font-size: var(--fs-md); }

  /* menu screen fills the width nicely */
  .menu-screen { gap: 22px; }
  .menu-row { padding: 15px 16px; }
  .menu-row-label { font-size: var(--fs-lg); }
}

/* ============================================================
   30. Homepage hero (v4) - centered, premium, vendor-logo strip
   ============================================================ */
.hero2 {
  position: relative; overflow: hidden;
  padding: var(--space-7) 0 var(--space-7);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-default);
  text-align: center;
}
.hero2-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 340px at 50% -8%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%),
    radial-gradient(520px 300px at 12% 4%, color-mix(in srgb, var(--pro) 12%, transparent), transparent 72%),
    radial-gradient(520px 300px at 88% 4%, color-mix(in srgb, var(--focus-ring) 10%, transparent), transparent 72%);
}
.hero2 > .container { position: relative; }
.hero2-body { max-width: 760px; margin: 0 auto; }

/* ---- vendor logo strip ---- */
.hero-logos {
  margin: 0 0 var(--space-5); padding-top: 12px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.hero-logos-track {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 12px;
  padding-top: 6px;
}
.hero-logo {
  position: relative; width: 58px; height: 58px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #ffffff;                      /* white plate in both themes - brand marks need it */
  border: 1px solid var(--border-default); border-radius: 15px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.hero-logo:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.hero-logo img { width: 32px; height: 32px; object-fit: contain; display: block; }
.hero-logo-fallback {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: #f1efec; color: #52504b; font-size: 12px; font-weight: var(--fw-bold);
}
.hero-logo-badge {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  min-width: 30px; padding: 2px 7px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: var(--fw-bold); line-height: 1.4; letter-spacing: -.01em;
  color: #fff; white-space: nowrap; box-shadow: var(--shadow-xs);
  border: 1.5px solid var(--surface-muted);
}
.hero-logo-badge--pct { background: var(--accent); }
.hero-logo-badge--amt { background: #1b1a15; }
[data-theme="dark"] .hero-logo-badge--amt { background: #3a3730; }

/* ---- text ---- */
.hero2-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px; border-radius: var(--radius-pill);
  background: var(--surface-raised); border: 1px solid var(--border-default);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}
.hero2-title {
  margin: var(--space-4) 0 var(--space-3);
  font-size: clamp(34px, 6.2vw, 62px); line-height: 1.04; letter-spacing: -.04em;
  font-weight: var(--fw-bold);
}
.hero2-sub {
  margin: 0 auto; max-width: 60ch;
  font-size: var(--fs-lg); line-height: 1.6; color: var(--text-secondary);
}
.hero2-sub b { color: var(--text-primary); font-weight: var(--fw-semibold); }

/* ---- search ---- */
.hero2-search {
  position: relative; display: flex; align-items: center; gap: 6px;
  max-width: 640px; margin: var(--space-5) auto 0;
  background: var(--surface-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: 6px 6px 6px 48px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}
.hero2-search:focus-within { border-color: var(--text-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus-ring) 20%, transparent); }
.hero2-search-ico { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); display: flex; pointer-events: none; }
.hero2-search input[type="search"] {
  flex: 1 1 auto; width: auto; min-width: 0; min-height: 46px;
  border: 0; background: transparent; box-shadow: none; padding: 0;
  font-size: var(--fs-md); color: var(--text-primary);
}
.hero2-search input[type="search"]:hover,
.hero2-search input[type="search"]:focus { border: 0; outline: none; box-shadow: none; }
.hero2-search input::placeholder { color: var(--text-secondary); }
.hero2-search-btn { flex-shrink: 0; border-radius: var(--radius-pill); min-height: 46px; padding: 0 24px; }

/* ---- CTAs ---- */
.hero2-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-5); }
.hero2-cta .btn-lg { padding: 0 28px; }

/* ---- trust row ---- */
.hero2-trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4);
  margin: var(--space-5) 0 0; padding: 0; list-style: none;
}
.hero2-trust li { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); color: var(--text-secondary); }
.hero2-trust svg { color: var(--accent); flex-shrink: 0; }

@media (max-width: 760px) {
  .hero2 { padding: var(--space-5) 0 var(--space-6); }
  /* one clean scrolling row on phones instead of many wrapped rows */
  .hero-logos-track {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
    padding: 12px 4px 4px; scrollbar-width: none;
  }
  .hero-logos-track::-webkit-scrollbar { display: none; }
  .hero-logo { width: 52px; height: 52px; }
  .hero2-title { font-size: clamp(30px, 8.5vw, 40px); }
  .hero2-sub { font-size: var(--fs-md); }
  .hero2-cta { flex-direction: column; }
  .hero2-cta .btn { width: 100%; }
  .hero2-trust { gap: var(--space-2) var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-logo { transition: none; }
}

/* ============================================================
   31. Pricing + checkout (manual payments)
   ============================================================ */

/* ---- currency selector on the pricing hero ---- */
.price-currency {
  display: inline-flex; align-items: center; gap: 8px; margin-top: var(--space-4);
  font-size: var(--fs-sm); color: var(--text-secondary);
}
.price-currency select {
  width: auto; min-height: 40px; padding: 0 32px 0 12px; border-radius: var(--radius-pill);
  background: var(--surface-raised); border: 1px solid var(--border-default); font-size: var(--fs-sm);
}

/* ---- plan toggle ---- */
.price-toggle-wrap { display: flex; justify-content: center; margin: 0 0 var(--space-5); }
.price-toggle { padding: 5px; }
.price-toggle .seg-btn { padding: 10px 26px; font-size: var(--fs-md); }

/* ---- plan cards ---- */
.price-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4);
  max-width: 880px; margin: 0 auto; align-items: stretch;
}
.price-card {
  position: relative; 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);
}
.price-card.is-premium {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--pro) 6%, var(--surface-raised)) 0%, var(--surface-raised) 40%);
}
.price-card[hidden] { display: none; }
.price-ribbon {
  position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: var(--fw-bold);
  letter-spacing: .03em; text-transform: uppercase; color: var(--pro);
  background: var(--pro-soft); padding: 4px 10px; border-radius: var(--radius-pill);
}
.price-card-head h2 { font-size: var(--fs-xl); margin: 0 0 2px; }
.price-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: var(--space-2) 0; }
.price-was { font-size: var(--fs-lg); color: var(--text-secondary); text-decoration: line-through; }
.price-now { font-size: clamp(34px, 6vw, 46px); font-weight: var(--fw-bold); letter-spacing: -.03em; line-height: 1; }
.price-per { font-size: var(--fs-md); color: var(--text-secondary); }
.price-off {
  font-size: 11px; font-weight: var(--fw-bold); color: #fff; background: var(--accent);
  padding: 3px 9px; border-radius: var(--radius-pill); letter-spacing: .02em;
}
.price-usd-note { font-size: var(--fs-xs); color: var(--text-secondary); margin: -4px 0 0; }
.price-feats { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: 12px; }
.price-feats li { display: flex; align-items: flex-start; gap: 11px; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-primary); }
.price-feats li b { font-weight: var(--fw-semibold); }
.price-feats .feat-tick {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-top: 1px;
}
.price-feats .feat-tick svg { width: 13px; height: 13px; }
.price-card.is-premium .price-feats .feat-tick { background: var(--pro-soft); color: var(--pro); }
.price-cta { margin-top: auto; }

/* ============================================================
   Checkout
   ============================================================ */
.checkout { padding: var(--space-5) 0 var(--space-7); }
.checkout-grid {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--space-5); align-items: start;
}
.checkout-h1 { font-size: var(--fs-3xl); letter-spacing: -.03em; margin: 0 0 6px; }
.checkout-h { font-size: var(--fs-md); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); margin: 0 0 var(--space-3); }

/* summary */
.checkout-summary {
  position: sticky; top: 88px;
  padding: var(--space-4); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-xs);
}
.sum-plan { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-default); }
.sum-plan strong { display: block; font-size: var(--fs-md); }
.sum-plan span.muted { display: block; }
.sum-lines { padding: var(--space-3) 0; display: grid; gap: 8px; }
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-sm); }
.sum-row.is-discount { color: var(--accent); }
.sum-total { padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--border-default); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.sum-usd { font-size: var(--fs-xs); color: var(--text-secondary); margin: 4px 0 0; }

.coupon-form { padding-top: var(--space-3); border-top: 1px solid var(--border-default); }
.coupon-input { display: flex; gap: 8px; }
.coupon-input input { min-height: 42px; }
.coupon-input .btn { flex-shrink: 0; }
.coupon-applied { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: var(--fs-sm); }
.coupon-applied span { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.coupon-remove { border: 0; background: none; color: var(--text-secondary); font-size: var(--fs-xs); cursor: pointer; text-decoration: underline; }

.checkout-cur { display: flex; align-items: center; gap: 8px; margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--text-secondary); }
.checkout-cur select { width: auto; min-height: 36px; padding: 0 28px 0 10px; border-radius: var(--radius-sm); }

.checkout-assure { list-style: none; padding: var(--space-3) 0 0; margin: var(--space-3) 0 0; border-top: 1px solid var(--border-default); display: grid; gap: 8px; }
.checkout-assure li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-secondary); }
.checkout-assure svg { color: var(--accent); flex-shrink: 0; }

/* payment side */
.pay-step { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-secondary); margin: var(--space-4) 0 var(--space-2); }
.pay-methods { display: grid; gap: 10px; }
.pay-method {
  display: block; border: 1.5px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-raised); cursor: pointer; overflow: hidden;
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.pay-method:hover { border-color: var(--border-strong); }
.pay-method.is-selected { border-color: var(--pro); box-shadow: 0 0 0 3px var(--pro-soft); }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.pay-method-main { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.pay-ico { flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.pay-ico.is-img { background: #fff; border: 1px solid var(--border-default); padding: 4px; }
.pay-ico.is-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pay-ico svg text { letter-spacing: -.02em; }
/* real official brand logo, shown as a wide lockup */
.pay-logo { flex-shrink: 0; display: inline-flex; align-items: center; border-radius: 9px; overflow: hidden; border: 1px solid var(--border-default); }
.pay-logo img { height: 100%; width: auto; display: block; }
/* when a logo lockup already shows the brand name, drop the duplicate text */
.pay-method-main.has-logo .pay-method-name:empty { display: none; }
.pay-method-main.has-logo .pay-method-name { margin-bottom: 1px; }
.pay-method-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pay-method-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-rec { font-size: 10px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .03em; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: var(--radius-pill); }
.pay-method-sub { font-size: var(--fs-xs); color: var(--text-secondary); }
.pay-method-check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong);
  display: grid; place-items: center; color: transparent; transition: all var(--motion-fast) var(--ease);
}
.pay-method.is-selected .pay-method-check { background: var(--pro); border-color: var(--pro); color: #fff; }

.pay-method-detail { display: none; padding: 0 14px 14px 14px; }
.pay-method.is-selected .pay-method-detail { display: block; }
.pay-detail-amt { display: block; font-size: var(--fs-sm); margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-muted); }
.pay-detail-amt b { font-size: var(--fs-md); }
.pay-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--border-default); }
.pay-field-label { font-size: var(--fs-xs); color: var(--text-secondary); flex-shrink: 0; }
.pay-field-val { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: var(--fw-medium); font-family: var(--font-mono); min-width: 0; }
.pay-field-val > span { overflow: hidden; text-overflow: ellipsis; }
.pay-copy { flex-shrink: 0; border: 1px solid var(--border-default); background: var(--surface-muted); color: var(--text-primary); font-size: 11px; font-weight: var(--fw-semibold); padding: 4px 9px; border-radius: var(--radius-xs); cursor: pointer; font-family: var(--font-sans); }
.pay-copy:hover { border-color: var(--border-strong); }
.pay-copy.is-copied { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pay-note { display: block; font-size: var(--fs-xs); color: var(--text-secondary); margin-top: 8px; line-height: 1.5; }

/* WhatsApp callout */
.pay-wa {
  display: flex; align-items: center; gap: 12px; margin-top: var(--space-3);
  padding: 13px 16px; border-radius: var(--radius-md); color: #fff;
  background: linear-gradient(100deg, #1faf54, #25d366);
  font-size: var(--fs-sm); box-shadow: var(--shadow-sm);
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.pay-wa:hover { color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.pay-wa span { flex: 1; min-width: 0; }
.pay-wa-go { flex-shrink: 0; }

.pay-confirm { border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-raised); padding: var(--space-4); }

/* WhatsApp button (success screen) */
.btn-wa { background: #25d366; color: #062e15; border-color: #25d366; font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: 9px; }
.btn-wa:hover { background: #20bd5a; color: #062e15; }

/* success */
.checkout-done { max-width: 560px; margin: var(--space-6) auto; text-align: center; }
.checkout-done-mark { width: 68px; height: 68px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: var(--space-3); }
.checkout-done h1 { font-size: var(--fs-3xl); letter-spacing: -.03em; }
.checkout-done-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-top: var(--space-4); }

@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  .checkout-summary { position: static; order: 2; }
  .checkout-pay { order: 1; }
}
@media (max-width: 620px) {
  .price-grid { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .checkout-done-actions .btn { width: 100%; }
  .pay-field { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pay-field-val { width: 100%; justify-content: space-between; }
}

/* ============================================================
   OTP / verification code page
   ============================================================ */
.otp-section { padding: var(--space-7) 0; display: flex; align-items: center; min-height: 70vh; }
.otp-card {
  max-width: 460px; margin: 0 auto; padding: var(--space-6);
  background: var(--surface-raised); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); text-align: center;
}
.otp-icon {
  width: 56px; height: 56px; margin: 0 auto var(--space-4);
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.otp-title { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.02em; margin: 0 0 var(--space-2); }
.otp-sub { color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6; margin: 0 0 var(--space-5); }
.otp-email { color: var(--text-primary); font-weight: var(--fw-semibold); word-break: break-all; }
.otp-alert { text-align: left; margin-bottom: var(--space-4); }

.otp-boxes { display: flex; gap: 8px; justify-content: center; margin: 0 0 var(--space-3); }
.otp-box {
  width: 52px; height: 60px; padding: 0; text-align: center;
  font-family: var(--font-mono); font-size: 24px; font-weight: var(--fw-semibold);
  color: var(--text-primary); background: var(--surface-base);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--motion-fast) linear, box-shadow var(--motion-fast) linear;
  -moz-appearance: textfield;
}
.otp-box::-webkit-outer-spin-button, .otp-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-box:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.otp-expiry { font-size: var(--fs-xs); color: var(--text-secondary); margin: 0 0 var(--space-4); }
.otp-submit:disabled { opacity: .5; cursor: not-allowed; }

.otp-resend { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: var(--space-4); font-size: var(--fs-sm); }
.otp-resend-text { color: var(--text-secondary); }
.otp-resend-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-weight: var(--fw-semibold); color: var(--accent); text-decoration: underline;
}
.otp-resend-btn:disabled, .otp-resend-btn.is-waiting { color: var(--text-secondary); text-decoration: none; cursor: default; }

.otp-foot { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-default); }
.otp-foot-line { font-size: var(--fs-xs); color: var(--text-secondary); margin: 0 0 var(--space-2); }
.otp-security {
  display: flex; align-items: flex-start; gap: 6px; justify-content: center;
  font-size: var(--fs-xs); line-height: 1.5; color: var(--text-secondary); margin: 0; text-align: left;
}
.otp-security svg { flex-shrink: 0; margin-top: 2px; }

@media (max-width: 480px) {
  .otp-card { padding: var(--space-5) var(--space-4); }
  .otp-boxes { gap: 6px; }
  .otp-box { width: 100%; max-width: 48px; height: 56px; font-size: 21px; }
}
