/* ember admin — global tokens + app shell. Module-specific styles live in each
   module's own <name>.css (loaded/unloaded by the router). Shared controls keep
   their own (shadow-DOM) styles under /controls. */

:root {
  /* clean & minimal — near-monochrome, hairline borders, flat surfaces */
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --elevated: #ffffff;
  --on-surface: #111114;
  --muted: #6b6b73;
  --faint: #9a9aa2;
  --line: #ededef;
  --line-2: #e3e3e6;
  --hover: #f6f6f7;
  --ink: #18181b;
  --ink-hover: #2c2c30;
  --on-ink: #ffffff;
  --primary: #ff6d3f;
  --primary-700: #e0501f;
  --primary-tint: #fff2ec;
  --ring: rgba(17,17,20,.10);
  --green: #15803d;  --green-tint: #ecf7f0;
  --amber: #a86412;  --amber-tint: #fbf3e7;
  --blue: #2563eb;   --blue-tint: #eef2fd;
  --red: #c93636;    --red-tint: #fceded;
  --grey: #6b6b73;   --grey-tint: #f1f1f2;
  --purple: #7c3aed; --purple-tint: #f3eefe;
  --sidebar-bg: #fbfbfc;
  --sidebar-fg: #45454b;
  --sidebar-muted: #9a9aa2;
  --sidebar-hover: #f1f1f3;
  --sidebar-active-bg: #ededef;
  --sidebar-active-fg: #111114;
  --shadow: 0 1px 2px rgba(17,17,20,.05);
  --shadow-md: 0 2px 8px rgba(17,17,20,.06);
  --shadow-lg: 0 16px 48px rgba(17,17,20,.16);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
  --topbar-h: 57px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #09090b;
  --surface: #131316;
  --surface-2: #1b1b1f;
  --elevated: #1b1b1f;
  --on-surface: #ededee;
  --muted: #8b8b93;
  --faint: #5f5f68;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.11);
  --hover: rgba(255,255,255,.04);
  --ink: #ededee;
  --ink-hover: #ffffff;
  --on-ink: #09090b;
  --primary: #ff7a4d;
  --primary-700: #ff9069;
  --primary-tint: rgba(255,122,77,.14);
  --ring: rgba(255,255,255,.14);
  --green: #4ade80;  --green-tint: rgba(74,222,128,.12);
  --amber: #e6a23c;  --amber-tint: rgba(230,162,60,.12);
  --blue: #6aa3ff;   --blue-tint: rgba(106,163,255,.12);
  --red: #f76b6b;    --red-tint: rgba(247,107,107,.12);
  --grey: #8b8b93;   --grey-tint: rgba(255,255,255,.06);
  --purple: #b794ff; --purple-tint: rgba(183,148,255,.13);
  --sidebar-bg: #0c0c0e;
  --sidebar-fg: #b8b8c0;
  --sidebar-muted: #5f5f68;
  --sidebar-hover: rgba(255,255,255,.05);
  --sidebar-active-bg: rgba(255,255,255,.08);
  --sidebar-active-fg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 2px 10px rgba(0,0,0,.45);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--on-surface); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* ── Toolbar (always visible, top of page) ─────────────────────────────────── */
.toolbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 20px;
  background: rgba(251,251,252,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
[data-theme="dark"] .toolbar { background: rgba(9,9,11,.8); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.toolbar__left { display: flex; align-items: center; gap: 10px; }
.toolbar__logo { display: inline-flex; color: var(--primary); }
.toolbar__brand { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; color: var(--on-surface); }
.toolbar__right { display: flex; align-items: center; }

/* Avatar button + dropdown */
.avatar-menu { position: relative; }
.avatar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: none; padding: 0;
  cursor: pointer; background: var(--surface-2); overflow: hidden;
  transition: box-shadow .12s;
}
.avatar-btn:hover { box-shadow: 0 0 0 2px var(--primary); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-initials {
  font-size: 13px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.avatar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px; background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 110;
}
.avatar-dropdown__header { padding: 14px 16px 10px; }
.avatar-dropdown__name { font-size: 14px; font-weight: 600; color: var(--on-surface); }
.avatar-dropdown__email { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-dropdown__sep { height: 1px; background: var(--line); }
.avatar-dropdown__item {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--on-surface);
  background: none; border: none; cursor: pointer; transition: background .1s;
}
.avatar-dropdown__item:hover { background: var(--hover); }

/* ── App shell ─────────────────────────────────────────────────────────────── */
.app { display: flex; height: calc(100vh - 52px); margin-top: 52px; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); height: calc(100vh - 52px);
  background: var(--sidebar-bg); color: var(--sidebar-fg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 16px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.sidebar__logo { display: inline-flex; color: var(--primary); }
.sidebar__logo .i { width: 24px; height: 24px; }
.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.sidebar__name { font-size: 15px; font-weight: 600; color: var(--sidebar-active-fg); }
.sidebar__sub { font-size: 11px; color: var(--sidebar-muted); }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-section { margin: 14px 0 4px; padding: 0 11px; font-size: 10px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--sidebar-muted); }
.navitem {
  display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: none;
  color: var(--sidebar-fg); font: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 11px; border-radius: 8px; cursor: pointer;
}
.navitem .i { width: 17px; height: 17px; opacity: .8; }
.navitem:hover { background: var(--sidebar-hover); color: var(--sidebar-active-fg); }
.navitem--active { background: var(--sidebar-active-bg); color: var(--sidebar-active-fg); }
.navitem--active .i { color: var(--primary); opacity: 1; }
.sidebar__top { display: flex; align-items: center; }
.sidebar__collapse { display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid transparent; background: none; color: var(--sidebar-muted);
  border-radius: 7px; cursor: pointer; flex: none; transition: transform .2s ease, background .12s; }
.sidebar__collapse--right { margin-left: auto; }
.sidebar__collapse:hover { background: var(--sidebar-hover); color: var(--sidebar-active-fg); }
body.nav-collapsed .sidebar__collapse { transform: rotate(180deg); }  /* « collapse → » re-dock */
/* Desktop collapse: sidebar goes off-canvas (same mechanism as mobile), burger appears. */
body.nav-collapsed .nav-toggle { display: inline-flex; }
body.nav-collapsed .sidebar { position: fixed; top: 52px; left: calc(-1 * var(--sidebar-w) - 8px); z-index: 60; height: calc(100vh - 52px);
  box-shadow: var(--shadow-lg, 0 24px 60px rgba(0,0,0,.28)); }
body.nav-collapsed .sidebar.sidebar--open { left: 0; }
body.nav-collapsed .nav-scrim:not(.hidden) { display: block !important; }
.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar__summary { font-size: 12px; color: var(--sidebar-muted); line-height: 1.6; }

/* main = column filling the viewport; topbar fixed; #view flexes to fill.
   Modules own their own padding/scroll inside #view (full-bleed by default). */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: calc(100vh - 52px); }
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__title { font-size: 18px; font-weight: 600; margin: 0; }
.topbar__actions { display: flex; gap: 8px; align-items: center; }
/* hamburger — hidden on desktop, shown on mobile via media query */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--on-surface); border-radius: 9px; cursor: pointer; }
.nav-toggle:hover { background: var(--hover); }
.nav-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
.view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.section-hint { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 18px; max-width: 900px; }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn { font: inherit; font-size: 13px; font-weight: 590; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 15px; cursor: pointer; transition: background .14s, border-color .14s, box-shadow .14s, transform .06s; }
.btn:active { transform: translateY(.5px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-700); }
.btn--block { width: 100%; }
.btn--ghost { background: var(--surface); color: var(--on-surface); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--hover); border-color: var(--muted); }
.btn--danger { background: transparent; color: var(--red); border-color: var(--line-2); }
.btn--danger:hover { background: var(--red-tint); border-color: var(--red); }
.btn--sm { padding: 5px 11px; font-size: 12.5px; }

/* ── Status pills ──────────────────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px; line-height: 1.45; background: var(--grey-tint); color: var(--muted); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok { background: var(--green-tint); color: var(--green); }
.pill--warn { background: var(--amber-tint); color: var(--amber); }
.pill--err { background: var(--red-tint); color: var(--red); }
.pill--info { background: var(--blue-tint); color: var(--blue); }
.pill--neutral, .pill--muted { background: var(--grey-tint); color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ── Sidecar slide-over (shared; form entry) ──────────────────────────────── */
.sidecar-scrim { position: fixed; inset: 0; background: rgba(20,12,30,.32); backdrop-filter: blur(2px); z-index: 40; }
.sidecar { position: fixed; top: 0; right: 0; height: 100vh; width: 520px; max-width: 92vw; background: var(--elevated);
  box-shadow: var(--shadow-lg); z-index: 41; display: flex; flex-direction: column; }
