:root {
  color-scheme: light;
  --navy-950: #0b1220;
  --navy-900: #111a2c;
  --navy-800: #1b2940;
  --ink-900: #172033;
  --ink-700: #44516a;
  --ink-500: #6d7890;
  --surface: #ffffff;
  --canvas: #f3f5f8;
  --line: #e3e7ee;
  --line-strong: #ced5e1;
  --blue: #3559e0;
  --blue-soft: #edf1ff;
  --red: #c93b4b;
  --red-soft: #fff0f2;
  --yellow: #a56a00;
  --yellow-soft: #fff7df;
  --green: #18835a;
  --green-soft: #eaf8f2;
  --gray: #647085;
  --gray-soft: #eef1f5;
  --shadow: 0 12px 34px rgba(20, 31, 50, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink-900);
  background: var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="date"] {
  min-height: 38px;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(53, 89, 224, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 3vw, 44px);
  color: #f8faff;
  background: var(--navy-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-lockup,
.header-actions,
.freshness,
.filter-group,
.section-heading,
.drawer-section-heading {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 13px;
}

.brand-mark,
.login-brand {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.06em;
  background: var(--blue);
  border-radius: 10px;
}

.header-eyebrow,
.eyebrow,
.section-kicker {
  margin: 0 0 3px;
  color: #91a0ba;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.2;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.freshness {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
  color: #d4dbea;
  font-size: 0.78rem;
}

.freshness-dot {
  width: 8px;
  height: 8px;
  background: #39c38b;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(57, 195, 139, 0.12);
}

#refresh-countdown {
  color: #91a0ba;
}

.header-button {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  color: #e9edf6;
  background: transparent;
  border: 1px solid #3b465b;
  border-radius: 7px;
  text-decoration: none;
}

.header-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.product-switcher {
  position: relative;
}

.product-switcher summary {
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.product-switcher summary::-webkit-details-marker {
  display: none;
}

.product-switcher nav {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 220px;
  max-height: min(60vh, 420px);
  padding: 6px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(10, 20, 38, 0.24);
}

.product-switcher nav a {
  min-height: 44px;
  padding: 11px 12px;
  color: var(--ink-900);
  border-radius: 7px;
  text-decoration: none;
}

.product-switcher nav a:hover,
.product-switcher nav a[aria-current="page"] {
  background: var(--blue-soft);
}

.dashboard-shell {
  width: min(1880px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 2vw, 32px) 52px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 13px;
  color: #6e4400;
  background: var(--yellow-soft);
  border: 1px solid #efd58f;
  border-radius: 8px;
  font-size: 0.86rem;
}

.notice-error {
  color: #8f2735;
  background: var(--red-soft);
  border-color: #efbdc4;
}

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

.source-tabs {
  display: inline-flex;
  padding: 3px;
  background: #e7eaf0;
  border-radius: 9px;
}

.source-tabs button {
  min-height: 34px;
  padding: 6px 15px;
  color: var(--ink-700);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 650;
}

.source-tabs button[aria-selected="true"] {
  color: var(--ink-900);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(19, 30, 50, 0.12);
}

.filter-group {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 9px;
}

.filter-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.filter-group label {
  margin-left: 7px;
  color: var(--ink-500);
  font-size: 0.8rem;
  font-weight: 650;
}

.filter-group input,
.filter-group select {
  padding: 7px 31px 7px 10px;
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.summary-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.summary-primary,
.summary-metrics {
  display: grid;
  gap: 12px;
}

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

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

body[data-view-mode="game_distribution"] .summary-primary {
  display: none;
}

body[data-view-mode="game_distribution"] .direction-only {
  display: none;
}

body[data-view-mode="game_distribution"] .decision-only {
  display: none;
}

body[data-view-mode="game_distribution"] #channel-table {
  min-width: 920px;
}

.summary-card {
  min-height: 124px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(20, 31, 50, 0.035);
}

.metric-card {
  min-height: 102px;
  border-top: 3px solid #dbe3f5;
}

.summary-card > span,
.summary-card small {
  display: block;
  color: var(--ink-500);
  font-size: 0.78rem;
  line-height: 1.5;
}

.summary-card > span {
  color: var(--ink-700);
  font-size: 0.84rem;
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.decision-counts,
.status-counts,
.arppu-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 9px;
}

.decision-counts button,
.status-counts b,
.arppu-counts b {
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 0.82rem;
}

.decision-counts button {
  min-height: 32px;
  border: 1px solid transparent;
  font-weight: 700;
}

.decision-counts button[aria-pressed="true"] {
  border-color: currentColor;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px currentColor;
}

.count-neutral {
  color: var(--ink-700);
  background: #f3f5f8;
}

.count-red {
  color: var(--red);
  background: var(--red-soft);
}

.count-yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.count-blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.count-gray {
  color: var(--gray);
  background: var(--gray-soft);
}

.count-green {
  color: var(--green);
  background: var(--green-soft);
}

.table-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-heading {
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.drawer-header h2,
.drawer-section h3 {
  margin: 0;
}

.section-heading h2 {
  font-size: 1.2rem;
}

.table-caption {
  max-width: 720px;
  text-align: right;
}

.table-caption p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.8rem;
  line-height: 1.5;
}

.table-caption p + p {
  margin-top: 4px;
  color: var(--yellow);
}

.section-kicker {
  color: var(--blue);
}

.table-scroll {
  max-height: min(72vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
}

.mobile-section-label {
  display: none;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

#channel-table {
  min-width: 1420px;
  table-layout: fixed;
}

#channel-table .col-channel {
  width: 150px;
}

#channel-table .col-decision {
  width: 390px;
}

#channel-table .col-volume {
  width: 165px;
}

