/* ============================================================================
   s-work SITE — app-chrome kit (proposed: side-nav layout shared with the app)
   TOKENS: copied VERBATIM from the app's single source of colour truth —
     ../app repo: apps/app/src/styles/globals.css  (:root + .dark blocks)
   The app builds its CSS through Tailwind with hashed filenames, so the site
   cannot hotlink it; instead we vendor the token blocks and re-sync by copy
   whenever the app's globals.css changes. CHROME: a plain-CSS reproduction of
   the app's desktop sidebar (shells/desktop/sidebar.tsx — r3-locked collapsible
   labelled rail, 240px ↔ 64px, collapse-to-icons + tooltips, expandable group).
   Colour law: brand red = logo lockup ONLY. Green = primary. system-ui type.
   ========================================================================== */

/* ── TOKENS (verbatim from apps/app globals.css) ─────────────────────────── */
:root {
  --radius: 16px;

  --page: #f1eeee;
  --background: #f1eeee;
  --foreground: #18181b;
  --ink-2: #3f3f46;
  --card: #ffffff;
  --card-foreground: #18181b;
  --surface-2: #faf8f8;
  --popover: #ffffff;
  --popover-foreground: #18181b;
  --muted: #faf8f8;
  --muted-foreground: #6b7280;
  --faint: #9aa0a6;
  --border: #e8e4e4;
  --hairline-2: #efebeb;
  --input: #e8e4e4;
  --ring: #15803d;

  --primary: #15803d;
  --primary-foreground: #ffffff;
  --secondary: #faf8f8;
  --secondary-foreground: #3f3f46;
  --accent: #f0f0f2;
  --accent-foreground: #18181b;
  --success: #15803d;
  --success-foreground: #ffffff;
  --warning: #946a00;
  --warning-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;

  --amber: #b45309; --amber-bg: #fbf0dd; --amber-bd: #f1dcb4;

  --safe: #15803d;    --safe-bg: #e7f4ec;    --safe-bd: #bfe3cc;
  --info: #52525b;    --info-bg: #f0f0f2;    --info-bd: #dddce0;    --info-fg: #ffffff;
  --caution: #946a00; --caution-bg: #fbf1cf; --caution-bd: #eedda0;
  --avoid: #c2410c;   --avoid-bg: #fbe7da;   --avoid-bd: #f3c9ae;
  --danger: #dc2626;  --danger-bg: #fce6e6;  --danger-bd: #f4c6c6;

  --brand: #e8001c;

  --attn: #db2777;
  --attn-bg: #fdf2f8;
  --attn-bd: #f9a8d4;
  --attn-fg: #ffffff;

  --shadow: 0 26px 60px -30px rgba(24, 24, 27, .42), 0 4px 12px -6px rgba(24, 24, 27, .14);
  --shadow-sm: 0 2px 6px -2px rgba(24, 24, 27, .14);
  --scrim: rgba(12, 12, 16, .5);

  --dur-shell: 200ms;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --radius-control: 10px;
  --radius-row: 11px;

  /* chrome geometry (sidebar.tsx: w-60 expanded / w-16 collapsed, h-16 header) */
  --w-sidebar: 240px;
  --w-sidebar-collapsed: 64px;
}

.dark {
  --page: #0c0c0e;
  --background: #0c0c0e;
  --foreground: #f4f4f5;
  --ink-2: #d4d4d8;
  --card: #161619;
  --card-foreground: #f4f4f5;
  --surface-2: #1d1d21;
  --popover: #202024;
  --popover-foreground: #f4f4f5;
  --muted: #1d1d21;
  --muted-foreground: #9ca3af;
  --faint: #71767e;
  --border: #2a2a2f;
  --hairline-2: #232327;
  --input: #2a2a2f;
  --ring: #34d07a;

  --primary: #34d07a;
  --primary-foreground: #08130c;
  --secondary: #1d1d21;
  --secondary-foreground: #d4d4d8;
  --accent: #26262b;
  --accent-foreground: #f4f4f5;
  --success: #34d07a;
  --success-foreground: #08130c;
  --warning: #eab308;
  --warning-foreground: #1c1917;
  --destructive: #f87171;
  --destructive-foreground: #1a0d0d;

  --amber: #f0b24b; --amber-bg: #30260f; --amber-bd: #493918;

  --safe: #4ade80;    --safe-bg: #12291c;    --safe-bd: #1f4630;
  --info: #a6a6ae;    --info-bg: #26262b;    --info-bd: #3a3a41;    --info-fg: #131316;
  --caution: #eab308; --caution-bg: #2e2711; --caution-bd: #4a3f17;
  --avoid: #fb923c;   --avoid-bg: #341f0e;   --avoid-bd: #51301a;
  --danger: #f87171;  --danger-bg: #351b1b;  --danger-bd: #57292a;

  --brand: #ff3049;

  --attn: #f472b6;
  --attn-bg: rgba(219, 39, 119, .16);
  --attn-bd: rgba(244, 114, 182, .35);
  --attn-fg: #2b0714;

  --shadow: 0 26px 60px -30px rgba(0, 0, 0, .7), 0 4px 12px -6px rgba(0, 0, 0, .5);
  --shadow-sm: 0 2px 6px -2px rgba(0, 0, 0, .5);
}

/* ── BASE ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: none; padding: 0; }
button:not(:disabled), [role="button"], label[for], summary { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

/* ── SHELL: sidebar + main column ────────────────────────────────────────── */
.shell { display: flex; min-height: 100dvh; }

