:root {
  color-scheme: light;
  --bg: #e2e5e8;
  --panel: #f3f3ef;
  --panel-strong: #6f7781;
  --text: #171b22;
  --muted: #68707a;
  --line: #cdd3d9;
  --blue: #1457a8;
  --green: #20a66b;
  --yellow: #ffd200;
  --yellow-soft: #ffd200;
  --red: #df4b40;
  --graphite: #6f7781;
  --shadow: 0 16px 40px rgb(23 27 34 / 10%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.page {
  width: calc(100% - 40px);
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 56px;
}

body.stats-mode .page {
  width: calc(100% - 24px);
}

body.stats-mode .hero {
  margin-bottom: 14px;
}

body.stats-mode .status,
body.stats-mode .app-tabs,
body.stats-mode .cards {
  margin-bottom: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 20px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 18px;
}

.lead {
  max-width: 760px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.eyebrow {
  margin-bottom: 8px;
  color: #806900;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-card,
.metric-card,
.panel,
.status {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgb(243 243 239 / 86%);
  box-shadow: 0 10px 30px rgb(23 27 34 / 7%);
}

.hero-card {
  display: flex;
  min-height: 168px;
  padding: 24px;
  flex-direction: column;
  justify-content: space-between;
}

.hero-card strong {
  font-size: 34px;
}

.hero-card small {
  color: var(--muted);
}

.muted,
.hint {
  color: var(--muted);
}

.status {
  margin-bottom: 20px;
  padding: 16px 18px;
  box-shadow: none;
}

.status-ok {
  border-color: rgb(18 183 106 / 35%);
  background: #effaf4;
}

.status-warning,
.status-loading {
  border-color: rgb(255 210 0 / 70%);
  background: #eef1f3;
}

.status-error {
  border-color: rgb(240 68 56 / 35%);
  background: #fef3f2;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.app-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  background: rgb(248 248 246 / 92%);
  box-shadow: var(--shadow);
}

.app-tab {
  min-width: 160px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.app-tab.active {
  background: var(--graphite);
  color: var(--yellow);
}

.metric-card {
  padding: 22px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.metric-card.accent {
  background: var(--panel-strong);
  color: white;
}

.metric-card.accent span {
  color: rgb(255 255 255 / 70%);
}

.panel {
  margin-top: 18px;
  padding: 24px;
}

#stats-view {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.panel-heading {
  display: flex;
  gap: 20px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.legend {
  display: flex;
  max-width: 560px;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-good {
  background: var(--green);
}

.legend-warn {
  background: var(--yellow);
}

.legend-bad {
  background: #f04438;
}

.legend-empty {
  border: 1px dashed #98a2b3;
  background: #f2f4f7;
}

.heatmaps {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.heatmap-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  background: #fbfbf8;
}

.heatmap-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.heatmap-title {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  line-height: 1.2;
}

.heatmap-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  transform: translateY(1px);
}

.heatmap-status-dot-needs-premium-plus,
.heatmap-status-dot-locked {
  background: #9ca3af;
}

.heatmap-header p {
  max-width: 860px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.heatmap-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: #292d33;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.heatmap-locked {
  opacity: 0.72;
}

.heatmap-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.heatmap-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 14px;
  align-items: start;
}

.heatmap-main-column {
  display: grid;
  gap: 0;
  min-width: 0;
}

.hour-heatmap-wrap {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px 12px;
  background: white;
}

.hour-heatmap-title {
  margin-bottom: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.hour-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
}

.hour-heatmap-cell {
  display: flex;
  width: auto;
  min-width: 0;
  height: 48px;
  border-radius: 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  white-space: normal;
}

.hour-heatmap-cell span {
  font-size: 9px;
  font-weight: 750;
  opacity: 0.76;
}

.hour-heatmap-cell strong {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}

.heatmap-coverage-note {
  width: min(100%, 1180px);
  margin: 0 0 10px;
  border: 1px solid rgb(255 210 0 / 55%);
  border-radius: 12px;
  padding: 9px 12px;
  background: #fff9d7;
  color: #5f4d00;
  font-size: 12px;
  font-weight: 750;
}

.heatmap-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  border: 1px solid #d8e1ea;
  border-radius: 14px;
  padding: 10px;
  background: #f8fafc;
}

.heatmap-summary span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 0 rgb(15 23 42 / 4%);
}

.heatmap-summary strong {
  color: #475467;
  font-weight: 800;
}

.heatmap-context {
  color: #475467 !important;
  font-weight: 700;
}

.heatmap-table {
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.heatmap-table th,
.heatmap-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  text-align: center;
  white-space: nowrap;
}

.heatmap-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 36px;
  background: #eceff2;
  color: #475467;
}

.heatmap-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 130px;
  padding: 0 12px;
  background: #eceff2;
  text-align: left;
}

.heat-cell {
  width: 42px;
  height: 42px;
  font-family: "Arial Narrow", "Roboto Condensed", "Inter Tight", Arial, sans-serif;
  font-stretch: condensed;
  font-size: 11px;
  font-weight: 800;
}

.heatmap-hour-detail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid #d8e1ea;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgb(15 23 42 / 6%);
}

.heatmap-hour-detail-head {
  display: grid;
  gap: 4px;
}

.heatmap-hour-detail-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.heatmap-hour-detail-head strong {
  color: #101828;
  font-size: 18px;
  font-weight: 900;
}

.heatmap-hour-detail-head small {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #f2f4f7;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.heatmap-hour-detail-good .heatmap-hour-detail-head small {
  background: #e7f7ee;
  color: #067647;
}

.heatmap-hour-detail-warn .heatmap-hour-detail-head small {
  background: #fff4c2;
  color: #7a5c00;
}

.heatmap-hour-detail-bad .heatmap-hour-detail-head small {
  background: #fee4e2;
  color: #b42318;
}

.heatmap-hour-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.heatmap-hour-detail-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  padding: 10px;
  background: #fbfcfd;
}

.heatmap-hour-detail-grid small {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.heatmap-hour-detail-grid strong {
  color: #101828;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.heatmap-hour-detail p {
  margin: 0;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.heat-good {
  background: #dff8ea;
  color: #067647;
}

.heat-warn {
  background: #fff1a6;
  color: #6d5800;
}

.heat-bad {
  background: #fee4e2;
  color: #b42318;
}

.legend-infinity {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #fee4e2;
  color: #b42318;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.heat-empty {
  background: #f9fafb;
  color: #98a2b3;
  font-weight: 600;
}

.self-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 20px;
  margin-top: 18px;
  border: 1px solid rgb(255 210 0 / 70%);
  border-radius: 18px;
  padding: 18px;
  background: #eef1f3;
}

.self-check p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.self-check ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.self-check li {
  display: grid;
  grid-template-columns: 12px 150px 1fr;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.self-check strong {
  color: var(--text);
}

.check-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #98a2b3;
}

.check-ok {
  background: var(--green);
}

.check-warning {
  background: #c9a400;
}

.check-planned {
  background: var(--blue);
}

.toolbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar label {
  display: grid;
  min-width: 240px;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wide-control {
  min-width: min(520px, 100%) !important;
}

.toolbar input,
.toolbar select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: white;
  color: var(--text);
  font: inherit;
}

.secondary-button {
  align-self: end;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--graphite);
  color: var(--yellow);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary-button {
  height: 42px;
  border: 1px solid var(--green);
  border-radius: 12px;
  padding: 0 16px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(23 27 34 / 22%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.settings-backdrop.open {
  opacity: 1;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  display: flex;
  width: min(430px, 100vw);
  height: 100vh;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #f4f4f0;
  box-shadow: -20px 0 60px rgb(23 27 34 / 18%);
  transform: translateX(100%);
  transition: transform 0.18s ease;
}

.settings-drawer.open {
  transform: translateX(0);
}

.download-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgb(15 23 42 / 20%);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.download-backdrop.open {
  opacity: 1;
}

.download-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 80;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgb(15 23 42 / 18%);
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.98);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.download-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.download-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 20px 22px;
}

.download-header h2 {
  font-size: 20px;
}

.download-header p,
.download-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.download-options {
  display: grid;
  gap: 8px;
  padding: 18px 22px;
}

.download-section-title {
  padding: 0 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.download-format-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 8px;
}

.download-options label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fafbfc;
  cursor: pointer;
}

.download-options input {
  margin-top: 3px;
  accent-color: var(--green);
}

.download-options strong,
.download-options small {
  display: block;
}

.download-options small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.download-status {
  min-height: 20px;
  margin: 0;
  padding: 0 22px 16px;
}

.download-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 16px 22px 20px;
}

@media (max-width: 620px) {
  .download-format-options {
    grid-template-columns: 1fr;
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px;
}

.drawer-header h2 {
  font-size: 20px;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 24px 12px;
  border-radius: 14px;
  padding: 5px;
  background: #eceff2;
}

.settings-tab {
  height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.settings-tab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 6px 16px rgb(23 27 34 / 9%);
}

.settings-list {
  display: grid;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 24px 20px;
}

.column-choice {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-radius: 8px;
  padding: 2px 4px;
  color: var(--text);
  cursor: grab;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.12s ease,
    opacity 0.12s ease,
    transform 0.12s ease;
}

.column-choice:hover {
  background: rgb(23 27 34 / 4%);
}

.column-choice.dragging {
  background: #eceff2;
  opacity: 0.76;
  transform: scale(0.99);
}

.drag-handle {
  width: 14px;
  flex: 0 0 14px;
  color: #b6bdc6;
  cursor: grab;
  font-size: 15px;
  letter-spacing: -4px;
  line-height: 1;
  user-select: none;
}

.column-choice:active,
.column-choice:active .drag-handle {
  cursor: grabbing;
}

.column-choice input {
  flex: 0 0 auto;
  accent-color: var(--green);
}

.locked-choice {
  color: #a4abb4;
}

.locked-choice input {
  opacity: 0.45;
}

.locked-badge {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
  background: #f1f2f3;
  color: #8a929d;
  font-size: 11px;
  font-weight: 800;
}

.metric-groups {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.metric-groups span {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eceff2;
  color: #646c76;
  font-size: 12px;
  font-weight: 800;
}

.indicator-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
}

.indicator-card + .indicator-card {
  margin-top: 10px;
}

.indicator-locked {
  opacity: 0.58;
}

.indicator-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
}

.indicator-toggle input {
  accent-color: var(--green);
}

