:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --local: #059669;
  --local-bg: #ecfdf5;
  --local-bd: #a7f3d0;
  --cloud-bg: #eef2ff;
  --cloud-bd: #c7d2fe;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, .05), 0 10px 26px -14px rgba(15, 23, 42, .12);
  --radius: 16px;
}

:root[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #131824;
  --surface-2: #1b2233;
  --border: #263147;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --local: #34d399;
  --local-bg: rgba(16, 185, 129, .14);
  --local-bd: rgba(16, 185, 129, .32);
  --cloud-bg: rgba(99, 102, 241, .16);
  --cloud-bd: rgba(99, 102, 241, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-card: 0 16px 40px -18px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.container { width: min(1160px, calc(100% - 2rem)); margin-inline: auto; }
.narrow { width: min(880px, calc(100% - 2rem)); }

/* Header & Mega Menus */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.topbar-left, .topbar-right, .nav {
  display: flex;
  align-items: center;
  gap: .95rem;
}
.topbar-left { gap: 1.6rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -.025em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.brand-mark svg { width: 18px; height: 18px; }
.nav a, .nav-link, .nav-trigger {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  background: transparent;
  border: 0;
  padding: .35rem .5rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-family: inherit;
}
.nav a:hover, .nav-link:hover, .nav-trigger:hover {
  color: var(--text);
  background: var(--surface-2);
}
.chev-ic { display: inline-flex; width: 14px; height: 14px; }
.svg-sm { display: inline-flex; width: 17px; height: 17px; }
.svg-md { display: inline-flex; width: 22px; height: 22px; }
.pill-ic { display: inline-flex; width: 14px; height: 14px; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: inline-flex; }
:root[data-theme="dark"] .icon-moon { display: none; }

.mega-popover {
  margin: 68px auto 0;
  width: min(860px, calc(100% - 2rem));
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.mega-popover::backdrop { background: rgba(15, 23, 42, .22); }
.mega-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}
.mega-title {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .5rem;
  padding-inline: .5rem;
}
.mega-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .42rem .5rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
}
.mega-link:hover { background: var(--surface-2); color: var(--accent); }
.mega-ic { display: inline-flex; width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: .62rem 1.05rem;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, .5);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-sm { padding: .38rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .82rem 1.35rem; font-size: .98rem; }
.btn-xl { padding: .95rem 2rem; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.pill-local { background: var(--local-bg); color: var(--local); border-color: var(--local-bd); }
.pill-accent { background: var(--cloud-bg); color: var(--accent); border-color: var(--cloud-bd); }
.pill-warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.proof-pill {
  font-size: .8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: .25rem .72rem;
  border-radius: 999px;
}

.badge-local, .badge-cloud {
  font-size: .7rem;
  font-weight: 700;
  padding: .16rem .5rem;
  border-radius: 999px;
}
.badge-local { background: var(--local-bg); color: var(--local); }
.badge-cloud { background: var(--cloud-bg); color: var(--accent); }

/* Homepage Hero */
.home-hero {
  padding: 2.5rem 0 1.4rem;
  background: radial-gradient(ellipse 80% 55% at 50% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent);
}
.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 1.1rem;
}
.home-title {
  text-align: center;
  margin: 0 auto .65rem;
  font-size: clamp(2rem, 4.4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  max-width: 22ch;
}
.home-sub {
  text-align: center;
  margin: 0 auto 1.6rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  max-width: 58ch;
}

.search-hero-wrap {
  position: relative;
  width: min(640px, 100%);
  margin: 0 auto 1.15rem;
}
.search-ic {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
  display: inline-flex;
}
.hero-search {
  width: 100%;
  padding: .88rem 1rem .88rem 2.85rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .98rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.hero-search:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }

/* Tool Page Hero */
.tool-hero { padding: 1.5rem 0 1.75rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a:hover { color: var(--accent); }
.tool-header { text-align: center; margin-bottom: 1.4rem; }
.tool-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin-bottom: .75rem; }
.tool-title {
  margin: 0 0 .45rem;
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -.03em;
}
.tool-sub { margin: 0 auto; color: var(--muted); max-width: 60ch; }

/* Studio & Dropzone */
.studio-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
}
.studio-compact { width: min(860px, 100%); margin-inline: auto; padding: .75rem; }

.drop-alert {
  margin-bottom: .85rem;
  padding: .7rem .95rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: .88rem;
  font-weight: 500;
}
:root[data-theme="dark"] .drop-alert { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: #fecaca; }

.dropzone {
  border: 2px dashed color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 12px;
  padding: 2.8rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.drop-content { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.drop-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--cloud-bg);
  color: var(--accent);
}
.drop-svg { width: 24px; height: 24px; display: inline-flex; }
.drop-title { font-size: .98rem; font-weight: 600; color: var(--text); }
.drop-hint { font-size: .84rem; color: var(--muted); }

.dropzone-compact { padding: .85rem 1.1rem; text-align: left; }
.dropzone-compact .drop-content { flex-direction: row; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dropzone-compact .drop-icon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.drop-compact-copy { flex: 1; min-width: 220px; display: grid; }
.drop-compact-copy strong { font-size: .95rem; }
.drop-compact-copy span { font-size: .82rem; color: var(--muted); }

/* Two-Column Workspace */
.workspace-split {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr 330px;
  align-items: start;
}
.workspace-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
}
.file-summary, .workspace-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.file-list, .result-list {
  list-style: none;
  margin: .85rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
  max-height: 380px;
  overflow-y: auto;
}
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.file-meta { min-width: 0; display: flex; align-items: center; gap: .6rem; }
.ext-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .48rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-transform: uppercase;
  flex-shrink: 0;
}
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: .9rem; }
.file-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.status-text { font-size: .82rem; color: var(--muted); }
.status-ok { color: var(--local); }
.status-err { color: var(--danger); }

.action-sidebar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}
.sidebar-section, .sidebar-options, .opt-field { display: grid; gap: .45rem; }
.opt-label { font-size: .82rem; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; }
.opt-sub { display: grid; gap: .25rem; font-size: .78rem; color: var(--muted); flex: 1; }
.opt-row { display: flex; gap: .5rem; align-items: center; }
.field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: .5rem .7rem;
  font-size: .88rem;
  font-family: inherit;
}
.crop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.crop-grid label { display: grid; gap: .2rem; font-size: .72rem; color: var(--muted); text-align: center; }
.crop-grid input { text-align: center; padding: .4rem .25rem; }
.check-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 500; cursor: pointer; }

