/* ==========================================================================
   HostAura Images — design system
   Tokens → base → components → app shell → marketing → docs → pages
   ========================================================================== */

:root {
  --font: "Schibsted Grotesk", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #16181d;
  --ink-2: #3b404a;
  --muted: #6a707b;
  --faint: #98a0ab;
  --line: rgba(22, 24, 29, .09);
  --line-strong: rgba(22, 24, 29, .16);

  --accent: #0f766e;
  --accent-strong: #0b5c56;
  --accent-soft: #e4f3f1;
  --ok: #17794f;   --ok-soft: #e5f4ec;
  --warn: #9a6408; --warn-soft: #fbf1dc;
  --danger: #b4321f; --danger-soft: #fbe9e6;
  --info: #2450a8; --info-soft: #e8eefb;

  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(22, 24, 29, .05);
  --sh-2: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 20px -10px rgba(22, 24, 29, .14);
  --sh-3: 0 2px 4px rgba(22, 24, 29, .05), 0 24px 48px -20px rgba(22, 24, 29, .28);
  --glass-bg: rgba(255, 255, 255, .72);
  --glass-blur: blur(18px) saturate(150%);

  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14.5px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 40px; --fs-4xl: 56px;
  --sidebar-w: 248px; --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.55; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; min-height: 100vh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(56rem 34rem at 88% -8%, rgba(15, 118, 110, .07), transparent 62%),
    radial-gradient(48rem 30rem at -8% 108%, rgba(90, 105, 160, .06), transparent 62%);
}
img, svg { max-width: 100%; }
img { display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--ink); }
p { margin: 0 0 .9em; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
code { background: rgba(22, 24, 29, .05); padding: .12em .38em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 12px; }
.container { width: min(1160px, 100% - 48px); margin-inline: auto; }
.container-narrow { width: min(720px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.mono { font-family: var(--mono); }
.break { word-break: break-all; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.text-danger { color: var(--danger); }
.flip { transform: scaleX(-1); }
.ic { flex: none; vertical-align: middle; }
.link-sm { font-size: var(--fs-sm); font-weight: 500; }
.glass { background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px var(--line), var(--sh-2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid transparent;
  border-radius: var(--r-sm); font-weight: 550; font-size: var(--fs-base); line-height: 1; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease), color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--sh-1), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: #2a2e37; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-1); }
.btn-secondary:hover { background: var(--surface-2); border-color: rgba(22, 24, 29, .26); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(22, 24, 29, .06); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #99281a; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); gap: 6px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: var(--fs-xs); gap: 5px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: var(--fs-md); border-radius: 10px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.btn-row-tight { gap: 6px; margin-top: 8px; }
.btn-row-center { justify-content: center; }
.btn.is-done { background: var(--ok-soft) !important; border-color: transparent !important; color: var(--ok) !important; }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2); padding: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s; font-size: var(--fs-base);
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a707b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: rgba(22, 24, 29, .28); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .16); }
.input.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(180, 50, 31, .1); }
.input[readonly] { background: var(--surface-2); }
.hint { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.field-error { font-size: var(--fs-sm); color: var(--danger); margin: 0; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-btn { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; }
.input-btn:hover { background: rgba(22, 24, 29, .06); color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-base); cursor: pointer; color: var(--ink-2); }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); display: grid; place-content: center; cursor: pointer; transition: .15s; }
.check input::after { content: ""; width: 10px; height: 10px; transform: scale(0); background: #fff; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); transition: transform .12s var(--ease); }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { transform: scale(1); }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.switch-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: rgba(22, 24, 29, .18); border-radius: var(--r-pill); transition: background .18s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .18s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; background: rgba(22, 24, 29, .06); border-radius: 10px; gap: 2px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 7px 12px; text-align: center; font-size: var(--fs-sm); font-weight: 550; color: var(--muted); border-radius: 7px; white-space: nowrap; transition: .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.segmented-sm span { padding: 5px 12px; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 3px; border-radius: 3px; background: rgba(22, 24, 29, .1); transition: background .2s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] i:nth-child(-n+3) { background: #5b9b3a; }
.strength[data-level="4"] i { background: var(--ok); }
.copy-field { display: flex; align-items: center; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }
.copy-label { display: none; }
.copy-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.copy-stack .copy-label { display: block; font-size: var(--fs-xs); color: var(--muted); min-width: 68px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 260px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .select { width: auto; min-width: 140px; }
.toolbar-inset { padding: 0 20px 14px; margin: 0; }
.search-field { position: relative; flex: 1 1 240px; max-width: 360px; }
.search-field .ic { position: absolute; left: 12px; top: 12px; color: var(--faint); pointer-events: none; }
.search-field .input { padding-left: 36px; }
.restriction-pane { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
fieldset.field .segmented { width: 100%; }
.secret-box { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 1px dashed var(--line-strong); background: var(--surface-2); border-radius: var(--r-sm); }
.secret-box code { flex: 1; background: none; padding: 0; word-break: break-all; font-size: 13px; user-select: all; }

/* ---------- Badges, alerts, tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; font-size: var(--fs-xs); font-weight: 600; border-radius: var(--r-pill); background: rgba(22, 24, 29, .06); color: var(--ink-2); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: rgba(22, 24, 29, .06); color: var(--muted); }
.pill { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--danger); color: #fff; padding: 1px 7px; border-radius: var(--r-pill); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: var(--r-md); border: 1px solid; font-size: var(--fs-base); }
.alert .ic { margin-top: 2px; }
.alert-info { background: var(--info-soft); border-color: rgba(36, 80, 168, .16); color: #1d3f86; }
.alert-warn { background: var(--warn-soft); border-color: rgba(154, 100, 8, .2); color: #6f4705; }
.alert-danger { background: var(--danger-soft); border-color: rgba(180, 50, 31, .2); color: #8a2314; }
.alert-success { background: var(--ok-soft); border-color: rgba(23, 121, 79, .2); color: #105a3a; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-size: var(--fs-xs); border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.method { display: inline-block; min-width: 46px; text-align: center; font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.method-get { background: var(--info-soft); color: var(--info); }
.method-post { background: var(--ok-soft); color: var(--ok); }
.method-delete { background: var(--danger-soft); color: var(--danger); }
.ep { background: none; padding: 0; color: var(--ink-2); }

/* ---------- Panels, stats, tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.panel-title { font-size: var(--fs-md); font-weight: 600; }
.panel-body { padding: 16px 20px 20px; }
.panel-foot { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.panel-head + .table-wrap, .panel-head + .feed { margin-top: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px 18px; box-shadow: var(--sh-1); min-width: 0; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.stat-label { font-size: var(--fs-sm); font-weight: 500; }
.stat-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-note { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.stat .progress { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2-tight { align-items: stretch; }
.progress { height: 6px; border-radius: 6px; background: rgba(22, 24, 29, .08); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .5s var(--ease); }
.progress.warn span { background: #d4901a; } .progress.danger span { background: var(--danger); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 550; font-size: var(--fs-xs); color: var(--muted); padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(22, 24, 29, .018); }
.table .num { text-align: right; }
.table-plain th { background: none; width: 130px; color: var(--ink-2); }
.table-plain td, .table-plain th { padding-left: 0; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions form { display: inline; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed li > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.feed li strong { font-weight: 550; font-size: var(--fs-base); }
.feed li .muted { font-size: var(--fs-sm); }
.feed-end { display: flex; align-items: center; gap: 10px; flex: none; }
.feed-roomy li { padding: 16px 20px; }
.meta-list { margin: 0 0 12px; display: grid; gap: 0; }
.meta-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--muted); flex: none; }
.meta-list dd { margin: 0; text-align: right; word-break: break-all; font-weight: 500; }
.big-figure { font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-bottom: 12px; }
.big-figure .muted { font-size: var(--fs-md); font-weight: 400; letter-spacing: 0; }
.sub-title { font-size: var(--fs-sm); font-weight: 600; margin: 22px 0 10px; }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; align-items: center; gap: 12px; font-size: var(--fs-sm); }
.bar-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 6px; background: rgba(22, 24, 29, .07); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.pre-block { margin: 6px 0 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 260px; overflow: auto; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.tip-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; font-size: var(--fs-sm); color: var(--ink-2); }
.tip-list li { display: flex; gap: 10px; align-items: flex-start; }
.tip-list .ic { color: var(--accent); margin-top: 2px; }

/* ---------- Empty, skeleton, pagination ---------- */
.empty { text-align: center; padding: 34px 20px; max-width: 420px; margin: 0 auto; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.empty h3 { font-size: var(--fs-md); margin-bottom: 4px; }
.empty p { color: var(--muted); margin-bottom: 0; }
.empty .btn-row { justify-content: center; }
.img-skel, .skel { position: relative; display: block; overflow: hidden; background: #eceef1; }
.img-skel::after, .skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .7) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
.img-skel.is-loaded::after { display: none; }
.img-skel img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.img-skel.is-loaded img { opacity: 1; }
@keyframes shimmer { to { transform: translateX(100%); } }
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 20px 0; }
.page-link { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2); border: 1px solid transparent; }
a.page-link:hover { background: rgba(22, 24, 29, .06); text-decoration: none; }
.page-link.is-current { background: var(--ink); color: #fff; }
.page-link.is-disabled { color: var(--faint); }
.page-gap { color: var(--faint); padding: 0 4px; }
.panel-foot .pagination { margin: 0; width: 100%; }

/* ---------- Modal, dropdown, toasts ---------- */
dialog.modal {
  padding: 0; border: 1px solid rgba(255, 255, 255, .6); border-radius: 18px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--sh-3); overflow: auto;
}
dialog.modal[open] { animation: pop .22s var(--ease); }
dialog.modal::backdrop { background: rgba(22, 24, 29, .34); backdrop-filter: blur(3px); }
dialog.modal-sm { width: min(400px, calc(100vw - 24px)); }
dialog.modal-lg { width: min(880px, calc(100vw - 24px)); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-title { font-size: var(--fs-lg); font-weight: 600; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(250, 251, 252, .8); }
.modal-sm .modal-body { padding-top: 22px; }
.modal-sm .modal-title { margin-bottom: 8px; }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px; padding: 6px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-3); animation: pop .16s var(--ease); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font-size: var(--fs-base); color: var(--ink-2); cursor: pointer; text-align: left; text-decoration: none; }
.menu a:hover, .menu button:hover { background: rgba(22, 24, 29, .06); color: var(--ink); text-decoration: none; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: var(--fs-sm); }
.menu-head strong { font-size: var(--fs-base); }
.menu-notes { width: min(340px, calc(100vw - 24px)); max-height: 420px; overflow: auto; }
.note { display: flex; flex-direction: column; gap: 1px; padding: 10px; border-radius: 8px; font-size: var(--fs-sm); color: var(--ink-2); text-decoration: none; }
a.note:hover { background: rgba(22, 24, 29, .05); text-decoration: none; }
.note strong { color: var(--ink); font-weight: 550; }
.note small { color: var(--faint); }
.note.is-unread { background: var(--accent-soft); }
.menu-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px; color: var(--muted); font-size: var(--fs-sm); }
.toasts { position: fixed; z-index: 300; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: var(--sh-3); font-size: var(--fs-base); animation: toast-in .28s var(--ease); }
.toast .ic { margin-top: 2px; flex: none; }
.toast-success .ic { color: #6ee0b1; } .toast-error .ic { color: #ff9a8b; } .toast-info .ic { color: #9bc0ff; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Tabs, code ---------- */
.tabs-nav { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs-nav a { padding: 10px 14px; font-size: var(--fs-base); font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs-nav a:hover { color: var(--ink); text-decoration: none; }
.tabs-nav a.is-active { color: var(--ink); border-color: var(--ink); }
.settings-pane { max-width: 760px; }
.tablist { display: flex; gap: 2px; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font-size: var(--fs-sm); font-weight: 550; color: #9aa3b2; cursor: pointer; transition: .15s; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: #fff; }
.codeblock { background: #14171c; border-radius: var(--r-md); overflow: hidden; margin: 14px 0; box-shadow: var(--sh-2); text-align: left; }
.codeblock-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.codeblock-title { font-size: var(--fs-xs); color: #8b93a1; font-family: var(--mono); }
.codeblock .btn-ghost { color: #9aa3b2; }
.codeblock .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: #d7dce4; font-size: 13px; line-height: 1.65; tab-size: 2; }
.codeblock pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.tk-c { color: #6b7686; font-style: italic; } .tk-s { color: #8fd7b3; } .tk-n { color: #f0b978; } .tk-k { color: #8ab4f8; } .tk-f { color: #e9a3c9; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark, .brand-logo { flex: none; border-radius: 8px; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 70; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-right: 1px solid var(--line); }
.sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 16px 12px; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 18px; }
.drawer-close, .menu-btn { display: none; }
.admin-tag { margin: -6px 8px 10px; font-size: var(--fs-xs); color: var(--accent); font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: var(--fs-base); transition: background .15s, color .15s; }
.side-nav a:hover { background: rgba(22, 24, 29, .05); color: var(--ink); text-decoration: none; }
.side-nav a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.side-nav a.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.side-nav a.is-active .ic { color: var(--accent); }
.side-sep { height: 1px; background: var(--line); margin: 10px 6px; }
.side-foot { margin-top: auto; padding: 14px 8px 4px; }
.side-storage { font-size: var(--fs-xs); color: var(--muted); }
.side-storage-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.side-back { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.scrim { display: none; position: fixed; inset: 0; z-index: 65; background: rgba(22, 24, 29, .38); backdrop-filter: blur(2px); }
.shell-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); }
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; height: var(--topbar-h); padding: 0 28px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--line); }
.topbar-search { position: relative; flex: 1; max-width: 400px; }
.topbar-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.topbar-search input { width: 100%; height: 36px; padding: 0 12px 0 36px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .7); transition: .15s; }
.topbar-search input:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
.topbar-title { font-weight: 600; font-size: var(--fs-md); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }
.content { padding: 28px 28px 56px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.03em; }
.page-sub { color: var(--muted); margin: 6px 0 0; max-width: 620px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bottom-nav { display: none; }

/* ---------- Dashboard pieces ---------- */
.chart { position: relative; height: 190px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: rgba(22, 24, 29, .07); stroke-width: 1; }
.chart-bar { fill: var(--accent); opacity: .85; transition: opacity .15s; }
.chart-bar:hover, .chart-bar.is-hot { opacity: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--accent); opacity: .08; }
.chart-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.chart-label { font-size: 10.5px; fill: var(--faint); font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; transition: opacity .12s; z-index: 2; }
.chart-tip.is-on { opacity: 1; }
.thumb-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.thumb { display: block; color: var(--ink); }
.thumb:hover { text-decoration: none; }
.thumb .img-skel { aspect-ratio: 1; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.thumb-cap { display: block; margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo { display: flex; gap: 16px; align-items: flex-start; padding: 20px; border-radius: var(--r-lg); border: 1px solid rgba(15, 118, 110, .16); background: linear-gradient(180deg, rgba(228, 243, 241, .7), rgba(255, 255, 255, .7)); backdrop-filter: blur(8px); }
.promo h3 { font-size: var(--fs-md); margin-bottom: 4px; }
.promo p { color: var(--ink-2); margin-bottom: 12px; font-size: var(--fs-sm); max-width: 520px; }
.promo-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.panel-start { border-color: rgba(15, 118, 110, .2); }
.start-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 28px; align-items: center; padding-top: 22px; }
.start-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.start-steps a { display: flex; flex-direction: column; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); background: var(--surface-2); transition: .15s; }
.start-steps a:hover { border-color: var(--accent); background: #fff; text-decoration: none; }
.start-steps span { color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Upload ---------- */
.upload-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.upload-layout .panel { margin-bottom: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 240px; padding: 32px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-art { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line), var(--sh-2); transition: transform .2s var(--ease); }
.dropzone.is-over .dropzone-art { transform: translateY(-4px); }
.dropzone-title { font-size: var(--fs-md); font-weight: 550; margin: 0 0 4px; }
.dz-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dropzone-hint { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.queue { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.q-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.q-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #eceef1; }
.q-main { min-width: 0; }
.q-name { font-weight: 550; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta { font-size: var(--fs-xs); color: var(--muted); }
.q-item .progress { margin-top: 6px; height: 4px; }
.q-item.is-error .q-meta { color: var(--danger); }
.q-item.is-done .progress { display: none; }
.results { display: grid; gap: 16px; margin-top: 20px; }
.result { display: grid; grid-template-columns: 220px 1fr; overflow: hidden; margin: 0; }
.result-preview .img-skel { height: 100%; min-height: 160px; }
.result-body { padding: 16px 18px; min-width: 0; }
.result-name { font-size: var(--fs-md); word-break: break-word; }

/* ---------- Image library ---------- */
.view-toggle { display: inline-flex; padding: 3px; background: rgba(22, 24, 29, .06); border-radius: 10px; margin-left: auto; }
.view-toggle button { width: 32px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--muted); cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.select-all { margin-bottom: 12px; font-size: var(--fs-sm); }
.bulk-bar { position: sticky; top: calc(var(--topbar-h) + 10px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; margin-bottom: 14px; background: var(--ink); color: #fff; border-radius: 12px; box-shadow: var(--sh-3); }
.bulk-bar .btn-ghost { color: #cfd5de; } .bulk-bar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.image-collection.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.img-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); transition: box-shadow .2s, transform .2s var(--ease); }
.img-card:hover { box-shadow: var(--sh-2); }
.img-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.img-open .img-skel { aspect-ratio: 4 / 3; }
.img-check { position: absolute; top: 10px; left: 10px; z-index: 3; padding: 4px; border-radius: 7px; background: rgba(255, 255, 255, .9); box-shadow: var(--sh-1); opacity: 0; transition: opacity .15s; }
.img-card:hover .img-check, .img-card:focus-within .img-check, .img-card.is-selected .img-check, .has-selection .img-check { opacity: 1; }
.img-check input { display: block; width: 18px; height: 18px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.img-card.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.img-info { padding: 10px 12px 4px; min-width: 0; }
.img-name { font-weight: 550; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); }
.img-actions { display: flex; gap: 2px; padding: 4px 8px 8px; }
.image-collection.is-list { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.is-list .img-card { flex-direction: row; align-items: center; gap: 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: 8px 12px 8px 44px; }
.is-list .img-card:last-child { border-bottom: 0; }
.is-list .img-open { width: 56px; flex: none; }
.is-list .img-open .img-skel { aspect-ratio: 1; border-radius: 8px; }
.is-list .img-info { flex: 1; padding: 0; }
.is-list .img-actions { padding: 0; }
.is-list .img-check { top: 50%; left: 12px; transform: translateY(-50%); opacity: 1; }
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.detail-preview .img-skel { border-radius: var(--r-md); min-height: 220px; max-height: 420px; box-shadow: 0 0 0 1px var(--line); }
.detail-preview .img-skel img { object-fit: contain; max-height: 420px; }

/* ---------- API keys & webhooks ---------- */
.key-list, .hook-list { display: grid; gap: 14px; margin-top: 4px; }
.key-item { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) auto; gap: 24px; align-items: center; padding: 18px 20px; margin: 0; }
.key-item.is-off, .hook.is-off { background: var(--surface-2); }
.key-item.is-off .key-title h2, .key-item.is-off .key-mask { color: var(--muted); }
.key-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.key-title h2 { font-size: var(--fs-md); }
.key-mask { display: inline-block; margin: 6px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.key-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.key-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 20px; margin: 0; }
.key-stats dt { font-size: var(--fs-xs); color: var(--muted); }
.key-stats dd { margin: 2px 0 0; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.key-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.key-actions form { display: inline; }
.hook { scroll-margin-top: 84px; }
.hook-title { display: flex; align-items: center; gap: 10px; }
.hook-fields { display: grid; gap: 16px; }
.hook .btn-row form { display: inline; }
.hook:target { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: minmax(360px, 5fr) 6fr; min-height: 100vh; }
.auth-side { position: relative; display: flex; align-items: center; padding: 48px; background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .42)); border-right: 1px solid var(--line); color: var(--ink-2); overflow: hidden; }
.auth-side-inner { position: relative; max-width: 380px; }
.auth-side h2 { font-size: 34px; letter-spacing: -.03em; margin: 44px 0 22px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.auth-points li { display: flex; gap: 12px; color: var(--ink-2); }
.auth-points .ic { color: var(--accent); margin-top: 3px; }
.auth-note { margin: 36px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: min(440px, 100%); padding: 34px; border-radius: 20px; background: rgba(255, 255, 255, .86); }
.auth-card h1 { font-size: 26px; letter-spacing: -.03em; }
.auth-sub { margin: 6px 0 22px; }
.auth-mobile-brand { display: none; margin-bottom: 22px; }
.auth-alt { text-align: center; margin: 20px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.auth-legal { margin: 18px 0 0; font-size: var(--fs-xs); color: var(--muted); text-align: center; max-width: 380px; }
.auth-card > .alert { margin-top: 16px; }
.auth-card > h1 + .alert { margin-top: 18px; }

/* ---------- Error pages ---------- */
.plain { display: grid; place-items: center; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; width: 100%; }
.error-card { max-width: 440px; padding: 40px; border-radius: 22px; text-align: center; }
.error-code { font-size: 64px; font-weight: 700; letter-spacing: -.05em; margin: 0; color: var(--accent); line-height: 1; }
.error-card h1 { font-size: 22px; margin: 12px 0 8px; }
.error-card .btn-row { justify-content: center; }

/* ---------- Public image page ---------- */
.view { padding: 40px 0 72px; }
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.view-stage { margin: 0; padding: 14px; border-radius: 20px; display: grid; place-items: center; background: rgba(255, 255, 255, .6); }
.view-stage img { max-height: 76vh; width: auto; height: auto; border-radius: 12px; object-fit: contain; background: repeating-conic-gradient(#f0f1f3 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
.view-side { display: flex; flex-direction: column; gap: 14px; }
.view-title { font-size: var(--fs-xl); word-break: break-word; }
.view-side .btn-row { margin-top: 0; }

/* ---------- Marketing site ---------- */
.site-header { position: sticky; top: 0; z-index: 80; border: 0; border-bottom: 1px solid var(--line); box-shadow: none; border-radius: 0; }
.site-header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.site-nav { display: flex; gap: 4px; margin-left: 12px; }
.site-nav a { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current] { background: rgba(22, 24, 29, .05); color: var(--ink); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle { display: none; }
.hero { padding: 84px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6vw, var(--fs-4xl)); letter-spacing: -.045em; line-height: 1.02; font-weight: 650; }
.hero-sub { font-size: 22px; font-weight: 550; margin: 20px 0 10px; letter-spacing: -.02em; color: var(--ink); }
.hero-text { color: var(--muted); font-size: 17px; max-width: 520px; }
.hero-copy .btn-row { margin-top: 28px; }
.hero-fine { color: var(--muted); font-size: var(--fs-sm); margin: 18px 0 0; }
.hero-demo { border-radius: 20px; overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(22, 24, 29, .14); }
.demo-bar span { margin-left: 8px; }
.demo-body { padding: 18px; }
.demo-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 40px 20px; border: 1.5px dashed var(--line-strong); border-radius: 14px; cursor: pointer; background: rgba(255, 255, 255, .5); transition: .15s; font-size: var(--fs-sm); }
.demo-drop:hover, .demo-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.demo-drop strong { font-size: var(--fs-base); }
.demo-drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line), var(--sh-1); margin-bottom: 8px; }
.demo-result { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.demo-thumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #eceef1; box-shadow: 0 0 0 1px var(--line); }
.demo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.demo-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.demo-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-url { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; max-width: 100%; }
.demo-url code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.section { padding: 84px 0; }
.section-tint { background: rgba(255, 255, 255, .6); border-block: 1px solid var(--line); }
.section h2, .cta h2 { font-size: clamp(28px, 3.6vw, 38px); letter-spacing: -.035em; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head-left { margin: 0; text-align: left; }
.section-head p { margin: 10px 0 0; font-size: 17px; }
.split { display: grid; grid-template-columns: 1fr 1.5fr; gap: 72px; align-items: start; }
.split-head { position: sticky; top: 100px; }
.split-head p { margin-top: 12px; font-size: 17px; max-width: 340px; }
.feature-rows { list-style: none; margin: 0; padding: 0; }
.feature-rows li { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); }
.feature-rows li:first-child { border-top: 0; padding-top: 4px; }
.feature-rows h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.feature-rows p { color: var(--muted); margin: 0; max-width: 520px; }
.fr-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; top: 17px; left: 34px; right: 34px; height: 1px; background: var(--line-strong); }
.steps li { position: relative; }
.step-n { position: relative; display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 16px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 0 0 6px var(--bg); }
.section-tint .step-n { box-shadow: 0 0 0 6px #f9fafb; }
.steps h3 { font-size: var(--fs-md); margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: var(--fs-base); margin: 0; }
.api-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: center; }
.api-grid h2 { margin-bottom: 12px; }
.api-grid > div > p { font-size: 17px; }
.endpoint-list { list-style: none; margin: 22px 0 24px; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.endpoint-list li { display: grid; grid-template-columns: 62px auto 1fr; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.endpoint-list li:last-child { border-bottom: 0; }
.endpoint-list li > span:last-child { color: var(--muted); text-align: right; }
.endpoint-list code { background: none; padding: 0; }
.flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin: 18px 0 22px; }
.flow-node { flex: 1 1 130px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 2px; }
.flow-node strong { font-size: var(--fs-sm); }
.flow-node span { font-size: var(--fs-xs); color: var(--muted); }
.flow-optional { border-style: dashed; background: transparent; box-shadow: none; }
.flow-arrow { display: grid; place-items: center; color: var(--faint); }
.flow-large { justify-content: center; margin: 0 auto 28px; max-width: 960px; }
.flow-large .flow-node { padding: 18px 20px; }
.flow-large .flow-node strong { font-size: var(--fs-base); }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.chips li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.chips .ic { color: var(--accent); }
.doc-list { margin: 14px 0; padding-left: 1.2em; display: grid; gap: 8px; }
.mock { display: grid; grid-template-columns: 64px 1fr; max-width: 940px; margin: 0 auto; border-radius: 20px; overflow: hidden; min-height: 320px; }
.mock-side { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; border-right: 1px solid var(--line); background: rgba(255, 255, 255, .5); }
.mock-side b { width: 26px; height: 26px; border-radius: 8px; background: rgba(22, 24, 29, .07); }
.mock-side b.on { background: var(--ink); }
.mock-logo { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); margin-bottom: 8px; }
.mock-main { padding: 16px 20px 22px; }
.mock-top { display: flex; justify-content: space-between; margin-bottom: 16px; }
.mock-top span { width: 160px; height: 28px; border-radius: 8px; background: rgba(22, 24, 29, .06); }
.mock-top .mock-pill { width: 82px; background: var(--ink); }
.mock-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mock-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mock-stats small { display: block; color: var(--muted); font-size: 11px; }
.mock-stats strong { font-size: 20px; letter-spacing: -.03em; }
.mock-stats em { display: block; height: 4px; border-radius: 4px; background: rgba(22, 24, 29, .08); margin-top: 6px; }
.mock-stats u { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.mock-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px; margin-top: 10px; }
.mock-chart, .mock-list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 130px; }
.mock-chart svg { width: 100%; height: 100%; min-height: 100px; }
.mock-list { display: grid; gap: 10px; align-content: start; }
.mock-list span { height: 12px; border-radius: 6px; background: rgba(22, 24, 29, .07); }
.mock-list span:nth-child(2) { width: 70%; } .mock-list span:nth-child(3) { width: 85%; } .mock-list span:nth-child(4) { width: 55%; }
.limits { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; max-width: 980px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.limits > div { padding: 22px 22px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.limits > div:first-child { border-left: 0; }
.limits dt { font-size: var(--fs-sm); color: var(--muted); }
.limits dd { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.limits span { font-size: var(--fs-xs); color: var(--faint); }
.promo-wide { align-items: center; max-width: 900px; margin: 0 auto; padding: 24px 28px; }
.promo-wide .promo-copy { flex: 1; }
.promo-wide p { margin: 0; }
.promo-doc { margin: 48px 0 0; }
.faq-wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 64px; align-items: start; }
.faq { display: grid; }
.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 550; font-size: var(--fs-md); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 300; color: var(--muted); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 10px 0 0; color: var(--muted); max-width: 560px; }
.cta { padding: 20px 0 96px; }
.cta-inner { text-align: center; padding: 64px 24px; border-radius: 28px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 0 0 1px var(--line), var(--sh-2); }
.cta p { color: var(--muted); margin: 12px auto 0; max-width: 480px; font-size: 17px; }
.cta .btn-row { margin-top: 28px; }
.site-footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .6); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 40px; }
.footer-grid h4 { font-size: var(--fs-sm); margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--muted); padding: 4px 0; font-size: var(--fs-base); }
.footer-grid a:hover { color: var(--ink); }
.footer-brand p, .footer-note { color: var(--muted); font-size: var(--fs-sm); margin: 12px 0 0; max-width: 300px; }
.footer-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.prose-page { padding: 72px 0 96px; }
.prose-page h1 { font-size: 38px; letter-spacing: -.04em; margin-bottom: 10px; }
.prose-page h2 { font-size: var(--fs-xl); margin: 34px 0 10px; }
.prose-page p, .prose-page li { color: var(--ink-2); }
.prose-page .lead, .lead { font-size: 19px; color: var(--muted); }

/* ---------- Docs ---------- */
.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; padding: 40px 0 80px; align-items: start; }
.docs-nav { position: sticky; top: 88px; }
.docs-nav-inner { display: flex; flex-direction: column; gap: 1px; }
.docs-nav a { padding: 6px 12px; border-left: 2px solid var(--line); color: var(--muted); font-size: var(--fs-base); }
.docs-nav a:hover { color: var(--ink); text-decoration: none; }
.docs-nav a.is-active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.docs-nav-sep { height: 10px; }
.docs-body { max-width: 780px; min-width: 0; }
.docs-body section { padding-bottom: 44px; margin-bottom: 44px; border-bottom: 1px solid var(--line); }
.docs-body h1 { font-size: 38px; letter-spacing: -.04em; margin-bottom: 10px; }
.docs-body h2 { font-size: 26px; margin-bottom: 12px; }
.docs-body h3 { font-size: var(--fs-md); margin: 26px 0 8px; display: flex; align-items: center; gap: 10px; }
.docs-body .table { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); margin: 14px 0; display: table; }
.docs-body .table-plain { border: 0; background: none; }
.docs-body .table td, .docs-body .table th { padding: 10px 14px; vertical-align: top; }
.docs-body .table-plain td, .docs-body .table-plain th { padding: 10px 0; }
.docs-body section:last-of-type { border-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .key-item { grid-template-columns: 1fr; gap: 14px; }
  .key-actions { justify-content: flex-start; }
  .limits { grid-template-columns: repeat(3, 1fr); } .limits > div:nth-child(4) { border-left: 0; } .limits > div:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-102%); transition: transform .28s var(--ease); background: rgba(255, 255, 255, .96); width: min(300px, 86vw); box-shadow: var(--sh-3); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .scrim { display: block; }
  body.drawer-open { overflow: hidden; }
  .shell-main { margin-left: 0; }
  .menu-btn, .drawer-close { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 8px; }
  .content { padding: 22px 16px 40px; }
  .grid-2, .upload-layout, .detail-grid, .start-grid { grid-template-columns: 1fr; }
  .hero-grid, .api-grid, .split, .faq-wrap, .view-grid { grid-template-columns: 1fr; gap: 36px; }
  .split-head { position: static; }
  .steps { grid-template-columns: 1fr 1fr; } .steps::before { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .docs { grid-template-columns: 1fr; gap: 20px; }
  .docs-nav { position: sticky; top: 64px; z-index: 30; margin: 0 -24px; padding: 8px 24px; background: rgba(245, 246, 248, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .docs-nav-inner { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .docs-nav a { border: 0; white-space: nowrap; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 5px 12px; font-size: var(--fs-sm); }
  .docs-nav a.is-active { background: var(--ink); color: #fff; }
  .docs-nav-sep { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: block; }
  .site-nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; margin: 0; padding: 12px 20px 20px; background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); box-shadow: var(--sh-3); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s var(--ease); }
  .site-nav a { padding: 12px 10px; font-size: var(--fs-md); }
  body.nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
  .nav-toggle { display: inline-flex; }
  .site-header-inner { gap: 12px; }
}
@media (max-width: 720px) {
  :root { --fs-base: 15px; }
  .container, .container-narrow { width: calc(100% - 32px); }
  .content { padding-bottom: 96px; }
  .bottom-nav { position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--line); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; font-size: 11px; font-weight: 500; color: var(--muted); border-radius: 10px; cursor: pointer; text-decoration: none; }
  .bottom-nav a.is-active { color: var(--accent); }
  .bottom-nav a.is-fab { color: #fff; }
  .bottom-nav a.is-fab .ic { background: var(--ink); color: #fff; width: 40px; height: 40px; padding: 10px; border-radius: 14px; margin-top: -18px; box-shadow: var(--sh-3); }
  .bottom-nav a.is-fab span { color: var(--muted); }
  .toasts { right: 16px; left: 16px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .topbar-search { display: none; } .topbar-upload { display: none; }
  .topbar-right { margin-left: auto; }
  .page-title { font-size: 24px; }
  .stat-grid { gap: 10px; } .stat { padding: 14px; } .stat-value { font-size: 22px; }
  .hide-sm { display: none; }
  .table th, .table td { padding: 10px 12px; }
  .panel-head, .panel-body, .panel-foot, .feed li { padding-left: 16px; padding-right: 16px; }
  .result { grid-template-columns: 1fr; }
  .result-preview .img-skel { min-height: 200px; }
  .key-stats { grid-template-columns: 1fr 1fr; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 56px 0; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .limits { grid-template-columns: 1fr 1fr; } .limits > div { border-left: 0 !important; border-top: 1px solid var(--line); } .limits > div:nth-child(-n+2) { border-top: 0; }
  .promo-wide { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .mock { grid-template-columns: 1fr; } .mock-side { display: none; } .mock-stats { grid-template-columns: 1fr 1fr; } .mock-cols { grid-template-columns: 1fr; }
  .demo-result { grid-template-columns: 1fr; }
  .image-collection.is-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .img-check { opacity: 1; }
  .flow-arrow { display: none; }
  .view-grid { gap: 20px; } .view { padding-top: 20px; }
  .toolbar .select, .toolbar .search-field { flex: 1 1 140px; min-width: 0; max-width: none; }
  .view-toggle { margin-left: 0; }
  .auth-card { padding: 26px 20px; }
  .dz-desktop { display: none; }
  .endpoint-list li { grid-template-columns: 58px 1fr; } .endpoint-list li > span:last-child { display: none; }
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  dialog.modal[open] { animation: sheet .26s var(--ease); }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .copy-stack .copy-field { flex-wrap: wrap; } .copy-stack .copy-label { width: 100%; }
  .copy-field { flex-wrap: nowrap; }
}
@keyframes sheet { from { transform: translateY(24px); opacity: .6; } }
@media print { .sidebar, .topbar, .bottom-nav, .site-header, .site-footer, .toasts { display: none !important; } .shell-main { margin: 0; } }
