:root {
  /* Kinetic Noir: primary #CA2D25, black, white and neutral #89726F. */
  --canvas: #f4ddd9;
  --surface: #fff7f5;
  --surface-soft: #fce9e5;
  --ink: #251b1a;
  --ink-soft: #89726f;
  --line: #e6c8c2;
  --line-dark: #cdaeaa;
  --nav: #000;
  --nav-soft: #2a2020;
  --nav-text: #f8e4e0;
  --brand: #ca2d25;
  --brand-dark: #a91e18;
  --brand-soft: #fce0dc;
  --success: #287a57;
  --success-soft: #e7f4ec;
  --warning: #956000;
  --warning-soft: #fff2d9;
  --danger: #b1221d;
  --danger-soft: #fbe2df;
  --violet: #7151a8;
  --violet-soft: #f0e9fa;
  --manual: #396f7a;
  --manual-soft: #e6f2f3;
  --shadow: 0 12px 34px rgba(72, 39, 35, 0.12);
  --radius: 18px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
}

button,
a {
  font: inherit;
}

/* A short, native-browser hint for terms that may be unfamiliar to a reader. */
.plain-term {
  color: inherit;
  font: inherit;
  font-variant: normal;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  text-underline-offset: 0.18em;
  cursor: help;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(202, 45, 37, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: #171717;
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.partial-error {
  margin: 12px 24px 0;
  padding: 10px 14px;
  color: #7b3f15;
  background: #fff3df;
  border: 1px solid #e8ba83;
  border-radius: 10px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 27px;
  background: var(--nav);
  color: #fff;
}

.brand {
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.025em;
}

.brand span {
  margin-top: 2px;
  color: #d8c0bb;
  font-size: 11px;
}

.sidebar-section {
  display: grid;
  gap: 9px;
}

.sidebar-caption {
  padding: 0 10px;
  color: #bda3a0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-nav-item {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--nav-text);
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.side-nav-item:hover {
  background: rgba(255, 255, 255, 0.065);
  color: #fff;
}

.side-nav-item.is-active {
  background: var(--nav-soft);
  color: #fff;
}

.side-icon {
  width: 21px;
  height: 21px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: #f8f9fc;
  font-size: 12px;
  font-weight: 800;
}

.side-nav-item.is-active .side-icon {
  background: rgba(202, 45, 37, 0.28);
  color: #ffd7d2;
}

.side-label {
  flex: 1;
  font-size: 13px;
  font-weight: 660;
}

.nav-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-foot strong,
.sidebar-foot p {
  display: block;
}

.sidebar-foot strong {
  margin: 4px 0 6px;
  font-size: 12px;
}

.sidebar-foot p {
  margin: 0;
  color: #aeb8c9;
  font-size: 11px;
  line-height: 1.45;
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 245, 0.9);
  backdrop-filter: blur(14px);
}

.mock-global-banner {
  min-height: 38px;
  padding: 9px 28px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  border-bottom: 1px solid #e8c388;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.35;
}

.mock-global-banner strong {
  color: #7b4a09;
}

.environment,
.top-actions,
.account-chip,
.budget-chip,
.user-chip,
.role-chip,
.locked-control {
  display: flex;
  align-items: center;
}

.environment {
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.environment-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.account-chip,
.budget-chip,
.user-chip {
  min-height: 34px;
  padding: 0 10px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}

.pause-state {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #b9dcc9;
  border-radius: 10px;
  background: #f3faf6;
  color: var(--success);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.pause-state > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.pause-state.is-paused {
  border-color: #f0d58f;
  background: var(--warning-soft);
  color: var(--warning);
}

.password-reset {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.password-reset summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 750;
}

.password-reset-form {
  margin-top: 12px;
}

.account-chip strong {
  color: var(--ink);
}

.budget-chip {
  color: var(--violet);
  background: #fbf7fe;
}

.role-chip {
  padding-left: 6px;
  color: var(--ink);
  font-weight: 750;
}

.role-chip > span {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  font-weight: 850;
}

.role-chip.is-owner {
  border-color: #b9dcc9;
  background: #f3faf6;
  color: var(--success);
}

.role-chip.is-owner > span {
  background: var(--success);
}

.role-chip.is-admin {
  border-color: #c7dde1;
  background: #f5fafb;
  color: var(--manual);
}

.role-chip.is-admin > span {
  background: var(--manual);
}

.role-chip.is-restricted {
  border-color: #e1e5ea;
  background: var(--surface-soft);
  color: var(--ink-soft);
}

.role-chip.is-restricted > span {
  background: #a2aab5;
}

.locked-control {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.user-chip {
  padding-left: 6px;
  color: var(--ink);
  font-weight: 700;
}

.user-chip > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2a2020;
  color: #fff;
  font-size: 10px;
}

.content {
  width: min(1450px, 100%);
  margin: 0 auto;
  padding: 29px;
}

.page-heading {
  margin-bottom: 21px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.page-heading h1,
.panel h2,
.panel h3,
.notice h2,
.case-card h2,
.connection-card h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.035em;
}

.page-heading h1 {
  font-size: clamp(25px, 3vw, 33px);
  line-height: 1.08;
}

.page-heading p {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.eyebrow {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.demo-tag {
  padding: 6px 9px;
  border: 1px solid #efc1bb;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.demo-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}

.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-pad {
  padding: 20px;
}

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

.panel-head h2 {
  margin-top: 4px;
  font-size: 19px;
}

.panel-head p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.48;
}

.pill {
  min-height: 23px;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.pill-success {
  background: var(--success-soft);
  color: var(--success);
}

.pill-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.pill-manual {
  background: var(--manual-soft);
  color: var(--manual);
}

.pill-neutral {
  background: #f1dfdc;
  color: #6e5754;
}

.btn {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
  border-color: var(--line-dark);
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.btn-danger {
  border-color: #e8b9b5;
  background: #fff4f2;
  color: var(--danger);
}

.btn-success {
  border-color: #b9dcc9;
  background: var(--success-soft);
  color: var(--success);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.btn-small {
  min-height: 31px;
  padding: 0 10px;
  font-size: 11px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.notice {
  margin-bottom: 20px;
  padding: 17px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #e5c5bf;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #fff 0%, #fce9e5 100%);
}

.notice strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.notice p {
  max-width: 800px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.notice-actions {
  flex: 0 0 auto;
}

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

.metric-card {
  min-height: 116px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.metric-value {
  color: var(--ink);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1.04;
}

.metric-detail {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}

.metric-detail.is-warning {
  color: var(--warning);
}

.metric-detail.is-success {
  color: var(--success);
}

.metric-detail.is-violet {
  color: var(--violet);
}

.dashboard-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 20px;
}

.action-stack {
  margin-top: 16px;
  display: grid;
  gap: 2px;
}

.action-card {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.action-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.action-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 850;
}

.action-card strong,
.action-card p {
  display: block;
}

.action-card strong {
  color: var(--ink);
  font-size: 12px;
}

.action-card p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.activity-list {
  margin-top: 12px;
}

.activity-row {
  padding: 12px 0;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.activity-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-row time {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.activity-row strong,
.activity-row span {
  display: block;
}

.activity-row strong {
  color: var(--ink);
  font-size: 12px;
}

.activity-row span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.activity-row em,
.audit-actor {
  min-width: 54px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #edf1f6;
  color: var(--ink-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.activity-row em.ai,
.audit-actor.ai {
  background: var(--violet-soft);
  color: var(--violet);
}

.activity-row em.system,
.audit-actor.system {
  background: var(--success-soft);
  color: var(--success);
}

.activity-row em.human,
.audit-actor.human {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.published-mini-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.mini-post {
  min-height: 149px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.mini-post:hover {
  border-color: #cfd8e5;
  background: #fff;
}

.mini-post > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.mini-platform {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.mini-post strong {
  line-height: 1.3;
}

.mini-post p,
.mini-post > span {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.flow-strip {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.flow-strip > div {
  min-height: 95px;
  padding: 14px 16px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.flow-strip > div:last-child {
  border-right: 0;
}

.flow-strip strong {
  color: var(--ink);
  font-size: 27px;
  letter-spacing: -0.06em;
  line-height: 1;
}

.flow-strip span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.filter-row {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  min-height: 33px;
  padding: 0 10px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.filter-chip span {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f6;
  color: var(--ink-soft);
  font-size: 9px;
}

.filter-chip.is-active {
  border-color: #f2b9b6;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.filter-chip.is-active span {
  background: #f8c9c7;
  color: var(--brand-dark);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.66fr) minmax(0, 1.34fr);
  gap: 20px;
  align-items: start;
}

.read-only-observations {
  margin-bottom: 20px;
}

.read-only-observation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.read-only-observation-grid > section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.read-only-observation {
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.read-only-observation:first-of-type {
  border-top: 0;
}

.read-only-observation > div {
  min-width: 0;
}

.read-only-observation strong,
.read-only-observation p,
.read-only-observation small {
  display: block;
}

.read-only-observation strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
}

.read-only-observation p {
  margin: 6px 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.read-only-observation small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.read-only-observation a {
  flex: 0 0 auto;
  color: var(--violet);
  font-size: 10px;
  font-weight: 750;
  text-decoration: none;
}

.read-only-observation a:hover {
  text-decoration: underline;
}

.news-list,
.task-list,
.publication-list,
.comment-list {
  overflow: hidden;
}

.list-header {
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.list-header strong {
  color: var(--ink);
  font-size: 12px;
}

.list-load-more {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.list-load-more span {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.list-record,
.task-record,
.publication-row,
.comment-row {
  width: 100%;
  padding: 15px 16px;
  display: grid;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.list-record:last-child,
.task-record:last-child,
.publication-row:last-child,
.comment-row:last-child {
  border-bottom: 0;
}

.list-record:hover,
.task-record:hover,
.publication-row:hover,
.comment-row:hover {
  background: #fbfcfe;
}

.list-record.is-selected,
.task-record.is-selected,
.publication-row.is-selected,
.comment-row.is-selected {
  border-left: 3px solid var(--brand);
  padding-left: 13px;
  background: #fff9f8;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.record-meta > span:last-child:not(.pill) {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.list-record strong,
.task-record strong,
.publication-row strong,
.comment-row strong {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.list-record p,
.task-record p,
.publication-row p,
.comment-row p {
  margin: 0;
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.record-id {
  color: #7a879b;
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.news-detail h2,
.queue-detail h2,
.publication-detail h2,
.comment-detail h2 {
  margin: 7px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lead {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.52;
}

.score-row {
  margin: 18px 0;
  display: grid;
  grid-template-columns: 0.55fr 0.65fr minmax(0, 1.6fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.score-row > div {
  min-height: 68px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.score-row > div:last-child {
  border-right: 0;
}

.score-row span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.score-row strong {
  color: var(--ink);
  font-size: 13px;
}

.detail-section {
  margin-top: 18px;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title h3 {
  color: var(--ink);
  font-size: 14px;
}

.section-title > span,
.section-title > div > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.source-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.source-row {
  min-height: 34px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11px;
}

.source-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand);
}

.trusted-source-policy {
  margin: 0 0 20px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.85fr);
  gap: 20px;
  border: 1px solid #cde4d7;
  border-radius: 15px;
  background: linear-gradient(135deg, #f4fbf7, #f9fcfb);
}

.trusted-source-policy-copy h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 17px;
}

.trusted-source-policy-copy p {
  max-width: 670px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.trusted-source-policy-rules {
  display: grid;
  align-content: start;
  gap: 9px;
}

.trusted-domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trusted-domain {
  padding: 7px 8px;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border: 1px solid #b7dcca;
  border-radius: 8px;
  background: #fff;
  color: var(--success);
}

.trusted-domain code {
  font-size: 11px;
  font-weight: 800;
}

.trusted-domain small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.trusted-source-reject {
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  border-radius: 9px;
  background: var(--danger-soft);
}

.trusted-source-reject strong {
  color: var(--danger);
  font-size: 11px;
}

.trusted-source-reject span,
.trusted-source-note {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.trusted-source-note {
  margin: 0;
}

.trusted-source-note strong {
  color: var(--warning);
}

.trusted-source-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.trusted-domain-editor {
  margin-bottom: 20px;
}

.trusted-domain-editor .panel-head p {
  max-width: 670px;
}

.trusted-domain-editor-list {
  margin: 17px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
  list-style: none;
}

.trusted-domain-editor-row {
  min-height: 58px;
  padding: 10px 11px 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cde4d7;
  border-radius: 10px;
  background: #f8fcfa;
}

.trusted-domain-editor-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.trusted-domain-editor-row code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.trusted-domain-editor-row small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.trusted-domain-remove {
  min-height: 31px;
  padding: 0 9px;
  flex: 0 0 auto;
  border: 1px solid #efc7c4;
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
}

.trusted-domain-remove:hover:not(:disabled) {
  border-color: #e9a9a5;
  background: var(--danger-soft);
}

.trusted-domain-remove:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.trusted-domain-form {
  margin-top: 13px;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.trusted-domain-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 780;
}

.trusted-domain-form label > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

.trusted-domain-form input {
  width: 100%;
  min-height: 39px;
  padding: 0 10px;
  border: 1px solid #cbd7e5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.trusted-domain-form input:focus {
  border-color: #94b7a4;
  outline: 3px solid rgba(20, 118, 82, 0.12);
  outline-offset: 1px;
}

.trusted-domain-help,
.trusted-domain-error {
  margin: 8px 1px 0;
  font-size: 10px;
  line-height: 1.42;
}

.trusted-domain-help {
  color: var(--ink-soft);
}

.trusted-domain-error {
  padding: 8px 10px;
  border: 1px solid #f0c2bf;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.trusted-domain-audit {
  margin-top: 12px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid #dfe2fa;
  border-radius: 10px;
  background: #faf9ff;
}

.trusted-domain-audit > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 850;
}

.trusted-domain-audit strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.trusted-domain-audit p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.trusted-domain-editor-actions {
  margin-top: 13px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.trusted-domain-editor-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.trusted-domain-draft-state {
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
}

.trusted-domain-draft-state.is-dirty {
  color: var(--warning);
}

.daily-limits-editor {
  margin-bottom: 20px;
}

.daily-limits-editor .panel-head p {
  max-width: 710px;
}

.daily-limits-form {
  margin-top: 16px;
}

.daily-limits-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.daily-limit-field {
  min-width: 0;
  min-height: 144px;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.daily-limit-field > span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.daily-limit-field small {
  min-height: 29px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.daily-limit-field--manual {
  border-color: #dfe2fa;
  background: #faf9ff;
}

.daily-limit-field input {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid #cbd7e5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}

.daily-limit-field input:focus {
  border-color: #94b7a4;
  outline: 3px solid rgba(20, 118, 82, 0.12);
  outline-offset: 1px;
}

.daily-limits-help,
.daily-limits-error {
  margin: 9px 1px 0;
  font-size: 10px;
  line-height: 1.42;
}

.daily-limits-help {
  color: var(--ink-soft);
}

.daily-limits-error {
  padding: 8px 10px;
  border: 1px solid #f0c2bf;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.daily-likes-manual-note {
  margin-top: 11px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 9px;
  border: 1px solid #dfe2fa;
  border-radius: 10px;
  background: #faf9ff;
}

.daily-likes-manual-note > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 850;
}

.daily-likes-manual-note strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
}

.daily-likes-manual-note p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.daily-limits-editor-actions {
  margin-top: 13px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.daily-limits-editor-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.daily-limits-state {
  max-width: 600px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.publication-control-editor {
  margin-bottom: 20px;
}

.publication-control-editor .panel-head p {
  max-width: 710px;
}

.publication-control-lock,
.publication-control-step-up {
  margin-top: 15px;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  border: 1px solid #d8e8df;
  border-radius: 10px;
  background: #f7fcf9;
}

.publication-control-lock strong,
.publication-control-step-up strong {
  color: var(--success);
  font-size: 11px;
}

.publication-control-lock span,
.publication-control-step-up span {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.publication-control-lock--warning {
  border-color: #efdcb4;
  background: #fffaf0;
}

.publication-control-lock--warning strong {
  color: var(--warning);
}

.publication-control-step-up {
  border-color: #d9d5fa;
  background: #faf9ff;
}

.publication-control-step-up strong {
  color: var(--violet);
}

.publication-control-step-up .detail-actions {
  margin-top: 7px;
}

.publication-control-form {
  margin-top: 15px;
}

.publication-control-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.publication-control-form legend {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.publication-control-form fieldset > p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.publication-mode-choices {
  margin-top: 11px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.publication-mode-choice {
  min-width: 0;
  min-height: 136px;
  padding: 12px;
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  cursor: pointer;
}

.publication-mode-choice.is-selected {
  border-color: #95b9a6;
  background: #f4fbf7;
  box-shadow: 0 0 0 2px rgba(20, 118, 82, 0.08);
}

.publication-mode-choice input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--success);
}

.publication-mode-choice span {
  min-width: 0;
}

.publication-mode-choice strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.publication-mode-choice small {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.publication-control-error,
.publication-control-safety-note {
  margin: 10px 1px 0;
  font-size: 10px;
  line-height: 1.42;
}

.publication-control-error {
  padding: 8px 10px;
  border: 1px solid #f0c2bf;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}

.publication-control-safety-note {
  color: var(--warning);
}

.publication-control-actions {
  margin-top: 13px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.publication-control-current {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.publication-control-current strong {
  color: var(--ink);
}

.publication-control-actions > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.trusted-source-inline {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.policy-box,
.queue-policy {
  margin-top: 17px;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  border: 1px solid #d8e8df;
  border-radius: 11px;
  background: #f7fcf9;
}

.policy-box strong,
.queue-policy strong {
  color: var(--success);
  font-size: 11px;
}

.policy-box span,
.queue-policy span {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.detail-actions,
.handoff-actions {
  margin-top: 17px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.muted-note {
  color: var(--ink-soft);
  font-size: 11px;
}

.external-handoff {
  margin-top: 19px;
  padding: 16px;
  border: 1px solid #cce8f2;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff 0%, #f6fcfe 100%);
}

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

.external-head h3 {
  margin-top: 5px;
  font-size: 15px;
}

.external-head p {
  max-width: 640px;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.46;
}

.handoff-context {
  margin-top: 13px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 11px;
  color: var(--ink-soft);
  font-size: 11px;
}

.handoff-context strong {
  color: var(--ink);
}

.handoff-draft {
  margin-top: 13px;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.handoff-draft p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.handoff-stages {
  margin-top: 14px;
  display: grid;
  gap: 9px;
}

.handoff-stage {
  padding: 12px;
  border: 1px solid #d6eaf1;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.handoff-stage-copy {
  display: grid;
  gap: 4px;
}

.handoff-stage-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.handoff-stage-copy p,
.handoff-stage-copy small,
.handoff-note-form small {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.handoff-stage-copy.is-pending {
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.handoff-stage-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.handoff-note-form {
  display: grid;
  gap: 8px;
}

.handoff-note-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
}

.handoff-note-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.handoff-outcome {
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--success-soft);
  color: var(--success) !important;
}

.manual-done {
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.destination-box {
  margin: 17px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #e4dafd;
  border-radius: 12px;
  background: #fcfbff;
}

.destination-box > div {
  min-height: 63px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.destination-box > div + div {
  border-left: 1px solid #e4dafd;
}

.destination-box strong {
  color: var(--ink);
  font-size: 12px;
}

.thread-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.thread-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-author > div {
  min-width: 0;
}

.thread-avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #263351;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.thread-author strong,
.thread-author span {
  display: block;
}

.thread-author strong {
  font-size: 12px;
}

.thread-author span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.thread-card > p {
  margin: 13px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.source-path,
.post-lineage {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.source-path > *,
.post-lineage > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-path > span,
.post-lineage > span {
  font-weight: 750;
}

.source-path button,
.post-lineage button,
.answer-destination button,
.case-linked button,
.table-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--violet);
  font-size: inherit;
  font-weight: 750;
  text-align: left;
}

.post-lineage i {
  color: var(--brand);
  font-style: normal;
}

.post-lineage strong {
  color: var(--ink);
}

.publication-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.publication-top > div,
.publish-location > div,
.answer-destination > div,
.tree-node > div {
  min-width: 0;
}

/* The delivery metadata lives inside the narrower half of the publications
   layout.  Make that card respond to its own available width rather than the
   whole browser viewport, otherwise the four desktop columns can squeeze a
   label down to a few letters at the split-layout breakpoint. */
.publication-detail {
  min-width: 0;
  container-type: inline-size;
}

.publication-dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 15px;
}

.publish-location {
  margin: 18px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 1fr) minmax(0, 1.35fr);
  max-width: 100%;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #d8e9df;
  border-radius: 13px;
  background: #f8fcfa;
}

.publish-location > div,
.publish-location > a {
  min-width: 0;
  min-height: 73px;
  padding: 13px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid #d8e9df;
}

.publish-location > :last-child {
  border-right: 0;
}

.publish-location > a {
  padding: 0 14px;
  place-content: center;
  border-right: 0;
  background: #fff;
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.publish-location strong {
  color: var(--ink);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.publish-location-note {
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.published-card {
  border-color: #cce7d9;
  box-shadow: inset 3px 0 0 var(--success);
}

.thread-metrics {
  margin-top: 14px;
  padding-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.linked-comments {
  margin-top: 20px;
}

.linked-comment {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.linked-comment:hover {
  border-color: #cdd6e2;
}

.avatar-small {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9edf5;
  color: #59667e;
  font-size: 10px;
  font-weight: 800;
}

.linked-comment strong,
.linked-comment p {
  display: block;
}

.linked-comment strong {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.linked-comment p {
  margin: 3px 0 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.linked-comments-preview-note {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.comment-target {
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.answer-destination {
  margin-bottom: 17px;
  padding: 12px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid #dfd6fb;
  border-radius: 12px;
  background: #faf8ff;
}

.destination-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 850;
}

.answer-destination strong,
.answer-destination button {
  display: block;
}

.answer-destination strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.answer-destination button {
  margin-top: 5px;
  font-size: 10px;
}

.thread-tree {
  position: relative;
  margin-top: 18px;
}

.tree-node {
  position: relative;
  min-height: 79px;
  padding: 14px 0 14px 45px;
  border-bottom: 1px solid var(--line);
}

.tree-node:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tree-node::before {
  content: "";
  position: absolute;
  top: 37px;
  bottom: -16px;
  left: 14px;
  width: 1px;
  background: #d9e1ec;
}

.tree-node:last-child::before {
  display: none;
}

.tree-marker {
  position: absolute;
  top: 12px;
  left: 0;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9edf4;
  color: #56637a;
  font-size: 10px;
  font-weight: 850;
}

.tree-root .tree-marker {
  background: #263351;
  color: #fff;
}

.tree-comment.is-target {
  margin: 0 -10px;
  padding-right: 10px;
  padding-left: 55px;
  border: 1px solid #eed0ce;
  border-radius: 11px;
  background: #fff9f8;
}

.tree-comment.is-target::before {
  left: 24px;
}

.tree-comment.is-target .tree-marker {
  left: 10px;
  background: #f7d6d4;
  color: var(--brand-dark);
}

.tree-reply .tree-marker {
  background: var(--brand);
  color: #fff;
}

.tree-reply.is-sent .tree-marker {
  background: var(--success);
}

.tree-empty .tree-marker {
  background: var(--danger-soft);
  color: var(--danger);
}

.tree-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tree-head strong {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.tree-node p {
  margin: 5px 0 3px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.46;
  overflow-wrap: anywhere;
}

.tree-node small {
  color: #77859a;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.response-panel {
  margin-top: 20px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.response-panel h3 {
  margin-top: 4px;
  font-size: 14px;
}

.response-panel p {
  max-width: 570px;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.response-panel .detail-actions {
  margin: 0;
  justify-content: flex-end;
}

.stats-metrics {
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 20px;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

td small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.table-link {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.table-link:hover {
  color: var(--brand-dark);
}

.insight-card {
  border-color: #dfd4fb;
  background: linear-gradient(145deg, #fff 0%, #faf8ff 100%);
}

.insight-card h2 {
  margin-top: 5px;
  font-size: 19px;
}

.insight-card > p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.insight-number {
  margin: 22px 0;
  color: var(--violet);
  font-size: 36px;
  font-weight: 850;
  letter-spacing: -0.07em;
}

.insight-number span {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.mini-stat {
  padding: 11px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e4def5;
  font-size: 11px;
}

.mini-stat strong {
  color: var(--ink);
}

.mini-stat span {
  color: var(--ink-soft);
  text-align: right;
}

.weekly-report {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(115deg, #fff 0%, #fbfcff 100%);
}

.weekly-report h2 {
  margin-top: 4px;
  font-size: 17px;
}

.weekly-report p {
  max-width: 750px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.weekly-metrics {
  align-items: stretch;
  flex-direction: column;
}

.weekly-metrics .panel-head {
  width: 100%;
}

.error-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #f1c2c6;
  border-radius: 10px;
  background: #fff4f4;
  color: #9d2d38;
  font-size: 12px;
  line-height: 1.45;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.case-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.case-card h2 {
  margin-top: 8px;
  font-size: 18px;
}

.case-id {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.case-linked {
  margin-top: 18px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.case-linked > span,
.case-linked button,
.case-linked p {
  display: block;
}

.case-linked > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.case-linked button {
  margin-top: 4px;
  font-size: 11px;
}

.case-linked p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.case-insight {
  margin-top: 16px;
}

.case-insight p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.case-decision {
  margin-top: 16px;
  padding-top: 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
}

.case-decision strong {
  color: var(--ink);
  text-align: right;
}

.case-note {
  margin-top: 20px;
  padding: 15px 17px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #f0dcbb;
  border-radius: 14px;
  background: #fff9ee;
}

.case-note-icon {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 850;
}

.case-note strong {
  font-size: 12px;
}

.case-note p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.settings-tabs {
  margin-bottom: 18px;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.settings-tabs button {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 0 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.settings-tabs button.is-active {
  border-bottom-color: var(--brand);
  color: var(--brand-dark);
}

.settings-intro {
  margin-bottom: 18px;
  padding: 15px 17px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #f0dfbc;
  border-radius: 13px;
  background: #fff9ee;
}

.settings-intro-icon {
  width: 25px;
  height: 25px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 850;
}

.settings-intro strong {
  font-size: 12px;
}

.settings-intro p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.connection-card {
  min-height: 205px;
  padding: 18px;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-content: start;
  gap: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.connection-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 850;
}

.connection-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.connection-icon.scout {
  background: var(--manual-soft);
  color: var(--manual);
}

.connection-icon.publisher {
  background: #263351;
  color: #fff;
}

.connection-copy h2 {
  margin-top: 4px;
  font-size: 16px;
}

.connection-copy p {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.48;
}

.connection-copy code,
.connection-scope {
  min-height: 35px;
  margin-top: 13px;
  padding: 7px 8px;
  display: block;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #59667d;
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.technical-details {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.5;
}

.technical-details summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.technical-details p {
  margin: 9px 0 0;
}

.technical-details .detail-actions {
  margin-top: 10px;
}

.connection-card > .pill {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 13px;
}

/* Owner onboarding: name the exact missing contour instead of reducing every
   unconfigured integration to one vague “test mode” label. */
.connection-start-guide {
  margin-bottom: 18px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.connection-start-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.connection-start-guide h2 {
  margin: 4px 0 6px;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.connection-start-guide-head p,
.connection-start-step p,
.connection-start-guard span {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.connection-start-steps {
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.connection-start-step {
  min-width: 0;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.connection-start-step--success { border-color: #c9e7d8; }
.connection-start-step--warning { border-color: #f0dfbc; }
.connection-start-step--danger { border-color: #efc7c4; }

.connection-start-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  font-weight: 850;
}

.connection-start-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.connection-start-title strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
}

.connection-start-step p { margin-top: 4px; }

.connection-start-guard {
  margin-top: 12px;
  padding: 10px 11px;
  display: grid;
  gap: 3px;
  border: 1px solid #d9d5fa;
  border-radius: 9px;
  background: #faf9ff;
}

.connection-start-guard strong {
  color: var(--violet);
  font-size: 11px;
}

.automation-table {
  margin: 16px -20px -20px;
  border-top: 1px solid var(--line);
}

.automation-row {
  min-height: 59px;
  padding: 11px 20px;
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(125px, 0.46fr) minmax(250px, 1.2fr);
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.automation-row:last-child {
  border-bottom: 0;
}

.automation-row strong {
  color: var(--ink);
  font-size: 12px;
}

.automation-row.header {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kill-switch-panel {
  margin-top: 20px;
}

.kill-switch-list {
  margin: 16px -20px -20px;
  border-top: 1px solid var(--line);
}

.kill-switch-row {
  min-height: 72px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) max-content max-content;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.kill-switch-row:last-child {
  border-bottom: 0;
}

.kill-switch-row strong {
  color: var(--ink);
  font-size: 12px;
}

.kill-switch-row p {
  max-width: 690px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.42;
}

.settings-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.settings-columns h2 {
  margin-top: 4px;
  font-size: 18px;
}

.rule-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.rule-grid > div {
  min-height: 73px;
  padding: 11px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.rule-grid strong {
  font-size: 11px;
  line-height: 1.35;
}

.rule-grid span {
  color: var(--danger);
  font-size: 10px;
}

.limit-list {
  margin-top: 14px;
}

.limit-list > div {
  min-height: 42px;
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
}

.limit-list > div:last-child {
  border-bottom: 0;
}

.limit-list strong {
  color: var(--ink);
  text-align: right;
}

.audit-list {
  margin-top: 15px;
}

.audit-row {
  padding: 14px 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.audit-row:last-child {
  border-bottom: 0;
}

.audit-row time {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.audit-row strong,
.audit-row p {
  display: block;
}

.audit-row strong {
  color: var(--ink);
  font-size: 12px;
}

.audit-row p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid #bfe7d7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(21, 32, 52, 0.18);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.42;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast strong {
  color: var(--success);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.roles-hero {
  margin-bottom: 18px;
  padding: 19px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  align-items: start;
  border: 1px solid #d8e8df;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff 0%, #f7fcf9 100%);
}

.roles-hero h2 {
  margin: 5px 0 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.roles-hero p {
  max-width: 700px;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.demo-role-switch {
  grid-column: 1 / -1;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #d9ebe0;
  color: var(--ink-soft);
  font-size: 11px;
}

.role-matrix {
  overflow: hidden;
}

.role-matrix .table-wrap {
  margin-bottom: -4px;
}

.secrets-note {
  margin-top: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dfe2fa;
  border-radius: 13px;
  background: #faf9ff;
}

.secrets-note > span {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--violet-soft);
  color: var(--violet);
  font-weight: 850;
}

.secrets-note strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.secrets-note p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.admin-readonly {
  margin-bottom: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid #cce8f2;
  border-radius: var(--radius);
  background: linear-gradient(115deg, #fff 0%, #f6fcfe 100%);
}

.admin-readonly-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--manual);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.admin-readonly h2 {
  margin: 5px 0 0;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.admin-readonly p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.status-card {
  min-height: 143px;
  padding: 15px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-card strong {
  color: var(--ink);
  font-size: 14px;
}

.status-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.user-management {
  margin-top: 20px;
}

.access-slots {
  display: grid;
  justify-items: end;
  gap: 5px;
  white-space: nowrap;
}

.access-slots small {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.user-admin-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
}

.user-form {
  padding: 16px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.user-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
}

.user-form input,
.user-form select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.user-form small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.42;
}

.form-role-lock {
  padding: 11px 12px;
  display: grid;
  gap: 3px;
  border: 1px solid #d8e8df;
  border-radius: 9px;
  background: #f7fcf9;
}

.form-role-lock strong {
  color: var(--ink);
  font-size: 13px;
}

.user-form-limit {
  align-content: start;
  background: #fffaf1;
  border-color: #f0dcc0;
}

.user-form-limit strong {
  color: var(--ink);
  font-size: 15px;
}

.user-form-limit p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.user-actions {
  min-width: 210px;
}

.llm-reconcile-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 330px;
}

.llm-reconcile-form select,
.llm-reconcile-form input {
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
}

.llm-reconcile-form select {
  min-width: 185px;
}

.llm-reconcile-form input {
  width: 115px;
}

.user-actions > .btn {
  margin-top: 6px;
}

.user-permissions-row td {
  padding: 0 10px 15px;
  background: #fbfcfe;
}

.permission-editor {
  padding: 14px;
  border: 1px solid #dfe6ee;
  border-radius: 12px;
  background: #fff;
}

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

.permission-editor-head strong {
  color: var(--ink);
  font-size: 12px;
}

.permission-editor-head p {
  max-width: 620px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.permission-summary {
  display: flex;
  max-width: 330px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.permission-summary span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.permission-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-choice {
  min-height: 74px;
  padding: 10px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  cursor: pointer;
}

.permission-choice:has(input:checked) {
  border-color: #90c8a4;
  background: #f5fbf7;
}

.permission-choice input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.permission-choice strong,
.permission-choice small {
  display: block;
}

.permission-choice strong {
  color: var(--ink);
  font-size: 10px;
}

.permission-choice small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.35;
}

.permission-readonly-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-readonly-card,
.permission-readonly-empty {
  min-height: 74px;
  padding: 11px;
  border: 1px solid #cfe4d7;
  border-radius: 10px;
  background: #f6fbf8;
}

.permission-readonly-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.permission-readonly-card--base {
  border-color: var(--line);
  background: var(--surface-soft);
}

.permission-readonly-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
}

.permission-readonly-card strong,
.permission-readonly-card small {
  display: block;
}

.permission-readonly-card strong,
.permission-readonly-empty strong {
  color: var(--ink);
  font-size: 11px;
}

.permission-readonly-card small,
.permission-readonly-empty p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.4;
}

.permission-readonly-state {
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.permission-editor-foot {
  margin-top: 11px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.permission-editor-foot small {
  max-width: 600px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.4;
}

.secret-stage {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.8fr);
  gap: 20px;
  align-items: end;
}

.secret-stage h2,
.secret-stage p {
  margin: 6px 0 0;
}

.secret-stage h2 {
  color: var(--ink);
  font-size: 18px;
}

.secret-stage p,
.secret-stage-form small {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.secret-stage-form {
  display: grid;
  gap: 8px;
}

.secret-stage-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
}

.secret-stage-form input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
}

.setup-note {
  margin-top: 16px;
  padding: 13px 15px;
  display: grid;
  gap: 4px;
  border: 1px solid #c9e5ee;
  border-radius: 12px;
  background: var(--manual-soft);
  color: var(--manual);
  font-size: 12px;
  line-height: 1.45;
}

.auth-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, #fff3f2, transparent 34%), var(--canvas);
}

.auth-card {
  width: min(100%, 440px);
  padding: 32px;
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card .brand {
  padding: 0;
}

.auth-card h1,
.auth-card p {
  margin: 0;
}

.auth-card h1 {
  color: var(--ink);
  font-size: 26px;
  letter-spacing: -0.035em;
}

.auth-card p,
.auth-card small {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.auth-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid #ffd0cd;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger) !important;
}

.auth-card > label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.auth-card > label input {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
}

.mfa-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.mfa-codes code {
  padding: 8px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}

.mfa-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.empty-state {
  min-height: 210px;
  padding: 30px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state h2 {
  color: var(--ink);
  font-size: 18px;
}

.empty-state p {
  max-width: 460px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.mock-warning {
  margin: 16px 0;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  border: 1px solid #f5d38b;
  border-radius: 11px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .account-chip {
    min-width: 0;
    flex: 1 1 250px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* The role chip already says who is signed in. Keeping a second copy of
     the same name at this width made the header wrap into a distracting
     third line. */
  .user-chip {
    display: none;
  }
}

@media (max-width: 1220px) {
  .metrics-grid,
  .stats-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .connection-card {
    min-height: 0;
  }

  .published-mini-grid {
    grid-template-columns: 1fr;
  }

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

  .publish-location > a {
    border-top: 1px solid #d8e9df;
  }

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

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 10px;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand > div:last-child,
  .sidebar-caption,
  .side-label,
  .nav-count,
  .sidebar-foot {
    display: none;
  }

  .side-nav-item {
    justify-content: center;
    padding: 0;
  }

  .topbar {
    padding: 13px 20px;
  }

  .budget-chip,
  .user-chip {
    display: none;
  }

  .role-chip {
    display: flex;
  }

  .content {
    padding: 22px;
  }

  .mock-global-banner {
    padding: 9px 20px;
  }

  .dashboard-grid,
  .stats-grid,
  .settings-columns,
  .user-admin-grid,
  .secret-stage {
    grid-template-columns: 1fr;
  }

  .trusted-source-policy {
    grid-template-columns: 1fr;
  }

  .trusted-domain-editor-actions {
    align-items: flex-start;
  }

  .daily-limits-fields {
    grid-template-columns: 1fr;
  }

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

  .permission-readonly-list {
    grid-template-columns: 1fr;
  }

  .split-layout {
    grid-template-columns: minmax(240px, 0.76fr) minmax(0, 1.24fr);
  }

  .read-only-observation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .connection-start-guide-head {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 0;
    padding: 9px 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .sidebar-section {
    min-width: 0;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }

  .side-nav-item {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .topbar {
    min-height: 56px;
    padding: 10px 14px;
  }

  .environment {
    display: none;
  }

  .top-actions {
    width: 100%;
  }

  .account-chip {
    flex: 1;
  }

  .top-actions .btn-quiet:not([data-topbar-control="logout"]) {
    display: none;
  }

  .top-actions [data-topbar-control="logout"] {
    display: inline-flex;
  }

  .content {
    padding: 16px;
  }

  .trusted-domain-form,
  .trusted-domain-editor-actions,
  .daily-limits-editor-actions,
  .publication-control-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .trusted-domain-form .btn,
  .trusted-domain-editor-actions > div {
    justify-self: start;
  }

  .trusted-domain-editor-actions > div {
    justify-content: flex-start;
  }

  .daily-limits-editor-actions > div {
    justify-content: flex-start;
  }

  .publication-control-actions > div:last-child {
    justify-content: flex-start;
  }

  .trusted-domain-editor-row {
    align-items: flex-start;
  }

  .access-slots {
    justify-items: start;
    margin-top: 10px;
  }

  .permission-editor-head,
  .permission-editor-foot {
    display: grid;
  }

  .permission-summary {
    justify-content: flex-start;
    max-width: none;
  }

  .permission-editor-foot .btn {
    justify-self: start;
  }

  .mock-global-banner {
    padding: 8px 14px;
    align-items: flex-start;
    font-size: 11px;
  }

  .page-heading,
  .notice,
  .weekly-report,
  .response-panel {
    display: block;
  }

  .page-heading > :last-child,
  .notice-actions,
  .weekly-report .btn,
  .response-panel .detail-actions {
    margin-top: 12px;
  }

  .metrics-grid,
  .stats-metrics,
  .flow-strip,
  .cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-strip > div:nth-child(even) {
    border-right: 0;
  }

  .flow-strip > div:nth-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .queue-layout .queue-detail,
  .posts-layout .publication-detail,
  .comments-layout .comment-detail {
    order: -1;
  }

  .score-row,
  .destination-box {
    grid-template-columns: 1fr;
  }

  .score-row > div,
  .destination-box > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .publish-location {
    grid-template-columns: 1fr;
  }

  .publish-location > div,
  .publish-location > a {
    min-height: 58px;
    border-right: 0;
    border-top: 1px solid #d8e9df;
  }

  .publish-location > div:first-child {
    border-top: 0;
  }

  .linked-comment {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .linked-comment > .pill {
    grid-column: 2;
    justify-self: start;
  }

  .automation-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .automation-row.header {
    display: none;
  }

  .publication-mode-choices {
    grid-template-columns: 1fr;
  }

  .publication-mode-choice {
    min-height: 0;
  }

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

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

  .kill-switch-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }
}

@media (max-width: 470px) {
  .metrics-grid,
  .stats-metrics,
  .flow-strip,
  .cases-grid {
    grid-template-columns: 1fr;
  }

  .flow-strip > div,
  .flow-strip > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .flow-strip > div:last-child {
    border-bottom: 0;
  }

  .metric-card {
    min-height: 94px;
  }

  .external-head,
  .panel-head {
    align-items: flex-start;
  }

  .external-head {
    display: block;
  }

  .external-head > .pill {
    margin-top: 9px;
  }
}

/* Owner control centre: one truthful map of the four independent contours. */
.control-center {
  display: grid;
  gap: 18px;
}

.control-center-hero,
.control-center-foot,
.control-center-blocker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-center-hero {
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.control-center-hero h2 {
  margin: 5px 0 8px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.control-center-hero p,
.control-center-blocker p,
.control-center-card > p,
.control-center-note,
.control-center-foot span {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.control-center-blocker {
  padding: 15px 18px;
  display: flex;
  gap: 12px;
  border-color: #f0cf86;
  background: var(--warning-soft);
}

.control-center-blocker > span {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f0c76b;
  color: #6e4600;
  font-size: 14px;
  font-weight: 900;
}

.control-center-blocker strong {
  display: block;
  margin-bottom: 2px;
  color: #704900;
  font-size: 13px;
}

.control-center-flow {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
}

.control-center-flow span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.control-center-flow i {
  color: var(--brand);
  font-style: normal;
}

.control-center-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.control-center-card {
  min-width: 0;
  padding: 19px;
  display: grid;
  align-content: start;
  gap: 11px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-center-card--success { border-top-color: var(--success); }
.control-center-card--warning { border-top-color: #e6ad40; }
.control-center-card--danger { border-top-color: var(--danger); }
.control-center-card--violet { border-top-color: var(--violet); }

.control-center-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-center-card-head .pill { margin-left: auto; }

.control-center-step {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-center-icon {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 11px;
  font-weight: 850;
}

.control-center-card h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.control-center-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.control-center-facts > div {
  min-width: 0;
  padding: 9px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.control-center-facts > div:last-child { border-right: 0; }

.control-center-facts dt {
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.control-center-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.control-center-next {
  padding-top: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-center-next > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.control-center-note {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.control-center-foot {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.control-center-foot strong,
.control-center-foot span { display: block; }
.control-center-foot strong { margin-bottom: 3px; font-size: 13px; }

@media (max-width: 760px) {
  .control-center-hero,
  .control-center-foot { align-items: stretch; flex-direction: column; }

  .control-center-grid { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  .control-center-hero,
  .control-center-card { padding: 16px; }

  .control-center-facts { grid-template-columns: 1fr; }
  .control-center-facts > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .control-center-facts > div:last-child { border-bottom: 0; }
  .control-center-next { align-items: flex-start; flex-direction: column; }
}

/* The width that matters here is the right-hand publication panel, not the
   browser window: on a split view that panel becomes narrow long before the
   viewport reaches a global media breakpoint.  Keep metadata readable rather
   than letting an intrinsic permalink column push its neighbours out of view. */
@media (min-width: 761px) {
  @container (max-width: 700px) {
    .publish-location {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .publish-location > :nth-child(even) {
      border-right: 0;
    }

    .publish-location > :nth-child(n + 3) {
      border-top: 1px solid #d8e9df;
    }
  }

  @container (max-width: 410px) {
    .publish-location {
      grid-template-columns: 1fr;
    }

    .publish-location > * {
      min-height: 58px;
      border-right: 0;
      border-top: 1px solid #d8e9df;
    }

    .publish-location > :first-child {
      border-top: 0;
    }
  }
}

/* Scout workbench: a topic, a raw signal and a query run are deliberately
   separate visual objects. This keeps an editor from mistaking a viral
   mention or a blocked URL for a publishable news item. */
.scout-overview {
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid #c8ddd1;
  border-radius: 16px;
  background: linear-gradient(135deg, #f2faf6 0%, #fbfdfc 54%, #f5f7fb 100%);
  box-shadow: var(--shadow);
}

.scout-overview-main {
  padding: 18px 20px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scout-overview-main h2,
.scout-settings-intro h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 18px;
}

.scout-overview-main p,
.scout-settings-intro p {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.scout-overview-meta,
.scout-flow-counts,
.scout-facts,
.scout-source-summary,
.scout-run-counts,
.scout-run-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scout-overview-meta {
  border-top: 1px solid #d5e6dc;
  background: rgb(255 255 255 / 0.55);
}

.scout-overview-meta > div {
  min-height: 82px;
  padding: 13px 16px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid #d5e6dc;
}

.scout-overview-meta > div:last-child {
  border-right: 0;
}

.scout-overview-meta span,
.scout-facts span,
.scout-source-summary span,
.scout-run-meta span,
.scout-references > div > span,
.scout-reference > span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scout-overview-meta strong,
.scout-overview-meta small,
.scout-facts strong,
.scout-source-summary strong,
.scout-run-meta strong {
  overflow-wrap: anywhere;
}

.scout-overview-meta strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.scout-overview-meta small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.scout-flow-counts {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid #d5e6dc;
  background: #fff;
}

.scout-flow-counts > div,
.scout-run-counts > div {
  min-height: 70px;
  padding: 11px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  border-right: 1px solid var(--line);
}

.scout-flow-counts > div:last-child,
.scout-run-counts > div:last-child {
  border-right: 0;
}

.scout-flow-counts strong,
.scout-run-counts strong {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.045em;
  line-height: 1;
}

.scout-flow-counts span,
.scout-run-counts span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
}

.scout-overview-note {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid #d5e6dc;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.scout-tabs {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.scout-tabs button {
  min-height: 35px;
  padding: 0 11px 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.scout-tabs button span {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf1f6;
  color: var(--ink-soft);
  font-size: 9px;
}

.scout-tabs button.is-active {
  border-color: #9bcdb1;
  background: #eaf7ef;
  color: #236344;
}

.scout-tabs button.is-active span {
  background: #cbe9d6;
  color: #236344;
}

.scout-split-layout {
  align-items: stretch;
}

.scout-list {
  min-height: 360px;
  overflow: hidden;
}

.scout-record {
  width: 100%;
  min-height: 126px;
  padding: 14px 15px;
  display: grid;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.scout-record:last-child {
  border-bottom: 0;
}

.scout-record:hover {
  background: var(--surface-soft);
}

.scout-record.is-selected {
  background: #f0f8f3;
  box-shadow: inset 3px 0 0 #43a56d;
}

.scout-record .record-meta {
  justify-content: space-between;
}

.scout-record .record-meta > span:last-child {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.scout-record strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.32;
}

.scout-record p {
  min-height: 30px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.scout-record-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.scout-record-foot > :last-child {
  overflow: hidden;
  max-width: 46%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scout-empty-list {
  min-height: 250px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 7px;
  color: var(--ink-soft);
  text-align: center;
}

.scout-empty-list strong {
  color: var(--ink);
  font-size: 13px;
}

.scout-empty-list span {
  font-size: 11px;
  line-height: 1.5;
}

.scout-detail {
  min-width: 0;
}

.scout-score-card {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid #d6e6dc;
  border-radius: 12px;
  background: #fbfefc;
}

.scout-score-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scout-score-head > div {
  min-height: 78px;
  padding: 13px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid #d6e6dc;
}

.scout-score-head > div:last-child {
  border-right: 0;
}

.scout-score-head span,
.scout-score-components small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scout-score-head strong {
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.scout-score-components {
  padding: 11px 13px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid #d6e6dc;
}

.scout-score-components span {
  min-width: 0;
  padding: 6px;
  display: grid;
  gap: 3px;
  border-radius: 7px;
  background: #f0f6f2;
}

.scout-score-components small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
}

.scout-score-components strong {
  color: var(--ink);
  font-size: 12px;
}

.scout-facts,
.scout-source-summary,
.scout-run-meta {
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.scout-facts > div,
.scout-source-summary > div,
.scout-run-meta > div {
  min-width: 0;
  min-height: 66px;
  padding: 11px 12px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line);
}

.scout-facts > div:last-child,
.scout-source-summary > div:last-child,
.scout-run-meta > div:last-child {
  border-right: 0;
}

.scout-facts strong,
.scout-source-summary strong,
.scout-run-meta strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
}

.scout-query-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.scout-link-chip {
  padding: 6px 8px;
  border: 1px solid #d4e1ea;
  border-radius: 7px;
  background: #f6f9fc;
  color: #4d657b;
  font-size: 10px;
  font-weight: 800;
}

.scout-next-check {
  color: #577082;
  font-size: 10px;
  font-weight: 750;
}

.scout-evidence-list {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.scout-evidence-list > div {
  padding: 10px 11px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.scout-evidence-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.scout-safe-excerpt {
  margin: 16px 0;
  padding: 13px 14px;
  border: 1px solid #d9e7df;
  border-radius: 10px;
  background: #f7fbf8;
}

.scout-safe-excerpt p {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.55;
}

.scout-references {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.scout-references > div,
.scout-reference {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.scout-references strong,
.scout-references button,
.scout-reference button {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #326a87;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scout-privacy-note {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.scout-run-counts {
  margin: 17px 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.scout-run-error {
  margin: 14px 0;
  padding: 12px 13px;
  border: 1px solid #f2c2c0;
  border-radius: 9px;
  background: var(--danger-soft);
}

.scout-run-error strong {
  color: var(--danger);
  font-size: 11px;
}

.scout-run-error p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.scout-manual-handoff {
  margin-top: 18px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #dacfea;
  border-radius: 13px;
  background: #faf8fd;
}

.scout-manual-handoff h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 14px;
}

.scout-manual-handoff p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.scout-manual-handoff > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.scout-manual-handoff button {
  max-width: 220px;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid #d5c8e6;
  border-radius: 7px;
  background: #fff;
  color: #624b8a;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scout-settings-intro {
  margin-bottom: 18px;
  padding: 17px 19px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #cfe2d7;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3faf6, #fbfdfc);
}

.scout-query-panel,
.scout-query-create {
  margin-bottom: 18px;
}

.scout-query-table table th:last-child,
.scout-query-table table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.scout-query-table td small,
.scout-query-table td > .pill {
  display: block;
  margin-top: 4px;
}

.scout-query-actions {
  text-align: right;
}

.scout-query-form {
  margin-top: 17px;
  display: grid;
  grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(125px, 1fr));
  gap: 11px;
  align-items: end;
}

.scout-query-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.scout-query-form input,
.scout-query-form select {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.scout-query-form .btn {
  min-height: 38px;
}

.scout-query-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 750;
}

.scout-settings-note {
  margin-top: 15px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border-radius: 10px;
  background: #f7f8fb;
}

.scout-settings-note > span {
  color: #596a7f;
  font-weight: 900;
}

.scout-settings-note strong {
  color: var(--ink);
  font-size: 11px;
}

.scout-settings-note p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 1020px) {
  .scout-flow-counts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scout-flow-counts > div:nth-child(3n) {
    border-right: 0;
  }

  .scout-flow-counts > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .scout-query-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scout-query-form label:first-child {
    grid-column: span 2;
  }

  .scout-score-components {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .scout-overview-main,
  .scout-settings-intro,
  .scout-manual-handoff {
    display: grid;
  }

  .scout-manual-handoff > div:last-child {
    justify-content: flex-start;
  }

  .scout-overview-meta,
  .scout-source-summary,
  .scout-run-meta,
  .scout-facts {
    grid-template-columns: 1fr;
  }

  .scout-overview-meta > div,
  .scout-source-summary > div,
  .scout-run-meta > div,
  .scout-facts > div {
    min-height: 58px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .scout-overview-meta > div:first-child,
  .scout-source-summary > div:first-child,
  .scout-run-meta > div:first-child,
  .scout-facts > div:first-child {
    border-top: 0;
  }

  .scout-flow-counts,
  .scout-run-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scout-flow-counts > div,
  .scout-run-counts > div {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .scout-flow-counts > div:nth-child(even),
  .scout-run-counts > div:nth-child(even) {
    border-right: 0;
  }

  .scout-flow-counts > div:nth-last-child(-n + 2),
  .scout-run-counts > div:nth-last-child(-n + 1) {
    border-bottom: 0;
  }

  .scout-score-head,
  .scout-references {
    grid-template-columns: 1fr;
  }

  .scout-score-head > div {
    min-height: 58px;
    border-top: 1px solid #d6e6dc;
    border-right: 0;
  }

  .scout-score-head > div:first-child {
    border-top: 0;
  }

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

  .scout-query-form,
  .scout-query-form label:first-child {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .scout-query-table {
    overflow-x: auto;
  }
}

@media (max-width: 470px) {
  .mfa-codes {
    grid-template-columns: 1fr;
  }

  .mfa-codes code {
    font-size: 12px;
  }

  .mfa-recovery-actions .btn {
    width: 100%;
  }

  .scout-flow-counts,
  .scout-run-counts,
  .scout-score-components {
    grid-template-columns: 1fr;
  }

  .scout-flow-counts > div,
  .scout-run-counts > div {
    min-height: 58px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scout-flow-counts > div:last-child,
  .scout-run-counts > div:last-child {
    border-bottom: 0;
  }
}
