:root {
  --bg: #070b18;
  --panel: rgba(15, 23, 42, .74);
  --panel-strong: rgba(15, 23, 42, .95);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, .22);
  --blue: #2563eb;
  --blue-rgb: 37, 99, 235;
  --sky: #38bdf8;
  --sky-rgb: 56, 189, 248;
  --violet: #7c3aed;
  --violet-rgb: 124, 58, 237;
  --green: #22c55e;
  --red: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, .86);
  --panel-strong: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, .14);
  --shadow: 0 24px 70px rgba(var(--blue-rgb), .12);
}

* { box-sizing: border-box; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html { scroll-behavior: smooth; }
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(var(--sky-rgb), .18), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(var(--violet-rgb), .2), transparent 30rem),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header, .footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header { min-height: 82px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--sky), var(--violet));
  box-shadow: 0 12px 38px rgba(var(--blue-rgb), .32);
}
.nav, .footer-links, .hero-actions, .card-actions, .public-actions, .admin-actions, .export-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nav a { color: var(--muted); font-weight: 600; }

.btn, .icon-btn, .link-btn, .segmented button, .tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
}
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), var(--sky));
  color: #fff;
  box-shadow: 0 14px 34px rgba(var(--blue-rgb), .28);
}
.btn-ghost:hover, .icon-btn:hover { border-color: rgba(var(--sky-rgb), .5); }
.btn.is-loading,
button.is-loading {
  pointer-events: none;
  opacity: .76;
  position: relative;
}
.btn.is-loading::before,
button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: ffSpin .72s linear infinite;
}
@keyframes ffSpin { to { transform: rotate(360deg); } }
.icon-btn { width: 44px; padding: 0; border-radius: 50%; }
.full { width: 100%; }
.link-btn { min-height: auto; padding: 0; border: 0; background: transparent; color: var(--sky); }
.link-btn.danger { color: var(--red); }

.hero {
  width: min(1160px, calc(100% - 32px));
  min-height: calc(100vh - 128px);
  max-height: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr);
  gap: 34px;
  align-items: center;
  padding: 38px 0 76px;
}
.hero.compact { min-height: 520px; grid-template-columns: 1fr; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--sky);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(42px, 7vw, 82px); line-height: .94; letter-spacing: 0; margin-bottom: 22px; max-width: 830px; }
h2 { font-size: clamp(26px, 4vw, 44px); line-height: 1.04; margin-bottom: 14px; }
h3 { font-size: 20px; margin-bottom: 8px; }
.hero-text { color: var(--muted); font-size: 19px; line-height: 1.65; max-width: 640px; }
.google-one-note {
  max-width: 620px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--sky-rgb), .28);
  border-radius: 14px;
  color: var(--text);
  background: rgba(var(--blue-rgb), .12);
  line-height: 1.5;
}

.hero-visual, .panel, .price-card, .signature-card, .kpi, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-visual { padding: 18px; }
.mail-window { min-height: 360px; border-radius: 16px; background: var(--panel-strong); border: 1px solid var(--line); padding: 18px; }
.mail-dots { display: flex; gap: 7px; margin-bottom: 70px; }
.mail-dots span { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.signature-glow { padding: 22px; border-left: 4px solid var(--sky); background: linear-gradient(135deg, rgba(var(--blue-rgb), .2), rgba(var(--violet-rgb), .13)); border-radius: 14px; }
.signature-glow strong, .signature-glow span, .signature-glow small { display: block; margin-bottom: 8px; }
.visual-line { width: 80%; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--blue), var(--sky), transparent); }

.benefits, .quick-grid, .pricing-band, .kpi-grid, .signature-grid {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 80px;
  display: grid;
  gap: 16px;
}
.benefits { grid-template-columns: repeat(4, 1fr); }
.benefits article {
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}
.benefits strong, .benefits span { display: block; }
.benefits span, .price-card p, .signature-card p, .kpi small, .auth-card p, .faq p { color: var(--muted); line-height: 1.55; }

