:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --band: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #18201b;
  --muted: #657067;
  --line: #dfe4db;
  --green: #16855d;
  --teal: #087c77;
  --blue: #2e67d1;
  --amber: #bd7b13;
  --red: #bf4444;
  --violet: #7357b8;
  --cyan: #0a8aa0;
  --shadow: 0 18px 44px rgba(54, 68, 55, .09);
  --radius: 8px;
  --sidebar: 264px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, 0) 360px),
    var(--bg);
}

button,
select,
input {
  font: inherit;
}

a {
  color: inherit;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, .13);
  background: #18231c;
  color: #f5fbf5;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 6px 7px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #45c484, #d5a340 52%, #61a9d6);
  color: #111a15;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0;
}

.brand small,
.sidebar-note span {
  display: block;
  margin-top: 3px;
  color: #adc0b2;
  font-size: 12px;
  line-height: 1.4;
}

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

.nav-list a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #dce8df;
  text-decoration: none;
  font-size: 13px;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: rgba(255, 255, 255, .09);
  outline: none;
}

.nav-list svg,
.card-head svg,
.brand svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.sidebar-note strong {
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 30px clamp(18px, 3.4vw, 46px) 52px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  gap: 22px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.14;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  max-width: 860px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.kpi-context {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.kpi-context-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.kpi-context span {
  text-align: right;
}

.kpi-context-copy span {
  text-align: left;
}

.period-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.period-control button {
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.period-control button:hover,
.period-control button:focus-visible {
  color: var(--ink);
  outline: none;
}

.period-control button.active {
  background: var(--green);
  color: #fff;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 34px;
}

.kpi-card {
  min-width: 0;
  min-height: 106px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(54, 68, 55, .06);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  margin-top: 7px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1;
  white-space: nowrap;
}

.kpi-card small {
  display: block;
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
  line-height: 1.35;
}

.section {
  scroll-margin-top: 24px;
  margin: 0 -18px 30px;
  padding: 28px 18px 34px;
  border-top: 1px solid rgba(190, 197, 184, .55);
}

.section:nth-of-type(even) {
  background: rgba(255, 255, 255, .44);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 390px) minmax(280px, 1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.section-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.use-case-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.use-case-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 10px;
}

.use-case-head span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.use-case-head strong {
  color: var(--ink);
  font-size: 15px;
}

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

.use-case-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: var(--surface);
}

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

.use-case-item.bad {
  border-left-color: var(--red);
}

.use-case-item span,
.use-case-item strong,
.use-case-item p {
  display: block;
}

.use-case-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.use-case-item strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.use-case-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr);
  gap: 14px;
}

.two-col.wide-left {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
}

.segment-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 14px;
}

.segment-guide div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segment-guide strong,
.segment-guide span {
  display: block;
}

.segment-guide strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
}

.segment-guide span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(360px, 1.35fr) minmax(260px, .83fr);
  gap: 14px;
}

.full-width-card {
  margin-top: 14px;
}

.chart-card,
.note-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chart-card {
  padding: 16px;
}

.note-card {
  padding: 18px;
  color: var(--muted);
  line-height: 1.72;
}

.note-card h3 {
  color: var(--ink);
  margin-bottom: 10px;
}

.note-card a,
.source-item a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.note-card a:hover,
.source-item a:hover {
  text-decoration: underline;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 15px;
}

.card-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.flow-node {
  position: relative;
  min-height: 132px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.flow-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 10px;
  height: 1px;
  background: var(--line);
}

.flow-node:last-child::after {
  display: none;
}

.flow-node .node-index {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #e6efe9;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.flow-node h4 {
  margin: 0;
  font-size: 13px;
}

.flow-node strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1;
}

.flow-node small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.funnel-wrap {
  display: grid;
  gap: 10px;
}

.bar-row,
.waterfall-row,
.budget-row,
.depth-row,
.ladder-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 94px;
  gap: 12px;
  align-items: center;
  min-height: 38px;
}

.bar-label,
.bar-value {
  font-size: 12px;
  color: var(--muted);
}

