:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --primary: #111827;
  --primary-soft: #e5e7eb;
  --good: #166534;
  --bad: #991b1b;
  --warn: #92400e;
  --shadow: 0 20px 55px rgba(15, 23, 42, .08);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(17, 24, 39, .10), transparent 34rem), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: inherit; }
.app-root { min-height: 100vh; }
.shell { max-width: 1180px; margin: 0 auto; padding: 28px 18px 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 950; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.nav-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; }
.user-chip { border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 999px; padding: 9px 12px; font-size: 13px; color: var(--muted); font-weight: 800; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 24px; align-items: start; }
.hero-copy { padding: 34px 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-weight: 850; font-size: 13px; margin-bottom: 16px; }
h1 { margin: 0; font-size: clamp(42px, 7vw, 76px); line-height: .92; letter-spacing: -.07em; }
.lead { max-width: 650px; color: var(--muted); font-size: 18px; line-height: 1.65; margin: 22px 0 0; }
.hero-list { display: grid; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; color: #334155; font-weight: 750; }
.hero-list li { display: flex; gap: 10px; align-items: start; }
.hero-list li::before { content: ""; width: 8px; height: 8px; margin-top: 9px; border-radius: 99px; background: var(--primary); flex: 0 0 auto; }
.card { background: rgba(255,255,255,.88); border: 1px solid rgba(226,232,240,.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.auth-card { position: sticky; top: 20px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: #f1f5f9; border-radius: 18px; margin-bottom: 18px; }
.auth-tab { border: 0; border-radius: 14px; padding: 12px 14px; font-weight: 900; background: transparent; color: var(--muted); }
.auth-tab.active { background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 8px; }
.form-row label, .field-label { font-size: 13px; color: #334155; font-weight: 900; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 16px; padding: 13px 14px; color: var(--ink); outline: none; min-height: 48px;
}
.textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(17,24,39,.10); }
.help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.btn { border: 0; border-radius: 16px; padding: 13px 16px; min-height: 46px; font-weight: 950; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .12s ease, opacity .12s ease; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
.btn.danger { background: #fee2e2; color: var(--bad); }
.btn.good { background: #dcfce7; color: var(--good); }
.btn.small { min-height: 38px; border-radius: 13px; padding: 9px 12px; font-size: 13px; }
.note { padding: 12px 14px; border-radius: 16px; background: #f1f5f9; color: #475569; font-weight: 750; line-height: 1.5; font-size: 14px; }
.note.error { background: #fef2f2; color: var(--bad); }
.note.good { background: #f0fdf4; color: var(--good); }
.note.compact { min-height: 48px; display: flex; align-items: center; font-size: 13px; padding: 10px 12px; }
.dashboard-section { margin-top: 22px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dashboard-main, .dashboard-aside { display: grid; gap: 14px; min-width: 0; }
.dashboard-aside { position: sticky; top: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.stat strong { display: block; font-size: 24px; line-height: 1; letter-spacing: -.05em; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-weight: 800; font-size: 12px; }
.qr-list { display: grid; gap: 10px; max-height: 520px; overflow: auto; padding-right: 3px; }
.qr-item { text-align: left; display: grid; gap: 8px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.qr-item.active { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(17,24,39,.08); }
.qr-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.qr-name { font-weight: 950; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 950; background: #f1f5f9; color: #334155; white-space: nowrap; }
.badge.off { background: #fee2e2; color: var(--bad); }
.badge.on { background: #dcfce7; color: var(--good); }
.qr-url { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; line-height: 1.4; }
.workspace { display: grid; gap: 18px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.preview-card { display: grid; gap: 14px; }
.canvas-wrap { min-height: 340px; display: grid; place-items: center; background: #f8fafc; border: 1px dashed var(--line-strong); border-radius: 22px; padding: 18px; }
canvas { max-width: 100%; height: auto; background: #fff; border-radius: 14px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.compact-heading { margin: 0 0 14px; text-align: left; }
.compact-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 44px); line-height: 1; letter-spacing: -.055em; }
.compact-heading p { max-width: 720px; margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.scan-table { width: 100%; border-collapse: collapse; }
.scan-table th, .scan-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 8px; font-size: 13px; vertical-align: top; }
.scan-table th { color: var(--muted); font-weight: 950; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 20px; background: #fff; }
.toast-root { position: fixed; z-index: 50; right: 16px; bottom: 16px; display: grid; gap: 10px; max-width: min(390px, calc(100vw - 32px)); }
.toast { background: var(--primary); color: #fff; border-radius: 16px; padding: 13px 15px; box-shadow: var(--shadow); font-weight: 850; line-height: 1.35; }
.toast.error { background: var(--bad); }
.toast.good { background: var(--good); }
.static-page { background: var(--bg); }
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 48px 18px; line-height: 1.7; }
.legal-wrap h1 { font-size: 48px; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--muted); font-weight: 900; text-decoration: none; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
@media (max-width: 940px) {
  .hero, .dashboard-grid, .editor-grid { grid-template-columns: 1fr; }
  .auth-card, .dashboard-aside { position: static; }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { padding: 18px 12px 38px; }
  .topbar { align-items: flex-start; }
  h1 { font-size: 42px; }
  .two-cols, .three-cols { grid-template-columns: 1fr; }
  .card-pad { padding: 16px; }
  .nav-actions { width: 100%; justify-content: flex-start; }
}
.compact-hero { margin-bottom: 18px; align-items: stretch; }
.compact-hero .hero-copy { padding: 10px 0 18px; }
.compact-hero h1 { font-size: clamp(34px, 5vw, 58px); }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; font-weight: 900; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(8px);
}
.modal-card {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}
.backup-preview {
  width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line-strong);
  background: #f8fafc;
  border-radius: 18px;
  padding: 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .08em;
  text-align: center;
}
.confirm-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #334155;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}
.confirm-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: 0 0 auto;
}

/* Pricing and plan usage */
.pricing-section { margin: 8px 0 24px; display: grid; gap: 18px; }
.section-heading { max-width: 720px; }
.section-heading h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1; letter-spacing: -.055em; }
.section-heading p { margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pricing-card { position: relative; display: grid; align-content: start; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.pricing-card-featured { border-color: var(--primary); box-shadow: 0 24px 70px rgba(15, 23, 42, .13); }
.pricing-icon { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: #f1f5f9; color: var(--primary); }
.pricing-card h3 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.pricing-price { margin: 0; font-size: 42px; font-weight: 950; letter-spacing: -.06em; }
.pricing-price span { font-size: 15px; color: var(--muted); letter-spacing: 0; font-weight: 850; }
.pricing-description { margin: 0; color: var(--muted); line-height: 1.55; }
.pricing-features { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: #334155; font-weight: 800; }
.pricing-features li { display: flex; gap: 9px; align-items: start; }
.pricing-features li::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; margin-top: 8px; border-radius: 99px; background: var(--primary); }
.pricing-badge { position: absolute; top: 16px; right: 16px; border-radius: 999px; background: var(--primary); color: #fff; padding: 6px 10px; font-size: 11px; font-weight: 950; }
.usage-card { display: grid; gap: 12px; }
.usage-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-weight: 850; }
.usage-line strong { color: var(--ink); font-size: 24px; letter-spacing: -.04em; }
.usage-bar { height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.admin-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-list { display: grid; gap: 10px; max-height: 72vh; overflow: auto; padding-right: 3px; }
.admin-item { text-align: left; display: grid; gap: 8px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.admin-item.active { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(17,24,39,.08); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 8px; font-size: 13px; vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 950; }
.admin-table td { overflow-wrap: anywhere; }
@media (max-width: 940px) {
  .pricing-grid, .admin-layout { grid-template-columns: 1fr; }
}
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.usage-bar span.w-0 { width: 0; }
.usage-bar span.w-10 { width: 10%; }
.usage-bar span.w-20 { width: 20%; }
.usage-bar span.w-30 { width: 30%; }
.usage-bar span.w-40 { width: 40%; }
.usage-bar span.w-50 { width: 50%; }
.usage-bar span.w-60 { width: 60%; }
.usage-bar span.w-70 { width: 70%; }
.usage-bar span.w-80 { width: 80%; }
.usage-bar span.w-90 { width: 90%; }
.usage-bar span.w-100 { width: 100%; }

/* Language selector and clearer access-key mode states */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.language-select { display: inline-flex; align-items: center; }
.small-select {
  width: auto;
  min-height: 38px;
  padding: 8px 32px 8px 12px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 900;
  background-color: rgba(255,255,255,.82);
}
.mode-banner {
  display: grid;
  gap: 6px;
  border-radius: 18px;
  padding: 14px;
  line-height: 1.45;
  border: 1px solid var(--line);
}
.mode-banner strong { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.mode-banner span { color: #475569; font-size: 14px; font-weight: 750; }
.mode-banner.local-mode { background: #f8fafc; }
.mode-banner.save-mode { background: #f0fdf4; border-color: #bbf7d0; }
.mode-banner.save-mode strong { color: var(--good); }
.mode-banner.local-mode strong { color: var(--primary); }

/* Refined public landing */
.landing-hero {
  position: relative;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(226, 232, 240, .82);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 12%, rgba(17, 24, 39, .10), transparent 22rem),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(248,250,252,.72));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.landing-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .055);
  pointer-events: none;
}
.landing-hero .hero-copy { padding: 24px 0 18px; position: relative; z-index: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.eyebrow.compact { margin: 0 0 10px; padding: 6px 10px; font-size: 12px; }
.hero-showcase {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: 20px;
  align-self: stretch;
  overflow: hidden;
}
.hero-showcase-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hero-showcase h2 { margin: 0; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.07em; line-height: .95; }
.hero-showcase p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.qr-demo {
  width: 126px;
  height: 126px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 14px;
  border-radius: 28px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
}
.qr-demo svg { grid-column: span 2; width: 100%; height: 100%; }
.qr-demo span { border-radius: 8px; background: rgba(255,255,255,.86); }
.qr-demo span:nth-child(3) { opacity: .5; }
.qr-demo span:nth-child(5) { grid-column: span 2; }
.showcase-steps { display: grid; gap: 10px; }
.showcase-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}
.step-icon, .benefit-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #f1f5f9;
  color: var(--primary);
}
.showcase-step strong { display: block; font-size: 14px; font-weight: 950; }
.showcase-step p { margin: 4px 0 0; font-size: 13px; }
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
.benefit-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 14px 40px rgba(15, 23, 42, .055);
}
.benefit-card h3 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.benefit-card p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
.dashboard-main .auth-card { position: static; }
@media (max-width: 940px) {
  .landing-hero { padding: 18px; }
  .benefit-grid { grid-template-columns: 1fr; }
  .hero-showcase-top { align-items: stretch; }
}
@media (max-width: 620px) {
  .landing-hero { border-radius: 26px; padding: 14px; }
  .hero-actions .btn { width: 100%; }
  .hero-showcase-top { flex-direction: column; }
  .qr-demo { width: 100%; height: auto; min-height: 118px; }
}

/* Full-screen generator workspace */
.generator-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.20), transparent 26rem),
    rgba(15, 23, 42, .66);
  backdrop-filter: blur(14px);
  padding: 14px;
}
.generator-modal-shell {
  width: min(1500px, 100%);
  height: calc(100vh - 28px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, .88);
  border-radius: 34px;
  background:
    radial-gradient(circle at 16% 0%, rgba(17,24,39,.08), transparent 26rem),
    #f8fafc;
  box-shadow: 0 32px 100px rgba(15, 23, 42, .32);
}
.generator-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
}
.generator-modal-header h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: .98;
  letter-spacing: -.06em;
}
.generator-modal-header p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.generator-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 16px;
  padding: 16px;
  overflow: auto;
}
.generator-form-pane,
.generator-preview-pane {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}
.generator-preview-pane {
  position: sticky;
  top: 0;
  align-self: start;
}
.generator-modal-body .card {
  box-shadow: 0 16px 45px rgba(15, 23, 42, .07);
}
.generator-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.92);
}
.generator-bottom-bar > span {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}
.generator-bottom-bar.local-mode > span { color: var(--primary); }
.generator-bottom-bar.save-mode > span,
.generator-bottom-bar.pro-mode > span { color: var(--good); }
.toast-root { z-index: 120; }
.modal-backdrop { z-index: 110; }
@media (max-width: 1040px) {
  .generator-modal-body { grid-template-columns: 1fr; }
  .generator-preview-pane { position: static; }
  .generator-bottom-bar { align-items: stretch; flex-direction: column; }
  .generator-bottom-bar .action-row { width: 100%; }
  .generator-bottom-bar .btn { flex: 1 1 auto; }
}
@media (max-width: 620px) {
  .generator-modal-backdrop { padding: 0; }
  .generator-modal-shell { height: 100vh; border-radius: 0; }
  .generator-modal-header { padding: 16px; align-items: stretch; flex-direction: column; }
  .generator-modal-body { padding: 12px; }
}
