* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-strong: #f5f5f5;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-soft-glass: rgba(255, 255, 255, 0.82);
  --surface-card: #ffffff;
  --input-bg: #ffffff;
  --ink: #090b0f;
  --muted: #8a9299;
  --line: #e2e2e2;
  --line-strong: #d6d6d6;
  --accent: #111318;
  --accent-strong: #000000;
  --accent-soft: #e2e2e2;
  --page-glow: transparent;
  --focus-ring: rgba(17, 19, 24, 0.2);
  --ok: #277a56;
  --warn: #9d6b24;
  --bad: #e9352b;
  --bad-soft: #fff0ee;
  --shadow: 0 16px 40px rgba(15, 18, 22, 0.08);
  --radius: 16px;
  --marketing-bg: #f7f7f2;
  --marketing-bg-soft: #eef4ef;
  --marketing-surface: #ffffff;
  --marketing-ink: #18231f;
  --marketing-muted: #66706b;
  --marketing-line: rgba(24, 35, 31, 0.14);
  --marketing-accent: #1f6f5b;
  --marketing-accent-strong: #164d40;
  --marketing-accent-soft: #dcebe5;
  --marketing-warm: #aa762f;
  color-scheme: light;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

.palette-emerald {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-strong: #f5f5f5;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-soft-glass: rgba(255, 255, 255, 0.82);
  --surface-card: #ffffff;
  --input-bg: #ffffff;
  --ink: #090b0f;
  --muted: #8a9299;
  --line: #e2e2e2;
  --line-strong: #d6d6d6;
  --accent: #111318;
  --accent-strong: #000000;
  --accent-soft: #e2e2e2;
  --page-glow: transparent;
  --focus-ring: rgba(17, 19, 24, 0.2);
  --shadow: 0 16px 40px rgba(15, 18, 22, 0.08);
  --marketing-bg: #f7f7f2;
  --marketing-bg-soft: #eef4ef;
  --marketing-surface: #ffffff;
  --marketing-ink: #18231f;
  --marketing-muted: #66706b;
  --marketing-line: rgba(24, 35, 31, 0.14);
  --marketing-accent: #1f6f5b;
  --marketing-accent-strong: #164d40;
  --marketing-accent-soft: #dcebe5;
  --marketing-warm: #aa762f;
}

.palette-cobalt {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-strong: #e8eef7;
  --surface-glass: rgba(250, 253, 255, 0.9);
  --surface-soft-glass: rgba(250, 253, 255, 0.78);
  --surface-card: rgba(255, 255, 255, 0.94);
  --input-bg: rgba(255, 255, 255, 0.8);
  --ink: #14202d;
  --muted: #637181;
  --line: rgba(20, 32, 45, 0.14);
  --line-strong: #aebccd;
  --accent: #245fbd;
  --accent-strong: #183f7f;
  --accent-soft: #dde8f8;
  --page-glow: rgba(36, 95, 189, 0.1);
  --focus-ring: rgba(36, 95, 189, 0.3);
  --shadow: 0 18px 46px rgba(20, 32, 45, 0.12);
  --marketing-bg: #f5f8fb;
  --marketing-bg-soft: #e8eef7;
  --marketing-surface: #ffffff;
  --marketing-ink: #14202d;
  --marketing-muted: #637181;
  --marketing-line: rgba(20, 32, 45, 0.14);
  --marketing-accent: #245fbd;
  --marketing-accent-strong: #183f7f;
  --marketing-accent-soft: #dde8f8;
  --marketing-warm: #9b6b24;
}

.palette-amber {
  --bg: #f8f5ed;
  --surface: #fffdf8;
  --surface-strong: #f0eadc;
  --surface-glass: rgba(255, 253, 248, 0.9);
  --surface-soft-glass: rgba(255, 253, 248, 0.78);
  --surface-card: rgba(255, 253, 248, 0.94);
  --input-bg: rgba(255, 255, 255, 0.8);
  --ink: #24231f;
  --muted: #6c675d;
  --line: rgba(36, 35, 31, 0.15);
  --line-strong: #c2b8a2;
  --accent: #5f6f3a;
  --accent-strong: #424e29;
  --accent-soft: #e4ead3;
  --page-glow: rgba(168, 111, 37, 0.1);
  --focus-ring: rgba(95, 111, 58, 0.3);
  --shadow: 0 18px 46px rgba(36, 35, 31, 0.12);
  --marketing-bg: #f8f5ed;
  --marketing-bg-soft: #f0eadc;
  --marketing-surface: #fffdf8;
  --marketing-ink: #24231f;
  --marketing-muted: #6c675d;
  --marketing-line: rgba(36, 35, 31, 0.15);
  --marketing-accent: #5f6f3a;
  --marketing-accent-strong: #424e29;
  --marketing-accent-soft: #e4ead3;
  --marketing-warm: #a86f25;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Public Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 500;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--input-bg);
  color: var(--ink);
}