.bar-value {
  text-align: right;
  color: var(--ink);
  font-weight: 800;
}

.track {
  position: relative;
  height: 22px;
  border-radius: 5px;
  background: #edf1eb;
  overflow: hidden;
}

.fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #7fb069);
}

.metric-context {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.metric-context strong,
.metric-context span {
  display: block;
}

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

.metric-context span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.drop-note {
  margin-left: 116px;
  color: var(--red);
  font-size: 11px;
}

.drop-diagnosis {
  display: grid;
  gap: 10px;
}

.drop-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.drop-card.main-drop {
  border-left: 5px solid var(--red);
}

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

.drop-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.drop-card strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 18px;
}

.drop-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.channel-summary,
.agent-summary,
.payment-summary,
.risk-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 14px;
}

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

.channel-summary-card,
.agent-summary-card,
.target-summary-card,
.payment-summary-card,
.risk-summary-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.channel-summary-card.warn,
.agent-summary-card.warn,
.target-summary-card.warn,
.payment-summary-card.warn,
.risk-summary-card.warn {
  border-left-color: var(--amber);
}

.agent-summary-card.bad,
.target-summary-card.bad,
.payment-summary-card.bad,
.risk-summary-card.bad {
  border-left-color: var(--red);
}

.channel-summary-card span,
.channel-summary-card strong,
.channel-summary-card small,
.agent-summary-card span,
.agent-summary-card strong,
.agent-summary-card small,
.target-summary-card span,
.target-summary-card strong,
.target-summary-card small,
.payment-summary-card span,
.payment-summary-card strong,
.payment-summary-card small,
.risk-summary-card span,
.risk-summary-card strong,
.risk-summary-card small {
  display: block;
}

.channel-summary-card span,
.agent-summary-card span,
.target-summary-card span,
.payment-summary-card span,
.risk-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.channel-summary-card strong,
.agent-summary-card strong,
.target-summary-card strong,
.payment-summary-card strong,
.risk-summary-card strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.15;
}

.channel-summary-card small,
.agent-summary-card small,
.target-summary-card small,
.payment-summary-card small,
.risk-summary-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.channel-budget-list,
.channel-action-list,
.agent-contribution-list,
.agent-action-list,
.agent-risk-grid,
.target-progress-list,
.target-cadence-list,
.payment-channel-list,
.withdrawal-list,
.risk-rule-list,
.risk-source-list {
  display: grid;
  gap: 10px;
}

.channel-row,
.channel-action-card,
.agent-contribution-card,
.agent-action-card,
.agent-risk-card,
.target-progress-card,
.target-cadence-card,
.payment-channel-card,
.withdrawal-card,
.risk-rule-card,
.risk-source-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.channel-row-head,
.agent-card-head,
.target-card-head,
.payment-card-head,
.risk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.channel-row-head strong,
.agent-card-head strong,
.target-card-head strong,
.payment-card-head strong,
.risk-card-head strong {
  font-size: 13px;
}

