:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --panel-2: #fbfaf6;
  --text: #1f2933;
  --muted: #64707d;
  --line: #d9d6cb;
  --line-strong: #bdb8aa;
  --green: #168a63;
  --red: #c94338;
  --amber: #b7791f;
  --blue: #2b6cb0;
  --ink: #202124;
  --shadow: 0 14px 35px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

body,
.shell,
.view,
.panel,
.metric,
.segment-card {
  min-width: 0;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

button {
  border: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #efede6;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.mobile-tab-select {
  display: none;
}

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

.nav-heading {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  padding: 0 11px 2px;
  text-transform: uppercase;
}

.nav button,
.segmented button,
.ghost {
  min-height: 38px;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 11px;
  cursor: pointer;
}

.nav-group button {
  margin-left: 8px;
}

.nav button:hover,
.segmented button:hover,
.ghost:hover {
  background: rgba(32, 33, 36, 0.06);
}

.nav button.active,
.segmented button.active {
  background: #202124;
  color: #fff;
}

.version-badge {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding: 9px 10px;
}

.version-badge span,
.version-badge small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.version-badge span {
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.version-badge strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.scope {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.scope-inline {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scope-inline-group {
  display: grid;
  grid-template-columns: auto minmax(112px, auto);
  align-items: center;
  gap: 6px;
}

.scope label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.scope-inline span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.segmented.tilt-modes {
  grid-template-columns: repeat(3, 1fr);
}

.segmented button {
  text-align: center;
  border: 1px solid var(--line);
  background: #f8f7f2;
}

.shell {
  min-width: 0;
  padding: 22px 24px 36px;
}

.topbar {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 26px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

#view-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost {
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}

.primary-action {
  min-height: 38px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 14px;
}

.primary-action:hover {
  background: #34363a;
}

.primary-action:disabled,
.ghost:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
}

.notice.slim {
  margin: 10px 0;
  padding: 8px 10px;
}

.notice.bad {
  border-color: rgba(201, 67, 56, .35);
  color: var(--red);
  background: #fff5f3;
}

.notice.warn,
.whale-model-warning {
  border-color: rgba(179, 107, 18, .35);
  border-left: 4px solid #b36b12;
  background: #fff8eb;
}

.whale-model-warning strong {
  color: #8a4c00;
}

.command-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.danger-action {
  color: var(--red);
  border-color: rgba(189, 59, 47, 0.32);
}

.danger-action:hover {
  background: #fff1ef;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--panel);
}

.pill.good {
  color: var(--green);
  border-color: rgba(22, 138, 99, .35);
}

.pill.bad {
  color: var(--red);
  border-color: rgba(201, 67, 56, .35);
}

.view {
  display: grid;
  gap: 16px;
}

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

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

.metric {
  padding: 14px;
  min-height: 92px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 24px;
  letter-spacing: 0;
}

.panel {
  padding: 16px;
}

.whale-purpose {
  background: #f8f7f2;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  padding: 20px;
}

.whale-purpose .eyebrow {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.whale-purpose h2 {
  font-size: 26px;
  margin-bottom: 8px;
  max-width: 820px;
}

.whale-purpose p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 880px;
}

.whale-purpose.compact {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  padding: 16px;
}

.whale-purpose.compact h2 {
  font-size: 22px;
}

.whale-purpose.compact p {
  margin-bottom: 0;
}

.whale-purpose-actions {
  align-content: center;
  display: grid;
  gap: 8px;
}

.whale-purpose-actions div {
  border-left: 3px solid var(--ink);
  padding: 8px 0 8px 12px;
}

.whale-purpose-actions strong,
.whale-purpose-actions span {
  display: block;
}

.whale-purpose-actions span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.whale-purpose-actions.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.whale-purpose-actions.compact div {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 7px;
  padding: 9px 10px;
}

.whale-purpose-actions.compact strong {
  font-size: 20px;
}

.whale-workbench {
  display: grid;
  gap: 14px;
}

.whale-filter-panel {
  display: grid;
  gap: 12px;
}

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

.whale-filter-head h2 {
  margin: 0 0 4px;
}

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

.whale-age-tabs button {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.whale-age-tabs button.active {
  background: #101820;
  border-color: #101820;
  color: white;
}

.whale-age-tabs strong,
.whale-age-tabs span,
.whale-age-tabs em {
  display: block;
}

.whale-age-tabs strong {
  font-size: 22px;
}

.whale-age-tabs span {
  font-weight: 900;
}

.whale-age-tabs em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  margin-top: 3px;
}

.whale-age-tabs button.active em {
  color: #d9ded6;
}

.whale-filter-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(130px, .75fr)) auto;
  align-items: end;
}

.whale-filter-grid label,
.whale-filter-grid span {
  display: block;
}

.whale-filter-grid label > span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.whale-filter-grid input,
.whale-filter-grid select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.whale-filter-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

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

.whale-workbench-meta {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 160px;
  padding: 10px 12px;
  text-align: right;
}

.whale-workbench-meta strong,
.whale-workbench-meta span {
  display: block;
}

.whale-workbench-meta strong {
  font-size: 24px;
}

.whale-workbench-meta span {
  color: var(--muted);
  font-size: 12px;
}

.whale-lane-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.whale-lane-tab {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.whale-lane-tab.active {
  background: #101820;
  border-color: #101820;
  color: white;
}

.whale-lane-tab strong,
.whale-lane-tab span,
.whale-lane-tab em {
  display: block;
}

.whale-lane-tab strong {
  font-size: 22px;
}

.whale-lane-tab span {
  font-weight: 900;
  margin-top: 2px;
}

.whale-lane-tab em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  margin-top: 3px;
}

.whale-lane-tab.active em {
  color: #d9ded6;
}

.whale-active-lane {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 11px 12px;
}

.whale-active-lane h3,
.whale-active-lane p {
  margin: 0;
}

.whale-active-lane p {
  color: var(--muted);
  margin-top: 3px;
}

.whale-table-scroll {
  max-height: none;
}

.whale-table th {
  white-space: nowrap;
}

.whale-table td {
  min-width: 130px;
}

.whale-table td:nth-child(1) {
  min-width: 190px;
}

.whale-table td:nth-child(4) {
  min-width: 280px;
}

.whale-context-pill.inline,
.whale-action-pill.inline {
  display: inline-flex;
  margin: 0 4px 6px 0;
}

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

.whale-prob-mini span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 6px;
  white-space: nowrap;
}

.whale-prob-mini b {
  color: var(--ink);
  margin-right: 4px;
}

.whale-prob-mini span.achieved {
  background: #f4fbf5;
  border-color: #a8d7b0;
  color: #14743a;
}