.target-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .2rem; }
.target-pill {
  padding: .28rem .6rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: .76rem;
  text-transform: uppercase;
  cursor: pointer;
}
.target-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.sign-canvas {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
}

/* Receipt */
.receipt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}
.receipt-head h2 { margin: .4rem 0 .15rem; font-size: 1.3rem; }
.receipt-cta { display: flex; gap: .6rem; flex-wrap: wrap; }

/* Directory Grid */
.directory-section { padding: 1rem 0 2rem; }
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  margin-bottom: 1.25rem;
}
.cat-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: .46rem .95rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.cat-tab:hover { color: var(--text); border-color: var(--accent); }
.cat-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.featured-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
}
.feat-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .13s ease, border-color .15s ease, box-shadow .15s ease;
}
.feat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}
.feat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ic, var(--accent)) 14%, transparent);
  color: var(--ic, var(--accent));
}
.feat-svg { width: 20px; height: 20px; display: inline-flex; }
.feat-card h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.feat-card p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.45; }

.search-pairs-wrap { margin-top: 1.4rem; }
.search-pairs-head { font-size: .84rem; font-weight: 700; color: var(--muted); margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .04em; }
.pairs-mini-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pair-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .68rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: .86rem;
}
.pair-mini-card:hover { border-color: var(--accent); }
.search-empty { text-align: center; padding: 2rem; color: var(--muted); }

