:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #738098;
  --line: #e7ecf4;
  --blue: #1557ff;
  --blue-2: #0f46dd;
  --green: #12a05c;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --sidebar: #ffffff;
  --sidebar-2: #f9fbff;
  --shadow: 0 6px 18px rgba(29, 42, 68, 0.045);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  place-items: center;
  background: #f6f8fc;
}

.app-loading .app-loader {
  display: grid;
}

.app-loading .app-main {
  opacity: 0;
  pointer-events: none;
}

.app-loader div {
  display: grid;
  min-width: min(360px, calc(100vw - 40px));
  justify-items: center;
  gap: 7px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-loader div::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid #dbe6ff;
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: app-loader-spin 0.8s linear infinite;
}

.app-loader strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

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

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

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

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

button,
input,
select {
  font: inherit;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

button {
  cursor: pointer;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #fff;
  box-shadow: 0 12px 30px rgba(9, 18, 35, 0.14);
}

.logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 40px;
  padding: 0 6px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1c6bff, #1745ea);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.logo strong {
  font-size: 14px;
  white-space: nowrap;
}

.side-nav {
  display: flex;
  flex: 1 1 auto;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.side-nav a {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.side-nav a svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  color: rgba(255, 255, 255, 0.84);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav a.is-active {
  background: linear-gradient(135deg, #1564ff, #0d46e9);
  color: #fff;
  box-shadow: 0 8px 16px rgba(21, 100, 255, 0.25);
}

.side-nav a.is-active svg {
  color: #fff;
}

.user-box {
  display: none;
  align-items: center;
  gap: 12px;
  margin: auto -14px -24px;
  padding: 22px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #ffffff 0 18%, transparent 19%),
    radial-gradient(circle at 50% 90%, #ffffff 0 32%, transparent 33%),
    #c7d2e7;
}

.user-box strong,
.user-box small {
  display: block;
}

.user-box small {
  color: rgba(255, 255, 255, 0.68);
}

.app-main {
  margin-left: 0;
  padding: 18px 24px 28px;
  min-width: 0;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

#unit .page-top {
  margin-bottom: 14px;
}

#unit h1 {
  font-size: 26px;
}

#unit .action-button {
  min-height: 42px;
  padding: 0 16px;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
  letter-spacing: 0;
}

.hint {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #a8b2c6;
  border-radius: 50%;
  color: #71809a;
  font-size: 11px;
  font-weight: 900;
}

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

.snapshot-picker {
  display: grid;
  gap: 4px;
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.snapshot-picker input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #1b2740;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30, 43, 70, 0.04);
}

.date-range-picker {
  display: flex;
  align-items: end;
  gap: 8px;
}

.date-range-picker .snapshot-picker input {
  min-width: 148px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #1b2740;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(30, 43, 70, 0.04);
}

.file-action input {
  display: none;
}

.action-button.primary {
  border-color: var(--blue);
  background: linear-gradient(135deg, #175fff, #0f47ea);
  color: #fff;
  box-shadow: 0 14px 26px rgba(21, 87, 255, 0.22);
}

.action-button.soft-blue {
  border-color: #b9cdfd;
  background: #edf4ff;
  color: #1557ff;
  box-shadow: 0 8px 18px rgba(21, 87, 255, 0.08);
}

.action-button.soft-blue:hover {
  border-color: #8fb0ff;
  background: #e3edff;
}

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

.stat-card {
  display: flex;
  justify-content: space-between;
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover,
.stat-card.is-active {
  transform: translateY(-1px);
  border-color: #c9d6ff;
  box-shadow: 0 18px 42px rgba(21, 87, 255, 0.12);
}

.stat-card span,
.filters-bar label,
th {
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.stat-card strong {
  display: block;
  margin: 14px 0 10px;
  font-size: 29px;
  line-height: 1;
}

.stat-card em {
  color: var(--green);
  font-size: 14px;
  font-style: normal;
  font-weight: 850;
}

.stat-card:nth-child(5) em {
  color: var(--red);
}

.stat-card small {
  color: #53617b;
}

.stat-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
}

.stat-icon.blue {
  background: #e8f0ff;
  color: var(--blue);
}

.stat-icon.green {
  background: #cdebd9;
  color: #37a76b;
}

.stat-icon.orange {
  background: #fff1d9;
  color: #f59e0b;
}

.stat-icon.red {
  background: #ffd9df;
  color: #ef4444;
}

.stat-icon.purple {
  background: #eee5ff;
  color: #7c3aed;
}

.stat-icon.coral {
  background: #ffe6dc;
  color: #ff6b3d;
}

.filters-bar {
  display: grid;
  grid-template-columns: minmax(300px, 1.5fr) repeat(6, minmax(96px, 0.55fr)) minmax(120px, 0.62fr) minmax(170px, 0.8fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filters-bar label {
  display: grid;
  gap: 6px;
}

.filters-bar input,
.filters-bar select,
.calc-panel input,
.calc-panel select,
.page-top select,
.table-meta select,
.promo-card input {
  min-height: 44px;
  width: 100%;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #fff;
  color: #17213a;
}

.filters-bar input,
.calc-panel input,
.promo-card input {
  padding: 0 12px;
}

.filters-bar select,
.page-top select,
.table-meta select {
  padding: 0 12px;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  right: 13px;
  bottom: 11px;
  color: #52627d;
  font-weight: 900;
}

.search-field input {
  width: 100%;
  padding-right: 40px;
}

.search-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.search-summary article {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-summary span,
.search-summary small,
.search-toolbar span {
  color: #66728a;
  font-size: 12px;
  font-weight: 800;
}

.search-summary strong {
  color: #13203a;
  font-size: 20px;
  line-height: 1.1;
}

.search-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.data-card {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.products-table {
  width: 100%;
  min-width: 1480px;
  border-collapse: collapse;
}

.products-table.compact {
  min-width: 980px;
}

.products-table.card-analytics-table {
  min-width: 1500px;
}

.products-table.unit-table {
  min-width: 1920px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  vertical-align: middle;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.table-sort-button b {
  color: #a2adc2;
  font-size: 11px;
  line-height: 1;
}

.table-sort-button.is-active {
  color: var(--blue);
}

.table-sort-button.is-active b {
  color: var(--blue);
}

td {
  color: #101a30;
  font-size: 13px;
  font-weight: 650;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #f8fbff;
}

.image-col {
  width: 56px;
}

.product-image {
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  overflow: hidden;
  border: 1px solid #e4e8f1;
  border-radius: 8px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #9ed0ff;
  font-size: 19px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.product-image.has-image {
  background: #fff;
  color: inherit;
  box-shadow: none;
}

.product-image img,
.large-product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.name-cell {
  min-width: 145px;
  max-width: 190px;
  line-height: 1.35;
}

.name-cell strong {
  display: block;
}

.product-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: inherit;
}

.ozon-product-link {
  display: inline-flex;
  margin-top: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.ozon-product-link:hover {
  text-decoration: underline;
}

.positive,
.status-ok {
  color: var(--green);
}

.negative,
.status-bad {
  color: var(--red);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
}

.badge.green {
  background: #e8f8ef;
  color: var(--green);
}

.badge.orange {
  background: #fff3dd;
  color: #e98600;
}

.badge.red {
  background: #ffe9ec;
  color: var(--red);
}

.badge.blue {
  background: #e8f0ff;
  color: var(--blue);
}

.badge.gray {
  background: #f1f4f8;
  color: #5b667a;
}

.muted-small {
  display: inline-block;
  margin-left: 4px;
  color: #7a869d;
  font-size: 11px;
  font-weight: 800;
}

.unit-price-main {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.unit-money-cell {
  text-align: center;
}

.unit-table.unit-expenses-collapsed .unit-expense-detail,
.unit-table.unit-expenses-expanded .unit-extra-total {
  display: none;
}

.unit-extra-expenses {
  display: inline-grid;
  min-width: 76px;
  justify-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #f3f7ff;
}

.unit-extra-expenses b {
  color: #182033;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.1;
}

.unit-extra-expenses small {
  color: #7a869d;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
}

.unit-cell-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 32px;
}

.unit-cell-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 15px;
  transform: translateX(-50%);
  color: #7a869d;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.unit-spp-cell {
  min-width: 120px;
}

.unit-co-invest-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 15px;
  transform: translateX(-50%);
  color: #7a869d;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.unit-rate-input {
  width: 28px;
  min-height: 24px;
  padding: 0 3px;
  border: 1px solid #dbe3f0;
  border-radius: 5px;
  background: #fff;
  color: #111827;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.unit-percent-stack {
  min-width: 62px;
}

.unit-percent-stack span {
  color: #7a869d;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
}

.unit-percent-stack b {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 74px;
  padding: 0 26px;
}

.unit-summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(320px, 1.35fr) repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.unit-summary-grid article {
  min-height: 76px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.unit-summary-grid span,
.unit-controls label,
.unit-bulk-panel label {
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.unit-summary-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
}

.unit-summary-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  margin-top: 9px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #fff1f2;
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
}

.unit-summary-note b {
  color: var(--red);
}

.unit-line-stock,
.unit-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.unit-line-chip,
.unit-threshold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f5f7fb;
  color: #24304a;
  font-size: 11px;
  font-weight: 850;
}

.unit-line-chip em,
.unit-line-chip i,
.unit-threshold em {
  display: inline-flex;
  min-width: 20px;
  justify-content: center;
  font-style: normal;
}

.unit-line-chip em,
.unit-threshold.above em {
  color: var(--green);
}

.unit-line-chip i,
.unit-threshold.below em {
  color: var(--red);
}

.unit-controls,
.unit-bulk-panel {
  display: grid;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.unit-bulk-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.unit-bulk-inputs {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(120px, 0.65fr);
  flex: 1 1 420px;
  gap: 8px;
  min-width: 0;
}

.unit-bulk-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: end;
  align-content: end;
  flex: 0 1 auto;
  gap: 5px;
  min-width: 0;
}

.unit-bulk-group > span {
  grid-row: 1;
  grid-column: 1 / -1;
  color: #68758c;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.unit-bulk-group .action-button {
  grid-row: 2;
  min-width: 82px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.unit-bulk-group select,
.unit-bulk-group input {
  grid-row: 2;
  min-height: 34px;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  font-size: 12px;
  font-weight: 700;
}

.unit-bulk-group select {
  width: 150px;
  padding: 0 26px 0 10px;
}

.unit-bulk-group input {
  width: 155px;
  padding: 0 10px;
}

.unit-controls label,
.unit-bulk-panel label,
.unit-filter-group {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.unit-range-filter,
.unit-filter-actions {
  grid-column: 1;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.unit-range-filter {
  grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(120px, 1fr));
}

.unit-filter-actions {
  grid-template-columns: minmax(180px, 1fr) minmax(260px, max-content) max-content;
  align-items: end;
}

.unit-group-select {
  min-width: 180px;
}

.unit-line-group {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-content: start;
}

.unit-line-group .unit-quick-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  align-items: stretch;
}

.unit-line-group .unit-quick-filters button {
  width: 100%;
}

.unit-hidden-select {
  display: none !important;
}

.unit-controls input,
.unit-controls select,
.unit-bulk-panel input,
.unit-bulk-panel select {
  height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #fff;
  color: #17213a;
  line-height: 42px;
}

.unit-filter-group > span {
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.unit-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.unit-quick-filters button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #dfe5ef;
  border-radius: 7px;
  background: #f7f9fd;
  color: #24304a;
  font-size: 12px;
  font-weight: 850;
}

.unit-quick-filters button.is-active {
  border-color: var(--blue);
  background: #eaf1ff;
  color: var(--blue);
}

.unit-table-tools {
  display: grid;
  grid-template-columns: minmax(260px, 520px);
  margin: 4px 0 10px;
}

.unit-table-tools .search-field input {
  min-height: 42px;
}

.unit-reset-button {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
  align-self: end;
}

.unit-th {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: normal;
}

.unit-th button {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #59657c;
  font-size: 12px;
  font-weight: 900;
}

.unit-th button:hover {
  background: #edf3ff;
  color: var(--blue);
}

.unit-actions-head,
.unit-actions-cell {
  width: 48px;
  min-width: 48px;
}

.unit-row-actions {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.unit-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--blue);
}

.unit-stock-head,
.unit-stock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 18px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.unit-stock-head {
  background: #f3f6fb;
  color: #71809a;
  text-transform: uppercase;
}

.unit-stock-badge.is-in {
  background: #e7f8ee;
  color: var(--green);
}

.unit-stock-badge.is-out {
  background: #ffecee;
  color: var(--red);
}

.unit-icon-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #dbe3f0;
  border-radius: 6px;
  background: #fff;
  color: #59657c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.unit-icon-button:hover {
  border-color: #b9cdfd;
  background: #edf4ff;
  color: var(--blue);
}

.unit-row-input {
  width: 112px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dbe3f0;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font-weight: 850;
}

.unit-row-input.compact {
  width: 96px;
}

.unit-row-input.wholesale-input {
  width: 76px;
}

.unit-row-input.ads-input {
  width: 76px;
  min-height: 32px;
}

.unit-row-input.target-price-input {
  width: 92px;
  min-height: 34px;
  border-color: #b7ccff;
  background: #fff;
  color: #1557ff;
  font-weight: 900;
}

.unit-row-input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(21, 87, 255, 0.14);
}

.unit-margin-cell {
  min-width: 128px;
}

.unit-margin-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.unit-margin-cell .unit-percent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.unit-percent-badge span,
.unit-percent-badge em {
  font-size: 10.5px;
  font-style: normal;
  line-height: 1;
}

.unit-percent-badge b {
  font-size: 12px;
  line-height: 1.1;
}

.unit-margin-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #eaf1ff;
  color: #1557ff;
  font-weight: 850;
  white-space: nowrap;
}

.unit-margin-check span,
.unit-margin-check em {
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.unit-margin-check b {
  font-size: 11px;
  line-height: 1.1;
}

.unit-ads-cell {
  min-width: 104px;
}

.unit-split-cell {
  display: inline-flex;
  min-width: 86px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
}

.unit-split-line {
  display: grid;
  grid-template-columns: minmax(34px, auto) minmax(48px, 1fr);
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 5px;
  color: #182033;
  line-height: 1.1;
}

.unit-split-line em,
.unit-split-line i,
.unit-split-line span {
  color: #7a869d;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.unit-split-line b {
  color: #182033;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.unit-split-line > b:only-child {
  grid-column: 1 / -1;
}

.unit-split-current {
  color: #182033;
}

.unit-split-new {
  border-radius: 7px;
  background: #f3f7ff;
}

.unit-split-new b {
  color: #1557ff;
}

.unit-target-split {
  min-width: 126px;
}

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

.unit-target-split .target-price-input {
  width: 92px;
  min-width: 92px;
  justify-self: center;
}

.unit-split-cell .unit-rate-input {
  width: 34px;
  height: 22px;
  min-height: 22px;
  padding: 0 4px;
  font-size: 11px;
}

.unit-spp-cell .unit-split-cell {
  min-width: 112px;
}

.unit-spp-cell .unit-split-line {
  grid-template-columns: 48px 68px;
  padding: 0 3px;
}

.unit-spp-cell .unit-split-line b {
  text-align: left;
}

.unit-split-cell .ads-input {
  width: 66px;
  min-height: 26px;
}

.unit-ads-cell .unit-split-cell {
  min-width: 96px;
}

.unit-ads-cell .unit-split-line {
  grid-template-columns: 42px 54px;
  padding: 0 3px;
}

.unit-ads-cell .unit-split-line b {
  text-align: left;
}

.unit-ads-source {
  color: #7a869d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-margin-split {
  min-width: 126px;
  align-items: stretch;
}

.unit-margin-split .unit-split-line {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) auto;
  min-height: 26px;
  padding: 3px 6px;
}

.unit-margin-split .unit-split-line em,
.unit-margin-split .unit-split-line i {
  color: currentColor;
  opacity: 0.72;
}

.unit-margin-split .unit-split-line b {
  color: currentColor;
}

.unit-promo-cell {
  min-width: 150px;
  text-align: center;
}

.unit-promo-summary {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  line-height: 1.05;
  white-space: nowrap;
  width: 146px;
}

.unit-promo-title {
  color: #5f6f8a;
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.unit-promo-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.unit-promo-range span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-height: 22px;
  padding: 3px 5px;
  border-radius: 6px;
  background: #fff4df;
  color: #d97706;
}

.unit-promo-range i {
  color: #9a6b18;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 750;
  line-height: 1;
  text-transform: uppercase;
}

.unit-promo-range b {
  color: #182033;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.05;
}

.unit-promo-decision {
  display: grid;
  grid-template-columns: 1fr minmax(48px, auto);
  align-items: center;
  gap: 3px;
}

.unit-promo-new-price,
.unit-promo-boost {
  min-height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.05;
  padding: 5px 6px;
}

.unit-promo-new-price {
  background: #e7f8ee;
  color: #128042;
}

.unit-promo-new-price.orange {
  background: #fff4df;
  color: #e98600;
}

.unit-promo-new-price.red {
  background: #ffecee;
  color: var(--red);
}

.unit-promo-boost {
  min-width: 48px;
  background: #ffecee;
  color: var(--red);
  text-align: center;
}

.unit-promo-boost.orange {
  background: #fff4df;
  color: #e98600;
}

.unit-promo-boost.green {
  background: #ffecee;
  color: var(--red);
}

.unit-promo-summary small,
.unit-promo-name,
.unit-promo-empty {
  color: #7a869d;
  font-size: 10px;
  font-weight: 600;
}

.unit-promo-statuses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.unit-promo-summary em {
  border-radius: 5px;
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  padding: 2px 4px;
  text-align: center;
}

.unit-promo-summary em.green {
  background: #e7f8ee;
  color: var(--green);
}

.unit-promo-summary em.orange {
  background: #fff4df;
  color: #e98600;
}

.unit-promo-summary em.red {
  background: #ffecee;
  color: var(--red);
}

.unit-promo-summary em.gray {
  background: #f1f5fa;
  color: #7a869d;
}

.unit-drr-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 15px;
  transform: translateX(-50%);
  color: #7a869d;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.unit-money-cell .unit-row-input,
.unit-money-cell .unit-percent-stack b,
.unit-money-cell .unit-price-main {
  font-weight: 600;
}

.unit-money-cell .unit-row-input {
  text-align: center;
}

.target-price-head,
.target-price-cell {
  background: #eef5ff;
  box-shadow: inset 3px 0 0 #1557ff;
}

.target-price-head {
  color: #1746be;
}

.target-price-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #b7ccff;
  border-radius: 7px;
  background: #ffffff;
  color: #1557ff;
  font-size: 13px;
  font-weight: 900;
}

.unit-bulk-panel .action-button {
  min-height: 34px;
  min-width: 0;
  padding-inline: 10px;
  white-space: normal;
}

.unit-bulk-panel .report-button {
  border-color: #b7ccff;
  background: #f5f8ff;
  color: #1557ff;
}

.unit-bulk-status {
  flex: 1 1 240px;
  align-self: center;
  min-height: 28px;
  padding-top: 2px;
  color: #647089;
  font-size: 12px;
  font-weight: 850;
}

.unit-bulk-status.green {
  color: var(--green);
}

.unit-bulk-status.red {
  color: var(--red);
}

.unit-history-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 16, 31, 0.42);
}

.unit-history-modal.is-open {
  display: flex;
}

.unit-history-dialog {
  width: min(760px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(7, 13, 28, 0.26);
}

.unit-history-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.unit-history-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.unit-history-list {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding: 14px 18px 18px;
}

.unit-history-item {
  display: grid;
  grid-template-columns: 110px minmax(80px, 0.35fr) minmax(120px, 0.45fr) minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #edf1f7;
  border-radius: 8px;
  background: #fbfcff;
}

.unit-history-item time,
.unit-history-item span,
.unit-history-item small {
  color: #6b768c;
  font-size: 11px;
  font-weight: 800;
}

.unit-history-item strong,
.unit-history-item p {
  margin: 0;
  color: #142038;
  font-size: 12px;
  font-weight: 900;
}

.unit-history-item small {
  grid-column: 2 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-history-empty {
  padding: 22px;
  color: #647089;
  font-weight: 850;
  text-align: center;
}

.unit-table th,
.unit-table td {
  padding: 10px 8px;
  white-space: nowrap;
}

.unit-table .name-cell {
  min-width: 230px;
  max-width: 280px;
  white-space: normal;
}

.unit-table .product-open {
  font-size: 11px;
  line-height: 1.25;
}

.unit-table .name-cell strong {
  font-size: 12px;
}

.product-top {
  align-items: flex-start;
}

.product-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.product-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.back-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #24304a;
  font-weight: 850;
}

.product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: -8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.product-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4c5872;
  font-weight: 850;
}

.product-tabs button.is-active {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.product-main-card,
.product-metrics-card,
.product-tab-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.product-main-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
}

.large-product-image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1.25;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid #e4e8f1;
  border-radius: 10px;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  color: #9ed0ff;
  font-size: 64px;
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.08);
}