.sidecar.hidden, .sidecar-scrim.hidden { display: none; }
.sidecar__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sidecar__title { font-size: 16px; margin: 0; }
.sidecar__close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.sidecar__body { padding: 18px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 22px; }
/* #sc-extra holds module-injected groups (e.g. the customer team/limit panels); flex
   it too so those groups keep the same 22px rhythm. Hidden when empty so it adds no
   trailing gap on forms that don't use it. */
#sc-extra { display: flex; flex-direction: column; gap: 22px; }
#sc-extra:empty { display: none; }
.sidecar__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* form fields (sidecar) */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--on-surface); line-height: 1.3; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 3px; }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--on-surface); font-size: 13px; font-family: inherit; transition: border-color .12s, box-shadow .12s; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
/* Sharp custom chevron for every native dropdown, system-wide: replaces the soft
   browser triangle with a crisp mitered caret that sits 5px from the right edge.
   Light + dark variants (SVG data-URIs can't read CSS vars, so colors are inlined
   to match --muted per theme). */
select, .field select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4 6 7.5 9.5 4' fill='none' stroke='%2352525b' stroke-width='2.2' stroke-linejoin='miter' stroke-linecap='butt'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 12px 12px;
  padding-right: 26px;
}
[data-theme="dark"] select, [data-theme="dark"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4 6 7.5 9.5 4' fill='none' stroke='%23c4c4cc' stroke-width='2.2' stroke-linejoin='miter' stroke-linecap='butt'/%3E%3C/svg%3E");
}
.field--check { flex-direction: row; align-items: center; gap: 8px; }
.field--check label { font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }

/* ── iOS-style grouped edit form (the shared sidecar) ───────────────────────────
   Sections become inset rounded cards with a small uppercase header; rows inside a
   card are separated by hairlines. Toggles + selects are inline (label left, control
   right); text/number/textarea are stacked (label above a borderless control). This
   is what gives the sidecar its uniform rhythm — spacing is fixed by the card/row,
   not per-field margins. */
.sc-group { margin: 0; }
.sc-group__hdr { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px 7px; }
.sc-group__hdr:empty { display: none; }
.sc-group__sub { font-size: 11.5px; color: var(--faint); line-height: 1.4; padding: 0 4px 8px; margin-top: -3px; }
.sc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sc-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; transition: background .12s; }
.sc-row + .sc-row { border-top: 1px solid var(--line); }
.sc-row:focus-within { background: var(--hover); }
.sc-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-row__label { font-size: 13px; font-weight: 500; color: var(--on-surface); line-height: 1.3; }
/* label + its optional ⓘ help trigger sit on one line */
.sc-labelrow { display: inline-flex; align-items: center; gap: 6px; }
.sc-row--stacked .sc-labelrow { display: flex; }
.sc-hint { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
/* borderless in-card controls */
.sc-in { border: 0; background: transparent; color: var(--on-surface); font: inherit; font-size: 13px; width: 100%; padding: 0; outline: none; }
.sc-in::placeholder { color: var(--faint); }
.sc-in--area { resize: vertical; min-height: 38px; line-height: 1.5; }
/* stacked rows (text/number/textarea): label on top, control below */
.sc-row--stacked { flex-direction: column; align-items: stretch; gap: 6px; }
.sc-row--stacked .sc-row__label { font-weight: 600; }
.sc-row--stacked .sc-hint { margin-top: 1px; }
/* stacked select: full-width control on its own line (never truncates the value) */
.sc-row--stacked ember-select { display: block; width: 100%; }
/* toggle rows: the switch sits at the far right */
.sc-row--toggle input[type="checkbox"] { margin-left: auto; }
input[type="radio"] { accent-color: var(--on-surface); }
/* iOS-style on/off switch for every checkbox, system-wide: appearance off, a pill
   track with a sliding knob. `checked` = primary track + knob shifted right. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  position: relative; box-sizing: border-box; flex: 0 0 auto; vertical-align: middle;
  width: 36px; height: 20px; margin: 0; border-radius: 999px; cursor: pointer;
  background: var(--line-2, #d0d0d6); border: none; transition: background .16s ease;
}
input[type="checkbox"]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.28); transition: transform .16s ease;
}
input[type="checkbox"]:checked { background: var(--primary, #e8590c); }
input[type="checkbox"]:checked::before { transform: translateX(16px); }
input[type="checkbox"]:disabled { opacity: .5; cursor: default; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary, #e8590c); outline-offset: 2px; }

/* ── Toasts ────────────────────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #2a2433; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); animation: rise .25s ease; }
.toast--err { background: var(--red); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── Scrollbars — transparent track ───────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(140,140,150,.45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140,140,150,.4); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(140,140,150,.65); background-clip: padding-box; }

/* ── Mobile: sidebar collapses into a hamburger-toggled overlay drawer ──────── */
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .sidebar { position: fixed; top: 52px; left: 0; z-index: 60; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg); height: calc(100vh - 52px); }
  .sidebar--open { transform: translateX(0); }
  .topbar { padding: 12px 16px; }
}
/* never let the drawer scrim block the desktop layout */
@media (min-width: 761px) { .nav-scrim { display: none !important; } }