/* the chrome always speaks the app's system-ui, even on pages whose content
   keeps the marketing fonts (kit.css loads FIRST there; page styles win on body) */
.rail, .topbar { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

.rail {
  display: flex; flex-direction: column; flex-shrink: 0;
  width: var(--w-sidebar);
  border-right: 1px solid var(--border);
  background: var(--card);
  transition: width var(--dur-shell) ease-in-out;
  position: sticky; top: 0; height: 100dvh;
}
.shell.collapsed .rail { width: var(--w-sidebar-collapsed); }

.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 20px; flex-shrink: 0;
}
.shell.collapsed .rail-head { justify-content: center; padding: 0; }
.rail-brand { display: inline-flex; align-items: center; color: var(--brand); text-decoration: none; }
.rail-brand svg { height: 18px; width: auto; display: block; }
.shell.collapsed .rail-brand { display: none; }
.rail-toggle {
  display: inline-flex; border-radius: var(--radius-sm); padding: 6px;
  color: var(--muted-foreground); transition: background 150ms, color 150ms;
}
.rail-toggle:hover { background: var(--accent); color: var(--foreground); }
.rail-toggle svg { width: 20px; height: 20px; }

.rail-nav { flex: 1; padding: 0 12px 10px; overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; }
.shell.collapsed .rail-nav { overflow: visible; }
.rail-nav > * + * { margin-top: 4px; }

.rail-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: var(--muted-foreground); transition: background 150ms, color 150ms;
}
.rail-link:hover { background: var(--accent); color: var(--foreground); }
.rail-link.active { background: var(--accent); color: var(--primary); }
/* the "App demo" item — attn pink (exciting new thing), stays pink on hover */
.rail-link.demolink { color: var(--attn); }
.rail-link.demolink:hover { background: var(--attn-bg); color: var(--attn); }
.rail-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.rail-link .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-link .trail { display: inline-flex; color: var(--muted-foreground); }
.rail-link .trail svg { width: 14px; height: 14px; }
.shell.collapsed .rail-link { justify-content: center; padding: 8px 0; gap: 0; }
.shell.collapsed .rail-link .lbl,
.shell.collapsed .rail-link .trail { display: none; }

/* group (Docs / Admin style): separator + sub-links behind a left border */
.rail-sep { margin: 8px 4px; border-top: 1px solid var(--border); }
/* Section label inside the admin sub-rail. Replaces a bare separator so the flat
   page list reads as grouped. Collapsed, the rail is 64px of icons and there is no
   room for words — the label becomes the hairline it replaced. */