.large-product-image.has-image {
  background: #fff;
  box-shadow: none;
}

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

.fact,
.mini-metric {
  padding: 12px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
}

.fact span,
.mini-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.fact strong,
.mini-metric strong {
  display: block;
  font-size: 17px;
}

.product-metrics-card,
.product-tab-panel {
  padding: 24px;
}

.product-analytics-journal {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e1e7f2;
  border-radius: 10px;
  background: #f8fafd;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

.product-journal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8edf5;
}

.product-journal-head span,
.product-journal-head small,
.product-journal-section-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.product-journal-range,
.product-date-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.product-date-controls {
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.product-date-controls.is-compact {
  margin-bottom: 8px;
  padding: 8px;
}

.product-journal-head .product-date-controls {
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.product-journal-range label,
.product-date-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.product-date-controls small {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.product-journal-range input,
.product-date-controls input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fff;
  color: #1d2738;
  font-weight: 500;
}

.product-date-controls .action-button {
  min-height: 38px;
  padding: 0 12px;
}

.product-analytics-journal h2 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 600;
}

.product-journal-block {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e6ebf3;
  border-radius: 8px;
  background: #fff;
}

.product-note-composer {
  margin-top: 0;
}

.product-journal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f7;
}

.product-journal-section-head h3 {
  margin: 0;
  color: #17233b;
  font-size: 14px;
  font-weight: 600;
}

