/* Blotter — design system. Tokens first, then layout, content components, app chrome, admin. */
:root {
  --accent: #6c5ce7;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --bg: #07070d;
  --bg-2: #0d0d18;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --solid: #12121f;
  --border: rgba(255, 255, 255, .1);
  --text: #eceef7;
  --muted: #9aa0b8;
  --ok: #34d399; --warn: #fbbf24; --danger: #f87171;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
  --radius: 18px;
  --font: Inter, "SF Pro Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --nav-h: 68px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f6fb; --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .72); --surface-2: rgba(20, 22, 50, .06);
  --solid: #ffffff;
  --border: rgba(20, 22, 50, .1);
  --text: #12142a; --muted: #5b6283;
  --shadow: 0 12px 40px -16px rgba(40, 40, 90, .25);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; position: relative; z-index: 1; }
img, video, svg { max-width: 100%; height: auto; }
a { color: color-mix(in srgb, var(--accent) 70%, var(--text)); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 55%, transparent); }
h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.025em; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--solid); padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ background */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bg-veil { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: color-mix(in srgb, var(--bg) 8%, transparent); }

/* ------------------------------------------------------------------- nav */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--nav-h); transition: background .3s, box-shadow .3s, border-color .3s;
  border-bottom: 1px solid transparent; }
.topbar.scrolled { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); border-color: var(--border); box-shadow: 0 8px 30px -20px rgba(0,0,0,.5); }
.topbar .inner { max-width: 1240px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand .logo-img { height: 32px; width: auto; max-width: 180px; object-fit: contain; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 20px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a, .nav .dd > a { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px; color: var(--muted);
  text-decoration: none; font-weight: 500; font-size: .95rem; transition: color .2s, background .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.dd { position: relative; }
.dd .menu { position: absolute; top: 100%; left: 0; min-width: 210px; padding: 8px; margin-top: 6px; border-radius: 16px; background: var(--solid);
  border: 1px solid var(--border); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s; }
.dd:hover .menu, .dd:focus-within .menu { opacity: 1; visibility: visible; transform: none; }
.dd .menu a { display: flex; width: 100%; border-radius: 10px; }
.actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: .2s; font: inherit; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.burger { display: none; }
.kbd { font: 600 .7rem var(--mono); padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.usermenu { position: relative; }
.usermenu .menu { right: 0; left: auto; }
.usermenu:hover .menu, .usermenu:focus-within .menu { opacity: 1; visibility: visible; transform: none; }
.menu .who { padding: 10px 14px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; font-size: .85rem; }
.menu .who small { display: block; color: var(--muted); }
.menu button.linklike { all: unset; box-sizing: border-box; display: flex; width: 100%; padding: 8px 14px; border-radius: 10px; color: var(--muted); cursor: pointer; font-weight: 500; font-size: .95rem; }
.menu button.linklike:hover { background: var(--surface-2); color: var(--text); }

/* --------------------------------------------------------------- buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 600 .95rem var(--font); cursor: pointer; text-decoration: none; transition: transform .18s, box-shadow .2s, background .2s; }
.btn { box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 10px -4px rgba(0, 0, 0, .35); }
.btn:hover { transform: translateY(-1px); color: var(--text); background: color-mix(in srgb, var(--surface-2) 70%, var(--accent) 12%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 10px 20px -6px rgba(0, 0, 0, .4); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.btn.primary { background: var(--accent); border-color: color-mix(in srgb, var(--accent) 80%, #000); color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 18px -6px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn.primary:hover { color: #fff; background: color-mix(in srgb, var(--accent) 88%, #fff);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 26px -8px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn.primary:active { background: color-mix(in srgb, var(--accent) 88%, #000); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { box-shadow: none; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 14px; font-size: .85rem; }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------- page content */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 780px; }
.page-head { padding: 72px 0 24px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-head p { color: var(--muted); font-size: 1.2rem; max-width: 640px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.badge.public { color: var(--ok); } .badge.private { color: var(--accent-2); } .badge.support { color: var(--warn); } .badge.system { color: var(--accent-3); }
.prose { font-size: 1.06rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.9rem; margin-top: 2em; } .prose h3 { font-size: 1.35rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; } .prose li { margin: .3em 0; }
.prose blockquote { margin-left: 0; padding: .4em 1.2em; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--muted); }
.prose code { font: .88em var(--mono); background: var(--surface-2); padding: .15em .45em; border-radius: 6px; }
.prose pre { background: var(--solid); border: 1px solid var(--border); padding: 18px; border-radius: 14px; overflow: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 14px; }
.prose table, .table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td, .table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.prose th, .table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.admonition { padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.admonition-title { font-weight: 700; margin: 0 0 4px; }
.admonition.warning { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.admonition.note { border-color: color-mix(in srgb, var(--accent-2) 50%, transparent); }

/* Sections authors can drop into HTML pages */
.section { padding: 96px 0; position: relative; }
.section.tight { padding: 56px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 14px; }
.hero { padding: 120px 0 100px; text-align: center; }
.hero h1 { font-size: clamp(2.8rem, 7.5vw, 5.8rem); letter-spacing: -.045em; line-height: 1.02; max-width: 18ch; margin: 0 auto 24px; }
.hero p.lead { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--muted); max-width: 640px; margin: 0 auto 36px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .pill { display: inline-flex; gap: 10px; align-items: center; padding: 6px 14px 6px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  backdrop-filter: blur(10px); font-size: .85rem; color: var(--muted); margin-bottom: 28px; }
.hero .pill b { background: var(--accent); color: #fff; padding: 2px 9px; border-radius: 999px; font-size: .72rem; }
.accent-text { color: color-mix(in srgb, var(--accent) 65%, var(--text)); }
}
.hero-media { margin: 72px auto 0; max-width: 1000px; border-radius: 24px; border: 1px solid var(--border); background: var(--surface); padding: 10px;
  box-shadow: 0 40px 100px -30px color-mix(in srgb, var(--accent) 55%, transparent); }
.hero-media img { display: block; width: 100%; border-radius: 16px; }
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s; position: relative; overflow: hidden; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--accent) 60%, transparent); }
.card h3 { font-size: 1.2rem; margin-bottom: .4em; } .card p { color: var(--muted); margin: 0; }
.card .ico { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 18%, transparent); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 18px; }
a.card { text-decoration: none; color: inherit; display: block; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; text-align: center; }
.stats.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats b { display: block; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.04em; color: color-mix(in srgb, var(--accent) 65%, var(--text)); }
.stats span { color: var(--muted); font-size: .95rem; }
.price { text-align: left; }
.price .amt { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; } .price .amt small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 20px 0 28px; } .price li { padding: 7px 0 7px 28px; position: relative; color: var(--muted); }
.price li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.price.featured { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.quote p { font-size: 1.1rem; color: var(--text); } .quote footer { margin-top: 18px; color: var(--muted); font-size: .9rem; }
.cta { text-align: center; padding: 72px 28px; border-radius: 32px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cta h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); } .cta p { color: var(--muted); max-width: 520px; margin: 0 auto 28px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 22px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent-2); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 0 0; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; border: 1px solid var(--border); transition: transform .4s; }
.gallery img:hover { transform: scale(1.02); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }

/* reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

/* ------------------------------------------------------ page action pill */
.page-actions { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; display: flex; gap: 2px; padding: 5px; border-radius: 999px;
  background: color-mix(in srgb, var(--solid) 82%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--border); box-shadow: var(--shadow); }
.page-actions button, .page-actions a { white-space: nowrap; all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font: 600 .85rem var(--font); color: var(--text); }
.page-actions button:hover, .page-actions a:hover { background: var(--surface-2); }
.page-actions svg { width: 16px; height: 16px; }

/* ----------------------------------------------------------------- footer */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); margin-top: 80px; padding: 56px 0 120px; color: var(--muted); font-size: .92rem;
  background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(10px); }
.footer .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 40px; }
.footer h4 { color: var(--text); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }
.footer a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; } .footer a:hover { color: var(--text); }
.footer .legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------ overlays & forms */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(4, 4, 12, .55); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: .25s; }
.overlay.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 90; background: var(--solid); border-left: 1px solid var(--border);
  transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.open { transform: none; }
.drawer header { padding: 18px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.drawer header h2 { font-size: 1.1rem; margin: 0; flex: 1; }
.drawer .body { padding: 20px; overflow: auto; flex: 1; }
.drawer .topic-link { display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid transparent; }
.drawer .topic-link:hover { background: var(--surface-2); border-color: var(--border); }
.drawer .topic-link small { display: block; color: var(--muted); }
.drawer .cat { margin: 18px 0 6px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.palette { position: fixed; top: 12vh; left: 50%; transform: translate(-50%, -10px) scale(.98); width: min(640px, calc(100vw - 32px)); z-index: 95; background: var(--solid);
  border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: .2s; overflow: hidden; }
.palette.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); padding: 20px 22px; font: 500 1.1rem var(--font); outline: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.palette li a { display: block; padding: 11px 14px; border-radius: 12px; text-decoration: none; color: var(--text); }
.palette li a small { color: var(--muted); display: block; font-size: .85rem; }
.palette li.sel a, .palette li a:hover { background: var(--surface-2); }
.palette .empty { padding: 28px; text-align: center; color: var(--muted); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: var(--solid); border: 1px solid var(--border); border-left: 3px solid var(--ok); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  animation: toast-in .35s cubic-bezier(.2,.8,.2,1); max-width: 360px; font-size: .92rem; }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.field { display: grid; gap: 6px; margin-bottom: 16px; } .field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 400 .98rem var(--font); transition: border-color .2s, box-shadow .2s; }
textarea { font-family: var(--mono); font-size: .88rem; line-height: 1.55; min-height: 280px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
select option { background: var(--solid); color: var(--text); }
.check { display: flex; gap: 10px; align-items: center; font-size: .92rem; color: var(--muted); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: .92rem; }

/* ------------------------------------------------------------ auth shell */
.auth { min-height: calc(100vh - var(--nav-h) - 120px); display: grid; place-items: center; padding: 40px 20px; }
.auth .panel { width: min(440px, 100%); padding: 40px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: var(--shadow); }
.auth h1 { font-size: 2rem; } .auth p.sub { color: var(--muted); margin-bottom: 28px; }
.error-page { text-align: center; padding: 140px 0 40px; } .error-page .code { font-size: clamp(5rem, 16vw, 10rem); font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.help-search { max-width: 560px; margin: 28px 0 0; }

/* ------------------------------------------------------- admin & manager */
.app { max-width: 1320px; margin: 0 auto; padding: 32px 24px 0; display: grid; grid-template-columns: 230px 1fr; gap: 32px; }
.side { position: sticky; top: calc(var(--nav-h) + 16px); align-self: start; display: grid; gap: 4px; }
.side a { padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 500; display: flex; gap: 10px; align-items: center; }
.side a:hover, .side a.active { background: var(--surface-2); color: var(--text); }
.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.app h1 { font-size: 1.9rem; } .toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .grow { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi b { display: block; font-size: 2.2rem; letter-spacing: -.04em; } .kpi span { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; }
.table tr:hover td { background: var(--surface); }
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(4,4,12,.6); backdrop-filter: blur(6px); }
.modal.open { display: grid; } .modal .box { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--solid); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); animation: toast-in .3s; }
.modal.wide .box { width: min(980px, 100%); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; } .tabs button { all: unset; cursor: pointer; padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs button.active { background: var(--surface-2); color: var(--text); }
.mm { display: grid; grid-template-columns: 1fr; gap: 16px; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.tile { position: relative; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; cursor: pointer; transition: .2s; display: flex; flex-direction: column; }
.tile:hover, .tile.sel { border-color: var(--accent); transform: translateY(-2px); }
.tile .thumb { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--surface-2); font-size: 2.2rem; overflow: hidden; }
.tile .thumb img, .tile .thumb video { width: 100%; height: 100%; object-fit: cover; }
.tile .meta { padding: 10px 12px; font-size: .82rem; } .tile .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tile .meta span { color: var(--muted); }
.dropzone { border: 2px dashed var(--border); border-radius: 20px; padding: 22px; text-align: center; color: var(--muted); transition: .2s; }
.dropzone.over { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 10%, transparent); color: var(--text); }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 10px; } .progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.detail { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.preview-box { border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; min-height: 260px; overflow: hidden; }
.preview-box img, .preview-box video { max-width: 100%; max-height: 420px; }
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.token { font: .85rem var(--mono); word-break: break-all; padding: 12px; border-radius: 12px; background: var(--surface-2); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 980px) {
  .grid.cols-3, .grid.cols-4, .stats, .stats.cols-3, .kpis { grid-template-columns: repeat(2, 1fr); }
  .split, .detail { grid-template-columns: 1fr; gap: 28px; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; } .side { position: static; display: flex; overflow-x: auto; }
}
@media (max-width: 820px) {
  .burger { display: grid; }
  .nav { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; padding: 14px 20px 24px; gap: 2px; background: var(--solid);
    border-bottom: 1px solid var(--border); transform: translateY(-120%); transition: transform .3s cubic-bezier(.2,.8,.2,1); max-height: calc(100vh - var(--nav-h)); overflow: auto; }
  .nav.open { transform: none; }
  .nav a { padding: 14px 16px; font-size: 1.05rem; }
  .dd .menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 14px; margin: 0; }
  .topbar .inner { gap: 10px; } .brand { flex: 1; } .actions .kbd { display: none; }
}
@media (max-width: 620px) {
  .actions [data-open-help], .page-actions a { display: none; } .page-actions { max-width: calc(100vw - 24px); }
  .page-actions button { white-space: nowrap; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .stats, .stats.cols-3, .kpis, .row2, .row3 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; } .hero { padding: 72px 0 60px; } .container { padding: 0 16px; }
  .footer .cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
@media print { #bg, .bg-veil, .topbar, .footer, .page-actions, .drawer { display: none !important; } body { background: #fff; color: #000; } }
