/* Adlayr base: tokens, aurora, glass, buttons, forms. Shared by the landing page and the app. */
:root {
  --bg: #07090D;
  --bg-2: #0D1016;
  --panel: rgba(16, 19, 26, 0.62);
  --panel-solid: #12151C;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #F4F2FF;
  --text-2: rgba(244, 242, 255, 0.74);
  --text-3: rgba(244, 242, 255, 0.58);
  --accent: #7C62FF;
  --accent-ink: #FFFFFF;
  --teal: #10C9B7;
  --pink: #FF3D8B;
  --ok: #2BD27F;
  --warn: #FFC454;
  --bad: #FF6B6B;
  --a1: #6B4DFF; --a2: #10C9B7; --a3: #FF3D8B; --a4: #2E6BFF;
  --radius: 14px;
  --radius-lg: 22px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, canvas, svg { max-width: 100%; }
a { color: #C9BCFF; }
a:hover { color: #fff; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(28px, 3.2vw, 44px); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Aurora ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: .9; contain: strict; }
.aurora i { position: absolute; border-radius: 50%; will-change: transform; transform: translateZ(0); backface-visibility: hidden; transition: background 1.2s var(--ease); }
.aurora i:nth-child(1) { left: -12%; top: -18%; width: 62vw; height: 62vw; background: radial-gradient(circle, var(--a1) 0%, transparent 70%); animation: au1 7s ease-in-out infinite; }
.aurora i:nth-child(2) { right: -14%; top: 8%; width: 56vw; height: 56vw; background: radial-gradient(circle, var(--a2) 0%, transparent 70%); animation: au2 9s ease-in-out infinite; }
.aurora i:nth-child(3) { left: 22%; bottom: -30%; width: 58vw; height: 58vw; background: radial-gradient(circle, var(--a3) 0%, transparent 70%); animation: au3 6.5s ease-in-out infinite; }
.aurora i:nth-child(4) { left: -10%; bottom: -20%; width: 44vw; height: 44vw; background: radial-gradient(circle, var(--a4) 0%, transparent 70%); animation: au4 10s ease-in-out infinite; }
@keyframes au1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(14vw, 8vh) scale(1.18); } 66% { transform: translate(4vw, 18vh) scale(.92); } }
@keyframes au2 { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-16vw, 12vh) scale(.88); } }
@keyframes au3 { 0%,100% { transform: translate(0,0); } 40% { transform: translate(10vw, -14vh) scale(1.12); } 70% { transform: translate(-8vw, -6vh) scale(.95); } }
@keyframes au4 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(18vw, -10vh) scale(1.2); } }
body.processing .aurora i, body.aurora-off .aurora i { animation-play-state: paused; }
.aurora i { animation-direction: alternate !important; }
body.aurora-off .aurora { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .aurora i { animation: none !important; } }
@media (max-width: 760px) { .aurora i { min-width: 420px; min-height: 420px; } }