.product-note-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(260px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 0;
}

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

.product-note-form input,
.product-note-form select {
  min-height: 36px;
  width: 100%;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  font-weight: 500;
}

.product-note-form input {
  padding: 0 10px;
}

.product-note-form select {
  padding: 0 8px;
}

.product-note-form .action-button {
  min-height: 36px;
  width: min(100%, 180px);
  justify-self: start;
  padding: 0 16px;
  font-weight: 600;
}

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

.product-overview-changes .product-section-head .action-button {
  min-height: 32px;
  padding: 0 12px;
}

.product-overview-change-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-overview-change-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fff;
}

.product-overview-change-card time,
.product-overview-change-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.product-overview-change-card strong,
.product-overview-change-card p {
  margin: 3px 0 0;
}

.product-overview-change-card strong {
  font-weight: 600;
}

.product-overview-change-card p {
  color: #17233b;
  font-weight: 500;
  line-height: 1.25;
}

.product-overview-change-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.product-overview-change-metrics span {
  padding: 6px 7px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.product-overview-change-metrics b,
.product-overview-change-metrics strong,
.product-overview-change-metrics em {
  display: block;
}

.product-overview-change-metrics b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.product-overview-change-metrics strong {
  margin: 2px 0;
  font-size: 10px;
  font-weight: 500;
}

.product-overview-change-metrics em {
  color: #647089;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.product-overview-change-metrics em.is-up {
  color: var(--green);
}

.product-overview-change-metrics em.is-down {
  color: var(--red);
}

.product-overview-change-metrics em.is-flat {
  color: #647089;
}

.product-analytics-empty,
.product-experiment-card {
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.product-analytics-empty {
  grid-column: 1 / -1;
  padding: 12px;
  color: var(--muted);
  font-weight: 500;
}

.product-experiment-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  min-height: 0;
  padding: 10px 40px 10px 12px;
  background: #fcfdff;
}

.product-experiment-card.is-hidden {
  display: none;
}

.product-experiment-card .unit-icon-button {
  position: absolute;
  top: 8px;
  right: 10px;
}

.product-experiment-card time,
.product-experiment-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.product-experiment-card strong,
.product-experiment-card p {
  margin: 3px 0 0;
}

.product-experiment-card strong {
  font-weight: 600;
}

.product-experiment-card p {
  color: #17233b;
  font-weight: 500;
  line-height: 1.2;
  min-height: 16px;
}

.product-experiment-card-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 5px;
  margin: 0;
}

.product-experiment-card-metrics span {
  padding: 6px 7px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.product-experiment-card-metrics b,
.product-experiment-card-metrics strong,
.product-experiment-card-metrics em {
  display: block;
}

.product-experiment-card-metrics b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.product-experiment-card-metrics strong {
  margin: 2px 0;
  font-size: 10px;
  font-weight: 500;
}

.product-experiment-card-metrics em {
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
}

.product-notes-toggle {
  min-height: 32px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #43506a;
  font-size: 12px;
  font-weight: 500;
}

.product-notes-toggle:hover {
  border-color: #b9c6dd;
  background: #f8fafd;
}

.product-experiment-card-metrics em.is-up {
  color: var(--green);
}

.product-experiment-card-metrics em.is-down {
  color: var(--red);
}

.product-experiment-card-metrics em.is-flat {
  color: #647089;
}

.product-daily-table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fff;
}

.product-daily-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.product-daily-table th,
.product-daily-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  vertical-align: top;
}

.product-daily-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.product-daily-table td {
  color: #17233b;
  font-weight: 500;
}

.product-daily-table tr.has-note .product-day-note {
  background: #ecfdf3;
  color: #067647;
}

.product-day-note {
  min-width: 260px;
}