.indicator-thresholds {
  display: flex;
  gap: 6px 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.indicator-thresholds span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.indicator-thresholds input {
  width: 54px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
}

.dot-good,
.dot-warn,
.dot-bad {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.dot-good {
  background: var(--green);
}

.dot-warn {
  background: var(--yellow);
}

.dot-bad {
  background: var(--red);
}

.active-sort,
.table-note {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.stats-subtabs {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  background: #f7f8f6;
}

.stats-subtab {
  height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.stats-subtab.active {
  background: white;
  color: var(--text);
  box-shadow: 0 4px 12px rgb(23 27 34 / 8%);
}

.stats-data-panel {
  min-width: 0;
}

.stats-data-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stats-data-heading {
  display: flex;
  min-width: 0;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.stats-data-month-control {
  display: grid;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  gap: 7px;
  color: #737d8c;
  font-size: 12px;
  font-weight: 800;
}

.stats-data-month-control select {
  width: auto;
  min-width: 190px;
  max-width: 100%;
  min-height: 44px;
  field-sizing: content;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.stats-data-month-control select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(20 166 106 / 12%);
}

.stats-data-actions strong,
.stats-data-actions span {
  display: block;
}

.stats-data-actions span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.stats-data-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats-data-scroll {
  max-height: min(62vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
}

.stats-data-scroll th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.stats-days-table th:first-child,
.stats-days-table td:first-child {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
}

.stats-days-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.status-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  min-width: 104px;
  padding: 5px 10px;
  font-size: 12px;
}

.status-chip {
  padding: 4px 8px;
  font-size: 11px;
}

.status-pill-ready,
.status-chip-ready {
  background: #dcfae6;
  color: #067647;
}

.status-pill-warning,
.status-chip-warning {
  background: #fef0c7;
  color: #b54708;
}

.status-pill-error,
.status-chip-error {
  background: #fee4e2;
  color: #b42318;
}

.status-pill-loading {
  gap: 7px;
  background: #eaf4ff;
  color: #135f9f;
}

.status-pill-queued {
  background: #f0f2f5;
  color: #5f6b7a;
}

.stats-data-row-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: stats-data-row-spin 720ms linear infinite;
}

@keyframes stats-data-row-spin {
  to { transform: rotate(360deg); }
}

.status-pill-missing,
.status-chip-missing,
.status-pill-unknown,
.status-chip-unknown {
  background: #fff1cf;
  color: #9a6700;
}

.stats-days-table tr.stats-data-day-problem td {
  background: #fffaf0;
}

.stats-days-table tr.stats-data-day-problem:hover td {
  background: #fff3d8;
}

.stats-days-table tr[data-state="ready"] td {
  background: #f1fbf6;
}

.stats-days-table tr.is-loading td {
  background: #f2f7fc;
}

@media (prefers-reduced-motion: reduce) {
  .stats-data-row-spinner { animation: none; }
}

.stats-data-metrics {
  display: flex;
  min-width: 360px;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-note {
  border-left: 3px solid var(--yellow);
  padding-left: 10px;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfbf8;
  overscroll-behavior-x: contain;
}

#stats-view .table-wrap {
  width: 100%;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: right;
  white-space: nowrap;
}

th[data-width],
td[data-width] {
  box-sizing: border-box;
}

th[data-width="product"],
td[data-width="product"] {
  width: 260px;
  min-width: 240px;
  max-width: 300px;
}

th[data-width="sku"],
td[data-width="sku"] {
  width: 84px;
  min-width: 78px;
  max-width: 92px;
}

th[data-width="text"],
td[data-width="text"] {
  width: 104px;
  min-width: 92px;
  max-width: 128px;
}

th[data-width="small"],
td[data-width="small"],
th[data-width="percent"],
td[data-width="percent"],
th[data-width="number"],
td[data-width="number"] {
  width: 86px;
  min-width: 72px;
  max-width: 96px;
}

th[data-width="money"],
td[data-width="money"] {
  width: 118px;
  min-width: 104px;
  max-width: 132px;
}

.table-wrap tbody tr:hover td,
.stats-data-scroll tbody tr:hover td {
  background: #eef1f3;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: #eceff2;
}

.sort-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
}

.active-sort-button {
  color: #202226;
}

.active-sort-button .sort-icon {
  background: var(--yellow);
  color: #202226;
}

.sort-button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

th:first-child .sort-button {
  justify-content: flex-start;
}

.header-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-icon {
  flex: 0 0 auto;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #cbd1d8;
  border-radius: 6px;
  color: #8b95a1;
  font-size: 11px;
  line-height: 1;
}

.sorted-column {
  background: #e1e5e9;
}

.sorted-cell {
  background: #eef1f3;
}

tfoot td {
  position: sticky;
  bottom: 0;
  border-top: 2px solid #d0d5dd;
  background: #eceff2;
  font-weight: 800;
}

.table-check {
  display: none;
}

.preset-button {
  height: 42px;
  margin: 0 24px 20px;
  border: 1px solid var(--green);
  border-radius: 12px;
  background: white;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.product-name {
  max-width: 260px;
  white-space: normal;
  line-height: 1.35;
}

.chart-panel,
.comparison-table {
  min-width: 0;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgb(248 248 244 / 82%);
  box-shadow: 0 10px 28px rgb(23 27 34 / 6%);
}

.chart-header,
.comparison-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chart-controls,
.comparison-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.chart-controls label,
.comparison-controls label {
  display: grid;
  min-width: 150px;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-controls select,
.comparison-controls input,
.comparison-controls select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
  background: white;
  color: var(--text);
  font: inherit;
}

.metric-chart {
  min-height: 230px;
  border: 1px solid #d7dce2;
  border-radius: 16px;
  padding: 14px;
  background: #f3f4f2;
  color: var(--text);
}

.metric-chart svg {
  display: block;
  width: 100%;
  height: 190px;
}

.chart-grid {
  fill: none;
  stroke: rgb(23 27 34 / 14%);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: #d7b000;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #ffd200;
  stroke: white;
  stroke-width: 3;
}

.chart-label {
  fill: #6b7480;
  font-size: 11px;
}

.chart-caption,
.comparison-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metric-chart .chart-caption {
  color: #68717c;
}

.chart-empty {
  display: grid;
  min-height: 188px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.comparison-controls button,
.add-comparison {
  height: 38px;
  border: 1px solid var(--green);
  border-radius: 11px;
  padding: 0 12px;
  background: white;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.comparison-tables {
  display: grid;
  min-width: 0;
  gap: 16px;
  margin-top: 18px;
}

.add-comparison {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border-style: dashed;
  background: #f5f6f3;
  color: #5d4d00;
}

.compact-table {
  max-width: 100%;
  min-width: 0;
  margin-top: 12px;
}

.pill {
  display: inline-block;
  min-width: 64px;
  border-radius: 999px;
  padding: 4px 9px;
  text-align: center;
  font-weight: 700;
}

.good-pill {
  background: #dcfae6;
  color: #067647;
}

.warn-pill {
  background: #fef0c7;
  color: #b54708;
}

.bad-pill {
  background: #fee4e2;
  color: #b42318;
}

.muted-pill {
  background: #f2f4f7;
  color: var(--muted);
}

.empty-pill {
  background: #f2f4f7;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .cards,
  .self-check {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .heatmap-header {
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }
}

@media (min-width: 1500px) {
  #stats-view .table-wrap {
    max-width: none;
  }
}

/* Product design refresh: cohesive SaaS surface, no logic changes. */
:root {
  --bg: #eef1f3;
  --panel: #fbfaf5;
  --panel-strong: #6f7781;
  --text: #171b22;
  --muted: #69727e;
  --line: #d9dee3;
  --line-strong: #c7cdd4;
  --green: #18a66a;
  --yellow: #ffd21f;
  --yellow-soft: #ffd200;
  --red: #e34d43;
  --graphite: #6f7781;
  --surface: rgb(255 255 252 / 82%);
  --surface-solid: #fbfaf6;
  --shadow: 0 18px 55px rgb(25 30 37 / 9%);
  --shadow-soft: 0 8px 24px rgb(25 30 37 / 6%);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

body {
  min-height: 100vh;
  background: #e5e8eb;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricprecision;
}

.page {
  width: min(100% - 28px, 1840px);
  padding: 22px 0 56px;
}

body.stats-mode .page {
  width: min(100% - 20px, 1900px);
}

.hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 30px;
  padding: clamp(22px, 3vw, 38px);
  background: #f2f3f2;
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: -90px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border-radius: 999px;
  background: #d7dce2;
  content: "";
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

h1 {
  max-width: 900px;
  font-size: clamp(42px, 5.2vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

h2 {
  font-size: clamp(22px, 2vw, 30px);
}

h3 {
  letter-spacing: -0.025em;
}

.lead {
  max-width: 740px;
  margin-top: 14px;
  font-size: clamp(16px, 1.2vw, 19px);
}

.eyebrow {
  color: #806a00;
  letter-spacing: 0.18em;
}

.hero-card {
  min-height: 150px;
  border-color: rgb(255 255 255 / 72%);
  background: var(--surface-solid);
  box-shadow: 0 18px 45px rgb(25 30 37 / 9%);
  backdrop-filter: blur(16px);
}

.hero-card strong {
  letter-spacing: -0.045em;
}

.status {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none;
}

.status-ok {
  border-color: rgb(24 166 106 / 20%);
  background: rgb(232 248 239 / 82%);
  color: #0b6f46;
}

.status-warning,
.status-loading {
  border-color: rgb(255 210 31 / 42%);
  background: rgb(255 247 203 / 82%);
  color: #755f00;
}

.status-error {
  border-color: rgb(227 77 67 / 28%);
  background: rgb(255 238 237 / 86%);
  color: #a8322a;
}

.app-tabs {
  position: sticky;
  top: 10px;
  z-index: 20;
  margin-bottom: 16px;
  border-color: rgb(255 255 255 / 72%);
  border-radius: 18px;
  background: rgb(255 255 252 / 74%);
  box-shadow: 0 12px 32px rgb(25 30 37 / 8%);
  backdrop-filter: blur(18px);
}

.app-tab,
.secondary-button,
.add-comparison,
.comparison-controls button,
.preset-button,
.drawer-close,
.settings-tab {
  transition:
    transform 150ms var(--ease-out),
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.app-tab:active,
.secondary-button:active,
.add-comparison:active,
.comparison-controls button:active,
.preset-button:active,
.drawer-close:active,
.settings-tab:active {
  transform: scale(0.975);
}

.app-tab.active {
  background: var(--graphite);
  box-shadow: 0 10px 24px rgb(25 30 37 / 16%);
}

.cards {
  gap: 14px;
}

.metric-card,
.panel,
.chart-panel,
.comparison-table {
  border-color: rgb(255 255 255 / 68%);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.metric-card {
  min-height: 116px;
  border-radius: 24px;
  padding: 20px 22px;
}

.metric-card strong {
  margin-top: 8px;
  font-size: clamp(25px, 2vw, 34px);
}

.metric-card.accent {
  border-color: rgb(36 40 47 / 18%);
  background: #6f7781;
  box-shadow: 0 18px 42px rgb(25 30 37 / 16%);
}

.panel {
  border-radius: 28px;
  padding: clamp(18px, 2vw, 28px);
}

#stats-view {
  margin-top: 18px;
}

.panel-heading {
  margin-bottom: 16px;
}

.legend {
  border: 1px solid rgb(255 255 255 / 64%);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgb(255 255 252 / 62%);
}

.toolbar {
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar input,
.toolbar select,
.chart-controls select,
.comparison-controls input,
.comparison-controls select,
.indicator-thresholds input {
  border-color: #d7dde3;
  background: rgb(255 255 255 / 88%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.toolbar input:focus,
.toolbar select:focus,
.chart-controls select:focus,
.comparison-controls input:focus,
.comparison-controls select:focus,
.indicator-thresholds input:focus {
  outline: none;
  border-color: rgb(255 210 31 / 90%);
  box-shadow:
    0 0 0 4px rgb(255 210 31 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 70%);
}

.secondary-button {
  border-color: rgb(36 40 47 / 16%);
  background: var(--graphite);
  color: var(--yellow);
  box-shadow: 0 10px 24px rgb(25 30 37 / 12%);
}

.chart-panel {
  border-radius: 24px;
  padding: 18px;
}

.metric-chart {
  min-height: 236px;
  border-color: rgb(255 255 255 / 74%);
  border-radius: 22px;
  padding: 16px 18px;
  background: #f3f4f2;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 82%),
    0 12px 28px rgb(25 30 37 / 5%);
}

.chart-line {
  stroke: #e0b800;
  stroke-width: 3.25;
  filter: drop-shadow(0 4px 8px rgb(224 184 0 / 20%));
}

.chart-grid {
  stroke: rgb(25 30 37 / 12%);
}

.chart-point {
  fill: var(--yellow);
  stroke: #f3f4f2;
}

.table-note,
.active-sort {
  color: #76808b;
  font-size: 12px;
}

.table-note {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  margin-bottom: 12px;
  border-left: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #eceff2;
  color: #6f5b00;
}

.table-wrap,
.heatmap-table-wrap {
  border-color: var(--line);
  border-radius: 20px;
  background: var(--surface-solid);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 72%),
    0 14px 34px rgb(25 30 37 / 6%);
}

th {
  background: #eef1f3;
  color: #66707c;
  font-weight: 800;
}

td {
  background: rgb(255 255 252 / 72%);
}

tbody tr {
  transition: background-color 140ms ease;
}

.table-wrap tbody tr:hover td,
.stats-data-scroll tbody tr:hover td {
  background: #eef1f3;
}

tfoot td {
  border-top-color: #cbd2d9;
  background: #eef1f3;
}

.sort-icon {
  border-color: #c9d0d8;
  background: rgb(255 255 255 / 56%);
}

.active-sort-button .sort-icon {
  border-color: rgb(255 210 31 / 70%);
}

.pill {
  font-weight: 800;
}

.heatmaps {
  gap: 24px;
}

.heatmap-card {
  border-color: rgb(255 255 255 / 68%);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
}

.heatmap-badge {
  background: var(--graphite);
}

.heat-cell {
  transition:
    box-shadow 140ms ease,
    filter 140ms ease;
}

.heat-cell[data-status="spend-without-base"] {
  font-weight: 900;
}

.heat-cell[data-status="no-sales-data"] {
  color: #8a94a3;
}

@media (hover: hover) and (pointer: fine) {
  .heatmap-table .heat-cell:hover {
    position: relative;
    z-index: 4;
    box-shadow: inset 0 0 0 2px rgb(17 24 39 / 14%);
    filter: saturate(1.08);
  }

  .secondary-button:hover,
  .add-comparison:hover,
  .comparison-controls button:hover,
  .preset-button:hover {
    box-shadow: 0 12px 28px rgb(25 30 37 / 11%);
    transform: translateY(-1px);
  }

  .app-tab:hover:not(.active),
  .settings-tab:hover:not(.active) {
    background: rgb(255 255 255 / 62%);
  }
}

.self-check {
  border-color: rgb(255 210 31 / 38%);
  border-radius: 22px;
  background: #eef1f3;
}

.settings-backdrop {
  background: rgb(25 30 37 / 28%);
  backdrop-filter: blur(4px);
}

.settings-drawer {
  width: min(460px, 100vw);
  border-left-color: rgb(255 255 255 / 58%);
  background: #f0f2f2;
  box-shadow: -28px 0 80px rgb(25 30 37 / 22%);
  transition: transform 220ms var(--ease-out);
}

.drawer-header {
  background: rgb(255 255 252 / 62%);
}

.drawer-close {
  border-color: rgb(24 166 106 / 26%);
}

.settings-tabs {
  background: #e9edf0;
}

.settings-tab.active {
  box-shadow: 0 8px 18px rgb(25 30 37 / 8%);
}

.column-choice,
.indicator-card {
  border: 1px solid transparent;
}

.column-choice:hover {
  border-color: rgb(255 210 31 / 22%);
  background: rgb(255 255 255 / 64%);
}

.column-choice.dragging {
  border-color: rgb(255 210 31 / 55%);
  background: #eceff2;
  box-shadow: 0 10px 24px rgb(25 30 37 / 8%);
}

.indicator-card {
  border-color: rgb(255 255 255 / 72%);
  background: rgb(255 255 252 / 72%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%);
}

.add-comparison {
  border-color: rgb(24 166 106 / 36%);
  background: #f5f6f3;
}

@media (max-width: 980px) {
  .page,
  body.stats-mode .page {
    width: min(100% - 18px, 1900px);
  }

  .hero {
    padding: 22px;
  }

  .status {
    display: flex;
    border-radius: 16px;
  }

  .app-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .app-tab {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Hard rule from Ivan: no soft color washes, no pastel yellow surfaces. */
:root {
  --bg: #e5e8eb;
  --panel: #f7f7f4;
  --panel-strong: #6f7781;
  --muted: #66717d;
  --line: #d0d6dc;
  --line-strong: #b9c1c9;
  --yellow: #ffd200;
  --yellow-soft: #ffd200;
  --surface: #f7f7f4;
  --surface-solid: #f7f7f4;
  --graphite: #6f7781;
}

body {
  background-color: #e5e8eb;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23cfd5da' stroke-opacity='0.5' stroke-width='1'%3E%3Cpath d='M0 0h18M0 9h18M0 18h18M0 0v18M9 0v18M18 0v18'/%3E%3C/g%3E%3Ccircle cx='9' cy='9' r='1' fill='%23bfc6cd' fill-opacity='0.28'/%3E%3C/svg%3E");
}

.hero,
.hero-card,
.metric-card,
.metric-card.accent,
.panel,
.status,
.app-tabs,
.heatmap-card,
.self-check,
.secondary-button,
.app-tab.active,
.heatmap-badge,
.settings-drawer,
.metric-chart,
.chart-panel,
.comparison-table,
.add-comparison,
.table-note,
.indicator-card,
.drawer-header {
  background-image: none !important;
}

.hero {
  background-color: #f2f3f2;
}

.hero::after {
  display: none;
}

.hero-card,
.metric-card,
.panel,
.chart-panel,
.comparison-table,
.heatmap-card,
.indicator-card {
  background-color: #f8f8f5;
}

.status-ok {
  background-color: #edf3ef;
  color: #145c3d;
}

.status-warning,
.status-loading {
  border-color: #c7ccd2;
  background-color: #eef1f3;
  color: #4f5965;
}

.status-error {
  background-color: #f4eceb;
}

.app-tabs,
.drawer-header {
  background-color: #f7f7f4;
}

.metric-card.accent,
.secondary-button,
.app-tab.active,
.heatmap-badge {
  background-color: var(--graphite);
  border-color: #626a73;
  color: #fff;
}

.secondary-button,
.app-tab.active {
  box-shadow:
    inset 0 -3px 0 rgb(255 210 0 / 85%),
    0 8px 18px rgb(25 30 37 / 10%);
}

.metric-card.accent strong {
  color: var(--yellow);
}

.heatmap-badge {
  box-shadow: inset 0 -2px 0 rgb(255 210 0 / 78%);
}

.metric-card.accent span {
  color: #eef1f3;
}

.metric-chart {
  background-color: #f3f4f2;
}

.table-note {
  background-color: #eceff2;
  color: #5c6672;
}

.self-check {
  border-color: #cfd5dc;
  background-color: #eef1f3;
}

.settings-drawer {
  background-color: #f0f2f2;
}

.add-comparison {
  background-color: #f5f6f3;
  color: #5c6672;
}

.column-choice.dragging {
  background-color: #eceff2;
}

.table-wrap tbody tr:hover td,
.stats-data-scroll tbody tr:hover td,
.sorted-cell {
  background-color: #eef1f3;
}

.sorted-column {
  background-color: #e1e5e9;
}

.active-sort-button .sort-icon {
  background-color: var(--yellow);
}

.heat-warn,
.warn-pill {
  background-color: #ffe26a;
  color: #3f3500;
}

/* Yoolip-like clean product shell: white SaaS, green accents, no texture. */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #12a66a;
  --text: #111827;
  --muted: #7b8492;
  --line: #e8edf2;
  --line-strong: #d8dfe7;
  --green: #14a66a;
  --yellow: #f5b700;
  --yellow-soft: #fff0b8;
  --red: #ef5b5b;
  --graphite: #eef2f5;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --shadow: 0 10px 28px rgb(15 23 42 / 5%);
  --shadow-soft: 0 6px 18px rgb(15 23 42 / 4%);
}

body {
  min-height: 100vh;
  background: #ffffff;
  background-image: none;
  color: var(--text);
}

body.auth-loading .side-nav,
body.auth-loading .mobile-nav-toggle,
body.auth-loading .mobile-menu-backdrop,
body.auth-loading .page,
body.needs-login .side-nav,
body.needs-login .mobile-nav-toggle,
body.needs-login .mobile-menu-backdrop,
body.needs-login .page,
body.needs-login .settings-backdrop,
body.needs-login .settings-drawer,
body.needs-login .download-backdrop,
body.needs-login .download-modal,
body.needs-password-change .side-nav,
body.needs-password-change .mobile-nav-toggle,
body.needs-password-change .mobile-menu-backdrop,
body.needs-password-change .page,
body.needs-password-change .settings-backdrop,
body.needs-password-change .settings-drawer,
body.needs-password-change .download-backdrop,
body.needs-password-change .download-modal {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ffffff;
}

.login-panel {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgb(23 27 34 / 10%);
}

.login-brand {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: #1f2937;
  font-size: 20px;
  font-weight: 900;
}

.login-brand sup {
  margin-left: -4px;
  color: var(--green);
  font-size: 10px;
}

.login-heading {
  margin-bottom: 22px;
}

.login-heading h1 {
  color: var(--text);
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: 0;
}

.login-heading p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.login-panel label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.login-panel input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: #f9fafb;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.login-panel input:focus {
  border-color: var(--green);
  outline: 2px solid rgb(32 166 107 / 18%);
}

.login-panel .primary-button {
  width: 100%;
  margin-top: 4px;
}

.login-text-button {
  display: block;
  width: fit-content;
  margin: 2px auto 12px;
  border: 0;
  padding: 6px 8px;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.login-panel .primary-button + .login-text-button {
  margin-top: 10px;
  margin-bottom: 0;
}

.login-text-button:hover,
.login-text-button:focus-visible {
  text-decoration: underline;
}

.login-status {
  min-height: 20px;
  margin-top: 12px;
  color: #8a94a3;
  font-size: 13px;
  line-height: 1.45;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 45;
  display: flex;
  width: 176px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  background: #ffffff;
}

.mobile-nav-toggle,
.mobile-menu-backdrop {
  display: none;
}

.brand {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #1f2937;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.brand sup {
  margin-left: -4px;
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0;
}

.store-card {
  display: grid;
  gap: 2px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: #475467;
}

.store-card strong {
  color: #273142;
  font-size: 13px;
}

.store-card span {
  color: #99a3b1;
  font-size: 12px;
  font-weight: 700;
}

.session-card {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 44px;
  gap: 10px;
  min-height: 44px;
  align-items: center;
  margin-top: 0;
  border-top: 1px solid var(--line);
  padding: 5px 8px;
  background: #ffffff;
}

.session-card strong {
  color: #273142;
  font-size: 13px;
  line-height: 1.15;
}

.session-card span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.session-avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 900;
}

.session-user {
  display: grid;
  min-width: 0;
  gap: 2px;
  justify-self: center;
  text-align: center;
}

.session-user span,
.session-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-logout {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgb(217 45 32 / 14%);
  border-radius: 50%;
  padding: 0;
  background: #fffafa;
  color: #d98a8a;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms var(--ease-out);
  justify-self: center;
}

.side-logout > svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-logout:hover {
  background: #fff1f0;
  color: #d92d20;
}

.side-logout:active {
  transform: scale(0.94);
}

.side-menu {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.side-menu-muted {
  margin-top: auto;
  margin-bottom: 16px;
}

.side-link {
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  background: transparent;
  color: #667085;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms var(--ease-out);
}

.side-link.active {
  background: #eaf8f0;
  color: var(--green);
}

@media (hover: hover) and (pointer: fine) {
  .side-link:hover {
    background: #f4f7f8;
    color: #273142;
  }
}

.page,
body.stats-mode .page {
  width: auto;
  max-width: none;
  margin: 0 0 0 176px;
  padding: 14px 24px 56px;
}

.future-view {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.future-header {
  max-width: 760px;
  margin-bottom: 18px;
}

.future-header h2 {
  margin: 4px 0 8px;
  color: var(--text);
  font-size: 28px;
  letter-spacing: -0.03em;
}

.future-header p {
  color: #667085;
  line-height: 1.55;
}

.future-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.future-card {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
}

.future-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border-radius: 999px;
  background: #eaf8f0;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.future-card h3 {
  margin: 18px 0 8px;
  color: var(--text);
  font-size: 18px;
}

.future-card p {
  color: #667085;
  line-height: 1.5;
}

.cabinet-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.cabinet-header h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 28px;
  letter-spacing: -0.03em;
}

.cabinet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cabinet-tile,
.cabinet-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.cabinet-tile {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 16px;
}

.cabinet-tile span,
.cabinet-tile small,
.cabinet-section-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.cabinet-tile strong {
  min-width: 0;
  color: var(--text);
  font-size: 20px;
  overflow-wrap: anywhere;
}

@media (max-width: 1240px) {
  .cabinet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.status-inline {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.status-inline-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.status-inline > span:not(.status-inline-icon) {
  min-width: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  overflow-wrap: anywhere;
}

.status-inline-success .status-inline-icon {
  background: #dcfae6;
  color: #067647;
}

.status-inline-pending .status-inline-icon {
  background: #fef0c7;
  color: #b54708;
}

.status-inline-danger .status-inline-icon {
  background: #fee4e2;
  color: #b42318;
}

.status-inline-muted .status-inline-icon {
  background: #f2f4f7;
  color: #667085;
}

.cabinet-section {
  margin-top: 14px;
  padding: 16px;
}

.cabinet-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cabinet-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.permission-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permission-item {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8faf9;
}

.permission-item span {
  min-width: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

.permission-item strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
}

.permission-status {
  gap: 6px;
}

.permission-status .status-inline-icon {
  width: 18px;
  height: 18px;
  font-size: 11px;
}

.permission-item.is-granted strong {
  background: #dcfae6;
  color: #067647;
}

.permission-item.is-denied {
  background: #f7f7f5;
}

.permission-item.is-denied strong {
  background: #f2f4f7;
  color: #667085;
}

.shop-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.shop-name-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.shop-name-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: #f8faf9;
  color: var(--text);
  font: inherit;
}

.shop-name-form input:focus {
  border-color: var(--green);
  outline: 2px solid rgb(32 166 107 / 18%);
}

.shop-name-form input:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.shop-name-message {
  min-height: 18px;
  grid-column: 1 / -1;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
}

.ozon-connection-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.ozon-connection-block + .ozon-connection-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.ozon-connection-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ozon-connection-title strong {
  font-size: 15px;
}

.ozon-connection-title span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.cabinet-section-head.compact {
  margin-bottom: 10px;
}

.ozon-connection-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.ozon-connection-form input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: #f8faf9;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.ozon-connection-form input:focus {
  border-color: var(--green);
  outline: 2px solid rgb(32 166 107 / 18%);
}

.ozon-connection-form input:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.ozon-connection-form .primary-button {
  min-width: 190px;
}

.ozon-connection-message {
  min-height: 18px;
  grid-column: 1 / -1;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
}

.audit-log-wrap {
  max-height: 420px;
  margin-top: 0;
}

.audit-log-table {
  min-width: 900px;
}

.audit-log-table td:last-child {
  max-width: 360px;
  color: #667085;
  overflow-wrap: anywhere;
}

.cpc-history-section {
  width: min(100%, 1160px);
  margin: 18px auto 0;
}

.cpc-history-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.cpc-history-wrap {
  max-height: 360px;
  margin-top: 0;
}

.cpc-history-table {
  min-width: 980px;
}

.cpc-history-table td {
  vertical-align: top;
}

.cpc-history-table td:nth-child(2) {
  min-width: 190px;
}

.cpc-history-table td:nth-child(7) {
  max-width: 320px;
  color: #667085;
  overflow-wrap: anywhere;
}

.cpc-history-table strong,
.cpc-history-table small {
  display: block;
}

.cpc-history-table small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.cpc-view {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.cpc-bid-wrap {
  margin-top: 16px;
}

.danger-button {
  border-color: #f04438;
  background: #fff5f5;
  color: #b42318;
}

.danger-button.is-active {
  background: #b42318;
  color: #ffffff;
}

.cpc-feedback {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 1160px);
  margin: 14px auto 0;
  padding: 14px 16px;
  border: 1px solid #b7e4cf;
  border-radius: 8px;
  background: #f3fbf7;
  color: var(--text);
  box-shadow: 0 12px 28px rgb(16 24 40 / 10%);
}

.cpc-feedback[hidden] {
  display: none;
}

.cpc-feedback strong {
  display: block;
  margin-bottom: 4px;
  color: #067647;
  font-size: 14px;
}

.cpc-feedback p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
}

.cpc-feedback ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.cpc-feedback.is-error {
  border-color: #fecdca;
  background: #fff5f5;
}

.cpc-feedback.is-error strong {
  color: #b42318;
}

.cpc-feedback.is-warning {
  border-color: #fedf89;
  background: #fffbeb;
}

.cpc-feedback.is-warning strong {
  color: #b54708;
}

.cpc-feedback .icon-button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: #667085;
  font-size: 20px;
  line-height: 1;
}

.cpc-search-panel {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 12px;
  width: min(100%, 1160px);
  margin: 14px auto 0;
  padding: 12px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
}

.cpc-search-field {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
}

.cpc-search-field span,
.cpc-search-count {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.cpc-search-field input {
  width: 100%;
  height: 36px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  background: #ffffff;
}

.cpc-search-field input:focus {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgb(46 125 50 / 12%);
}

.cpc-search-count {
  display: none;
}

.cpc-search-empty {
  width: min(100%, 1160px);
  margin: 12px auto 0;
  padding: 14px;
  border: 1px solid #f3b4b4;
  border-radius: 8px;
  color: #b42318;
  font-size: 13px;
  font-weight: 800;
  background: #fff7f7;
}

.cpc-product-list {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.cpc-product-card {
  display: grid;
  gap: 16px;
  width: min(100%, 1160px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgb(16 24 40 / 5%);
}

.cpc-product-main {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 360px);
  gap: 14px;
  align-items: start;
  width: min(100%, 1040px);
  justify-self: center;
}

.cpc-product-title,
.cpc-metric,
.cpc-stat-card,
.cpc-stat-tile {
  min-width: 0;
}

.cpc-product-title strong,
.cpc-product-title small,
.cpc-metric span,
.cpc-metric strong,
.cpc-metric small {
  display: block;
}

.cpc-product-title strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.cpc-product-title small,
.cpc-metric span,
.cpc-metric small {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.cpc-metric strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.cpc-stat-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #f8fafc;
}

.cpc-stat-card-title {
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.cpc-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cpc-stat-tile {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 9px 10px;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  background: #ffffff;
}

.cpc-stat-tile span,
.cpc-stat-tile small {
  display: block;
  color: #667085;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.cpc-stat-tile strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.cpc-stat-tile em {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}

.cpc-drr-excellent,
.cpc-drr-good {
  border-color: #b7e4cf;
  background: #f3fbf7;
}

.cpc-drr-excellent em,
.cpc-drr-good em {
  background: #dff8ea;
  color: #067647;
}

.cpc-drr-normal {
  border-color: #f3d68a;
  background: #fffaf0;
}

.cpc-drr-normal em {
  background: #fff1a6;
  color: #6d5800;
}

.cpc-drr-poor,
.cpc-drr-critical {
  border-color: #fecdca;
  background: #fff7f7;
}

.cpc-drr-poor em,
.cpc-drr-critical em {
  background: #fee4e2;
  color: #b42318;
}

.cpc-drr-empty em {
  background: #f2f4f7;
  color: #667085;
}

.cpc-recommendation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: min(100%, 1040px);
  justify-self: center;
  padding: 12px 14px;
  border: 1px solid #98d3a4;
  border-radius: 8px;
  background: #f3fbf5;
}

.cpc-recommendation-panel.is-warning {
  border-color: #f3d68a;
  background: #fffbeb;
}

.cpc-recommendation-panel.is-error {
  border-color: #f3b4b4;
  background: #fff7f7;
}

.cpc-recommendation-panel.is-muted {
  border-color: #d0d5dd;
  background: #f8fafc;
}

.cpc-recommendation-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.cpc-recommendation-heading > span {
  color: #175436;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.cpc-recommendation-panel.is-warning .cpc-recommendation-heading > span {
  color: #8a5a00;
}

.cpc-recommendation-panel.is-error .cpc-recommendation-heading > span {
  color: #9f1d1d;
}

.cpc-recommendation-panel.is-muted .cpc-recommendation-heading > span {
  color: #475467;
}

.cpc-recommendation-heading .pill {
  display: inline-flex;
  width: fit-content;
}

.cpc-recommendation-panel p,
.cpc-recommendation-panel small {
  margin: 0;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.cpc-recommendation-panel p {
  color: #1d2939;
  font-size: 13px;
  font-weight: 800;
}

.cpc-settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(170px, 1fr)) minmax(120px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.cpc-rule-panel {
  display: grid;
  gap: 14px;
  width: min(100%, 1040px);
  justify-self: center;
}

.cpc-rule-top {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(190px, 220px) minmax(260px, 340px);
  gap: 12px;
  align-items: start;
  justify-content: center;
}

.cpc-rules-details {
  width: min(100%, 1040px);
  justify-self: center;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #ffffff;
}

.cpc-rules-details[open] {
  box-shadow: 0 8px 18px rgb(16 24 40 / 4%);
}

.cpc-rules-details::details-content {
  block-size: 0;
  opacity: 0;
  overflow: clip;
  transition:
    block-size 220ms var(--ease-out),
    opacity 180ms ease;
  transition-behavior: allow-discrete;
}

.cpc-rules-details[open]::details-content {
  block-size: auto;
  opacity: 1;
}

.cpc-rules-details[open] > .cpc-rule-workspace {
  animation: cpc-details-in 190ms var(--ease-out);
}

@keyframes cpc-details-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports not selector(::details-content) {
  .cpc-rules-details:not([open]) > .cpc-rule-workspace {
    display: none;
  }
}

.cpc-rules-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  min-height: auto;
  padding: 10px 12px;
  color: #1d2939;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.cpc-rules-details > summary::-webkit-details-marker {
  display: none;
}

.cpc-rules-details > summary:focus {
  outline: none;
}

.cpc-rules-details > summary:focus-visible {
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgb(46 125 50 / 24%);
}

.cpc-rules-details > summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1;
  color: var(--green);
  font-size: 18px;
  line-height: 1;
}

.cpc-rules-details[open] > summary {
  border-bottom: 1px solid #eaecf0;
}

.cpc-rules-details[open] > summary::after {
  content: "-";
}

.cpc-rules-details > summary small {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-left: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

.cpc-rules-details.is-campaign-locked {
  border-color: #d0d5dd;
  background: #f8fafc;
}

.cpc-rules-details.is-campaign-blocked {
  border-color: #d0d5dd;
  background: #f8fafc;
}

.cpc-rules-details.is-campaign-locked > summary {
  cursor: not-allowed;
}

.cpc-rules-details.is-campaign-locked > summary::after {
  content: "×";
  color: #98a2b3;
}

.cpc-rules-details.is-campaign-blocked > summary::after,
.cpc-rules-details.is-campaign-blocked > summary small {
  color: #667085;
}

.cpc-rule-workspace {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 500px);
  gap: 12px;
  align-items: stretch;
  justify-content: center;
  padding: 12px;
}

.cpc-rule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.cpc-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(130px, 0.55fr);
  gap: 14px;
  align-items: start;
}

.cpc-rule-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 500px;
  justify-self: stretch;
}

.cpc-rule-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.cpc-rule-card.is-invalid {
  border-color: #d92d20;
  background: #fff1f0;
  box-shadow: inset 0 0 0 1px rgb(217 45 32 / 18%);
}

.cpc-rule-card.is-locked .cpc-rule-note {
  color: #667085;
}

.cpc-rule-card .cpc-setting-title {
  margin-bottom: 0;
}

.cpc-rule-card .cpc-field,
.cpc-rule-card .cpc-field-row {
  max-width: 360px;
}

.cpc-rule-card-bad {
  border-color: #fecdca;
  background: #fff7f7;
}

.cpc-rule-card-normal {
  border-color: #f3d68a;
  background: #fffbeb;
}

.cpc-rule-card-good {
  border-color: #a8d8b0;
  background: #f4fbf6;
}

.cpc-rule-card-bad .cpc-setting-title {
  color: #b42318;
}

.cpc-rule-card-normal .cpc-setting-title {
  color: #8a5a00;
}

.cpc-rule-card-good .cpc-setting-title {
  color: #166534;
}

.cpc-rule-note {
  min-height: 20px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.cpc-rule-static-note {
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.cpc-rule-errors {
  min-height: 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.cpc-settings-group {
  min-width: 0;
}

.cpc-settings-details {
  align-self: stretch;
  width: 100%;
  border: 1px solid #d8e1ea;
  border-radius: 8px;
  background: #ffffff;
}

.cpc-settings-details.is-incomplete {
  border-color: #8ec5ff;
  background: #f4f9ff;
  box-shadow: inset 0 0 0 1px rgb(11 111 203 / 10%);
}

.cpc-settings-details.is-warning {
  border-color: #f3d68a;
  background: #fffbeb;
}

.cpc-settings-details.is-invalid {
  border-color: #d92d20;
  background: #fff1f0;
}

.cpc-settings-heading {
  display: grid;
  gap: 4px;
  padding: 10px 12px 0;
  color: #1d2939;
  font-size: 13px;
  font-weight: 800;
}

.cpc-settings-heading span,
.cpc-settings-heading small {
  display: block;
}

.cpc-settings-heading small {
  margin-left: 0;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

.cpc-settings-alert {
  min-height: 0;
  padding: 0 12px;
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.cpc-settings-alert:not(:empty) {
  padding-top: 8px;
  padding-bottom: 4px;
}

.cpc-settings-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px 12px;
}

.cpc-settings-section {
  min-width: 0;
}

.cpc-setting-title {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.cpc-field,
.cpc-toggle,
.cpc-toggle-field,
.cpc-manual-apply-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-bottom: 10px;
}

.cpc-toggle-field[hidden],
.cpc-manual-apply-field[hidden] {
  display: none;
}

.cpc-field span,
.cpc-toggle-field > span,
.cpc-manual-apply-field > span,
.cpc-toggle-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.cpc-field-help {
  display: block;
  min-height: 16px;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.cpc-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cpc-field-row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cpc-field-row-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cpc-field-row-single {
  grid-template-columns: minmax(0, 1fr);
}

.cpc-settings-details .cpc-field-row,
.cpc-settings-details .cpc-field-row-three,
.cpc-settings-details .cpc-field-row-four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpc-settings-details .cpc-field-row-single,
.cpc-settings-details .cpc-field-wide {
  grid-column: 1 / -1;
}

.cpc-settings-details .cpc-field {
  margin-bottom: 0;
}

.cpc-product-card input,
.cpc-product-card select {
  width: 100%;
  min-width: 96px;
  height: 34px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.cpc-product-card input {
  padding: 0 10px;
}

.cpc-input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
}

.cpc-product-card .cpc-input-suffix input {
  min-width: 0;
  border-radius: 8px 0 0 8px;
}

.cpc-input-suffix-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #f6f7f9;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.cpc-product-card select {
  padding: 0 28px 0 10px;
}

.cpc-campaign-field {
  position: relative;
}

.cpc-campaign-field.is-open {
  z-index: 20;
}

.cpc-campaign-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12px;
  align-items: center;
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.cpc-campaign-trigger::after {
  content: "";
  width: 0;
  height: 0;
  justify-self: end;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid #667085;
}

.cpc-campaign-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpc-campaign-trigger:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(46 125 50 / 14%);
}

.cpc-campaign-trigger:disabled {
  border-color: #e4e7ec;
  background: #f9fafb;
  color: #98a2b3;
  cursor: not-allowed;
}

.cpc-campaign-field.is-blocked .cpc-campaign-trigger:disabled {
  border-color: #e4e7ec;
  background: #f9fafb;
  color: #98a2b3;
}

.cpc-campaign-field.is-blocked .cpc-field-help {
  color: #667085;
}

.cpc-campaign-menu {
  position: absolute;
  z-index: 25;
  top: 55px;
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgb(16 24 40 / 14%);
}

.cpc-campaign-menu[hidden] {
  display: none;
}

.cpc-campaign-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
}

.cpc-campaign-option:hover {
  background: #f4f7f8;
}

.cpc-campaign-option input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-top: 2px;
}

.cpc-campaign-option span,
.cpc-campaign-option strong,
.cpc-campaign-option small {
  display: block;
  min-width: 0;
}

.cpc-campaign-option strong {
  color: #1d2939;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cpc-campaign-option small {
  margin-top: 3px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.cpc-campaign-option.is-unavailable {
  background: #fffbeb;
}

.cpc-campaign-empty {
  padding: 8px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.cpc-field.is-disabled span {
  color: #98a2b3;
}

.cpc-field.is-disabled input {
  border-color: #e4e7ec;
  background: #f9fafb;
  color: #98a2b3;
  cursor: not-allowed;
}

.cpc-field.is-disabled select {
  border-color: #e4e7ec;
  background: #f9fafb;
  color: #98a2b3;
  cursor: not-allowed;
}

.cpc-field.is-disabled .cpc-campaign-trigger {
  border-color: #e4e7ec;
  background: #f9fafb;
  color: #98a2b3;
  cursor: not-allowed;
}

.cpc-field.is-needed span {
  color: #0b6fcb;
}

.cpc-field.is-needed input {
  border-color: #8ec5ff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgb(11 111 203 / 8%);
}

.cpc-field.is-needed .cpc-campaign-trigger {
  border-color: #8ec5ff;
  box-shadow: 0 0 0 3px rgb(11 111 203 / 8%);
}

.cpc-field.is-invalid span {
  color: #b42318;
}

.cpc-field.is-invalid input,
.cpc-field.is-invalid select {
  border-color: #d92d20;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgb(217 45 32 / 10%);
}

.cpc-field.is-invalid .cpc-campaign-trigger {
  border-color: #d92d20;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgb(217 45 32 / 10%);
}

.cpc-toggle {
  position: relative;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 28px;
  cursor: pointer;
}

.cpc-toggle-strong {
  min-height: 36px;
  margin-bottom: 0;
}

.cpc-toggle.is-disabled {
  cursor: default;
  opacity: 0.72;
}

.cpc-toggle-field.is-recommendation-only .cpc-toggle {
  display: none;
}

.cpc-rule-top .cpc-field,
.cpc-rule-top .cpc-toggle-field,
.cpc-rule-top .cpc-manual-apply-field,
.cpc-settings-group .cpc-field:last-child {
  margin-bottom: 0;
}

.cpc-toggle input {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  opacity: 0;
}

.cpc-toggle-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.cpc-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(16 24 40 / 24%);
  transition: transform 0.16s ease;
}

.cpc-toggle input:checked + .cpc-toggle-track {
  background: var(--green);
}

.cpc-toggle input:focus-visible + .cpc-toggle-track {
  box-shadow: 0 0 0 3px rgb(46 125 50 / 18%);
}

.cpc-toggle input:checked + .cpc-toggle-track .cpc-toggle-thumb {
  transform: translateX(20px);
}

.cpc-settings-save {
  align-self: stretch;
}

.cpc-rules-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  border-top: 1px solid #edf0f4;
  padding-top: 12px;
}

.cpc-rules-actions .compact-button {
  width: auto;
  min-width: 156px;
}

.cpc-rules-actions .cpc-manual-apply-field {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
}

.cpc-rules-actions .cpc-manual-apply-field[hidden] {
  display: none;
}

.compact-button {
  width: 100%;
  min-width: 104px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.cpc-product-card .compact-button:disabled {
  border-color: #d0d5dd;
  background: #f2f4f7;
  color: #98a2b3;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .heatmap-body {
    grid-template-columns: 1fr;
  }

  .heatmap-hour-detail {
    position: static;
  }

  .cpc-product-main,
  .cpc-settings-grid,
  .cpc-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cpc-rule-top,
  .cpc-rule-grid,
  .cpc-rule-workspace {
    grid-template-columns: 1fr;
  }

  .cpc-rule-top {
    width: 100%;
    max-width: 760px;
    justify-self: center;
  }

  .cpc-rules-details {
    width: 100%;
    max-width: 760px;
  }

  .cpc-rule-cards,
  .cpc-settings-details {
    justify-self: center;
    max-width: 520px;
  }

  .cpc-settings-details {
    align-self: start;
  }

  .cpc-settings-save {
    align-self: end;
  }
}

@media (max-width: 680px) {
  .heatmap-hour-detail-grid {
    grid-template-columns: 1fr;
  }

  .heat-cell {
    width: 38px;
    height: 38px;
    font-size: 10px;
  }

  .cpc-search-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .cpc-search-field {
    width: 100%;
  }

  .cpc-product-main,
  .cpc-settings-grid,
  .cpc-rule-top,
  .cpc-rule-grid,
  .cpc-action-grid,
  .cpc-rule-cards,
  .cpc-rule-workspace,
  .cpc-settings-details .cpc-field-row,
  .cpc-settings-details .cpc-field-row-three,
  .cpc-settings-details .cpc-field-row-four,
  .cpc-field-row-three,
  .cpc-field-row-four,
  .cpc-field-row {
    grid-template-columns: 1fr;
  }

  .cpc-rule-top,
  .cpc-settings-details,
  .cpc-rule-cards,
  .cpc-rule-card .cpc-field,
  .cpc-rule-card .cpc-field-row {
    max-width: none;
  }

  .cpc-rule-cards {
    width: 100%;
  }

  .cpc-product-card {
    padding: 14px;
  }

  .cpc-rules-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cpc-rules-actions .compact-button,
  .cpc-rules-actions .cpc-manual-apply-field {
    width: 100%;
  }

  .cpc-rules-details > summary {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: auto;
    padding: 10px 12px;
  }

  .cpc-rules-details > summary::after {
    grid-column: 2;
  }

  .cpc-rules-details > summary small {
    grid-column: 1 / -1;
    grid-row: 2;
    text-align: left;
  }
}

.audit-result {
  display: inline-flex;
  min-width: 74px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 800;
}

.audit-result-success {
  background: #dcfae6;
  color: #067647;
}

.audit-result-warning {
  background: #fef0c7;
  color: #b54708;
}

.hero {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.hero .eyebrow,
.hero h1,
.hero .lead {
  display: none;
}

.hero-card {
  min-height: 40px;
  margin-left: auto;
  border-radius: 12px;
  padding: 8px 12px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border-color: var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.hero-card .muted {
  font-size: 12px;
  font-weight: 800;
}

.hero-card strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.hero-card small {
  display: none;
}

.status {
  min-height: 34px;
  margin: 0 0 12px;
  border-color: #cceedd;
  background: #eefaf4;
  color: #087348;
  font-size: 12px;
}

.app-tabs {
  display: none !important;
}

.app-tab {
  min-width: 0;
}

.app-tabs {
  position: static;
  gap: 4px;
  margin-bottom: 14px;
  border: 0;
  border-radius: 12px;
  padding: 3px;
  background: #f4f6f8;
  box-shadow: none;
  backdrop-filter: none;
}

.app-tab {
  min-width: 112px;
  height: 32px;
  border-radius: 10px;
  color: #7b8492;
  font-size: 13px;
}

.app-tab.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 2px 8px rgb(15 23 42 / 8%);
}

.cards {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card,
.metric-card.accent {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  color: var(--text);
  box-shadow: none;
}

.metric-card span,
.metric-card.accent span {
  color: #8a94a3;
  font-size: 12px;
}

.metric-card strong,
.metric-card.accent strong {
  margin-top: 6px;
  color: #111827;
  font-size: 28px;
}

.metric-card.accent strong {
  color: #0f766e;
}

.panel,
#stats-view {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.panel-heading {
  align-items: end;
  margin: 0 0 12px;
}

.panel-heading .eyebrow {
  display: none;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.hint {
  color: #7b8492;
  font-size: 13px;
}

.chart-panel,
.comparison-table {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: none;
}

.chart-header,
.comparison-header {
  margin-bottom: 12px;
}

.chart-header .eyebrow {
  display: none;
}

.chart-controls label,
.comparison-controls label,
.toolbar label {
  color: #737d8c;
  font-size: 12px;
}

.toolbar {
  margin: 12px 0;
  gap: 10px;
}

.stats-toolbar {
  margin-top: 0;
  margin-bottom: 14px;
  align-items: end;
}

.heatmap-toolbar {
  align-items: end;
}

#stats-view.stats-data-mode .stats-toolbar {
  display: none;
}

.stats-table-section {
  min-width: 0;
}

#stats-view .chart-panel {
  margin-top: 18px;
  margin-bottom: 0;
}

.toolbar input,
.toolbar select,
.chart-controls select,
.comparison-controls input,
.comparison-controls select {
  height: 38px;
  border-color: var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.toolbar input:focus,
.toolbar select:focus,
.chart-controls select:focus,
.comparison-controls input:focus,
.comparison-controls select:focus,
.indicator-thresholds input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(20 166 106 / 12%);
}

.stats-range-control {
  position: relative;
  display: grid;
  width: 260px;
  min-width: 260px;
  gap: 7px;
  color: #737d8c;
  font-size: 12px;
  font-weight: 500;
}

.heatmap-range-control {
  grid-column: span 2;
  width: 260px;
  min-width: 260px;
}

.control-label {
  line-height: 1;
}

.stats-range-trigger {
  display: flex;
  width: 100%;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 150ms var(--ease-out);
}

.stats-range-trigger::after {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  opacity: 0.58;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms var(--ease-out);
}

.stats-range-trigger[aria-expanded="true"] {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(20 166 106 / 12%);
}

.stats-range-trigger[aria-expanded="true"]::after {
  transform: translateY(2px) rotate(225deg);
}

.stats-range-trigger:active {
  transform: scale(0.985);
}

.stats-range-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgb(15 23 42 / 14%);
  opacity: 1;
  padding: 12px;
  transform: translateY(0) scale(1);
  transform-origin: 28px -8px;
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

@starting-style {
  .stats-range-popover {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.stats-range-popover-head,
.stats-range-popover-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stats-range-popover-head {
  margin-bottom: 10px;
}

.stats-range-popover-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}

.range-nav-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 150ms var(--ease-out);
}

.range-nav-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.range-nav-button:active:not(:disabled) {
  transform: scale(0.96);
}

.stats-range-calendar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.range-month {
  min-width: 0;
}

.range-month > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.range-weekdays,
.range-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.range-weekdays {
  margin-bottom: 4px;
}

.range-weekdays span {
  color: #98a2b3;
  font-size: 10px;
  font-weight: 500;
  text-align: center;
}

.range-day {
  display: grid;
  min-width: 0;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms var(--ease-out),
    box-shadow 150ms ease;
}

.range-day.is-outside {
  color: #b8c0cc;
}

.range-day.is-in-range {
  background: #eaf8f0;
  color: #176946;
}

.range-day.is-selected {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 8px 18px rgb(32 166 107 / 20%);
}

.range-day.is-range-start:not(.is-range-end) {
  border-radius: 8px 4px 4px 8px;
}

.range-day.is-range-end:not(.is-range-start) {
  border-radius: 4px 8px 8px 4px;
}

.range-day.is-unavailable {
  background: #f3f5f7;
  color: #a8b0bc;
  box-shadow: inset 0 0 0 1px #edf0f3;
}

.range-day:disabled {
  cursor: default;
  opacity: 0.32;
}

.range-day.is-unavailable:disabled {
  opacity: 1;
}

.range-day:active:not(:disabled) {
  transform: scale(0.94);
}

.stats-range-availability {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
  margin: 9px 2px 0;
  color: #737d8c;
  font-size: 11px;
  line-height: 1.35;
}

.stats-range-availability::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #b8c0cc;
  content: "";
}

.stats-range-availability.is-error {
  color: #a33a32;
}

.stats-range-availability.is-error::before {
  background: #d92d20;
}

.stats-range-popover-foot {
  margin-top: 12px;
  color: #737d8c;
  font-size: 12px;
}

.range-done-button {
  height: 34px;
  min-width: 86px;
}

.secondary-button,
.comparison-controls button,
.add-comparison,
.preset-button {
  border-color: var(--green);
  background: #ffffff;
  color: var(--green);
  box-shadow: none;
}

.secondary-button {
  height: 38px;
}

.metric-chart {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfc;
  box-shadow: none;
}

.chart-line {
  stroke: var(--green);
  filter: none;
}

.chart-point {
  fill: var(--green);
  stroke: #ffffff;
}

.table-note,
.active-sort {
  color: #8a94a3;
  font-size: 12px;
}

.table-note {
  min-height: auto;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #8a94a3;
}

.table-wrap,
.heatmap-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

table {
  font-size: 13px;
}

th {
  background: #fafbfc;
  color: #98a2b3;
  font-size: 11px;
}

td {
  background: #ffffff;
}

.table-wrap tbody tr:hover td,
.stats-data-scroll tbody tr:hover td,
.sorted-cell {
  background: #f8fbfa;
}

.sorted-column {
  background: #f1f8f4;
}

tfoot td {
  background: #fafbfc;
}

.active-sort-button {
  color: #111827;
}

.active-sort-button .sort-icon {
  border-color: #cfeadd;
  background: #eaf8f0;
  color: var(--green);
}

.sort-icon {
  border-color: #d8dfe7;
  background: #ffffff;
}

.pill {
  min-width: 54px;
  padding: 3px 8px;
}

.good-pill {
  background: #dcf8e8;
  color: #087348;
}

.warn-pill {
  background: #fff3d6;
  color: #b7791f;
}

.bad-pill {
  background: #ffe4e4;
  color: #c24141;
}

.heatmap-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: none;
}

.heatmap-badge {
  background: #eefaf4;
  color: var(--green);
  box-shadow: none;
}

.heatmap-badge-needs-premium-plus,
.heatmap-badge-locked {
  background: #eef1f4;
  color: #6b7280;
}

.legend {
  border: 0;
  background: transparent;
  padding: 0;
}

.self-check {
  border-color: var(--line);
  background: #fafbfc;
}

.settings-backdrop {
  background: rgb(15 23 42 / 18%);
  backdrop-filter: none;
}

.settings-drawer {
  width: min(430px, 100vw);
  border-left-color: var(--line);
  background: #ffffff;
  box-shadow: -16px 0 42px rgb(15 23 42 / 10%);
}

.drawer-header,
.settings-tabs {
  background: #ffffff;
}

.settings-tabs {
  background: #f4f6f8;
}

.settings-tab.active {
  background: #ffffff;
  box-shadow: 0 2px 8px rgb(15 23 42 / 8%);
}

.column-choice:hover,
.column-choice.dragging {
  border-color: transparent;
  background: #f4f7f8;
}

.indicator-card {
  border-color: var(--line);
  background: #ffffff;
}

@media (max-width: 980px) {
  .side-nav {
    display: flex;
    width: min(82vw, 320px);
    max-width: calc(100vw - 48px);
    transform: translateX(calc(-100% - 18px));
    transition: transform 220ms var(--ease-out);
    box-shadow: 18px 0 42px rgb(15 23 42 / 14%);
    will-change: transform;
  }

  body.mobile-nav-open .side-nav {
    transform: translateX(0);
  }

  .mobile-nav-toggle {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: 12px;
    z-index: 44;
    display: inline-flex;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 14px;
    background: #ffffff;
    color: #273142;
    box-shadow: 0 10px 28px rgb(15 23 42 / 10%);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
  }

  body.mobile-nav-open .mobile-nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    background: rgb(15 23 42 / 28%);
    backdrop-filter: blur(2px);
    touch-action: pan-x pan-y;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .page,
  body.stats-mode .page,
  body.future-mode .page {
    margin-left: 0;
    padding: 64px 12px 56px;
  }

  .future-grid {
    grid-template-columns: 1fr;
  }

  .cabinet-header {
    align-items: stretch;
    flex-direction: column;
  }

  .cabinet-summary,
  .permission-list {
    grid-template-columns: 1fr;
  }

  .shop-name-form,
  .ozon-connection-form {
    grid-template-columns: 1fr;
  }

  .ozon-connection-title {
    display: grid;
  }

  .shop-name-form .primary-button,
  .ozon-connection-form .primary-button {
    width: 100%;
  }

  .hero {
    display: none;
  }
}

/* Interactive metric chart. */
.metric-chart svg {
  height: 240px;
}

.chart-area {
  fill: rgb(92 165 219 / 20%);
  pointer-events: none;
}

.chart-axis {
  fill: none;
  stroke: #aeb7c2;
  stroke-width: 1.4;
  pointer-events: none;
}

.chart-grid {
  fill: none;
  stroke: #e1e6eb;
  stroke-width: 1;
  stroke-dasharray: 4 6;
  pointer-events: none;
}

.chart-line {
  fill: none;
  stroke: #5ca5db;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: none;
  pointer-events: none;
}

.chart-point {
  fill: #5ca5db;
  stroke: #ffffff;
  stroke-width: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.chart-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.chart-hit-zone {
  fill: transparent;
  cursor: default;
}

.chart-hit-group:hover .chart-point,
.chart-hit-group:hover .chart-tooltip {
  opacity: 1;
}

.chart-label,
.chart-axis-label {
  fill: #98a2b3;
  font-size: 11px;
  pointer-events: none;
}

.chart-tooltip rect {
  fill: #ffffff;
  stroke: #d8dfe7;
  filter: drop-shadow(0 8px 18px rgb(15 23 42 / 12%));
}

.chart-tooltip-date {
  fill: #667085;
  font-size: 11px;
  font-weight: 800;
}

.chart-tooltip-value {
  fill: #111827;
  font-size: 12px;
  font-weight: 900;
}

.heatmap-card-legend {
  justify-content: flex-end;
  max-width: none;
  margin-top: 10px;
}

/* Heatmap cards should wrap the actual heatmap table, not the full page width. */
.heatmaps {
  display: grid;
  width: 100%;
  min-width: 0;
  justify-items: center;
}

.heatmaps > .heatmap-card {
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  min-width: 0;
  margin-inline: auto;
}

.heatmap-header,
.heatmap-card-legend,
.hour-heatmap-wrap,
.heatmap-body,
.heatmap-summary {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.heatmap-header {
  align-items: flex-start;
}

.heatmap-badge {
  margin-left: auto;
}

.heatmap-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.heatmap-card-legend {
  justify-content: flex-end;
}

.heatmap-summary {
  justify-content: flex-start;
}

.heatmap-context {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}

.heatmap-context span {
  color: #667085;
  font-size: 13px;
  font-weight: 650;
}

#heatmaps-view > .toolbar {
  display: grid;
  grid-template-columns: 150px 150px 150px minmax(0, 1fr);
  align-items: end;
  width: min(100%, calc(1180px + 32px));
  margin-inline: auto;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  box-shadow: none;
}

#heatmaps-view > .toolbar label {
  min-width: 0;
}

#heatmaps-view > .toolbar input,
#heatmaps-view > .toolbar select,
#heatmaps-view .stats-range-trigger {
  font-weight: 400;
}

#heatmaps-view > .toolbar .wide-control {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0 !important;
  overflow: visible;
}

.heatmap-product-control {
  position: relative;
  display: grid;
  gap: 7px;
  color: #737d8c;
  font-size: 12px;
  font-weight: 500;
}

#heatmap-product.heatmap-product-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.heatmap-product-picker {
  position: relative;
  min-width: 0;
}

.heatmap-product-trigger {
  min-width: 0;
  text-align: left;
}

#heatmap-product-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-product-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 35;
  width: 100%;
  max-height: min(340px, calc(100vh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgb(15 23 42 / 14%);
}

.heatmap-product-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
}

.heatmap-product-option span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.heatmap-product-option.is-selected {
  background: #eaf8f0;
  color: #176946;
  font-weight: 750;
}

.heatmap-product-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgb(20 166 106 / 14%);
}

@media (hover: hover) and (pointer: fine) {
  .heatmap-product-option:hover {
    background: #f3fbf6;
    color: #176946;
  }
}

.heatmap-threshold-control {
  grid-column: auto;
  width: 150px;
  min-width: 150px !important;
}

.heatmap-cr-control {
  display: grid;
  grid-column: span 2;
  width: min(100%, 430px);
  min-width: 360px !important;
  gap: 6px;
  color: #737d8c;
  font-size: 12px;
}

.heatmap-cr-control label {
  line-height: 1;
}

.heatmap-cr-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.heatmap-cr-row input {
  width: 82px;
  min-width: 82px;
}

.heatmap-auto-cr {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page,
body.stats-mode .page {
  padding-top: 10px;
}

/* Table/chart fine tuning after real viewport check. */
th[data-width="product"],
td[data-width="product"] {
  width: auto;
  min-width: 300px;
  max-width: none;
}

th[data-width="sku"],
td[data-width="sku"] {
  width: auto;
  min-width: 118px;
  max-width: none;
}

th[data-width="text"],
td[data-width="text"] {
  width: auto;
  min-width: 132px;
  max-width: none;
}

th[data-width="small"],
td[data-width="small"],
th[data-width="percent"],
td[data-width="percent"],
th[data-width="number"],
td[data-width="number"] {
  width: auto;
  min-width: 112px;
  max-width: none;
}

th[data-width="money"],
td[data-width="money"] {
  width: auto;
  min-width: 148px;
  max-width: none;
}

.sort-button {
  width: auto;
  min-width: max-content;
}

.header-label {
  overflow: visible;
  text-overflow: clip;
}

th {
  font-weight: 650;
}

td {
  font-weight: 450;
}

tfoot td {
  font-weight: 720;
}

.toolbar label:has(input[type="date"]),
.comparison-controls label:has(input[type="date"]) {
  width: 150px;
  min-width: 150px;
}

.chart-line {
  stroke: #1f5f99;
  stroke-width: 2.2;
}

.chart-point {
  fill: #1f5f99;
}

.heatmap-table-wrap,
.hour-heatmap-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.heatmap-table-wrap::-webkit-scrollbar,
.hour-heatmap-wrap::-webkit-scrollbar {
  display: none;
}

.heatmap-table {
  width: max-content;
  min-width: 1180px;
}

.heatmap-table .heat-cell {
  width: 42px;
  min-width: 42px;
}

.hour-heatmap-grid {
  min-width: 1200px;
  grid-template-columns: repeat(24, minmax(48px, 1fr));
}

.hour-heatmap-cell.heat-cell {
  width: 48px;
  min-width: 48px;
}

@media (max-width: 620px) {
  #heatmaps-view > .toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    gap: 10px;
    padding: 12px;
  }

  #heatmaps-view > .toolbar label:first-child,
  #heatmaps-view > .toolbar .heatmap-range-control,
  #heatmaps-view > .toolbar .wide-control {
    grid-column: 1 / -1;
  }

  .heatmap-threshold-control,
  .heatmap-cr-control,
  .toolbar label:has(input[type="date"]),
  .comparison-controls label:has(input[type="date"]) {
    width: auto;
    min-width: 0 !important;
  }

  .hour-heatmap-grid {
    min-width: 1200px;
    grid-template-columns: repeat(24, minmax(48px, 1fr));
  }

  .hour-heatmap-cell {
    height: 42px;
  }

  .toolbar input,
  .toolbar select {
    width: 100%;
    min-width: 0;
  }

  .heatmap-cr-row input {
    width: 82px;
    min-width: 82px;
  }

  .stats-range-control {
    width: auto;
    min-width: 0;
  }

  .stats-range-popover {
    width: calc(100vw - 32px);
  }

  .stats-range-calendar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .page,
  body.stats-mode .page,
  body.future-mode .page {
    padding-top: 64px;
  }
}

/* Operational dashboard v3 transfer */
:root {
  --op-bg: #f6f8f7;
  --op-panel: #ffffff;
  --op-panel-soft: #f9fbfa;
  --op-text: #101817;
  --op-muted: #66736f;
  --op-line: #e2e8e5;
  --op-line-strong: #d5ded9;
  --op-green: #0f9f6e;
  --op-green-dark: #06724f;
  --op-green-soft: #e9f8f2;
  --op-yellow: #f5b942;
  --op-yellow-soft: #fff7df;
  --op-red: #e05252;
  --op-red-soft: #fff0ef;
  --op-shadow: 0 18px 42px rgb(27 45 38 / 8%);
  --op-radius: 8px;
}

body {
  min-width: 1280px;
  background: var(--op-bg);
  color: var(--op-text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

button,
input,
select {
  letter-spacing: 0;
}

.side-nav {
  width: 244px;
  padding: 22px 16px;
  background: var(--op-panel);
  border-right: 1px solid var(--op-line);
  box-shadow: none;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--op-text);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--op-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #093f31;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 14px;
  line-height: 1.1;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 12px;
  line-height: 1.1;
}

.store-card,
.session-card {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: var(--op-panel-soft);
  box-shadow: none;
}

.side-menu {
  display: grid;
  gap: 4px;
}

.side-menu-muted {
  padding-top: 10px;
  border-top: 1px solid var(--op-line);
}

.side-link {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #25312e;
  justify-content: flex-start;
  padding: 0 11px;
  font-size: 14px;
  font-weight: 650;
}

.side-link.active,
.side-link[aria-current="page"] {
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.page,
body.stats-mode .page,
body.future-mode .page {
  margin-left: 244px;
  padding: 24px;
  max-width: none;
  background: var(--op-bg);
}

.view-panel,
.panel,
#heatmaps-view,
#stats-view,
#cpc-view {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.view-panel {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0;
}

.operational-page-header,
.cabinet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.operational-page-header h1,
.cabinet-header h2 {
  margin: 3px 0 0;
  color: var(--op-text);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--op-green-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-status,
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-status {
  margin-top: 8px;
  color: var(--op-muted);
  font-size: 13px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.status-dot.ok {
  background: var(--op-green);
}

.primary-button,
.secondary-button,
.ghost-button,
.compact-button,
.range-done-button {
  border-radius: 7px;
  font-weight: 750;
  box-shadow: none;
}

.primary-button {
  background: var(--op-green);
  border-color: var(--op-green);
}

.secondary-button,
.ghost-button {
  background: #ffffff;
  border: 1px solid var(--op-line);
  color: var(--op-text);
}

.danger-button {
  background: var(--op-red);
  border-color: var(--op-red);
  color: #ffffff;
}

.toolbar {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  box-shadow: 0 8px 24px rgb(20 37 32 / 4%);
}

.heatmap-toolbar {
  display: grid;
  grid-template-columns: 132px 1.4fr minmax(280px, 2fr) repeat(3, minmax(124px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px;
}

.stats-toolbar {
  display: grid;
  grid-template-columns: 320px 360px;
  gap: 10px;
  align-items: end;
  justify-content: start;
  margin-bottom: 14px;
  padding: 12px;
}

.stats-toolbar .stats-main-range-control,
.stats-toolbar .stats-search-control {
  width: 100%;
  min-width: 0;
}

.stats-search-control {
  position: relative;
  display: grid;
  gap: 7px;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 750;
}

.stats-product-search-box {
  position: relative;
  min-width: 0;
}

.stats-product-search-box input {
  width: 100%;
  padding-right: 38px;
}

.stats-product-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--op-muted);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

.stats-product-clear:hover,
.stats-product-clear:focus-visible {
  background: #eef5f2;
  color: var(--op-text);
  outline: none;
}

.stats-product-clear[hidden],
.stats-product-options[hidden] {
  display: none;
}

.stats-product-options {
  --stats-product-option-height: 54px;
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 40;
  width: 100%;
  max-height: calc(var(--stats-product-option-height) * 2 + 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--op-line);
  border-radius: 10px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 16px 38px rgb(20 37 32 / 14%);
}

.stats-product-option {
  display: grid;
  width: 100%;
  min-height: var(--stats-product-option-height);
  gap: 3px;
  align-content: center;
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  background: transparent;
  color: var(--op-text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.stats-product-option strong,
.stats-product-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-product-option strong {
  font-size: 13px;
}

.stats-product-option small {
  color: var(--op-muted);
  font-size: 11px;
}

.stats-product-option:hover,
.stats-product-option:focus-visible,
.stats-product-option[aria-selected="true"] {
  background: #eef8f3;
  color: #176946;
  outline: none;
}

.stats-product-option-empty {
  padding: 12px 10px;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 650;
}

.toolbar label,
.control-label,
.heatmap-cr-control label,
.stats-range-control .control-label {
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 750;
}

.toolbar input,
.toolbar select,
.stats-range-trigger,
.heatmap-product-trigger {
  min-height: 36px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  color: var(--op-text);
  font-weight: 650;
}

.heatmap-cr-row {
  display: flex;
  gap: 8px;
}

.heatmap-auto-cr {
  min-height: 36px;
  border: 1px solid #cdeee1;
  border-radius: 7px;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.metric-grid.five,
body.stats-mode #summary-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

#summary-cards[hidden] {
  display: none;
}

.metric-card,
.cabinet-tile {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  box-shadow: 0 8px 20px rgb(20 37 32 / 4%);
  padding: 14px;
}

.metric-card span,
.metric-card strong,
.metric-card small,
.cabinet-tile span,
.cabinet-tile strong,
.cabinet-tile small {
  display: block;
}

.metric-card span,
.cabinet-tile span {
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-card strong,
.cabinet-tile strong {
  margin-top: 6px;
  color: var(--op-text);
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}

.metric-card small,
.cabinet-tile small {
  margin-top: 5px;
  color: var(--op-muted);
  font-size: 12px;
}

.metric-card.accent,
.cabinet-tile.is-warning {
  background: var(--op-yellow-soft);
  border-color: #f2dda1;
}

.metric-card.accent.heat-good {
  border-color: #b7e7cc;
  background: #dff8ea;
}

.metric-card.accent.heat-good strong {
  color: #067647;
}

.metric-card.accent.heat-warn {
  border-color: #f2dda1;
  background: #fff1a6;
}

.metric-card.accent.heat-warn strong {
  color: #6d5800;
}

.metric-card.accent.heat-bad {
  border-color: #f6c7c3;
  background: #fee4e2;
}

.metric-card.accent.heat-bad strong {
  color: #b42318;
}

.metric-card.accent.heat-empty {
  border-color: var(--op-line);
  background: #f4f7f6;
}

.metric-card.accent.heat-empty strong {
  color: var(--op-muted);
}

.heatmaps {
  display: grid;
  gap: 18px;
}

.heatmap-card {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  box-shadow: var(--op-shadow);
  padding: 14px;
}

.heatmap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.heatmap-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--op-text);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

.heatmap-context {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  color: var(--op-muted);
  font-size: 13px;
}

.heatmap-badge {
  border: 1px solid #cdeee1;
  border-radius: 999px;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.heatmap-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 14px;
  align-items: start;
}

.heatmap-main-column {
  min-width: 0;
}

.heatmap-table-wrap {
  overflow-x: auto;
  padding-bottom: 2px;
}

.heatmap-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
}

.heatmap-table th {
  height: 24px;
  border: 0;
  background: transparent;
  color: #7a8581;
  font-size: 11px;
  font-weight: 750;
}

.heatmap-table th:first-child {
  width: 64px;
  text-align: left;
}

.heatmap-table td {
  height: 32px;
  border: 0;
  border-radius: 5px;
  text-align: center;
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 12px;
  font-stretch: condensed;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.heat-good,
.hour-heatmap-cell.heat-good,
.legend-good {
  background: #e4f7ec;
  color: #08764e;
}

.heat-warn,
.hour-heatmap-cell.heat-warn,
.legend-warn {
  background: #fff4cf;
  color: #8a5a00;
}

.heat-bad,
.hour-heatmap-cell.heat-bad,
.legend-bad {
  background: #ffe3df;
  color: #b42318;
}

.heat-empty,
.hour-heatmap-cell.heat-empty,
.legend-empty {
  background: #f1f4f2;
  color: #a0aaa6;
}

.hour-heatmap-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--op-line);
}

.hour-heatmap-title {
  margin-bottom: 7px;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 800;
}

.hour-heatmap-grid {
  display: grid;
  min-width: 1200px;
  grid-template-columns: repeat(24, minmax(48px, 1fr));
  gap: 3px;
}

.hour-heatmap-cell {
  height: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 5px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 3px 1px;
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.hour-heatmap-cell strong {
  font-size: 10px;
  line-height: 1;
}

.hour-heatmap-position {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.heatmap-card-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 700;
}

.heatmap-card-legend i,
.heatmap-card-legend b {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  font-size: 10px;
}

.heatmap-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.heatmap-summary span {
  min-width: 0;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  padding: 8px;
  color: var(--op-text);
  font-size: 14px;
  font-weight: 750;
}

.heatmap-summary strong {
  display: block;
  margin-bottom: 3px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 750;
}

.heatmap-hour-detail {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  color: var(--op-text);
  box-shadow: 0 10px 26px rgb(20 37 32 / 5%);
  padding: 14px;
}

.heatmap-hour-detail-head span,
.heatmap-hour-detail-head strong,
.heatmap-hour-detail-head small {
  display: block;
}

.heatmap-hour-detail-head span {
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 800;
}

.heatmap-hour-detail-head strong {
  margin-top: 4px;
  color: var(--op-text);
  font-size: 16px;
}

.heatmap-hour-detail-head small {
  margin-top: 3px;
  color: var(--op-green-dark);
  font-size: 12px;
  font-weight: 750;
}

.heatmap-hour-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.heatmap-hour-detail-grid span {
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  padding: 9px;
}

.heatmap-hour-detail-grid small,
.heatmap-hour-detail-grid strong {
  display: block;
}

.heatmap-hour-detail-grid small {
  color: var(--op-muted);
  font-size: 11px;
}

.heatmap-hour-detail-grid strong {
  margin-top: 4px;
  color: var(--op-text);
  font-size: 16px;
}

.heatmap-hour-detail-position {
  grid-column: 1 / -1;
}

.heatmap-hour-detail p {
  margin: 12px 0 0;
  border: 1px solid #cdeee1;
  border-radius: 7px;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.heatmap-coverage-note {
  margin: 8px 0;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
}

.heatmap-coverage-note-warning {
  border: 1px solid #f2dda1;
  background: var(--op-yellow-soft);
  color: #8a5a00;
}

.stats-subtabs {
  margin-bottom: 12px;
}

#stats-table-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#stats-view .chart-panel {
  order: 1;
}

#stats-view .stats-table-section {
  order: 2;
}

.chart-panel,
.stats-table-section,
.comparison-table,
.cabinet-section,
.cpc-search-panel,
.cpc-feedback {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  box-shadow: 0 10px 26px rgb(20 37 32 / 5%);
  padding: 14px;
}

.chart-header {
  margin-bottom: 8px;
}

.metric-chart {
  min-height: 280px;
  border-radius: 7px;
  background: #ffffff;
}

.metric-chart svg {
  width: 100%;
  height: 280px;
}

.chart-grid {
  stroke: #e3ebe7;
  stroke-width: 1;
}

.chart-axis {
  stroke: #dfe7e3;
  stroke-width: 1.2;
  fill: none;
}

.chart-area {
  fill: rgb(15 159 110 / 9%);
}

.chart-line {
  fill: none;
  stroke: var(--op-green);
  stroke-width: 4;
  stroke-linecap: round;
}

.chart-point {
  fill: #ffffff;
  stroke: var(--op-green);
  stroke-width: 3;
}

.chart-axis-label,
.chart-label {
  fill: #7b8783;
  font-size: 12px;
}

.chart-tooltip rect {
  fill: #ffffff;
  stroke: var(--op-line);
  filter: drop-shadow(0 8px 20px rgb(20 37 32 / 14%));
}

.chart-tooltip-date {
  fill: var(--op-muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-tooltip-value {
  fill: var(--op-text);
  font-size: 12px;
  font-weight: 800;
}

.chart-caption,
.active-sort {
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 650;
}

.table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
}

#stats-table,
.comparison-table table,
.cpc-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#stats-table th,
.comparison-table th,
.cpc-history-table th {
  border-bottom: 1px solid var(--op-line);
  color: #74817c;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#stats-table td,
.comparison-table td,
.cpc-history-table td {
  border-bottom: 1px solid var(--op-line);
  padding: 11px 8px;
  color: var(--op-text);
  font-weight: 650;
  vertical-align: middle;
}

.product-cell {
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  flex: none;
  display: grid;
  place-items: center;
  background: #093f31;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.product-cell strong,
.product-cell small {
  display: block;
}

.product-cell strong {
  color: var(--op-text);
  font-size: 13px;
}

.product-cell small {
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 500;
}

.comparison-tables {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.comparison-table {
  margin-top: 0;
  background: var(--op-panel-soft);
  box-shadow: none;
  overflow: visible;
}

.comparison-header {
  position: relative;
  align-items: end;
  margin-bottom: 12px;
}

.comparison-range-control {
  width: 320px;
  min-width: 320px;
}

.comparison-remove-button {
  min-height: 36px;
  border: 1px solid #efc8c3;
  border-radius: 7px;
  padding: 0 12px;
  background: #fff7f6;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.comparison-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.add-comparison {
  margin-top: 12px;
  border-radius: 7px;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  font-weight: 800;
}

.cabinet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

#cpc-bid-status {
  margin: 0 0 10px;
}

.cpc-search-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.cpc-search-field {
  display: grid;
  gap: 6px;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 750;
}

.cpc-search-field input {
  min-height: 38px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  color: var(--op-text);
  padding: 0 11px;
}

.cpc-search-count {
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 750;
}

.cpc-layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.cpc-main-column {
  min-width: 0;
}

.cpc-product-list {
  display: grid;
  gap: 12px;
}

.cpc-product-card {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  box-shadow: 0 10px 26px rgb(20 37 32 / 5%);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 12px;
  align-items: start;
}

.cpc-product-card.has-cpc-errors {
  border-color: #f0c4bd;
}

.cpc-product-card-good,
.cpc-product-card-excellent {
  border-left: 4px solid var(--op-green);
}

.cpc-product-card-normal {
  border-left: 4px solid var(--op-yellow);
}

.cpc-product-card-poor {
  border-left: 4px solid var(--op-red);
}

.cpc-product-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.cpc-product-thumb {
  width: 48px;
  height: 48px;
}

.cpc-product-title strong,
.cpc-product-title small {
  display: block;
}

.cpc-product-title strong {
  color: var(--op-text);
  font-size: 14px;
  line-height: 1.25;
}

.cpc-product-title small {
  margin-top: 4px;
  color: var(--op-muted);
  font-size: 12px;
}

.cpc-stat-card {
  grid-column: 1 / -1;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  padding: 9px;
}

.cpc-stat-card-title,
.cpc-setting-title {
  display: block;
  margin-bottom: 7px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.cpc-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cpc-stat-tile,
.cpc-metric {
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px;
}

.cpc-stat-tile span,
.cpc-stat-tile strong,
.cpc-stat-tile em,
.cpc-stat-tile small {
  display: block;
}

.cpc-stat-tile span {
  color: var(--op-muted);
  font-size: 11px;
}

.cpc-stat-tile strong {
  margin-top: 4px;
  color: var(--op-text);
  font-size: 16px;
}

.cpc-stat-tile em,
.cpc-stat-tile small {
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.cpc-drr-excellent,
.cpc-drr-good {
  background: var(--op-green-soft);
  border-color: #cdeee1;
}

.cpc-drr-normal {
  background: var(--op-yellow-soft);
  border-color: #f2dda1;
}

.cpc-drr-poor,
.cpc-drr-critical {
  background: var(--op-red-soft);
  border-color: #f2c2bd;
}

.cpc-recommendation-panel {
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  padding: 10px;
}

.cpc-recommendation-heading {
  display: grid;
  gap: 6px;
}

.cpc-recommendation-heading span {
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.cpc-recommendation-panel p {
  margin: 8px 0 0;
  color: var(--op-muted);
  font-size: 12px;
  line-height: 1.4;
}

.pill,
.good-pill,
.warn-pill,
.bad-pill,
.empty-pill {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 850;
}

.good-pill {
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.warn-pill {
  background: var(--op-yellow-soft);
  color: #8a5a00;
}

.bad-pill {
  background: var(--op-red-soft);
  color: #b42318;
}

.empty-pill {
  background: #eef3f0;
  color: var(--op-muted);
}

.cpc-rule-panel {
  min-width: 0;
  grid-column: 1 / -1;
}

.cpc-rule-top {
  display: grid;
  grid-template-columns: 190px 210px minmax(260px, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.cpc-field,
.cpc-toggle-field {
  display: grid;
  gap: 5px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 750;
}

.cpc-field input,
.cpc-field select,
.cpc-product-card input,
.cpc-product-card select {
  min-height: 32px;
  border: 1px solid var(--op-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--op-text);
  font-size: 12px;
  font-weight: 700;
}

.cpc-field-help {
  min-height: 14px;
  color: var(--op-muted);
  font-size: 10px;
  line-height: 1.25;
}

.cpc-rules-details {
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}

.cpc-rules-details summary {
  min-height: 38px;
  padding: 0 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  cursor: pointer;
  list-style: none;
}

.cpc-rules-details summary::-webkit-details-marker {
  display: none;
}

.cpc-rules-details summary span {
  font-size: 12px;
  font-weight: 850;
}

.cpc-rules-details summary small {
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.cpc-rules-status-chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cpc-rule-chip {
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.cpc-rule-chip-good {
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  box-shadow: inset 0 0 0 1px #cdeee1;
}

.cpc-rule-chip-normal {
  background: var(--op-yellow-soft);
  color: #8a5a00;
  box-shadow: inset 0 0 0 1px #f2dda1;
}

.cpc-rule-chip-bad {
  background: var(--op-red-soft);
  color: #b42318;
  box-shadow: inset 0 0 0 1px #f2c2bd;
}

.cpc-rules-details > summary::after,
.cpc-rules-details[open] > summary::after,
.cpc-rules-details.is-campaign-locked > summary::after {
  content: "";
  display: none;
}

.cpc-rule-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 10px;
  padding: 10px;
}

.cpc-rule-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  max-width: none;
}

.cpc-rule-card,
.cpc-settings-details {
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  padding: 9px;
}

.cpc-rule-card {
  display: grid;
  grid-template-columns: 132px minmax(190px, 1fr) minmax(210px, 0.9fr);
  gap: 8px;
  align-items: end;
}

.cpc-rule-card .cpc-setting-title {
  margin: 0;
  align-self: start;
}

.cpc-rule-card > .cpc-field {
  min-width: 0;
  max-width: none;
}

.cpc-rule-card > .cpc-field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
}

.cpc-rule-card .cpc-rule-note,
.cpc-rule-card .cpc-rule-errors {
  grid-column: 2 / -1;
}

.cpc-rule-card-good {
  border-color: #cdeee1;
  background: var(--op-green-soft);
}

.cpc-rule-card-normal {
  border-color: #f2dda1;
  background: var(--op-yellow-soft);
}

.cpc-rule-card-bad {
  border-color: #f2c2bd;
  background: var(--op-red-soft);
}

.cpc-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.cpc-field-row-three {
  grid-template-columns: 1fr;
}

.cpc-field-row-four {
  grid-template-columns: 1fr;
}

.cpc-field-row-single {
  grid-template-columns: 1fr;
}

.cpc-settings-heading span,
.cpc-settings-heading small {
  display: block;
}

.cpc-settings-heading span {
  color: var(--op-text);
  font-size: 12px;
  font-weight: 850;
}

.cpc-settings-heading small {
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 11px;
}

.cpc-settings-sections {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.cpc-settings-section {
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  padding: 8px;
}

.cpc-rules-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cpc-rule-note {
  display: block;
  margin-top: 7px;
  color: var(--op-muted);
  font-size: 11px;
  line-height: 1.35;
}

.cpc-rules-details.is-campaign-locked .cpc-rule-note,
.cpc-rules-details.is-campaign-locked .cpc-rule-errors {
  display: none;
}

.cpc-rules-actions .secondary-button,
.cpc-rules-actions .compact-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
}

.cpc-manual-apply-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cpc-history-section {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.cpc-history-wrap {
  max-height: 540px;
  overflow: auto;
}

.cpc-history-table {
  min-width: 720px;
}

.cpc-history-table small {
  display: block;
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 11px;
}

.audit-result-success {
  color: var(--op-green-dark);
  font-weight: 850;
}

.audit-result-warning {
  color: #b42318;
  font-weight: 850;
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .side-nav {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--op-line);
  }

  .page,
  body.stats-mode .page,
  body.future-mode .page {
    margin-left: 0;
    padding: 14px;
  }

  .heatmap-toolbar,
  .stats-toolbar,
  .metric-grid.five,
  body.stats-mode #summary-cards,
  .cabinet-summary,
  .heatmap-body,
  .cpc-layout-shell,
  .cpc-product-card,
  .cpc-rule-top,
  .cpc-rule-workspace,
  .cpc-rule-cards,
  .comparison-tables {
    grid-template-columns: 1fr;
  }

  .cpc-history-section {
    position: static;
    max-height: none;
  }

  .operational-page-header,
  .cabinet-header {
    flex-direction: column;
  }

  .heatmap-table {
    min-width: 900px;
  }
}

/* Fixed authenticated workspace: the full desktop canvas scrolls as one page. */
body.auth-ready {
  min-width: 1780px;
  overflow-x: auto;
  overflow-y: auto;
}

body.auth-ready.mobile-nav-open {
  overflow-x: auto;
  overflow-y: auto;
}

body.auth-ready .mobile-nav-toggle,
body.auth-ready .mobile-menu-backdrop {
  display: none !important;
}

body.auth-ready .side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  width: 244px;
  max-width: none;
  border-right: 1px solid var(--op-line);
  border-bottom: 0;
  transform: none;
  transition: none;
  box-shadow: none;
}

body.auth-ready .page,
body.auth-ready.stats-mode .page,
body.auth-ready.future-mode .page {
  width: auto;
  min-width: 1536px;
  margin-left: 244px;
  padding: 24px;
}

body.auth-ready .view-panel {
  width: 1480px;
  min-width: 1480px;
  max-width: 1480px;
}

body.auth-ready #heatmaps-view > .heatmap-toolbar {
  grid-template-columns: 190px minmax(420px, 1fr) 170px 170px 270px;
  width: 100%;
  min-width: 1260px;
  gap: 10px;
}

body.auth-ready #heatmaps-view > .heatmap-toolbar .heatmap-range-control,
body.auth-ready #heatmaps-view > .heatmap-toolbar .wide-control,
body.auth-ready #heatmaps-view > .heatmap-toolbar .heatmap-threshold-control,
body.auth-ready #heatmaps-view > .heatmap-toolbar .heatmap-cr-control {
  grid-column: auto;
  width: 100%;
  min-width: 0 !important;
}

body.auth-ready #heatmaps-view > .heatmap-toolbar .heatmap-cr-control {
  width: 270px;
  min-width: 270px !important;
}

body.auth-ready #heatmaps-view > .heatmap-toolbar .heatmap-cr-row {
  flex-wrap: nowrap;
}

body.auth-ready #heatmap-range-popover,
body.auth-ready #stats-range-popover,
body.auth-ready #unit-economics-range-popover,
body.auth-ready .comparison-range-popover {
  width: 860px;
  max-width: none;
}

.heatmap-range-popover-body,
.stats-range-popover-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 12px;
  align-items: stretch;
}

.heatmap-range-calendar-shell,
.stats-range-calendar-shell {
  min-width: 0;
}

.heatmap-period-presets,
.stats-period-presets {
  display: grid;
  align-content: start;
  gap: 6px;
  border-left: 1px solid var(--op-line);
  padding-left: 12px;
}

.heatmap-period-presets > span,
.stats-period-presets > span {
  margin-bottom: 2px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
}

.heatmap-period-presets button,
.stats-period-presets button {
  min-height: 34px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  padding: 0 10px;
}

.heatmap-period-presets button:hover,
.heatmap-period-presets button.is-selected,
.stats-period-presets button:hover,
.stats-period-presets button.is-selected {
  border-color: #b9dfd0;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.heatmap-period-presets button.is-selected,
.stats-period-presets button.is-selected {
  box-shadow: inset 3px 0 0 var(--op-green);
}

body.auth-ready .heatmap-body {
  grid-template-columns: minmax(0, 1fr) 312px;
}

body.auth-ready .heatmap-table-wrap,
body.auth-ready .hour-heatmap-wrap,
body.auth-ready .table-wrap,
body.auth-ready .stats-data-scroll,
body.auth-ready .cpc-history-wrap,
body.auth-ready .audit-log-wrap {
  max-width: none;
  overflow: visible;
}

body.auth-ready .cpc-history-section,
body.auth-ready .cpc-history-wrap {
  position: static;
  max-height: none;
}

body.auth-ready .heatmap-table {
  width: 100%;
  min-width: 1120px;
}

body.auth-ready .heatmap-table th:first-child {
  width: 118px;
  min-width: 118px;
  padding: 0 10px;
  white-space: nowrap;
}

body.auth-ready .heatmap-table .heat-cell {
  width: auto;
  min-width: 0;
  height: 32px;
  padding: 0;
}

body.auth-ready .hour-heatmap-grid {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(24, minmax(0, 1fr));
}

.heatmap-cell-button {
  display: grid;
  width: 100%;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  padding: 0;
}

.heatmap-table td.is-selected {
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px var(--op-green);
}

.heatmap-cell-button:focus-visible {
  outline: 3px solid rgb(15 159 110 / 34%);
  outline-offset: 1px;
}

body.auth-ready .stats-toolbar {
  grid-template-columns: 320px 360px;
  justify-content: start;
}

body.auth-ready .stats-toolbar .stats-main-range-control,
body.auth-ready .stats-toolbar .stats-search-control {
  width: 100%;
  min-width: 0;
}

body.auth-ready .stats-table-section,
body.auth-ready .comparison-table,
body.auth-ready .comparison-table-wrap {
  overflow: visible;
}

body.auth-ready #stats-table,
body.auth-ready .comparison-stats-table {
  width: max-content;
  min-width: 100%;
}

/* Statistics tables stay inside their cards and scroll horizontally inside. */
#stats-view {
  --stats-product-column-width: 220px;
}

body.auth-ready #stats-view .table-wrap,
#stats-view .table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

body.auth-ready #stats-view .stats-data-scroll,
#stats-view .stats-data-scroll {
  max-height: min(62vh, 720px);
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#stats-view .table-wrap th[data-column-key="name"],
#stats-view .table-wrap td[data-column-key="name"] {
  width: var(--stats-product-column-width);
  min-width: var(--stats-product-column-width);
  max-width: var(--stats-product-column-width);
  left: 0;
  position: sticky;
  box-shadow: 1px 0 0 var(--op-line), 8px 0 14px rgb(20 37 32 / 5%);
}

#stats-view .table-wrap th[data-column-key="name"] {
  z-index: 6;
  background: #f4f7f6;
}

#stats-view .table-wrap tbody td[data-column-key="name"] {
  z-index: 4;
  background: #ffffff;
}

#stats-view .table-wrap tbody tr:hover td[data-column-key="name"] {
  background: #eef5f2;
}

#stats-view .table-wrap tfoot td[data-column-key="name"] {
  z-index: 5;
  background: #f4f7f6;
}

#stats-view .product-name {
  max-width: var(--stats-product-column-width);
}

#stats-view .product-cell {
  width: 100%;
  min-width: 0;
}

#stats-view .product-cell > span:last-child {
  min-width: 0;
}

#stats-view .product-cell strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#stats-view .product-cell small {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resizable-product-column {
  padding-right: 14px;
  overflow: visible;
}

.product-column-resizer {
  position: absolute;
  inset: 0 -6px 0 auto;
  z-index: 8;
  display: grid;
  width: 14px;
  height: 100%;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--op-green-dark);
  cursor: col-resize;
  touch-action: none;
}

