:root {
  --color-danger: #C0392B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --color-danger: #FF6B6B; }
}
:root[data-theme="dark"] { --color-danger: #FF6B6B; }

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
img[hidden], svg[hidden] { display: none; }
button, input, textarea, select { font: inherit; color: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--duration-ui) var(--ease-out),
              color var(--duration-ui) var(--ease-out);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-fg);
}

p { color: var(--color-muted); }
a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent-fg);
  outline-offset: 2px;
  border-radius: var(--radius-inner);
}

/* ============================================================
   Surfaces
   ============================================================ */
.surface-flat { background: var(--color-bg); box-shadow: var(--elevation-flat); }
.surface-flat-sm { background: var(--color-bg); box-shadow: var(--elevation-flat-sm); }
.surface-inset { background: var(--color-bg); box-shadow: var(--elevation-inset); }
.surface-inset-deep { background: var(--color-bg); box-shadow: var(--elevation-inset-deep); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap-min);
  padding: 0.9rem 1.75rem;
  border: none;
  border-radius: var(--radius-base);
  background: var(--color-bg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-fg);
  box-shadow: var(--elevation-flat);
  cursor: pointer;
  transition: transform var(--duration-ui) var(--ease-out),
              box-shadow var(--duration-ui) var(--ease-out),
              color var(--duration-ui) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--elevation-flat-hover); }
.btn:active { transform: translateY(0.5px); box-shadow: var(--elevation-inset-sm); }
.btn[hidden] { display: none; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--elevation-flat-sm);
}

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(145deg, var(--color-accent-light), var(--color-accent));
  box-shadow: 9px 9px 16px var(--shadow-dark), -9px -9px 16px var(--shadow-light);
}
.btn-primary:hover { box-shadow: 12px 12px 20px var(--shadow-dark-strong), -12px -12px 20px var(--shadow-light-strong); }
.btn-primary:active { box-shadow: inset 4px 4px 8px rgba(0,0,0,0.25), inset -4px -4px 8px rgba(255,255,255,0.15); }
.btn-primary:disabled { opacity: 0.5; box-shadow: var(--elevation-flat-sm); }

.btn-icon {
  padding: 0.55rem 1rem;
  min-height: 0;
  border-radius: var(--radius-inner);
  font-size: 0.8rem;
}

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-block: 1rem;
  background: rgba(var(--color-bg-rgb), 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* On narrow screens, keep the theme toggle right beside the logo and
   drop the nav-links pill to its own row underneath. */
@media (max-width: 640px) {
  .nav-links { order: 3; flex-basis: 100%; justify-content: center; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--color-fg);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { display: block; width: 22px; height: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  flex-wrap: wrap;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: color var(--duration-ui) var(--ease-out), box-shadow var(--duration-ui) var(--ease-out);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-fg);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
}

/* Generator submenu — lists every dedicated tool page */
.nav-item.has-submenu {
  position: relative;
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
  border-radius: var(--radius-full);
  transition: background var(--duration-ui) var(--ease-out), box-shadow var(--duration-ui) var(--ease-out);
}
/* The hover/open pill wraps the whole item — link text and arrow together —
   instead of stopping at the link, which left the arrow looking stranded
   outside the highlighted area. */
.nav-item.has-submenu:hover,
.nav-item.has-submenu:focus-within,
.nav-item.has-submenu.is-open,
.nav-item.has-submenu.active {
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
}
.nav-item.has-submenu:hover > a,
.nav-item.has-submenu:focus-within > a,
.nav-item.has-submenu.is-open > a,
.nav-item.has-submenu.active > a {
  color: var(--color-fg);
}
/* Invisible bridge over the gap between the nav item and the submenu —
   without it, the cursor crosses empty space (no element under it) on
   the way down, :hover drops, and the menu closes before it's reached. */
.nav-item.has-submenu::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.6rem;
}
.submenu-toggle {
  width: 22px;
  height: 40px;
  margin-left: -0.4rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.submenu-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-ui) var(--ease-out);
}
.nav-item.has-submenu:hover .submenu-toggle::after,
.nav-item.has-submenu:focus-within .submenu-toggle::after,
.nav-item.has-submenu.is-open .submenu-toggle::after {
  transform: rotate(-135deg);
}