.whale-row-detail {
  margin-top: 6px;
}

.whale-row-detail summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.whale-row-detail ul {
  margin: 6px 0 0 18px;
}

.whale-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.player-name-with-star {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  min-width: 0;
}

.watch-star-button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: #9a8b72;
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 24px;
}

.watch-star-button:hover,
.watch-star-button.is-starred {
  color: #d69b16;
}

.watch-star-button.is-saving {
  opacity: .62;
}

.watch-star-button:disabled {
  cursor: default;
}

.whale-reference-row {
  margin-top: 0;
}

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

.whale-scout-card {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-left: 5px solid #b99045;
  border-radius: 8px;
  padding: 14px;
}

.whale-scout-card.heavy {
  border-left-color: #b36b12;
  background: #fff8eb;
}

.whale-scout-card.critical {
  border-left-color: #b72b2b;
  background: #fff3f1;
}

.whale-scout-head {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.whale-scout-head h3 {
  margin: 0 0 3px;
}

.whale-action-pill {
  background: #efe9dd;
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.whale-action-pill.heavy {
  background: #ffe3b8;
}

.whale-action-pill.critical {
  background: #ffd7d3;
}

.whale-action-stack {
  align-items: flex-end;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.whale-context-pill {
  background: #f5f1e8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.whale-scout-card.lane-tier_lag_exception {
  border-left-color: #7b341e;
}

.whale-scout-card.lane-confirmed_hidden_capture {
  border-left-color: #168a63;
}

.whale-scout-card.lane-early_scout,
.whale-scout-card.lane-pending_confirmation {
  border-left-color: #2b6cb0;
}

.whale-scout-card.lane-stale_research,
.whale-scout-card.lane-research_all {
  background: #fbfaf6;
  border-left-color: #8b8375;
}

.whale-scout-card.lane-managed_vip_upside {
  background: #fafafa;
  border-left-color: #4b5563;
}

.whale-scout-card.lane-research_all {
  background: #fbfbf8;
  border-left-color: #9ca3af;
}

.whale-lane-details {
  display: block;
}

.whale-lane-details > summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  list-style-position: inside;
}

.whale-lane-details > .row-sub {
  margin-top: 8px;
}

.whale-scout-grid,
.whale-prob-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.whale-scout-grid > div,
.whale-prob-strip > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.whale-scout-grid span,
.whale-prob-strip span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.whale-scout-grid strong,
.whale-prob-strip strong {
  display: block;
  font-size: 18px;
}

.whale-prob-strip > div.achieved {
  background: #f4fbf5;
  border-color: #a8d7b0;
}

.whale-prob-strip > div.achieved strong {
  color: #14743a;
}

.whale-prob-strip em {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-style: normal;
  margin-top: 2px;
}

.whale-prob-strip {
  margin: 10px 0;
}

.whale-reason {
  margin: 10px 0;
}

.whale-reason ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.whale-reason li {
  margin: 3px 0;
}

.whale-evidence-note {
  background: #f8f6ef;
  border: 1px solid var(--line);
  border-left: 3px solid #7e8a57;
  border-radius: 6px;
  color: var(--muted);
  display: grid;
  gap: 2px;
  margin: 8px 0;
  padding: 8px 10px;
}

.whale-evidence-note strong {
  color: var(--ink);
  font-size: 12px;
}

.whale-evidence-note span {
  font-size: 12px;
}

.whale-evidence-note.early {
  background: #fff8eb;
  border-left-color: #b36b12;
}

.whale-evidence-note.matured {
  background: #f4fbf5;
  border-left-color: #168a63;
}

.mini-panel {
  margin-bottom: 14px;
  padding: 12px 14px;
}

.source-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.source-strip strong {
  color: var(--ink);
}

.command-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.command-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.command-hero .eyebrow {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.command-hero h2 {
  font-size: 24px;
  margin-bottom: 4px;
}

.command-hero p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 920px;
}

.command-range-tabs {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  flex: 0 0 auto;
  max-width: 560px;
}

.command-range-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 800;
}

.command-range-tabs button:last-child {
  border-right: 0;
}

.command-range-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.command-snapshot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.command-analyst-panel {
  display: grid;
  gap: 12px;
}

.analyst-headline {
  border-left: 4px solid var(--ink);
  background: var(--panel-2);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  padding: 12px 14px;
}

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

.analyst-grid h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.analyst-diagnosis-list,
.analyst-action-list {
  display: grid;
  gap: 8px;
}

.analyst-diagnosis-list article,
.analyst-action-list article,
.analyst-watchouts {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.analyst-action-list article.high {
  border-left: 4px solid var(--red);
}

.analyst-action-list article.medium {
  border-left: 4px solid #c38915;
}

.analyst-action-list article.low {
  border-left: 4px solid var(--green);
}

.analyst-diagnosis-list strong,
.analyst-diagnosis-list span,
.analyst-action-list strong,
.analyst-action-list span,
.analyst-action-list em,
.analyst-watchouts strong,
.analyst-watchouts span {
  display: block;
}

.analyst-diagnosis-list span,
.analyst-action-list span,
.analyst-action-list em,
.analyst-watchouts span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.analyst-action-list em {
  font-style: normal;
}

.analyst-watchouts {
  display: grid;
  gap: 6px;
}

.command-metric strong {
  white-space: nowrap;
}

.command-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.command-insight-list {
  display: grid;
  gap: 8px;
}

.command-insight {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-2);
}

.command-insight.whale_driver,
.command-insight.operator_loss {
  border-left-color: var(--red);
}

.command-insight.deposit_spike,
.command-insight.multiple_big_deposits,
.command-insight.operator_win {
  border-left-color: var(--green);
}

.command-insight strong,
.command-insight span,
.command-insight em {
  display: block;
}

.command-insight span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.command-insight em {
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  margin-top: 6px;
}

.command-lower-tier-panel {
  display: grid;
  gap: 12px;
}

.lower-tier-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lower-tier-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
}

.lower-tier-summary strong,
.lower-tier-summary span,
.lower-tier-summary em {
  display: block;
}

.lower-tier-summary span,
.lower-tier-summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
  margin-top: 3px;
}

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

.lower-tier-pocket {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.lower-tier-pocket h3 {
  font-size: 15px;
  margin: 0;
}

.lower-tier-action {
  border-left: 3px solid var(--ink);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  margin: 8px 0;
  padding-left: 10px;
}

.compact-command-table {
  margin-top: 12px;
}

.command-split-list,
.command-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.command-split-list h3,
.command-action-grid h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.command-mini-list {
  display: grid;
  gap: 8px;
}

.command-mini-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
}