.product-column-resizer::before {
  position: absolute;
  inset: 5px auto 5px 6px;
  width: 2px;
  border-radius: 999px;
  background: #9dcbbb;
  content: "";
}

.product-column-resizer span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 12px;
  height: 24px;
  place-items: center;
  border: 1px solid #9dcbbb;
  border-radius: 5px;
  background: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.9;
}

.product-column-resizer:hover span,
.product-column-resizer:focus-visible span {
  border-color: var(--op-green);
  background: var(--op-green-soft);
  outline: none;
  box-shadow: 0 0 0 3px rgb(15 159 110 / 14%);
}

body.is-resizing-product-column,
body.is-resizing-product-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

body.auth-ready .metric-grid.five,
body.auth-ready.stats-mode #summary-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.auth-ready .cabinet-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.auth-ready .permission-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.auth-ready .shop-name-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.auth-ready .ozon-connection-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

body.auth-ready .shop-name-form .primary-button,
body.auth-ready .ozon-connection-form .primary-button {
  width: auto;
}

body.auth-ready .future-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.auth-ready .cpc-layout-shell {
  grid-template-columns: minmax(0, 1fr) 360px;
}

body.auth-ready .cpc-product-card {
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
}

body.auth-ready .cpc-product-main {
  grid-template-columns: 48px minmax(0, 1fr);
}