#channel-table .col-direction {
  width: 295px;
}

#channel-table .col-arppu {
  width: 155px;
}

#channel-table .col-performance {
  width: 265px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: var(--ink-500);
  background: #f8f9fb;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

td {
  color: var(--ink-700);
  font-size: 0.875rem;
}

tbody tr[data-channel-id]:hover {
  background: #f8faff;
}

tbody tr.row-status-red {
  background: linear-gradient(90deg, rgba(201, 59, 75, 0.07), transparent 70%);
}

tbody tr.row-status-yellow {
  background: linear-gradient(90deg, rgba(165, 106, 0, 0.07), transparent 70%);
}

tbody tr.row-status-value_shift {
  background: linear-gradient(90deg, rgba(53, 89, 224, 0.07), transparent 70%);
}

tbody tr.row-status-red:hover {
  background: linear-gradient(90deg, rgba(201, 59, 75, 0.11), #f8faff 75%);
}

tbody tr.row-status-yellow:hover {
  background: linear-gradient(90deg, rgba(165, 106, 0, 0.11), #f8faff 75%);
}

tbody tr.row-status-value_shift:hover {
  background: linear-gradient(90deg, rgba(53, 89, 224, 0.11), #f8faff 75%);
}

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

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.channel-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0;
  color: var(--ink-900);
  background: transparent;
  border: 0;
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
}

#channel-table th:first-child,
#channel-table .channel-cell {
  position: sticky;
  left: 0;
}

#channel-table th:first-child {
  z-index: 4;
}

#channel-table .channel-cell {
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}

#channel-table tr.row-status-red .channel-cell {
  background: #fff8f9;
  box-shadow: inset 4px 0 var(--red), 1px 0 0 var(--line);
}

#channel-table tr.row-status-yellow .channel-cell {
  background: #fffbf0;
  box-shadow: inset 4px 0 var(--yellow), 1px 0 0 var(--line);
}

#channel-table tr.row-status-value_shift .channel-cell {
  background: #f7f9ff;
  box-shadow: inset 4px 0 var(--blue), 1px 0 0 var(--line);
}

.channel-button::after {
  content: "›";
  color: var(--ink-500);
  font-size: 1.15rem;
}

.direction-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.35;
}

.direction-label b {
  color: var(--ink-900);
  font-size: 0.88rem;
}

.direction-target {
  color: var(--ink-700);
  font-size: 0.8rem;
}

.direction-dot {
  width: 7px;
  height: 7px;
  background: var(--blue);
  border-radius: 999px;
}

.metric-primary {
  color: var(--ink-900);
  font-weight: 700;
}

.metric-secondary,
.row-freshness {
  display: block;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 0.75rem;
  line-height: 1.4;
}

.volume-metrics,
.result-metrics {
  display: grid;
  gap: 8px;
}

.volume-metrics {
  grid-template-columns: repeat(3, minmax(48px, 1fr));
}

.volume-metrics span,
.result-metrics span {
  min-width: 0;
}

.volume-metrics small,
.result-metrics small {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 0.72rem;
}