.submenu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  width: max-content;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  border-radius: var(--radius-base);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-hover);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem 0.3rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--duration-ui) var(--ease-out),
              transform var(--duration-ui) var(--ease-out),
              visibility var(--duration-ui) var(--ease-out);
  z-index: 60;
}
.nav-item.has-submenu:hover .submenu,
.nav-item.has-submenu:focus-within .submenu,
.nav-item.has-submenu.is-open .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.submenu a {
  display: block;
  min-height: 0;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-inner);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}
.submenu a:hover, .submenu a:focus-visible {
  color: var(--color-fg);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
}

.nav-cta { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  cursor: pointer;
  transition: box-shadow var(--duration-ui) var(--ease-out), transform var(--duration-ui) var(--ease-out);
}
.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--elevation-flat-hover); }
.theme-toggle:active { transform: translateY(0.5px); box-shadow: var(--elevation-inset-sm); }
.theme-toggle svg { width: 20px; height: 20px; stroke: var(--color-accent-fg); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
}
.breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
}
.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--color-accent-fg);
}
.breadcrumb-sep {
  color: var(--color-muted);
  opacity: 0.6;
}
.breadcrumb-current {
  color: var(--color-fg);
  font-weight: 600;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding-block: clamp(3rem, 8vw, 6rem) var(--space-section);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem 0.45rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-accent-fg);
  margin-bottom: 1.5rem;
}
.eyebrow-dot {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, var(--color-accent-light), var(--color-accent));
  box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); line-height: 1.05; margin-bottom: 1.5rem; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(145deg, var(--color-accent-light), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); max-width: 34rem; margin-bottom: 2.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 30rem;
  margin-inline: auto;
  display: grid;
  place-items: center;
}

/* Dedicated-type-page hero: a live, real QR preview instead of the
   homepage's icon-and-rings — reuses the same preview-card styling as
   the generator below so the teaser and the real thing match exactly. */
.hero-teaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: 100%;
  max-width: 17rem;
  margin-inline: auto;
}
.hero-teaser .preview-card {
  width: 100%;
  animation: float 6s ease-in-out infinite;
}

/* Bulk page: a small batch grid instead of one big code, since the
   point of this page is many different codes at once. */
.hero-teaser--grid { max-width: 19rem; }
.hero-teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  width: 100%;
}
.hero-teaser-grid .preview-card { padding: 0.6rem; }
.hero-teaser-grid .preview-card:nth-child(2) { animation-delay: 0.3s; }
.hero-teaser-grid .preview-card:nth-child(3) { animation-delay: 0.6s; }
.hero-teaser-grid .preview-card:nth-child(4) { animation-delay: 0.9s; }
.hero-teaser-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-fg);
}
.hero-teaser-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-secondary);
  flex-shrink: 0;
}
.hv-ring { position: absolute; border-radius: 50%; background: var(--color-bg); }
.hv-ring--outer { inset: 0; box-shadow: var(--elevation-flat); animation: float 7s ease-in-out infinite; }
.hv-ring--mid { inset: 12%; box-shadow: var(--elevation-inset-deep); }
.hv-card {
  position: relative;
  width: 62%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-hover);
  display: grid;
  place-items: center;
  animation: float 6s ease-in-out infinite;
  animation-delay: 0.4s;
}
.hv-card .icon-well { width: 44%; aspect-ratio: 1 / 1; }
.hv-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  animation: float 5s ease-in-out infinite;
}
.hv-chip--1 { top: 6%; right: -4%; animation-delay: 0.2s; }
.hv-chip--2 { bottom: 10%; left: -8%; animation-delay: 1s; }
.hv-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent-secondary); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-sub { margin-inline: auto; }
  .hero-actions { justify-content: center; }
}

/* ============================================================
   Icon wells
   ============================================================ */
.icon-well {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-deep);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.icon-well svg { width: 26px; height: 26px; stroke: var(--color-accent-fg); }
.icon-well--teal svg { stroke: var(--color-accent-secondary); }

/* ============================================================
   Section scaffolding
   ============================================================ */
section { padding-block: var(--space-section); scroll-margin-top: 6rem; }
.section-head { max-width: 40rem; margin-inline: auto; text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: clamp(2rem, 3.5vw, 2.75rem); margin-bottom: 1rem; }
.section-head p { font-size: 1.0625rem; }
.kicker {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-fg);
  margin-bottom: 0.75rem;
}

/* ============================================================
   Feature cards
   ============================================================ */
.grid-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2rem); }
.card {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat);
  transition: transform var(--duration-ui) var(--ease-out), box-shadow var(--duration-ui) var(--ease-out);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--elevation-flat-hover); }