/* ── boot splash + error ───────────────────────────────────────────────── */
.boot {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px;
  background: var(--bg);
  color: var(--on-surface);
}
.boot__brand { display: inline-flex; align-items: center; gap: 10px; }
.boot__logo { color: var(--primary); display: inline-flex; }
.boot__name { font-weight: 600; font-size: 20px; letter-spacing: -0.01em; }
.boot__spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--primary);
  animation: bootSpin .8s linear infinite;
}
@keyframes bootSpin { to { transform: rotate(360deg); } }
.boot--err .boot__msg {
  background: var(--surface); border: 1px solid var(--line);
  padding: 22px 24px; border-radius: var(--radius);
  max-width: 460px; text-align: center;
}
.boot--err code { display:block; font-size:12px; color:var(--muted); margin:10px 0 14px; word-break: break-all; }
.boot--overlay { z-index: 900; }

/* ── toolbar brand link ───────────────────────────────────────────────── */
.toolbar__brand-link { display:inline-flex; align-items:center; gap:10px; text-decoration:none; color:inherit; }

/* ── marketing landing ─────────────────────────────────────────────────── */
.marketing {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  background: var(--bg);
  scroll-behavior: smooth;
}
.mk { width: 100%; }

/* Toolbar nav links (marketing only) */
.toolbar__nav { display: flex; align-items: center; gap: 4px; margin-left: 24px; }
.toolbar__link {
  font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 6px; transition: color .12s, background .12s;
}
.toolbar__link:hover { color: var(--on-surface); background: var(--hover); }
@media (max-width: 600px) { .toolbar__nav { display: none; } }