.agent-card-head span,
.target-card-head span,
.payment-card-head span,
.risk-card-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.channel-row-metrics,
.agent-card-metrics,
.target-card-metrics,
.payment-card-metrics,
.risk-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.channel-row-metrics span,
.agent-card-metrics span,
.target-card-metrics span,
.payment-card-metrics span,
.risk-card-metrics span {
  min-width: 0;
  padding: 6px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.channel-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ea;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.channel-status.warn {
  background: #fff3dc;
  color: var(--amber);
}

.channel-status.bad {
  background: #fde9e8;
  color: var(--red);
}

.agent-card-head .channel-status,
.target-card-head .channel-status,
.payment-card-head .channel-status,
.risk-card-head .channel-status,
.game-card-head .channel-status {
  display: inline-flex;
  margin-top: 0;
  color: var(--green);
}

.agent-card-head .channel-status.warn,
.target-card-head .channel-status.warn,
.payment-card-head .channel-status.warn,
.risk-card-head .channel-status.warn,
.game-card-head .channel-status.warn {
  color: var(--amber);
}

.agent-card-head .channel-status.bad,
.target-card-head .channel-status.bad,
.payment-card-head .channel-status.bad,
.risk-card-head .channel-status.bad,
.game-card-head .channel-status.bad {
  color: var(--red);
}

.channel-action-card {
  border-left: 4px solid var(--green);
}

.agent-contribution-card,
.agent-action-card,
.agent-risk-card,
.target-progress-card,
.target-cadence-card,
.payment-channel-card,
.withdrawal-card,
.risk-rule-card,
.risk-source-card {
  border-left: 4px solid var(--green);
}

.channel-action-card.warn,
.agent-contribution-card.warn,
.agent-action-card.warn,
.agent-risk-card.warn,
.target-progress-card.warn,
.target-cadence-card.warn,
.payment-channel-card.warn,
.withdrawal-card.warn,
.risk-rule-card.warn {
  border-left-color: var(--amber);
}

.channel-action-card.bad,
.agent-contribution-card.bad,
.agent-action-card.bad,
.agent-risk-card.bad,
.target-progress-card.bad,
.target-cadence-card.bad,
.payment-channel-card.bad,
.withdrawal-card.bad,
.risk-rule-card.bad {
  border-left-color: var(--red);
}

.channel-action-card span,
.channel-action-card strong,
.channel-action-card small,
.agent-action-card span,
.agent-action-card strong,
.agent-action-card small,
.agent-risk-card small,
.target-cadence-card span,
.target-cadence-card strong,
.target-cadence-card small,
.payment-channel-card small,
.withdrawal-card small,
.risk-rule-card small,
.risk-source-card small {
  display: block;
}

.channel-action-card span,
.agent-action-card span,
.target-cadence-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.channel-action-card strong,
.agent-action-card strong,
.target-cadence-card strong {
  margin-top: 4px;
  font-size: 14px;
}

.channel-action-card p,
.agent-action-card p,
.agent-risk-card p,
.target-cadence-card p,
.risk-source-card p {
  margin: 8px 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.channel-action-card small,
.agent-action-card small,
.agent-risk-card small,
.target-cadence-card small,
.payment-channel-card small,
.withdrawal-card small,
.risk-rule-card small,
.risk-source-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.table-scroll {
  overflow-x: auto;
}

.channel-table {
  min-width: 960px;
}

.agent-table {
  min-width: 1040px;
}

.target-table,
.payment-table,
.risk-table {
  min-width: 980px;
}

.agent-table th:nth-child(-n+2),
.agent-table td:nth-child(-n+2),
.agent-table th:last-child,
.agent-table td:last-child,
.target-table th:nth-child(-n+2),
.target-table td:nth-child(-n+2),
.target-table th:last-child,
.target-table td:last-child,
.payment-table th:nth-child(-n+2),
.payment-table td:nth-child(-n+2),
.payment-table th:last-child,
.payment-table td:last-child,
.risk-table th:nth-child(-n+2),
.risk-table td:nth-child(-n+2),
.risk-table th:nth-child(5),
.risk-table td:nth-child(5),
.risk-table th:last-child,
.risk-table td:last-child {
  text-align: left;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

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

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.segment-table th:nth-child(2),
.segment-table td:nth-child(2),
.segment-table th:last-child,
.segment-table td:last-child {
  text-align: left;
}

.quality-pill {
  display: inline-flex;
  min-width: 56px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ea;
  color: var(--green);
  font-weight: 800;
}

.quality-pill.warn {
  background: #fff3dc;
  color: var(--amber);
}

.quality-pill.bad {
  background: #fde9e8;
  color: var(--red);
}

.readiness-score {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.score-ring {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #e8ede5 0);
}

.score-ring strong {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: 24px;
}

.score-copy span,
.readiness-row span,
.guardrail-item span,
.action-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.score-copy strong {
  display: block;
  font-size: 15px;
  margin-bottom: 5px;
}

.readiness-list,
.guardrail-list,
.action-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.readiness-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
}

.readiness-row strong {
  font-size: 12px;
}

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

.mini-fill {
  height: 100%;
  border-radius: inherit;
}

.ops-action {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.priority {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 26px;
  border-radius: 999px;
  background: #fde9e8;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.priority.p1 {
  background: #fff3dc;
  color: var(--amber);
}

.priority.p2 {
  background: #e6f2ee;
  color: var(--green);
}

.action-body strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.action-impact {
  text-align: right;
  font-size: 12px;
  font-weight: 900;
  color: var(--green);
}

.guardrail-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.guardrail-item strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 13px;
}

.guardrail-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 12px;
}

.guardrail-state.warn {
  color: var(--amber);
}

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

.guardrail-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.basis {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--teal);
  background: rgba(255, 255, 255, .64);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

.rfm-grid {
  display: grid;
  grid-template-columns: 54px repeat(5, minmax(52px, 1fr));
  gap: 6px;
}

.rfm-axis,
.rfm-cell,
.rfm-head {
  min-height: 52px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 11px;
  text-align: center;
}

.rfm-head,
.rfm-axis {
  color: var(--muted);
  background: #f0f3ed;
  font-weight: 800;
}

.rfm-cell {
  position: relative;
  border: 1px dashed #d6ddd2;
  background: #fbfcfa;
  color: transparent;
}

.rfm-cell.has-segment {
  color: #fff;
  border-style: solid;
  font-weight: 900;
  line-height: 1.2;
}

.rfm-cell small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
}

.segment-priority-board {
  display: grid;
  gap: 10px;
}

.segment-priority-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segment-priority-card.keep {
  border-left-color: var(--green);
}

.segment-priority-card.wake {
  border-left-color: var(--amber);
}

.segment-priority-card.repeat,
.segment-priority-card.activate {
  border-left-color: var(--teal);
}

.segment-priority-card.grow {
  border-left-color: var(--blue);
}

.segment-priority-card.risk {
  border-left-color: var(--red);
}

.segment-priority-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.segment-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.segment-priority-head strong,
.segment-priority-head small,
.segment-priority-card p,
.segment-action {
  display: block;
}

.segment-priority-head strong {
  font-size: 14px;
}

.segment-priority-head small {
  margin-top: 2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.segment-priority-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.segment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segment-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ea;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.segment-metrics div {
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface);
}

.segment-metrics span,
.segment-metrics strong {
  display: block;
}

.segment-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.segment-metrics strong {
  margin-top: 3px;
  font-size: 13px;
  white-space: nowrap;
}

.segment-action {
  padding: 9px 10px;
  border-radius: 6px;
  background: rgba(22, 133, 93, .08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.heatmap {
  display: grid;
  grid-template-columns: 86px repeat(5, minmax(54px, 1fr));
  gap: 6px;
}

.heat-cell,
.heat-head,
.heat-row-head {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 12px;
}

.heat-head,
.heat-row-head {
  background: #f0f3ed;
  color: var(--muted);
  font-weight: 800;
}

.heat-cell {
  color: #fff;
  font-weight: 900;
}

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

.retention-summary-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.retention-summary-card span,
.retention-summary-card strong,
.retention-summary-card small {
  display: block;
}

.retention-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.retention-summary-card strong {
  margin-top: 5px;
  font-size: 24px;
}

.retention-summary-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.retention-summary-card.warn {
  border-left: 4px solid var(--amber);
}

.cohort-list,
.lifecycle-state-list {
  display: grid;
  gap: 10px;
}

.cohort-card,
.lifecycle-state {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.cohort-card.ok {
  border-left: 4px solid var(--green);
}

.cohort-card.warn {
  border-left: 4px solid var(--amber);
}

.cohort-card.bad {
  border-left: 4px solid var(--red);
}

.cohort-card-head,
.lifecycle-state-head,
.lifecycle-state-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cohort-card-head strong,
.lifecycle-state-head strong {
  display: block;
  font-size: 14px;
}

.cohort-card-head span,
.cohort-card p,
.lifecycle-state p,
.lifecycle-state-foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cohort-card-head em {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ea;
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.cohort-card.warn .cohort-card-head em {
  background: rgba(189, 123, 19, .12);
  color: var(--amber);
}

.cohort-card.bad .cohort-card-head em {
  background: rgba(191, 68, 68, .12);
  color: var(--red);
}

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

.retention-steps div {
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--surface);
}

.retention-steps span,
.retention-steps strong {
  display: block;
}

.retention-steps span {
  color: var(--muted);
  font-size: 10px;
}

.retention-steps strong {
  margin-top: 3px;
  font-size: 14px;
}

.retention-bar {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #edf1eb;
  overflow: hidden;
}

.retention-bar i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
}

.cohort-card p,
.lifecycle-state p {
  margin: 10px 0 0;
}

.lifecycle-state {
  display: grid;
  gap: 9px;
}

.lifecycle-state-head span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
}

.lifecycle-grid {
  display: grid;
  gap: 11px;
}

.life-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
}

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

.life-track {
  height: 28px;
  border-radius: 6px;
  background: #edf1eb;
  overflow: hidden;
}

.life-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.life-value {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
}

.unit-verdict,
.profit-verdict {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: #fbfcfa;
}

.unit-verdict.warn,
.profit-verdict.warn {
  border-left-color: var(--amber);
}

.unit-verdict.bad,
.profit-verdict.bad {
  border-left-color: var(--red);
}

.unit-verdict span,
.profit-verdict span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.unit-verdict strong,
.profit-verdict strong {
  color: var(--ink);
  font-size: 22px;
}

.unit-verdict p,
.profit-verdict p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.unit-metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.unit-metric span {
  color: var(--muted);
  font-size: 11px;
}

.unit-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
}

