/* Qex — one hand-written stylesheet. Tokens from docs/design/*.dc.html. */
:root {
  --paper: #F3F1EA;
  --ink: #121212;
  --muted: #5A5750;
  --line: #D9D5CA;
  --soft: #ECE9E1;
  --accent: #C23C0A;
  --white: #FFFFFF;
  --ok-bg: #E3F1E8;
  --ok-ink: #0B5A37;
  --display: 'Archivo', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.4; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
svg.qr { display: block; width: 100%; height: auto; shape-rendering: crispEdges; }
svg.qr-art { display: block; width: 100%; height: auto; }
[hidden] { display: none !important; }

/* ---- brand + buttons ---------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { flex-shrink: 0; }
.brand span { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 18px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn-accent { background: var(--accent); color: var(--white); }
.btn-accent:hover { color: var(--white); filter: brightness(1.08); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { color: var(--white); background: #2a2a2a; }
.btn-ghost { background: var(--white); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-pill { border-radius: 999px; }
.btn[disabled] { opacity: .55; cursor: default; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .label { font-size: 13px; font-weight: 600; }
.input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 16px; background: var(--white); width: 100%; min-width: 0; }
.input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
textarea.input { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; }
.error-text { color: #A12A06; font-size: 13px; min-height: 0; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; font-size: 14px; background: var(--white); border: 1px solid var(--line); }
.notice.is-error { border-color: #E7B7A5; background: #FBEDE7; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; }

.swatches { display: flex; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 999px; border: 3px solid var(--white); outline: 1px solid var(--line); padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--ink); }

/* ---- landing (shared) ---------------------------------------------------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 48px; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.site-nav a:not(.btn) { text-decoration: none; }
.landing { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.qr-dim svg.qr path { fill: var(--line); transition: fill .2s; }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 28px 48px; border-top: 1px solid var(--line); }
.features div { display: flex; flex-direction: column; gap: 4px; }
.features strong { font-size: 15px; }
.features span { font-size: 14px; color: var(--muted); }

.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 40px 48px 56px; max-width: 900px; margin: 0 auto; width: 100%; }
.pricing h2 { grid-column: 1 / -1; margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 28px; }
.plan { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.plan h3 { margin: 0; font-size: 17px; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

/* ---- landing A: the QR is the page -------------------------------------- */
.la-main { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 8px 48px 40px; }
.la-main h1 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: clamp(36px, 5.2vw, 60px); line-height: 1; letter-spacing: -0.02em; text-align: center; max-width: 900px; }
.la-row { display: flex; align-items: center; gap: 40px; }
.la-side { display: flex; flex-direction: column; gap: 10px; width: 220px; font-size: 14px; color: var(--muted); }
.la-side.left { align-items: flex-end; text-align: right; }
.la-side .mono { font-size: 13px; color: var(--ink); }
.la-side .live { color: var(--accent); }
.la-qr { padding: 20px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.la-qr .qr-box { width: 300px; }
.la-qr .short { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; }
.la-qr .dest { font-size: 13px; color: var(--muted); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.la-form { display: flex; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 6px; width: 620px; max-width: 100%; }
.la-form input { flex-grow: 1; min-width: 0; border: 0; outline: none; font-size: 16px; padding: 0 18px; background: transparent; }
.la-form .btn { padding: 14px 24px; font-size: 16px; border-radius: 999px; }
.la-note { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }

/* ---- landing B: editor + analytics preview ------------------------------ */
.lb-main { flex-grow: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; padding: 24px 48px 48px; align-items: center; }
.lb-edit { display: flex; flex-direction: column; gap: 28px; }
.lb-edit h1 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: clamp(40px, 5vw, 64px); line-height: .98; letter-spacing: -0.02em; }
.lb-edit p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--muted); max-width: 480px; }
.lb-edit .input { height: 52px; border-radius: 12px; }
.lb-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.lb-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lb-cta .btn { padding: 16px 28px; font-size: 16px; border-radius: 12px; }
.lb-preview { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lb-qr { padding: 24px; border-radius: 20px; display: flex; gap: 24px; align-items: center; }
.lb-qr .qr-box { width: 190px; flex-shrink: 0; }
.lb-qr .meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lb-qr .dest { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stats { padding: 24px; border-radius: 20px; display: flex; flex-direction: column; gap: 16px; }
.lb-stats .top { display: flex; justify-content: space-between; align-items: baseline; }
.big-num { font-family: var(--display); font-weight: 800; font-size: 32px; }

/* ---- landing C: QR builder ----------------------------------------------- */
.lc-main { flex-grow: 1; display: flex; flex-direction: column; gap: 28px; padding: 8px 48px 48px; max-width: 1180px; margin: 0 auto; width: 100%; }
.lc-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.lc-kicker { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lc-head h1 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: clamp(34px, 4.6vw, 56px); line-height: 1; letter-spacing: -0.02em; max-width: 820px; }
.lc-head p { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); max-width: 640px; }
.lc-builder { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.lc-panels { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lc-panel { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.lc-panel h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lc-panel fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lc-panel legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--muted); }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { flex-shrink: 0; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; margin-top: 1px; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text strong { font-size: 15px; }
.switch-text small { font-size: 13px; color: var(--muted); }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { display: flex; flex-direction: column; gap: 18px; }

.tiles-row { display: flex; flex-wrap: wrap; gap: 10px; }
.tile-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; cursor: pointer; }
.tile-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile-art { width: 64px; height: 64px; display: grid; place-items: center; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); transition: border-color .12s, box-shadow .12s; }
.tile-art svg, .tile-art img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.tile-art svg { width: 100%; height: 100%; }
.tile-art.none, .tile-art.upload { font-size: 22px; color: var(--muted); }
.tile-label { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.2; }
.tile-opt:hover .tile-art { border-color: var(--ink); }
.tile-opt input:checked + .tile-art { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tile-opt input:checked ~ .tile-label { color: var(--ink); font-weight: 600; }
.tile-opt input:focus-visible + .tile-art { outline: 2px solid var(--accent); outline-offset: 3px; }
.tile-opt input:disabled ~ * { opacity: .55; }
.logos .tile-art { padding: 16px; }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-row .hint { flex: 1; min-width: 200px; }

.color-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.color-field { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.color-field label { font-size: 13px; font-weight: 600; }
.color-input { display: flex; gap: 8px; }
.color-input input[type="color"] { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); flex-shrink: 0; cursor: pointer; }
.swatches.small { flex-wrap: wrap; gap: 6px; }
.swatches.small .swatch { width: 26px; height: 26px; border-width: 2px; }
.swap { width: 44px; height: 44px; padding: 0; margin-bottom: 34px; font-size: 18px; }

.lc-preview { position: sticky; top: 16px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lc-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #FBEDE7; color: #A12A06; }
.lc-badge.is-static { background: var(--soft); color: var(--muted); }
.lc-qr { width: 260px; max-width: 100%; transition: opacity .2s; }
.lc-qr.qr-dim { opacity: .35; }
.lc-qr.is-invalid { outline: 2px dashed #E7B7A5; outline-offset: 6px; border-radius: 8px; }
.lc-caption { font-size: 14px; letter-spacing: .03em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-dest { font-size: 13px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-dest:empty { display: none; }
.lc-stats { margin: 4px 0; width: 100%; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.lc-stats div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lc-stats dt { color: var(--muted); }
.lc-stats dd { margin: 0; }
.lc-stats i { display: block; width: 28px; height: 10px; border-radius: 999px; background: var(--soft); }
.lc-stats i.wide { width: 72px; }
.lc-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.lc-preview .notice { width: 100%; }

/* ---- download controls (builder + code page) ----------------------------- */
.dl-controls { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.dl-split { display: flex; position: relative; }
.dl-main { flex: 1; border-radius: 10px 0 0 10px; padding: 13px 16px; font-size: 15px; min-width: 0; }
.dl-main span { overflow: hidden; text-overflow: ellipsis; }
.dl-more summary { list-style: none; height: 100%; border-radius: 0 10px 10px 0; padding: 0 12px; border-left: 1px solid rgba(255,255,255,.35); }
.dl-more summary::-webkit-details-marker { display: none; }
.dl-more[open] summary svg { transform: rotate(180deg); }
.dl-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 100%; min-width: 260px; padding: 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 30px rgba(18,18,18,.14); }
.dl-menu fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dl-menu fieldset.is-off { opacity: .45; }
.dl-menu legend { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; padding: 0; }
.dl-opt { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.dl-opt:hover { background: var(--paper); }
.dl-opt input { margin: 3px 0 0; accent-color: var(--accent); }
.dl-opt span { display: flex; flex-direction: column; }
.dl-opt strong { font-size: 14px; }
.dl-opt small { font-size: 12px; color: var(--muted); }
.dl-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-family: var(--mono); }
.chip input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--white); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dl-share { width: 100%; }
.dl-status { margin: 0; font-size: 13px; color: var(--ok-ink); text-align: center; }

/* ---- bars / charts ------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 0; }
.bars .title { font-weight: 600; color: var(--muted); }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-row .lbl { display: flex; justify-content: space-between; gap: 8px; }
.bar-row .lbl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .lbl span:last-child { font-family: var(--mono); }
.bar-track { height: 6px; background: var(--soft); border-radius: 999px; }
.bar-fill { height: 6px; background: var(--accent); border-radius: 999px; }
.empty { font-size: 13px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }

/* ---- app shell (dashboard + detail) -------------------------------------- */
.app-header { display: flex; align-items: center; gap: 20px; padding: 18px 40px; border-bottom: 1px solid var(--line); background: var(--white); flex-wrap: wrap; }
.app-header .search { flex-grow: 1; max-width: 420px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 14px; background: var(--paper); min-width: 0; }
.app-header .spacer { flex-grow: 1; }
.crumbs { font-size: 14px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs strong { color: var(--ink); }
.page { padding: 0 40px 40px; }

.guest-banner { display: flex; align-items: center; gap: 16px; margin: 20px 40px 0; padding: 14px 18px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.guest-banner span { flex-grow: 1; }
.guest-banner svg { flex-shrink: 0; }
.page-notice { margin: 16px 40px 0; }

.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px 40px 12px; }
.title-row h1 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 32px; }
.title-row .sub { font-size: 14px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 40px 32px; }
.code-card { padding: 18px; display: flex; gap: 16px; position: relative; }
.code-card.is-new { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.code-card .qr-link { flex-shrink: 0; width: 104px; }
.code-card .body { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.code-card .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.code-card .head a { font-weight: 700; font-size: 15px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-card .head a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; } /* whole card clickable */
.code-card .short { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.code-card .dest { font-size: 13px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.code-card .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: auto; }
.code-card .foot strong { font-family: var(--display); font-size: 20px; }
.code-card .spark { width: 120px; flex-shrink: 1; min-width: 60px; }

.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-active { background: var(--ok-bg); color: var(--ok-ink); }
.pill-paused { background: var(--soft); color: var(--muted); }
.pill-flag { background: #FBEDE7; color: #A12A06; }

.empty-state { margin: 0 40px 40px; padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; }

dialog { border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: min(440px, calc(100vw - 32px)); background: var(--white); color: var(--ink); }
dialog::backdrop { background: rgba(18, 18, 18, .35); }
dialog h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 800; font-size: 22px; }
dialog form { display: flex; flex-direction: column; gap: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- code detail ---------------------------------------------------------- */
.range { display: flex; background: var(--paper); border-radius: 10px; padding: 4px; font-size: 13px; }
.range a { padding: 7px 12px; border-radius: 7px; text-decoration: none; }
.range a[aria-current="page"] { background: var(--white); font-weight: 600; }
.detail { display: flex; gap: 20px; padding: 24px 40px 40px; align-items: flex-start; }
.detail-side { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.detail-main { flex-grow: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.qr-panel { padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-panel .qr-box { width: 230px; max-width: 100%; }
.qr-panel .short { font-family: var(--mono); font-size: 14px; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.panel { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel .hint { font-size: 12px; color: var(--muted); }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile span { font-size: 13px; color: var(--muted); }
.tile strong { font-family: var(--display); font-weight: 800; font-size: 28px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chart-card .label, .panels .label { color: var(--muted); }
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.panels > .card { padding: 18px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; height: 36px; }
.hours i { border-radius: 2px; background: var(--accent); }
.hours-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ---- simple pages (report, 404, login) ----------------------------------- */
.narrow { max-width: 520px; margin: 0 auto; padding: 48px 24px; display: flex; flex-direction: column; gap: 20px; }
.narrow h1 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 32px; line-height: 1.05; }
.radio-list { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.radio-list label { display: flex; gap: 10px; align-items: center; font-weight: 400; }

/* ---- site footer + articles ------------------------------------------------ */
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding: 24px 48px 32px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); }
.article { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; font-size: 17px; line-height: 1.6; }
.article h1 { margin: 0 0 12px; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 44px; line-height: 1.02; }
.article h2 { margin: 40px 0 8px; font-family: var(--display); font-stretch: 108%; font-weight: 800; font-size: 26px; line-height: 1.1; }
.article .lede { font-size: 20px; color: var(--muted); margin: 0 0 24px; }
.article code { font-family: var(--mono); font-size: 0.92em; background: var(--soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.article figure { margin: 24px 0; }
.article figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.qr-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.qr-compare > div { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.qr-compare .qr { width: 100%; height: auto; }
.qr-compare span { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.article table { border-collapse: collapse; width: 100%; font-size: 15px; }
.article th, .article td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { font-weight: 600; }
.article .cta { margin-top: 40px; padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .la-side { width: 160px; }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  /* one column: Content → Preview → Design, so the link field and the code are both near the top */
  .lc-builder { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .lc-panels { display: contents; }
  .lc-panel:first-child { order: 1; }
  .lc-preview { position: static; order: 2; }
  .lc-panel:last-child { order: 3; }
  .lb-main { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .la-row { flex-direction: column; gap: 16px; }
  .la-side, .la-side.left { width: auto; align-items: center; text-align: center; flex-direction: row; gap: 8px; }
  .la-side span:not(.mono) { display: none; }
  .la-side.right span:not(.mono):last-child { display: inline; }
  .detail { flex-direction: column; }
  .detail-side { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-side .qr-panel { grid-row: span 2; }
}

@media (max-width: 720px) {
  .site-header { padding: 16px 16px; }
  .site-nav { gap: 16px; font-size: 14px; }
  .site-nav .hide-sm { display: none; }
  .la-main { padding: 8px 16px 32px; gap: 22px; }
  .la-qr .qr-box { width: min(200px, 52vw); }
  .la-qr { padding: 16px; gap: 8px; }
  .la-main h1 { font-size: 34px; }
  .la-side.right { flex-direction: column; gap: 4px; font-size: 13px; }
  .la-side .mono { white-space: nowrap; }
  .la-form { flex-direction: column; border-radius: 20px; padding: 8px; }
  .la-form input { height: 48px; padding: 0 12px; }
  .la-form .btn { width: 100%; border-radius: 14px; }
  .features { grid-template-columns: minmax(0, 1fr); padding: 24px 16px; gap: 16px; }
  .pricing { grid-template-columns: minmax(0, 1fr); padding: 32px 16px 48px; }
  .lb-main { padding: 8px 16px 32px; }
  .lc-main { padding: 8px 16px 32px; gap: 20px; }
  .lc-head p { font-size: 15px; }
  .lc-panel, .lc-preview { padding: 16px; }
  .lc-qr { width: min(240px, 64vw); }
  .tile-opt { width: 64px; }
  .tile-art { width: 56px; height: 56px; }
  .logos .tile-art { padding: 13px; }
  .tabs [role="tab"] { font-size: 13px; padding: 10px 4px; }
  .swap { margin-bottom: 0; }
  .lb-edit { gap: 22px; }
  .lb-edit p { font-size: 16px; }
  .lb-qr { flex-direction: column; align-items: stretch; padding: 20px; gap: 16px; }
  .lb-qr .qr-box { width: min(220px, 60vw); align-self: center; }
  .lb-stats { padding: 20px; }
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  .app-header { padding: 12px 16px; gap: 12px; }
  .app-header .search { order: 3; flex-basis: 100%; max-width: none; }
  .guest-banner { margin: 16px 16px 0; flex-wrap: wrap; }
  .guest-banner span { flex-basis: calc(100% - 36px); }
  .guest-banner .btn { width: 100%; }
  .page-notice { margin: 12px 16px 0; }
  .title-row { padding: 20px 16px 12px; }
  .title-row h1 { font-size: 26px; }
  .grid { grid-template-columns: minmax(0, 1fr); padding: 0 16px 24px; gap: 12px; }
  .code-card { padding: 14px; gap: 14px; }
  .code-card .qr-link { width: 88px; }
  .empty-state { margin: 0 16px 24px; }

  .range a { padding: 6px 9px; }
  .detail { padding: 16px; gap: 12px; }
  .detail-side { display: flex; gap: 12px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile strong { font-size: 22px; }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .narrow { padding: 32px 16px; }
  .site-footer { padding: 20px 16px 28px; }
  .article { padding: 16px 16px 48px; font-size: 16px; }
  .article h1 { font-size: 32px; }
  .article h2 { font-size: 22px; }
  .qr-compare { gap: 8px; }
  .qr-compare > div { padding: 8px; }
  .qr-compare span { font-size: 11px; }
}

/* Turnstile (interaction-only: invisible unless Cloudflare needs a click). Floated so it never shifts layout. */
.la-form, .nav-start { position: relative; }
.la-form .cf-turnstile, .nav-start .cf-turnstile { position: absolute; top: calc(100% + 8px); z-index: 10; }
.la-form .cf-turnstile { left: 50%; transform: translateX(-50%); }
.nav-start .cf-turnstile { right: 0; }
.landing-notice { margin: 0; max-width: 620px; }

/* Signed-in account (dashboard header) */
.account { display: flex; align-items: center; gap: 10px; margin: 0; }
.account-email { font-size: 13px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .account-email { display: none; }
}
/* ---- AI / API pages ------------------------------------------------------- */
.wide { max-width: 820px; margin: 0 auto; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 20px; }
.wide h1 { margin: 0; font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 40px; line-height: 1.05; }
.wide h2 { margin: 0; font-family: var(--display); font-stretch: 108%; font-weight: 800; font-size: 20px; }
.wide .lead { margin: 0; font-size: 18px; color: var(--muted); max-width: 640px; }
.wide .panel { padding: 22px; gap: 14px; }
.wide .panel ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.hint { font-size: 12px; color: var(--muted); }
.snippet { margin: 4px 0 0; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.guide { display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.step .btn { padding: 7px 12px; font-size: 13px; }
.rows { width: 100%; border-collapse: collapse; }
.rows td { padding: 10px 0; border-top: 1px solid var(--soft); vertical-align: middle; }
.rows td strong { display: block; }
.rows .act { text-align: right; width: 1%; padding-left: 12px; }
.inline-form { display: flex; gap: 8px; }
.new-key { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.link-list { list-style: none; padding: 0 !important; }
@media (max-width: 720px) {
  .wide { padding: 24px 16px 48px; }
  .wide h1 { font-size: 30px; }
  .inline-form { flex-direction: column; }
}