.card-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.card-head .icon-well { width: 48px; height: 48px; }
.card-head .icon-well svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.25rem; margin: 0; }
.card p { font-size: 0.9375rem; }
.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-accent-fg);
}
.card-link:hover { text-decoration: underline; }

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

/* ============================================================
   Landing-page intro (per-type SEO pages)
   ============================================================ */
.type-intro { max-width: 42rem; margin-inline: auto; text-align: center; }
.type-intro p { font-size: 1.0625rem; margin-top: 1rem; }
.type-intro p:first-of-type { margin-top: 1.5rem; }
.type-intro .hero-actions { justify-content: center; margin-top: 1.75rem; }

/* ============================================================
   Bulk CSV format guide
   ============================================================ */
.format-guide-grid {
  max-width: 58rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.format-guide-card {
  padding: clamp(1.5rem, 2.5vw, 2rem);
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat);
}
.format-guide-card h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.format-guide-card p { font-size: 0.875rem; color: var(--color-muted); margin: 0 0 0.9rem; }
.format-guide-card .code-sample + p { margin-top: 0.9rem; }
.code-sample {
  display: block;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-fg);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.format-guide-note {
  max-width: 46rem;
  margin: 0 auto 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  font-size: 0.9rem;
  color: var(--color-muted);
}
.format-guide-note strong { color: var(--color-fg); }

/* ============================================================
   How-to tutorial (bulk generation guide)
   ============================================================ */
.howto-toc {
  max-width: 46rem;
  margin: 0 auto 3rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
}
.howto-toc h2 {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-fg);
  margin: 0 0 1rem;
}
.howto-toc ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding-left: 1.25rem;
}
.howto-toc a { font-size: 0.9rem; font-weight: 600; color: var(--color-fg); }
.howto-toc a:hover { color: var(--color-accent-fg); }

.needs-list {
  max-width: 40rem;
  margin: 0 auto 3rem;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.needs-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  font-size: 0.95rem;
  color: var(--color-fg);
}
.needs-list .needs-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 0.05rem;
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, var(--color-accent-light), var(--color-accent));
  display: grid;
  place-items: center;
  color: #fff;
}
.needs-list .needs-icon svg { width: 14px; height: 14px; }

.howto-steps { display: flex; flex-direction: column; gap: 1.75rem; max-width: 46rem; margin: 0 auto 1rem; }
.howto-step {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat);
}
.howto-step-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.howto-step-head .step-num {
  width: 44px;
  height: 44px;
  margin: 0;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--color-accent-fg);
}
.howto-step-head h3 { font-size: 1.2rem; margin: 0; }
.howto-step-body p { margin: 0 0 1rem; color: var(--color-muted); font-size: 0.95rem; line-height: 1.65; }
.howto-step-body p:last-child { margin-bottom: 0; }
.howto-step-body ol,
.howto-step-body ul {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}
.howto-step-body li { margin-bottom: 0.35rem; }
.howto-step-body strong { color: var(--color-fg); }
.howto-step-body .code-sample { margin-bottom: 1.25rem; }

.howto-substeps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.howto-substep {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
}
.howto-substep h4 { font-size: 0.85rem; margin: 0 0 0.5rem; color: var(--color-fg); }
.howto-substep ol { margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.howto-substep li { margin-bottom: 0.25rem; }

.csv-table-wrap { overflow-x: auto; margin-bottom: 1.25rem; border-radius: var(--radius-inner); box-shadow: var(--elevation-inset-sm); }
.csv-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.csv-table th, .csv-table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  white-space: nowrap;
}
.csv-table thead th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-accent-fg);
  box-shadow: inset 0 -2px 0 var(--shadow-dark);
}
.csv-table tbody td { color: var(--color-muted); }
.csv-table tbody tr:not(:last-child) td { box-shadow: inset 0 -1px 0 var(--shadow-dark); }

.copy-btn { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 1.25rem; }
.copy-btn[data-copied="true"] { color: var(--color-accent-fg); }