.rail-grp { margin: 10px 4px 4px; padding: 0 8px; font-size: 10.5px; font-weight: 700;
            text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.rail-sub > .rail-grp:first-child { margin-top: 4px; }
.shell.collapsed .rail-grp { margin: 8px 4px; padding: 0; font-size: 0; letter-spacing: 0;
            border-top: 1px solid var(--border); }
.rail-link.grouped { box-shadow: inset 0 0 0 1px var(--border); }
.shell.collapsed .rail-link.grouped { box-shadow: none; }
.rail-sub { margin-top: 4px; margin-left: 12px; border-left: 1px solid var(--border); padding-left: 8px; }
.rail-sub > * + * { margin-top: 2px; }
.rail-sub .rail-link { padding: 6px 12px; font-size: 13px; }
.rail-sub .rail-link svg { width: 16px; height: 16px; }
.shell.collapsed .rail-sub { margin-left: 0; border-left: none; padding-left: 0; }
.shell.collapsed .rail-sub .rail-link { padding: 6px 0; }

/* collapsed-rail hover tooltip — pops out the RIGHT of the rail for EVERY item,
   nav and footer alike (claude.ai-style; deliberately not the app footer's
   top-centre tips) */
.rail .tip {
  pointer-events: none; visibility: hidden; opacity: 0;
  position: absolute; left: 100%; top: 50%; z-index: 50;
  margin-left: 8px; transform: translateY(-50%); white-space: nowrap;
  border: 1px solid var(--border); background: var(--popover); color: var(--foreground);
  border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px;
  box-shadow: var(--shadow-sm); transition: opacity 150ms;
}
.shell.collapsed .rail-link:hover .tip,
.shell.collapsed .foot-user:hover .tip,
.shell.collapsed .foot-app:hover .tip,
.shell.collapsed .foot-out:hover .tip,
.shell.collapsed .foot-join:hover .tip { visibility: visible; opacity: 1; }

/* ── RAIL FOOTER — mirrors the app's sidebar tray (persona row + controls),
   but for the site: email + [Use the app | log out], or a red Join-in CTA.
   Brand-red buttons here are Will's explicit call for the site chrome. ── */
.rail-foot { padding: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.foot-join {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 13px;
  border-radius: var(--radius-control); padding: 9px 12px; text-decoration: none;
  transition: filter 150ms;
}
.foot-join:hover { filter: brightness(0.94); }
.foot-join svg { width: 16px; height: 16px; flex-shrink: 0; }
.foot-user {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; margin-bottom: 6px; border-radius: var(--radius-sm);
  font-weight: 500; color: var(--foreground);
}
.foot-user svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted-foreground); }
.foot-user .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-row { display: flex; align-items: center; gap: 6px; }
.foot-app {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 7px 10px; border-radius: var(--radius-control); text-decoration: none;
  transition: filter 150ms;
}
.foot-app:hover { filter: brightness(0.94); }
.foot-app svg { width: 14px; height: 14px; flex-shrink: 0; }
.foot-spacer { flex: 1; }
.foot-out {
  position: relative; display: inline-flex; padding: 6px; border-radius: var(--radius-sm);
  color: var(--muted-foreground); transition: background 150ms, color 150ms;
}
.foot-out:hover { background: var(--accent); color: var(--foreground); }
.foot-out svg { width: 20px; height: 20px; }
/* collapsed: icon stack, labels off, tooltips on (right-side, like the nav) */
.shell.collapsed .rail-foot { padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shell.collapsed .foot-join { padding: 8px; }
.shell.collapsed .foot-join .lbl { display: none; }
.shell.collapsed .foot-user { padding: 6px; margin-bottom: 0; }
.shell.collapsed .foot-user .lbl { display: none; }
.shell.collapsed .foot-row { flex-direction: column; gap: 6px; }
.shell.collapsed .foot-app { padding: 8px; }
.shell.collapsed .foot-app .lbl { display: none; }
.shell.collapsed .foot-spacer { display: none; }

/* ── MAIN COLUMN ─────────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; }
.page-pad { max-width: 860px; margin: 0 auto; padding: 40px 28px 80px; }

/* mobile: rail becomes an overlay drawer behind a top bar */
.topbar {
  display: none; position: sticky; top: 0; z-index: 40;
  align-items: center; justify-content: space-between;
  height: 56px; padding: 0 16px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.topbar .rail-brand { display: inline-flex; }
.topbar .rail-brand svg { height: 16px; }
.topbar button { display: inline-flex; padding: 8px; border-radius: var(--radius-sm); color: var(--muted-foreground); }
.topbar button svg { width: 22px; height: 22px; }
.scrim { display: none; position: fixed; inset: 0; z-index: 45; background: var(--scrim); }

@media (max-width: 767px) {
  .topbar { display: flex; }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 46;
    width: var(--w-sidebar) !important;
    transform: translateX(-100%);
    transition: transform var(--dur-shell) ease-in-out;
  }
  .shell.drawer-open .rail { transform: translateX(0); }
  .shell.drawer-open .scrim { display: block; }
  .shell .rail-toggle { display: none; }
  /* drawer always shows labels regardless of desktop collapse pref */
  .shell.collapsed .rail-head { justify-content: space-between; padding: 0 20px; }
  .shell.collapsed .rail-brand { display: inline-flex; }
  .shell.collapsed .rail-link { justify-content: flex-start; padding: 8px 12px; gap: 12px; }
  .shell.collapsed .rail-link .lbl, .shell.collapsed .rail-link .trail { display: inline-flex; }
  .shell.collapsed .rail-sub { margin-left: 12px; border-left: 1px solid var(--border); padding-left: 8px; }
  .shell.collapsed .rail-foot { padding: 12px; display: block; }
  .shell.collapsed .foot-join { padding: 9px 12px; }
  .shell.collapsed .foot-user { padding: 6px 8px; margin-bottom: 6px; }
  .shell.collapsed .foot-row { flex-direction: row; }
  .shell.collapsed .foot-app { padding: 7px 10px; }
  .shell.collapsed .foot-join .lbl,
  .shell.collapsed .foot-user .lbl,
  .shell.collapsed .foot-app .lbl { display: inline; }
  .shell.collapsed .foot-spacer { display: block; }
  .page-pad { padding: 28px 18px 64px; }
}

/* ── DOCS PROSE ──────────────────────────────────────────────────────────── */
.prose h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 6px; }
.prose .kicker {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-foreground); margin: 0 0 14px;
}
.prose h2 { font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; margin: 44px 0 10px; }
.prose h3 { font-size: 16px; margin: 28px 0 8px; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; color: var(--ink-2); }
.prose li { margin-bottom: 6px; }
.prose b, .prose strong { color: var(--foreground); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.prose .lead { font-size: 17px; color: var(--foreground); }

/* cards, callouts, badges — scoped under .prose so they never collide with
   marketing-page classes of the same name (index.html has its own .card/.callout/.phone) */
.prose .card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 20px; margin: 0 0 14px;
  box-shadow: var(--shadow-sm);
}
.prose .callout {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid; border-radius: var(--radius-md);
  padding: 14px 16px; margin: 0 0 14px; font-size: 14px;
}
.prose .callout svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.prose .callout p { margin: 0; color: inherit; }
.prose .callout.honest  { background: var(--caution-bg); border-color: var(--caution-bd); color: var(--foreground); }
.prose .callout.honest svg { color: var(--caution); }
.prose .callout.safe    { background: var(--safe-bg); border-color: var(--safe-bd); color: var(--foreground); }
.prose .callout.safe svg { color: var(--safe); }
.prose .callout.danger  { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--foreground); }
.prose .callout.danger svg { color: var(--danger); }
.prose .callout.pending { background: var(--info-bg); border-color: var(--info-bd); color: var(--foreground); }
.prose .callout.pending svg { color: var(--info); }

.prose .badge {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid; border-radius: 999px; padding: 2px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  vertical-align: middle;
}
.prose .badge.live    { background: var(--safe-bg); border-color: var(--safe-bd); color: var(--safe); }
.prose .badge.build   { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber); }
.prose .badge.planned { background: var(--info-bg); border-color: var(--info-bd); color: var(--info); }

/* tables (the can/can't-see table etc.) */
.prose .tbl-wrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.prose table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose .tbl th, .prose .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hairline-2); vertical-align: top; }
.prose .tbl thead th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); background: var(--surface-2); }
.prose .tbl tbody tr:last-child td { border-bottom: none; }
.prose .tbl .yes { color: var(--danger); font-weight: 600; }
.prose .tbl .no  { color: var(--safe); font-weight: 600; }
.prose .tbl .some{ color: var(--amber); font-weight: 600; }