.product-day-note time,
.product-day-note small,
.product-day-note span,
.product-day-note strong {
  display: block;
}

.product-day-note time {
  color: inherit;
  font-weight: 600;
}

.product-day-note small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
}

.product-day-note div {
  margin-top: 6px;
}

.product-panel-section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(20, 30, 55, 0.035);
}

.product-panel-section.is-compact-metrics {
  margin-top: 0;
  padding: 14px;
}

.product-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7edf6;
}

.product-panel-section.is-compact-metrics .product-section-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.product-section-head span,
.product-section-head small,
.product-insight-card span,
.product-insight-card small,
.product-unit-list span,
.product-unit-list small,
.product-compare-grid span,
.product-compare-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.product-section-head h3 {
  margin: 3px 0 0;
  color: #17233b;
  font-size: 16px;
  font-weight: 650;
}

.product-overview-stack {
  display: grid;
  gap: 14px;
}

.product-overview-stack .product-panel-section {
  margin-top: 0;
}

.product-overview-summary,
.product-overview-diagnostics,
.product-overview-changes,
.product-overview-chart-section {
  position: relative;
}

.product-overview-summary::before,
.product-overview-diagnostics::before,
.product-overview-changes::before,
.product-overview-chart-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: #dbe7ff;
}

.product-overview-diagnostics::before {
  background: #e5efe9;
}

.product-overview-changes::before {
  background: #ffe3bd;
}

.product-overview-chart-section::before {
  background: #d6e4ff;
}

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

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

.product-insight-card,
.product-unit-list article,
.product-compare-grid article {
  padding: 11px 12px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.product-insight-card strong,
.product-unit-list strong,
.product-compare-grid strong {
  display: block;
  margin: 3px 0;
  color: #17233b;
  font-size: 16px;
  font-weight: 650;
}

.product-insight-card small.is-up {
  color: var(--green);
}

.product-insight-card small.is-down {
  color: var(--red);
}

.product-content-quality-section .tab-summary {
  margin-bottom: 10px;
}

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

.content-quality-details article {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.content-quality-details span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.content-quality-details strong {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #17233b;
  font-size: 14px;
  font-weight: 650;
}

.content-quality-details strong b {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f8;
  color: #3b475d;
  font-size: 12px;
}

.product-chart-mini {
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fff;
}

.product-panel-section.is-compact-metrics .product-chart-mini {
  margin-top: 0;
}

.product-chart-mini svg {
  display: block;
  width: 100%;
  height: auto;
}

.product-empty-state {
  padding: 18px;
  color: var(--muted);
  font-weight: 600;
}

.product-table-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fff;
}

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

.product-detail-table th,
.product-detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  vertical-align: top;
}

.product-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.product-detail-table td {
  color: #17233b;
  font-weight: 500;
}

.product-detail-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

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

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

.product-day-note span {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
}

.product-day-note strong {
  font-weight: 600;
}

.data-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

#card-analytics .card-analytics-top {
  align-items: flex-start;
  margin-bottom: 16px;
}

#card-analytics .card-analytics-top .title-row {
  align-items: flex-start;
}

#card-analytics .card-analytics-top h1 {
  font-size: 38px;
  line-height: 1.05;
}

#card-analytics .card-analytics-top p {
  margin: 8px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

#card-analytics .card-analytics-top .actions {
  gap: 10px;
}

#card-analytics .card-analytics-top .action-button,
#card-analytics .card-analytics-top .snapshot-picker input {
  min-height: 42px;
}

#card-analytics .card-analytics-top .data-source-pill {
  min-height: 42px;
}

.card-analytics-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(4, minmax(136px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.card-analytics-grid article {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-analytics-grid article.is-primary {
  grid-row: span 2;
  min-height: 218px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #101a30;
  color: #fff;
}

.summary-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-analytics-grid span,
.card-analytics-grid small,
.summary-delta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.card-analytics-grid article.is-primary span,
.card-analytics-grid article.is-primary small {
  color: rgba(255, 255, 255, 0.72);
}

.card-analytics-grid strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 28px;
  line-height: 1.15;
}

.card-analytics-grid article.is-primary strong {
  margin: 0;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
}

.summary-delta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f8;
  white-space: nowrap;
}

.summary-delta.is-up {
  background: #e8f8ef;
  color: var(--green);
}

.summary-delta.is-down {
  background: #fff0f0;
  color: var(--red);
}

.summary-delta.is-flat {
  color: #647089;
}

.metric-cell-button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 64px;
  line-height: 1.1;
}

.metric-cell-value {
  display: block;
}

.metric-cell-delta {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f8;
  color: #647089;
  font-size: 10.5px;
  font-weight: 850;
  white-space: nowrap;
}

.metric-cell-delta.is-up {
  background: #e8f8ef;
  color: var(--green);
}

.metric-cell-delta.is-down {
  background: #fff0f0;
  color: var(--red);
}

.metric-cell-delta.is-flat {
  color: #647089;
}

.content-quality-cell {
  display: grid;
  gap: 2px;
  min-width: 92px;
}

.content-quality-cell b {
  color: #17233b;
  font-weight: 650;
}

.content-quality-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.content-quality-cell small.is-good {
  color: var(--green);
}

.content-quality-cell small.is-warn {
  color: #b45309;
}

.content-quality-cell small.is-bad {
  color: var(--red);
}

.content-quality-cell.is-empty {
  color: var(--muted);
  font-size: 12px;
}

.card-analytics-table .select-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.card-analytics-table .select-cell input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #1557ff;
}

.card-note-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cbdcff;
  border-radius: 8px;
  background: #f5f8ff;
  color: #1557ff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.card-note-button span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #1557ff;
  color: #fff;
  font-size: 10px;
}

.card-analytics-grid article.is-primary .summary-delta {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.card-filter-builder {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-groups-panel {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-filter-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.card-filter-caption span {
  color: #17233b;
}

.card-filter-caption small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.card-filter-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(470px, 1.25fr) auto;
  align-items: start;
  gap: 10px;
}

.card-groups-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(280px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

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

.card-groups-layout select,
.card-groups-layout input {
  min-height: 38px;
  width: 100%;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  padding: 0 10px;
  font-weight: 650;
}

.card-groups-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.card-groups-actions .action-button {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

#cardGroupStatus[data-tone="green"] {
  color: var(--green);
}

#cardGroupStatus[data-tone="red"] {
  color: var(--red);
}

.card-product-search {
  display: grid;
  gap: 6px;
}

.card-product-search span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.card-product-search input {
  min-height: 40px;
  width: 100%;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  padding: 0 10px;
  font-weight: 750;
}

.card-filter-row label,
.card-custom-filters small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.card-filter-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: end;
  gap: 8px;
  padding-top: 18px;
  white-space: nowrap;
}

.card-filter-actions .action-button {
  min-height: 40px;
  padding: 0 12px;
}

.card-filter-rows {
  display: grid;
  gap: 8px;
}

.card-filter-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(110px, 0.55fr) minmax(110px, 0.55fr) 34px;
  align-items: end;
  gap: 8px;
}

.card-filter-row label {
  display: grid;
  gap: 5px;
}

.card-filter-row select,
.card-filter-row input {
  min-height: 38px;
  width: 100%;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  font-weight: 850;
}

.card-filter-row select {
  padding: 0 10px;
}

.card-filter-row input {
  padding: 0 9px;
}

.card-custom-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.card-custom-filters button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 8px 0 11px;
  border: 1px solid #d7deeb;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  font-weight: 850;
  cursor: pointer;
}

.card-custom-filters button.is-active {
  border-color: rgba(21, 87, 255, 0.55);
  background: #edf3ff;
  color: var(--blue);
}

.card-custom-filters span {
  color: var(--muted);
  font-size: 11px;
}

.card-custom-filters b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef2f8;
  color: #647089;
  line-height: 1;
}

.card-chart-panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-chart-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.card-chart-panel.is-collapsed header {
  margin-bottom: 0;
}

.card-chart-panel h2 {
  margin: 4px 0 0;
  max-width: 760px;
  font-size: 18px;
  line-height: 1.25;
}

.card-chart-panel header span,
.card-chart-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.card-chart-panel label {
  display: grid;
  gap: 5px;
}

.card-chart-panel select {
  min-width: 150px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  font-weight: 850;
}

.card-chart-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.card-chart-toggle {
  white-space: nowrap;
}

.card-chart-body {
  display: block;
}

.card-chart-panel.is-collapsed .card-chart-body {
  display: none;
}

.card-chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.card-chart-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f4f7fc;
  color: #17233b;
  font-size: 12px;
  font-weight: 850;
}

.card-chart-meta b {
  color: var(--muted);
}