.howto-narrow { max-width: 46rem; margin-inline: auto; }
.mistake-list { max-width: 46rem; margin-inline: auto; list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.mistake-list li {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
}
.mistake-list strong { display: block; color: var(--color-fg); font-size: 0.95rem; margin-bottom: 0.25rem; }

.faq-list { max-width: 46rem; margin-inline: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.faq-details { border-radius: var(--radius-inner); background: var(--color-bg); }
.faq-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-inner);
  box-shadow: var(--elevation-flat-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-fg);
  transition: box-shadow var(--duration-ui) var(--ease-out);
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { content: ""; }
.faq-summary:hover { box-shadow: var(--elevation-flat-hover); }
.faq-summary::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-ui) var(--ease-out);
}
.faq-details[open] .faq-summary { box-shadow: var(--elevation-inset-sm); }
.faq-details[open] .faq-summary::after { transform: rotate(-135deg); }
.faq-content { padding: 1rem 1.4rem 0.2rem; font-size: 0.9rem; color: var(--color-muted); line-height: 1.65; }

/* Internal links to sibling tool pages */
.tool-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.tool-links a {
  display: block;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-fg);
  transition: box-shadow var(--duration-ui) var(--ease-out), transform var(--duration-ui) var(--ease-out);
}
.tool-links a:hover { box-shadow: var(--elevation-flat-hover); transform: translateY(-1px); }


/* ============================================================
   Process — steps
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
}
.step { text-align: center; padding: 0 0.5rem; }
.step-num {
  width: 64px;
  height: 64px;
  margin-inline: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-accent-fg);
}
.step h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.step p { font-size: 0.9375rem; max-width: 20rem; margin-inline: auto; }

@media (max-width: 767px) {
  .steps { grid-template-columns: 1fr; }
}

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat);
  padding: clamp(3rem, 6vw, 5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 1rem; }
.cta-band p { max-width: 32rem; margin-inline: auto; margin-bottom: 2rem; font-size: 1.0625rem; }
.cta-band .hero-actions { justify-content: center; position: relative; }
.cta-decor { position: absolute; border-radius: 50%; background: var(--color-bg); }
.cta-decor--1 { width: 220px; height: 220px; top: -80px; right: -60px; box-shadow: var(--elevation-inset-deep); opacity: 0.6; }
.cta-decor--2 { width: 140px; height: 140px; bottom: -50px; left: -30px; box-shadow: var(--elevation-inset); opacity: 0.6; }

/* ============================================================
   Generator panel
   ============================================================ */
.generator-panel {
  border-radius: var(--radius-container);
  padding: clamp(1.75rem, 3vw, 2.75rem);
}

.generator-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: stretch;
}
.generator-grid > * { min-width: 0; }

@media (max-width: 900px) {
  .generator-grid { grid-template-columns: 1fr; }
}

.controls { display: flex; flex-direction: column; gap: 1.1rem; }

/* Type selector tabs — same rounded-rectangle radius as the fields below,
   so it reads as one consistent box rather than a pill that stretches
   awkwardly once it wraps to multiple rows. */
.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  margin-bottom: 1.25rem;
}
.type-tab {
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.775rem;
  cursor: pointer;
  transition: color var(--duration-ui) var(--ease-out),
              background var(--duration-ui) var(--ease-out),
              box-shadow var(--duration-ui) var(--ease-out);
}
.type-tab:hover { color: var(--color-fg); }
.type-tab.is-active { color: var(--color-fg); background: var(--color-bg); box-shadow: var(--elevation-flat-sm); }

/* Single code / Bulk from CSV switcher */
.mode-toggle {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  margin-bottom: 1.5rem;
}
.mode-tab {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--duration-ui) var(--ease-out),
              background var(--duration-ui) var(--ease-out),
              box-shadow var(--duration-ui) var(--ease-out);
}
.mode-tab:hover { color: var(--color-fg); }
.mode-tab.is-active { color: var(--color-fg); background: var(--color-bg); box-shadow: var(--elevation-flat-sm); }
.mode-panel[hidden] { display: none; }

/* On the dedicated bulk page, the preview column disappears in Bulk
   mode (style controls stay put in the form column) — collapse the
   grid to one column so the form doesn't leave an empty second track. */
.generator-grid[data-active-mode="bulk"] { grid-template-columns: 1fr; }

.example-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* Form fields */
.type-fields { display: flex; flex-direction: column; gap: 0.6rem; }
.type-fields[hidden] { display: none; }

.field-group { display: flex; flex-direction: column; gap: 0.5rem; }

label {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-fg);
}
.optional { font-weight: 500; color: var(--color-muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  box-shadow: var(--elevation-inset-sm);
  transition: box-shadow var(--duration-ui) var(--ease-out);
}
input::placeholder, textarea::placeholder { color: var(--color-placeholder); }
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
  box-shadow: var(--elevation-inset);
}
textarea { resize: vertical; }