.command-mini-list strong,
.command-mini-list span,
.command-mini-list em {
  display: block;
}

.command-mini-list span,
.command-mini-list em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 3px;
}

.command-mini-list em {
  font-style: normal;
}

.segment-list {
  display: grid;
  gap: 8px;
}

.segment-card {
  padding: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.segment-card:hover {
  border-color: var(--line-strong);
}

.segment-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.segment-card .meta,
.row-sub,
.small {
  color: var(--muted);
  font-size: 12px;
}

.segment-card .numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.segment-card .numbers b {
  display: block;
  color: var(--text);
}

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

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.bonus-tier-matrix {
  min-width: 980px;
}

.bonus-tier-matrix th:not(:first-child),
.bonus-tier-matrix td:not(:first-child) {
  text-align: right;
}

.bonus-tier-matrix td {
  white-space: nowrap;
}

.bonus-tier-matrix .muted-cell {
  color: var(--muted);
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 11px 8px;
  border-bottom: 1px solid #ece9df;
  vertical-align: top;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--panel-2);
}

.score {
  font-weight: 800;
}

.score.hot {
  color: var(--red);
}

.score.warm {
  color: var(--amber);
}

.score.cool {
  color: var(--green);
}

.owner {
  display: inline-flex;
  border-radius: 999px;
  background: #ece9df;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.owner.good {
  background: #e7f6ef;
  color: var(--green);
}

.owner.bad {
  background: #fff1f2;
  color: var(--red);
}

.panel-intro {
  margin: -4px 0 10px;
}

.player-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: inline;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.player-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.ledger-confirmed {
  border-color: rgba(22, 138, 99, .35);
}

.ledger-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(170px, .75fr) minmax(170px, .75fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
}

.ledger-filter-row label,
.ledger-filter-row span {
  display: block;
}

.ledger-filter-row span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.ledger-filter-row input,
.ledger-filter-row select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.ledger-metric-grid {
  margin-bottom: 14px;
}

.ledger-exceptions {
  border-color: rgba(198, 78, 60, .25);
}

.ledger-exception-list {
  display: grid;
  gap: 8px;
}

.ledger-exception {
  align-items: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.ledger-exception.failed {
  border-left-color: var(--red);
}

.ledger-exception.pending {
  border-left-color: var(--amber);
}

.ledger-exception.cancelled {
  border-left-color: var(--muted);
}

.ledger-exception span,
.ledger-exception em {
  display: block;
  font-style: normal;
}

.ledger-exception span {
  margin-top: 3px;
}

.ledger-exception em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}

.ledger-status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.ledger-status-chip.failed {
  border-color: rgba(198, 78, 60, .32);
  color: var(--red);
}

.ledger-status-chip.pending {
  border-color: rgba(167, 116, 43, .35);
  color: var(--amber);
}

.confirmed-send-table td {
  vertical-align: top;
}

.inspector {
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  height: 100vh;
  max-width: 440px;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  box-shadow: none;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 160ms ease;
  width: min(440px, 92vw);
  z-index: 40;
}

.inspector.open {
  box-shadow: -18px 0 45px rgba(31, 41, 51, 0.12);
  pointer-events: auto;
  transform: translateX(0);
}

.inspector-body {
  padding: 20px;
}

.inspector-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.inspector-head-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector-close {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  padding: 0 10px;
}

.inspector-close:hover {
  background: rgba(32, 33, 36, 0.06);
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.kv div,
.mini-bar {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.kv span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.kv strong {
  font-size: 14px;
}

.bo-snapshot {
  display: grid;
  gap: 10px;
}

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

.bo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bo-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
}

.bo-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.bo-cell strong {
  display: block;
  font-size: 13px;
}

.player-notes-panel {
  display: grid;
  gap: 8px;
}

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

.audit-item.compact {
  padding: 8px 10px;
}

.player-now {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 12px;
}

.player-now.needs-review {
  border-left-color: var(--red);
  background: #fff7f7;
}

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

.player-action-brief {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

.player-action-brief.tone-active {
  border-left-color: var(--green);
}

.player-action-brief.tone-danger {
  border-left-color: var(--red);
  background: #fff7f7;
}

.player-action-brief strong {
  display: block;
  font-size: 15px;
  margin: 2px 0 4px;
}

.player-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.player-quick-actions > * {
  flex: 0 0 auto;
}

.player-360-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.player-360-section {
  display: grid;
  gap: 8px;
}

.player-360-section h3 {
  margin: 0;
}

.compact-kv {
  margin-bottom: 0;
}

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

.journey-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

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

.journey-card-head strong {
  display: block;
  font-size: 15px;
}

.journey-flow {
  display: grid;
  gap: 8px;
}

.followup-filter-panel {
  margin-bottom: 12px;
}

.contact-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.contact-times div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
}

.contact-times span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.contact-times strong {
  display: block;
  font-size: 13px;
}

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

.form input,
.form select,
.form textarea,
.toolbar input,
.toolbar select,
.bonus-message-search input,
.bonus-message-batch-panel input,
.bonus-message-batch-panel select,
.bonus-message-batch-panel textarea,
.message-channel input,
.message-channel textarea,
#bonus-message-note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

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

.login-panel {
  max-width: 520px;
  margin: 8vh auto 0;
  display: grid;
  gap: 14px;
}

.login-form {
  gap: 12px;
}

.user-rules {
  border-left: 4px solid var(--ink);
}

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

.rule-grid div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
}

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

.rule-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 5px;
}

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

.user-form-grid.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.user-form-grid input,
.user-form-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  overflow: hidden;
}

.user-card-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  list-style: none;
  padding: 13px 14px;
}

.user-card-summary::-webkit-details-marker {
  display: none;
}

