/* Copyright (c) 2024-2026 Jiangsu Cytoderm Intelligent Technology Co., Ltd.
   SPDX-License-Identifier: LicenseRef-Cytoderm-Proprietary
   Confidential and proprietary. All rights reserved. */

/* CyboPost design system — a single build-free stylesheet shared by the
   user app, the admin console and the register page. Light/dark via a
   data-theme attribute on <html> (falls back to the OS preference). */

:root {
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC",
    "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, 0.18);
  --speed: 0.16s;
}

/* Light (default) */
:root,
:root[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-subtle: #f0f2f5;
  --bg-hover: #f2f4f7;
  --fg: #14181f;
  --fg-muted: #5b6675;
  --fg-faint: #8a94a3;
  --line: #e4e8ee;
  --line-strong: #d3d9e2;
  --accent: #4f46e5;
  --accent-fg: #ffffff;
  --accent-soft: #eef0fe;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf2e3;
  --err: #dc2626;
  --err-soft: #fdeceb;
  --info: #0369a1;
  --info-soft: #e6f2fb;
  --ring: rgba(79, 70, 229, 0.35);
}

/* Dark */
:root[data-theme="dark"] {
  --bg: #0c0e13;
  --bg-elev: #14171d;
  --bg-subtle: #181c23;
  --bg-hover: #1d222b;
  --fg: #e7eaef;
  --fg-muted: #9aa4b2;
  --fg-faint: #868f9e; /* WCAG AA: ≥4.5:1 on --bg (#0c0e13) */
  --line: #242a33;
  --line-strong: #313844;
  --accent: #7c75ff;
  --accent-fg: #0c0e13;
  --accent-soft: #1d1f3a;
  --ok: #4ade80;
  --ok-soft: #14271c;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --err: #f87171;
  --err-soft: #2a1514;
  --info: #56b6f0;
  --info-soft: #102330;
  --ring: rgba(124, 117, 255, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

/* `hidden` is a state contract. Component display rules (for example `.gate`
   and `.workspace`) must never make a hidden element visible again. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "tnum";
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  margin: 0 0 0.4em;
  font-weight: 680;
  letter-spacing: -0.022em;
  line-height: 1.2;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 0.98rem; }

.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.mono { font-family: var(--mono); }
.small { font-size: 0.82rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.cluster { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  grid-template-rows: 100%;
  height: 100%;
}
.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 1.15rem 0.9rem;
  font-weight: 720;
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}
.brand .logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #000 url("/favicon.svg") center / 142% no-repeat;
  color: transparent; /* hide the legacy "C" glyph; the mark is the background */
  font-size: 0;
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.5rem 0.55rem;
  overflow-y: auto;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 0.875rem;
  font-weight: 530;
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.nav a:hover {
  background: color-mix(in srgb, var(--bg-hover) 70%, transparent);
  color: var(--fg);
  text-decoration: none;
}
.nav a.active {
  background: var(--bg-elev);
  color: var(--fg);
  font-weight: 620;
  box-shadow: var(--shadow-sm);
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--accent);
}
.nav a.active .ico { color: var(--accent); opacity: 1; }
.nav a .ico { width: 18px; text-align: center; opacity: 0.7; }
.nav a .badge { margin-left: auto; }
.domain-nav-group {
  margin: 0.35rem 0.55rem 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.domain-nav { padding: 0; }
.domain-nav-state {
  padding: 0.45rem 0.7rem;
  color: var(--fg-faint);
  font-size: 0.78rem;
}
.domain-nav-retry {
  margin: 0 0.55rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--err);
  border-radius: var(--radius-sm);
  background: var(--err-soft);
  color: var(--err);
  text-align: left;
  cursor: pointer;
}
.nav-sep {
  margin: 0 0.7rem 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}
.sidebar-foot {
  margin-top: auto;
  padding: 0.8rem 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--fg-muted);
}
/* Who-you-are block under the brand in the member workspace sidebar. */
.sidebar-id {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0.55rem 0.5rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar { padding: 0.75rem 1.6rem; }
.topbar h1 { font-size: 1.15rem; margin: 0; letter-spacing: -0.025em; }
.content {
  padding: 1.8rem 1.6rem 4rem;
  overflow-y: auto;
  flex: 1;
}
.content-narrow { max-width: 960px; margin-inline: auto; width: 100%; }

/* ---------- Account workspace home ---------- */
.account-home { display: grid; gap: 1.25rem; }
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 38%),
    linear-gradient(145deg, var(--bg-elev), color-mix(in srgb, var(--accent-soft) 58%, var(--bg-elev)));
  box-shadow: var(--shadow-sm);
}
.home-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 11rem;
  height: 11rem;
  right: -5rem;
  bottom: -6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 2.7rem color-mix(in srgb, var(--accent) 5%, transparent);
}
.home-hero-copy { max-width: 39rem; }
.home-kicker {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.11em;
}
.home-hero h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.16;
  letter-spacing: -0.035em;
}
.home-hero p { max-width: 38rem; margin: 0.75rem 0 0; color: var(--fg-muted); }
.home-hero-actions { display: flex; flex: none; flex-direction: column; gap: 0.55rem; }
.home-section {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.home-section-head,
.home-section-head > div,
.home-overview-head,
.home-overview-head > div {
  display: flex;
  align-items: center;
}
.home-section-head { justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.home-section-head > div { min-width: 0; gap: 0.6rem; }
.home-section-head h3,
.home-overview-head h3 { margin: 0; font-size: 1rem; letter-spacing: -0.02em; }
.home-section-index { color: var(--accent); font-family: var(--mono); font-size: 0.72rem; font-weight: 750; }
.home-agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.home-agent-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed), transform var(--speed), box-shadow var(--speed);
}
.home-agent-card:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.home-agent-card:focus-visible,
.home-quick-list button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.home-agent-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.home-agent-card strong,
.home-agent-card small,
.home-quick-list strong,
.home-quick-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-agent-card small,
.home-quick-list small { color: var(--fg-muted); }
.home-agent-mark,
.home-overview-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
}
.home-agent-mark { width: 2.2rem; height: 2.2rem; border-radius: 9px; }
.home-onboarding-empty {
  display: grid;
  justify-items: start;
  gap: 0.4rem;
  padding: 1.15rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.home-onboarding-empty p { margin: 0 0 0.35rem; color: var(--fg-muted); }
.home-collaboration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.home-overview-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.home-overview-head { justify-content: space-between; gap: 0.75rem; }
.home-overview-head > div { min-width: 0; gap: 0.55rem; }
.home-overview-icon { width: 1.9rem; height: 1.9rem; border-radius: 8px; }
.home-overview-card > p { min-height: 2.8em; margin: 0.55rem 0 0.75rem; color: var(--fg-muted); font-size: 0.86rem; }
.home-quick-list { display: flex; min-height: 7.4rem; flex-direction: column; gap: 0.35rem; }
.home-quick-list > button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.home-quick-list > button:hover { background: var(--bg-hover); }
.home-quick-list > button > span:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.home-quick-empty { display: grid; flex: 1; place-items: center; min-height: 5rem; color: var(--fg-faint); font-size: 0.86rem; text-align: center; }
.home-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.46rem 0.85rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--fg);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  transition: background var(--speed), border-color var(--speed),
    transform var(--speed), box-shadow var(--speed);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { padding: 0.28rem 0.6rem; font-size: 0.82rem; }