/* simple figure/diagram framing */
.prose .fig { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin: 0 0 14px; }
.prose .fig svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.prose .fig .cap { text-align: center; font-size: 12.5px; color: var(--muted-foreground); margin: 12px 0 0; }

/* two-up comparison cards (padlock vs vault) */
.prose .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 14px; }
@media (max-width: 640px) { .prose .duo { grid-template-columns: 1fr; } }
.prose .duo .card { margin: 0; }
.prose .duo h3 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.prose .duo h3 svg { width: 18px; height: 18px; }

/* phone-frame flow mockups (docs: "a user-flow mockup beats dense docs") */
.prose .phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 6px; }
.prose .phones .phone {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 10px 10px 14px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px; min-height: 230px;
}
.prose .phone .pbar { font-size: 11px; font-weight: 600; color: var(--muted-foreground); text-align: center; padding: 2px 0 6px; border-bottom: 1px solid var(--hairline-2); }
.prose .phone .msg { align-self: flex-start; background: var(--muted); border: 1px solid var(--hairline-2); border-radius: 11px; padding: 7px 10px; font-size: 12.5px; max-width: 92%; }
.prose .phone .sig { border: 1px solid; border-radius: var(--radius-md); padding: 9px 10px; font-size: 12px; line-height: 1.45; }
.prose .phone .sig b { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.prose .phone .sig .dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.prose .phone .sig.ok { background: var(--safe-bg); border-color: var(--safe-bd); } .prose .phone .sig.ok .dot { background: var(--safe); }
.prose .phone .sig.warn { background: var(--danger-bg); border-color: var(--danger-bd); } .prose .phone .sig.warn .dot { background: var(--danger); }
.prose .phone .sig.note { background: var(--info-bg); border-color: var(--info-bd); } .prose .phone .sig.note .dot { background: var(--info); }
.prose .phone .pbtn {
  display: block; text-align: center; font-size: 12.5px; font-weight: 600;
  border-radius: var(--radius-control); padding: 8px 10px; border: 1px solid transparent;
}
.prose .phone .pbtn.go { background: var(--primary); color: var(--primary-foreground); }
.prose .phone .pbtn.line { background: var(--card); color: var(--foreground); border-color: var(--border); }
.prose .phone .pbtn.stop { background: var(--destructive); color: var(--destructive-foreground); }
.prose .phone .pnote { font-size: 11px; color: var(--muted-foreground); text-align: center; margin-top: auto; }
.prose .flow-cap { text-align: center; font-size: 12.5px; color: var(--muted-foreground); margin: 0 0 14px; }

/* gate screens (sign-in / pending) */
.gate { min-height: 60dvh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.gate .box { max-width: 380px; }
.gate h1 { font-size: 22px; margin: 0 0 8px; }
.gate p { color: var(--muted-foreground); margin: 0 0 18px; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: sp .7s linear infinite; margin: 0 auto; }
@keyframes sp { to { transform: rotate(360deg); } }

/* buttons — the app's kit shape: green primary, rounded-control */
.kbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; line-height: 1.15;
  padding: 11px 18px; border-radius: var(--radius-control);
  border: 1px solid transparent; transition: filter 150ms, background 150ms, border-color 150ms;
  text-decoration: none;
}
.kbtn.primary { background: var(--primary); color: var(--primary-foreground); }
.kbtn.primary:hover { filter: brightness(0.94); }
.kbtn.ghost { background: var(--card); color: var(--foreground); border-color: var(--border); }
.kbtn.ghost:hover { background: var(--accent); }
.kbtn.danger { background: var(--destructive); color: var(--destructive-foreground); }
.kbtn.danger:hover { filter: brightness(0.94); }
.kbtn.sm { font-size: 13px; padding: 7px 12px; }
.kbtn[disabled] { opacity: .55; cursor: progress; }
.kbtn svg { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   COMPANION DOCS (.swcomp) — the decision-support vocabulary, ported from the
   app's components/companion/ui.tsx so the section reads the same after the
   move. Everything is scoped under .swcomp: these fragments are injected into
   the admin page's own document, so an unscoped rule here would restyle the
   shell around them.

   Colour law, inherited from the original: green = recommended / good ·
   amber = caution · red = danger or honesty-warning · pink = pivotal, read
   this · violet = a future/roadmap note. Brand red is never used — it is the
   logo lockup only.
   ══════════════════════════════════════════════════════════════════════════ */
.swcomp { --mtag: #6d28d9; --mtag-bg: #f5f3ff; --mtag-bd: #ddd6fe; }
.swcomp { font-size: 14px; line-height: 1.6; color: var(--foreground); }
.swcomp > * + * { margin-top: 28px; }
.swcomp svg { width: 15px; height: 15px; flex: none; fill: none;
              stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Block — a titled section */
.swcomp .block > h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.swcomp .block > .lead { color: var(--muted-foreground); max-width: 68ch; margin: 0 0 12px; }
.swcomp .block > * + * { margin-top: 12px; }
.swcomp p { max-width: 72ch; }
.swcomp strong { font-weight: 650; }
.swcomp code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em;
                background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }

/* pills. NOTE: the recommended BADGE is .recb, not .rec — `.rec` is the
   'recommended' TONE modifier on .callout and .shape, and a shared .rec rule
   set display:inline-flex on those cards, shrink-wrapping them. */
.swcomp .chip, .swcomp .recb { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
        border: 1px solid var(--border); background: var(--surface-2); color: var(--muted-foreground);
        border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 650; }
.swcomp .recb,
.swcomp .chip.safe    { border-color: var(--safe-bd);    background: var(--safe-bg);    color: var(--safe); }
.swcomp .chip.caution { border-color: var(--caution-bd); background: var(--caution-bg); color: var(--caution); }
.swcomp .chip.avoid   { border-color: var(--avoid-bd);   background: var(--avoid-bg);   color: var(--avoid); }
.swcomp .chip.danger  { border-color: var(--danger-bd);  background: var(--danger-bg);  color: var(--danger); }
.swcomp .chip.note    { border-color: var(--mtag-bd);    background: var(--mtag-bg);    color: var(--mtag); }
.swcomp .recb svg { width: 12px; height: 12px; fill: currentColor; }

/* DocTable — the workhorse comparison table. Scrolls in its own container so a
   wide table never scrolls the page body. */
.swcomp .tbl { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.swcomp .tbl table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
.swcomp .tbl th { white-space: nowrap; padding: 8px 12px; font-size: 10.5px; font-weight: 650;
                  text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground);
                  border-bottom: 1px solid var(--border); vertical-align: bottom; }
.swcomp .tbl td { padding: 10px 12px; vertical-align: top; line-height: 1.55;
                  border-bottom: 1px solid var(--hairline-2); }
.swcomp .tbl tr:last-child td { border-bottom: 0; }
.swcomp .tbl tr.rec td { background: var(--safe-bg); }

/* Callout — a tinted emphasis box */
.swcomp .callout { border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 14px 16px; }
.swcomp .callout > .ct { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 6px; }
.swcomp .callout > :last-child { margin-bottom: 0; }
.swcomp .callout.rec     { border-color: var(--safe-bd);    background: var(--safe-bg); }
.swcomp .callout.warn    { border-color: var(--caution-bd); background: var(--caution-bg); }
.swcomp .callout.danger  { border-color: var(--danger-bd);  background: var(--danger-bg); }
.swcomp .callout.pivotal { border-color: var(--attn-bd);    background: var(--attn-bg); }
.swcomp .callout.note    { border-color: var(--mtag-bd);    background: var(--mtag-bg); }
.swcomp .callout.rec > .ct     { color: var(--safe); }
.swcomp .callout.warn > .ct    { color: var(--caution); }
.swcomp .callout.danger > .ct  { color: var(--danger); }
.swcomp .callout.pivotal > .ct { color: var(--attn); }
.swcomp .callout.note > .ct    { color: var(--mtag); }

/* Bullets — dot markers that align to the first line, not the text box */
.swcomp ul.bul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.swcomp ul.bul > li { position: relative; padding-left: 16px; max-width: 72ch; }
.swcomp ul.bul > li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 6px;
                              border-radius: 50%; background: var(--muted-foreground); }

/* Steps — a numbered sequence with a connecting spine */
.swcomp ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.swcomp ol.steps > li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; counter-increment: s; }
.swcomp ol.steps > li:last-child { padding-bottom: 0; }
.swcomp ol.steps > li::before { content: counter(s); flex: none; display: grid; place-items: center;
        width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
        background: var(--card); font-size: 11px; font-weight: 700; position: relative; z-index: 1; }
.swcomp ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 28px;
        bottom: 0; width: 1px; background: var(--border); }