.card-chart-canvas {
  min-height: 320px;
  overflow: hidden;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.card-chart-canvas svg {
  display: block;
  width: 100%;
  height: 320px;
}

.card-chart-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.chart-grid {
  stroke: #dfe5f0;
  stroke-width: 1;
}

.chart-day-tick {
  stroke: #c8d3e4;
  stroke-width: 1;
}

.chart-event-marker line {
  stroke: #f59e0b;
  stroke-dasharray: 4 4;
  stroke-width: 2;
}

.chart-event-marker text {
  fill: #92400e;
  font-size: 11px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fbfcff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart-axis,
.chart-date,
.chart-value-label {
  fill: #647089;
  font-size: 12px;
  font-weight: 800;
}

.chart-value-label {
  fill: #17233b;
  font-size: 11px;
  paint-order: stroke;
  stroke: #fbfcff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart-area {
  fill: url("#cardChartFill");
}

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

.chart-dot {
  fill: #fff;
  stroke: #7fa8ff;
  stroke-width: 2;
}

.chart-point:hover .chart-dot {
  fill: var(--blue);
  stroke: #fff;
}

.chart-last-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 3;
}

.card-experiment-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #edf0f6;
}

.card-experiment-panel header {
  margin-bottom: 10px;
}

.card-experiment-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.card-experiment-tools input {
  display: none;
}

.card-experiment-panel h3 {
  margin: 3px 0 0;
  font-size: 16px;
  line-height: 1.2;
}

.card-experiment-panel.is-disabled .card-experiment-form {
  opacity: 0.55;
  pointer-events: none;
}

.card-experiment-form {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(260px, 1.4fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

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

.card-experiment-form input,
.card-experiment-form select {
  min-height: 38px;
  width: 100%;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  font-weight: 850;
}

.card-experiment-form input {
  padding: 0 10px;
}

.card-experiment-form select {
  padding: 0 8px;
}

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

.card-experiment-empty,
.card-experiment-item {
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.card-experiment-empty {
  padding: 14px;
  color: var(--muted);
  font-weight: 850;
}

.card-experiment-item {
  padding: 12px;
}

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

.card-experiment-item time,
.card-experiment-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.card-experiment-item strong,
.card-experiment-item p {
  margin: 3px 0 0;
}

.card-experiment-item p {
  color: #17233b;
  font-weight: 800;
}

.card-experiment-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.card-experiment-result span {
  min-height: 72px;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf0f6;
}

.card-experiment-result b,
.card-experiment-result strong,
.card-experiment-result em {
  display: block;
}

.card-experiment-result b {
  color: var(--muted);
  font-size: 11px;
}

.card-experiment-result strong {
  margin: 5px 0;
  color: #101827;
  font-size: 13px;
}

.card-experiment-result em {
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.card-experiment-result em.is-up {
  color: var(--green);
}

.card-experiment-result em.is-down {
  color: var(--red);
}

.card-experiment-result em.is-flat {
  color: #647089;
}

.metric-cell-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-weight: 900;
}

.metric-cell-button:hover,
.metric-cell-button.is-selected {
  border-color: #b9cdfd;
  background: #edf4ff;
  color: var(--blue-2);
}

.card-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.card-quick-filters button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #26324b;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 5px 14px rgba(30, 43, 70, 0.04);
}

.card-quick-filters button.is-active {
  border-color: var(--blue);
  background: #edf4ff;
  color: var(--blue-2);
}

.card-columns-dialog {
  width: min(860px, calc(100vw - 32px));
}

.card-columns-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.card-columns-tools .action-button {
  min-height: 38px;
  padding: 0 12px;
}

.card-columns-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: min(62vh, 560px);
  overflow: auto;
}

.card-column-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  align-items: start;
  padding: 12px;
  border: 1px solid #e4e8f1;
  border-radius: 8px;
  background: #fbfcff;
  cursor: pointer;
}

.card-column-option input {
  margin-top: 3px;
}

.card-column-option span,
.card-column-option small {
  min-width: 0;
}

.card-column-option span {
  color: #101a30;
  font-weight: 850;
}

.card-column-option small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.tab-summary article {
  padding: 10px 12px;
  border: 1px solid #edf0f6;
  border-radius: 8px;
  background: #fbfcff;
}

.tab-summary strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.tab-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pages,
.table-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #56627a;
}

.pages button {
  min-width: 40px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #44516c;
  font-weight: 750;
}

.pages button.is-active {
  border: 1px solid #dce7ff;
  background: #f4f8ff;
  color: var(--blue);
}

.placeholder-grid,
.calculator-layout,
.promo-grid {
  display: grid;
  gap: 18px;
}

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

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

.placeholder-grid article,
.calc-panel,
.calc-result,
.promo-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.placeholder-grid article strong {
  margin-bottom: 8px;
  font-size: 18px;
}

.placeholder-grid article span,
.placeholder-grid article p {
  color: var(--muted);
}

.calculator-layout {
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 420px);
  align-items: start;
}

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

.calc-panel label {
  display: grid;
  gap: 7px;
  color: #47536c;
  font-size: 12px;
  font-weight: 850;
}

.calc-result span,
.promo-card span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.calc-result strong,
.promo-card strong {
  display: block;
  margin: 10px 0 16px;
  font-size: 34px;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.result-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.result-line dt {
  color: var(--muted);
}

.result-line dd {
  margin: 0;
  font-weight: 850;
}

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

.ads-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.promo-summary-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.promo-controls {
  margin-bottom: 18px;
}

.promo-summary-grid article {
  min-height: 118px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.promo-summary-grid span,
.promo-summary-grid small {
  display: block;
  color: var(--muted);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.promo-summary-grid strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
  line-height: 1.1;
}

.promo-summary-grid.compact {
  gap: 12px;
  margin-bottom: 14px;
}

.promo-summary-grid.compact article {
  min-height: 88px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: none;
}

.promo-summary-grid.compact strong {
  font-size: 22px;
}

.promo-table small {
  color: var(--muted);
  font-weight: 850;
}

.promo-percent-stack,
.promo-boost-stack {
  display: grid;
  gap: 3px;
  min-width: 132px;
}

.promo-percent-stack b,
.promo-boost-stack b {
  color: #22304a;
  font-size: 15px;
}

.promo-boost-stack b {
  color: var(--green);
}

.ads-campaign-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.ads-campaign-panel {
  min-width: 0;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.table-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.table-toolbar select {
  max-width: 360px;
}

.ads-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: min(100%, 980px);
}

.ads-controls input,
.ads-controls select {
  min-height: 38px;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-weight: 800;
}

.ads-controls input {
  padding: 0 12px;
}

.ads-campaign-table td:first-child {
  min-width: 220px;
}

.ads-campaign-table tr.selected-row {
  background: #edf4ff;
}

.link-button {
  display: block;
  max-width: 320px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.ads-campaign-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.ads-campaign-fields.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ads-campaign-fields div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.ads-campaign-fields dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ads-campaign-fields dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.ads-campaign-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ads-campaign-insights article {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #edf4ff;
}

.ads-campaign-insights span,
.ads-campaign-insights small {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.ads-campaign-insights strong {
  display: block;
  margin: 5px 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.ads-api-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ads-products-panel {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ads-products-panel h3 {
  margin: 0;
  font-size: 15px;
}

.ads-products-panel .table-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ads-product-search {
  display: block;
  margin: 8px 0 10px;
}

.ads-product-search input {
  min-height: 36px;
  width: 100%;
  border: 1px solid #d8dfed;
  border-radius: 8px;
  background: #fff;
  color: #17233b;
  padding: 0 10px;
  font-weight: 750;
}

.ads-products-table td {
  vertical-align: top;
}

.ads-note-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 150px minmax(260px, 1fr) auto;
  gap: 10px;
}

.ads-note-form input,
.ads-note-form select {
  min-height: 38px;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font-weight: 800;
}

.ads-note-form input {
  padding: 0 12px;
}

.ads-raw-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ads-raw-details summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.ads-campaign-json {
  max-height: 420px;
  margin: 12px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  background: #0f172a;
  color: #e5edf8;
  font-size: 12px;
  line-height: 1.45;
}

.data-card > h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.promo-card p {
  margin: 0;
  color: var(--green);
  font-weight: 850;
}

.promo-card.is-risk p {
  color: var(--orange);
}

.promo-card.is-bad p {
  color: var(--red);
}

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

.tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #244579;
  font-weight: 800;
}

#competitors .page-top {
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

#competitors .page-top h1 {
  margin: 0;
}

#competitors .page-top select {
  width: 100%;
  min-height: 44px;
}

.competitors-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 380px) minmax(420px, 1fr) minmax(300px, 360px);
}

.competitor-panel {
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(20, 30, 55, 0.04);
}

.competitor-panel h2 {
  margin: 0 0 12px;
  color: #121a2b;
  font-size: 18px;
}