.btn.icon { padding: 0.4rem; width: 34px; height: 34px; }

/* ---------- Language picker (custom, content-sized, no native <select>) ---------- */
/* A pill button + popdown menu. Auto-sizes to the active language label, so it
   never reserves the width of the widest locale. Inherits currentColor, so the
   same widget reads correctly on the app chrome AND the dark landing nav. */
.lang-pick {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  font: inherit;
  line-height: 1;
}
.lang-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  padding: 0.34rem 0.62rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--fg);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--speed), border-color var(--speed),
    color var(--speed), box-shadow var(--speed);
}
.lang-pick-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.lang-pick-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.lang-pick.is-open .lang-pick-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
.lang-pick-globe { flex: none; opacity: 0.85; }
.lang-pick-btn:hover .lang-pick-globe,
.lang-pick.is-open .lang-pick-globe { opacity: 1; }
.lang-pick-cur { display: inline-block; }
.lang-pick-chev {
  flex: none;
  margin-left: -0.04rem;
  opacity: 0.6;
  transition: transform var(--speed), opacity var(--speed);
}
.lang-pick.is-open .lang-pick-chev { transform: rotate(180deg); opacity: 0.9; }

/* The popdown menu — hidden by default, animated open (opacity + translateY). */
.lang-pick-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 50;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.3rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--speed) ease, transform var(--speed) ease;
}
.lang-pick.is-open .lang-pick-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.lang-pick-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.lang-pick-item:hover { background: var(--bg-hover); }
.lang-pick-item:focus-visible { outline: none; background: var(--bg-hover); }
.lang-pick-item .lang-pick-label { flex: 1; }
.lang-pick-item.is-active { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.lang-pick-check { flex: none; color: var(--accent); }

/* Compact variant used in inline rows (account/admin/register footers). */
.lang-pick.sm .lang-pick-btn { padding: 0.26rem 0.5rem; font-size: 0.8rem; }

@media (prefers-reduced-motion: reduce) {
  .lang-pick-menu, .lang-pick-chev { transition: none; }
}

/* ---------- Inline line-icons (CP.icon) ---------- */
/* Stroke icons that inherit text colour and sit on the text baseline. In
   flex contexts (buttons, tab bar) they centre automatically. */
.ico { flex: none; vertical-align: -0.18em; }
.btn .ico, .tab-btn .ico, .nav a .ico { vertical-align: middle; }

/* ---------- Avatar (flat, rounded-square, mono initial) ---------- */
/* Deliberately NOT a colourful gradient circle — a calm monospace tile reads
   as infrastructure, not a consumer chat app. */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #a78bfa));
  color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.avatar.sm { width: 2.1rem; height: 2.1rem; border-radius: 9px; font-size: 0.9rem; }
.avatar.lg { width: 3.1rem; height: 3.1rem; border-radius: 13px; font-size: 1.3rem; }

/* Profile header (account card) */
.profile-head { display: flex; align-items: center; gap: 0.9rem; }

/* Identity chips: label + copyable-looking mono value */
.id-grid {
  margin-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.id-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.id-label {
  flex: none;
  min-width: 6.5rem;
  font-size: 0.78rem;
  font-weight: 560;
  color: var(--fg-faint);
}
.id-val {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--fg);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.55rem;
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed);
}
.id-val:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Member management — hairline-separated rows inside the card */
.member-list { display: flex; flex-direction: column; }
.member-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.1rem;
  border-top: 1px solid var(--line);
}
.member-row:first-child { border-top: none; padding-top: 0.2rem; }
.member-info { min-width: 0; flex: 1; }
.member-name { display: flex; align-items: center; gap: 0.5rem; }
.member-name strong { letter-spacing: -0.01em; }
.member-sub { margin-top: 0.15rem; overflow: hidden; text-overflow: ellipsis; }
.member-actions { display: flex; align-items: center; gap: 0.25rem; flex: none; }
.member-row .avatar.sm { background: var(--bg-subtle); color: var(--fg-muted); box-shadow: none; border: 1px solid var(--line); font-family: var(--mono); }
.btn.icon.sm { width: 30px; height: 30px; padding: 0; }
.btn.icon.sm svg { width: 15px; height: 15px; }

