:root {
  --ink: #162033;
  --muted: #667085;
  --line: #d9e0e8;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --orange: #f46b2a;
  --green: #36a852;
  --blue: #2658d9;
  --brand: #818cf8;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(22, 32, 51, 0.08);
}

* { box-sizing: border-box; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 20px;
  font-weight: 800;
  color: var(--ink);
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.brand span {
  font-size: 18px;
}

.nav {
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav a {
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 650;
}

.nav a.active,
.nav a:hover {
  color: var(--ink);
  background: #eef4ff;
}

.global-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.global-notice.warning {
  border-color: #fedf89;
  background: #fffbeb;
  color: #854a0e;
}

.global-notice.success {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.global-notice.info {
  border-color: #b8c6ff;
  background: #eef4ff;
  color: #1d3b7a;
}

.global-notice.danger {
  border-color: #fda29b;
  background: #fef3f2;
  color: #912018;
}

.live-refresh-panel {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(22, 32, 51, 0.05);
}

.live-refresh-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

.live-refresh-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.live-refresh-copy strong,
.live-refresh-copy span,
.live-refresh-copy em {
  display: block;
  overflow-wrap: anywhere;
}

.live-refresh-copy strong {
  font-size: 13px;
  font-weight: 850;
}

.live-refresh-copy span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.live-refresh-copy em {
  color: #7a4a12;
  font-size: 11px;
  font-style: normal;
}

.live-refresh-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  white-space: nowrap;
}

.live-refresh-button:hover {
  border-color: #b8c6ff;
  background: #eef4ff;
}

.live-refresh-panel[data-live-status="fresh"] .live-refresh-dot,
.live-refresh-panel[data-live-status="live"] .live-refresh-dot {
  background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.14);
}

.live-refresh-panel[data-live-status="stale"] .live-refresh-dot,
.live-refresh-panel[data-live-status="warning"] .live-refresh-dot,
.live-refresh-panel[data-live-status="paused"] .live-refresh-dot {
  background: #f79009;
  box-shadow: 0 0 0 3px rgba(247, 144, 9, 0.16);
}

.live-refresh-panel[data-live-status="blocked"] .live-refresh-dot,
.live-refresh-panel[data-live-status="danger"] .live-refresh-dot,
.live-refresh-panel[data-live-status="error"] .live-refresh-dot {
  background: #f04438;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.14);
}

.live-region-changed {
  animation: liveRegionPulse 1.8s ease-out;
}

@keyframes liveRegionPulse {
  0% {
    background: #fff7cc;
    box-shadow: 0 0 0 4px rgba(247, 144, 9, 0.16);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.user-mini {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.user-mini img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.avatar-initial {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: var(--blue);
  font-weight: 900;
}

.user-mini strong,
.user-mini span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-mini strong { font-size: 13px; }
.user-mini span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.logout {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.main-shell {
  min-height: 100vh;
  padding-left: 244px;
  min-width: 0;
}

.login-shell {
  min-height: 100vh;
}

.page {
  width: min(1380px, calc(100vw - 284px));
  margin: 0 auto;
  padding: 28px 24px 48px;
  min-width: 0;
}

.page.narrow {
  width: min(760px, calc(100vw - 284px));
}

.topbar,
.page-header,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.topbar { margin-bottom: 22px; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 { font-size: 32px; }
h2 { font-size: 18px; }

.target-chip {
  border: 1px solid #c7d2fe;
  background: #eef4ff;
  color: #123f95;
  border-radius: 7px;
  padding: 10px 12px;
  font-weight: 750;
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

.kpi {
  padding: 16px;
  min-height: 132px;
  display: grid;
  align-content: space-between;
}

.kpi span,
.metric-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.kpi strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
  line-height: 1;
}

.kpi em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.panel {
  padding: 18px;
  margin-bottom: 14px;
  min-width: 0;
}

.panel.large { min-height: 258px; }

.loop {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.loop div {
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px;
  min-height: 132px;
}

.loop div:nth-child(2) { border-top-color: var(--orange); }
.loop div:nth-child(3) { border-top-color: var(--blue); }
.loop div:nth-child(4) { border-top-color: #7a4dd8; }

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

.loop strong { margin-bottom: 8px; }
.loop span { color: var(--muted); font-size: 13px; line-height: 1.45; }

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.secondary-button,
.primary-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  background: var(--blue);
  color: #fff;
  padding: 12px 16px;
}

.secondary-button {
  background: #f1f5f9;
  color: var(--ink);
  padding: 9px 12px;
  font-size: 13px;
}

.small-button {
  background: var(--ink);
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
}

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

.link-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  padding: 6px 4px;
}

.link-button.danger {
  color: var(--danger);
}

button[disabled],
.primary-button[aria-busy="true"],
.secondary-button[aria-busy="true"],
.small-button[aria-busy="true"],
.link-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.64;
}

form[aria-busy="true"] {
  pointer-events: auto;
}

.form-pending-note {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef4ff;
  color: #1d3b7a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
}

.form-pending-note.warning {
  border-color: #fedf89;
  background: #fffbeb;
  color: #854a0e;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.field-warning {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.field-warning[hidden] {
  display: none;
}

.countdown-note {
  display: inline-flex;
  width: fit-content;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 11px;
  font-weight: 800;
}

.countdown-note.overdue {
  background: #fee4e2;
  color: #912018;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th {
  text-align: left;
  padding: 10px 10px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid #eef1f5;
  font-size: 13px;
  vertical-align: top;
}

td strong,
td span {
  display: block;
}

td span {
  color: var(--muted);
  margin-top: 3px;
  max-width: 420px;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #edf2f7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.pill.critical { background: #fee4e2; color: #912018; }
.pill.high { background: #fff1df; color: #9a4b13; }
.pill.medium { background: #e8f3ff; color: #164c9a; }
.pill.low { background: #ecfdf3; color: #067647; }
.pill.success { background: #ecfdf3; color: #067647; }
.pill.failed { background: #fee4e2; color: #912018; }
.pill.observed { background: #f1f5f9; color: var(--muted); }
.pill.positive { background: #ecfdf3; color: #067647; }
.pill.negative { background: #fee4e2; color: #912018; }
.pill.neutral,
.pill.inconclusive { background: #f1f5f9; color: var(--muted); }
.pill.partial { background: #fff1df; color: #9a4b13; }

.compact-table {
  min-width: 680px;
}

.admin-users-table {
  min-width: 1280px;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 28px;
  border: 1px dashed #b7c2d0;
  border-radius: 8px;
  color: var(--muted);
  margin-top: 14px;
}

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

.empty-state.compact {
  padding: 16px;
}

.audit-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.audit-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f5;
}

.audit-list span {
  color: var(--muted);
  font-size: 12px;
}

.login-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(244,107,42,0.10), transparent 26%),
    linear-gradient(270deg, rgba(54,168,82,0.10), transparent 25%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 14px;
}

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

.stack {
  display: grid;
  gap: 12px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

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

.scope-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 8px;
  min-width: 620px;
}

.scope-form label {
  font-size: 12px;
}

.scope-form input {
  min-width: 0;
}

.alert {
  border-radius: 7px;
  padding: 10px 12px;
  margin: 14px 0;
  font-size: 13px;
  font-weight: 700;
}

.alert.danger {
  background: #fee4e2;
  color: var(--danger);
}

.table-link {
  display: block;
}

.table-link:hover strong,
.back-link:hover {
  color: var(--blue);
}

.asin-candidate-list {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.asin-candidate {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.asin-candidate img,
.asin-candidate-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.asin-candidate-thumb {
  display: block;
  background: var(--panel);
}

.back-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
}

.workflow-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

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

.readonly-grid div,
.narrative-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.readonly-grid span,
.narrative-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.readonly-grid strong {
  display: block;
  text-transform: capitalize;
}

.narrative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.narrative-grid p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.comment-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.comment-item div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.comment-item strong,
.comment-item span {
  font-size: 12px;
}

.comment-item span {
  color: var(--muted);
}

.comment-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.comment-form .primary-button {
  width: fit-content;
}

.modal-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

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

.modal-header h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

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

.proposal-preview div,
.safety-copy {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.proposal-preview span,
.safety-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.proposal-preview strong,
.safety-copy strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.safety-copy {
  display: grid;
  gap: 6px;
  background: #fffbeb;
  border-color: #fedf89;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.comment-mini {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.comment-mini div {
  display: grid;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef1f5;
}

.comment-mini div:last-child {
  border-bottom: 0;
}

.comment-mini strong,
.comment-mini span {
  display: block;
  font-size: 11px;
}

.comment-mini span {
  color: var(--muted);
  line-height: 1.35;
}

.comment-inline-form {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.evidence-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.evidence-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.evidence-card strong,
.evidence-card span {
  display: block;
}

.evidence-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.evidence-meta span {
  display: inline-flex;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 750;
}

.evidence-card pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-block {
  max-height: 360px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.compact-form .secondary-button,
.outcome-form .primary-button {
  width: fit-content;
}

.pill.new { background: #edf2f7; color: var(--ink); }
.pill.triaging { background: #e8f3ff; color: #164c9a; }
.pill.in_progress,
.pill.experiment { background: #fff1df; color: #9a4b13; }
.pill.blocked,
.pill.lost { background: #fee4e2; color: #912018; }
.pill.won { background: #ecfdf3; color: #067647; }
.pill.archived { background: #f1f5f9; color: var(--muted); }
.pill.proposed { background: #e8f3ff; color: #164c9a; }
.pill.approved,
.pill.completed { background: #ecfdf3; color: #067647; }
.pill.dry_run_ready { background: #ecfdf3; color: #067647; }
.pill.running { background: #fff1df; color: #9a4b13; }
.pill.rejected,
.pill.paused { background: #fee4e2; color: #912018; }

.command-page {
  width: min(1520px, calc(100vw - 284px));
}

.command-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
  min-width: 0;
}

.header-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.lifecycle-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.lifecycle-tabs a {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.lifecycle-tabs a.active,
.lifecycle-tabs a:hover {
  border-color: #b8c6ff;
  background: #eef4ff;
  color: var(--ink);
}

.lifecycle-tabs strong {
  color: inherit;
  font-size: 13px;
}

.lifecycle-tabs span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.brand-country-strip a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-country-strip a span {
  padding: 0;
  min-height: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
}

.brand-country-strip a.active,
.brand-country-strip a:hover {
  border-color: #b8c6ff;
  background: #eef4ff;
  color: var(--ink);
}

.notice-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.notice-strip span {
  display: block;
  padding: 10px 12px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  color: #854a0e;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.brand-kpi-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.brand-panel-wide {
  min-width: 0;
}

.brand-tam-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brand-tam-table {
  min-width: 1420px;
}

.brand-tam-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
}

.brand-tam-table th:first-child,
.brand-tam-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 260px;
  min-width: 260px;
  background: #fff;
}

.brand-tam-table th:first-child {
  z-index: 3;
  background: #fbfcfe;
}

.brand-tam-table th span,
.brand-tam-table td span,
.brand-tam-table td em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.3;
}

.brand-tam-table .country-cell {
  min-width: 132px;
}

.brand-tam-table .country-cell strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.autonomy-kpi-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.autonomy-panel {
  overflow: visible;
}

.autonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.autonomy-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  min-width: 0;
}

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

.autonomy-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

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

.autonomy-metrics div,
.autonomy-readonly div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e7ecf3;
  border-radius: 8px;
  background: #fff;
}

.autonomy-metrics span,
.autonomy-readonly span,
.autonomy-description {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.autonomy-metrics strong,
.autonomy-readonly strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.autonomy-description {
  margin: 0;
}

.autonomy-form {
  display: grid;
  gap: 10px;
}

.autonomy-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.autonomy-form input,
.autonomy-form select,
.autonomy-form textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
}

.autonomy-form textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.confirmation-check input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
  flex: 0 0 auto;
}

.confirmation-check span {
  margin: 0;
  color: inherit;
}

.compact-confirm {
  margin-bottom: 6px;
  max-width: 210px;
}

.gate-hint {
  display: block;
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.gate-hint[data-required="true"] {
  color: #854a0e;
  font-weight: 750;
}

.autonomy-confirm {
  padding: 10px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
}

.lever-grid,
.threshold-grid,
.autonomy-readonly {
  display: grid;
  gap: 8px;
}

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

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

.lever-grid label,
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid #e7ecf3;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.lever-grid input,
.switch-row input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

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

.pill.observe { background: #edf2f7; color: var(--ink); }
.pill.recommend { background: #e8f3ff; color: #164c9a; }
.pill.approval_required { background: #fff1df; color: #9a4b13; }
.pill.autonomous { background: #ecfdf3; color: #067647; }

.country-rank-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.country-rank-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.country-rank-list a.active,
.country-rank-list a:hover {
  border-color: #b8c6ff;
  background: #eef4ff;
}

.country-rank-list strong {
  font-size: 14px;
}

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

.country-rank-list em {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
}

.stack-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.stack-item {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stack-item strong {
  font-size: 13px;
}

.stack-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.saved-view-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.saved-view-form,
.saved-view-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.saved-view-form input,
.saved-view-form select,
.safety-form input,
.safety-form select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  font: inherit;
}

.saved-view-form input {
  width: min(280px, 100%);
}

.saved-view-form select {
  width: 150px;
}

.saved-view-form .small-button {
  width: auto;
}

.safety-form {
  display: grid;
  gap: 7px;
  min-width: 190px;
}

.safety-form input[name="snoozed_until"],
.safety-form input[name="due_at"] {
  min-width: 180px;
}

.saved-view-list a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #eef4ff;
  color: #123f95;
  font-size: 12px;
  font-weight: 750;
}

.saved-view-list form {
  display: inline-flex;
}

.target-strip {
  display: grid;
  grid-template-columns: 1.15fr 1.05fr repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
}

.target-card {
  min-height: 132px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.target-card span,
.target-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.target-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef5;
}

.progress-track span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--green));
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 0.7fr);
  gap: 14px;
  margin-bottom: 14px;
  min-width: 0;
}

.command-main,
.command-side {
  margin-bottom: 0;
}

.bridge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  min-width: 0;
}

.bridge-item {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.bridge-item strong,
.bridge-item span,
.bridge-item em {
  display: block;
}

.bridge-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bridge-item em {
  color: var(--ink);
  font-size: 20px;
  font-style: normal;
  font-weight: 850;
}

.alert-stack,
.workflow-list,
.phase-list,
.source-health,
.agent-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.alert-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
}

.alert-item strong {
  font-size: 13px;
}

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

.alert-item.critical { border-left-color: var(--danger); background: #fff8f7; }
.alert-item.warning { border-left-color: var(--orange); background: #fffaf2; }
.alert-item.info { border-left-color: var(--blue); background: #f7fbff; }
.alert-item.success { border-left-color: var(--green); background: #f7fff9; }

.command-two-col {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
  min-width: 0;
}

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

.workflow-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workflow-list strong {
  font-size: 18px;
}

.phase-list {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.phase-list > div,
.source-health > div,
.agent-grid > div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f5;
}

.phase-list > div:last-child,
.source-health > div:last-child,
.agent-grid > div:last-child {
  border-bottom: 0;
}

.phase-list strong,
.phase-list span,
.source-health strong,
.source-health span,
.agent-grid strong,
.agent-grid span {
  display: block;
}

.phase-list span,
.source-health span,
.agent-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.event-spine-health {
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.35fr) minmax(220px, 0.75fr);
  align-items: stretch;
}

.event-spine-health > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.event-spine-health > div:first-child {
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
}

.event-spine-health strong,
.event-spine-health span {
  overflow-wrap: anywhere;
}

.source-artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.source-artifact-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-artifact-grid span,
.source-artifact-grid strong {
  display: block;
}

.source-artifact-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.source-artifact-grid strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}

.event-spine-rows {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.event-spine-rows > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.event-spine-rows strong,
.event-spine-rows span,
.event-spine-rows em {
  display: block;
  min-width: 0;
}

.event-spine-rows span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.event-spine-rows em {
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.warning-list p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #f1d2a8;
  border-radius: 8px;
  background: #fffaf2;
  color: #704700;
  font-size: 13px;
  line-height: 1.35;
}

.status-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.success,
.status-dot.active,
.status-dot.available,
.status-dot.connected { background: var(--green); }
.status-dot.partial,
.status-dot.planned,
.status-dot.evidence_only,
.status-dot.not_run,
.status-dot.stale,
.status-dot.disabled,
.status-dot.unavailable,
.status-dot.warning { background: var(--orange); }
.status-dot.blocked,
.status-dot.failed,
.status-dot.invalid,
.status-dot.not_connected,
.status-dot.rejected,
.status-dot.paused,
.status-dot.critical { background: var(--danger); }

.status-dot.proposed,
.status-dot.running { background: var(--blue); }
.status-dot.approved,
.status-dot.completed { background: var(--green); }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
  text-transform: capitalize;
}

.status-pill.connected,
.status-pill.available,
.status-pill.active { background: #ecfdf3; color: #067647; }
.status-pill.partial,
.status-pill.planned,
.status-pill.evidence-only,
.status-pill.not-run,
.status-pill.disabled,
.status-pill.unavailable,
.status-pill.stale { background: #fff1df; color: #9a4b13; }
.status-pill.not-connected,
.status-pill.blocked,
.status-pill.invalid,
.status-pill.failed { background: #fee4e2; color: #912018; }

.source-kpis {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.predictive-kpis {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}

.source-table {
  min-width: 1180px;
}

.revenue-policy-strip {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #fedf89;
  border-radius: 8px;
  background: #fffbeb;
  color: #854a0e;
}

.revenue-policy-strip span,
.revenue-policy-strip strong {
  padding: 0;
  border: 0;
  background: transparent;
}

.revenue-materializer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 16px;
  align-items: start;
}

.revenue-materializer h2 {
  margin: 0;
  font-size: 20px;
}

.revenue-materializer p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.revenue-materializer form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.revenue-materializer label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.revenue-materializer input[type="number"] {
  width: 100%;
  min-height: 38px;
}

.revenue-materializer .confirm-line {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  color: var(--ink);
  line-height: 1.35;
}

.revenue-materializer button {
  justify-self: start;
}

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

.lever-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lever-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.lever-card h2 {
  font-size: 20px;
}

.lever-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lever-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

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

.lever-metrics > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.lever-metrics span,
.lever-metrics em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.lever-metrics strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 17px;
}

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

.lever-detail {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lever-detail h3 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--ink);
}

.lever-detail p {
  overflow-wrap: anywhere;
}

.write-policy-grid,
.write-gate-grid,
.snapshot-grid,
.write-review-grid {
  display: grid;
  gap: 12px;
}

.write-policy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.write-policy-grid div,
.write-gate-grid div,
.snapshot-box,
.write-review-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}

.write-policy-grid span,
.write-gate-grid span,
.snapshot-box span,
.write-review-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.write-policy-grid strong,
.write-gate-grid strong,
.snapshot-box strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.write-plan-list {
  display: grid;
  gap: 16px;
}

.write-plan-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.write-plan-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.write-plan-heading h3 {
  margin: 2px 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.write-plan-heading span,
.write-gate-grid em,
.snapshot-box em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.write-plan-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.write-gate-grid,
.snapshot-grid,
.write-review-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.snapshot-box code {
  display: block;
  max-height: 140px;
  margin-top: 10px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 7px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
}

.write-review-grid ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.compact-table-wrap {
  max-height: 260px;
  overflow: auto;
}

.compact-source-table {
  min-width: 760px;
}

.lever-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lever-sources span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.lever-related .stack-item {
  color: inherit;
}

.pill.fresh { background: #ecfdf3; color: #067647; }
.pill.stale,
.pill.missing { background: #fff1df; color: #9a4b13; }
.pill.blocked { background: #fee4e2; color: #912018; }

.privacy-cell {
  min-width: 260px;
}

.privacy-cell strong,
.privacy-cell span {
  max-width: none;
  overflow-wrap: anywhere;
}

.lifecycle-table {
  min-width: 1480px;
}

.cohort-matrix-table {
  min-width: 1720px;
}

.ltv-cell {
  font-weight: 850;
}

.ltv-cell em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.ltv-cell.heat-1 { background: #f8fafc; }
.ltv-cell.heat-2 { background: #f0f9ff; color: #075985; }
.ltv-cell.heat-3 { background: #ecfdf3; color: #067647; }
.ltv-cell.heat-4 { background: #fff7ed; color: #9a3412; }
.ltv-cell.heat-5 { background: #fef3c7; color: #92400e; }

.lifecycle-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-bottom: 18px;
}

.builder-prompt {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 12px;
}

.builder-prompt strong,
.builder-category strong,
.journey-row strong {
  font-size: 13px;
}

.builder-prompt span,
.builder-category span,
.journey-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.builder-category-list,
.journey-list {
  display: grid;
  gap: 10px;
}

.builder-category,
.journey-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.builder-category:first-child,
.journey-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.builder-category > div,
.journey-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.builder-category em,
.journey-row em {
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.seller-ledger-table {
  min-width: 0;
  table-layout: fixed;
}

.seller-ledger-table th,
.seller-ledger-table td {
  overflow-wrap: anywhere;
}

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

.activation-list > div {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.activation-list > div > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activation-list strong,
.activation-list span,
.activation-list em,
.activation-list p {
  display: block;
}

.activation-list p {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.activation-list span,
.activation-list em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.activation-list em {
  font-style: normal;
}

.activation-checklist {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.activation-checklist li {
  padding-left: 2px;
}

.command-stack {
  display: grid;
  gap: 6px;
}

.command-stack code {
  display: block;
  overflow-wrap: anywhere;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
}

.mono-mini {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.danger-text {
  color: var(--danger);
}

.action-review-form {
  align-items: stretch;
  flex-wrap: wrap;
}

.audit-summary-column {
  min-height: 0;
}

.inline-json {
  max-width: 420px;
  max-height: 140px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 7px;
  background: #111827;
  color: #e5e7eb;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.drilldown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  min-width: 0;
}

.drilldown-column {
  min-height: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.drilldown-column > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  padding: 9px 0;
  border-top: 1px solid #eef1f5;
}

.rank-row span,
.rank-row em,
.rank-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row span {
  font-size: 13px;
  font-weight: 750;
}

.rank-row em {
  color: var(--ink);
  font-style: normal;
  font-weight: 850;
}

.rank-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
}

.api-grid div {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.api-grid strong,
.api-grid span {
  display: block;
}

.api-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.api-grid .status-pill {
  align-self: start;
  justify-self: start;
  width: fit-content;
}

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

.target-strip > *,
.command-grid > *,
.command-two-col > *,
.content-grid > *,
.bridge-grid > *,
.drilldown-grid > *,
.autonomy-grid > *,
.api-grid > *,
.agent-grid > *,
.event-spine-health > *,
.source-artifact-grid > *,
.write-policy-grid > *,
.write-gate-grid > *,
.snapshot-grid > *,
.write-review-grid > *,
.activation-list > * {
  min-width: 0;
}

@media (max-width: 1200px) {
  .target-strip,
  .brand-kpi-strip,
  .autonomy-kpi-strip,
  .lifecycle-tabs,
  .command-grid,
  .command-two-col,
  .drilldown-grid,
  .lifecycle-grid,
  .activation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bridge-grid,
  .event-spine-health,
  .source-artifact-grid,
  .agent-grid,
  .lever-grid,
  .lever-detail-grid,
  .write-policy-grid,
  .write-gate-grid,
  .snapshot-grid,
  .write-review-grid {
    grid-template-columns: 1fr;
  }
  .lever-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: auto;
    min-height: auto;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 12px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0;
  }
  .brand img,
  .avatar-initial,
  .user-mini img {
    width: 28px;
    height: 28px;
  }
  .brand span {
    font-size: 14px;
  }
  .nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .sidebar-footer {
    justify-self: end;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .user-mini {
    grid-template-columns: 28px;
    gap: 0;
  }
  .user-mini div {
    display: none;
  }
  .logout {
    padding: 6px 0;
    font-size: 11px;
    white-space: nowrap;
  }
  .main-shell {
    padding-left: 0;
  }
  .live-refresh-panel {
    grid-template-columns: 10px minmax(0, 1fr);
  }
  .live-refresh-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .page,
  .page.narrow {
    width: 100%;
  }
  .command-header,
  .target-strip,
  .brand-kpi-strip,
  .autonomy-kpi-strip,
  .lifecycle-tabs,
  .command-grid,
  .command-two-col,
  .drilldown-grid,
  .lifecycle-grid,
  .api-grid,
  .activation-list,
  .event-spine-health,
  .source-artifact-grid,
  .agent-grid,
  .write-policy-grid,
  .write-gate-grid,
  .snapshot-grid,
  .write-review-grid {
    grid-template-columns: 1fr;
  }
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .kpi-grid,
  .content-grid,
  .autonomy-metrics,
  .autonomy-readonly,
  .lever-grid,
  .threshold-grid,
  .loop,
  .detail-grid,
  .field-grid,
  .readonly-grid,
  .lever-detail-grid,
  .lever-metrics,
  .narrative-grid {
    grid-template-columns: 1fr;
  }
  .lever-card-head {
    grid-template-columns: 1fr;
  }
  .lever-status {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .revenue-materializer {
    grid-template-columns: 1fr;
  }
  .revenue-materializer form {
    grid-template-columns: 1fr;
  }
  .topbar {
    display: grid;
  }
  .target-chip {
    white-space: normal;
  }
}