.swcomp ol.steps .st { font-weight: 650; }
.swcomp ol.steps .sb { color: var(--muted-foreground); margin-top: 2px; }

/* Diagrams — white node cards on the grey column, connected by labelled arrows.
   Stacks on narrow screens, runs as a row from 760px up (the original's md). */
.swcomp figure { margin: 0; }
.swcomp figcaption { font-size: 12.5px; line-height: 1.6; color: var(--muted-foreground); max-width: 72ch; margin-top: 10px; }
.swcomp .flow { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.swcomp .node { flex: 1; border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 12px; }
.swcomp .node.safe { border-left: 2px solid var(--safe); }
.swcomp .node.attn { border-left: 2px solid var(--attn); }
.swcomp .node.note { border-left: 2px solid var(--mtag); }
.swcomp .node > .nt { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.swcomp .node > .ns { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px;
                      text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-top: 2px; }
.swcomp .node > .nb { font-size: 12.5px; line-height: 1.55; color: var(--muted-foreground); margin-top: 8px; }
.swcomp .node > .nb > * + * { margin-top: 4px; }
.swcomp .node .nb strong { color: var(--foreground); }
.swcomp .conn { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 0; }
.swcomp .conn .cl { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
                    color: var(--muted-foreground); text-align: center; max-width: 112px; }
.swcomp .conn .cl.sub { font-weight: 400; text-transform: none; letter-spacing: 0; }
.swcomp .conn svg { transform: rotate(90deg); color: var(--muted-foreground); }
.swcomp .cols { display: grid; gap: 14px; }
/* grid + flex children default to min-width:auto, so one wide paragraph or table
   blows the track out and scrolls the whole page sideways. Pin them to 0. */
.swcomp .cols > *, .swcomp .flow > *, .swcomp .scene > * { min-width: 0; }
.swcomp .shape, .swcomp .shape > p { max-width: 100%; }
.swcomp .lbl { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650;
               text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: 8px; }
.swcomp .lbl.safe { color: var(--safe); }
.swcomp .lbl.attn { color: var(--attn); }

@media (min-width: 760px) {
  .swcomp .flow { flex-direction: row; align-items: center; }
  .swcomp .conn { width: 112px; padding: 0; }
  .swcomp .conn svg { transform: none; }
  .swcomp .cols { grid-template-columns: 1fr 1fr; }
  .swcomp .cols.three { grid-template-columns: repeat(3, 1fr); }
}

/* ── Companion scenes: schematic devices ──────────────────────────────────
   The "what it looks like" drawings, ported from components/companion/scenes.tsx.
   Line-art built from border/surface tokens only — brand red is the logo lockup
   and never appears on chrome (a real macOS status-bar icon is a monochrome
   template image anyway). Green = the connected / recommended cue.
   The client tints are illustrative avatar dots, not app tokens: the app's
   bg-client-* palette is a Tailwind build we cannot hotlink, so these are local
   stand-ins and carry no meaning beyond "these are different people". */
.swcomp { --c1:#7c8cf8; --c2:#e0a458; --c3:#9d7bd8; --c4:#5fb8b0; --c5:#c47ba8; --c6:#8b9dc3; }
.swcomp .scene { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.swcomp .dev { display: flex; flex-direction: column; align-items: center; }
.swcomp .cap { margin-top: 8px; max-width: 210px; text-align: center; }
.swcomp .cap .ct2 { font-size: 11.5px; font-weight: 700; }
.swcomp .cap .cs { font-size: 11px; line-height: 1.45; color: var(--muted-foreground); margin-top: 2px; }
.swcomp .cap .cs strong { color: var(--foreground); }

/* laptop: an inset lid on a slightly wider deck, so it reads as a laptop not a monitor */
.swcomp .laptop { width: 100%; }
.swcomp .laptop > .lid { margin: 0 12px; border: 1px solid var(--border); border-bottom: 0;
        border-radius: 6px 6px 0 0; background: var(--surface-2); padding: 6px; box-shadow: var(--shadow-sm); }
.swcomp .laptop > .lid > .screen { overflow: hidden; border: 1px solid var(--hairline-2);
        border-radius: 3px; background: var(--card); }
.swcomp .laptop > .deck { position: relative; height: 10px; border: 1px solid var(--border);
        border-radius: 0 0 6px 6px; background: var(--surface-2); }
.swcomp .laptop > .deck::after { content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
        height: 4px; width: 48px; border-radius: 0 0 3px 3px; background: var(--hairline-2); }

/* phone: rounded bezel + a thin top notch */
.swcomp .phone { border: 2px solid var(--border); border-radius: 10px; background: var(--surface-2);
        padding: 4px; box-shadow: var(--shadow-sm); }
.swcomp .phone > .screen { position: relative; overflow: hidden; border: 1px solid var(--hairline-2);
        border-radius: 6px; background: var(--card); }
.swcomp .phone > .screen::before { content: ""; position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
        height: 4px; width: 24px; border-radius: 999px; background: var(--hairline-2); }

/* the real macOS menu-bar strip */
.swcomp .mbar { display: flex; align-items: center; justify-content: space-between;
        border-bottom: 1px solid var(--hairline-2); background: var(--surface-2);
        padding: 4px 8px; color: var(--muted-foreground); font-size: 10px; }
.swcomp .mbar .l, .swcomp .mbar .r { display: flex; align-items: center; gap: 8px; }
.swcomp .mbar .l { font-weight: 650; }
.swcomp .mbar svg { width: 12px; height: 12px; }
.swcomp .tray { display: grid; place-items: center; border: 1px solid currentColor; border-radius: 3px;
        width: 13px; height: 13px; font-size: 9px; font-weight: 800; line-height: 1; }
.swcomp .traywrap { position: relative; display: grid; place-items: center; border-radius: 3px; padding: 2px;
        background: var(--safe-bg); box-shadow: 0 0 0 1px var(--safe-bd); color: var(--safe); }
.swcomp .traywrap::after { content: ""; position: absolute; right: -2px; top: -2px; width: 6px; height: 6px;
        border-radius: 50%; background: var(--safe); box-shadow: 0 0 0 1px var(--surface-2); }
.swcomp .clock { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* faux window / browser chrome — the URL pill is the "it's a website" tell */
.swcomp .chrome { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--hairline-2);
        background: var(--surface-2); padding: 6px 8px; }
.swcomp .chrome .dots { display: flex; gap: 4px; }
.swcomp .chrome .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline-2); display: block; }
.swcomp .chrome .url { flex: 1; border: 1px solid var(--hairline-2); border-radius: 999px; background: var(--card);
        padding: 1px 8px; text-align: center; font-family: ui-monospace, Menlo, monospace;
        font-size: 10px; color: var(--muted-foreground); }
.swcomp .chrome .wt { flex: 1; text-align: center; font-size: 10px; font-weight: 650; color: var(--muted-foreground); }

/* schematic content: greeked inbox rows and chat bubbles */
.swcomp .ghost { display: block; height: 4px; border-radius: 999px; background: var(--hairline-2); }
.swcomp .inbox > div { display: flex; align-items: center; gap: 6px; padding: 6px;
        border-bottom: 1px solid var(--hairline-2); }
.swcomp .inbox > div:last-child { border-bottom: 0; }
.swcomp .inbox .av { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.swcomp .inbox .ln { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.swcomp .chat { display: flex; flex-direction: column; height: 100%; }
.swcomp .chat .body { flex: 1; background: var(--surface-2); padding: 8px; display: flex;
        flex-direction: column; gap: 6px; }
.swcomp .chat .bin { width: 60%; border: 1px solid var(--hairline-2); background: var(--card);
        border-radius: 6px 6px 6px 0; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.swcomp .chat .bout { width: 50%; margin-left: auto; background: var(--safe-bg); border-radius: 6px 6px 0 6px; padding: 6px; }
.swcomp .composer { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--hairline-2);
        background: var(--card); padding: 6px; }
.swcomp .composer .fld { height: 16px; flex: 1; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.swcomp .composer .snd { display: grid; place-items: center; width: 16px; height: 16px; flex: none;
        border-radius: 50%; background: var(--primary); color: var(--primary-foreground); }
.swcomp .composer .snd svg { width: 9px; height: 9px; }
.swcomp .sidebar { width: 52px; flex: none; border-right: 1px solid var(--hairline-2);
        background: var(--surface-2); padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.swcomp .sidebar .it { display: flex; align-items: center; gap: 4px; border-radius: 3px; padding: 2px 4px; }
.swcomp .sidebar .it.on { background: var(--card); }
.swcomp .sidebar .it i { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline-2); display: block; }
.swcomp .sidebar .it.on i { background: var(--primary); }

/* the shape-comparison cards */
.swcomp .shape { border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 16px; }
.swcomp .shape.rec { border-color: var(--safe-bd); border-left: 2px solid var(--safe); }
.swcomp .shape > .sh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; }
.swcomp .shape > p { font-size: 12px; line-height: 1.6; color: var(--muted-foreground); margin: 12px 0 0; }
.swcomp .shape > p strong { color: var(--foreground); }

@media (min-width: 760px) {
  .swcomp .scene { flex-direction: row; justify-content: center; }
}

/* pros / cons cell — a tinted-marker mini list so a comparison table stays scannable */
.swcomp .pc { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; line-height: 1.5; }
.swcomp .pc > div { display: flex; gap: 6px; }
.swcomp .pc .p { font-weight: 700; color: var(--safe); }
.swcomp .pc .c { font-weight: 700; color: var(--danger); }
.swcomp .pc > div.con { color: var(--muted-foreground); }
/* an option cell: name over its badge */
.swcomp .opt { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; font-weight: 700; }

/* Companion UI mockups — the tray popover and the reply composer. Lightweight
   representations, not the real app; tokens only, no brand red on chrome. */
.swcomp .mockrow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px;
        border: 1px solid var(--border); background: var(--background); border-radius: 12px; padding: 20px; }
.swcomp .capd > .cl2 { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
        color: var(--muted-foreground); margin-bottom: 8px; }
.swcomp .pop { width: 280px; overflow: hidden; border: 1px solid var(--border); background: var(--card);
        border-radius: 10px; box-shadow: var(--shadow-sm); }
.swcomp .pop > div { border-top: 1px solid var(--hairline-2); padding: 10px 14px; }
.swcomp .pop > div:first-child { border-top: 0; }
.swcomp .pop .rowb { display: flex; align-items: center; justify-content: space-between; }
.swcomp .pop .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted-foreground); }
.swcomp .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--safe); display: inline-block; flex: none; }
.swcomp .sw { position: relative; display: inline-flex; width: 28px; height: 16px; border-radius: 999px;
        background: var(--primary); flex: none; }
