/* Kanalio editor look (editor.kanalio.app = @kanalio/ui kit, data-theme "blue"): Inter 13px UI, #f9f9fa / #121213
   page, cards with a hairline ring, pill buttons, Kanalio blue as the one accent. Light and dark follow
   <html data-mode>, set by theme.js (system by default). Values mirror support/web/packages/ui/src/styles/theme.css.
   The Aurora glow (DESIGN.md §3) sits behind the page, never on controls. */

@font-face { font-family: 'Inter'; src: url('/fonts/Inter-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --page: #f9f9fa;
  --card: #ffffff;
  --ink: oklch(0.145 0 0);
  --ink-2: #303032;
  --paper: #ffffff;
  --section: #efeff0;
  --surface: #ececed;
  --raised: #f5f5f6;
  --muted: #6b6b6b;
  --subtle: #a0a0a2;
  --border: #d8d8d8;
  --hairline: #e2e2e2;
  --destructive: #e2253b;
  --accent: #375afd;
  --accent-hover: #2f4fe6;
  --accent-text: #375afd;
  --accent-soft: #c5cfff;
  --accent-tint: #eef1ff;
  --ok: #16a34a;
  --warn: #d97706;
  --bar: #d6d6db;
  --bonus: #2bc9b4;
  --bar-active: #b9b9c0;
  --ring-line: rgb(0 0 0 / 0.09);
  --shadow-card: 0 0 0 1px rgb(0 0 0 / 0.07), 0 3px 6px -2px rgb(0 0 0 / 0.02), 0 1px 1px rgb(0 0 0 / 0.04);
  --shadow-btn: 0 0 0 1px rgb(0 0 0 / 0.09), 0 3px 6px -2px rgb(0 0 0 / 0.02), 0 1px 1px rgb(0 0 0 / 0.04);
  --shadow-pop: 0 6px 18px rgb(0 0 0 / 0.04), 0 3px 9px rgb(0 0 0 / 0.06), 0 1px 1px rgb(0 0 0 / 0.04);
  --glow: radial-gradient(60% 70% at 78% 0%, rgba(72, 175, 255, 0.20) 0%, rgba(244, 143, 177, 0.14) 40%, rgba(159, 119, 255, 0.08) 62%, transparent 78%),
          radial-gradient(45% 55% at 8% 4%, rgba(159, 119, 255, 0.10) 0%, rgba(43, 201, 180, 0.06) 45%, transparent 72%);
  --radius-sm: 4px; --radius-md: 6px; --radius-lg: 8px; --radius-card: 10px; --radius-xl: 12px;
  --sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  color-scheme: light;
}
[data-mode='dark'] {
  --page: #121213;
  --card: #1a1a1b;
  --ink: oklch(0.985 0 0);
  --ink-2: #e3e4e6;
  --paper: #121213;
  --section: #232325;
  --surface: #29292b;
  --raised: #1f1f21;
  --muted: oklch(0.708 0 0);
  --subtle: #626365;
  --border: #2c2d2f;
  --hairline: #242527;
  --destructive: #f34e52;
  --accent-hover: #2f4fe6;
  --accent-text: #7f97ff;
  --accent-soft: #2c3b85;
  --accent-tint: rgb(55 90 253 / 0.14);
  --bar: #3a3b3e;
  --bar-active: #55565a;
  --ring-line: rgb(255 255 255 / 0.09);
  --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.06), 0 0.5px 1px 1px rgb(0 0 0 / 0.3);
  --shadow-btn: 0 0 0 1px rgb(255 255 255 / 0.09), 0 0.5px 1px 1px rgb(0 0 0 / 0.3);
  --shadow-pop: 0 3px 8px rgb(0 0 0 / 0.13), 0 2px 5px rgb(0 0 0 / 0.13), 0 1px 1px rgb(0 0 0 / 0.13);
  --glow: radial-gradient(60% 70% at 78% 0%, rgba(55, 90, 253, 0.20) 0%, rgba(24, 66, 106, 0.30) 38%, rgba(159, 119, 255, 0.07) 62%, transparent 80%),
          radial-gradient(45% 55% at 8% 4%, rgba(43, 201, 180, 0.07) 0%, rgba(159, 119, 255, 0.06) 45%, transparent 72%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body { position: relative; isolation: isolate; margin: 0; min-height: 100vh; background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 13px; line-height: 1.5; font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: absolute; z-index: -1; inset: 0 0 auto 0; height: 760px; pointer-events: none; background: var(--glow); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
::selection { background: var(--accent-soft); }

.eyebrow { font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.75rem; }
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 72%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent); }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 550; letter-spacing: -0.01em; text-decoration: none; }
.brand img { width: 20px; height: 20px; border-radius: 5px; }

/* Buttons: pill, as in the editor. Primary takes the accent, the rest stay neutral. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-size: 0.8125rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: background 120ms ease-out, box-shadow 120ms, color 120ms; white-space: nowrap; box-shadow: 0 3px 6px -2px rgb(0 0 0 / 0.04), 0 1px 1px rgb(0 0 0 / 0.06); }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.secondary { background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-btn); }
.btn.secondary:hover { background: var(--raised); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.btn.danger { background: var(--card); color: var(--destructive); box-shadow: 0 0 0 1px color-mix(in srgb, var(--destructive) 35%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--destructive) 8%, var(--card)); }
.btn.sm { height: 28px; padding: 0 12px; }
.btn.lg { height: 36px; padding: 0 18px; }
.btn.icon { width: 28px; padding: 0; }
.btn.icon svg { width: 15px; height: 15px; }

.input, select.input, textarea.input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); font-size: 0.8125rem; transition: border-color 120ms, box-shadow 120ms; }
[data-mode='dark'] .input { background: color-mix(in srgb, #2c2d2f 30%, transparent); }
textarea.input { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.55; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.aurora { display: none; }

/* Gate (password page): centred like the editor's sign-in */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 360px; text-align: center; }
.gate-card h1 { font-size: 1.5rem; line-height: 1.33; letter-spacing: -0.015em; font-weight: 600; margin: 16px 0 6px; }
.gate-card p { margin: 0 0 28px; color: var(--muted); font-size: 0.8125rem; }
.gate-card form { display: grid; gap: 6px; text-align: left; }
.gate-card .btn { width: 100%; margin-top: 10px; }
.gate-card label.eyebrow { color: var(--ink); }
.error { color: var(--destructive); font-size: 0.75rem; min-height: 1.2em; margin: 2px 0 0; }
.mark { width: 40px; height: 40px; border-radius: 9px; }
.gate-foot { margin-top: 28px; font-size: 0.75rem; color: var(--subtle); text-align: center; }