/* Trust, Related, SEO Drawer, Docs, Pricing */
.trust-strip, .seo-details, .related-section, .page-section { padding: 1.5rem 0 2.2rem; }
.trust-grid, .seo-grid, .plan-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.trust-card, .seo-card, .plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.trust-ic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--cloud-bg);
  color: var(--accent);
  margin-bottom: .75rem;
}
.trust-card h3, .seo-card h2, .related-section h2 { margin-top: 0; font-size: 1.06rem; }
.trust-card p { margin: 0; font-size: .88rem; color: var(--muted); }
.steps-list { padding-left: 1.2rem; display: grid; gap: .5rem; }
.faq-list details { border-bottom: 1px solid var(--border); padding: .6rem 0; }
.faq-list summary { cursor: pointer; font-weight: 600; }

.seo-drawer-section { padding: 0 0 2rem; }
.all-pairs-drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1.1rem;
}
.all-pairs-drawer summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--muted); }
.drawer-grid {
  margin-top: .9rem;
  display: grid;
  gap: .45rem .8rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  font-size: .84rem;
}
.drawer-grid a { color: var(--muted); }
.drawer-grid a:hover { color: var(--accent); }

.plan-card ul { padding-left: 1.15rem; color: var(--muted); display: grid; gap: .4rem; margin: 1rem 0 1.25rem; }
.plan-featured { border-color: var(--accent); }
.plan-head-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.plan-title { font-weight: 700; font-size: 1.05rem; }
.plan-price { font-size: 2rem; font-weight: 800; margin-top: .25rem; }
.plan-price span { font-size: .88rem; color: var(--muted); font-weight: 500; }
.billing-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px; gap: 2px; }
.billing-btn { border: 0; background: transparent; color: var(--muted); font-size: .74rem; font-weight: 600; padding: .22rem .55rem; border-radius: 999px; cursor: pointer; }
.billing-btn.active { background: var(--accent); color: #fff; }
.pp-btn-wrap { min-height: 44px; margin-top: .4rem; }
.paypal-result { margin-bottom: .9rem; padding: .75rem .9rem; border-radius: 10px; background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .35); color: var(--text); font-size: .88rem; }
.paypal-result-err { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); }
.account-banner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; padding: .75rem .95rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: .84rem; }
.acc-banner-left { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.acc-banner-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.acc-banner-sub { font-size: .78rem; margin-top: 2px; }
.account-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* Account Avatar Pill + Popover */
.account-pill { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .6rem 0 .25rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.account-pill:hover { border-color: var(--accent); background: var(--surface-2); }
.acc-avatar-sm, .acc-avatar { display: grid; place-items: center; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; flex-shrink: 0; }
.acc-avatar-sm { width: 24px; height: 24px; font-size: .74rem; }
.acc-avatar { width: 34px; height: 34px; font-size: .88rem; }
.acc-plan-tag { font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; background: var(--local-bg); color: var(--local); border: 1px solid var(--local-bd); }
.account-popover { position: fixed; inset: auto; top: 68px; right: max(1rem, calc((100vw - 1160px) / 2)); margin: 0; width: 290px; padding: .6rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.account-popover::backdrop { background: transparent; }
.acc-pop-head { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; }
.acc-meta { min-width: 0; flex: 1; }
.acc-name { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-email { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-pop-sub { padding: .3rem .5rem .45rem; font-size: .76rem; color: var(--muted); }
.acc-pop-list { display: grid; gap: 2px; border-top: 1px solid var(--border); padding-top: .4rem; margin-top: .25rem; }
.acc-pop-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); font-family: inherit; font-size: .84rem; font-weight: 600; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; }
.acc-pop-item:hover { background: var(--surface-2); }
.acc-pop-danger { color: var(--danger); }
.acc-pop-sep { height: 1px; background: var(--border); margin: .25rem 0; }

/* Modern Auth Modal & Standalone Page */
#auth-dialog { width: min(430px, calc(100% - 1.5rem)); border-radius: 20px; }
.auth-shell { position: relative; padding: 1.75rem 1.65rem 1.55rem; }
.auth-close { position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px; font-size: .9rem; }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-logo { width: 46px; height: 46px; margin: 0 auto .75rem; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .65); }
.auth-logo svg { width: 22px; height: 22px; }
.auth-brand h1 { margin: 0; font-size: 1.38rem; font-weight: 800; letter-spacing: -.02em; }
.auth-brand p { margin: .3rem 0 0; font-size: .88rem; }

.auth-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 1.15rem; }
.auth-seg-btn { border: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: .84rem; font-weight: 600; padding: .5rem .6rem; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.auth-seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.auth-alert { margin-bottom: 1rem; padding: .7rem .85rem; border-radius: 10px; font-size: .84rem; font-weight: 500; background: var(--local-bg); border: 1px solid var(--local-bd); color: var(--text); }
.auth-alert-err { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: var(--danger); }

.auth-form { display: grid; gap: .95rem; }
.auth-field { display: grid; gap: .38rem; }
.auth-label { font-size: .82rem; font-weight: 600; color: var(--text); }
.auth-label-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.auth-form input { width: 100%; height: 44px; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: 0 .9rem; font-family: inherit; font-size: .92rem; transition: border-color .15s, box-shadow .15s, background .15s; }
.auth-form input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4rem; }
.pw-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-family: inherit; font-size: .76rem; font-weight: 600; padding: .3rem .45rem; border-radius: 6px; cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }

.pw-meter { display: grid; gap: .3rem; margin-top: .15rem; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pw-bars span { height: 4px; border-radius: 99px; background: var(--border); transition: background .2s; }
.pw-meter[data-score="1"] .pw-bars span:nth-child(1) { background: #ef4444; }
.pw-meter[data-score="2"] .pw-bars span:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-score="3"] .pw-bars span:nth-child(-n+3) { background: #10b981; }
.pw-meter[data-score="4"] .pw-bars span { background: #059669; }
.pw-label { font-size: .74rem; color: var(--muted); }

.auth-switch { text-align: center; font-size: .84rem; margin-top: .15rem; }
.auth-link { border: 0; background: transparent; color: var(--accent); font-family: inherit; font-size: inherit; font-weight: 600; padding: 0; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }

.auth-verify { text-align: center; display: grid; gap: .75rem; padding: .5rem 0 .25rem; }
.auth-mail-badge { width: 54px; height: 54px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--local-bg); border: 1px solid var(--local-bd); color: var(--local); }
.auth-mail-badge svg { width: 26px; height: 26px; }
.auth-verify h2 { margin: 0; font-size: 1.2rem; }
.auth-verify p { margin: 0; font-size: .88rem; }
.auth-verify-actions { display: grid; gap: .55rem; margin-top: .35rem; }

.auth-page-wrap { min-height: calc(100dvh - 150px); display: grid; place-items: center; padding: 2.5rem 1rem; }
.auth-page-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.85rem 1.65rem; box-shadow: var(--shadow-card); }
.auth-toast { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 60; max-width: 360px; padding: .85rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--local); color: var(--text); box-shadow: var(--shadow-card); font-size: .88rem; }
.auth-toast-err { border-color: #ef4444; }

dialog {
  transition: opacity .18s ease, transform .18s ease, overlay .18s ease allow-discrete, display .18s ease allow-discrete;
  opacity: 0;
  transform: translateY(8px) scale(.985);
}
dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}
@starting-style {
  dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(.985);
  }
}

/* Dialog */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(680px, calc(100% - 1.5rem));
  max-height: 90dvh;
  box-shadow: var(--shadow-card);
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.dialog-card { padding: 1.35rem; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.dialog-head h1 { margin: .45rem 0 0; font-size: 1.35rem; }
.waitlist-form { margin-top: 1.15rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.waitlist-form label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .45rem; }
.waitlist-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.waitlist-row input {
  flex: 1;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: .6rem .85rem;
}
.form-note { font-size: .84rem; min-height: 1.2em; margin: .5rem 0 0; color: var(--local); }

/* Code docs */
.code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.15rem;
}
.code-head {
  padding: .65rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
  font-weight: 600;
  color: var(--accent);
}
.code-card pre { margin: 0; padding: 1rem; overflow-x: auto; font-size: .85rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 2.2rem 0 1.6rem; color: var(--muted); font-size: .85rem; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
.footer-brand strong { font-size: 1rem; color: var(--text); }
.footer-brand p { margin: .45rem 0 0; font-size: .84rem; line-height: 1.55; max-width: 30ch; }
.footer-col { display: grid; gap: .45rem; align-content: start; }
.footer-head { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text); margin-bottom: .15rem; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; font-size: .8rem; }