.swcomp .sw::after { content: ""; position: absolute; right: 2px; top: 2px; width: 12px; height: 12px;
        border-radius: 50%; background: var(--primary-foreground); }
.swcomp .comp { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 6px; }
.swcomp .comp .warnline { display: flex; align-items: center; gap: 6px; padding: 0 4px;
        font-size: 11px; font-weight: 550; color: var(--caution); }
.swcomp .comp .fieldrow { display: flex; align-items: flex-end; gap: 8px; }
.swcomp .comp .field { flex: 1; border: 1px solid var(--border); background: var(--surface-2);
        border-radius: 20px; padding: 10px 14px; font-size: 13.5px; color: var(--muted-foreground); }
.swcomp .comp .field.filled { color: var(--foreground); }
.swcomp .comp .sendbtn { display: grid; place-items: center; width: 42px; height: 42px; flex: none;
        border-radius: 50%; background: var(--primary); color: var(--primary-foreground); }
.swcomp .comp .sendbtn svg { width: 16px; height: 16px; }
/* phase lists that start at zero (Phase 0 = the honesty fix, before any build) */
.swcomp ol.steps.from0 { counter-reset: s -1; }

/* ── System-model flowchart ───────────────────────────────────────────────
   A tall top-to-bottom diagram, ported from components/companion/system-model.tsx.
   Colour law is load-bearing here, not decorative:
     green (safe)  = YOUR data + YOUR devices — laptop vault, phone, encrypted shards
     violet (mtag) = coordination / method — the service's shape, updates, shard index
     pink (attn)   = the safety relay — hashed flags + the check-in dead-man's-switch
     neutral       = ingress channels (no value judgement)
   Brand red is the logo lockup only and never appears on this chrome. */