body.auth-ready .cpc-rule-top {
  width: auto;
  max-width: none;
  grid-template-columns: 190px 210px minmax(260px, 1fr);
}

body.auth-ready .cpc-rule-workspace {
  grid-template-columns: minmax(0, 1fr) 320px;
}

body.auth-ready .cpc-rule-cards {
  width: 100%;
  max-width: none;
  grid-template-columns: 1fr;
}

body.auth-ready .cpc-rule-card {
  grid-template-columns: 132px minmax(190px, 1fr) minmax(210px, 0.9fr);
}

body.auth-ready .cpc-field-row,
body.auth-ready .cpc-settings-details .cpc-field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.auth-ready .comparison-tables {
  grid-template-columns: minmax(0, 1fr);
}

body.auth-ready .heatmap-hour-detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.auth-ready .operational-page-header,
body.auth-ready .cabinet-header {
  align-items: flex-start;
  flex-direction: row;
}

/* CPC workspace — compact product queue selected on 2026-07-12. */
body.auth-ready:has(#cpc-view:not([hidden])) {
  min-width: 1180px;
}

body.auth-ready:has(#cpc-view:not([hidden])) .page {
  width: auto;
  min-width: 936px;
}

#cpc-view {
  --cpc-history-width: 336px;
  --cpc-gap: 16px;
}

body.auth-ready #cpc-view {
  width: 100%;
  min-width: 0;
  max-width: none;
}

#cpc-view .cpc-page-header {
  align-items: flex-start;
  margin-bottom: 14px;
}

.cpc-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cpc-page-actions .secondary-button {
  min-height: 38px;
  padding-inline: 16px;
}

#cpc-view .cpc-summary-grid,
body.auth-ready #cpc-view .cpc-summary-grid {
  width: calc(100% - var(--cpc-history-width) - var(--cpc-gap));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#cpc-view .cpc-summary-warning {
  border-color: #eed58b;
  background: #fff9e8;
}

#cpc-view .cpc-summary-grid .cabinet-tile {
  min-height: 94px;
  padding: 12px;
  box-shadow: 0 12px 18px -16px rgb(20 37 32 / 18%);
}

#cpc-view .cpc-summary-danger {
  border-color: #f2c0ba;
  background: #fff4f3;
}

#cpc-view #cpc-bid-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#cpc-view .cpc-search-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 1160px);
  margin: 0 auto 12px;
  border: 1px solid var(--op-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

#cpc-view .cpc-search-empty {
  margin: 0 auto 12px;
}

#cpc-view .cpc-search-field {
  width: 100%;
}

#cpc-view .cpc-search-field input {
  min-height: 36px;
  background: #f8faf9;
}

#cpc-view .cpc-search-count {
  position: absolute;
  top: 9px;
  right: 12px;
}

#cpc-view .cpc-layout-shell,
body.auth-ready #cpc-view .cpc-layout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--cpc-history-width);
  gap: var(--cpc-gap);
  align-items: start;
}

.cpc-product-summary {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 88px 88px 88px 126px 20px;
  gap: 10px;
  align-items: center;
}

.cpc-product-table {
  width: min(100%, 1160px);
  margin-inline: auto;
}

.cpc-product-list-head {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 88px 88px 88px 126px 20px;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--op-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8faf9;
  padding: 7px 12px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

#cpc-view .cpc-product-list {
  display: grid;
  gap: 0;
  width: 100%;
  justify-items: stretch;
}

#cpc-view .cpc-product-card,
body.auth-ready #cpc-view .cpc-product-card {
  display: block;
  width: 100%;
  border: 1px solid var(--op-line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  padding: 0;
}

#cpc-view .cpc-product-card + .cpc-product-card {
  border-top: 0;
}

#cpc-view .cpc-product-card:first-child {
  border-radius: 0;
}

#cpc-view .cpc-product-card:last-child {
  border-radius: 0 0 8px 8px;
}

#cpc-view .cpc-product-card:only-child {
  border-radius: 8px;
}

#cpc-view .cpc-product-card[open] {
  border-color: #a8bdb5;
  border-top-width: 1px;
}

#cpc-view .cpc-product-card[open] + .cpc-product-card {
  border-top: 0;
}

#cpc-view .cpc-product-summary {
  min-height: 52px;
  list-style: none;
  cursor: pointer;
  padding: 7px 12px;
}

#cpc-view .cpc-product-summary::-webkit-details-marker {
  display: none;
}

#cpc-view .cpc-product-summary:focus-visible {
  outline: 3px solid rgb(15 159 110 / 24%);
  outline-offset: -3px;
}

.cpc-product-summary-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

#cpc-view .cpc-product-summary .cpc-product-thumb {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  font-size: 11px;
}

#cpc-view .cpc-product-summary .cpc-product-title {
  min-width: 0;
}

#cpc-view .cpc-product-summary .cpc-product-title strong {
  display: block;
  overflow: hidden;
  color: var(--op-text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cpc-view .cpc-product-summary .cpc-product-title small {
  display: block;
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 11px;
}

.cpc-product-summary-metric small,
.cpc-product-summary-metric strong {
  display: block;
}

.cpc-product-summary-metric small {
  display: none;
  color: var(--op-muted);
  font-size: 10px;
}

.cpc-product-summary-metric strong {
  color: var(--op-text);
  font-size: 13px;
}

.cpc-product-summary-drr-value {
  font-weight: 900;
}

.cpc-product-summary-metric strong.cpc-product-summary-drr-excellent {
  color: #067647;
}

.cpc-product-summary-metric strong.cpc-product-summary-drr-good,
.cpc-product-summary-metric strong.cpc-product-summary-drr-normal {
  color: #6d5800;
}

.cpc-product-summary-metric strong.cpc-product-summary-drr-poor,
.cpc-product-summary-metric strong.cpc-product-summary-drr-critical {
  color: #b42318;
}

.cpc-product-summary-metric strong.cpc-product-summary-drr-empty {
  color: var(--op-muted);
}

.cpc-product-summary-state {
  color: var(--op-green-dark);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}

.cpc-product-summary-marker {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #52645e;
  border-bottom: 1.5px solid #52645e;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms var(--ease-out);
}

.cpc-product-card[open] .cpc-product-summary-marker {
  transform: rotate(225deg) translate(-2px, -2px);
}

#cpc-view .cpc-product-card[open] > .cpc-product-summary {
  border-bottom: 1px solid var(--op-line);
  background: #ffffff;
}

#cpc-view .cpc-product-card > .cpc-product-main {
  display: none;
}

#cpc-view .cpc-product-card > .cpc-recommendation-panel {
  margin: 12px 16px 0;
  border-color: #f1b9b2;
  background: #fff6f5;
  box-shadow: none;
  padding: 12px 16px;
}

#cpc-view .has-cpc-campaign-locked .cpc-recommendation-heading > span,
#cpc-view .has-cpc-campaign-locked .cpc-recommendation-heading > strong {
  color: #b42318;
}

#cpc-view .cpc-recommendation-panel .cpc-recommendation-heading {
  min-height: auto;
}

#cpc-view .cpc-recommendation-panel p {
  margin-top: 5px;
  font-size: 11px;
}

#cpc-view .cpc-recommendation-panel small {
  margin-top: 3px;
  font-size: 10px;
}

#cpc-view .cpc-rule-panel {
  display: grid;
  gap: 12px;
  margin: 12px 16px 16px;
}

#cpc-view .cpc-rule-top,
body.auth-ready #cpc-view .cpc-rule-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(410px, 1.05fr);
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  padding: 0 8px;
}

#cpc-view .cpc-rule-top > .cpc-toggle-field {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
}

#cpc-view .cpc-rule-top > .cpc-mode-segments {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
}

#cpc-view .cpc-rule-top > .cpc-campaign-field {
  position: relative;
  display: grid;
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

#cpc-view .cpc-campaign-trigger {
  min-height: 38px;
  text-align: left;
}

#cpc-view .cpc-campaign-refresh {
  min-height: 38px;
  white-space: nowrap;
}

#cpc-view .cpc-campaign-menu {
  top: calc(100% + 6px);
  left: 0;
  right: 96px;
  z-index: 16;
}

#cpc-view .cpc-mode-segments {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr) minmax(0, 1fr);
  min-height: 38px;
  overflow: hidden;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
}

#cpc-view .cpc-mode-segments > button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: var(--op-text);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

#cpc-view .cpc-mode-segments > button + button {
  border-left: 1px solid var(--op-line);
}

#cpc-view .cpc-mode-segments > button.is-active {
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

#cpc-view .cpc-mode-segments > button:hover:not(.is-active) {
  background: #f8faf9;
}

#cpc-view .cpc-mode-segments > button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgb(15 157 114 / 35%);
  outline-offset: -2px;
}

#cpc-view .cpc-rules-details,
body.auth-ready #cpc-view .cpc-rules-details {
  width: 100%;
  max-width: none;
  border-radius: 7px;
  box-shadow: none;
}

#cpc-view .cpc-rules-details > summary {
  min-height: 36px;
  border: 0;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  padding: 0 10px;
}

#cpc-view .cpc-rules-details > summary > span:first-child {
  font-size: 12px;
}

#cpc-view .cpc-rules-status-chips,
#cpc-view .cpc-rules-details > summary small {
  display: none;
}

#cpc-view .cpc-rule-workspace,
body.auth-ready #cpc-view .cpc-rule-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
}

#cpc-view .cpc-settings-details {
  grid-column: 1;
  grid-row: 2;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #f9fbfa;
  padding: 8px 10px 9px;
}

#cpc-view .cpc-settings-heading {
  display: none;
}

#cpc-view .cpc-settings-heading > span {
  color: var(--op-text);
  font-size: 12px;
  font-weight: 850;
}

#cpc-view .cpc-settings-heading small,
#cpc-view .cpc-settings-section > .cpc-setting-title {
  display: block;
}

#cpc-view .cpc-settings-heading small {
  display: none;
}

#cpc-view .cpc-settings-sections {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

#cpc-view .cpc-settings-section {
  position: relative;
  grid-column: span 5;
  border: 0;
  background: transparent;
  padding: 0;
}

#cpc-view .cpc-settings-section + .cpc-settings-section {
  border-top: 0;
  padding-top: 0;
}

#cpc-view .cpc-settings-section + .cpc-settings-section::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  width: 1px;
  background: var(--op-line);
  content: "";
}

#cpc-view .cpc-settings-section:last-child {
  grid-column: span 3;
}

#cpc-view .cpc-settings-section:nth-child(2) {
  grid-column: span 3;
}

#cpc-view .cpc-settings-section:first-child {
  grid-column: span 7;
}

#cpc-view .cpc-settings-section .cpc-field-row,
body.auth-ready #cpc-view .cpc-settings-section .cpc-field-row {
  display: grid;
  gap: 6px;
}

#cpc-view .cpc-settings-section .cpc-field-row-three,
body.auth-ready #cpc-view .cpc-settings-section .cpc-field-row-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#cpc-view .cpc-settings-section .cpc-field-row-four,
body.auth-ready #cpc-view .cpc-settings-section .cpc-field-row-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#cpc-view .cpc-settings-section .cpc-field-row-two,
body.auth-ready #cpc-view .cpc-settings-section .cpc-field-row-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#cpc-view .cpc-settings-section .cpc-field-row .cpc-field:last-child {
  grid-column: auto;
}

#cpc-view .cpc-settings-details .cpc-field {
  gap: 3px;
}

#cpc-view .cpc-settings-details .cpc-field > span {
  font-size: 9px;
  line-height: 1.2;
}

#cpc-view .cpc-settings-details input,
#cpc-view .cpc-settings-details select,
#cpc-view .cpc-settings-details .cpc-input-suffix {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
}

#cpc-view .cpc-settings-details .cpc-input-suffix {
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
}

#cpc-view .cpc-settings-details .cpc-input-suffix input {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#cpc-view .cpc-settings-details .cpc-input-suffix-text {
  min-width: 38px;
  height: 100%;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 700;
}

#cpc-view .cpc-settings-section > .cpc-setting-title {
  margin-bottom: 7px;
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

#cpc-view .cpc-rule-cards,
body.auth-ready #cpc-view .cpc-rule-cards {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  align-items: stretch;
  width: 100%;
  max-width: none;
  border: 0;
  background: transparent;
  padding: 0;
}

#cpc-view .cpc-rule-card,
body.auth-ready #cpc-view .cpc-rule-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
  gap: 6px;
  align-content: start;
  min-width: 0;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  padding: 8px;
}

#cpc-view .cpc-rule-card-good {
  border-color: #abd9c7;
  background: #edf9f4;
}

#cpc-view .cpc-rule-card-normal {
  border-color: #efd27f;
  background: #fff8e7;
}

#cpc-view .cpc-rule-card-bad {
  border-color: #f0b5ae;
  background: #fff3f2;
}

#cpc-view .cpc-rule-card .cpc-setting-title {
  min-height: 0;
  margin: 0;
  font-size: 10px;
  font-weight: 900;
  text-transform: none;
}

#cpc-view .cpc-rule-card .cpc-field > span {
  display: block;
}

#cpc-view .cpc-rule-card select {
  min-height: 34px;
  background: #ffffff;
  font-size: 10px;
  font-weight: 750;
}

#cpc-view .cpc-rule-card .cpc-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

#cpc-view .cpc-rule-card .cpc-rule-note {
  align-self: start;
  min-height: 0;
  font-size: 9px;
}

#cpc-view .cpc-rule-card .cpc-rule-note,
#cpc-view .cpc-rule-card .cpc-rule-errors {
  grid-column: 1;
}

#cpc-view .cpc-rule-card > .cpc-field,
#cpc-view .cpc-rule-card > .cpc-field-row {
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}

#cpc-view .cpc-rules-actions {
  grid-column: 1;
  grid-row: 3;
  justify-content: flex-end;
  border-top: 1px solid var(--op-line);
  padding-top: 10px;
}

#cpc-view .cpc-rules-actions .compact-button {
  min-width: 180px;
  min-height: 34px;
}

#cpc-view .cpc-rules-actions [data-cpc-apply-rules] {
  border-color: var(--op-green);
  background: var(--op-green);
  color: #ffffff;
}

#cpc-view .cpc-rules-actions [data-cpc-apply-rules]:disabled {
  border-color: #d0d5dd;
  background: #e4e7ec;
  color: #667085;
  cursor: not-allowed;
  opacity: 1;
}

#cpc-view .cpc-history-section,
body.auth-ready #cpc-view .cpc-history-section {
  position: sticky;
  top: 18px;
  display: block;
  margin: 0;
  min-height: 670px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid var(--op-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(20 37 32 / 4%);
  padding: 12px;
}

.cpc-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.cpc-history-head h3 {
  margin: 0;
  font-size: 16px;
}

.cpc-history-head p {
  margin: 5px 0 0;
  color: var(--op-muted);
  font-size: 11px;
  line-height: 1.4;
}

.cpc-history-copy-expanded {
  display: none;
}

#cpc-bid-history-expand {
  width: auto;
  flex: 0 0 auto;
  padding-inline: 12px;
}

.cpc-history-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.cpc-history-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.cpc-history-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #f8faf9;
  min-height: 78px;
  padding: 9px 10px;
}

.cpc-history-item-meta,
.cpc-history-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.cpc-history-item time,
.cpc-history-item small,
.cpc-history-item-sku {
  color: var(--op-muted);
  font-size: 10px;
}

.cpc-history-item-sku {
  flex: 0 0 auto;
  font-weight: 800;
}

.cpc-history-item strong {
  color: var(--op-text);
  font-size: 12px;
  line-height: 1.35;
}

.cpc-history-item-foot small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpc-history-item .audit-result {
  min-width: 0;
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 10px;
}

.cpc-history-item.is-error {
  border-color: #efc1bb;
  background: #fff7f6;
}

.cpc-history-empty {
  color: var(--op-muted);
  font-size: 12px;
}

#cpc-view .cpc-history-actions,
#cpc-view .cpc-history-wrap {
  display: none;
}

#cpc-view .cpc-history-section.is-expanded,
body.auth-ready #cpc-view .cpc-history-section.is-expanded {
  position: fixed;
  z-index: 80;
  top: 72px;
  right: auto;
  bottom: 28px;
  left: 50%;
  display: flex;
  width: min(1440px, calc(100vw - 56px));
  margin: 0;
  transform: translateX(-50%);
  flex-direction: column;
  max-height: none;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 24px 80px rgb(16 24 40 / 24%);
}

#cpc-view:has(.cpc-history-section.is-expanded) {
  backdrop-filter: none;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-copy-compact {
  display: none;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-copy-expanded {
  display: inline;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-list {
  display: none;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-actions {
  display: flex;
  margin: 10px 0;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-actions button {
  width: 100%;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-wrap,
body.auth-ready #cpc-view .cpc-history-section.is-expanded .cpc-history-wrap {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#cpc-view .cpc-history-section.is-expanded .cpc-history-table {
  min-width: 1120px;
  table-layout: fixed;
}

.cpc-history-col-time {
  width: 11%;
}

.cpc-history-col-product {
  width: 17%;
}

.cpc-history-col-campaign {
  width: 12%;
}

.cpc-history-col-action {
  width: 13%;
}

.cpc-history-col-bid,
.cpc-history-col-result {
  width: 10%;
}

.cpc-history-col-details {
  width: 27%;
}

#cpc-view .cpc-history-table th,
#cpc-view .cpc-history-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

#cpc-view .cpc-history-table td:nth-child(7) {
  max-width: none;
}

#cpc-view .cpc-history-product-name {
  display: -webkit-box !important;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-weight: 600 !important;
  line-height: 1.35;
  white-space: normal !important;
}

.cpc-history-campaign strong {
  line-height: 1.3;
}

.cpc-history-details {
  color: var(--op-muted) !important;
  font-weight: 600 !important;
  line-height: 1.45;
  white-space: normal !important;
}

#cpc-view .cpc-history-table .audit-result {
  white-space: nowrap;
}

.cpc-history-section .audit-result-warning {
  background: #fef0c7;
  color: #b54708;
}

.audit-result-error {
  background: #fee4e2;
  color: #b42318;
}

.audit-result-neutral {
  background: #f2f4f7;
  color: #475467;
}

@media (max-width: 1488px) {
  body.auth-ready:has(#cpc-view:not([hidden])) {
    min-width: 1488px;
  }

  body.auth-ready:has(#cpc-view:not([hidden])) .page {
    width: 1244px;
    min-width: 1244px;
  }

  #cpc-view .cpc-summary-grid,
  body.auth-ready #cpc-view .cpc-summary-grid {
    width: calc(100% - var(--cpc-history-width) - var(--cpc-gap));
  }

  #cpc-view .cpc-layout-shell,
  body.auth-ready #cpc-view .cpc-layout-shell {
    grid-template-columns: minmax(0, 1fr) var(--cpc-history-width);
  }

  #cpc-view .cpc-history-section,
  body.auth-ready #cpc-view .cpc-history-section {
    position: sticky;
    min-height: 670px;
    max-height: calc(100vh - 36px);
  }
}

.self-check.self-check-error {
  border-color: #f3b4b4;
  background-color: #fff7f7;
}

.self-check.self-check-error h3 {
  color: #9f1d1d;
}

.check-error {
  background: #d92d20;
}

/* Unit economics */
body.unit-economics-mode {
  min-width: 0;
  overflow-x: hidden;
}

body.unit-economics-mode .page {
  width: calc(100vw - 244px);
  min-width: 0;
  max-width: none;
  margin-left: 244px;
  padding: 24px;
  overflow-x: hidden;
  background: var(--op-bg);
}

#unit-economics-view {
  width: 100%;
  min-width: 0;
  max-width: 1560px;
  overflow-x: clip;
}

.app-nonblocking-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid #e4a6a6;
  border-left: 4px solid #bb2f3b;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--aw-panel-shadow, 0 14px 38px rgba(27, 39, 51, 0.16));
  color: #7e202a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  pointer-events: none;
}

.app-nonblocking-notice[data-tone="warning"] {
  border-color: #e9c678;
  border-left-color: #b97808;
  color: #76500a;
}

.app-nonblocking-notice[hidden] {
  display: none;
}

.unit-economics-header {
  align-items: flex-end;
}

.unit-economics-subtitle {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--op-muted);
  font-size: 13px;
  line-height: 1.5;
}

.unit-economics-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.unit-economics-tabs {
  display: inline-flex;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 3px;
}

.unit-economics-mode-bar {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.unit-economics-plan-actions.plan-economics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.unit-economics-plan-actions[hidden] {
  display: none !important;
}

.unit-economics-tab {
  width: 124px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--op-muted);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
}

.unit-economics-tab.is-active {
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.unit-economics-toolbar {
  display: grid;
  grid-template-columns: 260px minmax(230px, 1.2fr) minmax(200px, 1fr) minmax(210px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
}

.unit-economics-range-control {
  width: 100%;
  min-width: 0;
  gap: 6px;
}

.unit-economics-toolbar .control-label {
  display: flex;
  min-height: 18px;
  align-items: center;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
}

.unit-economics-toolbar label,
.unit-economics-toolbar .unit-economics-field,
.unit-economics-plan-fields label,
.unit-economics-settings-card label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
}

.unit-economics-toolbar input,
.unit-economics-toolbar select,
.unit-economics-toolbar .unit-economics-field input,
.unit-economics-toolbar .unit-economics-field select,
.unit-economics-plan-fields input,
.unit-economics-plan-fields select,
.unit-economics-settings-card input,
.unit-economics-settings-card select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-text);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.unit-economics-toolbar button {
  min-height: 40px;
}

.unit-economics-field-label,
.unit-economics-heading-with-help,
.unit-economics-user-presets-head {
  display: flex;
  gap: 7px;
  align-items: center;
}

.unit-economics-field-label {
  position: relative;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 0;
  min-height: 18px;
  padding-right: 12px;
}

.unit-economics-toolbar .range-nav-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
}

.unit-economics-toolbar .range-day {
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.unit-economics-toolbar .stats-period-presets button,
.unit-economics-toolbar .range-done-button {
  min-height: 34px;
}

.unit-product-picker-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.unit-product-picker {
  position: relative;
  min-width: 0;
}

.unit-product-picker-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-text);
  padding: 6px 9px;
  font: inherit;
  text-align: left;
  align-self: stretch !important;
  margin: 0 !important;
}

.unit-product-picker-trigger strong {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-product-picker-trigger small {
  grid-column: 1;
  overflow: hidden;
  color: var(--op-muted);
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-product-picker-chevron {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--op-muted);
  font-size: 16px;
  transition: transform 150ms ease;
}

.unit-product-picker.is-open .unit-product-picker-trigger {
  border-color: #82cbb1;
  box-shadow: 0 0 0 3px rgb(24 166 106 / 10%);
}

.unit-product-picker.is-open .unit-product-picker-chevron {
  transform: rotate(180deg);
}

.unit-product-picker-menu {
  position: fixed;
  z-index: 130;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--op-line);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgb(9 30 24 / 24%);
  padding: 8px;
}

.unit-product-picker-menu[hidden] {
  display: none;
}

.unit-product-picker-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--op-line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--op-text);
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
}

.unit-product-picker-options {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.unit-product-picker-option {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--op-text);
  padding: 8px 9px;
  font: inherit;
  text-align: left;
}

.unit-product-picker-option:hover,
.unit-product-picker-option:focus-visible,
.unit-product-picker-option[aria-selected="true"] {
  background: var(--op-green-soft);
  outline: 0;
}

.unit-product-picker-option strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.unit-product-picker-option small {
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 650;
}

.unit-product-picker-empty {
  margin: 14px 8px;
  color: var(--op-muted);
  font-size: 10px;
  text-align: center;
}

.unit-economics-status {
  min-height: 42px;
  margin-bottom: 12px;
  border: 1px solid var(--op-line);
  border-left: 4px solid var(--op-green);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.unit-economics-status[hidden] {
  display: none;
}

.unit-economics-status.is-warning {
  border-left-color: var(--op-yellow);
  background: var(--op-yellow-soft);
  color: #6f520b;
}

.unit-economics-status.is-info {
  border-left-color: var(--op-green);
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.unit-economics-status.is-error {
  border-left-color: var(--op-red);
  background: var(--op-red-soft);
  color: #8c2e2e;
}

.unit-economics-status.is-loading {
  border-left-color: #6d7b76;
}

.unit-economics-warning-details {
  margin: -2px 0 12px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--op-muted);
  font-size: 12px;
  line-height: 1.5;
}

.unit-economics-warning-details[hidden] {
  display: none;
}

.unit-economics-warning-details summary {
  padding: 10px 0;
  color: var(--op-green-dark);
  font-weight: 700;
  cursor: pointer;
}

.unit-economics-warning-details summary::marker {
  color: var(--op-green);
}

.unit-economics-warning-details-body {
  padding: 0 0 10px;
}

.unit-economics-warning-details p {
  margin: 0 0 8px;
}

.unit-economics-warning-details ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 18px;
}

.unit-economics-warning-details li::marker {
  color: var(--op-green);
}

.unit-economics-report-status.is-loading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 84px;
  background: #f7faf8;
  color: var(--op-text);
  font-size: 13px;
}

.unit-economics-status-spinner {
  width: 48px;
  height: 48px;
  box-sizing: border-box;
  border: 4px solid #d9e3df;
  border-top-color: var(--op-green);
  border-radius: 50%;
  animation: unit-economics-spin 720ms linear infinite;
}

.unit-economics-status-spinner[hidden] {
  display: none;
}

.unit-economics-status-spinner.is-compact {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

@keyframes unit-economics-spin {
  to {
    transform: rotate(360deg);
  }
}

.unit-economics-metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.unit-economics-metric-row {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.unit-economics-metric-row.is-financial {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.unit-economics-metric-row.is-operational {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.unit-economics-metric-card {
  position: relative;
  min-width: 0;
  min-height: 118px;
  border: 1px solid var(--op-line);
  border-top: 4px solid var(--op-green);
  border-radius: var(--op-radius);
  background: #ffffff;
  padding: 13px 40px 13px 14px;
}

.unit-economics-metric-card.is-expense {
  border-top-color: #df6a5d;
}

.unit-economics-metric-card.is-tax {
  border-top-color: var(--op-yellow);
}

.unit-economics-metric-card.is-profit {
  border-color: #9dd8c3;
  border-top-color: var(--op-green);
  background: var(--op-green-soft);
}

.unit-economics-forecast-badge,
.unit-economics-forecast-inline-badge {
  width: max-content;
  border: 1px solid #e3ba61;
  border-radius: 999px;
  background: #fff7df;
  color: #755612;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.unit-economics-forecast-badge {
  display: block;
  margin-top: 6px;
  padding: 5px 8px;
}

.unit-economics-forecast-badge[hidden] {
  display: none;
}

.unit-economics-metric-card > .unit-economics-metric-label,
.unit-economics-metric-card > strong,
.unit-economics-metric-card > small,
.unit-economics-metric-card > .unit-economics-metric-detail {
  display: block;
}

.unit-economics-metric-card > .unit-economics-metric-label {
  min-height: 34px;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.unit-economics-metric-card > strong {
  margin-top: 8px;
  color: var(--op-text);
  font-size: clamp(19px, 1.6vw, 26px);
  line-height: 1.1;
  white-space: nowrap;
}

.unit-economics-metric-card > small {
  margin-top: 7px;
  overflow: hidden;
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.unit-economics-metric-detail {
  margin-top: 3px;
  overflow: hidden;
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-help-trigger {
  --context-help-visual-size: 22px;

  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px !important;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--op-muted);
  padding: 0;
  font: inherit;
  font-size: 0;
  font-weight: 850;
  line-height: 1;
  cursor: help;
  transition: none !important;
}

.context-help-trigger::before {
  display: grid;
  place-items: center;
  position: absolute;
  width: var(--context-help-visual-size);
  height: var(--context-help-visual-size);
  border: 1px solid #c7d5d0;
  border-radius: 50%;
  background: #ffffff;
  color: currentColor;
  content: "?";
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.context-help-trigger.is-attention {
  color: #77540b;
}

.context-help-trigger.is-attention::before {
  border-color: #d9ad4d;
  background: #fff4cf;
  content: "!";
}

.context-help-trigger.is-attention:hover::before,
.context-help-trigger.is-attention:focus-visible::before,
.context-help-trigger.is-attention[aria-expanded="true"]::before {
  border-color: #c28d20;
  background: #ffe9a6;
}

.context-help-trigger:hover,
.context-help-trigger:focus-visible,
.context-help-trigger[aria-expanded="true"] {
  color: var(--op-green-dark);
  outline: 0;
}

.context-help-trigger:hover::before,
.context-help-trigger:focus-visible::before,
.context-help-trigger[aria-expanded="true"]::before {
  border-color: #82cbb1;
  background: var(--op-green-soft);
}

.context-help-trigger:focus-visible::before {
  box-shadow: 0 0 0 3px rgb(24 166 106 / 16%);
}

.context-help-trigger:active {
  transform: none !important;
}

.unit-economics-metric-card > .context-help-trigger {
  position: absolute;
  top: -1px;
  right: -1px;
}

.unit-economics-field-label .context-help-trigger {
  position: absolute;
  top: -13px;
  right: -16px;
  place-items: center;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.unit-economics-field-label .context-help-trigger::before {
  display: none;
  content: none;
}

.unit-economics-field-label .context-help-trigger:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.context-help-popup {
  position: fixed;
  z-index: 220;
  width: max-content;
  max-width: min(300px, calc(100vw - 20px));
  border: 1px solid #cbd8d3;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgb(9 30 24 / 18%);
  color: var(--op-text);
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.context-help-popup[hidden] {
  display: none;
}

.unit-economics-table-card,
.unit-economics-detail,
.unit-economics-unallocated,
.unit-economics-plan-form,
.unit-economics-plan-result {
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  background: #ffffff;
  box-shadow: 0 8px 24px rgb(20 37 32 / 4%);
}

.unit-economics-table-card,
.unit-economics-detail,
.unit-economics-unallocated {
  min-width: 0;
  margin-bottom: 12px;
  padding: 14px;
}

.unit-economics-table-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.unit-economics-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.unit-economics-section-head h2,
.unit-economics-section-head h3 {
  margin: 0;
  color: var(--op-text);
  font-size: 17px;
}

.unit-economics-section-head p {
  margin: 5px 0 0;
  color: var(--op-muted);
  font-size: 11px;
  line-height: 1.45;
}

.unit-economics-section-head > span,
.unit-economics-section-head > strong {
  flex: 0 0 auto;
  color: var(--op-muted);
  font-size: 12px;
  font-weight: 800;
}

.unit-economics-advertising-quality {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(880px, 100%);
  max-inline-size: min(880px, 100%);
  margin: 0 0 12px;
  border: 1px solid #e5a39d;
  border-left: 5px solid var(--op-red);
  border-radius: 7px;
  background: var(--op-red-soft);
  color: #7f2929;
  padding: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.5;
}

.unit-economics-advertising-quality[hidden] {
  display: none;
}

.unit-economics-advertising-quality > summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.unit-economics-advertising-quality > summary::-webkit-details-marker {
  display: none;
}

.unit-economics-advertising-quality > summary:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px rgb(168 59 52 / 20%);
}

.unit-economics-advertising-quality-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d97268;
  border-radius: 50%;
  background: #ffffff;
  color: #a83b34;
  font-size: 12px;
  font-weight: 950;
}

.unit-economics-advertising-quality-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.unit-economics-advertising-quality-copy > strong {
  color: #932f2f;
  font-size: 13px;
  font-weight: 850;
}

.unit-economics-advertising-quality-copy > span {
  font-weight: 700;
}

.unit-economics-advertising-quality-action {
  color: #8d3531;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.unit-economics-advertising-quality-action .is-open,
.unit-economics-advertising-quality[open] .unit-economics-advertising-quality-action .is-closed {
  display: none;
}

.unit-economics-advertising-quality[open] .unit-economics-advertising-quality-action .is-open {
  display: inline;
}

.unit-economics-advertising-quality-body {
  border-top: 1px solid rgb(168 59 52 / 16%);
  padding: 0 12px 10px 45px;
}

.unit-economics-advertising-quality ul {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.unit-economics-advertising-quality.is-warning {
  border-color: #e4c06e;
  border-left-color: #d9a62d;
  background: #fff8df;
  color: #74520f;
}

.unit-economics-advertising-quality.is-warning .unit-economics-advertising-quality-icon {
  border-color: #d9ad4d;
  color: #77540b;
}

.unit-economics-advertising-quality.is-warning .unit-economics-advertising-quality-copy > strong,
.unit-economics-advertising-quality.is-warning .unit-economics-advertising-quality-action {
  color: #76520b;
}

.unit-economics-advertising-quality.is-warning .unit-economics-advertising-quality-body {
  border-top-color: rgb(117 82 15 / 14%);
}

.unit-economics-advertising-quality.is-warning > summary:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(194 141 32 / 22%);
}

.unit-economics-table-wrap {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

body.auth-ready .unit-economics-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

#unit-economics-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 12px;
}

#unit-economics-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  border-bottom: 1px solid var(--op-line);
  background: #ffffff;
  color: #74817c;
  padding: 8px 6px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.015em;
  line-height: 1.2;
  text-align: right;
  text-transform: uppercase;
  white-space: normal;
}

#unit-economics-table th small,
#unit-economics-table th strong {
  display: block;
}

#unit-economics-table th small {
  margin-bottom: 4px;
  color: #96a19c;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

#unit-economics-table th strong {
  color: #64706a;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: normal;
}

#unit-economics-table th[data-column-key="product"],
#unit-economics-table td[data-column-key="product"] {
  position: sticky;
  left: 0;
  width: 224px;
  min-width: 224px;
  max-width: 224px;
  text-align: left;
  box-shadow: 1px 0 0 var(--op-line), 9px 0 16px rgb(20 37 32 / 7%);
}

#unit-economics-table th[data-column-key="product"] {
  z-index: 8;
  background: #f6f9f7;
}

#unit-economics-table td {
  border-bottom: 1px solid var(--op-line);
  color: var(--op-text);
  padding: 8px 6px;
  font-weight: 700;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

#unit-economics-table tbody td[data-column-key="product"] {
  z-index: 4;
  background: #ffffff;
}

#unit-economics-table tfoot th,
#unit-economics-table tfoot td {
  position: static;
  z-index: auto;
  border-top: 2px solid #a9d2c2;
  border-bottom: 0;
  background: #f2faf7;
  color: var(--op-text);
  padding: 9px 6px;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
}

#unit-economics-table tfoot th[data-column-key="product"],
#unit-economics-table tfoot td[data-column-key="product"] {
  position: sticky;
  z-index: 5;
  left: 0;
  background: #eaf7f2;
  color: var(--op-green-dark);
  text-align: left;
}