.unit-metric small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.payback-line {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.payback-line span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.payback-line strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.curve {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  align-items: end;
  min-height: 152px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.curve-bar {
  display: grid;
  grid-template-rows: minmax(16px, 1fr) auto auto;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.curve-bar i {
  align-self: end;
  justify-self: stretch;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--blue), var(--teal));
}

.curve-bar span,
.curve-bar small {
  font-size: 11px;
  color: var(--muted);
}

.curve-bar strong {
  font-size: 12px;
}

.waterfall {
  display: grid;
  gap: 9px;
}

.waterfall-row {
  grid-template-columns: 136px minmax(0, 1fr) 108px;
}

.waterfall-row.negative .fill {
  background: linear-gradient(90deg, #d06052, var(--red));
}

.waterfall-row.result .fill {
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

.matrix-plot {
  position: relative;
  min-height: 312px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(130, 140, 128, .18) 49.8%, rgba(130, 140, 128, .18) 50.2%, transparent 50.2%),
    linear-gradient(0deg, transparent 49.8%, rgba(130, 140, 128, .18) 49.8%, rgba(130, 140, 128, .18) 50.2%, transparent 50.2%),
    #fbfcfa;
  overflow: hidden;
}

.axis-label {
  position: absolute;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.axis-label.x {
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
}

.axis-label.y {
  top: 50%;
  left: 8px;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left top;
}

.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
  transform: translate(-50%, -50%);
}

.bubble small {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.budget-row {
  grid-template-columns: 128px minmax(0, 1fr) 96px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.formula-card {
  display: grid;
  gap: 14px;
}

.formula-line {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.formula-line strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.formula-line span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.game-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 14px;
}

.game-summary-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.game-summary-card.bad {
  border-left-color: var(--red);
}

.game-summary-card span,
.game-summary-card strong,
.game-summary-card small {
  display: block;
}

.game-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.game-summary-card strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.15;
}

.game-summary-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.game-contribution-list,
.game-newuser-list,
.game-risk-grid {
  display: grid;
  gap: 10px;
}

.game-contribution-card,
.game-newuser-card,
.game-risk-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface-soft);
}

.game-contribution-card.warn,
.game-newuser-card.warn,
.game-risk-card.warn {
  border-left-color: var(--amber);
}

.game-contribution-card.bad,
.game-newuser-card.bad,
.game-risk-card.bad {
  border-left-color: var(--red);
}

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

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

.game-card-head strong {
  color: var(--ink);
  font-size: 13px;
}

.game-card-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.game-card-metrics,
.game-newuser-metrics {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

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

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

.game-card-metrics span,
.game-newuser-metrics div {
  min-width: 0;
  padding: 7px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.game-newuser-metrics span,
.game-newuser-metrics strong {
  display: block;
}

.game-newuser-metrics strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
}

.game-newuser-card p,
.game-risk-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.game-risk-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.game-table {
  min-width: 980px;
}

.game-table th:nth-child(-n+3),
.game-table td:nth-child(-n+3),
.game-table th:last-child,
.game-table td:last-child {
  text-align: left;
}

.command-card {
  background: #151c18;
  color: #f2fbf4;
}

.command-card .card-head span {
  color: #a9baad;
}

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

.live-metric,
.alert-panel,
.game-panel {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
}

.live-metric {
  min-height: 108px;
  padding: 13px;
}

.live-metric span {
  display: block;
  color: #a9baad;
  font-size: 12px;
}

.live-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.live-metric small {
  display: block;
  margin-top: 8px;
  color: #69d99c;
  font-size: 12px;
}

.live-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 10px;
  margin-top: 10px;
}

.alert-panel,
.game-panel {
  padding: 14px;
}

.alert-list,
.game-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.alert-list li,
.game-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  color: #dfeae1;
  font-size: 12px;
}