.swcomp .legend { display: grid; gap: 8px; border: 1px solid var(--border); background: var(--card);
        border-radius: 10px; padding: 12px; }
.swcomp .legend > div { display: flex; gap: 8px; }
.swcomp .legend .sw2 { width: 20px; flex: none; display: flex; justify-content: center; padding-top: 2px; }
.swcomp .legend .lt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.swcomp .legend .lb { font-size: 12px; line-height: 1.5; color: var(--muted-foreground); margin-top: 2px; }
.swcomp .legend .lb strong { color: var(--foreground); }
.swcomp .sq { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--safe-bd); background: var(--safe); display: block; }
.swcomp .dash { width: 20px; height: 0; border-top: 2px dashed var(--mtag); align-self: center; display: block; }

/* vertical flow connector */
.swcomp .farrow { display: flex; flex-direction: column; align-items: center; padding: 6px 0; }
.swcomp .farrow .rule { height: 16px; width: 0; border-left: 2px solid var(--border); }
.swcomp .farrow svg { margin-top: -4px; color: var(--muted-foreground); width: 16px; height: 16px; }
.swcomp .farrow .fl { margin-top: 4px; max-width: 22rem; text-align: center; font-size: 10.5px;
        font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); }
.swcomp .farrow.meta .rule { border-left-style: dashed; border-left-color: var(--mtag); }
.swcomp .farrow.meta svg, .swcomp .farrow.meta .fl { color: var(--mtag); }
.swcomp .farrow.safety .rule { border-left-color: var(--attn-bd); }
.swcomp .farrow.safety svg, .swcomp .farrow.safety .fl { color: var(--attn); }