/* The calendar icon is the browser's own control — filter-based
   inversion proved unreliable (Chrome's native glyph isn't pure black,
   so invert() left it just as low-contrast), so it's replaced outright
   with a small SVG colored to match --color-fg in each theme. */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0.2rem;
  border-radius: var(--radius-inner);
  opacity: 0.7;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233D4852' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  transition: opacity var(--duration-ui) var(--ease-out);
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E7ECF3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E7ECF3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.75rem;
  cursor: pointer;
  /* Some Chromium builds paint a faint native highlight around <select>
     in dark color-scheme that isn't part of the CSS box model, so
     `border: none` alone doesn't fully suppress it — an explicit
     same-color border and a cleared outline do. */
  border: 1px solid var(--color-bg);
  outline: none;
}
select:focus-visible {
  outline: 2px solid var(--color-accent-fg);
  outline-offset: 2px;
}

.select-wrap { position: relative; }
.select-wrap select { width: 100%; }
.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1.1rem;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.row label { white-space: nowrap; font-weight: 700; }
.row .select-wrap { flex: 1; min-width: 8rem; }

/* Size / colors / logo / advanced options sit 2-3 to a row instead of
   stretching full width. */
.style-controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem 1.75rem; }
.style-controls > .row,
.style-controls > .row-group,
.style-controls > .field-group,
.style-controls > .advanced-details { flex: 1 1 240px; max-width: 340px; }
.row-group { display: flex; flex-direction: column; gap: 0.5rem; }

.color-row input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 4px;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  cursor: pointer;
  flex-shrink: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }

.field-hint { margin: 0; font-size: 0.8rem; color: var(--color-muted); }
.field-hint-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-fg);
}
.field-hint-link:hover { text-decoration: underline; }

.advanced-details { margin: 0; }
.advanced-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-fg);
  transition: box-shadow var(--duration-ui) var(--ease-out);
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary::marker { content: ""; }
.advanced-summary:hover { box-shadow: var(--elevation-flat-hover); }
.advanced-summary::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-ui) var(--ease-out);
}
.advanced-details[open] .advanced-summary { box-shadow: var(--elevation-inset-sm); }
.advanced-details[open] .advanced-summary::after { transform: rotate(-135deg); }
.advanced-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.75rem;
  padding: 1rem 0.25rem 0;
}
.advanced-content > .field-group,
.advanced-content > .row { flex: 1 1 240px; max-width: 340px; }

.corner-toggle {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
}
.corner-tab {
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-ui) var(--ease-out),
              background var(--duration-ui) var(--ease-out),
              box-shadow var(--duration-ui) var(--ease-out);
}
.corner-tab:hover { color: var(--color-fg); }
.corner-tab.is-active { color: var(--color-fg); background: var(--color-bg); box-shadow: var(--elevation-flat-sm); }

.password-row { display: flex; gap: 0.5rem; }
.password-row input { flex: 1; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500 !important;
  color: var(--color-muted);
}
.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin: 0;
  border-radius: 6px;
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 65%;
  transition: background-color var(--duration-ui) var(--ease-out),
              box-shadow var(--duration-ui) var(--ease-out);
}
.checkbox-row input[type="checkbox"]:hover { box-shadow: var(--elevation-inset); }
.checkbox-row input[type="checkbox"]:checked {
  background-color: var(--color-accent);
  box-shadow: var(--elevation-flat-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3 3 7-7'/%3E%3C/svg%3E");
}
.checkbox-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--color-accent-fg); outline-offset: 2px; }

.logo-input-wrap { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; max-width: 100%; }

/* Native file inputs won't shrink their internal button+label below a
   fixed minimum width, so on narrow screens stack instead of squeezing. */
@media (max-width: 480px) {
  .logo-input-wrap { flex-direction: column; align-items: stretch; }
  .logo-input-wrap #logoInput { width: 100%; }
}
#logoInput {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-inner);
  box-shadow: var(--elevation-inset-sm);
}
#logoInput::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: var(--elevation-flat-sm);
  cursor: pointer;
  transition: box-shadow var(--duration-ui) var(--ease-out), transform var(--duration-ui) var(--ease-out);
}
#logoInput::file-selector-button:hover { box-shadow: var(--elevation-flat-hover); transform: translateY(-1px); }
#logoInput::file-selector-button:active { box-shadow: var(--elevation-inset-sm); transform: translateY(0.5px); }
#logoPreview {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-inner);
  object-fit: cover;
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  flex-shrink: 0;
}