input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(177, 59, 49, 0.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 11ch;
  font-size: 27px;
  line-height: 1.08;
  text-wrap: balance;
}

h2 {
  font-size: 24px;
  line-height: 1.12;
}

h3 {
  font-size: 17px;
  line-height: 1.2;
}

small {
  color: var(--muted);
  font-size: 12px;
}

.preload-shell {
  display: grid;
  min-height: 100dvh;
  padding: 28px;
  place-items: center;
}

.preload-card {
  display: grid;
  gap: 14px;
  width: min(640px, 100%);
}

.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
}

.admin-shell {
  grid-template-columns: 272px minmax(0, 1fr);
  background: var(--bg);
}

.admin-shell .sidebar {
  display: flex;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100dvh;
  padding: 26px;
  border-right: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
}

.workspace {
  min-width: 0;
}

.admin-shell .workspace {
  min-height: 100dvh;
  padding: 0;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.metric {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft-glass);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  line-height: 1;
}

.quota {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  background: var(--surface-soft-glass);
}

.quota span,
.quota small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quota strong {
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  line-height: 1;
}

.nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar-nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar-section {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.nav-item small {
  margin-left: auto;
  color: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.nav-item:hover {
  border-color: var(--line);
  background: var(--surface-soft-glass);
}

.nav-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.nav-item svg,
.button svg,
.qr-panel svg,
.empty-state svg,
.dialog-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
}

.admin-shell .admin-topbar {
  justify-content: flex-end;
  min-height: 58px;
  padding-block: 12px;
}

.session-bar,
.section-head,
.actions,
.inline-form,
.dialog-actions,
.bulk-action-bar,
.bulk-actions,
.bulk-quota-edit,
.admin-pagination,
.admin-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-bar {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-bar > span {
  max-width: min(36vw, 360px);
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.button:hover {
  background: var(--accent-strong);
}

.button-secondary {
  border-color: #dedede;
  background: #ffffff;
  color: var(--ink);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button-danger {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}

.button-danger:hover {
  border-color: #c62f27;
  background: #c62f27;
  color: #fff;
}

.auth-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 430px);
  justify-content: center;
  align-content: center;
  gap: 18px;
  min-height: 100dvh;
  overflow: hidden;
  padding: 34px 20px;
  background:
    linear-gradient(135deg, var(--page-glow), transparent 28rem),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  color: var(--ink);
}

.auth-page::before {
  position: absolute;
  inset: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  pointer-events: none;
  content: "";
}

.auth-panel {
  display: grid;
  justify-items: stretch;
  width: 100%;
  max-width: 430px;
  position: relative;
  z-index: 1;
}

.auth-card {
  position: relative;
  display: grid;
  gap: 16px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface-card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
  content: "";
}

.auth-card h2 {
  font-size: 24px;
}

.auth-card input {
  min-height: 44px;
  background: var(--input-bg);
}

.auth-card .button {
  min-height: 44px;
  margin-top: 2px;
}

.field-hint,
.auth-form-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-hint-warning,
.auth-form-error {
  color: var(--bad);
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-form-error {
  margin-top: -2px;
}

.view {
  display: grid;
  gap: 22px;
  width: min(1280px, 100%);
  padding: 26px 28px 38px;
}

#analyticsView {
  --surface: #fcfdfa;
  --surface-strong: #eef2ef;
  --surface-glass: rgba(252, 253, 250, 0.94);
  --surface-soft-glass: rgba(252, 253, 250, 0.82);
  --ink: #111816;
  --muted: #78847f;
  --line: #dbe1dc;
  --line-strong: #c7d0c9;
  --accent: #285f53;
  --accent-strong: #173c35;
  --accent-soft: #e3eee8;
  --focus-ring: rgba(40, 95, 83, 0.22);
  --bad: #bd5a50;
  --bad-soft: #faefed;
  --warn: #8b7041;
  gap: 18px;
  width: min(1280px, 100%);
}

.create-form {
  display: grid;
  gap: 15px;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.create-form-note {
  max-width: 58ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-switch {
  color: var(--muted);
  font-size: 14px;
}

.auth-switch a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.brand-link {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}

.marketing-page {
  min-height: 100dvh;
  background: var(--marketing-bg);
  color: var(--marketing-ink);
}

.marketing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  border-bottom: 1px solid var(--marketing-line);
}

.marketing-nav .brand-link {
  font-size: 16px;
}

.marketing-nav nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.marketing-nav a,
.marketing-nav button {
  border: 0;
  background: transparent;
  color: var(--marketing-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.marketing-nav a:hover,
.marketing-nav button:hover {
  color: var(--marketing-accent-strong);
}

.marketing-hero,
.pain-section,
.capability-section,
.manager-section,
.flow-section,
.marketing-cta {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 52px;
  align-items: center;
  min-height: calc(100dvh - 72px);
  padding: 42px 0 62px;
}

.hero-copy {
  display: grid;
  gap: 20px;
}

.marketing-kicker {
  width: fit-content;
  border-left: 3px solid var(--marketing-accent);
  padding-left: 10px;
  color: var(--marketing-accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.marketing-hero h1 {
  max-width: 10.5ch;
  color: var(--marketing-ink);
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 34rem;
  color: var(--marketing-muted);
  font-size: 19px;
  line-height: 1.7;
}

.marketing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.marketing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--marketing-accent);
  border-radius: 7px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.marketing-button.primary {
  background: var(--marketing-accent);
  color: #fff;
}

.marketing-button.primary:hover {
  background: var(--marketing-accent-strong);
}

.marketing-button.secondary {
  background: transparent;
  color: var(--marketing-accent-strong);
}

.marketing-button.secondary:hover {
  background: var(--marketing-accent-soft);
}

.workflow-figure,
.manager-figure {
  margin: 0;
}

.workflow-figure img,
.manager-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--marketing-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 35, 31, 0.12);
}

.pain-section,
.capability-section,
.manager-section,
.marketing-cta {
  padding: 72px 0;
  border-top: 1px solid var(--marketing-line);
}

.section-copy,
.manager-copy,
.marketing-cta {
  display: grid;
  gap: 14px;
}

.section-copy h2,
.manager-copy h2,
.marketing-cta h2 {
  max-width: 16ch;
  color: var(--marketing-ink);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.section-copy p,
.manager-copy p,
.marketing-cta p {
  max-width: 44rem;
  color: var(--marketing-muted);
  font-size: 17px;
  line-height: 1.72;
}

.pain-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 48px;
}

.pain-grid,
.capability-grid {
  display: grid;
  gap: 12px;
}

.pain-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pain-grid article,
.capability-grid article,
.flow-section article {
  border: 1px solid var(--marketing-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.pain-grid article,
.capability-grid article {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.pain-grid strong,
.capability-grid strong {
  color: var(--marketing-ink);
  font-size: 18px;
}

.pain-grid p,
.capability-grid p {
  color: var(--marketing-muted);
  font-size: 15px;
  line-height: 1.65;
}

.capability-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 48px;
}

.capability-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.manager-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 48px;
  align-items: center;
}

.manager-copy ul {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.manager-copy li {
  border-left: 3px solid var(--marketing-accent);
  padding-left: 12px;
  color: var(--marketing-ink);
  font-weight: 700;
  line-height: 1.55;
}

.flow-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 42px 0 76px;
}

.flow-section article {
  min-height: 76px;
  border-right: 0;
  display: grid;
  place-items: center;
  color: var(--marketing-accent-strong);
  font-weight: 900;
}

.flow-section article:last-child {
  border-right: 1px solid var(--marketing-line);
}

.marketing-cta {
  align-items: start;
  padding-bottom: 96px;
}

.layout-trade-command .marketing-hero {
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
}

.layout-sales-studio .marketing-hero {
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
  min-height: auto;
  padding-top: 58px;
}

.layout-sales-studio .marketing-hero h1 {
  max-width: 15ch;
}

.layout-sales-studio .workflow-figure {
  max-width: 860px;
}

.layout-sales-studio .pain-section {
  grid-template-columns: minmax(0, 1fr);
}

.layout-sales-studio .pain-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.layout-executive-dossier .marketing-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
}

.layout-executive-dossier .workflow-figure img,
.layout-executive-dossier .manager-figure img {
  box-shadow: none;
}

.layout-executive-dossier .pain-section,
.layout-executive-dossier .capability-section {
  grid-template-columns: minmax(0, 1fr);
}

.layout-executive-dossier .capability-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.admin-panel {
  display: grid;
  gap: 14px;
}

.section-head {
  justify-content: space-between;
  min-height: 40px;
}

.agent-grid,
.account-grid,
.timeline-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.agent-grid,
.account-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.agent-card,
.account-card,
.session-card,
.admin-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.agent-card,
.account-card,
.session-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.workspace-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.workspace-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
}

.workspace-row-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.workspace-row-main h3 {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-row-main p,
.workspace-row-meta {
  color: var(--muted);
  font-size: 13px;
}

.workspace-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.workspace-row-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-head h3,
.admin-item strong {
  overflow-wrap: anywhere;
}

.card-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.meta-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tone-neutral {
  border-color: #d8dde0;
  background: #edf0f1;
  color: #485451;
}

.tone-ready {
  border-color: #cce5da;
  background: #edf7f2;
  color: var(--ok);
}

.tone-waiting {
  border-color: rgba(155, 101, 27, 0.25);
  background: #fff2dd;
  color: var(--warn);
}

.tone-failed {
  border-color: #f0cac6;
  background: var(--bad-soft);
  color: var(--bad);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin: 2px 0;
}

.stepper span {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.stepper i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.stepper .done {
  color: var(--ink);
}

.stepper .done i {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.stepper .current i {
  box-shadow: 0 0 0 4px rgba(39, 108, 103, 0.13);
}

.event-stream {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  font-size: 13px;
}

.event-row span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.event-row small {
  grid-column: 2;
}

.qr-panel {
  display: grid;
  gap: 12px;
  width: min(260px, 100%);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-strong);
}

.qr-panel > div:first-child {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
}

.qr-panel > div:first-child span {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.qr-panel.expired,
.qr-box.expired {
  border-color: rgba(177, 59, 49, 0.45);
  background: #fff4f2;
}

.qr-code,
.qr-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.qr-placeholder {
  color: var(--bad);
  font-weight: 800;
}

.notice {
  border: 1px solid rgba(155, 101, 27, 0.24);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff6e8;
  color: var(--warn);
  font-size: 13px;
}

.analytics-hero-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface) 100%);
  box-shadow: 0 12px 28px rgba(17, 24, 22, 0.045);
}

.analytics-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.analytics-command-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  min-width: 0;
}

.analytics-command-main h3 {
  font-size: 16px;
}

.analytics-command-row .button {
  min-height: 34px;
  padding: 0 11px;
}

.analytics-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.analytics-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid color-mix(in srgb, var(--line) 82%, #ffffff);
  padding-top: 9px;
  background: transparent;
}

.analytics-basis {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.analytics-scope strong {
  font-size: 14px;
  white-space: nowrap;
}

.analytics-scope span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.window-grid {
  display: flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.window-grid span {
  border: 1px solid color-mix(in srgb, var(--line) 78%, #ffffff);
  border-radius: 7px;
  padding: 5px 7px;
  background: color-mix(in srgb, var(--surface-strong) 38%, #ffffff);
  color: var(--muted);
  font-size: 12px;
}

.intelligence-feed {
  display: grid;
  gap: 18px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.analytics-feed-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 0;
}

.queue-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.queue-filter button {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, #ffffff);
  border-radius: 6px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--surface-strong) 34%, #ffffff);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.queue-filter button:hover,
.queue-filter button.active {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 72%, #ffffff);
  color: var(--accent-strong);
}

.queue-filter strong {
  color: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.intelligence-list {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(17, 24, 22, 0.04);
}

.intelligence-workbench {
  display: block;
  width: 100%;
  max-width: none;
}

.intelligence-row {
  position: relative;
  display: grid;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  box-shadow: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.intelligence-row:hover,
.intelligence-row.active {
  background: color-mix(in srgb, var(--accent-soft) 34%, #ffffff);
  box-shadow: none;
}

.intelligence-row + .intelligence-row {
  border-top: 1px solid color-mix(in srgb, var(--line) 74%, #ffffff);
}

.intelligence-row.active::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  content: "";
}

.intelligence-row:hover .intelligence-row-trigger {
  background: transparent;
}

.intelligence-row.active .intelligence-row-trigger {
  background: transparent;
}

.intelligence-row-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  border: 0;
  padding: 14px 16px 14px 18px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.intelligence-row-trigger:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
}

.intelligence-row-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.intelligence-row-title-line {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.intelligence-row-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intelligence-row-title-line small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.intelligence-row-action {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intelligence-row-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
}

.intelligence-row-signals small {
  border: 0;
  border-radius: 5px;
  padding: 2px 5px;
  background: color-mix(in srgb, var(--surface-strong) 42%, #ffffff);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.intelligence-row-footer {
  display: none;
  align-items: center;
  margin-top: 3px;
}

.intelligence-expand-hint {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--surface));
  border-radius: 6px;
  padding: 4px 7px;
  background: color-mix(in srgb, var(--surface) 78%, var(--bg));
  color: color-mix(in srgb, var(--accent-strong) 72%, var(--muted));
  font-size: 12px;
  font-weight: 700;
}

.intelligence-row-trigger:hover .intelligence-expand-hint,
.intelligence-row.active .intelligence-expand-hint {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
  color: var(--accent-strong);
}

.intelligence-row-side {
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 74px;
}

.intelligence-row-chevron {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 180ms ease, color 180ms ease;
}

.intelligence-row.active .intelligence-row-chevron {
  color: var(--accent-strong);
}

.priority-badge {
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 6px;
  padding: 3px 6px;
  background: color-mix(in srgb, var(--surface-strong) 46%, #ffffff);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.priority-badge.high {
  border-color: color-mix(in srgb, var(--bad) 34%, #ffffff);
  background: color-mix(in srgb, var(--bad-soft) 78%, #ffffff);
  color: color-mix(in srgb, var(--bad) 76%, var(--ink));
}

.priority-badge.medium {
  border-color: color-mix(in srgb, var(--warn) 30%, #ffffff);
  background: color-mix(in srgb, #f6efe2 80%, #ffffff);
  color: color-mix(in srgb, var(--warn) 74%, var(--ink));
}

.intelligence-row-side small,
.intelligence-detail-context,
.focus-summary p,
.next-action-panel p,
.intelligence-risk p,
.intelligence-evidence p,
.reply-draft p,
.next-action-panel small,
.decision-note,
.detail-eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.intelligence-detail-pane {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  display: grid;
  gap: 16px;
  align-content: start;
  width: min(680px, calc(100vw - 48px));
  min-width: min(100vw, 420px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  padding: 24px 26px 28px;
  background: var(--surface);
  box-shadow: -24px 0 56px rgba(15, 18, 22, 0.14);
}

.intelligence-detail-pane.empty {
  position: static;
}

.intelligence-detail-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, var(--surface));
  padding-bottom: 14px;
}

.intelligence-detail-header h3 {
  margin-top: 2px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.28;
}

.intelligence-detail-actions > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.intelligence-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.intelligence-detail-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.intelligence-detail-close:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.intelligence-detail-close svg {
  width: 16px;
  height: 16px;
}

.intelligence-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  border: 0;
  padding: 0;
  background: rgba(9, 11, 15, 0.18);
  cursor: default;
}

.detail-eyebrow {
  font-weight: 800;
}

.intelligence-detail-context {
  width: fit-content;
  margin: 0;
  line-height: 1.4;
}

.focus-summary {
  border-left: 3px solid color-mix(in srgb, var(--accent) 46%, var(--line));
  padding-left: 14px;
}

.focus-summary p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.intelligence-detail-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  align-items: start;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.next-action-panel,
.intelligence-risk,
.intelligence-evidence,
.reply-draft {
  display: grid;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 16px 0;
  background: transparent;
  box-shadow: none;
}

.next-action-panel {
  background: transparent;
}

.intelligence-detail-stack > section + section {
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, var(--surface));
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-reply-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.copy-reply-button:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 48%, var(--surface));
  color: var(--accent-strong);
}

.copy-reply-button svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.next-action-panel > p,
.intelligence-risk > p,
.intelligence-evidence > p,
.reply-draft p {
  color: var(--accent-strong);
  font-weight: 800;
}

.decision-note {
  display: block;
  border-top: 0;
  padding-top: 2px;
  line-height: 1.45;
}

.next-action-panel ul,
.intelligence-risk ul,
.intelligence-evidence ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.next-action-panel li,
.intelligence-risk li {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.intelligence-evidence li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.intelligence-evidence li span,
.intelligence-evidence li strong {
  margin-right: 6px;
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.intelligence-evidence li em {
  color: var(--ink);
  font-style: normal;
}

.next-action-panel strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.reply-draft blockquote {
  margin: 0;
  border: 0;
  border-radius: 7px;
  padding: 13px 14px;
  background: color-mix(in srgb, var(--surface-strong) 62%, var(--surface));
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.field-error {
  color: var(--bad);
  font-size: 12px;
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

.admin-view {
  justify-self: auto;
  width: min(1280px, 100%);
  gap: 22px;
}

.admin-dashboard {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-strong));
  box-shadow: var(--shadow);
}

.admin-dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-dashboard-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.admin-dashboard-state {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 7px;
  padding: 12px;
  background: var(--surface);
}

.admin-stat-card span,
.admin-control-copy span,
.admin-toolbar-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-stat-card strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.admin-stat-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-control-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  gap: 10px;
}

.admin-control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--surface);
}

.admin-control-card-danger {
  border-color: color-mix(in srgb, var(--bad) 28%, var(--line));
}

.admin-control-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-control-copy strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

.admin-control-actions,
.admin-maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-control-actions .button,
.admin-maintenance-actions .button {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 13px;
}

.admin-object-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.admin-toolbar-heading {
  display: grid;
  gap: 4px;
  min-width: 130px;
}

.admin-toolbar-heading strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
}

.tabbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.tabbar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.tabbar button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.tabbar small {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: rgba(30, 37, 35, 0.08);
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.admin-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.admin-filter-toggle:hover,
.admin-filter-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.admin-filter-toggle:disabled {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.68;
}

.admin-filter-toggle strong {
  min-width: 20px;
  color: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.admin-filter-toggle small {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.admin-data-table {
  display: grid;
  gap: 12px;
}

.admin-panel-toolbar {
  display: flex;
  justify-content: flex-end;
  min-height: 40px;
}

.admin-panel-toolbar .inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 150px)) auto auto;
  gap: 10px;
  width: 100%;
  align-items: end;
  justify-content: end;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--surface));
  border-radius: 12px;
  padding: 12px;
  background: color-mix(in srgb, var(--surface-strong) 44%, var(--surface));
}

.admin-panel-toolbar .inline-form label {
  display: grid;
  gap: 6px;
  width: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-panel-toolbar .inline-form input,
.admin-panel-toolbar .inline-form select {
  width: 100%;
  min-height: 38px;
  background: var(--surface);
}

.admin-panel-toolbar .inline-form .button {
  align-self: end;
  min-height: 38px;
}

.user-create-form {
  width: 100%;
  grid-template-columns: minmax(220px, 1.45fr) minmax(180px, 1fr) minmax(132px, 0.72fr) minmax(96px, 0.48fr) auto !important;
}

.invitation-create-form {
  grid-template-columns: repeat(2, minmax(120px, 150px)) auto auto;
}

.bulk-action-bar {
  justify-content: space-between;
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0 2px;
  background: transparent;
}

.bulk-action-bar > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bulk-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bulk-quota-edit {
  color: var(--muted);
  font-size: 12px;
}

.page-size-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.page-size-select select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: var(--surface);
  color: var(--ink);
}

.bulk-quota-edit input,
.row-menu-field input {
  width: 72px;
  min-height: 34px;
}

.inline-form select,
.row-menu-field select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
}

.admin-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-soft) 28%, transparent);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.check-cell {
  width: 44px;
  text-align: center !important;
}

.check-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.number-cell {
  width: 110px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wide-cell {
  min-width: 190px;
}

.action-cell {
  width: 150px;
  text-align: right !important;
  white-space: nowrap;
}

.action-cell .button,
.bulk-actions .button {
  width: auto;
}

.row-action-menu {
  display: inline-grid;
  justify-items: end;
  position: relative;
}

.row-action-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.row-action-trigger svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.row-action-menu.open .row-action-trigger,
.row-action-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface));
  color: var(--accent-strong);
}