.alert-list small,
.game-list small {
  color: #a9baad;
}

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

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

.source-item {
  min-height: 164px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(54, 68, 55, .05);
}

.term-item {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(54, 68, 55, .04);
}

.term-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.term-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-item h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.source-item p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .kpi-strip,
  .live-grid,
  .term-grid,
  .segment-guide,
  .channel-summary,
  .agent-summary,
  .target-summary,
  .payment-summary,
  .risk-summary,
  .game-summary,
  .use-case-grid,
  .retention-summary,
  .source-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-grid {
    grid-template-columns: repeat(8, 130px);
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .brand {
    padding-bottom: 10px;
  }

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

  .nav-list a {
    grid-template-columns: 18px minmax(0, 1fr);
    padding: 8px;
  }

  .sidebar-note {
    display: none;
  }

  .main {
    padding: 22px 14px 42px;
  }

  .topbar,
  .section-head,
  .two-col,
  .two-col.wide-left,
  .ops-grid,
  .live-lower {
    grid-template-columns: 1fr;
  }

  .card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .card-head span {
    text-align: left;
  }

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

  .channel-summary,
  .payment-summary,
  .risk-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .nav-list,
  .kpi-strip,
  .live-grid,
  .term-grid,
  .segment-guide,
  .channel-summary,
  .agent-summary,
  .target-summary,
  .payment-summary,
  .risk-summary,
  .game-summary,
  .use-case-grid,
  .retention-summary,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .bar-row,
  .waterfall-row,
  .budget-row,
  .depth-row,
  .ladder-row,
  .readiness-row,
  .ops-action,
  .life-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-value,
  .life-value,
  .action-impact {
    text-align: left;
  }

  .kpi-context {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .kpi-context span {
    text-align: left;
  }

  .period-control {
    width: 100%;
  }

  .drop-note {
    margin-left: 0;
  }

  .channel-row-metrics,
  .agent-card-metrics,
  .target-card-metrics,
  .payment-card-metrics,
  .risk-card-metrics {
    grid-template-columns: 1fr;
  }

  .game-card-metrics,
  .game-newuser-metrics {
    grid-template-columns: 1fr;
  }

  .use-case-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .heatmap {
    grid-template-columns: 74px repeat(5, minmax(42px, 1fr));
    gap: 4px;
  }

  .rfm-grid {
    grid-template-columns: 42px repeat(5, minmax(42px, 1fr));
    gap: 4px;
  }

  .heat-cell,
  .heat-head,
  .heat-row-head,
  .rfm-axis,
  .rfm-cell,
  .rfm-head {
    min-height: 40px;
    font-size: 10px;
  }

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

  .payback-line {
    grid-template-columns: 1fr;
  }

  .matrix-plot {
    min-height: 260px;
  }
}