/* ---------- Tabs (segmented control) ---------- */
.tabnav {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-weight: 550;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { background: var(--bg-elev); color: var(--fg); box-shadow: var(--shadow-sm); }
.tab-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.tab-btn .ico { opacity: 0.85; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 1.5rem 1.6rem; }
.card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.card-head h3 { margin: 0; font-size: 1.02rem; letter-spacing: -0.02em; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

/* Stat tile */
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat .label { font-size: 0.82rem; color: var(--fg-muted); font-weight: 550; }
.stat .value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .sub { font-size: 0.78rem; color: var(--fg-faint); }
.stat .value.accent { color: var(--accent); }

/* ---------- Inputs ---------- */
label.field { display: block; margin: 0.6rem 0; }
label.field > span {
  display: block;
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-weight: 550;
  margin-bottom: 0.25rem;
}
.field-hint { display: block; margin-top: 0.35rem; color: var(--fg-faint); font-size: 0.76rem; }
.agent-create-intro { margin: 0 0 1rem; color: var(--fg-muted); }
.agent-identity-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}
.agent-identity-preview span { flex: none; color: var(--fg-muted); font-size: 0.78rem; }
.agent-identity-preview code { min-width: 0; overflow: hidden; color: var(--accent); font-family: var(--mono); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.agent-create-footnote { margin: 0.75rem 0 0; color: var(--fg-muted); font-size: 0.78rem; }
.agent-handoff { min-height: 15rem; }
.agent-handoff-loading { display: grid; gap: 0.7rem; color: var(--fg-muted); text-align: center; }
.agent-handoff-intro { margin: 0 0 0.9rem; color: var(--fg-muted); }
.agent-handoff-profile { display: grid; gap: 0.45rem; margin: 0 0 0.9rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-subtle); }
.agent-handoff-profile > div { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: 0.75rem; align-items: baseline; }
.agent-handoff-profile span { color: var(--fg-muted); font-size: 0.75rem; }
.agent-handoff-profile strong { min-width: 0; overflow-wrap: anywhere; font-size: 0.82rem; font-weight: 600; }
.agent-handoff-prompt {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.agent-handoff-prompt > span { display: block; padding: 0.55rem 0.75rem; border-bottom: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); color: var(--accent); font-size: 0.75rem; font-weight: 650; }
.agent-handoff-prompt pre { min-height: 8rem; margin: 0; padding: 0.8rem; overflow: auto; background: transparent; font: 0.82rem/1.65 var(--font); white-space: pre-wrap; word-break: break-word; }
.agent-handoff-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem; }
.agent-handoff-actions .btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.agent-handoff-meta { display: flex; align-items: center; gap: 0.55rem; margin-top: 0.85rem; color: var(--fg-muted); font-size: 0.76rem; }
.agent-handoff-link { display: grid; gap: 0.25rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.agent-handoff-link span { color: var(--fg-muted); font-size: 0.75rem; }
.agent-handoff-link a { overflow: hidden; font-family: var(--mono); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.agent-handoff-after { margin: 0.75rem 0 0; color: var(--fg-muted); font-size: 0.78rem; }
input, textarea, select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--fg);
  font: inherit;
  transition: border-color var(--speed), box-shadow var(--speed);
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}
textarea { min-height: 5em; resize: vertical; line-height: 1.5; }
input.mono { font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 0.4rem; width: auto; }
.check input { width: auto; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--fg-muted);
}
.badge.dot::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.err { color: var(--err); background: var(--err-soft); border-color: transparent; }
.badge.info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.active { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge.read_only { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.badge.suspended { color: var(--err); background: var(--err-soft); border-color: transparent; }

.prio { display:inline-grid; place-items:center; min-width: 1.5em; height: 1.5em; border-radius: 5px; color:#fff; font-size: 0.72rem; font-weight: 700; }
.prio.p1 { background: var(--err); }
.prio.p2 { background: #d97706; }
.prio.p3 { background: var(--accent); }
.prio.p4 { background: var(--fg-faint); }

/* ---------- Tables ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
table { border-collapse: collapse; width: 100%; }
thead th {
  background: var(--bg-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--speed); }
tbody tr:hover { background: var(--bg-hover); }

/* ---------- Lists / messages ---------- */
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.list-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed), transform var(--speed);
}
.list-item:hover { background: var(--bg-hover); transform: translateX(2px); }
.list-item.unread { border-left: 3px solid var(--accent); }
.list-item .head { display: flex; align-items: center; gap: 0.5rem; }
.list-item .who { font-weight: 600; }

.bubble {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 0.6rem 0.8rem;
}
.bubble .meta { font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 0.25rem; }

pre {
  background: var(--bg-subtle);
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.86rem;
  margin: 0.4rem 0 0;
}

/* ---------- Rendered Markdown (message / post / todo bodies) ---------- */
.md { font-size: 0.9rem; line-height: 1.6; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0.4rem 0; }
.md h3 { font-size: 0.98rem; margin: 0.7rem 0 0.3rem; }
.md h4 { font-size: 0.9rem; margin: 0.6rem 0 0.25rem; }
.md ul, .md ol { margin: 0.4rem 0; padding-left: 1.4rem; }
.md li { margin: 0.15rem 0; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.32rem;
}
.md pre.md-code {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0.5rem 0;
}
.md pre.md-code code { background: none; border: none; padding: 0; }
.md strong { font-weight: 650; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; }
.kcol { background: var(--bg-subtle); border-radius: var(--radius); padding: 0.7rem; min-height: 140px; }
.kcol > h4 {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--fg-muted); margin: 0.2rem 0.2rem 0.7rem;
}
.kcol .count { margin-left: auto; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; padding: 0 0.45rem; font-size: 0.72rem; }
.kcard {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.55rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--speed), box-shadow var(--speed);
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kcard .title { font-weight: 600; margin: 0.2rem 0; }

/* ---------- Progress ---------- */
.meter { height: 7px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width var(--speed); }
.meter.warn > span { background: var(--warn); }
.meter.err > span { background: var(--err); }

/* ---------- Dialog / modal ---------- */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 720px;
  width: 92%;
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(8, 10, 14, 0.55); backdrop-filter: blur(2px); }
dialog .dlg-head { display: flex; align-items: center; gap: 0.6rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
dialog .dlg-body { padding: 1.1rem 1.2rem; max-height: 70vh; overflow-y: auto; }
dialog .dlg-foot { padding: 0.8rem 1.2rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 50;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 360px;
}
.toast {
  display: flex; align-items: flex-start; gap: 0.5rem;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 0.65rem 0.8rem;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.toast .msg { font-size: 0.88rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Skeleton / empty / states ---------- */
.skeleton { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-hover) 37%, var(--bg-subtle) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-line { height: 0.9rem; margin: 0.5rem 0; }
.empty { text-align: center; color: var(--fg-faint); padding: 2.4rem 1rem; }
.empty .ico { display: block; margin: 0 auto 0.5rem; color: var(--fg-faint); opacity: 0.8; }
.error-box { color: var(--err); background: var(--err-soft); border: 1px solid color-mix(in srgb, var(--err) 30%, transparent); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }

/* ---------- Section header ---------- */
.section-head { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 1rem; }
.section-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; border-radius: 0; background: var(--bg-elev); padding: 0.35rem 0.75rem; cursor: pointer; color: var(--fg-muted); font: inherit; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: var(--accent-fg); }

/* ---------- Resume intake ---------- */
.resume-page { min-height: 100%; }
.resume-content { padding-top: clamp(1.4rem, 4vw, 3rem); }
.resume-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.resume-intro .eyebrow {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.resume-intro h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.25rem); }
.resume-intro p { max-width: 44rem; margin: 0.65rem 0 0; color: var(--fg-muted); }
.resume-drop {
  width: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--speed), background var(--speed), box-shadow var(--speed), transform var(--speed);
}
.resume-drop:hover,
.resume-drop.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--ring);
}
.resume-drop.is-dragging { transform: scale(1.005); }
.resume-drop:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.resume-drop strong { font-size: 1.1rem; }
.resume-drop > span:not(.resume-drop-icon):not(.btn) { color: var(--fg-muted); }
.resume-drop .btn { pointer-events: none; margin-top: 0.25rem; }
.resume-drop-icon {
  width: 3.3rem;
  height: 3.3rem;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
.resume-drop-icon::before {
  content: "PDF";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 800;
}
.resume-security,
.resume-ids-hint { margin: 0.85rem 0 0; color: var(--fg-muted); font-size: 0.82rem; }
.resume-queue-card { margin-top: 1.1rem; }
.resume-file-list { display: flex; flex-direction: column; gap: 0.6rem; }
.resume-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(190px, auto);
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.resume-file-row.ok { border-color: color-mix(in srgb, var(--ok) 42%, var(--line)); background: var(--ok-soft); }
.resume-file-row.failed { border-color: color-mix(in srgb, var(--err) 42%, var(--line)); background: var(--err-soft); }
.resume-file-mark { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--fg-muted); }
.resume-file-row.ok .resume-file-mark { color: var(--ok); }
.resume-file-row.failed .resume-file-mark { color: var(--err); }
.resume-file-meta { display: flex; min-width: 0; flex-direction: column; }
.resume-file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-file-meta small { color: var(--fg-muted); }
.resume-file-status { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 0.55rem; color: var(--fg-muted); }
.resume-file-status code { overflow: hidden; max-width: 20rem; color: var(--ok); text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Gate (token entry) ---------- */
.gate { display: grid; place-items: center; height: 100%; padding: 1.5rem; }
.gate .panel { width: 100%; max-width: 420px; }
.gate .panel .card { padding: 1.6rem 1.6rem 1.4rem; }
.boot-loading { color: var(--fg-muted); text-align: center; }
.boot-failure { display: grid; justify-items: start; gap: 0.75rem; }
.boot-failure h1 { margin: 0; font-size: 1.2rem; }
.boot-failure p { margin: 0; color: var(--fg-muted); }
.boot-failure .error-box { width: 100%; }
.boot-failure-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--err-soft); color: var(--err); }
.boot-failure .btn { margin-top: 0.15rem; }