.competitor-panel-own {
  min-height: 0;
}

.competitor-own-card {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 88px 1fr;
}

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

.competitor-own-main {
  min-width: 0;
}

.competitor-own-main strong {
  color: #121a2b;
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.competitor-own-main span,
.competitor-own-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.competitor-product-image {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  overflow: hidden;
  height: 72px;
  width: 88px;
}

.competitor-product-image img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.competitor-own-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.competitor-metric-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.competitor-own-stats article,
.competitor-metric-grid article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.competitor-own-stats span,
.competitor-own-stats small,
.competitor-metric-grid span,
.competitor-metric-grid small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 750;
}

.competitor-own-stats strong,
.competitor-metric-grid strong {
  display: block;
  color: #121a2b;
  font-size: 15px;
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.competitor-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.competitor-empty-state {
  display: grid;
  gap: 6px;
  max-width: 520px;
  padding: 14px;
  border: 1px dashed #dbe4f2;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
}

.competitor-empty-state strong {
  color: #121a2b;
  font-size: 15px;
}

.competitor-empty-state span {
  line-height: 1.35;
}

.competitor-query-list {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Light UI pass: keep the operational layout, reduce visual weight. */
.sidebar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 1px 10px rgba(20, 30, 55, 0.05);
  backdrop-filter: blur(10px);
}

.logo-mark {
  border-radius: 7px;
  background: #1557ff;
  font-weight: 750;
}

.logo strong {
  color: #1c2638;
  font-weight: 650;
}

.side-nav {
  gap: 3px;
}

.side-nav a {
  min-height: 32px;
  border-radius: 7px;
  color: #526078;
  font-weight: 600;
}

.side-nav a svg {
  color: #7a869d;
  stroke-width: 1.8;
}

.side-nav a.is-active {
  background: #edf4ff;
  color: var(--blue);
  box-shadow: none;
}

.side-nav a.is-active svg {
  color: var(--blue);
}

.app-main {
  padding-top: 16px;
}

.page-top {
  margin-bottom: 16px;
}

#unit .page-top {
  margin-bottom: 10px;
}

h1,
#unit h1 {
  color: #121a2b;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.12;
}

h2,
.table-toolbar h2,
.data-card > h2,
.unit-history-dialog h2 {
  color: #182033;
  font-weight: 650;
}

.hint {
  border-color: #c6cedc;
  color: #8a96aa;
  font-weight: 650;
}

.snapshot-picker,
.stat-card span,
.filters-bar label,
.search-summary span,
.search-summary small,
.search-toolbar span,
.unit-summary-grid span,
.unit-controls label,
.unit-bulk-panel label,
.unit-bulk-group > span,
.unit-filter-group > span,
.promo-summary-grid span,
.promo-summary-grid small,
.calc-panel label,
.fact span,
.mini-metric span,
.card-analytics-grid span,
.card-analytics-grid small,
.summary-delta,
.card-filter-row label,
.card-groups-layout label,
.card-chart-panel header span,
.card-chart-panel label,
.ads-campaign-fields dt,
.ads-campaign-insights span,
.ads-campaign-insights small,
.ads-raw-details summary,
th {
  color: #68758c;
  font-weight: 600;
}

.action-button,
.back-button,
.data-source-pill,
.card-quick-filters button,
.card-custom-filters button,
.unit-quick-filters button,
.pages button,
.tag {
  font-weight: 600;
}

.action-button {
  min-height: 38px;
  padding: 0 14px;
  border-color: #dfe6f1;
  background: #fff;
  box-shadow: none;
}

#unit .action-button,
.unit-bulk-panel .action-button,
#card-analytics .card-analytics-top .action-button,
#card-analytics .card-analytics-top .snapshot-picker input,
#card-analytics .card-analytics-top .data-source-pill {
  min-height: 38px;
}

.action-button.primary {
  border-color: #1d5cff;
  background: #1557ff;
  box-shadow: 0 7px 16px rgba(21, 87, 255, 0.14);
}

.action-button.soft-blue,
.unit-bulk-panel .report-button {
  border-color: #cbdcff;
  background: #f5f8ff;
  color: #1557ff;
  box-shadow: none;
}

.snapshot-picker input,
.filters-bar input,
.filters-bar select,
.calc-panel input,
.calc-panel select,
.page-top select,
.table-meta select,
.promo-card input,
.unit-controls input,
.unit-controls select,
.unit-bulk-panel input,
.unit-bulk-panel select,
.ads-controls input,
.ads-controls select,
.card-filter-row select,
.card-filter-row input,
.card-chart-panel select {
  min-height: 38px;
  height: 38px;
  border-color: #dfe6f1;
  color: #1d2738;
  font-weight: 500;
  box-shadow: none;
}

.stats-grid,
.search-summary,
.promo-summary-grid {
  gap: 10px;
}

.stat-card,
.search-summary article,
.search-toolbar,
.filters-bar,
.data-card,
.unit-summary-grid article,
.unit-controls,
.unit-bulk-panel,
.product-main-card,
.product-metrics-card,
.product-tab-panel,
.card-analytics-grid article,
.card-filter-builder,
.card-groups-panel,
.card-chart-panel,
.placeholder-grid article,
.calc-panel,
.calc-result,
.promo-card,
.promo-summary-grid article {
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 108px;
  padding: 16px;
}

.stat-card:hover,
.stat-card.is-active {
  transform: none;
  box-shadow: 0 8px 22px rgba(21, 87, 255, 0.08);
}

.stat-card strong {
  margin: 8px 0 5px;
  font-size: 24px;
  font-weight: 650;
}

.stat-card em,
.unit-summary-note,
.unit-line-chip,
.unit-threshold,
.unit-bulk-status,
.promo-table small,
.muted-small,
.unit-co-invest-label,
.unit-percent-stack span,
.unit-drr-label,
.card-column-option small {
  font-weight: 600;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 650;
}

.filters-bar {
  gap: 10px;
  padding: 12px 14px;
}

.data-card {
  box-shadow: 0 4px 14px rgba(29, 42, 68, 0.045);
}

th,
td {
  padding: 10px 10px;
}

th {
  background: #fbfcff;
  font-size: 11.5px;
}

td {
  color: #182033;
  font-size: 12.5px;
  font-weight: 500;
}

.products-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.name-cell strong,
.product-open,
.link-button,
.metric-cell-button,
.unit-percent-stack b,
.unit-row-input,
.unit-row-input.target-price-input,
.target-price-badge,
.unit-margin-check,
.unit-history-item strong,
.unit-history-item p,
.card-column-option span,
.result-line dd,
.promo-card p {
  font-weight: 650;
}

.badge {
  min-height: 24px;
  padding: 4px 7px;
  font-weight: 600;
}

.table-footer {
  min-height: 56px;
  padding: 0 18px;
}

.unit-summary-grid {
  gap: 8px;
}

.unit-summary-grid article {
  min-height: 66px;
  padding: 9px 12px;
}

.unit-summary-grid strong {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 650;
}

.unit-controls,
.unit-bulk-panel {
  gap: 8px;
  padding: 10px 12px;
}

.unit-quick-filters button {
  min-height: 30px;
  padding: 0 10px;
  background: #f8fafd;
}

.unit-quick-filters button.is-active {
  border-color: #9db7ff;
  background: #f0f5ff;
}

.unit-table-tools {
  margin-top: 0;
}

.unit-table-tools .search-field input {
  min-height: 38px;
}

.unit-table th,
.unit-table td {
  padding: 8px 7px;
}

.unit-table .product-open {
  color: #202a3b;
  font-size: 10.8px;
}

.unit-table .name-cell strong {
  font-size: 11.2px;
}

.unit-row-input {
  min-height: 32px;
  padding: 0 8px;
}

.unit-row-input.target-price-input {
  min-height: 32px;
  background: #fff;
}

.target-price-head,
.target-price-cell {
  background: #f3f7ff;
  box-shadow: inset 2px 0 0 #2f66ff;
}

.unit-icon-button,
.unit-th button {
  font-weight: 650;
}

.unit-icon-button {
  border-color: #dfe6f1;
  background: #fff;
  box-shadow: none;
}

.unit-margin-check {
  background: #f1f6ff;
}

#card-analytics .card-analytics-top h1 {
  font-size: 30px;
  font-weight: 650;
}

#card-analytics .card-analytics-top p,
.product-heading p {
  font-weight: 500;
}

.card-analytics-grid article.is-primary {
  background: #f8fbff;
  color: #182033;
}

.card-analytics-grid article.is-primary span,
.card-analytics-grid article.is-primary small {
  color: #68758c;
}

.card-analytics-grid article.is-primary strong {
  font-size: 36px;
  font-weight: 650;
}