#unit-economics-table tfoot .unit-economics-unallocated-advertising-row > :is(th, td) {
  border-top: 1px solid #e5aaa4;
  background: #fff3f1;
  color: #8f342f;
}

#unit-economics-table tfoot .unit-economics-unallocated-advertising-row > [data-column-key="product"] {
  background: #fde8e5;
  color: #8f342f;
}

#unit-economics-table tfoot .unit-economics-unallocated-advertising-row th small {
  margin-top: 3px;
  margin-bottom: 0;
  color: #9f514b;
  text-transform: none;
}

#unit-economics-table :is(th, td)[data-column-width="units"] {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}

#unit-economics-table :is(th, td)[data-column-width="money"] {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

#unit-economics-table :is(th, td)[data-column-width="cost"] {
  width: 156px;
  min-width: 156px;
  max-width: 156px;
}

#unit-economics-table :is(th, td)[data-column-width="profit"] {
  width: 116px;
  min-width: 116px;
  max-width: 116px;
}

#unit-economics-table :is(th, td)[data-column-width="forecast"] {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

#unit-economics-table :is(th, td)[data-column-width="percent"] {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
}

#unit-economics-table :is(th, td)[data-column-width="status"] {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

#unit-economics-table tbody tr {
  cursor: pointer;
}

#unit-economics-table tbody tr:hover,
#unit-economics-table tbody tr:focus-within,
#unit-economics-table tbody tr.is-selected {
  background: #f2faf7;
}

#unit-economics-table tbody tr:hover td[data-column-key="product"],
#unit-economics-table tbody tr:focus-within td[data-column-key="product"],
#unit-economics-table tbody tr.is-selected td[data-column-key="product"] {
  background: #f2faf7;
}

#unit-economics-table tbody tr.is-selected td[data-column-key="product"] {
  box-shadow:
    inset 3px 0 0 var(--op-green),
    1px 0 0 var(--op-line),
    9px 0 16px rgb(20 37 32 / 7%);
}

#unit-economics-table .unit-economics-money-cell {
  white-space: normal;
}

#unit-economics-table .unit-economics-money-cell > strong,
#unit-economics-table .unit-economics-money-cell > small {
  display: block;
}

#unit-economics-table .unit-economics-money-cell > strong {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

#unit-economics-table .unit-economics-money-cell > small {
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.unit-economics-inline-quality {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  margin-top: 4px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.unit-economics-inline-quality.is-warning {
  background: var(--op-yellow-soft);
  color: #825a04;
}

.unit-economics-inline-quality.is-error {
  background: var(--op-red-soft);
  color: #9b3931;
}

#unit-economics-table .unit-economics-forecast-value {
  color: #2563a6;
  background: #f4f8ff;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

#unit-economics-table .unit-economics-forecast-value > strong,
#unit-economics-table .unit-economics-forecast-value > small {
  display: block;
}

#unit-economics-table .unit-economics-forecast-value > strong {
  color: #255f9d;
  font-size: 11px;
}

#unit-economics-table .unit-economics-forecast-value > small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: #667e98;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.unit-economics-forecast-inline-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
}

.unit-economics-product-button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--op-text);
  padding: 0;
  text-align: left;
}

.unit-economics-product-button strong {
  overflow: hidden;
  max-width: 196px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-economics-product-button small {
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 650;
}

.unit-economics-product-action {
  width: max-content;
  border-bottom: 1px solid rgb(24 166 106 / 32%);
  color: var(--op-green-dark);
  font-size: 10px;
  font-weight: 800;
}

.unit-economics-value-negative {
  color: #b8463a;
}

.unit-economics-value-positive {
  color: var(--op-green-dark);
}

.unit-economics-value-missing {
  color: #9a6a09;
}

.unit-economics-completeness-cell {
  vertical-align: middle;
}

.unit-economics-completeness-cell > .unit-economics-completeness {
  display: flex;
  width: max-content;
}

.unit-economics-completeness-cell > .unit-economics-completeness + .unit-economics-completeness {
  margin-top: 4px;
}

.unit-economics-completeness {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
  padding: 0 9px;
  font-size: 10px;
  font-weight: 850;
}

.unit-economics-completeness.is-warning {
  background: var(--op-yellow-soft);
  color: #8b6207;
}

.unit-economics-completeness.is-error {
  background: var(--op-red-soft);
  color: #a93d33;
}

.unit-economics-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 180px;
  border: 1px dashed var(--op-line-strong);
  border-radius: 7px;
  background: var(--op-panel-soft);
  color: var(--op-muted);
  padding: 24px;
  text-align: center;
}

.unit-economics-empty[hidden] {
  display: none;
}

.unit-economics-empty strong {
  color: var(--op-text);
  font-size: 15px;
}

.unit-economics-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.unit-economics-detail-grid[hidden],
.unit-economics-detail-loading[hidden] {
  display: none;
}

.unit-economics-detail-loading {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  margin-bottom: 12px;
  border: 1px solid var(--op-line);
  border-left: 4px solid #6d7b76;
  border-radius: 7px;
  background: #f7faf8;
  color: var(--op-text);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
}

.unit-economics-detail-loading.is-error {
  min-height: 54px;
  border-left-color: var(--op-red);
  background: var(--op-red-soft);
  color: #8c2e2e;
}

.unit-economics-waterfall-card {
  min-width: 0;
  margin: 0;
}

.unit-economics-waterfall-card figcaption strong {
  display: block;
  margin: 0;
  color: var(--op-text);
  font-size: 14px;
}

.unit-economics-waterfall {
  min-height: 0;
  margin-top: 10px;
  overflow: visible;
}

.unit-economics-waterfall-list {
  display: grid;
  gap: 0;
}

.unit-economics-waterfall-row {
  display: grid;
  grid-template-columns: minmax(128px, 0.9fr) minmax(110px, 1.1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid var(--op-line);
  border-left: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 2px;
}

.unit-economics-waterfall-row.is-expense {
  border-left-color: transparent;
}

.unit-economics-waterfall-row.is-composition {
  border-left-color: transparent;
  background: transparent;
}

.unit-economics-waterfall-row.is-positive,
.unit-economics-waterfall-row.is-total {
  border-left-color: transparent;
  background: #f4fbf8;
}

.unit-economics-waterfall-row.is-incomplete {
  border-left-color: transparent;
}

.unit-economics-waterfall-row meter {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 9px;
  border: 0;
  border-radius: 3px;
  background: #e8eeeb;
}

.unit-economics-waterfall-row meter::-webkit-meter-bar {
  border: 0;
  border-radius: 3px;
  background: #e8eeeb;
  box-shadow: none;
}

.unit-economics-waterfall-row meter::-webkit-meter-optimum-value {
  border-radius: 3px;
  background: #7faaa0;
}

.unit-economics-waterfall-row.is-expense meter::-webkit-meter-optimum-value {
  background: #df6a5d;
}

.unit-economics-waterfall-row.is-composition meter::-webkit-meter-optimum-value {
  background: #7c9fb4;
}

.unit-economics-waterfall-row.is-positive meter::-webkit-meter-optimum-value,
.unit-economics-waterfall-row.is-total meter::-webkit-meter-optimum-value {
  background: var(--op-green);
}

.unit-economics-waterfall-row.is-incomplete meter::-webkit-meter-optimum-value {
  background: #98a49f;
}

.unit-economics-detail-grid .unit-economics-waterfall {
  min-height: 0;
}

.unit-economics-detail-grid .unit-economics-waterfall-list {
  gap: 0;
}

.unit-economics-detail-grid .unit-economics-waterfall-row {
  grid-template-columns: minmax(150px, 0.9fr) minmax(120px, 1.4fr) auto;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px solid var(--op-line);
  border-left: 0;
  border-radius: 0;
  background: transparent;
  padding: 7px 2px;
}

.unit-economics-detail-grid .unit-economics-waterfall-label {
  min-width: 0;
  color: var(--op-text);
  font-size: 11px;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-align: right;
}

.unit-economics-detail-grid .unit-economics-waterfall-value {
  color: var(--op-text);
  font-size: 11px;
  white-space: nowrap;
}

.unit-economics-detail-grid .unit-economics-waterfall-row meter {
  width: 100%;
  min-width: 0;
  accent-color: var(--op-green);
}

.unit-economics-detail-grid .unit-economics-waterfall-row meter::-webkit-meter-optimum-value {
  background: var(--op-green);
}

.unit-economics-detail-grid .unit-economics-waterfall-row.is-expense meter {
  accent-color: #df6a5d;
}

.unit-economics-detail-grid .unit-economics-waterfall-row.is-expense meter::-webkit-meter-optimum-value {
  background: #df6a5d;
}

.unit-economics-detail-grid .unit-economics-waterfall-row.is-composition meter {
  accent-color: #7c9fb4;
}

.unit-economics-detail-grid .unit-economics-waterfall-row.is-composition meter::-webkit-meter-optimum-value {
  background: #7c9fb4;
}

.unit-economics-detail-grid .unit-economics-waterfall-row.is-incomplete meter {
  accent-color: #98a49f;
}

.unit-economics-detail-grid .unit-economics-waterfall-row.is-incomplete meter::-webkit-meter-optimum-value {
  background: #98a49f;
}

.unit-economics-breakdown {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.unit-economics-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid var(--op-line);
  color: var(--op-muted);
  font-size: 11px;
}

.unit-economics-breakdown-row:last-child {
  border-bottom: 0;
}

.unit-economics-breakdown-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.unit-economics-breakdown-row strong {
  color: var(--op-text);
  white-space: nowrap;
}

.unit-economics-heading-with-help h2 {
  margin: 0;
}

.unit-economics-shop-charges-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--op-line);
  border-radius: 7px;
}

.unit-economics-shop-charges-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.unit-economics-shop-charges-table th,
.unit-economics-shop-charges-table td {
  border-bottom: 1px solid var(--op-line);
  padding: 8px 10px;
}

.unit-economics-shop-charges-table th {
  background: var(--op-panel-soft);
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 850;
  text-align: left;
}

.unit-economics-shop-charges-table th:last-child,
.unit-economics-shop-charges-table td:last-child {
  width: 1%;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.unit-economics-shop-charges-table tbody tr:last-child td {
  border-bottom: 0;
}

.unit-economics-shop-charges-table tbody tr:hover {
  background: #f4fbf8;
}

@media (min-width: 1360px) {
  .unit-economics-waterfall-list:has(> .unit-economics-waterfall-row:nth-of-type(13)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .unit-economics-detail-grid
    .unit-economics-waterfall-list:has(> .unit-economics-waterfall-row:nth-of-type(13)) {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }
}

.unit-economics-plan-layout {
  display: grid;
  grid-template-columns: minmax(520px, 0.9fr) minmax(620px, 1.1fr);
  gap: 12px;
}

.unit-economics-plan-form,
.unit-economics-plan-result {
  padding: 16px;
}

.unit-economics-plan-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.unit-economics-plan-tariff-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.unit-economics-plan-tariff-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
}

.unit-economics-plan-tariff-grid select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-text);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
}

.unit-economics-plan-tariff-grid button {
  min-height: 40px;
}

.unit-economics-tariff-status {
  margin-top: 10px;
  border-left: 3px solid #7faaa0;
  background: var(--op-panel-soft);
  color: var(--op-muted);
  padding: 9px 11px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.unit-economics-tariff-status.is-loading {
  border-left-color: #7f8c87;
}

.unit-economics-tariff-status.is-error {
  border-left-color: #df6a5d;
  color: #8c2e2e;
}

.unit-economics-plan-form > .primary-button {
  width: 100%;
}

.unit-economics-plan-profit {
  border: 1px solid #9dd8c3;
  border-radius: 7px;
  background: var(--op-green-soft);
  padding: 14px;
}

.unit-economics-plan-profit span,
.unit-economics-plan-profit strong,
.unit-economics-plan-profit small {
  display: block;
}

.unit-economics-plan-profit span {
  color: var(--op-green-dark);
  font-size: 11px;
  font-weight: 850;
}

.unit-economics-plan-profit strong {
  margin-top: 6px;
  color: var(--op-text);
  font-size: 30px;
}

.unit-economics-plan-profit small {
  margin-top: 5px;
  color: var(--op-muted);
  font-size: 11px;
}

.unit-economics-settings-backdrop {
  position: fixed;
  z-index: 89;
  inset: 0;
  background: rgb(9 30 24 / 34%);
}

.unit-economics-settings {
  position: fixed;
  z-index: 90;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(1120px, calc(100vw - 36px));
  overflow: auto;
  border: 1px solid var(--op-line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgb(9 30 24 / 24%);
  padding: 18px;
}

.unit-economics-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.unit-economics-settings-head h2 {
  margin: 3px 0 0;
  color: var(--op-text);
  font-size: 23px;
}

.unit-economics-settings-head p:last-child {
  margin: 6px 0 0;
  color: var(--op-muted);
  font-size: 11px;
}

.unit-economics-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.unit-economics-settings-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--op-line);
  border-radius: 8px;
  background: var(--op-panel-soft);
  padding: 14px;
}

.unit-economics-settings-card h3 {
  margin: 0;
  color: var(--op-text);
  font-size: 15px;
}

.unit-economics-settings-card p {
  min-height: 32px;
  margin: 4px 0 0;
  color: var(--op-muted);
  font-size: 10px;
  line-height: 1.45;
}

.settings-date-picker {
  position: relative;
  width: 100%;
}

.unit-economics-settings-card .settings-date-trigger {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-self: stretch;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 0 44px 0 14px;
  color: var(--op-text);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.unit-economics-settings-card .settings-date-trigger::after {
  display: none;
}

.unit-economics-settings-card .settings-date-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-date-trigger-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  flex: 0 0 16px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  color: var(--op-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.settings-date-trigger-icon::before {
  position: absolute;
  top: 4px;
  right: 2px;
  left: 2px;
  border-top: 1.5px solid currentColor;
  content: "";
}

.settings-date-trigger-icon::after {
  position: absolute;
  top: -3px;
  right: 3px;
  left: 3px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  content: "";
}

.settings-date-popover {
  inset: calc(100% + 8px) auto auto 0;
  z-index: 80;
  width: min(320px, calc(100vw - 48px));
  padding: 14px;
}

.unit-economics-settings-card .settings-date-popover .range-nav-button {
  width: 32px;
  min-height: 32px;
  align-self: auto;
  margin: 0;
  padding: 0;
}

.settings-date-calendar {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.settings-date-calendar .range-month > strong {
  display: none;
}

.unit-economics-current-cogs {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #cfe2da;
  border-radius: 8px;
  background: #f5faf8;
  padding: 10px;
}

.unit-economics-current-cogs > strong {
  color: var(--op-text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
}

.unit-economics-current-cogs > span {
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
}

.unit-economics-current-cogs-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 10px;
  line-height: 1.4;
}

.unit-economics-current-cogs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgb(255 255 255 / 68%);
  padding: 7px 8px;
}

.unit-economics-current-cogs-row.is-selected {
  border-color: #a9d2c2;
  background: #ffffff;
  box-shadow: inset 3px 0 0 var(--op-green);
}

.unit-economics-current-cogs-row > span,
.unit-economics-current-cogs-row > strong,
.unit-economics-current-cogs-row > small {
  min-width: 0;
}

.unit-economics-current-cogs-row > span {
  color: var(--op-text);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.unit-economics-current-cogs-row > strong {
  color: var(--op-text);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.unit-economics-current-cogs-row > small {
  grid-column: 1 / -1;
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.unit-economics-settings-card button {
  align-self: end;
  margin-top: 4px;
}

.unit-economics-settings-card .unit-economics-settings-submit {
  width: 100%;
  min-height: 42px;
  margin: 0;
}

.unit-economics-settings-card-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 4px;
}

.unit-economics-settings-card .unit-economics-checkbox {
  display: flex;
  grid-template-columns: none;
  gap: 9px;
  align-items: flex-start;
  font-weight: 700;
  line-height: 1.4;
}

.unit-economics-settings-card .unit-economics-checkbox input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
}

.unit-economics-settings-hint {
  margin-top: -4px;
  color: var(--op-muted);
  font-size: 10px;
  line-height: 1.45;
}

.unit-economics-settings-history {
  margin-top: 12px;
  border: 1px solid var(--op-line);
  border-radius: 8px;
  padding: 14px;
}

.unit-economics-settings-history .unit-economics-section-head {
  align-items: center;
}

.unit-economics-settings-history:is(.is-expanded, :has(#unit-economics-settings-history-toggle[aria-expanded="true"])) #unit-economics-settings-history {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.unit-economics-settings-history:not(.is-expanded):has(#unit-economics-settings-history-toggle[aria-expanded="false"]) #unit-economics-settings-history > :not(:nth-last-child(-n + 3)) {
  display: none;
}

.unit-economics-columns-backdrop {
  position: fixed;
  z-index: 91;
  inset: 0;
  background: rgb(9 30 24 / 34%);
  opacity: 0;
  transition: opacity 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.unit-economics-columns-backdrop.is-open {
  opacity: 1;
}

.unit-economics-columns-drawer {
  position: fixed;
  z-index: 92;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  width: min(430px, 100vw);
  border-left: 1px solid var(--op-line);
  background: #ffffff;
  box-shadow: -24px 0 70px rgb(9 30 24 / 20%);
  transform: translateX(100%);
  transition: transform 210ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.unit-economics-columns-drawer.is-open {
  transform: translateX(0);
}

.unit-economics-columns-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--op-line);
  padding: 18px;
}

.unit-economics-columns-head h2 {
  margin: 4px 0 0;
  color: var(--op-text);
  font-size: 22px;
}

.unit-economics-columns-head p:last-child {
  max-width: 320px;
  margin-top: 6px;
  color: var(--op-muted);
  font-size: 10px;
  line-height: 1.45;
}

.unit-economics-columns-search {
  display: grid;
  gap: 6px;
  color: var(--op-muted);
  padding: 14px 18px 10px;
  font-size: 10px;
  font-weight: 800;
}

.unit-economics-columns-search input {
  min-height: 40px;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-text);
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
}

.unit-economics-columns-presets {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 18px 12px;
}

.unit-economics-columns-presets button,
.unit-economics-column-group-chip {
  min-height: 30px;
  border: 1px solid var(--op-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--op-muted);
  padding: 0 9px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.unit-economics-columns-presets button.is-active {
  border-color: #9dd8c3;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.unit-economics-user-presets {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--op-line);
  padding: 12px 18px;
}

.unit-economics-user-presets-head {
  justify-content: space-between;
}

.unit-economics-user-presets-head strong {
  color: var(--op-text);
  font-size: 11px;
}

.column-preset-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.column-preset-controls-heading {
  grid-column: 1 / -1;
  color: var(--op-text);
  font-size: 11px;
}

.column-preset-controls-field,
.column-preset-controls__field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 800;
}

.column-preset-controls-field-label {
  min-height: 13px;
}

.column-preset-controls-input,
.column-preset-controls-select,
.column-preset-controls__input,
.column-preset-controls__select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--op-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--op-text);
  padding: 0 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}

.column-preset-controls-actions,
.column-preset-controls__actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 6px;
}

.column-preset-controls-button,
.column-preset-controls-actions button,
.column-preset-controls__actions button {
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: auto;
  margin: 0;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--op-text);
  box-shadow: none;
  cursor: pointer;
  padding: 7px 9px;
  font: inherit;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
}

.column-preset-controls-button--primary {
  border-color: var(--op-green);
  background: var(--op-green);
  color: #ffffff;
}

.column-preset-controls-button--secondary {
  border-color: var(--op-line);
  background: #ffffff;
  color: var(--op-text);
}

.column-preset-controls-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.column-preset-controls-button:focus-visible {
  outline: 2px solid #77c6a9;
  outline-offset: 2px;
}

.column-preset-controls-status,
.column-preset-controls__status {
  grid-column: 1 / -1;
  min-height: 14px;
  margin: 0;
  color: var(--op-muted);
  font-size: 9px;
  line-height: 1.4;
}

.column-preset-controls-status.is-error,
.column-preset-controls__status.is-error,
.column-preset-controls .is-error {
  color: #9d3c32;
}

#statistics-column-presets {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: #ffffff;
  padding: 12px 24px 20px;
}

#statistics-column-presets[hidden] {
  display: none;
}

#columns-settings > .column-choice {
  display: grid;
  grid-template-columns: 24px 18px max-content minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 36px;
  padding: 6px 4px;
}

#columns-settings > .column-choice > .drag-handle {
  display: grid;
  place-items: center;
  align-self: start;
  width: 24px;
  min-width: 24px;
  height: 20px;
  margin: 0;
  line-height: 20px;
}

#columns-settings > .column-choice > input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 2px 0 0;
}

#columns-settings > .column-choice > span:not(.drag-handle, .locked-badge) {
  min-width: max-content;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

#columns-settings > .column-choice > .locked-badge {
  align-self: start;
  min-width: 0;
  justify-self: start;
  margin-left: 0;
  margin-top: 0;
  white-space: nowrap;
}

#columns-settings > .column-choice > .locked-badge.is-plan-lock {
  display: inline-grid;
  box-sizing: border-box;
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  justify-self: end;
  align-self: center;
  border-color: rgb(49 65 80 / 15%);
  border-radius: 50%;
  padding: 0;
  background-color: #ffffff;
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 72%, #edf1f4 100%);
  box-shadow:
    inset 0 -6px 10px -10px rgb(54 69 85 / 12%),
    0 1px 3px rgb(34 49 64 / 12%);
  color: #7d8792;
  font-size: 11px;
  line-height: 1;
  cursor: help;
}

.unit-economics-columns-list {
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
  border-top: 1px solid var(--op-line);
  padding: 12px 18px 18px;
}

.unit-economics-column-groups {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--op-line);
  padding: 10px 18px;
  scrollbar-width: thin;
}

.unit-economics-column-group-chip.is-active {
  border-color: #9dd8c3;
  background: var(--op-green-soft);
  color: var(--op-green-dark);
}

.unit-economics-column-choice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  border: 1px solid var(--op-line);
  border-radius: 7px;
  background: var(--op-panel-soft);
  padding: 9px;
  cursor: grab;
  transition: background 120ms ease, opacity 120ms ease, transform 120ms ease;
}

.unit-economics-column-choice:hover {
  border-color: #cbd8d3;
  background: #ffffff;
}

.unit-economics-column-choice.dragging {
  border-color: #9dd8c3;
  background: var(--op-green-soft);
  opacity: 0.72;
  transform: scale(0.99);
}

.unit-economics-column-choice label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-width: 0;
  padding-top: 2px;
}

.unit-economics-column-choice label > span,
.unit-economics-column-choice label strong,
.unit-economics-column-choice label small {
  display: block;
}

.unit-economics-column-choice label > span {
  min-width: 0;
}

.unit-economics-column-choice label strong {
  color: var(--op-text);
  font-size: 11px;
  line-height: 1.3;
}

.unit-economics-column-choice label small {
  margin-top: 3px;
  color: var(--op-muted);
  font-size: 9px;
  font-weight: 650;
}

.unit-economics-column-choice input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

.unit-economics-column-drag-handle {
  display: grid;
  place-items: center;
  align-self: start;
  width: 24px;
  min-width: 24px;
  height: 20px;
  min-height: 20px;
  border: 0;
  background: transparent;
  color: #9aa8a2;
  padding: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -4px;
  cursor: grab;
}

.unit-economics-column-choice > label {
  align-items: start;
  padding-top: 0;
}

.unit-economics-column-choice > label > input {
  align-self: start;
  margin: 2px 0 0;
}

button.unit-economics-column-drag-handle:focus-visible {
  border-radius: 5px;
  outline: 2px solid #77c6a9;
  outline-offset: 1px;
}

.unit-economics-column-choice.locked-choice {
  cursor: default;
  opacity: 0.72;
}

.unit-economics-columns-footer {
  border-top: 1px solid var(--op-line);
  background: #ffffff;
  padding: 13px 18px;
}

.unit-economics-columns-footer button {
  width: 100%;
}

.unit-economics-columns-empty {
  margin: 20px 0;
  color: var(--op-muted);
  font-size: 11px;
  text-align: center;
}

