/* =========================================================
   QR Studio – qr.parthxd7.in
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #f6f7fb;
  --bg-2: #eef0f8;
  --surface: #ffffff;
  --surface-2: #f3f4fa;
  --border: #e3e6ef;
  --text: #151826;
  --text-2: #4b5168;
  --muted: #7a8099;
  --accent: #6d5dfc;
  --accent-2: #b14bf4;
  --accent-soft: rgba(109, 93, 252, .12);
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 8px 24px rgba(20, 24, 40, .06);
  --radius: 18px;
  --radius-sm: 11px;
  --checker: #e9ebf2;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f17;
    --bg-2: #131624;
    --surface: #161a28;
    --surface-2: #1d2233;
    --border: #2a3047;
    --text: #eef0f8;
    --text-2: #b7bdd3;
    --muted: #8a91ab;
    --accent: #8b7dff;
    --accent-2: #c779ff;
    --accent-soft: rgba(139, 125, 255, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --checker: #22273a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d0f17;
  --bg-2: #131624;
  --surface: #161a28;
  --surface-2: #1d2233;
  --border: #2a3047;
  --text: #eef0f8;
  --text-2: #b7bdd3;
  --muted: #8a91ab;
  --accent: #8b7dff;
  --accent-2: #c779ff;
  --accent-soft: rgba(139, 125, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --checker: #22273a;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 10% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(177, 75, 244, .08), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 28px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.brand-mark svg { width: 22px; height: 22px; fill: #fff; stroke: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--text-2); font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; font-size: 18px;
}
.icon-btn:hover { border-color: var(--accent); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Hero ---------- */
.hero { padding: 48px 0 28px; text-align: center; }
.pill {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 16px;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; letter-spacing: -.035em; max-width: 820px; margin: 0 auto; }
.grad-text { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--text-2); font-size: clamp(15px, 2vw, 18px); max-width: 680px; margin: 16px auto 0; }

/* ---------- Generator layout ---------- */
.generator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas:
    "banner  banner"
    "content preview"
    "design  preview"
    "history history";
  gap: 20px;
  align-items: start;
  padding-bottom: 40px;
}
.area-content { grid-area: content; }
.area-design { grid-area: design; }
.area-preview { grid-area: preview; position: sticky; top: 84px; }
.area-history { grid-area: history; }