/* Legal, About & Contact Pages */
.auth-legal { font-size: .75rem; text-align: center; margin: -.2rem 0 0; line-height: 1.45; }
.legal-wrap { width: min(860px, calc(100% - 2rem)); }
.legal-head { margin-bottom: 1.25rem; }
.legal-head h1 { margin: .5rem 0 .25rem; font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.02em; }
.legal-meta { font-size: .84rem; }
.prose-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.65rem 1.75rem; box-shadow: var(--shadow-sm); line-height: 1.68; }
.prose-card > p:first-child { margin-top: 0; }
.prose-card h2 { margin: 1.6rem 0 .55rem; font-size: 1.15rem; letter-spacing: -.01em; color: var(--text); }
.prose-card ul { padding-left: 1.25rem; display: grid; gap: .45rem; margin: .5rem 0 1rem; }
.prose-card a { color: var(--accent); font-weight: 500; }
.prose-card a:hover { text-decoration: underline; }
.cookie-table td:last-child, .cookie-table th:last-child { white-space: nowrap; }

.contact-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 1.15rem; align-items: start; }
.contact-side { display: grid; gap: 1rem; }
.settings-card textarea, .settings-card select { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 11px; padding: .7rem .9rem; font-family: inherit; font-size: .92rem; }
.settings-card textarea:focus, .settings-card select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Ad Slots (hidden for Pro / 24h-Pass users) */
.ad-wrap { margin: 1.25rem auto; }
.ad-slot { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .65rem .85rem .85rem; text-align: center; min-height: 100px; overflow: hidden; }
.ad-label { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }

.plan-lock-note { margin-top: .5rem; padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .82rem; }
.pill-err { background: rgba(239, 68, 68, .12); color: var(--danger); border: 1px solid rgba(239, 68, 68, .3); }

/* Settings Page */
.settings-wrap { width: min(860px, calc(100% - 2rem)); }
.settings-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.35rem; }
.settings-head h1 { margin: 0; font-size: 1.65rem; letter-spacing: -.02em; }
.settings-head p { margin: .25rem 0 0; }
.settings-stack { display: grid; gap: 1.15rem; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow-sm); }
.settings-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.settings-card-head h2 { margin: 0; font-size: 1.1rem; }
.settings-two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.settings-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.settings-card input:disabled { opacity: .65; cursor: not-allowed; }

.plan-summary-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .85rem 1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.plan-summary-title { font-weight: 700; font-size: 1.05rem; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.toggle-title { font-weight: 600; font-size: .92rem; }
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background .18s; }
.switch-slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s; }
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-slider { opacity: .5; cursor: not-allowed; }

.sub-cancel-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--border); }
.sub-section-title { margin: 1.25rem 0 .65rem; font-size: .92rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.orders-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.orders-table { width: 100%; border-collapse: collapse; font-size: .84rem; text-align: left; }
.orders-table th, .orders-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.orders-table th { background: var(--surface-2); font-size: .76rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.orders-table tr:last-child td { border-bottom: 0; }

.api-box { display: grid; gap: .75rem; }
.api-meta-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.usage-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.usage-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.new-key-box { display: grid; gap: .4rem; padding: .75rem .9rem; border-radius: 10px; background: var(--local-bg); border: 1px solid var(--local-bd); }
.new-key-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.new-key-row code { word-break: break-all; font-size: .84rem; }

.danger-drawer { margin-top: 1.35rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.danger-drawer summary { cursor: pointer; color: var(--danger); font-weight: 600; font-size: .88rem; }
.btn-danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-danger:hover { filter: brightness(1.08); }

@media (max-width: 860px) {
  .workspace-split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-hide-sm { display: none; }
  .dropzone { padding: 2rem 1rem; }
  .settings-two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