.unit-economics-actions button,
.unit-economics-tab,
.unit-economics-product-button,
.unit-economics-toolbar button,
.unit-economics-plan-form button,
.unit-economics-settings-card button,
.unit-economics-columns-drawer button {
  transition: transform 120ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 160ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.unit-economics-actions button:active,
.unit-economics-tab:active,
.unit-economics-product-button:active,
.unit-economics-toolbar button:active,
.unit-economics-plan-form button:active,
.unit-economics-settings-card button:active,
.unit-economics-columns-drawer button:active {
  transform: scale(0.98);
}

@media (max-width: 1500px) {
  .unit-economics-toolbar {
    grid-template-columns: 240px minmax(170px, 1fr) minmax(145px, 1fr) minmax(145px, 1fr) auto;
  }

  .unit-economics-metric-row.is-financial,
  .unit-economics-metric-row.is-operational {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .unit-economics-metric-card {
    min-height: 112px;
  }
}

@media (max-width: 1180px) {
  .unit-economics-detail-grid,
  .unit-economics-plan-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-economics-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-economics-metric-row.is-financial,
  .unit-economics-metric-row.is-operational {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-economics-plan-tariff-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .unit-economics-plan-tariff-grid button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  body.auth-ready.unit-economics-mode .side-nav {
    width: min(82vw, 320px);
    max-width: calc(100vw - 48px);
    transform: translateX(calc(-100% - 18px));
    transition: transform 220ms var(--ease-out), box-shadow 220ms ease;
    box-shadow: 18px 0 42px rgb(15 23 42 / 14%);
  }

  body.auth-ready.unit-economics-mode.mobile-nav-open .side-nav {
    transform: translateX(0);
  }

  body.auth-ready.unit-economics-mode .mobile-nav-toggle {
    display: inline-flex !important;
  }

  body.auth-ready.unit-economics-mode.mobile-nav-open .mobile-menu-backdrop {
    display: block !important;
  }
}

@media (max-width: 760px) {
  body.unit-economics-mode .page {
    width: 100%;
    margin-left: 0;
    padding: 14px;
  }

  .unit-economics-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding-top: 48px;
  }

  .unit-economics-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .unit-economics-actions button {
    width: 100%;
    min-width: 0;
  }

  .unit-economics-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-economics-metric-row.is-financial,
  .unit-economics-metric-row.is-operational {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-economics-range-control {
    width: 100%;
    min-width: 0;
  }

  body.auth-ready #unit-economics-range-popover {
    width: calc(100vw - 52px);
    max-width: calc(100vw - 52px);
  }

  #unit-economics-range-popover .stats-range-popover-body,
  #unit-economics-range-calendar {
    grid-template-columns: minmax(0, 1fr);
  }

  #unit-economics-range-popover .stats-period-presets {
    border-top: 1px solid var(--op-line);
    border-left: 0;
    padding-top: 12px;
    padding-left: 0;
  }

  .unit-economics-plan-fields,
  .unit-economics-plan-tariff-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-economics-plan-tariff-grid button {
    grid-column: auto;
  }

  .unit-economics-detail-grid .unit-economics-waterfall-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 8px;
  }

  .unit-economics-detail-grid .unit-economics-waterfall-label {
    grid-column: 1;
    grid-row: 1;
    text-align: left;
  }

  .unit-economics-detail-grid .unit-economics-waterfall-value {
    grid-column: 2;
    grid-row: 1;
  }

  .unit-economics-detail-grid .unit-economics-waterfall-row meter {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .unit-economics-settings-history .unit-economics-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .unit-economics-settings-history .unit-economics-section-head button {
    width: 100%;
  }

  .column-preset-controls,
  .column-preset-controls-actions,
  .column-preset-controls__actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* One-way support widget. It stays available on login, restricted and app views. */
.support-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 850;
  display: grid;
  align-items: center;
  justify-items: center;
  width: 68px;
  height: 68px;
  padding: 0;
  border: 1px solid var(--aw-white-edge, rgb(49 65 80 / 15%));
  border-radius: 50%;
  color: #2563eb;
  background: linear-gradient(
    180deg,
    var(--aw-white-top, #fff) 0%,
    var(--aw-white-middle, #f8fafc) 25%,
    var(--aw-white-middle, #f8fafc) 75%,
    var(--aw-white-bottom, #e9edf1) 100%
  );
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
    var(--aw-control-shadow, 0 0 6px rgb(24 36 48 / 16%));
  font: inherit;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.support-launcher > svg {
  width: 34px;
  height: 34px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.support-launcher:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
    var(--aw-control-shadow-hover, 0 0 24px rgb(34 49 64 / 12%));
}

.support-launcher:active {
  transform: translateY(1px) scale(.986);
  box-shadow:
    inset 0 -10px 16px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
    var(--aw-control-shadow-active, 0 0 13px rgb(34 49 64 / 9%));
}

.support-launcher:focus-visible,
.support-close:focus-visible,
.support-actions button:focus-visible {
  border-color: var(--aw-blue-edge-active, rgb(65 153 214 / 78%));
  outline: 3px solid var(--aw-blue-ring, rgb(91 181 230 / 24%));
  outline-offset: 3px;
}

.support-backdrop {
  position: fixed;
  inset: 0;
  z-index: 890;
  background: rgb(15 23 42 / 34%);
}

.support-dialog {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: min(470px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid var(--aw-white-edge, rgb(49 65 80 / 15%));
  border-radius: var(--aw-panel-radius, 28px);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 88%, #eef1f4 100%);
  box-shadow: var(--aw-panel-shadow, 0 18px 48px rgb(34 49 64 / 7%));
}

.support-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  background: #fff;
}

.support-dialog-head h2 {
  margin: 4px 0 0;
  color: #111827;
  font-size: 22px;
  line-height: 1.18;
}

.support-eyebrow {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.support-close {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--aw-white-edge, rgb(49 65 80 / 15%));
  border-radius: var(--aw-control-radius, 16px);
  color: #475569;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 70%, #e9edf1 100%);
  box-shadow:
    inset 0 -10px 16px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
    var(--aw-control-shadow, 0 0 6px rgb(24 36 48 / 16%));
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.support-form {
  display: grid;
  gap: 14px;
  padding: 0 22px 22px;
}

.support-intro,
.support-privacy {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.support-anonymous-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.support-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.support-form :is(input[type="text"], input[type="email"], textarea) {
  width: 100%;
  border: 1px solid #dbe2ea;
  border-radius: 13px;
  color: #172033;
  background: #fff;
  font: inherit;
}

.support-form :is(input[type="text"], input[type="email"]) {
  min-height: 43px;
  padding: 9px 12px;
}

.support-form textarea {
  min-height: 132px;
  padding: 11px 12px;
  resize: vertical;
}

.support-form :is(input, textarea):focus {
  border-color: #7aa7ff;
  outline: 3px solid rgb(37 99 235 / 13%);
}

.support-files-field {
  padding: 13px;
  border: 1px dashed #cbd5e1;
  border-radius: 15px;
  background: #f8fafc;
}

.support-files-field input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-files-field input::file-selector-button {
  min-height: 36px;
  margin: 0 10px 0 0;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  color: #334155;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 8%);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.support-files-field small {
  color: #64748b;
  font-weight: 500;
  line-height: 1.45;
}

.support-file-list {
  display: grid;
  gap: 7px;
}

.support-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
}

.support-file-item strong {
  display: block;
  overflow: hidden;
  color: #1e293b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-file-item > span {
  min-width: 0;
}

.support-file-item small {
  display: block;
  margin-top: 2px;
  color: #64748b;
}

.support-file-remove {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  color: #475569;
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.support-file-remove:hover {
  border-color: #94a3b8;
  color: #1e293b;
}

.support-status {
  min-height: 19px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.support-status[data-tone="error"] { color: #b42318; }
.support-status[data-tone="warning"] { color: #a15c00; }
.support-status[data-tone="success"] { color: #087443; }

.support-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.support-actions button {
  min-height: 43px;
  padding: 9px 16px;
  border: 1px solid var(--aw-white-edge, rgb(49 65 80 / 15%));
  border-radius: var(--aw-control-radius, 16px);
  color: var(--aw-text, #17202a);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 25%, #f8fafc 75%, #e9edf1 100%);
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
    var(--aw-control-shadow, 0 0 6px rgb(24 36 48 / 16%));
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms var(--aw-ease, ease), box-shadow 160ms var(--aw-ease, ease);
}

.support-cancel {
  color: #475569;
}

.support-submit {
  border-color: rgb(15 159 110 / 42%);
  color: #087443;
}

@media (hover: hover) and (pointer: fine) {
  .support-close:hover,
  .support-actions button:hover {
    transform: translateY(-1px) scale(1.005);
    box-shadow:
      inset 0 -12px 18px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
      var(--aw-control-shadow-hover, 0 0 24px rgb(34 49 64 / 12%));
  }
}

.support-close:active,
.support-actions button:active {
  transform: translateY(1px) scale(.986);
  box-shadow:
    inset 0 -10px 16px -12px var(--aw-white-inner-depth, rgb(54 69 85 / 10%)),
    var(--aw-control-shadow-active, 0 0 13px rgb(34 49 64 / 9%));
}

.support-submit:disabled {
  cursor: wait;
  opacity: .65;
}

.support-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
}

body.support-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .support-launcher {
    right: 12px;
    bottom: 12px;
    width: 64px;
    height: 64px;
  }

  .support-dialog {
    inset: auto 8px 8px;
    width: auto;
    max-height: calc(100vh - 16px);
    border-radius: 20px;
  }

  .support-dialog-head {
    padding: 18px 16px 12px;
  }

  .support-form {
    padding: 0 16px 18px;
  }

  .support-anonymous-fields {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-launcher,
  .support-close,
  .support-actions button,
  .unit-economics-status-spinner {
    transition: none;
    animation: none;
  }

  .unit-economics-actions button,
  .unit-economics-tab,
  .unit-economics-product-button,
  .unit-economics-toolbar button,
  .unit-economics-plan-form button,
  .unit-economics-settings-card button,
  .unit-economics-columns-drawer,
  .unit-economics-columns-backdrop,
  .unit-economics-columns-drawer button {
    transition: none;
  }
}

/* Local Apple-white material study — opaque, softly dimensional, no glass. */
:root {
  --aw-canvas-top: #f8f9fa;
  --aw-canvas-middle: #eef1f4;
  --aw-canvas-bottom: #e7ebef;
  --aw-white-top: #ffffff;
  --aw-white-middle: #f8fafc;
  --aw-white-bottom: #e9edf1;
  --aw-white-edge: rgb(49 65 80 / 15%);
  --aw-white-inner-depth: rgb(54 69 85 / 10%);
  --aw-text: #17202a;
  --aw-muted: #68727d;
  --aw-focus: #0f9f6e;
  --aw-control-shadow:
    0 0 6px rgb(24 36 48 / 16%),
    0 0 19px rgb(34 49 64 / 10.5%);
  --aw-control-shadow-hover:
    0 0 7px rgb(24 36 48 / 17%),
    0 0 24px rgb(34 49 64 / 11.5%);
  --aw-control-shadow-active:
    0 0 4px rgb(24 36 48 / 17%),
    0 0 13px rgb(34 49 64 / 8.5%);
  --aw-tile-shadow:
    0 0 5px rgb(24 36 48 / 9%),
    0 8px 24px rgb(34 49 64 / 8%);
  --aw-panel-shadow: 0 18px 48px rgb(34 49 64 / 7%);
  --aw-control-radius: 16px;
  --aw-tile-radius: 22px;
  --aw-panel-radius: 28px;
  --aw-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button
  ) {
  min-height: 44px;
  border: 1px solid var(--aw-white-edge);
  border-radius: var(--aw-control-radius);
  background: linear-gradient(
    180deg,
    var(--aw-white-top) 0%,
    var(--aw-white-middle) 25%,
    var(--aw-white-middle) 75%,
    var(--aw-white-bottom) 100%
  );
  color: var(--aw-text);
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth),
    var(--aw-control-shadow);
  transform: translateY(0) scale(1);
  transition:
    transform 160ms var(--aw-ease),
    box-shadow 160ms var(--aw-ease),
    border-color 160ms ease,
    color 160ms ease;
}

:is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button
  ):focus-visible {
  outline: 3px solid var(--aw-blue-ring, rgb(91 181 230 / 24%));
  outline-offset: 3px;
  border-color: var(--aw-blue-edge-active, rgb(65 153 214 / 78%));
}

:where(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button
  ):disabled {
  color: #929aa3;
  box-shadow:
    inset 0 -10px 16px -12px rgb(54 69 85 / 7%),
    0 0 4px rgb(34 49 64 / 6%);
  cursor: not-allowed;
  opacity: 0.68;
}

@media (hover: hover) and (pointer: fine) {
  :is(
      .primary-button,
      .secondary-button,
      .ghost-button,
      .compact-button,
      .range-done-button,
      .icon-button,
      .preset-button,
      .range-nav-button,
      .add-comparison,
      .comparison-remove-button,
      .stats-subtab,
      .unit-economics-tab,
      .unit-economics-product-button
    ):not(:disabled):hover {
    border-color: rgb(49 65 80 / 20%);
    box-shadow:
      inset 0 -12px 18px -12px var(--aw-white-inner-depth),
      var(--aw-control-shadow-hover);
    transform: translateY(-1px) scale(1.006);
  }
}

:is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button
  ):not(:disabled):active {
  box-shadow:
    inset 0 -10px 16px -12px rgb(54 69 85 / 12%),
    var(--aw-control-shadow-active);
  transform: translateY(1px) scale(0.986);
}

@media (prefers-reduced-motion: reduce) {
  :is(
      .primary-button,
      .secondary-button,
      .ghost-button,
      .compact-button,
      .range-done-button,
      .icon-button,
      .preset-button,
      .range-nav-button,
      .add-comparison,
      .comparison-remove-button,
      .stats-subtab,
      .unit-economics-tab,
      .unit-economics-product-button
    ) {
    transition: none;
  }
}

/* Apple-white local theme: canvas and shared color/border tokens. */
:root {
  --bg: var(--aw-canvas-middle);
  --panel: #ffffff;
  --text: var(--aw-text);
  --muted: var(--aw-muted);
  --line: #d8dde2;
  --op-bg: var(--aw-canvas-middle);
  --op-panel: #ffffff;
  --op-panel-soft: #f7f9fa;
  --op-text: var(--aw-text);
  --op-muted: var(--aw-muted);
  --op-line: #d8dde2;
  --op-line-strong: #cbd2d9;
  --op-shadow: var(--aw-panel-shadow);
  --op-radius: 18px;
}

body {
  background:
    radial-gradient(circle at 18% 8%, #ffffff 0, #ffffff 18%, transparent 46%),
    radial-gradient(circle at 82% 92%, #eef1f5 0, transparent 44%),
    linear-gradient(
      155deg,
      var(--aw-canvas-top) 0%,
      var(--aw-canvas-middle) 52%,
      var(--aw-canvas-bottom) 100%
    );
  background-attachment: fixed;
}

.page,
body.stats-mode .page,
body.future-mode .page,
body.unit-economics-mode .page {
  background: transparent;
}

/* Interactive depth: actions, navigation and select-like triggers. */
body :is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button,
    .side-link,
    .side-logout,
    .stats-range-trigger,
    .heatmap-product-trigger
  ) {
  min-height: 44px;
  border: 1px solid var(--aw-white-edge);
  border-radius: var(--aw-control-radius);
  background-color: var(--aw-white-middle);
  background-image: linear-gradient(
    180deg,
    var(--aw-white-top) 0%,
    var(--aw-white-middle) 25%,
    var(--aw-white-middle) 75%,
    var(--aw-white-bottom) 100%
  );
  color: var(--aw-text);
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth),
    var(--aw-control-shadow);
  backdrop-filter: none;
}

body select {
  box-sizing: border-box;
  line-height: normal;
  text-align: start;
}

body :is(
    .primary-button,
    .side-link.active,
    .side-link[aria-current="page"],
    .stats-subtab.active,
    .unit-economics-tab.is-active,
    .preset-button.active
  ) {
  border-color: var(--aw-blue-edge-active, rgb(65 153 214 / 78%));
  background-color: #f3f9fe;
  background-image: linear-gradient(
    180deg,
    #ffffff 0%,
    #f3f9fe 25%,
    #f3f9fe 75%,
    #e3f1fb 100%
  );
  color: #176b9f;
  box-shadow:
    inset 0 -12px 18px -12px rgb(46 126 178 / 9%),
    0 0 6px rgb(65 153 214 / 13%),
    0 0 20px rgb(65 153 214 / 9%);
}

body :is(.danger-button, .comparison-remove-button) {
  border-color: rgb(196 55 62 / 24%);
  background-color: #fff7f7;
  background-image: linear-gradient(
    180deg,
    #ffffff 0%,
    #fff7f7 25%,
    #fff7f7 75%,
    #f6e7e8 100%
  );
  color: #a52f38;
}

body :is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button,
    .side-link,
    .side-logout,
    .stats-range-trigger,
    .heatmap-product-trigger
  ):focus-visible {
  outline: 3px solid var(--aw-blue-ring, rgb(91 181 230 / 24%));
  outline-offset: 3px;
  border-color: var(--aw-blue-edge-active, rgb(65 153 214 / 78%));
}

@media (hover: hover) and (pointer: fine) {
  body
    :is(
      .primary-button,
      .secondary-button,
      .ghost-button,
      .compact-button,
      .range-done-button,
      .icon-button,
      .preset-button,
      .range-nav-button,
      .add-comparison,
      .comparison-remove-button,
      .stats-subtab,
      .unit-economics-tab,
      .unit-economics-product-button,
      .side-link,
      .side-logout,
      .stats-range-trigger,
      .heatmap-product-trigger
    ):not(:disabled):hover {
    box-shadow:
      inset 0 -12px 18px -12px var(--aw-white-inner-depth),
      var(--aw-control-shadow-hover);
    transform: translateY(-1px) scale(1.006);
  }
}

body
  :is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-button,
    .side-link,
    .side-logout,
    .stats-range-trigger,
    .heatmap-product-trigger
  ):not(:disabled):active {
  box-shadow:
    inset 0 -10px 16px -12px rgb(54 69 85 / 12%),
    var(--aw-control-shadow-active);
  transform: translateY(1px) scale(0.986);
}

/* Field depth: the same even edge and shadow as the select-like controls. */
body :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .column-preset-select
  ) {
  min-height: 44px;
  border: 1px solid var(--aw-blue-edge, rgb(91 164 214 / 42%));
  border-radius: var(--aw-control-radius);
  background-color: #f8fafc;
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 76%, #edf1f4 100%);
  color: var(--aw-text);
  box-shadow: var(--aw-control-shadow);
  backdrop-filter: none;
}

body
  :is(
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea,
    .column-preset-select
  ):focus {
  border-color: var(--aw-blue-edge-active, rgb(65 153 214 / 78%));
  outline: none;
  box-shadow:
    0 0 0 3px var(--aw-blue-ring, rgb(91 181 230 / 24%)),
    var(--aw-control-shadow);
}

/* Tile depth: KPI and compact information surfaces. */
body.auth-ready :is(
    .metric-card,
    .cabinet-tile,
    .cpc-stat-card,
    .cpc-stat-tile,
    .cpc-drr-tile,
    .unit-economics-metric-card,
    .indicator-card,
    .future-card,
    .store-card,
    .session-card,
    .cpc-rule-card,
    .cpc-product-card
  ) {
  border: 1px solid rgb(49 65 80 / 12%);
  border-radius: var(--aw-tile-radius);
  background-color: var(--aw-white-middle);
  background-image: linear-gradient(
    180deg,
    #ffffff 0%,
    #f9fafb 18%,
    #f9fafb 82%,
    #edf1f4 100%
  );
  box-shadow:
    inset 0 -10px 18px -15px rgb(54 69 85 / 8%),
    var(--aw-tile-shadow);
  backdrop-filter: none;
}

/* Preserve semantic meaning with opaque near-white materials. */
body.auth-ready :is(
    .metric-card.accent.heat-good,
    .cpc-product-card-excellent,
    .cpc-product-card-good,
    .cpc-rule-card-good
  ) {
  border-color: rgb(15 159 110 / 24%);
  background-color: #f5fbf8;
  background-image: linear-gradient(180deg, #ffffff 0%, #f5fbf8 22%, #f5fbf8 78%, #e5f3eb 100%);
}

body.auth-ready :is(
    .metric-card.accent.heat-warn,
    .cabinet-tile.is-warning,
    .cpc-product-card-normal,
    .cpc-rule-card-normal
  ) {
  border-color: rgb(180 132 28 / 24%);
  background-color: #fffaf0;
  background-image: linear-gradient(180deg, #ffffff 0%, #fffaf0 22%, #fffaf0 78%, #f7edd4 100%);
}

body.auth-ready :is(
    .metric-card.accent.heat-bad,
    .cpc-product-card-poor,
    .cpc-product-card-critical,
    .cpc-rule-card-bad,
    .cpc-rule-card.is-invalid
  ) {
  border-color: rgb(196 55 62 / 23%);
  background-color: #fff7f7;
  background-image: linear-gradient(180deg, #ffffff 0%, #fff7f7 22%, #fff7f7 78%, #f6e7e8 100%);
}

/* Panel depth: broad, calm surfaces for zones, tables, dialogs and drawers. */
body :is(
    .side-nav,
    .toolbar,
    .heatmap-card,
    .chart-panel,
    .stats-table-section,
    .stats-data-panel,
    .cpc-search-panel,
    .cpc-recommendation-panel,
    .cpc-rule-panel,
    .unit-economics-table-card,
    .unit-economics-waterfall-card,
    .unit-economics-settings-card,
    .login-panel,
    .download-modal,
    .settings-drawer,
    .unit-economics-download-modal,
    .unit-economics-columns-drawer,
    .stats-range-popover,
    .heatmap-product-list
  ) {
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: var(--aw-panel-radius);
  background-color: #f8fafb;
  background-image: linear-gradient(180deg, #ffffff 0%, #fafbfc 12%, #f6f8fa 90%, #edf1f4 100%);
  box-shadow:
    inset 0 -8px 22px -20px rgb(54 69 85 / 7%),
    var(--aw-panel-shadow);
  backdrop-filter: none;
}

.side-nav {
  border-width: 0 1px 0 0;
  border-radius: 0 30px 30px 0;
  box-shadow: 12px 0 38px rgb(34 49 64 / 7%);
}

.side-menu {
  gap: 9px;
}

.side-link {
  padding-inline: 14px;
}

/* Table zones stay calm; rows and cells are not raised as separate buttons. */
body :is(
    .table-wrap,
    .heatmap-table-wrap,
    .hour-heatmap-wrap,
    .cpc-bid-wrap,
    .cpc-history-wrap,
    .unit-economics-table-wrap,
    .unit-economics-shop-charges-table-wrap,
    .audit-log-wrap
  ) {
  border: 1px solid rgb(49 65 80 / 10%);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: inset 0 0 18px rgb(34 49 64 / 3%);
}

body :is(
    .stats-table,
    .comparison-stats-table,
    .heatmap-table,
    .cpc-product-table,
    .cpc-history-table,
    .unit-economics-table,
    .unit-economics-shop-charges-table,
    .audit-log-table
  ) {
  background: #ffffff;
}

body :is(
    .stats-table,
    .comparison-stats-table,
    .heatmap-table,
    .cpc-product-table,
    .cpc-history-table,
    .unit-economics-table,
    .unit-economics-shop-charges-table,
    .audit-log-table
  ) :is(th, td) {
  border-color: rgb(49 65 80 / 9%);
  box-shadow: none;
}

body :is(
    .stats-table,
    .comparison-stats-table,
    .heatmap-table,
    .cpc-product-table,
    .cpc-history-table,
    .unit-economics-table,
    .unit-economics-shop-charges-table,
    .audit-log-table
  ) th {
  background: #f6f8fa;
}

/* Give the table itself a rounded, clipped silhouette on every heatmap card. */
.heatmap-table {
  border-radius: 18px;
  overflow: hidden;
}

.heatmap-table thead tr:first-child > th:first-child {
  border-top-left-radius: 16px;
}

.heatmap-table thead tr:first-child > th:last-child {
  border-top-right-radius: 16px;
}

.heatmap-table tbody tr:last-child > th:first-child {
  border-bottom-left-radius: 16px;
}

.heatmap-table tbody tr:last-child > td:last-child {
  border-bottom-right-radius: 16px;
}

@media (max-width: 760px) {
  body :is(
      .primary-button,
      .secondary-button,
      .ghost-button,
      .compact-button,
      .range-done-button,
      .icon-button,
      .preset-button,
      .range-nav-button,
      .add-comparison,
      .comparison-remove-button,
      .stats-subtab,
      .unit-economics-tab,
      .unit-economics-product-button,
      .side-link,
      .side-logout,
      .stats-range-trigger,
      .heatmap-product-trigger
    ) {
    box-shadow:
      inset 0 -10px 16px -12px var(--aw-white-inner-depth),
      0 0 5px rgb(24 36 48 / 13%),
      0 0 15px rgb(34 49 64 / 8%);
  }

  body.auth-ready :is(
      .metric-card,
      .cabinet-tile,
      .cpc-stat-card,
      .cpc-stat-tile,
      .cpc-drr-tile,
      .unit-economics-metric-card,
      .indicator-card,
      .future-card,
      .store-card,
      .session-card,
      .cpc-rule-card,
      .cpc-product-card
    ) {
    box-shadow:
      inset 0 -8px 16px -14px rgb(54 69 85 / 7%),
      0 6px 18px rgb(34 49 64 / 6%);
  }
}

@media (prefers-reduced-motion: reduce) {
  body :is(
      .primary-button,
      .secondary-button,
      .ghost-button,
      .compact-button,
      .range-done-button,
      .icon-button,
      .preset-button,
      .range-nav-button,
      .add-comparison,
      .comparison-remove-button,
      .stats-subtab,
      .unit-economics-tab,
      .unit-economics-product-button,
      .side-link,
      .side-logout,
      .stats-range-trigger,
      .heatmap-product-trigger
    ) {
    transition: none;
  }
}

/* Local review pass: even edges, anchored heatmap details and completed controls. */
:root {
  --aw-control-shadow:
    0 0 0 1px rgb(32 45 58 / 3%),
    0 0 6px rgb(24 36 48 / 14%),
    0 0 18px rgb(34 49 64 / 9%);
  --aw-control-shadow-hover:
    0 0 0 1px rgb(32 45 58 / 4%),
    0 0 7px rgb(24 36 48 / 16%),
    0 0 22px rgb(34 49 64 / 10%);
  --aw-control-shadow-active:
    0 0 0 1px rgb(32 45 58 / 4%),
    0 0 5px rgb(24 36 48 / 15%),
    0 0 13px rgb(34 49 64 / 8%);
  --aw-tile-shadow:
    0 0 0 1px rgb(32 45 58 / 2%),
    0 0 6px rgb(24 36 48 / 8%),
    0 0 20px rgb(34 49 64 / 7%);
  --aw-panel-shadow:
    0 0 0 1px rgb(32 45 58 / 2%),
    0 0 10px rgb(24 36 48 / 5%),
    0 0 34px rgb(34 49 64 / 7%);
}

body :is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-action,
    .side-link,
    .side-logout,
    .stats-range-trigger,
    .heatmap-product-trigger
  ) {
  border-color: rgb(49 65 80 / 18%);
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--aw-control-shadow);
}

@media (hover: hover) and (pointer: fine) {
  body
    :is(
      .primary-button,
      .secondary-button,
      .ghost-button,
      .compact-button,
      .range-done-button,
      .icon-button,
      .preset-button,
      .range-nav-button,
      .add-comparison,
      .comparison-remove-button,
      .stats-subtab,
      .unit-economics-tab,
      .unit-economics-product-action,
      .side-link,
      .side-logout,
      .stats-range-trigger,
      .heatmap-product-trigger
    ):not(:disabled):hover {
    box-shadow: var(--aw-control-shadow-hover);
  }
}

body
  :is(
    .primary-button,
    .secondary-button,
    .ghost-button,
    .compact-button,
    .range-done-button,
    .icon-button,
    .preset-button,
    .range-nav-button,
    .add-comparison,
    .comparison-remove-button,
    .stats-subtab,
    .unit-economics-tab,
    .unit-economics-product-action,
    .side-link,
    .side-logout,
    .stats-range-trigger,
    .heatmap-product-trigger
  ):not(:disabled):active {
  box-shadow: var(--aw-control-shadow-active);
}

body.auth-ready :is(
    .metric-card,
    .cabinet-tile,
    .cpc-stat-card,
    .cpc-stat-tile,
    .cpc-drr-tile,
    .unit-economics-metric-card,
    .indicator-card,
    .future-card,
    .store-card,
    .session-card,
    .cpc-rule-card
  ) {
  background-image: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: var(--aw-tile-shadow);
}

/* Settings workspace: opaque surfaces, blue actions, green only for success. */
#app-settings-view {
  --settings-blue: var(--blue);
  --settings-blue-soft: #eef5ff;
  --settings-blue-edge: rgb(20 87 168 / 30%);
  --settings-surface: #fff;
  --settings-subtle: #f7f8fa;
  min-width: 0;
  overflow: visible;
}

#app-settings-view .settings-header {
  min-height: auto;
}

#app-settings-view .settings-tabs {
  display: flex;
  width: 100%;
  gap: 6px;
  margin: 0 0 16px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--aw-tile-radius);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: var(--aw-tile-shadow);
  scrollbar-width: thin;
}

#app-settings-view .settings-tab {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--aw-control-radius);
  padding: 0 17px;
  background: transparent;
  color: #52606f;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

#app-settings-view .settings-tab:hover {
  color: var(--settings-blue);
  background: rgb(255 255 255 / 62%);
}

#app-settings-view .settings-tab.is-active {
  border-color: var(--settings-blue-edge);
  background: linear-gradient(180deg, #ffffff 0%, #f3f9fe 76%, #e3f1fb 100%);
  color: var(--settings-blue);
  box-shadow: inset 0 -12px 18px -12px rgb(46 126 178 / 9%), var(--aw-control-shadow);
}

#app-settings-view .settings-panel {
  display: grid;
  min-width: 0;
  gap: 14px;
}

#app-settings-view .settings-summary-card,
#app-settings-view .settings-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--aw-tile-radius);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: var(--aw-tile-shadow);
}

#app-settings-view .settings-summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

#app-settings-view .settings-summary-card > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#app-settings-view .settings-summary-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-settings-view .settings-summary-card span,
#app-settings-view .settings-summary-card small {
  overflow-wrap: anywhere;
  color: var(--muted);
}

#app-settings-view .settings-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgb(20 87 168 / 18%);
  border-radius: 14px;
  background: var(--settings-blue-soft);
  color: var(--settings-blue);
  font-size: 14px;
  font-weight: 900;
}

#app-settings-view .settings-card {
  border-radius: var(--aw-panel-radius);
  padding: 20px;
  box-shadow: var(--aw-panel-shadow);
}

#app-settings-view .settings-card h3 {
  margin: 0 0 16px;
  font-size: 17px;
  letter-spacing: -0.015em;
}

#app-settings-view .settings-card-head,
#app-settings-view .settings-summary-meta,
#app-settings-view .audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#app-settings-view .settings-card-head h3 {
  margin-bottom: 0;
}

#app-settings-view .settings-form,
.settings-modal .settings-form {
  display: grid;
  min-width: 0;
  gap: 14px;
}

#app-settings-view .settings-form-two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#app-settings-view .settings-profile-card .settings-form {
  align-items: end;
  column-gap: 18px;
}

#app-settings-view .settings-profile-card .settings-message {
  align-self: center;
  min-height: 0;
}

#app-settings-view .settings-password-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#app-settings-view .settings-form label,
.settings-modal .settings-form label,
#app-settings-view .audit-filter-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #4f5966;
  font-size: 13px;
  font-weight: 800;
}

#app-settings-view .settings-form input,
#app-settings-view .settings-form select,
#app-settings-view .audit-filter-grid select,
.settings-modal .settings-form input,
.settings-modal .settings-form select,
#app-settings-view .team-role-control select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--aw-blue-edge);
  border-radius: var(--aw-control-radius);
  padding: 0 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 76%, #edf1f4 100%);
  color: var(--text);
  box-shadow: var(--aw-control-shadow);
  font: inherit;
}

#app-settings-view .settings-form small,
#app-settings-view .settings-form-note,
.settings-modal .settings-form-note,
.settings-modal-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#app-settings-view .settings-action {
  justify-self: start;
}

#app-settings-view .secondary-button,
.settings-modal .secondary-button {
  border-color: var(--settings-blue-edge, rgb(20 87 168 / 30%));
  background: #fff;
  color: var(--blue);
  box-shadow: var(--aw-control-shadow);
}

#app-settings-view .secondary-button:hover,
.settings-modal .secondary-button:hover {
  border-color: rgb(20 87 168 / 56%);
  background: var(--settings-blue-soft, #eef5ff);
}

#app-settings-view .secondary-button:disabled,
#app-settings-view .text-button:disabled,
.settings-modal .secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

#app-settings-view .text-button {
  min-height: 44px;
  border: 0;
  border-radius: var(--aw-control-radius);
  padding: 0 10px;
  background: transparent;
  color: var(--settings-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

#app-settings-view .text-button:hover {
  background: var(--settings-blue-soft);
}

#app-settings-view :is(button, input, select, a):focus-visible,
.settings-modal :is(button, input, select):focus-visible {
  border-color: rgb(20 87 168 / 72%);
  outline: 3px solid rgb(20 87 168 / 20%);
  outline-offset: 2px;
}

#app-settings-view .settings-message {
  min-height: 19px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

#app-settings-view .password-field {
  position: relative;
  display: block;
}

#app-settings-view .password-field input {
  padding-right: 82px;
}

#app-settings-view .password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  background: var(--settings-blue-soft);
  color: var(--settings-blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

#app-settings-view .settings-summary-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
}

#app-settings-view .status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

#app-settings-view .status-badge-success,
#app-settings-view .audit-result-success {
  border-color: rgb(32 166 107 / 22%);
  background: #eaf8f0;
  color: #137548;
}

#app-settings-view .status-badge-pending {
  border-color: rgb(20 87 168 / 20%);
  background: var(--settings-blue-soft);
  color: var(--settings-blue);
}

#app-settings-view .status-badge-danger,
#app-settings-view .audit-result-error,
#app-settings-view .audit-result-denied {
  border-color: rgb(223 75 64 / 18%);
  background: #fff0ef;
  color: #b42318;
}

#app-settings-view .status-badge-muted {
  border-color: #d9dee4;
  background: #f2f4f6;
  color: #5f6975;
}

#app-settings-view .connection-list {
  display: grid;
  gap: 10px;
}

#app-settings-view .connection-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, .8fr) minmax(120px, .8fr) minmax(165px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border: 1px solid #e0e4e8;
  border-radius: var(--op-radius);
  padding: 14px;
  background: var(--settings-subtle);
}

#app-settings-view .connection-row > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#app-settings-view .connection-row span,
#app-settings-view .connection-row time {
  overflow-wrap: anywhere;
  color: #4e5966;
  font-size: 13px;
}

#app-settings-view .connection-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

#app-settings-view .settings-help-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--settings-blue);
  font-size: 13px;
  font-weight: 800;
}

#app-settings-view .team-member-list,
#app-settings-view .team-invitation-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

#app-settings-view .team-invitation-list:not(:empty) {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e3e6ea;
}

#app-settings-view .team-member-row,
#app-settings-view .team-invitation-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(150px, .6fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid #e0e4e8;
  border-radius: var(--op-radius);
  padding: 12px 14px;
  background: var(--settings-subtle);
}

#app-settings-view .team-invitation-row {
  grid-template-columns: minmax(180px, 1fr) auto minmax(150px, auto) auto;
}

#app-settings-view .team-member-copy,
#app-settings-view .team-invitation-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

#app-settings-view .team-member-copy span,
#app-settings-view .team-invitation-row span,
#app-settings-view .team-invitation-row time {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

#app-settings-view .team-role-control {
  display: grid;
  gap: 4px;
}

#app-settings-view .team-role-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

#app-settings-view .role-description-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#app-settings-view .role-description-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #e0e4e8;
  border-radius: var(--op-radius);
  padding: 13px;
  background: var(--settings-subtle);
}

#app-settings-view .role-description-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Account extensions reuse the current opaque white settings language. */
.store-card .account-shop-switcher {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}

.store-card .account-shop-switcher select {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  border: 1px solid rgb(49 65 80 / 14%);
  border-radius: var(--aw-control-radius);
  padding: 0 28px 0 10px;
  background-color: #fff;
  color: #273142;
  font: inherit;
  font-size: 12px;
  box-shadow: var(--aw-control-shadow);
}

.account-access-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  border: 1px solid rgb(214 157 46 / 25%);
  border-radius: var(--aw-tile-radius, 16px);
  padding: 14px 16px;
  background-color: #fffdf6;
  background-image: linear-gradient(180deg, #fffefb 0%, #fff9e9 100%);
  color: #6f5215;
  box-shadow: var(--aw-tile-shadow);
}

.account-access-notice strong {
  white-space: nowrap;
}

.account-access-notice span {
  color: #80672e;
  font-size: 13px;
  line-height: 1.45;
}

.side-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .45;
}

body[data-account-access="read_only"] #cpc-view :is(button, input, select, textarea)[aria-disabled="true"],
body[data-account-access="locked"] #cpc-view :is(button, input, select, textarea)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
}

#app-settings-view .account-shops-card .settings-card-head > div,
#app-settings-view .account-member-shop-access .settings-card-head {
  min-width: 0;
}

#app-settings-view .account-shops-card .settings-card-head {
  margin-bottom: 16px;
}

#app-settings-view .account-shops-card .settings-card-head > div {
  display: grid;
  gap: 4px;
}

#app-settings-view .account-shops-card .settings-card-head span,
#app-settings-view .account-member-shop-access .settings-card-head span {
  color: var(--muted);
  font-size: 12px;
}

#app-settings-view .account-shop-row {
  grid-template-columns: minmax(190px, 1fr) minmax(130px, auto) minmax(220px, auto);
}

#app-settings-view .account-shop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.account-shop-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-shop-access-grid > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #e0e4e8;
  border-radius: var(--op-radius);
  padding: 9px 11px;
  background: var(--settings-subtle, #f7f8fa);
  color: #4f5966;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  cursor: pointer;
}

.account-shop-access-grid > label:has(input:disabled) {
  cursor: default;
}

.account-shop-access-grid input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--settings-blue, #1457a8);
}

.settings-modal .account-invite-shops {
  margin: 0;
}

#app-settings-view .account-member-shop-row {
  grid-template-columns: minmax(170px, .75fr) minmax(320px, 1.5fr) auto;
}

#app-settings-view .account-member-shop-row .account-shop-access-grid {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

#app-settings-view .settings-message[data-type="success"],
.settings-modal .settings-message[data-type="success"] {
  color: #137548;
}

#app-settings-view .settings-message[data-type="error"],
.settings-modal .settings-message[data-type="error"] {
  color: #b42318;
}

.settings-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

#app-settings-view .audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

#app-settings-view .audit-feed {
  display: grid;
  gap: 10px;
  min-width: 0;
}

#app-settings-view .audit-feed-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e0e4e8;
  border-radius: var(--op-radius);
  background: var(--settings-subtle);
}

#app-settings-view .audit-feed-main {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) minmax(150px, .8fr) minmax(180px, 1fr) minmax(100px, .5fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
}

#app-settings-view .audit-feed-copy,
#app-settings-view .audit-feed-meta {
  display: grid;
  min-width: 0;
  gap: 4px;
}