.volume-metrics strong,
.result-metrics strong {
  display: block;
  color: var(--ink-900);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.result-metrics {
  grid-template-columns: 1fr;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.result-metrics strong {
  font-size: 0.95rem;
}

.row-freshness.stale {
  color: var(--yellow);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 999px;
}

.status-red {
  color: var(--red);
  background: var(--red-soft);
}

.status-yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.status-value_shift {
  color: var(--blue);
  background: var(--blue-soft);
}

.status-green {
  color: var(--green);
  background: var(--green-soft);
}

.status-insufficient,
.status-unknown {
  color: var(--gray);
  background: var(--gray-soft);
}

.arppu-cell {
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 126px;
}

.action-cell {
  vertical-align: top;
}

.action-decision {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.action-decision-heading,
.action-track-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-decision-heading > small,
.action-track-heading span {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.action-pill,
.day-outcome {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
}

.action-pill {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.action-pill-scale_up,
.action-day-stop-clear,
.action-day-scale-met {
  color: var(--green);
  background: var(--green-soft);
}

.action-pill-stop,
.action-day-stop-triggered {
  color: var(--red);
  background: var(--red-soft);
}

.action-pill-observe,
.action-day-scale-missed {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.action-pill-hold,
.action-pill-immature,
.action-day-excluded,
.action-day-missing,
.action-day-pending {
  color: var(--gray);
  background: var(--gray-soft);
}

.action-compact-tracks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.action-track-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px 9px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.action-track-heading strong {
  color: var(--ink-900);
  font-size: 0.78rem;
}

.action-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.action-progress-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.2;
}

.action-progress-item small {
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
}

.action-progress-empty {
  color: var(--ink-500);
  font-size: 0.75rem;
}

.action-reason {
  margin: 0;
  padding: 8px 10px;
  color: var(--ink-700);
  background: #f6f7fa;
  border-left: 3px solid var(--line-strong);
  border-radius: 5px;
  font-size: 0.78rem;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.action-stop .action-reason {
  color: #8f2735;
  background: var(--red-soft);
  border-left-color: var(--red);
}

.action-scale_up .action-reason {
  color: #126b49;
  background: var(--green-soft);
  border-left-color: var(--green);
}

.action-detail-hint {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 650;
}

.arppu-value {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.arppu-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}

.arppu-met {
  color: var(--green);
  background: var(--green-soft);
}

.arppu-missed {
  color: var(--red);
  background: var(--red-soft);
}

.arppu-insufficient,
.arppu-unknown {
  color: var(--gray);
  background: var(--gray-soft);
}

.distribution {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 62px 1fr 48px;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
}

.direction-insight-cell {
  vertical-align: top;
}

.direction-insight {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.direction-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.direction-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.direction-score strong {
  color: var(--ink-900);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.direction-score span,
.direction-rates {
  color: var(--ink-500);
  font-size: 0.74rem;
}

.direction-rates {
  display: block;
  line-height: 1.4;
}

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

.direction-fact {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  background: #f6f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.direction-fact small {
  color: var(--ink-500);
  font-size: 0.68rem;
}

.direction-fact strong {
  min-width: 0;
  color: var(--ink-900);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.row-status-red .direction-fact strong {
  color: #982c3a;
}

.row-status-yellow .direction-fact strong {
  color: #785000;
}

.row-status-value_shift .direction-fact strong {
  color: #2949b4;
}

.direction-note {
  display: block;
  min-width: 0;
  color: var(--ink-700);
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 8px 9px;
  background: var(--gray-soft);
  border-radius: 8px;
}

.distribution-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-track {
  height: 6px;
  background: #e8ebf1;
  border-radius: 999px;
  overflow: hidden;
}

.distribution-fill {
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

.performance-cell {
  vertical-align: top;
}

.performance-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 78px;
  gap: 14px;
  align-items: center;
}

.table-state {
  margin: 0;
  padding: 34px 18px;
  color: var(--ink-500);
  text-align: center;
}

.table-state-error {
  color: var(--red);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(8, 14, 25, 0.36);
}

.detail-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 31;
  width: min(860px, 96vw);
  padding: 0 22px 32px;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: -20px 0 50px rgba(14, 23, 39, 0.18);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 -22px 18px;
  padding: 20px 22px 16px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.drawer-header h2 {
  font-size: 1.35rem;
}

.drawer-meta {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 0.8rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  color: var(--ink-700);
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.5rem;
  line-height: 1;
}

.drawer-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.drawer-kpi {
  padding: 11px 12px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.drawer-kpi span {
  display: block;
  color: var(--ink-500);
  font-size: 0.75rem;
}

.drawer-kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-900);
  font-size: 1.12rem;
}

.drawer-kpi-wide {
  grid-column: 1 / -1;
  background: var(--yellow-soft);
  border-color: #efd58f;
}

.drawer-kpi-wide strong {
  font-size: 0.92rem;
  line-height: 1.55;
}

.drawer-section {
  margin-top: 24px;
}

.drawer-section-heading {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.drawer-section-heading h3 {
  font-size: 1.02rem;
}

.drawer-section-heading span {
  color: var(--ink-500);
  font-size: 0.75rem;
}

.action-rule-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.action-rule-legend p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  color: var(--ink-700);
  background: #f6f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.action-rule-legend strong {
  color: var(--ink-900);
  font-size: 0.8rem;
}

.action-rule-legend span {
  color: var(--ink-500);
}

.action-history-list {
  display: grid;
  gap: 9px;
}

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

.action-history-heading,
.action-history-heading > div,
.action-history-meta,
.history-condition > div {
  display: flex;
  align-items: center;
}

.action-history-heading {
  justify-content: space-between;
  gap: 12px;
}

.action-history-heading > div {
  gap: 7px;
}

.action-history-heading > div:first-child strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.action-history-heading small,
.action-history-meta {
  color: var(--ink-500);
  font-size: 0.75rem;
}

.action-history-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 12px;
}

.action-history-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.action-history-facts span {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  background: #f7f8fa;
  border-radius: 7px;
}

.action-history-facts small {
  color: var(--ink-500);
  font-size: 0.72rem;
}

.action-history-facts strong {
  color: var(--ink-900);
  font-size: 0.82rem;
}

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

.history-condition {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 9px 10px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-condition > div {
  justify-content: space-between;
  gap: 8px;
}

.history-condition > div > strong {
  font-size: 0.8rem;
}

.history-condition p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.76rem;
  line-height: 1.45;
}

.condition-result {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.trend-chart {
  min-height: 220px;
  padding: 10px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
}

.trend-grid {
  stroke: #d9dee7;
  stroke-width: 1;
}

.trend-threshold-40 {
  stroke: #dda92c;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.trend-threshold-60 {
  stroke: #3aa879;
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.trend-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-point-latest {
  fill: #ffffff;
  stroke: var(--blue);
  stroke-width: 3;
}

.trend-hit-target {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
}

.trend-hit-target:focus {
  fill: rgba(53, 89, 224, 0.1);
  stroke: var(--blue);
  stroke-width: 2;
  outline: none;
}

.trend-label {
  fill: var(--ink-500);
  font-size: 11px;
}

.trend-fallback {
  min-height: 20px;
  margin: 7px 0 0;
  color: var(--ink-500);
  font-size: 0.76rem;
}

.category-table {
  min-width: 560px;
  border: 1px solid var(--line);
}

.category-table th,
.category-table td {
  padding: 9px 10px;
  font-size: 0.8rem;
}

.drawer-state {
  padding: 42px 16px;
  color: var(--ink-500);
  text-align: center;
}

.drawer-error {
  color: var(--red);
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 20%, rgba(53, 89, 224, 0.2), transparent 34%),
    var(--navy-950);
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  width: min(410px, 100%);
  padding: 34px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.login-brand {
  margin-bottom: 22px;
}

.login-panel .eyebrow {
  color: var(--blue);
}

.login-panel h1 {
  margin: 3px 0 8px;
  font-size: 1.55rem;
}

.login-intro {
  margin: 0 0 22px;
  color: var(--ink-500);
}

.form-error {
  padding: 9px 11px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 7px;
  font-size: 0.82rem;
}

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

.login-form label {
  margin-top: 6px;
  color: var(--ink-700);
  font-size: 0.78rem;
  font-weight: 650;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink-900);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.primary-button {
  min-height: 43px;
  margin-top: 12px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: 7px;
  font-weight: 700;
}

.primary-button:hover {
  background: #294ac8;
}

.setup-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(53, 89, 224, 0.1), transparent 34rem),
    var(--canvas);
}

.setup-shell,
.settings-shell {
  width: min(100% - 32px, 880px);
  margin: 0 auto;
  padding: 48px 0 72px;
}

.setup-panel,
.settings-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.setup-panel-narrow {
  width: min(100%, 560px);
  margin: 7vh auto 0;
}

.setup-session-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.setup-panel h1,
.setup-header h1,
.settings-card h2 {
  margin: 0;
}

.setup-intro,
.settings-copy p {
  color: var(--ink-700);
  line-height: 1.65;
}

.setup-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.setup-form label:not(.setup-check) {
  margin-top: 8px;
  color: var(--ink-700);
  font-size: 0.9rem;
  font-weight: 700;
}

.setup-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink-900);
  background: #fff;
}

.setup-control:focus {
  border-color: var(--blue);
}

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

.setup-field {
  display: grid;
  gap: 7px;
}

.setup-field-wide {
  grid-column: 1 / -1;
}

.setup-field small {
  color: var(--ink-500);
}

.setup-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  color: var(--ink-700);
  background: var(--blue-soft);
  line-height: 1.5;
}

.setup-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 1px 0 0;
}

.setup-check-warning {
  color: #785000;
  background: var(--yellow-soft);
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.setup-actions button,
.setup-header .header-button {
  min-height: 44px;
}

.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-weight: 750;
}

.secondary-button {
  color: var(--ink-900);
  background: #fff;
}

.danger-button {
  border-color: #efb9c0;
  color: var(--red);
  background: var(--red-soft);
}

.setup-message {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.5;
}

.setup-message-error {
  border-color: #f2c0c6;
  color: #9f2937;
  background: var(--red-soft);
}

.setup-message-success {
  border-color: #bee6d5;
  color: var(--green);
  background: var(--green-soft);
}

.setup-message-info {
  border-color: #cbd5ff;
  color: var(--blue);
  background: var(--blue-soft);
}

.setup-progress {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
  padding: 20px;
  border-radius: 12px;
  background: var(--blue-soft);
}

.setup-progress p {
  margin: 6px 0 0;
  color: var(--ink-700);
  line-height: 1.55;
}

.setup-progress-content {
  min-width: 0;
  flex: 1 1 auto;
}

.setup-progress-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.setup-progress-actions[hidden],
.setup-progress-actions form[hidden],
.setup-progress-actions a[hidden] {
  display: none;
}

.setup-progress-actions .primary-button {
  margin-top: 0;
  padding: 10px 16px;
}

.setup-progress-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.setup-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid #c7d2ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: setup-spin 800ms linear infinite;
}

@keyframes setup-spin {
  to { transform: rotate(360deg); }
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.setup-header .eyebrow {
  margin: 0 0 4px;
}

.settings-shell {
  display: grid;
  gap: 18px;
  width: min(100% - 32px, 980px);
  padding-top: 28px;
}

.settings-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  gap: 32px;
  padding: 26px;
  box-shadow: 0 8px 24px rgba(20, 31, 50, 0.05);
}

.settings-card .setup-form {
  margin-top: 0;
}

.settings-card-danger {
  border-color: #f0cbd0;
}

.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 0%, rgba(53, 89, 224, 0.09), transparent 36rem),
    var(--canvas);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px clamp(18px, 3vw, 44px);
  color: #f8faff;
  background: var(--navy-950);
}