.builder-section, .showcase, .faq, .seo-page, .help-hero, .help-grid, .help-strip { width: min(1160px, calc(100% - 32px)); margin: 0 auto 84px; }
.section-head { margin-bottom: 24px; }
.section-head.inline { display: flex; align-items: end; justify-content: space-between; gap: 18px; width: min(1160px, calc(100% - 32px)); margin: 0 auto 20px; }
.quick-grid { grid-template-columns: .9fr 1.1fr; width: 100%; margin-bottom: 0; }
.panel { padding: 22px; }
.panel.narrow { max-width: 760px; margin: 0 auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  padding: 10px 12px;
}
input[type="color"] { padding: 4px; }
textarea { min-height: 140px; resize: vertical; }
.password-field {
  position: relative;
  display: block;
}
.password-field input { padding-right: 54px; }
.password-field button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.password-field button:hover,
.password-field button[aria-pressed="true"] {
  color: var(--text);
  background: rgba(var(--sky-rgb), .12);
}
.span-2 { grid-column: span 2; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.check input { width: 18px; min-height: 18px; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.upload-card {
  min-height: 180px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  display: grid;
  gap: 10px;
  cursor: pointer;
}
.upload-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-action {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(var(--sky-rgb), .36);
  color: var(--text);
  background: rgba(var(--blue-rgb), .16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.upload-card:hover .upload-action { border-color: rgba(var(--sky-rgb), .7); background: rgba(var(--blue-rgb), .24); }
.upload-card img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(7, 11, 24, .48);
  border: 1px solid var(--line);
}
.upload-card small { color: var(--muted); overflow-wrap: anywhere; }
.banner-card { grid-column: span 2; }
.banner-card img { aspect-ratio: 4 / 1; height: auto; object-fit: cover; }

.preview-panel { min-width: 0; }
.preview-toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.client-frame {
  overflow: auto;
  min-height: 260px;
  padding: 24px;
  background: #fff;
  color: #0f172a;
  border-radius: 14px;
  border: 1px solid var(--line);
  transform-origin: top left;
}
.client-frame.outlook { padding: 36px 28px; font-family: Arial, sans-serif; }
.client-frame.apple { padding: 28px; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
.client-frame.guides * { outline: 1px dashed rgba(var(--blue-rgb), .35); }
.code-box { margin-top: 12px; min-height: 160px; font-family: "JetBrains Mono", monospace; font-size: 12px; }

.template-strip { display: flex; gap: 10px; overflow: auto; padding-bottom: 8px; }
.template-strip span { flex: 0 0 auto; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); color: var(--muted); }
.template-plan-note {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(var(--sky-rgb), .08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.pricing-band { grid-template-columns: repeat(3, 1fr); }
.pricing-band.expanded { margin-top: 20px; }
.app-main .help-strip,
.app-main .help-hero,
.app-main .help-grid {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.price-card { padding: 24px; display: grid; gap: 12px; align-content: start; }
.price-card strong { font-size: 34px; }
.price-card ul { padding-left: 20px; color: var(--muted); line-height: 1.9; }
.mini-form { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; background: rgba(255, 255, 255, .04); }
.faq summary { cursor: pointer; font-weight: 800; }

.footer { padding: 36px 0 54px; border-top: 1px solid var(--line); color: var(--muted); }
.footer a, .app-footer a, .public-footer a { color: var(--sky); font-weight: 800; }
.copyright { margin: 8px 0 0; font-size: 13px; }
.qr-band {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto 84px;
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--blue-rgb), .16), rgba(var(--sky-rgb), .08), rgba(var(--violet-rgb), .12));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow);
}
.qr-band p:not(.eyebrow) { color: var(--muted); max-width: 680px; line-height: 1.6; margin-bottom: 0; }
.help-hero,
.help-strip {
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.help-hero h1 { font-size: clamp(34px, 5vw, 58px); }
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.help-grid article {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
}
.help-grid p,
.help-strip p { color: var(--muted); line-height: 1.6; }
.help-grid ul { color: var(--muted); line-height: 1.8; padding-left: 20px; }
.help-grid a { color: var(--sky); font-weight: 800; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; width: 100%; max-width: 100%; overflow-x: hidden; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px; border-right: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); display: flex; flex-direction: column; gap: 22px; }
.sidebar-user {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.sidebar-user:hover { border-color: rgba(var(--sky-rgb), .42); }
.sidebar-user img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(var(--sky-rgb), .52);
  background: #0f172a;
}
.sidebar-user span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.sidebar-user strong,
.sidebar-user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user strong { color: var(--text); font-size: 14px; }
.sidebar-user small { color: var(--muted); font-size: 12px; }
.sidebar-user em {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--sky));
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}
.side-nav { display: grid; gap: 8px; }
.side-nav a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px; color: var(--muted); font-weight: 700; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
[data-theme="light"] .side-nav a:hover { background: rgba(var(--blue-rgb), .08); }
.app-main { min-width: 0; width: 100%; max-width: 100%; min-height: 100vh; padding: 24px; overflow-x: hidden; display: flex; flex-direction: column; }
.app-main .kpi-grid,
.app-main .signature-grid,
.app-main .pricing-band,
.app-main .section-head.inline {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.app-main .panel {
  max-width: 100%;
  overflow-x: hidden;
}
.topbar { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 24px; }
.topbar h1 { font-size: clamp(30px, 4vw, 48px); margin: 0; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 20px; }
.kpi, .signature-card { min-width: 0; }
.kpi span { color: var(--muted); font-weight: 800; }
.kpi strong { display: block; font-size: 34px; margin: 8px 0; }
.signature-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.signature-card { padding: 16px; overflow: hidden; }
.signature-card > h3,
.signature-card > p { overflow-wrap: anywhere; }
.signature-card .card-actions { max-width: 100%; min-width: 0; }
.signature-card .btn { max-width: 100%; min-width: 0; white-space: normal; }
.signature-preview { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 12px; border-radius: 12px; background: #fff; margin-bottom: 14px; }
.signature-preview.large { margin: 0 auto 22px; }
.signature-preview table { min-width: 600px; width: 600px; transform: scale(.72); transform-origin: top left; }
.empty-state { grid-column: 1 / -1; padding: 28px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; }
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid var(--line); }
.alert.success { background: rgba(34, 197, 94, .12); color: #86efac; }
.alert.danger { background: rgba(239, 68, 68, .12); color: #fca5a5; }
.app-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

.editor { display: grid; grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); gap: 18px; align-items: start; }
.editor-panel, .preview-workbench { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.preview-workbench {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tabs, .segmented { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button, .segmented button { flex: 1; padding: 0 10px; color: var(--muted); }
.tabs button.active, .segmented button.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.tab-pane { display: none; }
.tab-pane.active { display: grid; }
.preview-workbench .preview-toolbar { flex: 0 0 auto; }
.preview-workbench .client-frame {
  flex: 1 1 auto;
  min-height: 360px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  overscroll-behavior: contain;
}

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(440px, 100%); padding: 26px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 42px; margin-bottom: 0; }
.auth-actions { display: grid; gap: 10px; }
.auth-card small a { color: var(--sky); font-weight: 800; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.public-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.public-footer { position: fixed; left: 20px; right: 20px; bottom: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.public-signature { width: min(820px, 100%); }
.digital-card { width: min(520px, 100%); }
.card-hero { text-align: center; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.avatar-xl { width: 120px; height: 120px; border-radius: 30px; object-fit: cover; border: 2px solid var(--sky); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 50; }
.toast { padding: 12px 14px; border-radius: 14px; background: var(--panel-strong); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 320px; }

@media (max-width: 900px) {
  .hero, .quick-grid, .editor, .app-shell { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-bottom: 48px; }
  .benefits, .pricing-band, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-band { align-items: flex-start; flex-direction: column; }
  .help-hero, .help-strip { align-items: flex-start; flex-direction: column; }
  .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .app-main { padding: 18px; }
  .preview-workbench { position: static; max-height: none; }
  .preview-workbench .client-frame { max-height: 70vh; }
}

@media (max-width: 560px) {
  .site-header, .footer, .section-head.inline { align-items: flex-start; flex-direction: column; }
  .nav { width: 100%; }
  .hero, .benefits, .builder-section, .showcase, .faq, .pricing-band, .kpi-grid, .signature-grid, .qr-band, .help-hero, .help-grid, .help-strip { width: min(100% - 24px, 1160px); }
  h1 { font-size: 42px; }
  .benefits, .pricing-band, .kpi-grid, .form-grid, .help-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .media-grid { grid-template-columns: 1fr; }
  .banner-card { grid-column: auto; }
  .client-frame { padding: 14px; }
  .editor-panel, .preview-workbench, .panel, .price-card { border-radius: 16px; }
  .tabs { overflow-x: auto; }
  .signature-preview table { transform: scale(.58); }
}
