/* ================= Design tokens ================= */
:root {
  --accent: #0d9488;
  --accent-soft: #e7f8f5;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1a202e;
  --muted: #67708b;
  --border: #e3e6f0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 46, 0.05), 0 8px 24px rgba(20, 24, 46, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ================= Header ================= */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand strong { color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: 20px; }
.header-nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.header-nav a:hover { color: var(--text); }

/* ================= Hero ================= */
.hero { padding: 42px 0 10px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4.2vw, 40px); margin: 0 0 10px; letter-spacing: -0.02em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 16.5px; }

/* ================= Layout ================= */
.app-layout {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 28px;
  align-items: start;
  padding-top: 30px;
  padding-bottom: 40px;
}
@media (max-width: 980px) {
  .app-layout { grid-template-columns: 1fr; }
}

/* ================= Panels ================= */
.editor, .results-col { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}
.panel-title h2 { margin: 0 0 14px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.span-2, .check.span-2 { grid-column: span 2; }
.field span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: #fbfbfe;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
input[type="color"] { padding: 3px 5px; height: 40px; cursor: pointer; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 500; align-self: end; padding-bottom: 8px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.type-fields { margin-top: 14px; }

/* ================= Segmented control ================= */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: #fbfbfe; color: var(--muted);
  transition: all .12s;
}
.seg-btn:hover { border-color: var(--accent); color: var(--accent); }
.seg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ================= Buttons ================= */
.btn {
  font: inherit; font-weight: 600; font-size: 14.5px;
  border-radius: 9px; padding: 10px 18px;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, transform .05s;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-subtle { background: #fff; color: var(--text); border-color: var(--border); }
.btn-subtle:hover:not(:disabled) { background: #f5f6fb; }
.btn-ghost-accent { background: var(--accent-soft); color: var(--accent); border: none; }
.btn-ghost-accent:hover { background: color-mix(in srgb, var(--accent) 18%, white); }
.btn-wide { width: 100%; padding: 12px; font-size: 15.5px; }

/* ================= Premium locks ================= */
.lock-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 8px; border-radius: 999px; text-transform: none;
}
.lock-inline { font-size: 12px; }

/* ================= Preview ================= */
.preview-panel { text-align: center; }
.qr-frame {
  position: relative;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: repeating-conic-gradient(#eceef4 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}
#qrCanvas { display: block; width: 300px; height: 300px; }
@media (max-width: 560px) { #qrCanvas { width: 240px; height: 240px; } }
.qr-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  color: var(--muted); font-size: 14px; padding: 24px; text-align: center;
}
.qr-meta { font-size: 12.5px; color: var(--muted); margin: 10px 0 14px; min-height: 18px; }
.dl-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: end;
  text-align: left;
}
@media (max-width: 640px) { .dl-grid { grid-template-columns: 1fr 1fr; } .dl-grid .field { grid-column: span 2; } }

/* ================= Logo row ================= */
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#logoPreview { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; border: 1px solid var(--border); background: #fff; }

/* ================= Content sections ================= */
.content-section { padding: 46px 0 30px; }
.content-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.content-section h2 { font-size: 24px; letter-spacing: -0.01em; margin: 0 0 18px; }
.content-section h2:not(:first-child) { margin-top: 36px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.content-alt .feature { background: var(--bg); }
.feature h3 { margin: 0 0 6px; font-size: 15.5px; }
.feature p { margin: 0; font-size: 14px; color: var(--muted); }

details {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 13px 16px; margin-bottom: 10px;
}
details summary { font-weight: 600; cursor: pointer; font-size: 15px; }
details p { color: var(--muted); font-size: 14px; margin: 10px 0 2px; }

/* ================= Footer ================= */
.site-footer { padding: 30px 0 40px; text-align: center; color: var(--muted); font-size: 13.5px; }
.site-footer a { color: var(--accent); }

/* ================= Ad slot ================= */
.ad-slot { min-height: 90px; }

/* ================= Premium modal ================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 18, 32, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.25);
  max-width: 440px; width: 100%; padding: 26px 28px; position: relative;
}
.modal h2 { margin: 0 0 4px; }
.modal-sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; border: none; background: none;
  font-size: 16px; cursor: pointer; color: var(--muted); width: 30px; height: 30px; border-radius: 8px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.premium-perks { margin: 0 0 16px; padding-left: 20px; font-size: 14.5px; }
.premium-perks li { margin-bottom: 7px; }
.premium-price { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.premium-price b { font-size: 26px; color: var(--text); }
.license-row { display: flex; gap: 8px; margin-top: 14px; }
.license-status { font-size: 13px; margin: 8px 0 0; min-height: 18px; }
.license-status.ok { color: #15803d; }
.license-status.err { color: #b91c1c; }

/* ================= Toast ================= */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 14px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
