:root {
  --ink: #050706;
  --panel: #0b100d;
  --panel-2: #101711;
  --panel-3: #151d16;
  --line: rgba(183, 255, 57, .18);
  --line-soft: rgba(255, 255, 255, .10);
  --text: #f4f8ef;
  --muted: #8d9a8c;
  --muted-2: #637064;
  --neon: #b7ff39;
  --neon-soft: #d7ffa0;
  --danger: #ff8f8f;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: inherit; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image: linear-gradient(rgba(183,255,57,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(183,255,57,.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.app-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; position: relative; }
.site-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; position: relative; display: block; border: 2px solid var(--neon); border-radius: 9px; transform: rotate(-7deg); box-shadow: 0 0 24px rgba(183,255,57,.18); }
.brand-mark::before, .brand-mark::after, .brand-mark span, .brand-mark i, .brand-mark b { content: ""; display: block; position: absolute; background: var(--neon); }
.brand-mark::before { width: 8px; height: 8px; left: 5px; top: 5px; box-shadow: 17px 0 0 var(--neon), 0 17px 0 var(--neon); }
.brand-mark::after { width: 5px; height: 5px; right: 5px; bottom: 5px; }
.brand-mark span { width: 5px; height: 12px; right: 6px; top: 13px; }
.brand-mark i { width: 12px; height: 5px; left: 13px; bottom: 6px; }
.brand-mark b { width: 5px; height: 5px; right: 14px; top: 6px; }
.brand-copy { display: flex; align-items: baseline; gap: 5px; letter-spacing: .08em; }
.brand-copy strong { font-size: 1.05rem; font-weight: 850; }
.brand-copy em { color: var(--neon); font-size: .7rem; font-style: normal; font-weight: 800; letter-spacing: .16em; }
.header-meta { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; }
.status-dot, .preview-live span, .secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 12px var(--neon); display: inline-block; }

.main-nav { display: flex; gap: 8px; padding: 22px 0 8px; }
.nav-button { border: 1px solid transparent; background: transparent; color: var(--muted); padding: 10px 15px; border-radius: 12px; font-size: .83rem; font-weight: 750; transition: .2s ease; }
.nav-button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-button.is-active { color: var(--ink); background: var(--neon); box-shadow: 0 8px 22px rgba(183,255,57,.16); }
.nav-icon { font-size: 1rem; margin-right: 5px; }