.error-msg { margin: 0; color: var(--color-danger); font-size: 0.85rem; font-weight: 600; }
.scan-warning { margin: 0; color: var(--color-fg); font-size: 0.8rem; font-weight: 600; }

.payment-fields { display: flex; flex-direction: column; gap: 0.5rem; }
.payment-fields[hidden] { display: none; }

.generate-btn { width: 100%; margin-top: 0.4rem; }

/* Bulk generation */
.bulk-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 32rem;
  margin-inline: auto;
}
/* Nested inside the generator form (the dedicated bulk page), it should
   match the full width of the style controls above it, not center — and
   sit clearly apart as its own "upload & generate" step, after styling. */
.generator-form .bulk-panel {
  max-width: none;
  margin-inline: 0;
  margin-top: 0.5rem;
  padding-top: 1.75rem;
  box-shadow: inset 0 1px 0 var(--shadow-light), inset 0 2px 0 var(--shadow-dark);
}
/* The CSV picker itself stays field-width, like Size/Color/Logo above —
   only the hint text, status, and Generate button run full width. */
.bulk-panel .field-group { max-width: 340px; }
.bulk-panel .btn-primary { max-width: 340px; }
#bulkCsvInput {
  border-radius: var(--radius-inner);
  box-shadow: var(--elevation-inset-sm);
  font-size: 0.85rem;
  padding: 0.6rem 0.7rem;
}
#bulkCsvInput::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.5rem 0.9rem;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: var(--elevation-flat-sm);
  cursor: pointer;
  transition: box-shadow var(--duration-ui) var(--ease-out), transform var(--duration-ui) var(--ease-out);
}
#bulkCsvInput::file-selector-button:hover { box-shadow: var(--elevation-flat-hover); transform: translateY(-1px); }
#bulkCsvInput::file-selector-button:active { box-shadow: var(--elevation-inset-sm); transform: translateY(0.5px); }
.bulk-status { margin: 0; color: var(--color-muted); font-size: 0.85rem; font-weight: 600; }

/* Preview */
.generator-preview { display: flex; flex-direction: column; gap: 1.25rem; }
.preview-card {
  border-radius: var(--radius-base);
  padding: 1.25rem;
}
.preview-box {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: var(--radius-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}
.preview-box .placeholder { color: var(--color-muted); font-size: 0.9rem; text-align: center; margin: 0; }
.preview-box canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
}

.download-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.4rem; }
.download-row .btn { flex: 1; min-width: 8rem; }
.copy-status { margin: 0.6rem 0 0; color: var(--color-muted); font-size: 0.8rem; font-weight: 600; text-align: center; }

/* ============================================================
   Footer
   ============================================================ */
/* Always-dark band, independent of the page's own light/dark theme —
   same "ink" used by the logo/favicon assets, not the softer dark-mode
   surface color. Overriding the tokens here (rather than hardcoding
   colors on each rule below) means every existing var(--color-fg) /
   var(--color-muted) / var(--color-bg) / shadow reference in this section
   picks up dark-appropriate values automatically. */
.site-footer {
  --color-bg: #101214;
  --color-bg-rgb: 16, 18, 20;
  --color-fg: #F4F5F3;
  --color-muted: #9AA5B4;
  --color-accent-fg: #3CB371;
  --shadow-light: rgba(58, 72, 92, 0.35);
  --shadow-dark: rgba(0, 0, 0, 0.55);
  background: var(--color-bg);
  color: var(--color-fg);
  padding-block: 3.5rem 2.5rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1.4fr 0.8fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-top { grid-template-columns: 1fr; gap: 2rem; }
}

.footer-brand .brand { margin-bottom: 0.9rem; }
.footer-tagline {
  font-size: 0.875rem;
  color: var(--color-muted);
  max-width: 30ch;
  line-height: 1.55;
  margin: 0;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-fg);
  margin: 0 0 1rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col li:last-child { margin-bottom: 0; }
.footer-col a {
  font-size: 0.875rem;
  color: var(--color-muted);
  transition: color var(--duration-ui) var(--ease-out);
}
.footer-col a:hover { color: var(--color-accent-fg); }

.footer-tools-list { column-count: 2; column-gap: 1.5rem; }
.footer-tools-list li { break-inside: avoid; }