.row-action-menu.open .row-action-trigger svg {
  color: var(--accent-strong);
  transform: rotate(180deg);
}

.row-action-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30, 37, 35, 0.34);
}

.row-action-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(620px, 100%);
  max-height: min(86vh, 760px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--surface));
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(15, 18, 22, 0.14);
  white-space: normal;
}

.row-action-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, var(--surface));
  padding: 15px 16px;
}

.row-action-dialog-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.row-action-dialog-head h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.row-action-dialog-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.row-action-dialog-close:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.row-action-dialog-close svg {
  width: 17px;
  height: 17px;
}

.row-action-dialog-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.row-action-dialog-body .button {
  width: 100%;
}

.row-action-section {
  display: grid;
  gap: 8px;
}

.row-action-section + .row-action-section {
  border-top: 1px solid color-mix(in srgb, var(--line) 86%, var(--surface));
  padding-top: 10px;
}

.row-action-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.row-action-danger-zone {
  gap: 0;
}

.row-menu-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.row-menu-field input {
  width: 100%;
}

.row-menu-field-wide {
  min-width: 220px;
}

.table-title {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.table-muted {
  color: var(--muted);
}

.empty-table-cell {
  padding: 0 !important;
}

.empty-table-cell .empty-state {
  border: 0;
  background: transparent;
}

.admin-pagination {
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.admin-pagination > div {
  justify-content: flex-end;
}

.admin-pagination button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.admin-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-pagination strong {
  min-width: 58px;
  color: var(--ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.inline-form {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body .inline-form label {
  width: 136px;
}

body .user-create-form label:first-child {
  width: 220px;
}

.admin-panel-toolbar .inline-form label,
.admin-panel-toolbar .user-create-form label:first-child {
  width: auto;
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 118px;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.skeleton-grid span {
  min-height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 253, 248, 0.72), rgba(225, 219, 208, 0.72), rgba(255, 253, 248, 0.72));
  background-size: 200% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(30, 37, 35, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30, 37, 35, 0.34);
}

.dialog {
  display: grid;
  gap: 12px;
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dialog-icon.danger {
  background: var(--bad-soft);
  color: var(--bad);
}

.dialog-detail p,
.dialog p {
  color: var(--muted);
  line-height: 1.55;
}

.delete-target-detail {
  display: grid;
  gap: 10px;
}

.delete-target-detail > strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
}

.delete-target-detail dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.delete-target-detail dl div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface-strong);
}

.delete-target-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.delete-target-detail dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.delete-target-detail small {
  color: var(--muted);
  line-height: 1.45;
}

.password-dialog {
  width: min(460px, 100%);
}

.password-form {
  display: grid;
  gap: 12px;
}

.password-form input {
  min-height: 42px;
}

.dialog-error {
  border: 1px solid color-mix(in srgb, var(--bad) 22%, var(--line));
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--bad-soft);
  color: var(--bad) !important;
  font-size: 13px;
  font-weight: 700;
}

.dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .marketing-nav,
  .marketing-hero,
  .pain-section,
  .capability-section,
  .manager-section,
  .flow-section,
  .marketing-cta {
    width: min(100% - 32px, 760px);
  }

  .marketing-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }

  .marketing-nav nav {
    flex-wrap: wrap;
    gap: 14px;
  }

  .marketing-hero,
  .pain-section,
  .capability-section,
  .manager-section,
  .layout-trade-command .marketing-hero,
  .layout-executive-dossier .marketing-hero {
    grid-template-columns: 1fr;
  }

  .marketing-hero {
    min-height: auto;
    padding-top: 38px;
  }

  .marketing-hero h1 {
    max-width: 13ch;
    font-size: 48px;
  }

  .layout-sales-studio .pain-grid,
  .layout-executive-dossier .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-page {
    grid-template-columns: minmax(0, 430px);
    gap: 18px;
  }

  .auth-panel {
    justify-items: stretch;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    gap: 16px;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  h1 {
    max-width: none;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .topbar {
    position: static;
  }

  .analytics-scope {
    align-items: flex-start;
  }

  .analytics-feed-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .window-grid {
    justify-content: flex-start;
  }

  .intelligence-row-trigger {
    grid-template-columns: minmax(0, 1fr);
  }

  .intelligence-workbench {
    max-width: none;
  }

  .intelligence-detail-pane {
    position: fixed;
  }

  .intelligence-row-side {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
  }

  .intelligence-detail-stack {
    grid-template-columns: 1fr;
  }

  .admin-stat-grid,
  .admin-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-control-card-danger,
  .admin-object-toolbar {
    grid-column: 1 / -1;
  }

  .admin-object-toolbar {
    grid-template-columns: 1fr;
  }

  .tabbar {
    justify-content: flex-start;
  }

}

@media (max-width: 640px) {
  .marketing-nav,
  .marketing-hero,
  .pain-section,
  .capability-section,
  .manager-section,
  .flow-section,
  .marketing-cta {
    width: min(100% - 28px, 100%);
  }

  .marketing-nav nav {
    width: 100%;
    justify-content: space-between;
  }

  .marketing-hero h1 {
    max-width: none;
    font-size: 40px;
  }

  .hero-lead,
  .section-copy p,
  .manager-copy p,
  .marketing-cta p {
    font-size: 15px;
  }

  .pain-section,
  .capability-section,
  .manager-section,
  .marketing-cta {
    padding: 48px 0;
  }

  .pain-grid,
  .capability-grid,
  .layout-sales-studio .pain-grid,
  .layout-executive-dossier .capability-grid,
  .flow-section {
    grid-template-columns: 1fr;
  }

  .flow-section {
    gap: 8px;
    padding: 24px 0 48px;
  }

  .flow-section article,
  .flow-section article:last-child {
    border-right: 1px solid var(--marketing-line);
  }

  .marketing-button {
    width: 100%;
  }

  .auth-page {
    padding: 22px 16px 30px;
  }

  .auth-page::before {
    inset: 10px;
  }

  .auth-card {
    padding: 22px;
  }

  .sidebar,
  .topbar,
  .view {
    padding-inline: 16px;
  }

  .topbar,
  .section-head,
  .admin-panel-toolbar,
  .bulk-action-bar,
  .admin-pagination,
  .session-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .session-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    justify-content: stretch;
  }

  .session-bar > span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-bar .button {
    width: auto;
    min-height: 36px;
    padding: 0 10px;
  }

  .admin-shell .admin-topbar {
    gap: 12px;
  }

  .admin-shell .admin-session-bar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    justify-content: stretch;
    gap: 8px;
  }

  .admin-shell .admin-session-bar > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    justify-self: end;
  }

  .admin-shell .admin-session-bar .button {
    width: auto;
    min-height: 36px;
    padding: 0 10px;
  }

  .workspace-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workspace-row-side {
    justify-content: space-between;
    width: 100%;
  }

  .intelligence-row-trigger {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-block: 13px;
  }

  .intelligence-row-side {
    grid-column: 1;
    display: flex;
    gap: 8px;
    justify-items: start;
    justify-content: flex-start;
    min-width: 0;
  }

  .queue-filter {
    width: 100%;
    justify-content: flex-start;
  }

  .queue-filter button {
    flex: 1;
    justify-content: center;
  }

  .intelligence-detail-pane {
    top: auto;
    width: 100%;
    min-width: 0;
    max-height: 86dvh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    padding: 18px 16px 22px;
  }

  .intelligence-detail-stack {
    padding-inline: 0;
  }

  .intelligence-detail-header {
    flex-direction: column;
  }

  .intelligence-row-action {
    white-space: normal;
  }

  .stepper,
  .agent-grid,
  .account-grid,
  .admin-stat-grid,
  .admin-control-grid,
  .skeleton-grid {
    grid-template-columns: 1fr;
  }

  .admin-dashboard,
  .admin-object-toolbar {
    padding: 12px;
  }

  .admin-dashboard-head,
  .admin-control-card {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-dashboard-state,
  .admin-control-actions,
  .admin-maintenance-actions {
    justify-content: flex-start;
  }

  .inline-form,
  .actions,
  .dialog-actions,
  .bulk-actions,
  .admin-pagination > div {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-panel-toolbar .inline-form,
  .admin-panel-toolbar .user-create-form,
  .admin-panel-toolbar .invitation-create-form {
    grid-template-columns: 1fr !important;
    justify-content: stretch;
  }

  .inline-form label,
  .bulk-quota-edit input,
  .row-action-menu,
  .row-menu-field input,
  .row-menu-field-wide,
  .user-create-form label:first-child {
    width: 100%;
  }

  .row-action-dialog-backdrop {
    align-items: end;
    padding: 12px;
  }

  .row-action-dialog {
    width: 100%;
    max-height: min(88vh, 760px);
  }

  .button {
    width: 100%;
  }

  .analytics-command-row .button {
    width: auto;
  }

  .admin-table {
    min-width: 0;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .admin-table tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface);
  }

  .admin-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 0;
    text-align: right;
    white-space: normal;
  }

  .admin-table td:not(.check-cell)::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
  }

  .admin-table .check-cell {
    grid-column: 1;
    width: auto;
    text-align: left !important;
  }

  .admin-table .wide-cell {
    grid-column: 1 / -1;
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
  }

  .admin-table .wide-cell::before {
    min-width: 56px;
  }

  .admin-table .wide-cell .table-title {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .admin-table .number-cell {
    width: auto;
  }

  .admin-table .action-cell {
    grid-column: 1 / -1;
    width: auto;
    justify-content: flex-end;
    text-align: left !important;
  }

  .admin-table .action-cell:empty {
    display: none;
  }

  .action-cell .button,
  .bulk-actions .button {
    width: 100%;
  }
}