/* Hero */
.mk-hero {
  padding: 80px 24px 60px; text-align: center;
  background: linear-gradient(170deg, var(--primary-tint) 0%, var(--bg) 60%, var(--surface-2) 100%);
  position: relative; overflow: hidden;
}
.mk-hero::before {
  content: ""; position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 500px;
  background: radial-gradient(ellipse, rgba(255,109,63,.12) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.mk-hero__inner { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }
.mk-hero__badge {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .03em;
  padding: 5px 14px; border-radius: 20px; margin-bottom: 20px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: mkShimmer 3s ease infinite;
  border: 1px solid var(--line); color: var(--muted);
}
@keyframes mkShimmer { 0%,100% { background-position: 200% 0; } 50% { background-position: 0 0; } }
.mk-hero__title {
  font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.1; margin: 0 0 18px;
  background: linear-gradient(135deg, var(--on-surface) 40%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.mk-hero__sub {
  font-size: 18px; color: var(--muted); line-height: 1.65; margin: 0 auto 32px;
  max-width: 540px;
}
.mk-hero__sub code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.mk-hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.btn--lg { padding: 13px 28px; font-size: 15px; border-radius: 10px; text-decoration: none; }
.btn { text-decoration: none; }
.btn--primary:hover { box-shadow: 0 4px 16px rgba(255,109,63,.3); }

/* Terminal */
.mk-term {
  background: #1a1a2e; border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 80px rgba(255,109,63,.06);
  border: 1px solid rgba(255,255,255,.08);
  text-align: left; max-width: 620px; margin: 0 auto;
}
[data-theme="dark"] .mk-term { background: #0d0d1a; box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 80px rgba(255,109,63,.08); }
.mk-term__bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  background: rgba(255,255,255,.05); border-bottom: 1px solid rgba(255,255,255,.06);
}
.mk-term__dot { width: 11px; height: 11px; border-radius: 50%; }
.mk-term__dot--r { background: #ff5f57; }
.mk-term__dot--y { background: #febc2e; }
.mk-term__dot--g { background: #28c840; }
.mk-term__bar-title { margin-left: auto; font-size: 12px; color: rgba(255,255,255,.3); }
.mk-term__body { padding: 18px 20px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.8; }
.mk-term__line { color: #e0e0e0; }
.mk-term__line--out { color: rgba(255,255,255,.55); }
.mk-term__prompt { color: #28c840; margin-right: 8px; user-select: none; }
.mk-term__cmd { color: #e0e0e0; }
.mk-term__static { color: #e0e0e0; }
.mk-term__out { color: rgba(255,255,255,.55); }
.mk-term__comment { color: rgba(255,255,255,.35); font-style: italic; }
.mk-term__hl { color: #5eead4; font-weight: 500; }
.mk-term__cursor { color: #28c840; animation: mkBlink 1s step-end infinite; }
@keyframes mkBlink { 50% { opacity: 0; } }
@keyframes mkFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mk-term--sm { max-width: 100%; }
.mk-term--sm .mk-term__body { padding: 14px 16px; font-size: 12.5px; line-height: 1.7; }

/* Sections */
.mk-section { padding: 80px 24px; }
.mk-section--alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mk-section__inner { max-width: 960px; margin: 0 auto; animation: mkReveal .6s ease both; }
@keyframes mkReveal { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.mk-section__title {
  font-size: clamp(24px, 3.5vw, 34px); font-weight: 700; letter-spacing: -0.02em;
  text-align: center; margin: 0 0 12px; color: var(--on-surface);
}
.mk-section__sub { text-align: center; color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 auto 48px; max-width: 560px; }

/* Feature cards */
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.mk-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; transition: box-shadow .25s, border-color .25s, transform .25s;
}
.mk-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.08); border-color: var(--line-2); }
[data-theme="dark"] .mk-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,.3); }
.mk-card__icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-tint); border-radius: 10px; color: var(--primary); margin-bottom: 16px;
  box-shadow: 0 0 0 6px rgba(255,109,63,.06); }
.mk-card__icon svg { width: 22px; height: 22px; }
.mk-card__title { font-size: 16px; font-weight: 650; margin: 0 0 8px; color: var(--on-surface); }
.mk-card__desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin: 0; }
.mk-card__desc code { background: var(--surface-2); padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* Sequence diagram */
.mk-diagram { margin: 0 auto 56px; max-width: 800px; overflow-x: auto; }
.mk-seq { width: 100%; height: auto; }
.mk-seq text { font-family: "Inter", sans-serif; }

/* Steps */
.mk-steps { display: flex; flex-direction: column; gap: 40px; max-width: 640px; margin: 0 auto; position: relative; }
.mk-steps::before {
  content: ""; position: absolute; left: 17px; top: 36px; bottom: 36px; width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--line)); z-index: 0;
}
.mk-step { display: flex; gap: 20px; position: relative; z-index: 1; }
.mk-step__num {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
  box-shadow: 0 0 0 4px var(--primary-tint);
}
.mk-step__body { flex: 1; min-width: 0; }
.mk-step__title { font-size: 18px; font-weight: 650; margin: 0 0 6px; color: var(--on-surface); }
.mk-step__desc { font-size: 14px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }

/* Install tabs (landing page how-it-works step 1) */
.mk-install-tabs { display: flex; gap: 0; margin-bottom: 12px; }
.mk-install-tab {
  padding: 5px 14px; font-size: 12px; font-weight: 500; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.5);
}
.mk-install-tab:first-child { border-radius: 6px 0 0 6px; }
.mk-install-tab:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.mk-install-tab--active { background: var(--primary); color: #fff; border-color: var(--primary); }
.mk-install-panel--hidden { display: none; }

/* Pricing tiers */
.mk-tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; max-width: 880px; margin: 0 auto; }
.mk-tier {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 24px 24px; display: flex; flex-direction: column; position: relative;
}
.mk-tier__header { text-align: center; margin-bottom: 24px; }
.mk-tier__name { font-size: 20px; font-weight: 700; margin: 0 0 8px; color: var(--on-surface); }
.mk-tier__price { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.mk-tier__amount { font-size: 48px; font-weight: 800; letter-spacing: -0.04em; color: var(--on-surface); }
.mk-tier__period { font-size: 15px; color: var(--muted); }
.mk-tier__features { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.mk-tier__features li {
  font-size: 13.5px; color: var(--on-surface); padding-left: 22px; position: relative; line-height: 1.4;
}
.mk-tier__features li::before {
  content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; font-size: 13px;
}
.mk-tier__feat--no { color: var(--muted) !important; }
.mk-tier__feat--no::before { content: "—" !important; color: var(--faint) !important; }
.mk-tier--enterprise { border-color: var(--line-2); background: var(--surface-2); }
.mk-tier__amount-text { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; color: var(--on-surface); }
.mk-tier__phone { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; }

/* Comparison table */
.mk-compare { overflow-x: auto; }
.mk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mk-table th { text-align: left; padding: 12px 16px; font-weight: 650; font-size: 14px; border-bottom: 2px solid var(--line-2); color: var(--on-surface); }
.mk-table th:first-child { width: 35%; }
.mk-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.mk-table td:first-child { font-weight: 500; color: var(--on-surface); }
.mk-table__yes { color: var(--green) !important; font-weight: 500; }
.mk-table tbody tr:nth-child(even) { background: var(--surface-2); }
.mk-table tbody tr:hover { background: var(--primary-tint); }

/* CTA */
.mk-cta { padding: 80px 24px; text-align: center; background: linear-gradient(180deg, var(--bg) 0%, var(--primary-tint) 100%); }
.mk-cta__inner { max-width: 560px; margin: 0 auto; }
.mk-cta__title { font-size: clamp(24px, 3.5vw, 32px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; color: var(--on-surface); }
.mk-cta__sub { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 28px; }
.mk-cta .btn--primary { animation: mkPulse 2.5s ease infinite; }
@keyframes mkPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,109,63,.4); } 50% { box-shadow: 0 0 0 12px rgba(255,109,63,0); } }

/* Footer */
.mk-footer { padding: 48px 24px 32px; background: var(--surface-2); }
.mk-footer__inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.mk-footer__brand { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--on-surface); }
.mk-footer__brand svg { color: var(--primary); }
.mk-footer__links { display: flex; gap: 6px; font-size: 13px; }
.mk-footer__links a { color: var(--muted); text-decoration: none; }
.mk-footer__links a:hover { color: var(--on-surface); }
.mk-footer__sep { color: var(--faint); }
.mk-footer__copy { font-size: 12px; color: var(--faint); }

/* ── Marketing responsive ─────────────────────────────────────────────── */

/* Tablet (≤768px) */
@media (max-width: 768px) {
  .mk-hero { padding: 56px 20px 48px; }
  .mk-section { padding: 56px 20px; }
  .mk-hero__actions { flex-direction: column; align-items: center; }
  .mk-hero__actions .btn--lg { width: 100%; max-width: 340px; }
  .mk-tiers { gap: 16px; }
  .mk-diagram { margin-bottom: 40px; }
  .mk-footer__inner { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .mk-footer__copy { width: 100%; text-align: center; }
  .mk-cta { padding: 56px 20px; }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
  .mk-hero { padding: 40px 16px 36px; }
  .mk-hero__badge { font-size: 11px; padding: 4px 10px; }
  .mk-hero__sub { font-size: 15px; }
  .mk-hero__actions .btn--lg { max-width: 100%; padding: 14px 20px; }
  .mk-section { padding: 48px 16px; }
  .mk-section__title { font-size: 22px; }
  .mk-section__sub { font-size: 13.5px; margin-bottom: 32px; }
  .mk-cards { grid-template-columns: 1fr; gap: 14px; }
  .mk-card { padding: 22px 20px; }
  .mk-card__title { font-size: 15px; }
  .mk-card__desc { font-size: 13px; }
  .mk-steps { gap: 32px; }
  .mk-step__title { font-size: 16px; }
  .mk-step__desc { font-size: 13px; }
  .mk-tiers { grid-template-columns: 1fr; }
  .mk-tier { padding: 28px 20px 20px; }
  .mk-tier__amount { font-size: 40px; }
  .mk-table { font-size: 12px; }
  .mk-table th { padding: 10px 10px; font-size: 12px; }
  .mk-table td { padding: 9px 10px; }
  .mk-cta { padding: 48px 16px; }
  .mk-cta__title { font-size: 22px; }
  .mk-footer { padding: 32px 16px 24px; }
  .mk-footer__inner { gap: 8px; }
  .mk-footer__brand { font-size: 13px; }
  .mk-footer__links { font-size: 12px; }
  .mk-term__body { padding: 14px 14px; font-size: 12px; line-height: 1.7; }
  .mk-term__bar { padding: 10px 14px; }
  .btn--lg { padding: 12px 20px; font-size: 14px; }
}

/* iPhone landscape (short viewport) */
@media (max-height: 500px) and (orientation: landscape) {
  .mk-hero { padding: 32px 24px 28px; }
  .mk-section { padding: 40px 24px; }
  .mk-hero__actions { flex-direction: row; }
  .mk-hero__terminal { margin-top: 20px; }
}

/* ── sign-in landing ───────────────────────────────────────────────────── */
.signin {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.signin__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.signin__brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.signin__logo { color: var(--primary); display: inline-flex; }
.signin__name { font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.signin__tagline { color: var(--muted); font-size: 13.5px; margin: 6px 0 22px; }
.signin__buttons { display: flex; flex-direction: column; gap: 10px; }
.signin__form { margin: 0; }   /* <form> wraps each provider button — no margin */
.signin__btn {
  /* also resets browser default button styling */
  font: inherit;
  outline: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500; font-size: 14px;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  border: 1px solid var(--line-2);
  background: var(--surface); color: var(--on-surface);
}
.signin__btn:hover { background: var(--hover); border-color: var(--line); }
.signin__ico {
  width: 18px; height: 18px;
  background-repeat: no-repeat; background-position: center; background-size: contain;
  display: inline-block;
}
.signin__ico--google    { background-image: url("/assets/logos/google/g-logo.png"); }
/* Microsoft: four-tile logo (SVG data URI so we don't need an asset file). */
.signin__ico--microsoft {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='1' y='1' width='10' height='10' fill='%23f25022'/><rect x='13' y='1' width='10' height='10' fill='%237fba00'/><rect x='1' y='13' width='10' height='10' fill='%2300a4ef'/><rect x='13' y='13' width='10' height='10' fill='%23ffb900'/></svg>");
}
/* Amazon: bare "a." arrow-smile mark. */
.signin__ico--amazon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23ff9900' d='M14.6 14.6c-3.1 2.3-7.6 3.5-11.5 3.5-.4 0-.5-.4-.1-.7 3.5-2 8.3-3.2 13.3-3.2.7 0 .8.2.2.4zm1.3 1c-.4-.5-2.6-.2-3.5-.1-.3 0-.3-.2-.1-.4 1.7-1.2 4.6-.9 4.9-.5.3.5-.1 3.4-1.7 4.8-.2.2-.5.1-.4-.2.3-.8 1.2-3 .8-3.6z'/><path fill='%23111114' d='M14 10.8c0 1 0 1.8-.5 2.7-.4.7-1 1.2-1.8 1.2-1 0-1.6-.8-1.6-1.9 0-2.3 2-2.7 3.9-2.7v.7zm2.6 6.3c-.2.2-.4.2-.6.1-.9-.7-1-1-1.5-1.7-1.4 1.4-2.4 1.9-4.3 1.9-2.2 0-3.9-1.4-3.9-4 0-2.1 1.1-3.6 2.7-4.3 1.4-.6 3.4-.7 4.8-.9v-.3c0-.7.1-1.5-.3-2-.4-.5-1.1-.7-1.8-.7-1.2 0-2.3.6-2.6 1.9-.1.3-.3.6-.6.6l-2.5-.3c-.2 0-.4-.2-.4-.5.6-3.1 3.4-4 5.9-4 1.3 0 3 .3 4 1.3 1.3 1.2 1.2 2.7 1.2 4.4v4c0 1.2.5 1.7 1 2.3.2.2.2.5 0 .7l-1.1.9v.2z'/></svg>");
}
.signin__foot { color: var(--faint); font-size: 12px; margin: 18px 0 0; }

/* ── sidebar footer: signed-in email ───────────────────────────────────── */
.sidebar__me {
  font-size: 12px; color: var(--muted);
  padding: 6px 8px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* module-in-a-dialog uses the shared <hsio-dialog> panel (controls/dialog.js) */