#app-settings-view .audit-feed-copy span,
#app-settings-view .audit-feed-meta span,
#app-settings-view .audit-feed-meta time,
#app-settings-view .audit-feed-meta small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

#app-settings-view .audit-feed-meta small {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#app-settings-view .audit-result {
  display: inline-flex;
  width: fit-content;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 850;
}

#app-settings-view .audit-safe-details {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e0e4e8;
  padding: 13px 14px;
  background: #fff;
}

#app-settings-view .audit-safe-details > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

#app-settings-view .audit-safe-details span {
  color: var(--muted);
}

#app-settings-view .audit-pagination {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgb(23 27 34 / 38%);
  backdrop-filter: none;
}

.settings-modal {
  position: fixed;
  z-index: 121;
  top: 50%;
  left: 50%;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--aw-panel-radius);
  padding: 22px;
  background: #fff;
  box-shadow: 0 26px 70px rgb(23 27 34 / 24%);
}

.settings-modal-small {
  width: min(480px, calc(100vw - 32px));
}

#account-shop-add-modal {
  width: min(560px, calc(100vw - 32px));
}

#connection-manager {
  top: 50%;
  bottom: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(1120px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow: visible;
  transform: translate(-50%, -50%);
}

#connection-manager .settings-modal-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

#connection-manager .connection-manager-form,
#connection-manager .connection-manager-form fieldset {
  height: 100%;
}

.settings-modal-head {
  position: sticky;
  top: -22px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: -22px -22px 14px;
  border-bottom: 1px solid var(--line);
  padding: 22px 22px 14px;
  background: #fff;
}

.settings-modal-head h2 {
  margin-top: 4px;
  font-size: 21px;
}

.settings-modal-icon-close {
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  place-items: center;
  align-self: center;
  border: 1px solid var(--settings-blue-edge, rgb(20 87 168 / 30%));
  border-radius: 14px;
  padding: 0 0 2px;
  background-color: #fff;
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 72%, #edf1f4 100%);
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth),
    var(--aw-control-shadow);
  color: var(--blue);
  font: 400 26px/1 Arial, sans-serif;
  cursor: pointer;
  transition:
    transform 160ms var(--aw-ease),
    box-shadow 160ms var(--aw-ease),
    border-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .settings-modal-icon-close:hover {
    border-color: rgb(20 87 168 / 56%);
    box-shadow:
      inset 0 -12px 18px -12px var(--aw-white-inner-depth),
      var(--aw-control-shadow-hover);
    transform: translateY(-1px) scale(1.006);
  }
}

.settings-modal-icon-close:active {
  box-shadow:
    inset 0 -10px 16px -12px rgb(54 69 85 / 12%),
    var(--aw-control-shadow-active);
  transform: translateY(1px) scale(0.986);
}

#connection-manager .settings-modal-close {
  display: inline-flex;
  width: auto;
  min-width: 112px;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  align-self: center;
  border: 1px solid var(--settings-blue-edge, rgb(20 87 168 / 30%));
  border-radius: 14px;
  padding: 0 16px;
  color: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 72%, #edf1f4 100%);
  box-shadow:
    inset 0 -12px 18px -12px var(--aw-white-inner-depth),
    var(--aw-control-shadow);
  transition:
    transform 160ms var(--aw-ease),
    box-shadow 160ms var(--aw-ease),
    border-color 160ms ease;
}

#connection-manager .settings-modal-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

#connection-manager .settings-modal-close:hover {
  background-color: #fff;
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fafc 72%, #edf1f4 100%);
}

@media (hover: hover) and (pointer: fine) {
  #connection-manager .settings-modal-close:hover {
    box-shadow:
      inset 0 -12px 18px -12px var(--aw-white-inner-depth),
      var(--aw-control-shadow-hover);
    transform: translateY(-1px) scale(1.006);
  }
}

#connection-manager .settings-modal-close:active {
  box-shadow:
    inset 0 -10px 16px -12px rgb(54 69 85 / 12%),
    var(--aw-control-shadow-active);
  transform: translateY(1px) scale(0.986);
}

.settings-modal fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: 1px solid #e0e4e8;
  border-radius: var(--aw-tile-radius);
  padding: 14px;
}

.settings-modal legend {
  padding: 0 6px;
  color: var(--text);
  font-weight: 850;
}

.settings-modal-open {
  overflow: hidden;
}

.public-invitation-layer {
  z-index: 220;
}

#accept-invitation-modal {
  z-index: 221;
}

@media (max-width: 1120px) {
  #app-settings-view .settings-password-grid,
  #app-settings-view .role-description-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #app-settings-view .connection-row,
  #app-settings-view .audit-feed-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #app-settings-view .account-shop-row,
  #app-settings-view .account-member-shop-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #app-settings-view .account-shop-actions {
    justify-content: flex-start;
  }

  #app-settings-view .connection-row > :first-child,
  #app-settings-view .audit-feed-copy {
    grid-column: 1 / -1;
  }

  #app-settings-view .audit-detail-toggle {
    justify-self: start;
  }

  #app-settings-view .audit-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #connection-manager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: auto;
  }

  #connection-manager #shop-name-form {
    grid-column: 1 / -1;
  }

  #connection-manager #shop-name-form fieldset {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  #connection-manager #shop-name-form legend,
  #connection-manager #shop-name-message {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  #app-settings-view .settings-tabs {
    margin-inline: 0;
  }

  #app-settings-view .settings-summary-card,
  #app-settings-view .settings-form-two-columns,
  #app-settings-view .settings-password-grid,
  #app-settings-view .role-description-grid,
  #app-settings-view .audit-filter-grid,
  #app-settings-view .connection-row,
  #app-settings-view .audit-feed-main,
  #app-settings-view .team-member-row,
  #app-settings-view .team-invitation-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-shop-access-grid,
  #app-settings-view .account-member-shop-row .account-shop-access-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-access-notice {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  #app-settings-view .account-shop-actions,
  #app-settings-view .account-shop-actions .text-button,
  #app-settings-view .account-member-shop-row .secondary-button,
  .settings-modal-actions,
  .settings-modal-actions .secondary-button {
    width: 100%;
  }

  #app-settings-view .settings-summary-action,
  #app-settings-view .settings-action,
  #app-settings-view .connection-row .text-button,
  #app-settings-view .team-member-row .text-button,
  #app-settings-view .team-invitation-row .text-button {
    width: 100%;
  }

  #app-settings-view .settings-summary-card {
    align-items: start;
  }

  #app-settings-view .settings-summary-card .settings-avatar {
    grid-row: auto;
  }

  #app-settings-view .settings-card {
    padding: 15px;
  }

  #app-settings-view .audit-safe-details > div {
    display: grid;
    gap: 3px;
  }

  .settings-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 16px;
  }

  #connection-manager {
    top: 10px;
    bottom: 10px;
    display: block;
    max-height: none;
    overflow: auto;
    transform: translateX(-50%);
  }

  #connection-manager .connection-manager-form + .connection-manager-form {
    margin-top: 14px;
  }

  #connection-manager #shop-name-form fieldset {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #connection-manager #shop-name-form legend,
  #connection-manager #shop-name-message {
    grid-column: auto;
  }

  .settings-modal-head {
    top: -16px;
    margin: -16px -16px 14px;
    padding: 16px 16px 12px;
  }
}

@media (max-width: 420px) {
  #app-settings-view .settings-tab {
    padding-inline: 13px;
  }

  #app-settings-view .settings-avatar {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app-settings-view *,
  .settings-modal,
  .settings-modal-backdrop {
    scroll-behavior: auto;
    transition: none !important;
  }

  #connection-manager .settings-modal-close {
    transform: none !important;
  }

  .settings-modal-icon-close {
    transform: none !important;
  }
}

body :is(
    .toolbar,
    .heatmap-card,
    .chart-panel,
    .stats-table-section,
    .stats-data-panel,
    .cpc-search-panel,
    .cpc-recommendation-panel,
    .cpc-rule-panel,
    .unit-economics-table-card,
    .unit-economics-detail,
    .unit-economics-unallocated,
    .unit-economics-settings,
    .unit-economics-settings-card,
    .unit-economics-columns-drawer,
    .download-modal,
    .settings-drawer
  ) {
  border-color: rgb(49 65 80 / 15%);
  background-image: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: var(--aw-panel-shadow);
}

/* Heatmap detail belongs to its card instead of following the viewport. */
body.auth-ready .heatmap-body {
  align-items: stretch;
}

body.auth-ready .heatmap-hour-detail {
  position: static;
  top: auto;
  align-self: stretch;
  height: calc(100% - 10px);
  margin-top: 10px;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-color: rgb(49 65 80 / 16%);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: var(--aw-tile-shadow);
}

body.auth-ready .heatmap-hour-detail > p {
  align-self: end;
}

.heatmap-coverage-note {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.heatmap-coverage-note > span {
  min-width: 0;
}

.heatmap-coverage-note details {
  position: relative;
}

.heatmap-coverage-note summary {
  color: inherit;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.heatmap-coverage-note details p {
  max-width: 760px;
  margin: 8px 0 0;
  line-height: 1.45;
}

/* Date controls: larger arrows and the same white-button material for presets. */
body .range-nav-button,
body .unit-economics-toolbar .range-nav-button {
  width: 48px;
  min-width: 48px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 19px;
  font-weight: 950;
}

body :is(.heatmap-period-presets, .stats-period-presets) button {
  min-height: 40px;
  border: 1px solid rgb(49 65 80 / 17%);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--aw-control-shadow);
  padding-inline: 12px;
}

body :is(.heatmap-period-presets, .stats-period-presets) button:is(:hover, .is-selected) {
  border-color: var(--aw-blue-edge-active);
  background: linear-gradient(180deg, #ffffff 0%, #e8f4fc 100%);
  color: #176b9f;
  box-shadow:
    0 0 0 1px rgb(65 153 214 / 4%),
    0 0 6px rgb(65 153 214 / 13%),
    0 0 18px rgb(65 153 214 / 9%);
}

body :is(.heatmap-period-presets, .stats-period-presets) button.is-selected {
  box-shadow:
    inset 3px 0 0 rgb(65 153 214 / 88%),
    0 0 6px rgb(65 153 214 / 13%),
    0 0 18px rgb(65 153 214 / 9%);
}

/* Unit economics: semantic KPI tiles remain immediately readable. */
body.auth-ready .unit-economics-metric-card {
  border-top-width: 4px;
}

body.auth-ready
  .unit-economics-metric-card:not(.is-expense):not(.is-tax):not(.is-profit) {
  border-top-color: #19a56f;
}

body.auth-ready .unit-economics-metric-card.is-expense {
  border-top-color: #df6a5d;
  background: linear-gradient(180deg, #fffdfd 0%, #fff6f5 100%);
}

body.auth-ready .unit-economics-metric-card.is-tax {
  border-top-color: #eab43d;
  background: linear-gradient(180deg, #fffefa 0%, #fff9e9 100%);
}

body.auth-ready .unit-economics-metric-card.is-profit {
  border-color: rgb(25 165 111 / 36%);
  border-top-color: #19a56f;
  background: linear-gradient(180deg, #ffffff 0%, #e7f7f0 100%);
}

#unit-economics-table th[data-column-key="product"],
#unit-economics-table td[data-column-key="product"] {
  width: 304px;
  min-width: 304px;
  max-width: 304px;
}

.unit-economics-product-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.unit-economics-product-identity strong {
  overflow: hidden;
  max-width: 100%;
  color: var(--op-text);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-economics-product-identity small {
  color: var(--op-muted);
  font-size: 10px;
  font-weight: 650;
}

body .unit-economics-product-action {
  width: fit-content;
  min-height: 30px;
  margin-top: 7px;
  border-color: rgb(15 159 110 / 30%);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #e5f5ed 100%);
  color: #087653;
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
}

.unit-economics-waterfall-card figcaption {
  display: block;
  width: 100%;
  border-bottom: 1px solid rgb(49 65 80 / 12%);
  padding: 0 0 10px;
  text-align: left;
}

.unit-economics-waterfall-card figcaption strong {
  text-align: left;
}

/* All service dialogs and their choices use one opaque white material. */
body :is(
    .download-modal,
    .unit-economics-settings,
    .unit-economics-columns-drawer,
    .settings-drawer
  ) {
  overflow: hidden auto;
  border: 1px solid rgb(49 65 80 / 17%);
  border-radius: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7f9 100%);
}

body :is(.download-options label, .unit-economics-columns-presets button, .unit-economics-column-group-chip) {
  border: 1px solid rgb(49 65 80 / 15%);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow:
    0 0 0 1px rgb(32 45 58 / 2%),
    0 0 5px rgb(24 36 48 / 8%),
    0 0 14px rgb(34 49 64 / 5%);
}

body :is(.download-options label:has(input:checked), .unit-economics-columns-presets button.is-active) {
  border-color: rgb(15 159 110 / 34%);
  background: linear-gradient(180deg, #ffffff 0%, #e6f6ee 100%);
  color: #087653;
}

body .drawer-close {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgb(49 65 80 / 17%);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  box-shadow: var(--aw-control-shadow);
  color: var(--aw-text);
  font-size: 22px;
}

/* CPC header and expandable rows share one continuous rounded backing. */
body.auth-ready #cpc-view .cpc-product-table {
  overflow: hidden;
  border: 1px solid rgb(49 65 80 / 15%);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--aw-panel-shadow);
}

body.auth-ready #cpc-view .cpc-product-list-head {
  border: 0;
  border-bottom: 1px solid rgb(49 65 80 / 11%);
  border-radius: 0;
  background: #f5f7f9;
}

body.auth-ready #cpc-view .cpc-product-card,
body.auth-ready #cpc-view .cpc-product-card:first-child,
body.auth-ready #cpc-view .cpc-product-card:last-child,
body.auth-ready #cpc-view .cpc-product-card:only-child {
  border: 0;
  border-bottom: 1px solid rgb(49 65 80 / 10%);
  border-radius: 0;
  background: #ffffff;
  background-image: none;
  box-shadow: none;
}

body.auth-ready #cpc-view .cpc-product-card:last-child {
  border-bottom: 0;
}

body.auth-ready #cpc-view .cpc-product-card[open] {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fa 100%);
}

body.auth-ready #cpc-view .cpc-product-card[open] > summary {
  border-bottom: 1px solid rgb(49 65 80 / 10%);
}

@media (max-width: 760px) {
  body.auth-ready .heatmap-hour-detail {
    height: auto;
    margin-top: 0;
  }

  .unit-economics-advertising-quality {
    width: 100%;
  }

  .unit-economics-advertising-quality > summary {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .unit-economics-advertising-quality-action {
    grid-column: 2;
  }

  .unit-economics-advertising-quality-body {
    padding-left: 43px;
  }

  #unit-economics-table th[data-column-key="product"],
  #unit-economics-table td[data-column-key="product"] {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
  }
}

/* Daily data keeps its labels and actions away from both panel edges. */
body.auth-ready #stats-data-panel {
  box-sizing: border-box;
  padding: 18px;
}

body.auth-ready #stats-data-panel :is(.stats-data-heading, .stats-data-status) {
  line-height: 1.35;
}

@media (max-width: 760px) {
  body.auth-ready #stats-data-panel {
    padding: 14px;
  }
}

/* Shared invisible workspace grid: every primary page uses the same guides. */
:root {
  --workspace-content-width: 1480px;
  --workspace-header-height: 51px;
  --workspace-header-gap: 16px;
}

html {
  scrollbar-gutter: stable;
}

@media (min-width: 761px) {
  body.auth-ready .page,
  body.auth-ready.stats-mode .page,
  body.auth-ready.future-mode .page,
  body.auth-ready.unit-economics-mode .page,
  body.auth-ready:has(#cpc-view:not([hidden])) .page {
    width: calc(100% - 244px);
    min-width: 0;
    max-width: none;
    margin-left: 244px;
    padding: 24px;
  }

  body.auth-ready :is(
      #heatmaps-view,
      #stats-view,
      #unit-economics-view,
      #cpc-view,
      #app-settings-view
    ) {
    width: min(100%, var(--workspace-content-width));
    min-width: 0;
    max-width: var(--workspace-content-width);
    margin: 0 auto;
  }
}

body.auth-ready :is(
    #heatmaps-view,
    #stats-view,
    #unit-economics-view,
    #cpc-view,
    #app-settings-view
  ) > :is(.operational-page-header, .cabinet-header) {
  min-height: var(--workspace-header-height);
  margin-bottom: var(--workspace-header-gap);
  align-items: flex-start;
}

body.auth-ready #stats-view {
  margin-top: 0;
}

@media (max-width: 760px) {
  html {
    scrollbar-gutter: auto;
  }

  body.auth-ready :is(
      #heatmaps-view,
      #stats-view,
      #unit-economics-view,
      #cpc-view,
      #app-settings-view
    ) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-inline: 0;
  }
}

/* Apple-style typography: SF Pro when available, close native fallbacks elsewhere. */
:root {
  --apple-font-text:
    "SF Pro Text", "SF Pro Icons", -apple-system, BlinkMacSystemFont, Inter,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --apple-font-display:
    "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, Inter,
    "Segoe UI", Helvetica, Arial, sans-serif;
  --apple-font-compact:
    "SF Pro Text", "Inter Tight", "Arial Narrow", "Roboto Condensed",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
  font-family: var(--apple-font-text);
  font-optical-sizing: auto;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

:is(h1, h2, h3, .brand, .login-brand, .operational-page-header h1) {
  font-family: var(--apple-font-display);
  letter-spacing: -0.025em;
}

:is(
    button,
    .side-link,
    .control-label,
    .eyebrow,
    th,
    .unit-economics-metric-card > span,
    .cpc-product-list-head
  ) {
  letter-spacing: -0.012em;
}

:is(
    .metric-card strong,
    .unit-economics-metric-card strong,
    .cpc-stat-card strong,
    .cpc-stat-tile strong,
    .heatmap-summary,
    td,
    input,
    select
  ) {
  font-variant-numeric: tabular-nums lining-nums;
}

.heat-cell,
.heatmap-table td,
.hour-heatmap-cell {
  font-family: var(--apple-font-compact);
}

/* Planned unit economics: opaque Apple White workspace. */
.plan-economics {
  --plan-blue: #1687c4;
  --plan-blue-dark: #0a679c;
  --plan-green: #087653;
  --plan-green-soft: #e8f6ef;
  --plan-amber: #9c6914;
  --plan-amber-soft: #fff7e4;
  --plan-red: #b3313a;
  --plan-red-soft: #fff0f1;
  --plan-ink: var(--aw-text);
  --plan-muted: var(--aw-muted);
  --plan-line: var(--aw-white-edge);
  --plan-interactive: var(--aw-control-shadow);
  --plan-interactive-hover: var(--aw-control-shadow-hover);
  --plan-interactive-active: var(--aw-control-shadow-active);
  --plan-tile: var(--aw-tile-shadow);
  --plan-panel: var(--aw-panel-shadow);
  display: grid;
  gap: 16px;
  min-width: 0;
  color: var(--plan-ink);
}

.plan-economics [hidden] {
  display: none !important;
}

.plan-dialog-portal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: block;
  min-width: 0;
  pointer-events: none;
}

.plan-dialog-portal > * {
  pointer-events: auto;
}

.unit-economics-view.is-plan-active > .operational-page-header .unit-economics-actions {
  visibility: hidden;
  pointer-events: none;
}

.plan-panel-depth {
  border: 1px solid var(--plan-line);
  border-radius: var(--aw-panel-radius);
  background-color: var(--aw-white-middle);
  background-image: linear-gradient(
    180deg,
    var(--aw-white-top) 0%,
    var(--aw-white-middle) 24%,
    var(--aw-white-bottom) 100%
  );
  box-shadow: var(--plan-panel);
}

.plan-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.plan-kpi {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid var(--aw-white-edge);
  border-radius: var(--aw-tile-radius);
  background-color: var(--aw-white-middle);
  background-image: linear-gradient(
    180deg,
    var(--aw-white-top) 0%,
    var(--aw-white-middle) 24%,
    var(--aw-white-middle) 78%,
    var(--aw-white-bottom) 100%
  );
  box-shadow: var(--plan-tile);
  padding: 19px 20px 17px;
}

.plan-kpi::before {
  position: absolute;
  top: 0;
  right: 22px;
  left: 22px;
  height: 3px;
  border-radius: 0 0 5px 5px;
  background: #91a0ad;
  content: "";
}

.plan-kpi--investment::before {
  background: #8b73cf;
}

.plan-kpi--revenue::before {
  background: #2f93c9;
}

.plan-kpi--profit::before,
.plan-kpi--roi::before {
  background: #18a46f;
}

.plan-kpi.is-negative {
  border-color: rgb(179 49 58 / 22%);
  background-color: #fff7f7;
  background-image: linear-gradient(180deg, #ffffff 0%, #fff8f8 22%, #fff8f8 80%, #f6e7e8 100%);
}

.plan-kpi.is-negative::before {
  background: #c74a53;
}

.plan-kpi > span,
.plan-kpi > strong,
.plan-kpi > small {
  display: block;
}

.plan-kpi > span {
  color: var(--plan-muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.plan-kpi > strong {
  margin-top: 16px;
  color: var(--plan-ink);
  font-family: var(--apple-font-display);
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 820;
  letter-spacing: -0.045em;
  line-height: 1;
}

.plan-kpi > small {
  margin-top: 10px;
  color: var(--plan-muted);
  font-size: 12px;
  font-weight: 650;
}

.plan-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 0;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  padding: 0;
}

.plan-search {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--plan-muted);
  font-size: 11px;
  font-weight: 790;
}

.plan-search input,
.plan-field :is(input, select, textarea),
.plan-inline-decision,
.plan-inline-quantity,
.plan-column-preset-controls :is(input, select),
.column-preset-controls :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgb(49 65 80 / 16%);
  border-radius: 14px;
  outline: none;
  background-color: var(--aw-white-top);
  background-image: linear-gradient(
    180deg,
    var(--aw-white-top) 0%,
    var(--aw-white-middle) 74%,
    var(--aw-white-bottom) 100%
  );
  box-shadow:
    inset 0 -9px 16px -15px rgb(54 69 85 / 8%),
    0 0 5px rgb(24 36 48 / 7%);
  color: var(--plan-ink);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 650;
}

.plan-field textarea {
  min-height: 86px;
  resize: vertical;
  padding-block: 11px;
  line-height: 1.45;
}

.plan-search input:focus-visible,
.plan-field :is(input, select, textarea):focus-visible,
.plan-inline-decision:focus-visible,
.plan-inline-quantity:focus-visible,
.column-preset-controls :is(input, select):focus-visible {
  border-color: var(--aw-blue-edge-active);
  box-shadow:
    0 0 0 3px var(--aw-blue-ring),
    inset 0 -9px 16px -15px rgb(54 69 85 / 8%),
    0 0 5px rgb(24 36 48 / 7%);
}

.plan-decision-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.plan-filter,
.plan-action,
.plan-inline-action,
.plan-icon-button,
.plan-modal-tab,
.plan-sort-button,
.plan-input-with-source > button,
.plan-column-order-actions button,
.column-preset-controls-button {
  min-height: 44px;
  border: 1px solid rgb(49 65 80 / 17%);
  border-radius: var(--aw-control-radius);
  background-color: var(--aw-white-middle);
  background-image: linear-gradient(
    180deg,
    var(--aw-white-top) 0%,
    var(--aw-white-middle) 25%,
    var(--aw-white-middle) 75%,
    var(--aw-white-bottom) 100%
  );
  box-shadow: var(--plan-interactive);
  color: #314153;
  cursor: pointer;
  padding: 0 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 820;
  transition:
    transform 165ms ease,
    box-shadow 165ms ease,
    border-color 165ms ease,
    color 165ms ease,
    opacity 165ms ease;
}

.plan-filter {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 9px;
  white-space: nowrap;
}

.plan-filter span {
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 999px;
  background: #ffffff;
  color: var(--plan-muted);
  font-size: 10px;
}

.plan-filter.is-active,
.plan-modal-tab.is-active {
  border-color: rgb(52 143 201 / 45%);
  background-color: #f6faff;
  background-image: linear-gradient(180deg, #ffffff 0%, #f6faff 25%, #f6faff 75%, #e8f2fb 100%);
  color: var(--plan-blue-dark);
}

.plan-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.plan-action {
  white-space: nowrap;
}

.plan-action--primary {
  border-color: rgb(30 134 193 / 48%);
  background-color: #eef8fe;
  background-image: linear-gradient(180deg, #ffffff 0%, #f3faff 25%, #f3faff 75%, #dbeefa 100%);
  color: #096493;
  box-shadow:
    inset 0 -12px 18px -14px rgb(35 112 158 / 12%),
    0 0 6px rgb(32 124 177 / 15%),
    0 0 19px rgb(35 116 163 / 10%);
}

#plan-add-open {
  height: 44px;
  min-height: 44px;
  border-radius: 16px;
  padding-inline: 17px;
  font-size: 13px;
}

.plan-action--danger {
  border-color: rgb(179 49 58 / 24%);
  background-color: #fff7f7;
  background-image: linear-gradient(180deg, #ffffff 0%, #fff7f7 25%, #fff7f7 75%, #f6e7e8 100%);
  color: var(--plan-red);
}

.plan-filter:disabled,
.plan-action:disabled,
.plan-inline-action:disabled,
.plan-icon-button:disabled,
.plan-input-with-source > button:disabled,
.column-preset-controls-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow:
    inset 0 -8px 14px -14px rgb(54 69 85 / 7%),
    0 0 4px rgb(24 36 48 / 5%);
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .plan-filter:not(:disabled):hover,
  .plan-action:not(:disabled):hover,
  .plan-inline-action:not(:disabled):hover,
  .plan-icon-button:not(:disabled):hover,
  .plan-modal-tab:not(:disabled):hover,
  .plan-input-with-source > button:not(:disabled):hover,
  .plan-column-order-actions button:not(:disabled):hover,
  .column-preset-controls-button:not(:disabled):hover {
    border-color: rgb(49 65 80 / 24%);
    box-shadow: var(--plan-interactive-hover);
    transform: translateY(-1px) scale(1.005);
  }

  .plan-action--primary:not(:disabled):hover {
    border-color: rgb(30 134 193 / 65%);
  }

  .plan-action--danger:not(:disabled):hover {
    border-color: rgb(179 49 58 / 38%);
  }
}

.plan-filter:not(:disabled):active,
.plan-action:not(:disabled):active,
.plan-inline-action:not(:disabled):active,
.plan-icon-button:not(:disabled):active,
.plan-modal-tab:not(:disabled):active,
.plan-input-with-source > button:not(:disabled):active,
.plan-column-order-actions button:not(:disabled):active,
.column-preset-controls-button:not(:disabled):active {
  box-shadow: var(--plan-interactive-active);
  transform: translateY(1px) scale(0.986);
}

.plan-filter:focus-visible,
.plan-action:focus-visible,
.plan-inline-action:focus-visible,
.plan-icon-button:focus-visible,
.plan-modal-tab:focus-visible,
.plan-input-with-source > button:focus-visible,
.plan-column-order-actions button:focus-visible,
.column-preset-controls-button:focus-visible,
.plan-product-cell:focus-visible,
.plan-sort-button:focus-visible {
  border-color: var(--aw-blue-edge-active);
  outline: none;
  box-shadow:
    0 0 0 3px var(--aw-blue-ring),
    var(--plan-interactive);
}

.plan-status {
  border: 1px solid rgb(35 120 170 / 20%);
  border-radius: 15px;
  background: #f2f9fd;
  color: #155f88;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 680;
}

.plan-status.is-success {
  border-color: rgb(8 118 83 / 20%);
  background: #edf8f3;
  color: var(--plan-green);
}

.plan-status.is-warning {
  border-color: rgb(156 105 20 / 20%);
  background: var(--plan-amber-soft);
  color: var(--plan-amber);
}

.plan-status.is-error {
  border-color: rgb(179 49 58 / 20%);
  background: var(--plan-red-soft);
  color: var(--plan-red);
}

.plan-table-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px 14px;
  color: var(--plan-muted);
  font-size: 12px;
  font-weight: 700;
}

.plan-table-meta #plan-row-count {
  color: var(--plan-ink);
}

.plan-table-meta #plan-selection-summary {
  border-radius: 999px;
  background: #edf7fc;
  color: #126b9b;
  padding: 5px 9px;
}

.plan-inline-action {
  min-height: 44px;
  margin-left: auto;
  border-radius: 12px;
  padding-inline: 11px;
  font-size: 11px;
}

.plan-refresh-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  max-width: 310px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-refresh-state::before {
  display: inline-grid;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.plan-refresh-state.is-loading::before {
  content: "";
  border: 2px solid #dfe9ef;
  border-top-color: var(--plan-blue);
  animation: plan-spin 720ms linear infinite;
}

.plan-refresh-state.is-success {
  color: var(--plan-green);
  font-weight: 720;
}

.plan-refresh-state.is-success::before {
  content: "✓";
  background: var(--plan-green-soft);
  color: var(--plan-green);
}

.plan-refresh-state.is-error {
  color: var(--plan-red);
  font-weight: 680;
}

.plan-refresh-state.is-error::before {
  content: "!";
  background: var(--plan-red-soft);
  color: var(--plan-red);
}

.plan-table-panel {
  position: relative;
  min-width: 0;
  padding: 14px;
}

.plan-table-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 4px 14px;
}

.plan-table-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.plan-table-heading h2,
.plan-dialog-head h2 {
  margin: 0;
  color: var(--plan-ink);
  font-family: var(--apple-font-display);
  font-size: 20px;
  letter-spacing: -0.025em;
}

.plan-table-heading p,
.plan-dialog-head p {
  margin: 5px 0 0;
  color: var(--plan-muted);
  font-size: 12px;
  line-height: 1.45;
}

.plan-table-scroll {
  overflow: auto;
  max-height: max(430px, calc(100vh - 390px));
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 19px;
  clip-path: inset(0 round 19px);
  background: #ffffff;
  box-shadow: inset 0 0 18px rgb(34 49 64 / 3%);
  scrollbar-gutter: stable;
}

.plan-table {
  width: max-content;
  min-width: 100%;
  border: 0;
  border-spacing: 0;
  border-collapse: separate;
  background: #ffffff;
  color: var(--plan-ink);
  table-layout: fixed;
}

.plan-table th,
.plan-table td {
  box-sizing: border-box;
  height: 48px;
  border: 0;
  border-right: 1px solid rgb(49 65 80 / 7%);
  border-bottom: 1px solid rgb(49 65 80 / 9%);
  background: #ffffff;
  padding: 7px 10px;
  color: #344354;
  font-size: 11px;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.3;
  vertical-align: middle;
}

.plan-table th:last-child,
.plan-table td:last-child {
  border-right: 0;
}

.plan-table thead th {
  position: sticky;
  z-index: 4;
  background: #f3f6f8;
}

.plan-table-groups th {
  top: 0;
  height: 34px;
  background: #eaf0f4;
  color: #667585;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.045em;
  text-align: center;
  text-transform: uppercase;
}

.plan-table-columns th {
  top: 34px;
  height: 46px;
  padding-block: 0;
}

.plan-table th.is-pinned,
.plan-table td.is-pinned {
  position: sticky;
  z-index: 3;
  border-right-color: rgb(49 65 80 / 15%);
  box-shadow: 7px 0 13px -13px rgb(34 49 64 / 45%);
}

.plan-table thead th.is-pinned {
  z-index: 7;
}

.plan-table tbody tr:last-child td {
  border-bottom: 0;
}

.plan-table tbody tr:hover td {
  background: #f7fafc;
}

.plan-table tbody tr.is-selected td {
  background: #f0f8fd;
}

.plan-table tbody tr.has-fresh-tariff td:first-child {
  box-shadow: inset 3px 0 0 #4296c7;
}

.plan-selection-cell {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  padding-inline: 13px !important;
  text-align: center;
}

.plan-selection-cell input,
.plan-mobile-card input[type="checkbox"],
.plan-catalog-item input,
.plan-export-options input,
.plan-check-field input,
.plan-column-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--plan-blue);
}

.plan-sort-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  border: 0;
  justify-content: flex-start;
  background: none;
  box-shadow: none;
  padding: 0;
  color: #4f6072;
  text-align: left;
}

.plan-sort-button[data-direction]::after {
  margin-left: 5px;
  content: "↑";
}

.plan-sort-button[data-direction="desc"]::after {
  content: "↓";
}

@media (hover: hover) and (pointer: fine) {
  .plan-sort-button:hover,
  .plan-product-cell:hover {
    background: #eef4f7;
    color: var(--plan-blue-dark);
  }
}

.plan-sort-button:active,
.plan-product-cell:active {
  background: #e4edf2;
  box-shadow: none;
  transform: none;
}

.plan-product-cell {
  display: grid;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: none;
  color: var(--plan-ink);
  padding: 0;
  text-align: left;
}