.footer-bottom {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
  box-shadow: inset 0 1px 0 var(--shadow-dark), inset 0 2px 0 var(--shadow-light);
}
.footer-bottom p { font-size: 0.8125rem; color: var(--color-muted); margin: 0; }

/* ============================================================
   Reveal-on-scroll
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   Account menu + sign-in modal
   ============================================================ */
.account-menu { position: relative; }
/* Invisible bridge over the gap between the button and the dropdown —
   without it, the cursor crosses empty space on the way down, :hover
   drops, and the menu closes before it's reached. Same trick as the
   Generator submenu above. */
.account-menu.is-signed-in::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 0.6rem;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: var(--tap-min);
  padding: 0 1rem;
  border: none;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: var(--elevation-flat-sm);
  cursor: pointer;
  transition: box-shadow var(--duration-ui) var(--ease-out), transform var(--duration-ui) var(--ease-out);
  max-width: 9rem;
}
.account-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn:hover { transform: translateY(-1px); box-shadow: var(--elevation-flat-hover); }
.account-btn:active { transform: translateY(0.5px); box-shadow: var(--elevation-inset-sm); }
.account-btn.is-signed-in { color: var(--color-accent-fg); }

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 10rem;
  padding: 0.5rem;
  background: var(--color-bg);
  border-radius: var(--radius-base);
  box-shadow: var(--elevation-flat-hover);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--duration-ui) var(--ease-out),
              transform var(--duration-ui) var(--ease-out),
              visibility var(--duration-ui) var(--ease-out);
  z-index: 40;
}
/* Signed-in only — a signed-out visitor hovering "Sign in" shouldn't see
   "My codes" / "Sign out". */
.account-menu.is-signed-in:hover .account-dropdown,
.account-menu.is-signed-in:focus-within .account-dropdown,
.account-menu.is-signed-in.is-open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.account-dropdown a,
.account-dropdown button {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: none;
  background: none;
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-inner);
  cursor: pointer;
}
.account-dropdown a:hover, .account-dropdown a:focus-visible,
.account-dropdown button:hover, .account-dropdown button:focus-visible {
  background: rgba(var(--color-bg-rgb), 0.6);
  box-shadow: var(--elevation-inset-sm);
  color: var(--color-accent-fg);
}

body.no-scroll { overflow: hidden; }

.auth-modal-overlay[hidden] { display: none; }
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  overflow-y: auto;
  z-index: 100;
}
/* Centering via align-items clips the top of the modal on very short
   viewports where it doesn't fully fit — fall back to top-anchored +
   scrollable there instead of losing the close button off-screen. */
@media (max-height: 30rem) {
  .auth-modal-overlay { align-items: flex-start; }
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
  border-radius: var(--radius-container);
}
.auth-modal h2 { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 1.4rem; }
.auth-modal-sub { margin: 0 0 1.5rem; color: var(--color-muted); font-size: 0.9rem; }
.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  color: var(--color-fg);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.auth-modal-close:hover { box-shadow: var(--elevation-flat-hover); }
#authForm, #authPasswordForm { display: flex; flex-direction: column; gap: 0.5rem; }
#authForm label, #authPasswordForm label { font-size: 0.8125rem; font-weight: 700; color: var(--color-muted); }
#authForm input, #authPasswordForm input {
  height: var(--tap-min);
  padding: 0 1rem;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
#authForm input:focus-visible, #authPasswordForm input:focus-visible { outline: 2px solid var(--color-accent-fg); outline-offset: 2px; }
#authForm .btn-primary, #authPasswordForm .btn-primary { width: 100%; }

.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.auth-google-btn svg { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--shadow-dark);
}

.auth-modal-toggle { margin: 0.6rem 0 0; text-align: center; }
.auth-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--color-accent-fg);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-link-btn:hover { color: var(--color-accent-light); }

.auth-modal-status { margin: 0.9rem 0 0; font-size: 0.8125rem; font-weight: 600; color: var(--color-muted); text-align: center; }
.auth-modal-status.is-error, .save-status.is-error { color: var(--color-danger); }
.save-status { margin: 0.6rem 0 0; color: var(--color-muted); font-size: 0.8rem; font-weight: 600; text-align: center; }

/* ============================================================
   My Codes page — profile summary + a compact saved-codes list
   ============================================================ */
.my-codes-page { max-width: 46rem; }