/* the vault — the visual anchor */
.swcomp .vault { border: 2px solid var(--safe-bd); background: var(--safe-bg); border-radius: 10px; padding: 16px; }
.swcomp .vault .vh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.swcomp .vault .vh svg { color: var(--safe); width: 19px; height: 19px; }
.swcomp .vault .vs { margin-top: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 10.5px;
        text-transform: uppercase; letter-spacing: .05em; color: var(--safe); }
.swcomp .vault .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.swcomp .vault .tags span { border: 1px solid var(--safe-bd); background: var(--card); border-radius: 6px;
        padding: 2px 8px; font-size: 12px; font-weight: 550; }

/* peer backup mesh */
.swcomp .peers { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 8px; margin-top: 12px; }
.swcomp .peer { width: 112px; display: flex; flex-direction: column; align-items: center; text-align: center;
        border: 1px solid var(--safe-bd); background: var(--card); border-radius: 10px; padding: 8px; }
.swcomp .peer .pi { display: flex; align-items: center; gap: 4px; color: var(--safe); }
.swcomp .peer .pn { margin-top: 4px; font-size: 11.5px; font-weight: 700; }
.swcomp .peer .pd { font-size: 10.5px; line-height: 1.35; color: var(--muted-foreground); }
.swcomp .tie { width: 14px; height: 14px; align-self: center; flex: none; color: var(--safe); opacity: .7; }
.swcomp .metaline { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px;
        font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--mtag); }
.swcomp .metaline::before { content: ""; width: 24px; height: 0; border-top: 1px dashed var(--mtag); flex: none; }

/* the central service */
.swcomp .svc { border: 2px solid var(--mtag-bd); background: var(--card); border-radius: 10px; padding: 16px; }
.swcomp .svc .sh2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.swcomp .svc .sh2 svg { color: var(--mtag); width: 19px; height: 19px; }
.swcomp .svc .ss { margin-top: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 10.5px;
        text-transform: uppercase; letter-spacing: .05em; color: var(--mtag); }
.swcomp .svc blockquote { margin: 10px 0 0; border-left: 2px solid var(--mtag-bd); padding-left: 12px;
        font-style: italic; font-size: 13.5px; line-height: 1.6; }
.swcomp .svcpart { border: 1px solid var(--border); border-left: 2px solid var(--mtag); background: var(--card);
        border-radius: 10px; padding: 12px; }
.swcomp .svcpart.safety { border-left-color: var(--attn); }
.swcomp .svcpart .ph { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.swcomp .svcpart .num { display: grid; place-items: center; width: 20px; height: 20px; flex: none;
        border-radius: 50%; border: 1px solid var(--mtag-bd); background: var(--mtag-bg); color: var(--mtag);
        font-size: 11px; font-weight: 800; }
.swcomp .svcpart.safety .num { border-color: var(--attn-bd); background: var(--attn-bg); color: var(--attn); }
.swcomp .svcpart .pb { margin-top: 6px; font-size: 12px; line-height: 1.55; color: var(--muted-foreground); }
.swcomp .svcpart .pb strong { color: var(--foreground); }

/* ingress + small nodes in the check-in strip */
.swcomp .ingress { border: 1px dashed var(--border); background: var(--surface-2); border-radius: 10px; padding: 12px; }
.swcomp .ingress .row2 { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 8px; }
.swcomp .chan { width: 160px; display: flex; flex-direction: column; align-items: center; text-align: center;
        border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 10px 12px; }
.swcomp .chan .cn { margin-top: 4px; font-size: 13.5px; font-weight: 650; }
.swcomp .chan .cd { margin-top: 2px; font-size: 10.5px; line-height: 1.35; color: var(--muted-foreground); }
.swcomp .minode { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%;
        border: 1px solid var(--safe-bd); background: var(--card); border-radius: 10px; padding: 10px 12px; }
.swcomp .minode.attn { border-color: var(--attn-bd); }
.swcomp .minode.attn.fill { background: var(--attn-bg); }
.swcomp .minode svg { width: 19px; height: 19px; color: var(--safe); }
.swcomp .minode.attn svg { color: var(--attn); }
.swcomp .minode .mn { margin-top: 4px; font-size: 13.5px; font-weight: 700; }
.swcomp .minode .md { margin-top: 2px; font-size: 10.5px; line-height: 1.35; color: var(--muted-foreground); }
.swcomp .checkin { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px; }
.swcomp .checkin .conn svg { color: var(--muted-foreground); }
.swcomp .checkin .conn.attn svg, .swcomp .checkin .conn.attn .cl { color: var(--attn); }

@media (min-width: 760px) {
  .swcomp .legend { grid-template-columns: repeat(3, 1fr); }
  .swcomp .checkin { flex-direction: row; align-items: center; }
  .swcomp .minode { width: 176px; }
}