/* ---------- Glass ---------- */
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); }
.glass-bar { background: rgba(9, 11, 16, 0.55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; flex-shrink: 0; cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #fff; color: #0B0D12; }
.btn-primary:hover:not(:disabled) { background: #E9E5FF; color: #0B0D12; transform: translateY(-1px); box-shadow: 0 10px 30px rgba(124, 98, 255, .35); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-danger-ghost { background: transparent; color: #FFB0B0; border-color: rgba(255, 107, 107, .4); }
.btn-danger-ghost:hover { background: rgba(255, 107, 107, .12); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.icon-xs { width: 28px; height: 28px; border-radius: 8px; border-color: transparent; background: transparent; }
.link-btn { background: none; border: 0; padding: 4px 0; color: #C9BCFF; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.link-btn:hover { color: #fff; }
.link-btn.left { text-align: left; text-decoration: none; white-space: normal; display: flex; gap: 8px; align-items: center; color: var(--text); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.field-inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field-label { font-size: 13px; color: var(--text-2); }
.field-err { color: #FFB0B0; font-size: 12px; min-height: 0; }
.input { font: inherit; font-size: 15px; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; min-width: 0; }
.input:focus { outline: none; border-color: #B3A3FF; box-shadow: 0 0 0 3px rgba(124, 98, 255, .35); }
.input::placeholder { color: rgba(244, 242, 255, 0.42); }
.input-sm { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.input-lg { min-height: 52px; font-size: 17px; }
.input.num { width: 92px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
select.input option { background: #12151C; color: #fff; }
textarea.input { min-height: 72px; resize: vertical; }
.mono { font-family: var(--mono); }
.color-pick { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: none; cursor: pointer; flex-shrink: 0; }
.color-pick::-webkit-color-swatch-wrapper { padding: 3px; }
.color-pick::-webkit-color-swatch { border: none; border-radius: 7px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text); }
.check input, .size-option input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); transition: background .2s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.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 #fff; outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Layout helpers ---------- */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { justify-content: center; }
.center-text { text-align: center; }
.stack-6 > * + * { margin-top: 6px; } .stack-8 > * + * { margin-top: 8px; } .stack-10 > * + * { margin-top: 10px; } .stack-12 > * + * { margin-top: 12px; } .stack-16 > * + * { margin-top: 16px; } .stack-24 > * + * { margin-top: 24px; }
.muted { color: var(--text-2); } .small { font-size: 13px; }
.lead { color: var(--text-2); font-size: 17px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.divider-top { border-top: 1px solid var(--line); padding-top: 16px; }
.align-end { align-self: flex-end; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.tag-violet { background: rgba(124, 98, 255, .25); color: #D8CFFF; }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand:hover { color: #fff; }
.brand .logo-mark rect { transition: transform .45s var(--ease); transform-box: fill-box; }
.brand:hover .lm1 { transform: translate(-2px, 2px); }
.brand:hover .lm3 { transform: translate(2px, -2px); }
.brand-lg { font-size: 26px; }
.credit { color: var(--text-3); font-size: 13px; text-align: center; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: #1A1E27; border: 1px solid var(--line-strong); color: #fff; box-shadow: var(--shadow); font-size: 14px; transform: translateY(10px); opacity: 0; transition: all .25s var(--ease); }
.toast.in { transform: none; opacity: 1; }
.toast-ok { border-color: rgba(43, 210, 127, .5); }
.toast-error { border-color: rgba(255, 107, 107, .6); background: #2A1518; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: rgba(20, 23, 30, 0.96); border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; animation: pop .25s var(--ease); }
.modal-wide { max-width: 1100px; }
.modal-title { font-size: 22px; margin-bottom: 16px; }
.modal-body { color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Busy overlay ---------- */
.busy { position: fixed; inset: 0; z-index: 250; display: none; align-items: center; justify-content: center; background: rgba(4, 6, 10, 0.5); backdrop-filter: blur(3px); }
.busy.show { display: flex; }
.busy-card { min-width: 300px; max-width: 420px; padding: 28px; border-radius: 22px; background: rgba(20, 23, 30, 0.95); border: 1px solid var(--line-strong); text-align: center; box-shadow: var(--shadow); }
.busy-label { margin-top: 12px; font-weight: 600; }
.busy-note { margin-top: 6px; color: var(--text-3); font-size: 13px; min-height: 1em; }
.busy-bar { margin-top: 14px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.busy-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width .3s; }
.busy.indeterminate .busy-fill { width: 35% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.pen-loader svg { overflow: visible; }
.pen-loader rect { fill: none; stroke-width: 2.5; }
.pl-r1 { stroke: var(--a1); } .pl-r2 { stroke: var(--a2); } .pl-r3 { stroke: #fff; }
.pl-path { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; stroke-dasharray: 90; stroke-dashoffset: 90; animation: plDraw 1.6s ease-in-out infinite; }
.pl-pen { fill: #fff; animation: plPen 1.6s ease-in-out infinite; offset-path: path('M4 58 C 20 40, 44 64, 60 6'); }
@keyframes plDraw { 0% { stroke-dashoffset: 90; } 70%, 100% { stroke-dashoffset: 0; } }
@keyframes plPen { 0% { offset-distance: 0%; } 70%, 100% { offset-distance: 100%; } }
.pen-loader rect { animation: plRect 1.6s ease-in-out infinite; transform-box: fill-box; }
.pl-r2 { animation-delay: .15s; } .pl-r3 { animation-delay: .3s; }
@keyframes plRect { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(2px, -2px); } }
@media (prefers-reduced-motion: reduce) { .pl-path, .pl-pen, .pen-loader rect, .busy.indeterminate .busy-fill { animation: none; } .pl-path { stroke-dashoffset: 0; } }

/* ---------- Marching ants ---------- */
.ants { background-image: linear-gradient(90deg, #fff 50%, #000 50%), linear-gradient(90deg, #fff 50%, #000 50%), linear-gradient(0deg, #fff 50%, #000 50%), linear-gradient(0deg, #fff 50%, #000 50%); background-repeat: repeat-x, repeat-x, repeat-y, repeat-y; background-size: 8px 1px, 8px 1px, 1px 8px, 1px 8px; background-position: 0 0, 0 100%, 0 0, 100% 0; animation: ants .6s linear infinite; }
@keyframes ants { to { background-position: 16px 0, -16px 100%, 0 -16px, 100% 16px; } }
@media (prefers-reduced-motion: reduce) { .ants { animation: none; } }

.checker { background-color: #2A2C2E; background-image: linear-gradient(45deg, #3a3c3f 25%, transparent 25%), linear-gradient(-45deg, #3a3c3f 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #3a3c3f 75%), linear-gradient(-45deg, transparent 75%, #3a3c3f 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.checker-dark { background-color: #2A2C2E; }
.busy-skip { margin-top: 16px; }
.busy-skip[hidden] { display: none; }
.bg-chip { position: fixed; left: 20px; bottom: 20px; z-index: 260; padding: 9px 14px; border-radius: 999px; background: rgba(20, 23, 30, .92); border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: all .25s var(--ease); pointer-events: none; }
.bg-chip.show { opacity: 1; transform: none; }
.busy-eta { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--text-1, #fff); min-height: 1.2em; font-variant-numeric: tabular-nums; }