.user-card[open] .user-card-summary {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.user-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-expand-label {
  min-width: 56px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.user-card[open] .user-expand-label {
  color: var(--ink);
}

.user-card[open] .user-expand-label::before {
  content: 'Close';
}

.user-card[open] .user-expand-label {
  font-size: 0;
}

.user-card[open] .user-expand-label::before {
  font-size: 12px;
}

.user-card-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.permission-editor {
  display: grid;
  gap: 10px;
}

.permission-editor.disabled {
  opacity: .65;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px;
}

.permission-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

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

.permission-grid .check-row,
.active-toggle {
  justify-content: flex-start;
}

.permission-grid .check-row input,
.active-toggle input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: 0 0 16px;
}

.active-toggle {
  align-self: center;
  min-height: 38px;
}

.bonus-message-search {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px;
  gap: 12px;
  align-items: end;
}

.bonus-message-batch-panel {
  display: grid;
  gap: 12px;
}

.batch-message-meta {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.batch-promo-list textarea {
  min-height: 106px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.batch-ai-writer {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 190px;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 10px;
}

.batch-ai-writer .row-sub {
  grid-column: 1 / -1;
}

.batch-token-strip {
  align-items: flex-start;
}

.batch-editor-grid {
  margin: 0;
}

.batch-message-channel {
  display: grid;
  gap: 12px;
  background: #fff;
}

.batch-message-actions {
  justify-content: flex-start;
}

.batch-result-block {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.batch-message-table td {
  vertical-align: top;
}

.batch-issue-list {
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.batch-row-preview {
  margin-top: 8px;
}

.batch-row-preview summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.batch-row-preview .message-preview-box {
  margin-top: 6px;
  max-width: 520px;
}

.program-message-duplicator {
  display: grid;
  gap: 12px;
}

.duplicator-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.mini-card,
.checkbox-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 10px;
}

.mini-card {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.mini-card span,
.checkbox-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.source-card {
  border-left: 3px solid var(--ink);
}

.duplicator-target-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.checkbox-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.checkbox-card span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.duplicator-result-block,
.duplicator-target-results {
  display: grid;
  gap: 10px;
}

.duplicator-action-log,
.duplicator-output-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 10px;
}

.duplicator-action-log {
  display: grid;
  gap: 7px;
}

.duplicator-action-log span,
.duplicator-output-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.duplicator-output-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
}

.duplicator-output-summary .bad-text span,
.duplicator-output-summary .warn-text span,
.duplicator-output-summary .good-text span {
  color: inherit;
}

.duplicator-target-card {
  background: #fff;
}

.promo-library-hero {
  display: grid;
  gap: 12px;
}

.promo-library-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.promo-library-map div,
.promo-group-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 12px;
}

.promo-library-map strong,
.promo-library-map span {
  display: block;
}

.promo-library-map span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 5px;
}

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

.promo-library-form-panel {
  display: grid;
  gap: 12px;
}

.promo-library-readiness {
  display: grid;
  gap: 12px;
}

.promo-readiness-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 12px;
}