.plan-product-cell.has-image {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.plan-product-cell > img {
  width: 38px;
  height: 38px;
  border: 1px solid rgb(49 65 80 / 10%);
  border-radius: 10px;
  background: #f1f4f6;
  object-fit: cover;
}

.plan-product-cell-copy {
  display: grid;
  min-width: 0;
}

.plan-product-cell-copy > strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 790;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-product-cell-copy > span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--plan-muted);
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-product-cell-copy > em {
  width: fit-content;
  margin-top: 4px;
  border-radius: 999px;
  background: #e7f3fa;
  color: #176b9f;
  padding: 2px 6px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.plan-table td.is-numeric {
  text-align: right;
}

.plan-table-link {
  color: var(--plan-blue-dark);
  font-weight: 760;
  text-underline-offset: 2px;
}

.plan-inline-decision {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 28px 0 9px;
  font-size: 10px;
}

.plan-inline-decision.is-ordering {
  border-color: rgb(8 118 83 / 24%);
  background-color: #f3faf7;
  color: var(--plan-green);
}

.plan-inline-decision.is-thinking {
  border-color: rgb(156 105 20 / 22%);
  background-color: #fffaf0;
  color: var(--plan-amber);
}

.plan-inline-decision.is-rejected {
  border-color: rgb(179 49 58 / 20%);
  background-color: #fff7f7;
  color: var(--plan-red);
}

.plan-inline-quantity {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 7px;
  text-align: right;
}

.plan-table :is(.is-success, .is-warning, .is-danger),
.plan-live-result :is(.is-success, .is-warning, .is-danger),
.plan-mobile-metrics :is(.is-success, .is-warning, .is-danger) strong {
  font-weight: 820;
}

.plan-economics .is-success {
  color: var(--plan-green);
}

.plan-economics .is-warning {
  color: var(--plan-amber);
}

.plan-economics .is-danger {
  color: var(--plan-red);
}

.plan-empty,
.plan-loading {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 9px;
  color: var(--plan-muted);
  text-align: center;
}

.plan-empty strong {
  color: var(--plan-ink);
  font-size: 17px;
}

.plan-empty p {
  max-width: 440px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.plan-empty-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgb(52 143 201 / 25%);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #edf7fc 100%);
  box-shadow: var(--plan-tile);
  color: var(--plan-blue);
  font-size: 28px;
}

.plan-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #dfe9ef;
  border-top-color: var(--plan-blue);
  border-radius: 50%;
  animation: plan-spin 720ms linear infinite;
}

@keyframes plan-spin {
  to {
    transform: rotate(360deg);
  }
}

.plan-mobile-list {
  display: none;
}

.plan-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  background: rgb(231 235 239 / 76%);
}

.plan-overlay--modal {
  z-index: 120;
}

.plan-editor {
  position: fixed;
  z-index: 115;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(1180px, calc(100vw - 72px));
  overflow: hidden;
  border-radius: 28px 0 0 28px;
  background-color: #f7f9fb;
}

.plan-editor:not([hidden]),
.plan-side-settings:not([hidden]),
#plan-add-modal:not([hidden]) {
  animation: plan-drawer-in 180ms cubic-bezier(0.2, 0.72, 0.25, 1);
}

@keyframes plan-drawer-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

.plan-editor > form {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.plan-editor > form > .plan-dialog-head {
  grid-row: 1;
}

.plan-editor > form > .plan-editor-alert {
  grid-row: 2;
}

.plan-editor-body {
  display: grid;
  min-height: 0;
  grid-row: 3;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  align-items: start;
  padding: 14px 18px;
}

.plan-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgb(49 65 80 / 10%);
  background: #ffffff;
  padding: 21px 22px 18px;
}

.plan-dialog-head .eyebrow {
  margin: 0 0 5px;
}

.plan-icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.plan-editor-alert {
  margin: 12px 18px 0;
  border: 1px solid rgb(52 143 201 / 20%);
  border-radius: 13px;
  background: #f0f8fd;
  color: #176b9f;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 680;
}

.plan-editor-alert.is-error {
  border-color: rgb(179 49 58 / 22%);
  background: var(--plan-red-soft);
  color: var(--plan-red);
}

.plan-editor-alert.is-success {
  border-color: rgb(8 118 83 / 20%);
  background: var(--plan-green-soft);
  color: var(--plan-green);
}

.plan-editor-section {
  margin: 0;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 0 16px rgb(34 49 64 / 4%);
  padding: 15px;
}

.plan-editor-section--product {
  grid-column: 1;
  grid-row: 1;
}

.plan-editor-section--ozon {
  grid-column: 2;
  grid-row: 1;
}

.plan-editor-section--purchase {
  grid-column: 1;
  grid-row: 2;
}

.plan-editor-section--details {
  grid-column: 2;
  grid-row: 2;
}

.plan-editor-section--ozon .plan-cost-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.plan-editor-section--ozon .plan-field {
  grid-template-rows: 29px 44px auto auto;
}

.plan-editor-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.plan-editor-section h3 {
  margin: 0;
  color: var(--plan-ink);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.plan-editor-section-head > :is(small, span) {
  color: var(--plan-muted);
  font-size: 10px;
  font-weight: 650;
  text-align: right;
}

.plan-version-badge {
  border-radius: 999px;
  background: #edf4f8;
  padding: 4px 8px;
}

.plan-form-grid,
.plan-cost-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.plan-field {
  display: grid;
  min-width: 0;
  gap: 6px;
  align-content: start;
  grid-auto-rows: max-content;
  color: #526273;
  font-size: 11px;
  font-weight: 750;
}

.plan-field > span:not(.plan-input-with-source) {
  color: var(--plan-muted);
  font-weight: 600;
}

.plan-field > small {
  color: var(--plan-muted);
  font-size: 9px;
  font-weight: 620;
  line-height: 1.35;
}

.plan-field > small.is-warning {
  color: var(--plan-amber);
}

.plan-field--wide {
  grid-column: 1 / -1;
}

.plan-input-with-source {
  display: grid;
  height: 44px;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
}

.plan-editor-section .plan-field > :is(input, select),
.plan-editor-section .plan-input-with-source > input {
  height: 44px;
  min-height: 44px;
}

.plan-input-with-source > button {
  width: 44px;
  padding: 0;
  font-size: 17px;
}

.plan-source-badge {
  justify-self: start;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 999px;
  background: #f3f6f8;
  color: #657587 !important;
  padding: 3px 7px;
  font-size: 8px !important;
  font-weight: 830 !important;
}

.plan-source-badge[data-source-tone="ozon"] {
  border-color: rgb(52 143 201 / 20%);
  background: #edf7fc;
  color: #176b9f !important;
}

.plan-source-badge[data-source-tone="official"] {
  border-color: rgb(8 118 83 / 18%);
  background: #edf8f3;
  color: var(--plan-green) !important;
}

.plan-check-field {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: #526273;
  font-size: 11px;
  font-weight: 750;
}

.plan-live-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 20px;
  background: #ffffff;
  padding: 12px;
}

.plan-live-result > div {
  min-width: 0;
  border-right: 1px solid rgb(49 65 80 / 9%);
  padding: 2px 10px;
}

.plan-live-result > div:last-child {
  border-right: 0;
}

.plan-live-result span,
.plan-live-result strong {
  display: block;
}

.plan-live-result span {
  min-height: 26px;
  color: var(--plan-muted);
  font-size: 9px;
  font-weight: 700;
}

.plan-live-result strong {
  margin-top: 5px;
  color: var(--plan-ink);
  font-size: 15px;
}

.plan-editor-footer {
  display: flex;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
  border-top: 1px solid rgb(49 65 80 / 12%);
  background: #ffffff;
  box-shadow: 0 -10px 24px rgb(34 49 64 / 5%);
  padding: 13px 18px max(13px, env(safe-area-inset-bottom));
}

.plan-editor-footer > div {
  display: flex;
  gap: 8px;
}

.plan-modal,
.plan-side-settings {
  position: fixed;
  z-index: 125;
  overflow: hidden auto;
  max-height: calc(100vh - 32px);
  border-radius: 28px;
  background-color: #f7f9fb;
}

.plan-modal {
  top: 50%;
  left: 50%;
  width: min(680px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
}

#plan-add-modal {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  display: grid;
  width: min(1180px, calc(100vw - 72px));
  max-height: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 28px 0 0 28px;
  transform: none;
}

#plan-add-modal.is-catalog-mode {
  top: 50%;
  right: 24px;
  bottom: auto;
  width: min(820px, calc(100vw - 48px));
  height: min(620px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  border-radius: 28px;
  transform: translateY(-50%);
}

#plan-add-modal.is-catalog-mode:not([hidden]) {
  animation: plan-catalog-in 180ms cubic-bezier(0.2, 0.72, 0.25, 1);
}

@keyframes plan-catalog-in {
  from {
    opacity: 0;
    transform: translate(20px, -50%);
  }
}

#plan-add-manual,
#plan-add-catalog {
  min-height: 0;
}

#plan-add-manual:not([hidden]) {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

#plan-add-manual > .plan-form-grid {
  align-content: start;
  overflow-y: auto;
  padding: 4px;
}

#plan-add-catalog:not([hidden]) {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

#plan-add-catalog .plan-catalog-list {
  max-height: 390px;
}

.plan-modal--compact {
  width: min(520px, calc(100vw - 32px));
}

.plan-side-settings {
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: min(480px, calc(100vw - 24px));
  max-height: none;
}

.plan-modal-tabs,
.plan-settings-tabs,
.plan-column-builtins {
  display: flex;
  gap: 8px;
  padding: 14px 18px 0;
}

.plan-modal-tab {
  flex: 1;
}

.plan-settings-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.plan-settings-tabs::-webkit-scrollbar {
  display: none;
}

.plan-settings-tabs .plan-modal-tab {
  flex: 0 0 auto;
  min-width: 112px;
}

.plan-add-panel,
.plan-settings-panel {
  padding: 18px;
}

.plan-search--catalog {
  margin-bottom: 12px;
}

.plan-catalog-status,
.plan-settings-note,
.plan-rates-summary {
  border-radius: 13px;
  background: #edf3f7;
  color: var(--plan-muted);
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.plan-catalog-list {
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  overflow: auto;
  max-height: 370px;
  margin-top: 10px;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 17px;
  background: #ffffff;
}

.plan-catalog-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid rgb(49 65 80 / 9%);
  cursor: pointer;
  padding: 9px 12px;
}

.plan-catalog-item:last-child {
  border-bottom: 0;
}

.plan-catalog-item:hover {
  background: #f7fafc;
}

.plan-catalog-item strong,
.plan-catalog-item small {
  display: block;
}

.plan-catalog-item strong {
  color: var(--plan-ink);
  font-size: 12px;
  line-height: 1.35;
}

.plan-catalog-item small {
  margin-top: 4px;
  color: var(--plan-muted);
  font-size: 9px;
  line-height: 1.35;
}

.plan-source-badge[data-source-tone="actual"] {
  border-color: rgb(8 118 83 / 18%);
  background: #edf8f3;
  color: var(--plan-green) !important;
}

.plan-modal-actions,
.plan-side-settings-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid rgb(49 65 80 / 10%);
  background: #ffffff;
  padding: 13px 18px;
}

.plan-modal-actions--three {
  justify-content: space-between;
}

.plan-export-options {
  display: grid;
  gap: 9px;
  padding: 18px;
}

.plan-export-options label {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 62px;
  border: 1px solid rgb(49 65 80 / 13%);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fa 100%);
  cursor: pointer;
  padding: 10px 13px;
}

.plan-export-options label:has(input:checked) {
  border-color: rgb(52 143 201 / 36%);
  background: linear-gradient(180deg, #ffffff 0%, #eaf6fc 100%);
}

.plan-export-options strong,
.plan-export-options small {
  display: block;
}

.plan-export-options strong {
  color: var(--plan-ink);
  font-size: 12px;
}

.plan-export-options small {
  margin-top: 3px;
  color: var(--plan-muted);
  font-size: 10px;
}

.plan-confirm-details {
  max-height: 190px;
  overflow: auto;
  padding: 0 18px;
}

.plan-confirm-details ul {
  margin: 14px 0;
  border-radius: 14px;
  background: #eef2f5;
  padding: 10px 10px 10px 30px;
}

.plan-confirm-details li {
  margin: 3px 0;
  color: #4b5c6d;
  font-size: 11px;
  font-weight: 650;
}

.plan-columns-list {
  display: grid;
  overflow: auto;
  max-height: calc(100vh - 390px);
  margin: 14px 18px;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 17px;
  background: #ffffff;
}

.plan-column-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid rgb(49 65 80 / 9%);
  padding: 8px 10px;
}

.plan-column-row:last-child {
  border-bottom: 0;
}

.plan-column-visible {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.plan-column-visible strong,
.plan-column-visible small {
  display: block;
}

.plan-column-visible strong {
  color: var(--plan-ink);
  font-size: 11px;
}

.plan-column-visible small {
  margin-top: 2px;
  color: var(--plan-muted);
  font-size: 8px;
}

.plan-column-pin {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--plan-muted);
  font-size: 9px;
  font-weight: 700;
}

.plan-column-order-actions {
  display: flex;
  gap: 4px;
}

.plan-column-order-actions button {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  padding: 0;
}

.column-preset-controls {
  display: grid;
  gap: 10px;
  margin: 14px 18px 0;
  border: 1px solid rgb(49 65 80 / 11%);
  border-radius: 17px;
  background: #ffffff;
  padding: 13px;
}

.column-preset-controls-heading {
  color: var(--plan-ink);
  font-size: 12px;
}

.column-preset-controls-field {
  display: grid;
  gap: 5px;
}

.column-preset-controls-field-label {
  color: var(--plan-muted);
  font-size: 9px;
  font-weight: 750;
}

.column-preset-controls-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.column-preset-controls-button {
  min-height: 44px;
  padding-inline: 9px;
  font-size: 10px;
}

.column-preset-controls-button--primary {
  border-color: rgb(52 143 201 / 35%);
  color: var(--plan-blue-dark);
}

.column-preset-controls-status {
  min-height: 14px;
  margin: 0;
  color: var(--plan-muted);
  font-size: 9px;
}

.column-preset-controls-status.is-error {
  color: var(--plan-red);
}

.plan-settings-panel {
  min-height: 250px;
}

.plan-settings-subtitle {
  margin: 4px 0 12px;
  color: var(--plan-ink);
  font-size: 13px;
}

.plan-settings-subtitle:not(:first-child) {
  margin-top: 20px;
}

.plan-settings-panel--columns :is(
    .plan-column-builtins,
    .column-preset-controls,
    .plan-columns-list
  ) {
  margin-inline: 0;
}

.plan-settings-panel--columns .plan-column-builtins {
  padding: 0;
}

.plan-settings-panel--columns #plan-columns-reset {
  width: 100%;
  margin-top: 12px;
}

.plan-settings-panel .plan-rates-summary,
.plan-settings-panel .plan-settings-note {
  margin: 14px 0 0;
}

body.plan-dialog-open {
  overflow: hidden;
}

@media (max-width: 1780px) {
  .plan-toolbar {
    grid-template-columns: minmax(280px, 1fr) auto;
  }
}

@media (max-width: 960px) {
  .plan-editor-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-editor-section--product,
  .plan-editor-section--ozon,
  .plan-editor-section--purchase,
  .plan-editor-section--details {
    grid-column: 1;
    grid-row: auto;
  }

  .plan-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-toolbar-actions {
    grid-column: auto;
  }

  .plan-refresh-state {
    max-width: 220px;
  }
}

@media (max-width: 760px) {
  .unit-economics-view.is-plan-active > .operational-page-header {
    min-height: auto;
  }

  .unit-economics-view.is-plan-active > .operational-page-header .unit-economics-actions {
    display: none;
  }

  .unit-economics-mode-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-economics-plan-actions.plan-economics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .unit-economics-plan-actions .plan-action {
    width: 100%;
    padding-inline: 8px;
  }

  .plan-economics {
    gap: 12px;
  }

  .plan-kpi-grid {
    gap: 9px;
  }

  .plan-kpi {
    min-height: 112px;
    border-radius: 20px;
    padding: 16px 15px 14px;
  }

  .plan-kpi > span {
    font-size: 9px;
  }

  .plan-kpi > strong {
    margin-top: 13px;
    font-size: 24px;
  }

  .plan-kpi > small {
    margin-top: 8px;
    font-size: 9px;
  }

  .plan-toolbar,
  .plan-table-panel {
    border-radius: 21px;
    padding: 11px;
  }

  .plan-toolbar-actions {
    display: flex;
    width: auto;
  }

  .plan-toolbar-actions .plan-action {
    width: 100%;
    padding-inline: 8px;
  }

  #plan-add-open {
    height: 44px;
    min-height: 44px;
  }

  .plan-table-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
  }

  .plan-table-meta .plan-inline-action {
    width: 100%;
    min-height: 44px;
    margin: 0;
  }

  .plan-refresh-state {
    overflow: visible;
    max-width: none;
    grid-column: 1 / -1;
    white-space: normal;
  }

  .plan-table-heading {
    display: grid;
  }

  .plan-table-heading-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-table-heading-actions :is(.plan-inline-action, .plan-action) {
    width: 100%;
    min-height: 44px;
    margin: 0;
  }

  .plan-table-scroll {
    display: none;
  }

  .plan-mobile-list {
    display: grid;
    gap: 10px;
  }

  .plan-mobile-card {
    overflow: hidden;
    border: 1px solid rgb(49 65 80 / 12%);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 0 15px rgb(34 49 64 / 5%);
    padding: 12px;
  }

  .plan-mobile-card-head {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 9px;
    align-items: flex-start;
  }

  .plan-mobile-product {
    display: grid;
    min-height: 44px;
    border: 0;
    outline: none;
    background: none;
    padding: 0;
    color: var(--plan-ink);
    text-align: left;
  }

  .plan-mobile-product.has-image {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
  }

  .plan-mobile-product > img {
    width: 44px;
    height: 44px;
    border: 1px solid rgb(49 65 80 / 10%);
    border-radius: 11px;
    background: #f1f4f6;
    object-fit: cover;
  }

  .plan-mobile-product-copy {
    display: grid;
    min-width: 0;
  }

  .plan-mobile-product-copy > strong {
    font-size: 13px;
    line-height: 1.3;
  }

  .plan-mobile-product-copy > span {
    margin-top: 4px;
    color: var(--plan-muted);
    font-size: 10px;
  }

  .plan-mobile-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
    border-block: 1px solid rgb(49 65 80 / 9%);
    padding-block: 10px;
  }

  .plan-mobile-metrics > div {
    min-width: 0;
  }

  .plan-mobile-metrics span,
  .plan-mobile-metrics strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .plan-mobile-metrics span {
    color: var(--plan-muted);
    font-size: 8px;
    font-weight: 680;
  }

  .plan-mobile-metrics strong {
    margin-top: 4px;
    color: var(--plan-ink);
    font-size: 11px;
  }

  .plan-mobile-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
  }

  .plan-mobile-configure {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .plan-mobile-decision-summary {
    color: var(--plan-muted);
    font-size: 10px;
    font-weight: 720;
  }

  .plan-editor,
  .plan-side-settings,
  .plan-modal {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: none;
    border-width: 0;
    border-radius: 0;
    transform: none;
  }

  #plan-add-modal,
  #plan-add-modal.is-catalog-mode {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    transform: none;
  }

  .plan-editor {
    z-index: 130;
  }

  .plan-modal {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .plan-modal .plan-add-panel,
  .plan-modal .plan-export-options,
  .plan-confirm-details {
    overflow-y: auto;
  }

  .plan-dialog-head {
    padding: max(16px, env(safe-area-inset-top)) 15px 14px;
  }

  .plan-dialog-head h2 {
    font-size: 19px;
  }

  .plan-editor-section {
    margin: 0 0 10px;
    border-radius: 17px;
    padding: 12px;
  }

  .plan-editor-body {
    display: block;
    padding: 10px 10px 0;
  }

  .plan-form-grid,
  .plan-cost-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .plan-editor-section--ozon .plan-cost-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-editor-section--ozon .plan-field {
    grid-template-rows: auto 44px auto auto;
  }

  .plan-field--wide {
    grid-column: auto;
  }

  .plan-live-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 10px;
  }

  .plan-live-result > div:nth-child(2) {
    border-right: 0;
  }

  .plan-live-result > div:nth-child(-n + 2) {
    border-bottom: 1px solid rgb(49 65 80 / 9%);
    padding-bottom: 9px;
  }

  .plan-editor-footer {
    padding-inline: 10px;
  }

  .plan-editor-footer > div {
    min-width: 0;
  }

  .plan-editor-footer .plan-action {
    padding-inline: 10px;
  }

  .plan-column-builtins {
    overflow-x: auto;
  }

  .plan-column-builtins .plan-action {
    flex: 0 0 auto;
  }

  .plan-columns-list {
    max-height: none;
  }

  .plan-column-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .plan-column-order-actions {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .plan-modal-actions--three {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-modal-actions--three #plan-confirm-secondary {
    grid-column: 1 / -1;
  }

  .plan-overlay {
    background: rgb(231 235 239 / 82%);
  }
}

@media (max-width: 420px) {
  .plan-kpi > strong {
    font-size: 21px;
  }

  .plan-mobile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-toolbar-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-editor-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-editor-footer > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-editor-footer .plan-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plan-filter,
  .plan-action,
  .plan-inline-action,
  .plan-icon-button,
  .plan-modal-tab,
  .plan-input-with-source > button,
  .plan-column-order-actions button,
  .column-preset-controls-button {
    transition: none;
  }

  .plan-spinner,
  .plan-refresh-state.is-loading::before {
    animation: none;
  }

  .plan-editor:not([hidden]),
  .plan-side-settings:not([hidden]),
  #plan-add-modal:not([hidden]) {
    animation: none;
  }
}

/* One calm blue edge and one even shadow for controls and compact tiles. */
:root {
  --aw-blue-edge: rgb(91 164 214 / 42%);
  --aw-blue-edge-active: rgb(65 153 214 / 78%);
  --aw-blue-ring: rgb(91 181 230 / 24%);
  --aw-surface-shadow:
    0 0 0 1px rgb(32 45 58 / 3%),
    0 0 7px rgb(24 36 48 / 13%),
    0 0 18px rgb(34 49 64 / 8%);
  --aw-control-shadow:
    0 0 0 1px rgb(32 45 58 / 3%),
    0 0 7px rgb(24 36 48 / 13%),
    0 0 18px rgb(34 49 64 / 8%);
  --aw-tile-shadow:
    0 0 0 1px rgb(32 45 58 / 3%),
    0 8px 24px rgb(34 49 64 / 8%);
}

body :is(
    .stats-range-trigger,
    .heatmap-product-trigger,
    .unit-product-picker-trigger
  ) {
  border-color: var(--aw-blue-edge);
  border-radius: var(--aw-control-radius);
  box-shadow: var(--aw-control-shadow);
}

body :is(.stats-range-trigger, .heatmap-product-trigger, .unit-product-picker-trigger):focus-visible,
body :is(.stats-range-trigger, .heatmap-product-trigger)[aria-expanded="true"],
body .unit-product-picker.is-open .unit-product-picker-trigger {
  border-color: var(--aw-blue-edge-active);
  outline: none;
  box-shadow:
    0 0 0 3px var(--aw-blue-ring),
    var(--aw-control-shadow);
}

body button:focus-visible {
  outline-color: var(--aw-blue-ring);
  border-color: var(--aw-blue-edge-active);
}

body.auth-ready :is(
    .metric-card,
    .cabinet-tile,
    .cpc-stat-card,
    .cpc-stat-tile,
    .cpc-drr-tile,
    .unit-economics-metric-card,
    .indicator-card,
    .future-card,
    .store-card,
    .session-card,
    .cpc-rule-card
  ) {
  box-shadow: var(--aw-tile-shadow);
}

/* Settings opts out of the legacy 1780px desktop canvas. */
body.auth-ready.future-mode:has(#app-settings-view:not([hidden])) {
  min-width: 0;
  overflow-x: hidden;
}

@media (min-width: 761px) {
  body.auth-ready.future-mode:has(#app-settings-view:not([hidden])) .page {
    width: calc(100% - 244px);
    min-width: 0;
    margin-left: 244px;
    padding: 24px;
  }

  body.auth-ready #app-settings-view:not([hidden]) {
    width: min(100%, var(--workspace-content-width));
    min-width: 0;
    max-width: var(--workspace-content-width);
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  body.auth-ready.future-mode:has(#app-settings-view:not([hidden])) .side-nav {
    width: min(82vw, 320px);
    max-width: calc(100vw - 48px);
    transform: translateX(calc(-100% - 18px));
    transition: transform 220ms ease, box-shadow 220ms ease;
    box-shadow: 18px 0 42px rgb(15 23 42 / 14%);
  }

  body.auth-ready.future-mode:has(#app-settings-view:not([hidden])).mobile-nav-open .side-nav {
    transform: translateX(0);
  }

  body.auth-ready.future-mode:has(#app-settings-view:not([hidden])) .mobile-nav-toggle {
    display: inline-flex !important;
  }

  body.auth-ready.future-mode:has(#app-settings-view:not([hidden])).mobile-nav-open .mobile-menu-backdrop {
    display: block !important;
  }

  body.auth-ready.future-mode:has(#app-settings-view:not([hidden])) .page {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    padding: 64px 12px 32px;
  }

  body.auth-ready #app-settings-view:not([hidden]) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
  }
}
.local-mirror-banner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 1480px);
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 1px solid rgba(166, 123, 24, 0.24);
  border-radius: 16px;
  background: #fff8df;
  color: #5d4715;
  box-shadow: 0 8px 24px rgba(87, 64, 12, 0.08);
}

.local-mirror-banner strong {
  flex: 0 0 auto;
  color: #3f300f;
}

.local-mirror-banner.is-stale {
  border-color: rgba(177, 43, 43, 0.34);
  background: #fff0f0;
  color: #7f2020;
  box-shadow: 0 8px 24px rgba(127, 32, 32, 0.1);
}

.local-mirror-banner.is-stale strong {
  color: #641818;
}

.local-mirror-banner span {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.local-mirror-banner[hidden] {
  display: none !important;
}

/* This compact action must stay circular even after the global authenticated
   button material is applied later in the cascade. */
body.auth-ready .side-logout {
  border-radius: 50%;
  --side-logout-visual-size: 24px;

  position: absolute;
  top: 50%;
  right: 8px;
  border: 0;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
  transform: translateY(-50%);
}

body.auth-ready .side-logout::before {
  position: absolute;
  top: 50%;
  left: 50%;
  box-sizing: border-box;
  width: var(--side-logout-visual-size);
  height: var(--side-logout-visual-size);
  border: 1px solid rgb(217 45 32 / 14%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #fffafa 76%, #f6ebeb 100%);
  box-shadow:
    inset 0 -5px 8px -8px rgb(145 56 56 / 7%),
    0 1px 2px rgb(44 53 63 / 9%);
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
}

body.auth-ready .side-logout > svg {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
}

body.auth-ready .side-logout:hover::before {
  background: linear-gradient(180deg, #ffffff 0%, #fff1f0 76%, #f5dfdd 100%);
  box-shadow:
    inset 0 -5px 8px -8px rgb(145 56 56 / 9%),
    0 1px 3px rgb(44 53 63 / 12%);
}

body.auth-ready .side-logout:active::before {
  box-shadow:
    inset 0 -4px 7px -8px rgb(145 56 56 / 10%),
    0 1px 1px rgb(44 53 63 / 8%);
}

@media (hover: hover) and (pointer: fine) {
  body.auth-ready .side-logout:not(:disabled):hover {
    box-shadow: none;
    transform: translateY(-50%);
  }
}

body.auth-ready .side-logout:not(:disabled):active {
  box-shadow: none;
  transform: translateY(-50%);
}

/* The authenticated workspace is a fixed desktop canvas above 980px and a
   real mobile canvas below it. Keep wide tables inside their own scroll areas. */
@media (max-width: 980px) {
  body.auth-ready,
  body.auth-ready.mobile-nav-open {
    min-width: 0;
    overflow-x: hidden;
  }

  body.auth-ready .side-nav {
    width: min(82vw, 320px);
    max-width: calc(100vw - 48px);
    transform: translateX(calc(-100% - 18px));
    transition: transform 220ms var(--ease-out), box-shadow 220ms ease;
    box-shadow: 18px 0 42px rgb(15 23 42 / 14%);
  }

  body.auth-ready.mobile-nav-open .side-nav {
    transform: translateX(0);
  }

  body.auth-ready .mobile-nav-toggle {
    display: inline-flex !important;
    min-height: 44px;
  }

  /* An open date picker must own the overlapping mobile area. Keep the fixed
     menu action in layout, but remove it from painting and hit testing. */
  body.auth-ready:has(
      #heatmap-range-popover:not([hidden]),
      #stats-range-popover:not([hidden]),
      #unit-economics-range-popover:not([hidden])
    ) .mobile-nav-toggle {
    visibility: hidden;
    pointer-events: none;
  }

  body.auth-ready.mobile-nav-open .mobile-menu-backdrop {
    display: block !important;
  }

  body.auth-ready .page,
  body.auth-ready.stats-mode .page,
  body.auth-ready.future-mode .page,
  body.auth-ready.unit-economics-mode .page {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    padding: 64px 12px 32px;
  }

  body.auth-ready .view-panel,
  body.auth-ready #app-settings-view:not([hidden]) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
  }

  body.auth-ready #heatmaps-view > .heatmap-toolbar {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  body.auth-ready #heatmaps-view > .heatmap-toolbar .heatmap-cr-control {
    width: 100%;
    min-width: 0 !important;
  }

  body.auth-ready .heatmap-body {
    grid-template-columns: minmax(0, 1fr);
  }

  body.auth-ready .heatmap-table-wrap,
  body.auth-ready .hour-heatmap-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  body.auth-ready .heatmap-card,
  body.auth-ready .heatmap-body,
  body.auth-ready .heatmap-main-column {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.auth-ready #heatmap-range-popover,
  body.auth-ready #stats-range-popover {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  body.auth-ready :is(
      #heatmap-range-popover,
      #stats-range-popover
    ) :is(.heatmap-range-popover-body, .stats-range-popover-body),
  body.auth-ready :is(#heatmap-range-calendar, #stats-range-calendar) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.auth-ready .stats-toolbar {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  body.auth-ready .stats-toolbar .stats-main-range-control,
  body.auth-ready .stats-toolbar .stats-search-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.auth-ready.stats-mode #summary-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  body.auth-ready .operational-page-header,
  body.auth-ready .cabinet-header,
  body.auth-ready #cpc-view .cpc-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  body.auth-ready .header-actions,
  body.auth-ready .cpc-page-actions {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  body.auth-ready .header-actions > *,
  body.auth-ready .cpc-page-actions > * {
    max-width: 100%;
  }

  body.auth-ready:has(#cpc-view:not([hidden])) {
    min-width: 0;
  }

  body.auth-ready:has(#cpc-view:not([hidden])) .page {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
  }

  body.auth-ready #cpc-view .cpc-summary-grid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  body.auth-ready #cpc-view .cpc-layout-shell,
  body.auth-ready #cpc-view .cpc-product-card,
  body.auth-ready #cpc-view .cpc-rule-top,
  body.auth-ready #cpc-view .cpc-rule-workspace,
  body.auth-ready #cpc-view .cpc-rule-card {
    grid-template-columns: minmax(0, 1fr);
  }

  #cpc-view .cpc-product-summary,
  #cpc-view .cpc-product-list-head {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Table settings use the same opaque white material and control geometry as
   the authenticated workspace. Keep this block last: older feature styles
   intentionally share generic selectors with the plan editor. */
#settings-backdrop {
  background: #ffffff;
}

body.auth-ready #settings-drawer,
body.auth-ready #settings-drawer > .drawer-header,
body.auth-ready #settings-drawer > .settings-list,
body.auth-ready #statistics-column-presets {
  background-color: #ffffff;
  background-image: none;
}

#statistics-column-presets .column-preset-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  padding: 0;
}

#statistics-column-presets .column-preset-controls-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#statistics-column-presets :is(
    .column-preset-controls-input,
    .column-preset-controls-select,
    .column-preset-controls-button
  ) {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-height: 44px;
  border-radius: var(--aw-control-radius, 16px);
  background-color: #ffffff;
  background-image: none;
}

/* Indicator cards keep the full drawer width. Only their vertical rhythm is
   compacted; horizontal sizing and the existing visual style stay untouched. */
#indicators-settings {
  align-content: start;
}

#indicators-settings .indicator-card {
  gap: 4px;
  padding-top: 6px;
  padding-bottom: 6px;
}

#indicators-settings .indicator-card + .indicator-card {
  margin-top: 0;
}

#indicators-settings .indicator-thresholds {
  display: grid;
  grid-template-columns: 111px 111px minmax(0, 1fr);
  column-gap: 3px;
  row-gap: 4px;
  align-items: center;
}

#indicators-settings .indicator-thresholds > .indicator-threshold {
  display: grid;
  grid-template-columns: 8px 18px 68px 8px;
  gap: 0 3px;
  align-items: center;
  min-width: 0;
}

#indicators-settings .indicator-thresholds > .indicator-threshold--tail {
  grid-template-columns: 8px max-content;
  gap: 0 2px;
}

#indicators-settings :is(
    .indicator-threshold-label,
    .indicator-threshold-unit,
    .indicator-threshold-tail-label
  ) {
  display: block;
  min-width: 0;
  gap: 0;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

#indicators-settings .indicator-thresholds input {
  box-sizing: border-box;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  height: 28px;
  min-height: 28px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.metric-availability-badge.is-unknown {
  border-color: #eadfbf;
  background: #fff8df;
  color: #7a5b14;
}

/* On narrow screens a locked subscription badge gets its own row. This keeps
   the metric name readable and the existing list as the vertical scroller. */
@media (max-width: 480px) {
  #columns-settings {
    align-content: start;
    grid-auto-rows: max-content;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #columns-settings > .column-choice {
    min-width: 0;
    max-width: 100%;
    grid-template-columns: 24px 18px minmax(0, 1fr) 24px;
  }

  #columns-settings > .column-choice > span:not(.drag-handle, .locked-badge) {
    min-width: max-content;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }

  #columns-settings > .column-choice > .locked-badge {
    min-width: 0;
    max-width: 100%;
    grid-row: 2;
    grid-column: 3 / 5;
    justify-self: start;
    margin-left: 0;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }

  #columns-settings > .column-choice > .locked-badge.is-plan-lock {
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    grid-row: 1;
    grid-column: 4;
    justify-self: end;
    align-self: center;
  }
}