.admin-header h1,
.admin-intro h2,
.admin-create-panel h2,
.admin-section-heading h2,
.admin-product-card h3,
.admin-account-card h3,
.temporary-credential h2 {
  margin: 0;
}

.admin-nav,
.admin-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav .header-button {
  min-height: 44px;
}

.admin-nav form,
.admin-card-actions form {
  margin: 0;
}

.admin-shell {
  width: min(100% - 32px, 1320px);
  margin: 0 auto;
  padding: 30px 0 72px;
}

.admin-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.admin-intro > p,
.admin-create-panel > div > p,
.admin-account-note,
.temporary-credential > p {
  margin: 6px 0 0;
  color: var(--ink-700);
  line-height: 1.55;
}

.admin-product-grid,
.admin-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.admin-product-card,
.admin-account-card,
.admin-create-panel,
.temporary-credential {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(20, 31, 50, 0.06);
}

.admin-product-card {
  border-top: 4px solid var(--line-strong);
}

.admin-product-card.status-normal { border-top-color: var(--green); }
.admin-product-card.status-delayed,
.admin-product-card.status-initializing { border-top-color: var(--yellow); }
.admin-product-card.status-connection_error { border-top-color: var(--red); }

.admin-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-card-team {
  margin: 0 0 4px;
  color: var(--ink-500);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-status-chip {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--gray);
  background: var(--gray-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-status-chip.status-normal { color: var(--green); background: var(--green-soft); }
.admin-status-chip.status-delayed,
.admin-status-chip.status-initializing { color: var(--yellow); background: var(--yellow-soft); }
.admin-status-chip.status-connection_error { color: var(--red); background: var(--red-soft); }

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

.admin-metric-grid > div,
.temporary-credential dl > div {
  min-width: 0;
  padding: 11px 12px;
  background: var(--canvas);
  border-radius: 10px;
}

.admin-metric-grid dt,
.temporary-credential dt,
.admin-connector-details dt {
  color: var(--ink-500);
  font-size: 0.74rem;
  font-weight: 700;
}

.admin-metric-grid dd,
.temporary-credential dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.admin-connector-details {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.admin-connector-details > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.admin-connector-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 750;
  text-align: right;
}

.admin-safe-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  color: #9f2937;
  background: var(--red-soft);
  border-radius: 9px;
  font-size: 0.86rem;
}

.admin-card-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.admin-card-actions .primary-button,
.admin-card-actions .secondary-button,
.admin-card-actions .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0;
  padding: 10px 16px;
  text-decoration: none;
}