.readiness-check-list,
.readiness-step-list,
.promo-readiness-samples {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.readiness-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.readiness-check.blocked {
  border-left: 4px solid var(--red);
}

.readiness-check.review {
  border-left: 4px solid var(--amber);
}

.readiness-check.ready {
  border-left: 4px solid var(--green);
}

.readiness-check strong,
.promo-readiness-samples strong {
  display: block;
}

.readiness-step-list {
  margin-bottom: 0;
  padding-left: 20px;
}

.readiness-step-list li {
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.promo-readiness-samples {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.promo-readiness-samples div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf6;
  padding: 8px 10px;
}

.promo-readiness-samples span,
.promo-readiness-samples em {
  font-size: 12px;
  line-height: 1.35;
}

.promo-readiness-samples em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.segment-handoff-cell {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.segment-handoff-actions {
  gap: 5px;
  margin: 0;
}

.segment-handoff-actions .compact-action {
  min-height: 28px;
  padding: 3px 7px;
}

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

.role-policy-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.role-policy-card strong,
.role-policy-card span,
.role-policy-card em {
  display: block;
  line-height: 1.35;
}

.role-policy-card span,
.role-policy-card em {
  color: var(--muted);
  font-size: 12px;
}

.role-policy-card em {
  font-style: normal;
}

.knowledge-hero {
  display: grid;
  gap: 12px;
}

.doc-meta {
  margin: 10px 0;
}

.player-whale-evidence {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.player-whale-evidence div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
}

.player-whale-evidence span,
.player-whale-evidence em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.player-whale-audit {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 8px;
}

.player-whale-audit summary {
  cursor: pointer;
  font-weight: 800;
}

.promo-library-form input,
.promo-library-form select,
.promo-library-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.promo-library-textarea {
  grid-column: span 1;
}

.promo-library-textarea.wide {
  grid-column: 1 / -1;
}

.promo-library-textarea textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.promo-program-list,
.promo-group-list {
  display: grid;
  gap: 12px;
}

.promo-program-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.promo-program-card summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 13px 14px;
  background: #fbfaf6;
  border-bottom: 1px solid var(--line);
}

.promo-program-card summary::-webkit-details-marker {
  display: none;
}

.promo-program-card summary span:not(.pill) {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.program-health {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 8px;
  max-width: 860px;
  padding: 7px 9px;
}

.program-health strong,
.program-health span,
.program-health em {
  display: block;
  line-height: 1.35;
}

.program-health strong {
  color: inherit;
  font-size: 12px;
}

.program-health span,
.program-health em {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.program-health.bad-text {
  border-left: 4px solid var(--red);
}

.program-health.warn-text {
  border-left: 4px solid var(--amber);
}

.program-health.good-text {
  border-left: 4px solid var(--green);
}

.promo-group-list {
  padding: 12px;
}

.promo-group-card h3 {
  margin: 0;
}

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

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

.promo-code-columns .wide {
  grid-column: 1 / -1;
}

.promo-code-columns strong {
  display: block;
  margin-bottom: 6px;
}

.promo-chip.static {
  cursor: default;
}

.promo-chip.static:hover {
  border-color: var(--line);
  background: #fff;
}

.bonus-message-search label,
.message-channel label,
.panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.message-channel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.message-field {
  display: grid;
  gap: 6px;
}

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

.message-channel textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.45;
}

.popup-media-uploader {
  display: grid;
  gap: 10px;
}

.popup-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.file-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111827;
  color: #fff !important;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 800 !important;
  padding: 0 12px;
}

.file-button input {
  display: none;
}

.popup-media-preview {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf6;
  padding: 8px;
}

.popup-media-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.rich-editor {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
  padding: 6px;
}

.rich-toolbar button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px;
}

.rich-toolbar button:hover {
  background: #f3f0e7;
}

.rich-editor-surface {
  min-height: 170px;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  color: var(--text);
  line-height: 1.45;
  outline: none;
}

.rich-editor-surface:focus {
  box-shadow: inset 0 0 0 2px rgba(43, 108, 176, .16);
}

.rich-editor-surface p {
  margin: 0 0 8px;
}

.rich-editor-surface table {
  border-collapse: collapse;
  width: 100%;
}

.rich-editor-surface td,
.rich-editor-surface th {
  border: 1px solid var(--line);
  padding: 6px;
  white-space: normal;
}

.rich-source-details {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 8px;
}

.rich-source-details summary {
  color: var(--muted);
  font-size: 12px;
}

.rich-source-details textarea {
  margin-top: 8px;
  min-height: 120px;
}

.message-ai-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.message-locale-panel {
  margin-top: 14px;
}

.locale-tabs {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.batch-locale-panel {
  margin: 10px 0;
}

.batch-locale-tabs {
  margin-top: 8px;
}

.batch-locale-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.batch-locale-help strong {
  color: var(--text);
}

.batch-locale-copy-row {
  justify-content: flex-start;
  margin-top: 10px;
}

.locale-preview-block {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
}

.promo-library-qa-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  padding: 8px 10px;
}

.promo-library-qa-details summary {
  cursor: pointer;
  font-weight: 800;
}

.promo-library-qa-details .table-scroll {
  margin-top: 8px;
}

.promo-library-deep-qa {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.promo-library-deep-qa.empty {
  color: var(--muted);
  background: #fbfaf6;
}

.promo-library-deep-qa .table-scroll {
  margin-top: 10px;
}

.promo-library-deep-qa td div + div {
  margin-top: 4px;
}

.variable-strip,
.message-vars,
.message-help-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.message-help-grid span,
.message-vars span,
.variable-strip span {
  color: var(--muted);
  font-size: 12px;
}

.message-vars {
  border: 1px solid var(--line);
  background: #fbfaf6;
  border-radius: 7px;
  padding: 8px;
}

.message-vars button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.char-counter {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
}

.char-counter.good {
  color: var(--green);
}

.char-counter.warn {
  color: #946200;
}

.char-counter.bad {
  color: var(--red);
}

.message-preview-box {
  border: 1px solid var(--line);
  background: #f8f7f2;
  border-radius: 7px;
  padding: 10px;
}

.message-preview-box pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.compact-head {
  margin-bottom: 8px;
}

.qtp-save-panel {
  display: grid;
  gap: 12px;
}

.qtp-map-panel {
  display: grid;
  gap: 14px;
}

.qtp-flow-map {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(130px, 1fr) auto minmax(130px, 1fr);
  align-items: stretch;
  gap: 8px;
}

.qtp-flow-step {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf6;
  padding: 10px;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 7px;
}

.qtp-flow-step strong {
  font-size: 13px;
}

.qtp-flow-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.qtp-flow-arrow {
  align-self: center;
  color: var(--muted);
  font-weight: 800;
}

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

.qtp-save-plan,
.qtp-save-result {
  display: grid;
  gap: 10px;
}

.qtp-save-result {
  border: 1px solid rgba(22, 138, 99, .3);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  background: #f6fbf7;
  padding: 10px;
}

.qtp-save-result.bad {
  border-color: rgba(201, 67, 56, .35);
  border-left-color: var(--red);
  background: #fff7f5;
}

.good-pill {
  border-color: rgba(22, 138, 99, .32);
  color: var(--green);
  background: #f2fbf6;
}

.bad-pill {
  border-color: rgba(201, 67, 56, .34);
  color: var(--red);
  background: #fff7f5;
}

@media (max-width: 980px) {
  .batch-message-meta {
    grid-template-columns: 1fr;
  }

  .batch-ai-writer {
    grid-template-columns: 1fr;
  }

  .promo-library-map,
  .promo-library-form,
  .promo-readiness-grid,
  .role-policy-grid,
  .player-whale-evidence,
  .promo-code-columns,
  .tone-profile-grid,
  .tone-rule-sections,
  .locked-template-summary,
  .locked-template-grid,
  .duplicator-layout,
  .duplicator-output-summary,
  .lower-tier-summary,
  .lower-tier-pocket-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .qtp-flow-map {
    grid-template-columns: 1fr;
  }

  .qtp-flow-arrow {
    display: none;
  }

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

.message-locales summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.warning-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid #c4b68e;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fffdf8;
}

.warning-item.hard {
  border-left-color: var(--red);
}

.warning-item.warn {
  border-left-color: #c38915;
}

.warning-item.info {
  border-left-color: var(--blue);
}

.error.compact,
.warning,
.sent-note.compact {
  margin: 8px 0;
}

.primary {
  min-height: 40px;
  background: var(--ink);
  color: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 190px;
  gap: 10px;
  margin-bottom: 12px;
}

.engine-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-action {
  align-items: center;
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  text-decoration: none;
}

.vm-packet-strip {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(22, 138, 99, .28);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 11px;
}

.vm-packet-strip strong,
.vm-packet-strip span {
  display: block;
}

.vm-packet-strip strong {
  font-size: 13px;
  margin-bottom: 2px;
}

.vm-packet-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.vm-packet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.toolbar:has(.engine-actions) {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.status-active_scan {
  background: #f8d7da;
  color: var(--red);
}

.status-heartbeat {
  background: #fff3cd;
  color: #8a5a00;
}

.status-watching {
  background: #d8eef7;
  color: var(--blue);
}

.bad-text {
  color: var(--red);
}

.good-text {
  color: var(--green);
}

.check-row {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.check-row input {
  width: auto;
}

.panel .check-row {
  display: flex;
  flex-direction: row;
}

.engine-health {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 7px;
  background: var(--panel-2);
}

.engine-health.live {
  border-left-color: var(--green);
}

.engine-health.degraded {
  border-left-color: var(--red);
  background: #fff1f2;
}

.engine-health.unknown {
  border-left-color: #8a5a00;
}

.section-head,
.tilt-nugget-head,
.progress-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin-bottom: 4px;
}

.tilt-purpose-banner {
  border: 1px solid #d7c79a;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffaf0;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--ink);
}

.tilt-purpose-banner div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.tilt-purpose-banner strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.tilt-purpose-banner span {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.followup-hero {
  border: 1px solid #b8d6ca;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #f6fcf8;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.followup-hero div:first-child {
  display: grid;
  gap: 4px;
}

.followup-hero strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.followup-hero span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.followup-window-read {
  flex: 0 0 auto;
  border: 1px solid rgba(22, 138, 99, .32);
  color: var(--green);
  background: #fff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.followup-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.followup-controls span {
  color: var(--muted);
  font-size: 12px;
  margin-right: 2px;
}

.followup-controls .ghost {
  padding: 7px 11px;
}

.followup-controls .active-filter {
  border-color: rgba(22, 138, 99, .45);
  color: var(--green);
  background: #f2fbf6;
  font-weight: 700;
}

.compact-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compact-field input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
}

.followup-table td {
  vertical-align: top;
}

.episode-table {
  min-width: 1080px;
}

.tilt-action-now {
  display: grid;
  gap: 14px;
}

.tilt-refresh-control {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.tilt-refresh-control strong,
.tilt-refresh-control span {
  display: block;
}

.tilt-kpi-strip {
  margin-top: 2px;
}

.tilt-action-stats {
  display: grid;
  gap: 12px;
}

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

.tilt-action-stat-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
}

.tilt-action-stat-box h3 {
  font-size: 14px;
  margin: 0 0 8px;
}

.tilt-action-stat-box div {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}

.tilt-action-stat-box div:first-of-type {
  border-top: 0;
}

.tilt-action-stat-box span {
  color: var(--muted);
  font-size: 12px;
}

.tilt-action-stat-box strong {
  color: var(--ink);
}

@media (max-width: 900px) {
  .tilt-action-stat-grid {
    grid-template-columns: 1fr;
  }

  .tilt-refresh-control {
    align-items: stretch;
    flex-direction: column;
  }
}

.telegram-gate-panel {
  display: grid;
  gap: 12px;
}

.telegram-gate-control {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.telegram-gate-control.notification-toggle-grid {
  align-items: center;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.telegram-gate-control.notification-toggle-grid label {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 34px;
  white-space: nowrap;
}

.telegram-gate-control label,
.telegram-gate-control span {
  display: block;
}

.telegram-gate-control span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.telegram-gate-control input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.telegram-gate-control input[type="checkbox"] {
  min-height: auto;
  width: auto;
}

.quick-score-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-score-buttons .active {
  background: var(--ink);
  color: #fff;
}

.tilt-nugget-list {
  display: grid;
  gap: 10px;
}

.tilt-nugget {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
  cursor: pointer;
}

.tilt-nugget.critical {
  border-left-color: var(--red);
  background: #fff7f7;
}

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

.tilt-nugget-stats span {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tilt-score-breakdown {
  font-weight: 700;
  color: var(--ink);
}

.tilt-empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.tilt-more {
  text-align: right;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 9px 10px;
}

.health-item.good {
  border-left-color: var(--green);
}

.health-item.warn {
  border-left-color: var(--amber);
}

.health-item.bad {
  border-left-color: var(--red);
  background: #fff1f2;
}

.health-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.health-item strong {
  display: block;
}

.funnel-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.funnel-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "detail value";
  gap: 2px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 12px;
}

.funnel-step.hot {
  border-color: rgba(201, 67, 56, .4);
  background: #fff7f7;
}

.funnel-step span {
  grid-area: label;
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 0;
}

.funnel-step strong {
  grid-area: value;
  display: block;
  font-size: 24px;
}

.funnel-step .row-sub {
  grid-area: detail;
}

.funnel-arrow {
  display: none;
}

.tracka-progress {
  display: grid;
  gap: 12px;
}

.progress-label strong {
  font-size: 15px;
}

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

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

.progress-track div {
  height: 100%;
  min-width: 2px;
  background: var(--green);
}

.inline-details,
.tilt-debug {
  box-shadow: none;
}

.inline-details {
  margin-top: 2px;
  background: var(--panel-2);
}

.tilt-debug > summary {
  margin: -2px 0 12px;
}

.tilt-debug-toolbar,
.raw-queue-panel {
  margin-top: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.audit-list {
  display: grid;
  gap: 8px;
}

.qtp-assigner {
  display: grid;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.qtp-assignment-form {
  margin-top: 0;
}

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

.qtp-result {
  display: grid;
  gap: 10px;
}

.qtp-result-table td {
  vertical-align: top;
}

.campaign-designer {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.campaign-form {
  margin-top: 0;
}

.campaign-form textarea {
  min-height: 96px;
}

.campaign-preview {
  display: grid;
  gap: 12px;
}

.campaign-preview-result {
  display: grid;
  gap: 10px;
}

.promo-chip-list {
  min-height: 34px;
}

.promo-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.promo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

.promo-chip strong {
  color: var(--red);
  font-size: 11px;
}

.promo-chip:hover {
  border-color: rgba(201, 67, 56, .45);
}

.promo-registry-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 160px 110px;
  gap: 10px;
  margin: 12px 0 8px;
}

.promo-registry-filters input,
.promo-registry-filters select,
.promo-registry-table select,
.promo-registry-table input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 34px;
  background: #fff;
  color: var(--text);
  padding: 6px 8px;
}

.promo-registry-table {
  min-width: 1120px;
}

.promo-registry-table tbody tr {
  cursor: default;
}

.promo-currency-mini {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.promo-currency-mini div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.promo-currency-mini strong {
  color: var(--ink);
  min-width: 32px;
}

.promo-currency-mini em {
  color: var(--warn);
  font-style: normal;
}

.tone-profile-panel {
  border-left: 4px solid var(--accent);
}

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

.tone-profile-editor-details,
.tone-profile-organized,
.locked-template-details,
.copy-safety-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  margin-top: 12px;
}

.tone-profile-editor-details summary,
.tone-profile-organized summary,
.locked-template-details summary,
.copy-safety-details summary {
  cursor: pointer;
  font-weight: 800;
  padding: 11px 12px;
}

.tone-profile-editor-details[open] summary,
.tone-profile-organized[open] summary,
.locked-template-details[open] summary,
.copy-safety-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.tone-profile-editor-details .tone-profile-grid,
.tone-profile-editor-details .button-row {
  padding: 12px;
}

.tone-profile-editor-details .button-row {
  padding-top: 0;
}

.tone-profile-grid .wide {
  grid-column: 1 / -1;
}

.tone-profile-grid input,
.tone-profile-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

.tone-profile-grid textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}

.tone-source-note {
  border: 1px solid rgba(22, 138, 99, .25);
  border-left: 3px solid var(--green);
  border-radius: 7px;
  background: #f4fbf7;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 10px;
  padding: 9px 10px;
}

.tone-rule-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.tone-rule-sections div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 10px;
}

.tone-rule-sections strong,
.tone-rule-sections span,
.tone-rule-sections em {
  display: block;
}

.tone-rule-sections strong {
  margin-bottom: 6px;
}

.tone-rule-sections span,
.tone-rule-sections em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.locked-template-body {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.copy-safety-body {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.copy-safety-body .mini-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0;
}

.copy-safety-body .mini-panel h3 {
  margin: 0 0 6px;
}

.copy-safety-body .danger-panel {
  border-left: 4px solid var(--red);
}

.copy-safety-body .warn-panel {
  border-left: 4px solid var(--warn);
}

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

.locked-template-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.locked-template-summary strong,
.locked-template-summary span {
  display: block;
}

.locked-template-summary strong {
  margin-bottom: 6px;
}

.locked-template-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.locked-template-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f7f3;
  color: var(--text);
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.registry-tag-grid {
  display: grid;
  gap: 6px;
  min-width: 210px;
}

.inline-check {
  align-items: center;
  display: inline-flex !important;
  gap: 7px !important;
  grid-template-columns: auto 1fr;
  min-height: 30px;
}

.inline-check input {
  width: auto;
}

.registry-actions {
  display: grid;
  gap: 6px;
  min-width: 128px;
}

.good-text {
  color: var(--green);
  font-weight: 800;
}

.warn-text {
  color: #946200;
  font-weight: 800;
}

.outreach-list {
  display: grid;
  gap: 10px;
}

.outreach-item {
  display: grid;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.outreach-item.status-promo_pulled_off {
  border-color: rgba(201, 67, 56, .55);
  background: #fff7f5;
}

.outreach-item.status-fc_approval_required {
  border-color: rgba(176, 119, 0, .55);
  background: #fffaf0;
}

.outreach-item.status-manual_review_no_promo {
  border-color: rgba(96, 86, 68, .28);
  background: #fffdf7;
}

.outreach-item.status-promo_sent_this_session {
  border-color: rgba(22, 138, 99, .45);
  background: #f4fbf7;
}

.watchlist-form-grid,
.watch-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.watchlist-form-grid label {
  display: grid;
  gap: 5px;
}

.watchlist-form-grid input,
.watchlist-form-grid select,
#watch-reason {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
}

#watch-reason {
  min-height: 70px;
  resize: vertical;
}

.watch-alert-list {
  display: grid;
  gap: 10px;
}

.watch-alert {
  display: grid;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.watch-alert.critical {
  border-color: rgba(201, 67, 56, .55);
  background: #fff5f3;
}

.watch-alert.needs-review {
  border-color: rgba(183, 121, 31, .45);
  background: #fffaf0;
}

.watch-alert.warn {
  border-color: rgba(43, 108, 176, .32);
  background: #f6f9fe;
}

.watch-alert h3 {
  margin: 0;
}

.watch-alert-evidence {
  font-weight: 800;
}

.watch-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.watch-action-grid .mini-bar {
  display: grid;
  gap: 8px;
}

.review-only-box {
  display: grid;
  gap: 8px;
  border-left: 3px solid var(--ink-soft);
  background: #fff;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.review-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--panel-2);
}

.pull-off-note {
  border-left: 3px solid var(--red);
  background: #fff;
  padding: 8px 10px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
}

.sent-note {
  border-left: 3px solid var(--green);
  background: #fff;
  padding: 8px 10px;
  color: var(--green);
  font-size: 12px;
  line-height: 1.45;
}

.sent-note.compact {
  margin-top: 4px;
  padding: 4px 6px;
  border-left-width: 2px;
}

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

.outreach-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.outreach-stats div,
.outreach-offers > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  min-width: 0;
}

.outreach-stats span,
.outreach-offers span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.outreach-stats strong,
.outreach-offers strong {
  font-size: 13px;
}

.tilt-decision-data {
  padding: 8px 10px;
  background: #fffdf8;
}

.tilt-decision-data summary {
  font-size: 12px;
}

.decision-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.decision-data-tile {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  min-width: 0;
}

.decision-data-tile span,
.decision-data-tile em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.decision-data-tile strong {
  display: block;
  font-size: 13px;
  margin: 4px 0;
}

.decision-data-tile.tone-hot {
  border-left: 3px solid var(--red);
}

.audit-item {
  border-left: 3px solid var(--red);
  background: var(--panel-2);
  padding: 10px 12px;
  border-radius: 0 7px 7px 0;
}

.audit-item strong {
  display: block;
  margin-bottom: 3px;
}

.alert-critical {
  border-left-color: var(--red);
}

.alert-info {
  border-left-color: var(--green);
}

.doc-list {
  display: grid;
  gap: 8px;
}

details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

pre {
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.55;
  color: var(--text);
  margin: 12px 0 0;
}

.doc-content {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  color: var(--text);
  line-height: 1.55;
}

.doc-content h2,
.doc-content h3,
.doc-content h4,
.doc-content h5 {
  margin: 8px 0 0;
}

.doc-content p {
  margin: 0;
}

.doc-content ul {
  margin: 0;
  padding-left: 20px;
}

.doc-content li {
  margin: 4px 0;
}

.doc-content code {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  padding: 1px 5px;
  font-size: 12px;
}

.doc-code {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f4ed;
  padding: 12px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

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

.doc-table th {
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

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

.doc-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.doc-figure img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

.doc-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

@media (max-width: 1200px) {
  body {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .inspector {
    width: min(420px, 94vw);
  }

  .metric-grid,
  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .rule-grid,
  .user-form-grid,
  .user-form-grid.compact,
  .permission-grid {
    grid-template-columns: 1fr 1fr;
  }

  .whale-purpose {
    grid-template-columns: 1fr;
  }

  .whale-purpose.compact,
  .whale-lane-tabs,
  .whale-age-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .command-grid,
  .analyst-grid,
  .command-brief-grid,
  .command-split-list,
  .command-action-grid,
  .ledger-filter-row,
  .whale-filter-grid,
  .watchlist-form-grid,
  .watch-action-grid {
    grid-template-columns: 1fr;
  }

  .command-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 780px) {
  body {
    display: block;
    overflow-x: hidden;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    gap: 10px;
    min-height: auto;
    overflow: hidden;
    padding: 10px 12px 8px;
    position: sticky;
    top: 0;
    z-index: 35;
  }

  .brand {
    align-items: center;
    gap: 8px;
  }

  .brand-mark {
    height: 32px;
    width: 32px;
    font-size: 11px;
  }

  .brand strong {
    font-size: 13px;
  }

  .brand span {
    font-size: 11px;
    margin-top: 0;
  }

  .mobile-tab-select {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    display: block;
    font-weight: 800;
    min-height: 42px;
    padding: 8px 10px;
    width: 100%;
  }

  .nav {
    display: none;
  }

  .version-badge {
    align-items: center;
    grid-template-columns: auto auto minmax(0, 1fr);
    margin-top: 0;
    padding: 7px 9px;
  }

  .version-badge strong {
    font-size: 12px;
  }

  .version-badge small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shell {
    max-width: 100vw;
    overflow-x: hidden;
    padding: 14px 10px 28px;
  }

  .topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 0;
    width: 100%;
  }

  .topbar > div:first-child {
    display: none;
  }

  .topbar h1 {
    font-size: 22px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .topbar-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .scope-inline {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .scope-inline-group {
    grid-template-columns: 1fr;
  }

  .scope-inline span {
    display: none;
  }

  .segmented {
    min-width: 0;
  }

  .scope-inline-group {
    gap: 0;
  }

  .scope-inline .segmented button {
    font-size: 13px;
    padding: 0 6px;
  }

  .segmented button,
  .ghost,
  .primary-action,
  .primary,
  .compact-action {
    min-height: 36px;
  }

  .topbar-actions > .ghost,
  #health-pill,
  #auth-user-pill,
  #logout-btn {
    align-items: center;
    font-size: 12px;
    justify-content: center;
    min-height: 36px;
    padding: 0 8px;
    width: auto;
  }

  .telegram-gate-control.notification-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #auth-user-pill {
    display: none;
  }

  #health-pill {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pill,
  .owner {
    justify-content: center;
    max-width: 100%;
    white-space: normal;
  }

  .metric-grid,
  .two-col,
  .whale-purpose,
  .whale-purpose.compact,
  .whale-purpose-actions.compact,
  .whale-lane-tabs,
  .whale-age-tabs,
  .whale-filter-grid,
  .whale-scout-grid,
  .whale-prob-strip,
  .tilt-nugget-stats,
  .outreach-stats,
  .qtp-economics-grid,
  .contact-times,
  .toolbar,
  .bonus-message-search,
  .promo-registry-filters,
  .message-editor-grid,
  .rule-grid,
  .user-form-grid,
  .user-form-grid.compact,
  .permission-grid,
  .telegram-gate-control {
    grid-template-columns: 1fr;
  }

  .whale-workbench-head,
  .whale-filter-head,
  .whale-active-lane {
    align-items: stretch;
    display: grid;
    text-align: left;
  }

  .whale-workbench-meta {
    text-align: left;
  }

  .ledger-exception {
    grid-template-columns: 1fr;
  }

  .section-head,
  .tilt-nugget-head,
  .progress-label {
    display: grid;
  }

  .outreach-head,
  .outreach-offers,
  .vm-packet-strip,
  .player-now-head {
    grid-template-columns: 1fr;
  }

  .vm-packet-actions {
    justify-content: flex-start;
  }

  .panel {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 12px;
  }

  details,
  .view,
  .page,
  .page-section,
  .copy-safety-body,
  .locked-template-body,
  .tone-profile-organized,
  .tone-profile-editor-details,
  .locked-template-details,
  .copy-safety-details {
    max-width: 100%;
    min-width: 0;
  }

  .copy-safety-body,
  .locked-template-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .copy-safety-body > *,
  .locked-template-body > * {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .panel > table,
  details > table,
  .copy-safety-body table,
  .locked-template-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .copy-safety-body .two-col,
  .locked-template-summary,
  .locked-template-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .copy-safety-body .two-col > *,
  .copy-safety-body .mini-panel,
  .locked-template-summary > *,
  .locked-template-grid > * {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .metric {
    min-height: auto;
    padding: 12px;
  }

  .metric strong {
    font-size: 21px;
    line-height: 1.15;
  }

  .notice,
  .audit-item,
  .audit-item strong,
  .audit-item .small,
  .sent-note,
  .sent-note.compact,
  .mini-bar,
  .row-sub,
  td,
  th {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .audit-item,
  .sent-note {
    box-sizing: border-box;
    width: 100%;
  }

  .table-scroll {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-left: -2px;
    margin-right: -2px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll table {
    min-width: 720px;
  }

  .whale-table,
  .episode-table,
  .bonus-tier-matrix,
  .batch-message-table,
  .compact-command-table,
  .followup-table {
    min-width: 900px;
  }

  .bonus-tier-matrix {
    table-layout: fixed;
  }

  .whale-age-tabs,
  .whale-lane-tabs,
  .command-range-tabs,
  .followup-controls,
  .engine-actions,
  .chip-row,
  .button-row,
  .vm-packet-actions,
  .whale-row-actions,
  .rich-toolbar {
    display: flex;
    gap: 8px;
    margin-left: -2px;
    margin-right: -2px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .whale-age-tabs::-webkit-scrollbar,
  .whale-lane-tabs::-webkit-scrollbar,
  .command-range-tabs::-webkit-scrollbar,
  .followup-controls::-webkit-scrollbar,
  .engine-actions::-webkit-scrollbar,
  .chip-row::-webkit-scrollbar,
  .button-row::-webkit-scrollbar,
  .vm-packet-actions::-webkit-scrollbar,
  .whale-row-actions::-webkit-scrollbar,
  .rich-toolbar::-webkit-scrollbar {
    display: none;
  }

  .whale-age-tabs button,
  .whale-lane-tab,
  .command-range-tabs button,
  .followup-controls .ghost,
  .engine-actions .ghost,
  .chip-row .pill,
  .button-row button,
  .vm-packet-actions .ghost,
  .whale-row-actions .ghost,
  .rich-toolbar button {
    flex: 0 0 auto;
  }

  .whale-purpose,
  .command-hero,
  .followup-hero,
  .tilt-purpose-banner,
  .player-now-card,
  .tilt-nugget,
  .whale-scout-card,
  .user-card,
  .promo-family-card,
  .promo-library-program,
  .bonus-message-batch-panel {
    border-radius: 8px;
  }

  .followup-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .followup-window-read {
    text-align: center;
  }

  .tilt-refresh-control,
  .section-head,
  .tilt-nugget-head,
  .progress-label,
  .whale-workbench-head,
  .whale-filter-head,
  .whale-active-lane,
  .user-card-summary,
  .promo-family-head,
  .bonus-message-head {
    gap: 8px;
  }

  .inspector {
    border-left: 0;
    max-width: none;
    width: 100vw;
  }

  .inspector:not(.open) {
    display: none;
  }

  .inspector.open {
    display: block;
  }

  .inspector-body {
    padding: 14px 12px 22px;
  }

  .inspector-head {
    display: grid;
  }

  .inspector-head-actions {
    align-items: stretch;
  }

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

  .rich-editor {
    min-width: 0;
  }

  .rich-editor-surface,
  .rich-source-details textarea,
  .message-channel textarea,
  .bonus-message-batch-panel textarea {
    font-size: 16px;
    overflow-x: auto;
  }

  .rich-editor-surface table {
    min-width: 540px;
  }

  .message-preview-box {
    max-height: 320px;
    overflow: auto;
  }
}

@media (max-width: 480px) {
  .shell {
    padding-left: 8px;
    padding-right: 8px;
  }

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

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

  .telegram-gate-control,
  .telegram-gate-control.notification-toggle-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid.compact,
  .ledger-metric-grid {
    grid-template-columns: 1fr;
  }

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

  .whale-table,
  .episode-table,
  .bonus-tier-matrix,
  .batch-message-table,
  .compact-command-table,
  .followup-table {
    min-width: 860px;
  }

  .bonus-tier-matrix {
    min-width: 680px;
  }

  .warning-item {
    grid-template-columns: 1fr;
  }
}