.view { padding: 48px 0 26px; animation: view-in .35s ease both; }
.view[hidden] { display: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.eyebrow, .step-label, .tiny-label, .preview-meta, .result-label, .result-status { letter-spacing: .15em; font-size: .65rem; font-weight: 800; }
.eyebrow { color: var(--neon); margin: 0 0 15px; }
h1 { margin: 0; font-size: clamp(2.65rem, 6vw, 5.25rem); line-height: .94; letter-spacing: -.075em; font-weight: 820; }
h1 span { color: var(--neon); }
.lede { color: var(--muted); max-width: 430px; margin: 20px 0 0; font-size: .98rem; line-height: 1.55; }
.heading-badge { display: flex; align-items: center; gap: 10px; color: var(--muted); border: 1px solid var(--line); padding: 13px 15px; border-radius: 13px; font-size: .73rem; line-height: 1.3; text-transform: uppercase; letter-spacing: .06em; }
.heading-badge b { color: var(--neon-soft); font-weight: 700; }
.badge-shield { color: var(--neon); font-size: 1.25rem; }

.generator-layout, .scanner-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); gap: 22px; align-items: start; }
.tool-card, .preview-card, .result-card { background: rgba(11,16,13,.94); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
.generator-card, .scanner-card { padding: 28px; }
.card-topline, .preview-card-header, .result-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-topline { margin-bottom: 23px; }
.card-topline.compact { margin-top: 28px; margin-bottom: 17px; }
.step-label { color: var(--muted); }
.step-label b { color: var(--neon); margin-right: 7px; }
.tiny-label { color: var(--muted-2); }
.mode-tabs { display: flex; gap: 5px; background: #070a08; padding: 4px; border-radius: 11px; margin-bottom: 27px; }
.mode-tab { border: 0; color: var(--muted); background: transparent; border-radius: 8px; padding: 10px 12px; flex: 1; font-size: .77rem; font-weight: 700; }
.mode-tab.is-active { color: var(--ink); background: var(--neon); }
.mode-panel { min-height: 103px; }
.mode-panel.is-hidden { display: none; }
label { display: block; color: var(--text); font-size: .76rem; font-weight: 750; margin: 0 0 9px; }
.mode-panel label + input, .mode-panel label + textarea { margin-bottom: 10px; }
input[type="url"], input[type="tel"], textarea { display: block; width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid rgba(255,255,255,.13); border-radius: 10px; outline: none; padding: 13px 14px; font-size: .88rem; transition: .2s ease; resize: vertical; }
input:focus, textarea:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(183,255,57,.09); }
input::placeholder, textarea::placeholder { color: #5d6a5d; }
.field-hint { margin: 0; color: var(--muted-2); font-size: .68rem; line-height: 1.4; }
.field-hint b { color: var(--muted); }
.customization-block { border-top: 1px solid var(--line-soft); margin-top: 9px; }
.color-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-control { background: var(--panel-2); border: 1px solid rgba(255,255,255,.10); border-radius: 11px; padding: 10px; margin: 0; }
.color-label { display: flex; align-items: center; gap: 7px; font-size: .7rem; color: var(--muted); margin-bottom: 11px; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.qr-swatch { background: var(--ink); border: 1px solid #fff; }
.bg-swatch { background: var(--neon); }
.color-input-wrap { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
input[type="color"] { width: 32px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: transparent; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255,255,255,.22); border-radius: 5px; }
code { color: var(--neon-soft); font: 700 .64rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.contrast-note { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: .68rem; margin: 13px 0 23px; }
.contrast-note span { color: var(--neon); font-size: .55rem; }
.primary-button, .secondary-button, .icon-button, .upload-button { border-radius: 10px; min-height: 45px; border: 0; font-weight: 800; font-size: .75rem; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.primary-button { background: var(--neon); color: var(--ink); padding: 0 15px; display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; text-decoration: none; }
.primary-button:hover { box-shadow: 0 10px 28px rgba(183,255,57,.20); transform: translateY(-1px); }
.button-arrow { font-size: 1.15rem; font-weight: 500; }
.generator-card > .primary-button { width: 100%; }
.secondary-button { background: var(--panel-3); color: var(--text); border: 1px solid rgba(255,255,255,.13); padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.secondary-button:hover { border-color: var(--neon); color: var(--neon); }
.icon-button { width: 46px; background: var(--panel-3); color: var(--neon); border: 1px solid rgba(255,255,255,.13); font-size: 1.08rem; }
.form-error { color: var(--danger); font-size: .73rem; line-height: 1.45; min-height: 17px; margin: 11px 0 0; }

.preview-column, .scanner-results { min-width: 0; }
.preview-card { padding: 22px; background: #101710; }
.preview-card-header { padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.preview-live { display: inline-flex; align-items: center; gap: 7px; color: var(--neon); font-size: .61rem; font-weight: 800; letter-spacing: .12em; }
.qr-stage { min-height: 350px; position: relative; display: grid; place-items: center; padding: 27px; overflow: hidden; }
.qr-stage::before { content: ""; position: absolute; inset: 20px; border: 1px dashed rgba(183,255,57,.14); border-radius: 14px; }
#qr-canvas { width: min(100%, 290px); height: auto; display: none; position: relative; z-index: 1; border-radius: 7px; image-rendering: pixelated; box-shadow: 0 14px 40px rgba(0,0,0,.28); }
.qr-empty { color: var(--muted-2); position: relative; width: 190px; height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: .71rem; text-align: center; }
.qr-empty p { margin: 0; }
.empty-plus { color: var(--neon); font-size: 1.4rem; font-weight: 300; }
.empty-corner, .scan-corner { width: 20px; height: 20px; position: absolute; border-color: var(--neon); }
.corner-tl { left: 0; top: 0; border-top: 2px solid; border-left: 2px solid; }
.corner-tr { right: 0; top: 0; border-top: 2px solid; border-right: 2px solid; }
.corner-bl { left: 0; bottom: 0; border-bottom: 2px solid; border-left: 2px solid; }
.corner-br { right: 0; bottom: 0; border-bottom: 2px solid; border-right: 2px solid; }
.preview-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 16px; font-size: .59rem; }
.preview-meta span:last-child { max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 500; }
.action-row { display: grid; grid-template-columns: 1fr 1fr 46px; gap: 8px; margin-top: 12px; }
.share-note { color: var(--muted-2); font-size: .68rem; margin: 10px 2px 18px; }
.ad-slot { min-height: 52px; height: 52px; contain: layout paint; overflow: hidden; border: 1px dashed rgba(255,255,255,.13); border-radius: 12px; color: var(--muted-2); display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 10px 13px; font-size: .64rem; transition: border-color .2s ease, background .2s ease; }
.ad-slot[data-ad-state="loading"] { border-style: solid; border-color: rgba(255,255,255,.16); }
.ad-slot[data-ad-state="loaded"] { border-style: solid; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.015); }
.ad-slot[data-ad-state="unavailable"] { border-color: rgba(255,255,255,.08); }
.ad-slot-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-tag { color: var(--muted); font-size: .57rem; letter-spacing: .13em; border: 1px solid rgba(255,255,255,.14); border-radius: 4px; padding: 3px 5px; white-space: nowrap; }

.scanner-heading { align-items: center; }
.secure-badge { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid rgba(183,255,57,.22); border-radius: 10px; color: var(--neon-soft); font-size: .68rem; font-weight: 750; }
.secure-badge.is-warning { color: var(--danger); border-color: rgba(255,143,143,.3); }
.secure-badge.is-warning .secure-dot { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.camera-frame { height: 348px; position: relative; overflow: hidden; background: #040604; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; }
#camera-video { width: 100%; height: 100%; object-fit: cover; display: none; }
.camera-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; text-align: center; padding: 20px; }
.camera-placeholder strong { color: var(--text); font-size: .8rem; }
.camera-glyph { color: var(--neon); font-size: 3rem; line-height: 1; }
.scan-corner { width: 32px; height: 32px; z-index: 2; opacity: .9; }
.scan-tl { left: 27px; top: 27px; border-top: 3px solid; border-left: 3px solid; }
.scan-tr { right: 27px; top: 27px; border-top: 3px solid; border-right: 3px solid; }
.scan-bl { left: 27px; bottom: 27px; border-bottom: 3px solid; border-left: 3px solid; }
.scan-br { right: 27px; bottom: 27px; border-bottom: 3px solid; border-right: 3px solid; }
.scan-line { position: absolute; z-index: 2; width: calc(100% - 78px); height: 1px; top: 50%; left: 39px; background: var(--neon); box-shadow: 0 0 13px var(--neon); opacity: 0; }
.camera-frame.is-scanning .scan-line { opacity: 1; animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateY(-125px); } 50% { transform: translateY(125px); } }
.camera-actions { display: grid; grid-template-columns: 1fr 110px; gap: 8px; margin-top: 13px; }
.camera-actions .primary-button { width: 100%; }
.gallery-upload { margin-top: 14px; }
.or-divider { color: var(--muted-2); display: flex; align-items: center; gap: 9px; justify-content: center; font-size: .68rem; margin: 0 0 12px; }
.or-divider i { height: 1px; width: 50px; background: var(--line-soft); }
.upload-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--neon); background: transparent; border: 1px solid rgba(183,255,57,.26); }
.upload-button:hover { background: rgba(183,255,57,.08); }
.scanner-footnote { color: var(--muted-2); font-size: .65rem; line-height: 1.5; margin: 12px 0 0; }
.scanner-footnote span { color: var(--neon); margin-right: 4px; }
.result-card { min-height: 348px; padding: 22px; }
.result-header { padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.result-status { color: var(--muted-2); font-size: .6rem; }
.result-status.is-found { color: var(--neon); }
.result-empty { min-height: 275px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 9px; color: var(--muted); padding: 30px; font-size: .72rem; line-height: 1.5; }
.result-empty strong { color: var(--text); font-size: .82rem; }
.result-empty-icon { color: var(--muted-2); font-size: 2.6rem; line-height: 1; }
.result-content { padding-top: 22px; }
.result-content.is-hidden { display: none; }
.result-label { color: var(--neon); margin: 0 0 10px; font-size: .6rem; }
.result-text { background: #070a08; border: 1px solid rgba(255,255,255,.11); border-radius: 10px; color: var(--text); min-height: 108px; max-height: 180px; overflow: auto; padding: 13px; white-space: pre-wrap; word-break: break-word; font: .78rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.result-actions .secondary-button, .result-actions .primary-button { width: 100%; }
.link-button { justify-content: center; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; color: var(--muted-2); border-top: 1px solid var(--line-soft); padding: 24px 0 34px; margin-top: 58px; font-size: .64rem; letter-spacing: .04em; }
.site-footer b { color: var(--neon); padding: 0 4px; }
.footer-line { display: inline-block; width: 28px; height: 1px; background: var(--neon); vertical-align: middle; margin-left: 6px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--neon); color: var(--ink); padding: 11px 16px; border-radius: 9px; font-size: .76rem; font-weight: 800; box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: .24s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 800px) {
  .app-shell { width: min(100% - 28px, 650px); }
  .generator-layout, .scanner-layout { grid-template-columns: 1fr; }
  .view-heading { align-items: flex-start; }
  .heading-badge { margin-top: 5px; }
  .preview-column, .scanner-results { max-width: 650px; }
}
@media (max-width: 520px) {
  .app-shell { width: calc(100% - 24px); }
  .site-header { min-height: 72px; }
  .header-meta { font-size: .58rem; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-copy strong { font-size: .9rem; }
  .brand-copy em { font-size: .58rem; }
  .main-nav { padding-top: 16px; }
  .nav-button { flex: 1; font-size: .72rem; padding: 10px 7px; }
  .view { padding-top: 34px; }
  .view-heading { display: block; margin-bottom: 28px; }
  h1 { font-size: clamp(2.5rem, 15vw, 4rem); }
  .heading-badge, .secure-badge { margin-top: 22px; display: inline-flex; }
  .generator-card, .scanner-card { padding: 19px; }
  .preview-card, .result-card { padding: 16px; }
  .qr-stage { min-height: 290px; padding: 18px; }
  .qr-stage::before { inset: 14px; }
  .action-row { grid-template-columns: 1fr 1fr; }
  .action-row .icon-button { grid-column: 1 / -1; width: 100%; }
  .camera-frame { height: min(86vw, 340px); }
  .camera-actions { grid-template-columns: 1fr 96px; }
  .result-actions { grid-template-columns: 1fr; }
  .site-footer { margin-top: 40px; flex-direction: column; }
}