@media (max-width: 960px) {
  .generator {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "banner" "content" "preview" "design" "history";
  }
  .area-preview { position: static; }
  .nav > a:not(.btn) { display: none; }
}
.area-banner { grid-area: banner; }
.generator:has(.area-banner[hidden]) { grid-template-areas: "content preview" "design preview" "history history"; }
@media (max-width: 960px) {
  .generator:has(.area-banner[hidden]) { grid-template-areas: "content" "preview" "design" "history"; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.step {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Type grid ---------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.type-btn svg { font-size: 22px; }
.type-btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.type-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form > * { grid-column: span 2; }
.form > .half { grid-column: span 1; }
@media (max-width: 560px) { .form > .half { grid-column: span 2; } }

.field, .range-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .opt { font-weight: 500; color: var(--muted); }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 14.5px; font-weight: 500; color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8099' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.field-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.self-center { align-self: center; }
.tab-panel > .check { margin-bottom: 12px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 480px) { .row-2 { grid-template-columns: 1fr; } }

.color-field { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; gap: 6px 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.color-field > span { grid-column: span 2; }
.color-field input[type="color"] { width: 44px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; background: var(--surface-2); cursor: pointer; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-field input[type="color"]::-moz-color-swatch { border: 0; border-radius: 8px; }
.hex { font-family: ui-monospace, "SF Mono", Consolas, monospace; text-transform: uppercase; }

.range-field { margin: 14px 0; }
.range-field span { display: flex; justify-content: space-between; }
.range-field output { color: var(--accent); font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.btn-inline { justify-self: start; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px -6px var(--accent); }
.btn-primary:hover { box-shadow: 0 8px 22px -6px var(--accent); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { border-color: var(--accent); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 7px 11px; font-size: 13px; }

/* ---------- Uploader ---------- */
.dropzone {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 22px; border-radius: var(--radius); cursor: pointer;
  border: 2px dashed var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 14px; transition: border-color .15s, background .15s;
}
.dropzone svg { font-size: 30px; color: var(--accent); }
.dropzone small { color: var(--muted); font-size: 12.5px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.small { padding: 16px; }

.upload-progress { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.progress-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }

.upload-done {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  font-size: 13.5px; font-weight: 600;
}
.upload-done .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-done svg { color: var(--ok); font-size: 18px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.notice { font-size: 12.5px; color: var(--muted); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.notice.err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad) 7%, transparent); }

/* ---------- Preview ---------- */
.preview-card { padding: 20px; }
.preview-stage {
  position: relative; border-radius: 14px; padding: 18px;
  display: grid; place-items: center; min-height: 300px;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.preview-stage img { width: 100%; max-width: 300px; height: auto; transition: opacity .2s; }
.preview-stage.empty img { opacity: .12; filter: grayscale(1); }
.preview-empty { position: absolute; inset: 0; display: none; place-items: center; text-align: center; font-weight: 700; color: var(--text-2); font-size: 14px; }
.preview-stage.empty .preview-empty { display: grid; }
.preview-empty span { background: var(--surface); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border); }

.scan-status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 14px 0 6px; min-height: 20px; }
.scan-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.scan-status.warn { color: var(--warn); }
.scan-status.warn .dot { background: var(--warn); }
.scan-status.bad { color: var(--bad); }
.scan-status.bad .dot { background: var(--bad); }
.data-peek {
  font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 14px;
}
.data-peek:empty { display: none; }
.dl-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; }
.dl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 10px; }
@media (max-width: 400px) { .dl-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1; padding: 9px 12px; border: 0; border-radius: 10px; background: none; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.label { font-size: 13px; font-weight: 700; color: var(--text); margin: 18px 0 10px; }
.tab-panel > .label:first-child, .tab-panel > .hint:first-child { margin-top: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-2);
}
.choice svg { width: 40px; height: 40px; stroke: none; fill: var(--text); }
.choice:hover { border-color: var(--accent); }
.choice.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice.active svg { fill: var(--accent); }

.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.segmented button { flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: none; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.segmented button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.preset { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.preset:hover { border-color: var(--accent); transform: translateY(-1px); }
.preset img { width: 76px; height: 76px; border-radius: 8px; }

.logo-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-quick button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; padding: 6px; }
.logo-quick button:hover { border-color: var(--accent); }
.logo-quick button img { width: 100%; height: 100%; }
.logo-quick .none { font-size: 11px; font-weight: 700; color: var(--muted); }
.logo-current { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 13.5px; }
.logo-current img { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; background: #fff; }
.logo-current span { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.chip { padding: 6px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- History ---------- */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.history-item { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.history-item:hover { border-color: var(--accent); }
.history-item img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #fff; }
.history-item b { font-size: 12px; }
.history-item span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.03em; text-align: center; margin-bottom: 30px; }
.feature-grid { 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: 22px; }
.feature h3 { font-size: 16px; margin: 12px 0 6px; }
.feature p { margin: 0; color: var(--text-2); font-size: 14px; }
.f-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); }

.faq { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; }
.faq[open] summary::after { content: "–"; }
.faq p { margin: 0 0 16px; color: var(--text-2); }

.site-footer { border-top: 1px solid var(--border); padding: 26px 0; font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   Accounts & dynamic QR
   ========================================================= */
.nav-login { font-weight: 700 !important; }
.btn-block { width: 100%; }
.nav .btn-sm { padding: 8px 13px; }
@media (max-width: 520px) { .nav { gap: 8px; } .nav .btn-sm { padding: 7px 10px; font-size: 12.5px; } }

.how-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.how-strip span { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); line-height: 1.4; }
.how-strip b { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
@media (max-width: 640px) { .how-strip { grid-template-columns: 1fr; } }
.footer-note { padding-bottom: 20px; margin: -8px auto 0; }
.site-footer a { font-weight: 600; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 5px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 22px; }
.mode-switch button { border: 0; background: none; border-radius: 11px; padding: 11px 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; color: var(--text-2); }
.mode-switch b { font-size: 14.5px; }
.mode-switch small { font-size: 12px; color: var(--muted); }
.mode-switch button.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.mode-switch button.active small { color: var(--text-2); }

.edit-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 14px; color: var(--text); }
.edit-actions { display: flex; gap: 8px; }

.preview-ribbon { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 99px; white-space: nowrap; box-shadow: var(--shadow); }

.dyn-panel { display: grid; gap: 10px; margin-top: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
#dynControls { display: grid; gap: 10px; }
.dyn-panel .tiny { margin: 0; }
.dyn-live { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--ok) 9%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); font-size: 13.5px; font-weight: 700; min-width: 0; }
.dyn-live a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); flex-shrink: 0; }
.btn.is-locked { opacity: .55; }
.btn.pulse { animation: pulse 1.2s ease; }
@keyframes pulse { 0%, 100% { box-shadow: 0 6px 18px -6px var(--accent); } 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 32px 16px 56px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .lead-sm { color: var(--text-2); margin: 0 0 20px; font-size: 14.5px; }
.auth-form { display: grid; gap: 14px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-2); margin: 18px 0 0; }
.auth-switch button { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; font-size: inherit; }
.form-msg { font-size: 13.5px; padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; }
.form-msg.err { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.form-msg.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.perks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.perks li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }

/* ---------- Dashboard ---------- */
.dash { padding: 28px 16px 60px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.dash-head p { margin: 4px 0 0; color: var(--text-2); }
.dash-tabs { margin-bottom: 20px; max-width: 520px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 200px; }
.qr-list { display: grid; gap: 12px; }
.qr-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.qr-thumb { width: 92px; height: 92px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); }
.qr-thumb img { width: 100%; height: 100%; object-fit: contain; }
.qr-info { min-width: 0; display: grid; gap: 3px; }
.qr-info h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qr-info .meta { font-size: 12.5px; color: var(--muted); }
.qr-info .dest, .qr-info .short { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-info .dest { color: var(--text-2); }
.qr-info .short { font-weight: 700; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.qr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.scan-count { text-align: right; }
.scan-count b { font-size: 24px; font-weight: 800; display: block; line-height: 1; font-variant-numeric: tabular-nums; }
.scan-count span { font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
  .qr-row { grid-template-columns: 72px minmax(0, 1fr); }
  .qr-thumb { width: 72px; height: 72px; }
  .qr-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .scan-count { text-align: left; }
}
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--text-2); margin: 0 0 18px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(8, 10, 18, .55); backdrop-filter: blur(3px); }
.modal-card { width: 100%; max-width: 880px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); padding: 22px; }
.modal-card.sm { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.chart-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; background: var(--surface); }
.chart-card h3 { font-size: 14px; margin-bottom: 12px; }
.chart { width: 100%; height: 190px; display: block; stroke: none; fill: none; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: var(--accent-2); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.break-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
.break-list { display: grid; gap: 9px; }
.break-item { display: grid; gap: 4px; font-size: 13px; }
.break-item .top { display: flex; justify-content: space-between; gap: 8px; }
.break-item .top b { font-variant-numeric: tabular-nums; }
.break-track { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.break-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.table-wrap { overflow-x: auto; }
table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple th, table.simple td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.simple th { font-size: 12px; color: var(--muted); font-weight: 700; }
table.simple td.wrap { white-space: normal; word-break: break-all; min-width: 180px; }
.muted-box { color: var(--muted); text-align: center; padding: 24px; font-size: 14px; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .card h2 { font-size: 17px; margin-bottom: 14px; }
.settings-grid .card form { display: grid; gap: 12px; }
.danger { color: var(--bad) !important; }
.btn-danger { background: var(--bad); color: #fff; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.dl-menu { position: relative; }
.dl-menu summary { list-style: none; }
.dl-menu summary::-webkit-details-marker { display: none; }
.dl-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 110px; padding: 6px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dl-pop button { background: none; border: 0; text-align: left; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--text); }
.dl-pop button:hover { background: var(--surface-2); color: var(--accent); }
.chart-tip { position: absolute; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; pointer-events: none; white-space: nowrap; }
details > summary.link-btn { display: inline-block; list-style: none; margin-top: 6px; }
details > summary.link-btn::-webkit-details-marker { display: none; }