.admin-create-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 32px;
  margin-bottom: 30px;
}

.admin-create-panel .setup-form {
  margin-top: 0;
}

.admin-section-heading {
  margin-bottom: 14px;
}

.admin-account-note {
  min-height: 48px;
}

.temporary-credential {
  margin-bottom: 18px;
  border-color: #bfd0ff;
  background: #f7f9ff;
}

.temporary-credential dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.temporary-password {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: all;
}

.admin-empty-state {
  margin: 0;
  padding: 28px;
  color: var(--ink-500);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

@media (max-width: 1280px) {
  .dashboard-shell {
    padding-inline: 18px;
  }

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

  .action-overview {
    grid-column: 1 / -1;
  }

}

@media (max-width: 820px) {
  .app-header,
  .control-bar {
    align-items: flex-start;
  }

  .app-header,
  .control-bar,
  .section-heading {
    flex-direction: column;
  }

  .table-caption {
    max-width: none;
    text-align: left;
  }

  .header-actions,
  .filter-group {
    width: 100%;
    justify-content: space-between;
  }

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

  .summary-primary {
    grid-template-columns: 1fr;
  }

  .summary-metrics {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
  }

  .drawer-kpis {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .detail-drawer {
    width: min(100vw, 860px);
  }
}

@media (max-width: 640px) {
  .admin-shell {
    width: min(100% - 20px, 100%);
    padding: 18px 0 44px;
  }

  .admin-header,
  .admin-intro,
  .admin-create-panel {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .admin-header {
    padding: 13px 14px;
  }

  .admin-nav,
  .admin-card-actions,
  .admin-card-actions form,
  .admin-card-actions button,
  .admin-card-actions a {
    width: 100%;
  }

  .admin-nav {
    align-items: stretch;
  }

  .admin-nav .header-button,
  .admin-card-actions .primary-button,
  .admin-card-actions .secondary-button,
  .admin-card-actions .danger-button {
    justify-content: center;
    min-height: 44px;
  }

  .admin-product-grid,
  .admin-account-grid,
  .admin-metric-grid,
  .temporary-credential dl {
    grid-template-columns: 1fr;
  }

  .admin-product-card,
  .admin-account-card,
  .admin-create-panel,
  .temporary-credential {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .setup-shell,
  .settings-shell {
    width: min(100% - 20px, 100%);
    padding: 18px 0 44px;
  }

  .setup-panel,
  .settings-card {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .setup-panel-narrow {
    margin-top: 0;
  }

  .setup-grid,
  .settings-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .setup-actions,
  .setup-actions button {
    width: 100%;
  }

  .setup-actions button,
  .setup-control,
  .setup-header .header-button {
    min-height: 44px;
  }

  .setup-header {
    align-items: flex-start;
    padding: 14px 12px;
  }

  .setup-header h1 {
    font-size: 1.2rem;
  }

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

  .app-header {
    gap: 12px;
    padding: 13px 14px;
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .header-eyebrow {
    display: none;
  }

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

  .freshness {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: start;
    gap: 3px 9px;
  }

  .header-actions .freshness {
    grid-column: 1 / -1;
  }

  .header-actions > form,
  .header-actions > form .header-button,
  .product-switcher,
  .product-switcher summary {
    width: 100%;
  }

  .header-actions .header-button {
    justify-content: center;
  }

  .product-switcher nav {
    right: 0;
    left: 0;
    min-width: 0;
  }

  #refresh-countdown {
    grid-column: 2;
  }

  .header-button,
  .source-tabs button,
  .filter-group input,
  .filter-group select,
  .decision-counts button,
  .icon-button {
    min-height: 44px;
  }

  .dashboard-shell {
    padding: 14px 12px 36px;
  }

  .notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
  }

  .header-actions,
  .filter-group {
    align-items: stretch;
  }

  .control-bar {
    gap: 12px;
    margin-bottom: 14px;
  }

  .source-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .filter-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .filter-group label {
    margin: 0;
  }

  .filter-control {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .filter-group input,
  .filter-group select {
    width: 100%;
  }

  .summary-grid {
    gap: 10px;
    margin-bottom: 16px;
  }

  .summary-primary,
  .summary-metrics {
    gap: 10px;
  }

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

  .summary-card {
    min-height: 0;
    padding: 14px;
  }

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

  .summary-card strong {
    font-size: 1.55rem;
  }

  .decision-counts,
  .status-counts,
  .arppu-counts {
    gap: 7px;
  }

  .section-heading {
    gap: 8px;
    padding: 15px 14px 12px;
  }

  .table-caption {
    display: none;
  }

  .table-section {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .table-scroll {
    max-height: none;
    overflow: visible;
  }

  #channel-table,
  body[data-view-mode="game_distribution"] #channel-table {
    display: block;
    min-width: 0;
    table-layout: auto;
  }

  #channel-table colgroup,
  #channel-table thead {
    display: none;
  }

  #channel-table tbody {
    display: grid;
    gap: 12px;
  }

  #channel-table .channel-row {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(20, 31, 50, 0.07);
  }

  #channel-table .channel-row:hover {
    background: var(--surface);
  }

  #channel-table .channel-row > td {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  body[data-view-mode="game_distribution"] #channel-table .direction-only,
  body[data-view-mode="game_distribution"] #channel-table .decision-only,
  body[data-view-mode="game_distribution"] #channel-table .arppu-only {
    display: none;
  }

  #channel-table .channel-row > td:last-child {
    border-bottom: 0;
  }

  #channel-table th:first-child,
  #channel-table .channel-cell {
    position: static;
    left: auto;
  }

  #channel-table .channel-cell {
    padding-block: 10px;
    box-shadow: none;
  }

  #channel-table tr.row-status-red .channel-cell,
  #channel-table tr.row-status-yellow .channel-cell,
  #channel-table tr.row-status-value_shift .channel-cell {
    box-shadow: none;
  }

  #channel-table tr.row-status-red {
    border-left: 4px solid var(--red);
  }

  #channel-table tr.row-status-yellow {
    border-left: 4px solid var(--yellow);
  }

  #channel-table tr.row-status-value_shift {
    border-left: 4px solid var(--blue);
  }

  .channel-button {
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
  }

  .mobile-section-label {
    display: block;
    margin-bottom: 9px;
    color: var(--ink-500);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.08em;
  }

  .action-compact-tracks {
    grid-template-columns: 1fr;
  }

  .action-reason {
    -webkit-line-clamp: 3;
  }

  .performance-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .distribution {
    min-width: 0;
  }

  .result-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .detail-drawer {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    padding: 0 14px calc(28px + env(safe-area-inset-bottom));
  }

  .drawer-header {
    margin: 0 -14px 16px;
    padding: calc(14px + env(safe-area-inset-top)) 14px 13px;
  }

  .drawer-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .drawer-kpi {
    padding: 10px;
  }

  .drawer-section {
    margin-top: 20px;
  }

  .drawer-section-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .trend-chart {
    min-height: 0;
    padding: 6px;
  }

  .action-rule-legend,
  .action-history-tracks {
    grid-template-columns: 1fr;
  }

  .action-history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-history-meta {
    justify-content: flex-start;
  }

  .login-panel {
    padding: 26px 22px;
  }
}

@media (max-width: 360px) {
  .summary-metrics,
  .drawer-kpis,
  .action-history-facts {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .detail-drawer {
    animation: drawer-in 160ms ease-out;
  }

  @keyframes drawer-in {
    from { transform: translateX(18px); opacity: 0.92; }
    to { transform: translateX(0); opacity: 1; }
  }
}