.card-analytics-grid strong,
.promo-summary-grid strong,
.calc-result strong,
.promo-card strong,
.search-summary strong,
.tab-summary strong,
.fact strong,
.mini-metric strong {
  font-weight: 650;
}

.large-product-image,
.product-image {
  background: #eef4ff;
  color: #426bd6;
  box-shadow: none;
}

.ads-campaign-json {
  font-weight: 400;
}

@media (max-width: 1450px) {
  #unit .unit-range-filter {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  #unit .unit-range-filter label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .card-analytics-grid article.is-primary {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 132px;
  }

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

  .product-overview-summary .tab-summary,
  .product-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .card-filter-row {
    grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(90px, 0.4fr)) 34px;
  }

  .card-filter-layout {
    grid-template-columns: 1fr;
  }

  .card-groups-layout {
    grid-template-columns: 1fr;
  }

  .competitors-layout {
    grid-template-columns: minmax(300px, 380px) minmax(420px, 1fr);
  }

  .competitor-panel-queries {
    grid-column: 1 / -1;
  }

  .card-filter-actions {
    justify-content: flex-start;
    padding-top: 0;
    flex-wrap: wrap;
  }

  .card-groups-actions {
    flex-wrap: wrap;
  }

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

  .card-chart-panel header,
  .card-chart-controls {
    align-items: stretch;
  }

  .card-experiment-note {
    grid-column: 1 / -1;
  }

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

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

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

  .product-note-input {
    grid-column: 1 / -1;
  }

  .filters-bar,
  .unit-summary-grid,
  .unit-controls,
  .unit-bulk-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #unit .unit-summary-grid {
    grid-template-columns: minmax(170px, 0.65fr) minmax(360px, 1.35fr);
  }

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

  #unit .unit-line-group {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 980px) {
  .sidebar {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
  }

  .app-main {
    margin-left: 0;
    padding: 14px 12px 22px;
  }

  .card-filter-actions {
    justify-content: flex-start;
  }

  .logo {
    min-height: 32px;
  }

  .logo-mark {
    width: 28px;
    height: 28px;
  }

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

  .side-nav {
    width: 100%;
    padding-bottom: 2px;
  }

  .side-nav a {
    min-height: 34px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  .side-nav a svg {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .page-top {
    display: block;
  }

  .actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  .action-button {
    min-height: 42px;
    padding: 0 14px;
  }

  .stats-grid,
  .card-analytics-grid,
  .search-summary,
  .product-overview-summary .tab-summary,
  .product-insight-grid,
  .card-columns-list,
  .filters-bar,
  .placeholder-grid,
  .placeholder-grid.three,
  .product-detail-grid,
  .calculator-layout,
  .unit-summary-grid,
  .unit-controls,
  .unit-bulk-panel,
  .promo-grid,
  .promo-summary-grid,
  .ads-kpi-grid,
  .ads-campaign-layout,
  .ads-campaign-fields,
  .ads-campaign-insights,
  .ads-controls,
  .ads-note-form,
  .competitors-layout,
  #competitors .page-top {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .card-analytics-grid,
  .filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-bar .search-field,
  .unit-bulk-panel label:first-child {
    grid-column: 1 / -1;
  }

  .card-analytics-grid article.is-primary {
    grid-column: 1 / -1;
  }

  .stat-card {
    min-height: 116px;
  }

  .product-main-card {
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    align-items: start;
  }

  .large-product-image {
    min-height: 170px;
    max-height: 260px;
  }

  .tab-summary,
  .mini-metrics {
    grid-template-columns: 1fr;
  }

  #unit .unit-range-filter,
  #unit .unit-filter-actions {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  #unit .unit-line-group {
    grid-column: 1;
    grid-row: auto;
  }

  #unit .unit-line-group .unit-quick-filters {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }

  #unit .unit-bulk-panel {
    display: flex;
  }

  #unit .unit-bulk-inputs,
  #unit .unit-bulk-group,
  #unit .unit-bulk-status {
    flex-basis: 100%;
  }

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

  #unit .unit-bulk-group {
    grid-auto-flow: column;
    grid-auto-columns: minmax(92px, 1fr);
  }

  #unit .unit-bulk-group > span {
    grid-column: 1 / -1;
  }

  #unit .unit-bulk-group .action-button {
    width: 100%;
  }

  #unit .unit-table-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sidebar {
    padding: 7px 10px;
  }

  .logo strong {
    display: none;
  }

  .side-nav a {
    gap: 6px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .side-nav a svg {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .app-main {
    padding: 12px 10px 20px;
  }

  .page-top {
    margin-bottom: 12px;
  }

  .card-filter-row {
    grid-template-columns: 1fr;
  }

  .card-filter-row .unit-icon-button {
    width: 100%;
  }

  .card-chart-panel header,
  .card-chart-controls {
    flex-direction: column;
  }

  .card-chart-panel select,
  .card-chart-toggle {
    width: 100%;
  }

  .card-experiment-form,
  .card-experiment-result,
  .product-main-card,
  .product-facts,
  .product-note-form,
  .product-experiment-strip,
  .product-overview-change-list,
  .product-experiment-card,
  .product-overview-change-metrics,
  .product-experiment-card-metrics {
    grid-template-columns: 1fr;
  }

  .large-product-image {
    aspect-ratio: 4 / 3;
    min-height: 120px;
    max-height: 180px;
  }

  h1,
  #unit h1 {
    font-size: 24px;
  }

  .actions {
    gap: 8px;
  }

  .actions .action-button,
  .actions .file-action,
  .snapshot-picker {
    flex: 1 1 100%;
    justify-content: center;
  }

  .date-range-picker,
  .product-journal-range,
  .product-date-controls {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .snapshot-picker input,
  .date-range-picker .snapshot-picker input,
  .product-journal-range input,
  .product-date-controls input,
  .filters-bar input,
  .filters-bar select,
  .unit-controls input,
  .unit-controls select,
  .unit-bulk-panel input,
  .unit-bulk-panel select {
    min-height: 36px;
    height: 36px;
  }

  .stats-grid,
  .card-analytics-grid,
  .search-summary,
  .filters-bar,
  #unit .unit-summary-grid {
    grid-template-columns: 1fr;
  }

  #unit .unit-controls,
  #unit .unit-bulk-panel {
    padding: 9px;
  }

  #unit .unit-controls {
    gap: 9px;
  }

  #unit .unit-line-group .unit-quick-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #unit .unit-quick-filters {
    gap: 5px;
  }

  #unit .unit-quick-filters button {
    min-height: 28px;
    padding: 0 7px;
    font-size: 11.5px;
  }

  #unit .unit-filter-actions {
    gap: 7px;
  }

  #unit .unit-reset-button {
    min-height: 34px;
  }

  .stat-card,
  .unit-summary-grid article {
    min-height: 92px;
    padding: 12px;
  }

  .products-table {
    font-size: 12px;
  }

  th,
  td {
    padding: 8px 7px;
  }
}

/* Card analytics and product workspace polish */
#card-analytics .card-analytics-top {
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e5ebf4;
}

#card-analytics .card-analytics-top h1 {
  font-size: 26px;
  line-height: 1.08;
}

#card-analytics .card-analytics-top p {
  margin-top: 5px;
  font-size: 12.5px;
}

#card-analytics .card-analytics-top .actions {
  gap: 8px;
}

#card-analytics .card-analytics-top .action-button,
#card-analytics .card-analytics-top .snapshot-picker input,
#card-analytics .card-analytics-top .data-source-pill {
  min-height: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 12px;
}

#card-analytics .card-analytics-top .snapshot-picker {
  gap: 3px;
  font-size: 11px;
}

#card-analytics .date-range-picker {
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
}

#card-analytics .card-analytics-grid {
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

#card-analytics .card-analytics-grid article,
#card-analytics .card-analytics-grid article.is-primary {
  grid-row: auto;
  min-height: 84px;
  padding: 11px 12px;
  border-color: #dfe6f1;
  border-top: 3px solid #d8e4f8;
  background: #fff;
  box-shadow: none;
}

#card-analytics .card-analytics-grid article.is-primary {
  grid-column: span 2;
  color: #182033;
}

#card-analytics .card-analytics-grid article:nth-child(2n) {
  background: #fbfcff;
}

#card-analytics .card-analytics-grid article:nth-child(3n) {
  border-top-color: #dcefe6;
}

#card-analytics .card-analytics-grid article:nth-child(4n) {
  border-top-color: #ffe2bf;
}

#card-analytics .card-analytics-grid strong,
#card-analytics .card-analytics-grid article.is-primary strong {
  margin: 6px 0 4px;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 650;
}

#card-analytics .card-analytics-grid span,
#card-analytics .card-analytics-grid small,
#card-analytics .card-analytics-grid article.is-primary span,
#card-analytics .card-analytics-grid article.is-primary small {
  color: #68758c;
  font-size: 11.5px;
  font-weight: 550;
}