.my-codes-empty {
  max-width: 30rem;
  margin: 0 auto;
  padding: 3rem 2rem;
  text-align: center;
  border-radius: var(--radius-container);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-deep);
}
.my-codes-empty p { color: var(--color-muted); margin-bottom: 1.25rem; }
.my-codes-empty .btn-primary { display: inline-flex; }

.my-codes-note {
  max-width: 40rem;
  margin: 0 auto 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-base);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  color: var(--color-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* ---- Profile summary ---------------------------------------------- */

.profile-panel {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-container);
  margin-bottom: 2.5rem;
}

.profile-avatar {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: var(--elevation-flat-sm);
}

.profile-info { flex: 1; min-width: 0; }
.profile-email {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-meta { margin: 0; color: var(--color-muted); font-size: 0.8125rem; }

/* ---- Compact saved-codes list --------------------------------------- */

.my-codes-list-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.my-codes-list-head h1 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; }
.my-codes-count { color: var(--color-muted); font-size: 0.85rem; font-weight: 600; }

.my-codes-list[hidden] { display: none; }
.my-codes-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.my-code-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-base);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
}

.my-code-row-thumb {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.25rem;
  border-radius: var(--radius-inner);
  background: #fff;
  box-shadow: var(--elevation-inset-sm);
}
.my-code-row-thumb canvas { width: 100%; height: 100%; display: block; }

.my-code-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.my-code-row-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-code-row-type {
  flex-shrink: 0;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: var(--elevation-inset-sm);
  color: var(--color-accent-fg);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.my-code-row-date {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.my-code-row-actions { flex-shrink: 0; display: flex; gap: 0.4rem; }
.my-code-row-actions a,
.my-code-row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius-inner);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-sm);
  color: var(--color-muted);
  cursor: pointer;
  text-decoration: none;
}
.my-code-row-actions svg { width: 16px; height: 16px; }
.my-code-row-actions a:hover, .my-code-row-actions a:focus-visible,
.my-code-row-actions button:hover, .my-code-row-actions button:focus-visible {
  color: var(--color-accent-fg);
  box-shadow: var(--elevation-flat-hover);
}

@media (max-width: 30rem) {
  /* Avatar + email/meta share the top row (info still gets the lion's
     share of the width); the sign-out button gets forced onto its own
     full-width row via flex-basis rather than being left to shrink the
     email down to nothing. */
  .profile-panel { flex-wrap: wrap; row-gap: 1rem; }
  .profile-info { flex-basis: calc(100% - 3.5rem - 1.25rem); }
  .profile-panel .btn { flex-basis: 100%; }

  .my-code-row { flex-wrap: wrap; row-gap: 0.4rem; }
  .my-code-row-date { margin-left: 0; }
  .my-code-row-actions { margin-left: auto; }
}

/* ============================================================
   Legal / info pages (Privacy, Terms, About, Contact)
   ============================================================ */
.legal-content { max-width: 42rem; }
.legal-content .updated-note {
  margin: 0 0 2.5rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}
.legal-content h2 {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content h3 {
  margin: 1.75rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.legal-content p { margin: 0 0 1rem; color: var(--color-muted); }
.legal-content ul, .legal-content ol { margin: 0 0 1rem; padding-left: 1.4rem; color: var(--color-muted); }
.legal-content li { margin-bottom: 0.5rem; }
.legal-content a:not(.btn) { color: var(--color-accent-fg); font-weight: 600; }
.legal-content strong { color: var(--color-fg); }

.contact-card {
  padding: 2rem;
  border-radius: var(--radius-container);
  margin-top: 0.5rem;
}
.contact-card p { margin: 0 0 0.75rem; }
.contact-card .contact-email {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
}

/* ============================================================
   404 page
   ============================================================ */
.error-page {
  text-align: center;
  padding-block: var(--space-section);
}
.error-page .error-code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--color-accent-fg);
  line-height: 1;
  margin-bottom: 1rem;
}
.error-page p { color: var(--color-muted); max-width: 32rem; margin: 0 auto 2rem; }

/* ============================================================
   Cookie consent banner
   ============================================================ */
.cookie-banner[hidden] { display: none; }
.cookie-banner {
  position: fixed;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: var(--radius-base);
  background: var(--color-bg);
  box-shadow: var(--elevation-flat-hover);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cookie-banner p { margin: 0; font-size: 0.875rem; color: var(--color-muted); }
.cookie-banner a { color: var(--color-accent-fg); font-weight: 600; }
.cookie-banner-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cookie-banner-actions .btn { flex: 1; min-width: 8rem; }