/* SVG graph nodes */
svg .gnode rect { fill: var(--bg-elev); stroke: var(--line-strong); }
svg .gnode.done rect { fill: var(--ok-soft); stroke: var(--ok); }
svg .gnode.claimed rect { fill: var(--warn-soft); stroke: var(--warn); }
svg .gnode.blocked rect { fill: var(--err-soft); stroke: var(--err); }
svg .gnode text { fill: var(--fg); font-size: 11px; }
svg .gnode text.sub { fill: var(--fg-muted); }
svg .gedge { stroke: var(--fg-faint); fill: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0.7rem 1rem; }
  .nav { flex-direction: row; padding: 0.4rem; }
  .nav a .label { display: none; }
  .domain-nav-group { display: contents; }
  .nav-sep, .sidebar-foot { display: none; }
  .kanban { grid-template-columns: 1fr 1fr; }
  .home-hero { align-items: flex-start; flex-direction: column; }
  .home-hero-actions { flex-direction: row; }
}
@media (max-width: 560px) {
  .kanban { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .resume-page .topbar { flex-wrap: wrap; padding-inline: 1rem; }
  .resume-drop { min-height: 220px; padding: 1.25rem; }
  .resume-file-row { grid-template-columns: auto minmax(0, 1fr); }
  .resume-file-status { grid-column: 1 / -1; justify-content: flex-start; padding-left: 2.75rem; }
  .home-agent-grid,
  .home-collaboration-grid { grid-template-columns: 1fr; }
  .home-hero-actions { width: 100%; flex-direction: column; }
  .home-hero-actions .btn { width: 100%; }
  .home-section { padding: 0.9rem; }
  .agent-identity-preview { align-items: flex-start; flex-direction: column; }
  .agent-handoff-actions,
  .agent-handoff-meta { align-items: stretch; flex-direction: column; }
  .agent-handoff-actions .btn { width: 100%; }
}

/* ---------- Classic split-panel auth (register + login gates) ---------- */
.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}
/* left: a calm, premium brand panel (deep aurora + drifting starfield) */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 4vw, 3.6rem);
  color: #eaf0ff;
  background:
    radial-gradient(58% 48% at 18% 22%, rgba(94, 234, 212, 0.16), transparent 60%),
    radial-gradient(52% 50% at 86% 78%, rgba(123, 162, 255, 0.22), transparent 62%),
    linear-gradient(155deg, #0a1024 0%, #070a18 58%, #05060e 100%);
}
.auth-brand::before { /* drifting starfield */
  content: "";
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.2px 1.2px at 75% 20%, rgba(190, 215, 255, 0.6), transparent),
    radial-gradient(1.6px 1.6px at 40% 70%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.1px 1.1px at 88% 64%, rgba(160, 200, 255, 0.6), transparent),
    radial-gradient(1.3px 1.3px at 60% 48%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.1px 1.1px at 12% 84%, rgba(190, 215, 255, 0.5), transparent);
  background-size: 320px 320px;
  opacity: 0.7;
  animation: auth-drift 90s linear infinite;
}
@keyframes auth-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-160px, -160px, 0); } }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .wordmark { display: flex; align-items: center; gap: 0.65rem; font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em; }
.auth-brand .wordmark .logo {
  width: 34px; height: 34px; border-radius: 10px; color: transparent; font-size: 0;
  background: #000 url("/favicon.svg") center / 142% no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 28px rgba(80, 110, 255, 0.35);
}
.auth-brand .pitch { max-width: 26rem; }
.auth-brand .pitch h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.18; letter-spacing: -0.02em; font-weight: 750; margin: 0 0 0.9rem;
  background: linear-gradient(180deg, #ffffff, #b9c6ee); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-brand .pitch p { color: #9fb0d6; font-size: 0.98rem; line-height: 1.7; margin: 0; }
.auth-brand .points { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-direction: column; gap: 0.7rem; }
.auth-brand .points li { display: flex; align-items: center; gap: 0.6rem; color: #c7d3f0; font-size: 0.92rem; }
.auth-brand .points li::before { content: "✦"; color: #5eead4; font-size: 0.8rem; }
.auth-brand .foot { color: #6b7799; font-size: 0.82rem; }

/* right: clean themed form pane */
.auth-pane {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.6rem, 4vw, 3rem);
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 392px; }
.auth-card .eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); text-transform: uppercase; }
.auth-card h1 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0.35rem 0 0.4rem; }
.auth-card .sub { color: var(--fg-muted); font-size: 0.92rem; margin: 0 0 1.4rem; line-height: 1.6; }
.auth-card .btn-row { margin-top: 1.2rem; display: flex; gap: 0.6rem; align-items: center; }
.auth-card .alt { margin-top: 1.4rem; font-size: 0.86rem; color: var(--fg-muted); }
.auth-card .btn.block { width: 100%; padding: 0.62rem; font-size: 0.98rem; }

@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 1.6rem 1.4rem; min-height: auto; flex-direction: row; align-items: center; gap: 1rem; }
  .auth-brand .pitch, .auth-brand .points, .auth-brand .foot { display: none; }
  .auth-pane { align-items: flex-start; }
}

/* ---------- Accessibility ---------- */
/* Visible focus for custom keyboard-interactive elements (WCAG 2.4.7). */
.nav a:focus-visible,
.list-item:focus-visible,
.kcard:focus-visible,
.seg button:focus-visible,
tbody tr[role="button"]:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--radius-sm);
}
.list-item[role="button"], .kcard[role="button"], tbody tr[role="button"] { cursor: pointer; }

/* Skip-to-content link: off-screen until focused (WCAG 2.4.1). */
.skip-link {
  position: absolute;
  left: 0.6rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.15s;
}
.skip-link:focus { top: 0.6rem; text-decoration: none; outline: 2px solid #fff; }