#card-analytics .summary-delta {
  min-height: 20px;
  padding: 0 6px;
  font-size: 11px;
}

#card-analytics .card-chart-panel,
#card-analytics .card-filter-builder,
#card-analytics .card-groups-panel,
#card-analytics .data-card {
  position: relative;
  margin-bottom: 12px;
  border-color: #dfe6f1;
  border-radius: 9px;
  box-shadow: none;
}

#card-analytics .card-chart-panel {
  padding: 12px 14px;
  border-top: 3px solid #b8cdfd;
  background: #fbfdff;
}

#card-analytics .card-filter-builder {
  padding: 12px;
  border-top: 3px solid #c7d7f5;
  background: #ffffff;
}

#card-analytics .card-groups-panel {
  padding: 11px 12px;
  border-top: 3px solid #cce8d8;
  background: #fbfffd;
}

#card-analytics .data-card {
  border-top: 3px solid #e7d2ad;
  background: #fff;
}

#card-analytics .card-filter-caption {
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid #edf1f7;
}

#card-analytics .card-filter-caption span {
  color: #1c2639;
  font-size: 13px;
  font-weight: 650;
}

#card-analytics .card-filter-layout {
  grid-template-columns: minmax(220px, 0.7fr) minmax(440px, 1.35fr) auto;
  gap: 8px;
}

#card-analytics .card-filter-row {
  grid-template-columns: minmax(190px, 1fr) 96px 96px 32px;
  gap: 7px;
}

#card-analytics .card-filter-row select,
#card-analytics .card-filter-row input,
#card-analytics .card-product-search input,
#card-analytics .card-groups-layout select,
#card-analytics .card-groups-layout input {
  min-height: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
}

#card-analytics .card-filter-actions {
  gap: 7px;
  padding-top: 17px;
}

#card-analytics .card-filter-actions .action-button,
#card-analytics .card-groups-actions .action-button {
  min-height: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 12.5px;
}

#card-analytics .card-quick-filters {
  gap: 7px;
  margin-bottom: 10px;
}

#card-analytics .card-quick-filters button,
#card-analytics .card-custom-filters button {
  min-height: 30px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 550;
}

#card-analytics .products-table.compact th,
#card-analytics .products-table.compact td {
  padding: 8px 9px;
}

#card-analytics .products-table.compact th {
  background: #f5f8fc;
  color: #5f6d83;
  font-size: 11.5px;
  font-weight: 650;
}

#product .product-top {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5ebf4;
}

#product .product-heading {
  align-items: flex-start;
  gap: 10px;
}

#product .product-heading h1 {
  max-width: 1280px;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 650;
}

#product .product-heading p {
  margin-top: 4px;
  font-size: 13px;
}

#product .back-button,
#product .product-top .action-button {
  min-height: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 12.5px;
}

#product .product-tabs {
  gap: 8px;
  margin: 0 0 12px;
  padding-bottom: 0;
}

#product .product-tabs button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
}

#product .product-detail-grid {
  grid-template-columns: minmax(520px, 1.2fr) minmax(420px, 0.8fr);
  gap: 12px;
  margin-bottom: 12px;
}

#product .product-main-card,
#product .product-metrics-card,
#product .product-tab-panel {
  border-color: #dfe6f1;
  border-radius: 9px;
  box-shadow: none;
}

#product .product-main-card {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  align-items: stretch;
}

#product .large-product-image {
  min-height: 128px;
  max-height: 190px;
  border-radius: 8px;
  font-size: 42px;
}

#product .product-facts {
  grid-template-columns: repeat(4, minmax(118px, 1fr));
  gap: 7px;
}

#product .product-metrics-card,
#product .product-tab-panel {
  padding: 14px;
}

#product .product-metrics-card h2 {
  margin: 0 0 9px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf1f7;
  color: #1c2639;
  font-size: 15px;
  font-weight: 650;
}

#product .mini-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

#product .fact,
#product .mini-metric {
  min-height: 58px;
  padding: 8px 9px;
  border-color: #e5ebf4;
  border-radius: 7px;
  background: #fbfcff;
}

#product .fact span,
#product .mini-metric span {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 550;
}

#product .fact strong,
#product .mini-metric strong {
  font-size: 14px;
  line-height: 1.18;
  font-weight: 650;
}

#product .product-overview-stack {
  gap: 10px;
}

#product .product-panel-section {
  margin-top: 10px;
  padding: 12px;
  border-color: #dfe6f1;
  border-radius: 9px;
  box-shadow: none;
}

#product .product-section-head {
  margin-bottom: 9px;
  padding-bottom: 8px;
}

#product .product-section-head h3 {
  font-size: 15px;
  font-weight: 650;
}

#product .product-section-head span,
#product .product-section-head small,
#product .product-insight-card span,
#product .product-insight-card small {
  font-size: 11.5px;
  font-weight: 550;
}

#product .product-overview-summary::before,
#product .product-overview-diagnostics::before,
#product .product-overview-changes::before,
#product .product-overview-chart-section::before {
  width: 4px;
}

#product .product-overview-summary {
  background: #fbfdff;
}

#product .product-overview-diagnostics {
  background: #fcfffd;
}

#product .product-overview-changes {
  background: #fffdf9;
}

#product .product-overview-chart-section {
  background: #fbfcff;
}

#product .product-overview-summary .tab-summary {
  gap: 7px;
}

#product .tab-summary article,
#product .product-insight-card,
#product .product-overview-change-card {
  min-height: 0;
  padding: 9px 10px;
  border-color: #e5ebf4;
  border-radius: 7px;
  background: #fff;
}

#product .tab-summary strong,
#product .product-insight-card strong {
  font-size: 15px;
}

#product .product-insight-grid {
  gap: 7px;
}

#product .product-overview-change-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

#product .product-overview-change-card {
  gap: 6px;
}

#product .product-overview-change-card p,
#product .product-overview-change-card strong {
  font-size: 13px;
  font-weight: 550;
}

#product .product-overview-change-metrics {
  gap: 4px;
}

#product .product-overview-change-metrics span {
  padding: 5px 6px;
  border-radius: 7px;
}

#product .product-chart-mini {
  margin-top: 6px;
}

#product .product-chart-mini svg {
  max-height: 180px;
}

#product .product-analytics-journal {
  margin-top: 0;
  padding: 12px;
  border-color: #dfe6f1;
  border-radius: 9px;
  background: #fbfcff;
}

#product .product-journal-block {
  margin-top: 10px;
  padding: 10px;
  border-color: #e5ebf4;
  background: #fff;
}

#product .product-note-form input,
#product .product-note-form select,
#product .product-journal-range input,
#product .product-date-controls input {
  min-height: 34px;
  height: 34px;
  font-size: 12.5px;
}

#product .product-date-controls .action-button {
  min-height: 34px;
  height: 34px;
  font-size: 12px;
}

#product .product-unit-row-wrap {
  max-width: 100%;
  overflow-x: auto;
}

#product .product-unit-edit-table {
  min-width: 1680px;
}

#product .product-unit-edit-table th,
#product .product-unit-edit-table td {
  padding: 7px 8px;
}

#product .product-unit-edit-table .name-cell {
  min-width: 280px;
}

#product .product-unit-edit-table input,
#product .product-unit-edit-table select {
  min-height: 30px;
  height: 30px;
  font-size: 12px;
}

#product .product-unit-edit-table .unit-th {
  gap: 4px;
  font-size: 11px;
}

#product .product-promos-table {
  min-width: 1220px;
}

#product .product-promos-table th,
#product .product-promos-table td {
  padding: 9px 10px;
}

#product .product-promo-boost {
  display: grid;
  gap: 2px;
}

#product .product-promo-boost b {
  color: #17233b;
  font-size: 13px;
  font-weight: 650;
}

#product .product-promo-boost small {
  margin: 0;
  font-size: 11px;
}

@media (max-width: 1500px) {
  #card-analytics .card-analytics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #card-analytics .card-analytics-grid article.is-primary {
    grid-column: span 2;
  }

  #product .product-detail-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1100px) {
  #card-analytics .card-filter-layout,
  #card-analytics .card-groups-layout {
    grid-template-columns: 1fr;
  }

  #card-analytics .card-filter-actions,
  #card-analytics .card-groups-actions {
    justify-content: flex-start;
    padding-top: 0;
  }

  #product .product-main-card {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  #product .product-facts,
  #product .mini-metrics,
  #product .product-overview-change-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #card-analytics .card-analytics-grid,
  #card-analytics .card-analytics-grid article.is-primary,
  #product .product-facts,
  #product .mini-metrics,
  #product .product-overview-change-list {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  #product .product-main-card {
    grid-template-columns: 1fr;
  }

  #product .large-product-image {
    aspect-ratio: 4 / 3;
  }
}
