html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #121c2f;
  --surface2: #1a2740;
  --input-bg: #0d1526;
  --text: #e8eef8;
  --muted: #94a3b8;
  --lead: #b6c2d6;
  --accent: #22d3ee;
  --accent2: #38bdf8;
  --trust: #34d399;
  --danger: #fb7185;
  --ad-panel: #eef2f7;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

input[type='checkbox'] {
  accent-color: var(--trust);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(34, 211, 238, 0.15), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(56, 189, 248, 0.12), transparent), var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent2);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 8px;
  z-index: 100;
}

:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(120px, calc(env(safe-area-inset-bottom) + 96px))
    max(16px, env(safe-area-inset-left));
}

.wrap-tool {
  max-width: 1200px;
}

.page-landing .content-guide {
  display: none;
}

.single-column {
  display: block;
}

.card-main {
  padding: clamp(18px, 4vw, 24px);
}

.page-title {
  font-size: clamp(1.5rem, 5vw + 0.5rem, 2rem);
  line-height: 1.2;
  margin: 0 0 8px;
}

.lead {
  margin: 0 0 18px;
  color: var(--lead);
  font-size: 0.95rem;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.tool-shell {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 1100px) {
  .tool-shell {
    grid-template-columns: 160px minmax(0, 560px) 160px;
    justify-content: center;
  }

  .card-main {
    grid-column: 2;
  }

  .ad-rail-left {
    grid-column: 1;
    position: sticky;
    top: 16px;
  }

  .ad-rail-right {
    grid-column: 3;
    position: sticky;
    top: 16px;
  }
}

@media (max-width: 1099px) {
  .ad-rail-left,
  .ad-rail-right {
    display: none;
  }
}

.ad-rail,
.ad-well {
  background: var(--ad-panel);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  color: #334155;
}

.ad-well-footer {
  margin-top: 20px;
}

.ad-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.ad-rail ins,
.ad-well ins {
  display: block;
  min-height: 90px;
}

.trust-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border-left: 3px solid rgba(52, 211, 153, 0.55);
  border-radius: 0 10px 10px 0;
  background: rgba(52, 211, 153, 0.06);
}

.trust-check {
  color: var(--lead);
}

.mode-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.mode-chips .chip {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s, background 0.15s;
}

.mode-chips .chip:hover {
  border-color: rgba(34, 211, 238, 0.45);
}

.mode-chips .chip.is-active {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.55);
  color: var(--accent);
}

.field-block {
  margin-bottom: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.extras {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.extras summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent2);
}

.extras[open] summary {
  margin-bottom: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.btn-text {
  background: transparent;
  color: var(--accent2);
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 0;
  min-height: auto;
}

.link-btn {
  background: transparent;
  border: 0;
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

#cookie-banner.cookie-sheet {
  padding: 0;
}

.cookie-sheet-inner {
  padding: 16px 18px;
}

.cookie-lead {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.cookie-actions-primary {
  flex-direction: column;
  align-items: stretch;
}

.btn-wide {
  width: 100%;
}

.cookie-customize {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.cookie-customize .btn-block {
  margin-top: 14px;
}

.fine-print {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 12px 0 0;
  line-height: 1.45;
}

.footer-tools {
  text-align: center;
  margin-top: 10px;
}

.inline-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  margin: 10px 0 0;
}

.inline-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.colors-row {
  margin-top: 4px;
}

input[type='color'] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--surface2);
  cursor: pointer;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: start;
  }
}

.card {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 18px);
  box-shadow: var(--shadow);
}

.card h1 {
  font-size: clamp(1.35rem, 4vw + 0.6rem, 1.85rem);
  line-height: 1.25;
  margin: 0 0 10px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0 6px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input[type='text'],
input[type='url'],
input[type='password'],
input[type='tel'],
input[type='email'],
select,
textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--input-bg);
  color: var(--text);
}

.field-block:focus-within label {
  color: var(--lead);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.45);
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  min-height: 44px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #041018;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.qr-stage {
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  position: relative;
  min-height: 200px;
}

.qr-ghost {
  position: absolute;
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
}

.qr-stage.is-live .qr-ghost {
  display: none;
}

#qrCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  background: transparent;
}

.qr-stage.is-live #qrCanvas {
  background: #fff;
}

.content-guide {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
}

.content-guide h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.content-guide h3 {
  font-size: 1.1rem;
  margin: 1.5em 0 0.5em;
}

.content-guide p,
.content-guide li {
  color: var(--lead);
}

.landing-guide {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: var(--radius);
}

.landing-guide h2 {
  margin-top: 0;
}

.landing-guide p {
  color: var(--lead);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.privacy-pill[data-active='false'] {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

details.faq {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface2);
}

details.faq + details.faq {
  margin-top: 10px;
}

footer.site-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--muted);
  font-size: 0.9rem;
}

#cookie-banner {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.drawer-toggle {
  width: 100%;
}

@media (min-width: 900px) {
  .advanced-panel {
    display: block;
  }
}

@media (max-width: 899px) {
  .advanced-panel[hidden] {
    display: none;
  }
}

@media (max-width: 520px) {
  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .qr-stage {
    padding: 12px;
  }
}
