:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #17202a;
  --muted: #687281;
  --line: #dde3ea;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #f59e0b;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 16px 40px rgba(23, 32, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 800; color: var(--text); font-size: 20px; }
.topbar nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar nav a { color: var(--text); font-weight: 700; font-size: 14px; }
.topbar nav a.active { color: var(--primary); }
.app-main, .public-main { width: min(1180px, calc(100% - 32px)); margin: 32px auto; }
.footer { padding: 28px; text-align: center; color: var(--muted); font-size: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn.secondary { background: #e8eef2; color: var(--text); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: var(--danger); }
.hero {
  min-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
}
.hero h1 { font-size: clamp(44px, 7vw, 86px); line-height: 1; margin: 0 0 20px; }
.hero p { font-size: 19px; color: var(--muted); max-width: 640px; }
.eyebrow { color: var(--primary) !important; text-transform: uppercase; font-size: 13px !important; font-weight: 900; letter-spacing: 0; }
.hero-actions, .download-row, .form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { display: grid; place-items: center; }
.fake-qr {
  width: min(420px, 82vw);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.fake-qr span { background: #eef2f4; border-radius: 4px; }
.fake-qr span.on { background: var(--text); }
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 12px; }
.benefits article, .panel, .auth-box, .table-wrap, .card, .supported {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.benefits article, .supported, .panel, .auth-box, .table-wrap { padding: 24px; }
.supported { margin-top: 16px; }
.type-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.type-grid span, .badge { padding: 7px 10px; border-radius: 999px; background: #edf6f5; color: var(--primary-dark); font-size: 13px; font-weight: 800; }
.auth-box { max-width: 460px; margin: 72px auto; }
.form { display: grid; gap: 16px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 7px; font-weight: 800; font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }
.qr-builder {
  display: grid;
  gap: 18px;
}
.form-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  padding: 20px;
}
.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head.compact { margin-bottom: 14px; }
.section-head h2 {
  font-size: 19px;
  margin: 0 0 3px;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.step {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
}
.form-grid,
.type-fields,
.appearance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.type-fields {
  display: none;
  padding: 16px;
  border: 1px solid #d7e5e3;
  border-radius: var(--radius);
  background: #ffffff;
}
.type-fields.active { display: grid; }
.type-section { background: #f8fbfa; }
.qr-builder input,
.qr-builder select,
.qr-builder textarea {
  border-color: #d8e0e7;
  background: #fff;
}
.qr-builder input:focus,
.qr-builder select:focus,
.qr-builder textarea:focus {
  outline: 3px solid rgba(15, 118, 110, .14);
  border-color: var(--primary);
}
.qr-builder input[type="color"] {
  padding: 6px;
  height: 44px;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0 0;
  background: linear-gradient(to top, var(--surface) 70%, rgba(255,255,255,0));
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
h1, h2 { margin-top: 0; line-height: 1.15; }
.muted { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.card { padding: 18px; }
.card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.card strong { display: block; font-size: 30px; margin-top: 8px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.filters select { max-width: 240px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.inline-form button { border: 0; background: transparent; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-weight: 700; }
.inline-action { margin: 0 0 16px; }
.empty { text-align: center; color: var(--muted); }
.flash, .notice { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.flash.error { background: #fef3f2; border-color: #fecdca; color: var(--danger); }
.notice.warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.qr-detail { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.qr-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.qr-preview img { display: block; width: 100%; height: auto; margin-bottom: 14px; }
.panel.soft { box-shadow: none; }
.danger-zone { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.resolved-content {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f3f6f7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font: 15px/1.6 Consolas, Monaco, monospace;
}

@media (max-width: 820px) {
  .topbar { padding: 14px 16px; align-items: flex-start; flex-direction: column; }
  .hero, .benefits, .cards, .qr-detail, .grid-form, .form-grid, .type-fields, .appearance-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .page-head { flex-direction: column; }
  .table-wrap { overflow-x: auto; }
  .hero { min-height: auto; padding-top: 12px; }
  .form-section { padding: 16px; }
  .sticky-actions { position: static; }
}
