:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dfe4ea;
  --line-strong: #cbd5e1;
  --text: #252a31;
  --muted: #687282;
  --muted-2: #8b95a3;
  --green: #64c800;
  --green-dark: #4da200;
  --blue: #1f7ae0;
  --blue-soft: #e8f2ff;
  --amber: #f59e0b;
  --amber-soft: #fff7e7;
  --red: #d93025;
  --red-soft: #fff0ef;
  --purple: #7c3aed;
  --shadow: 0 8px 24px rgba(30, 41, 59, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--surface);
  background: var(--text);
  border-radius: 7px;
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 14px;
  color: #3d4653;
  background: transparent;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}

.nav-button.active {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}

.account-menu {
  position: relative;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 220px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-dropdown-head {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.account-dropdown-head small {
  color: var(--muted);
}

.account-dropdown button {
  display: flex;
  justify-content: flex-start;
  padding: 11px 14px;
  background: var(--surface);
  color: var(--text);
}

.account-dropdown button:hover {
  background: var(--surface-soft);
}

.shop-select {
  width: min(260px, 24vw);
  height: 34px;
  padding: 0 32px 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-link {
  height: 34px;
  padding: 0 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-weight: 700;
}

.add-shop-link {
  white-space: nowrap;
}

.notice-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

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

.login-card .api-form {
  margin-top: 16px;
}

.login-card .form-grid.two {
  grid-template-columns: 1fr;
}

.soft-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
  font-size: 12px;
}

.page {
  padding: 18px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  border-radius: var(--radius);
  color: #4c3a16;
}

.notice-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-dot {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid var(--amber);
  border-radius: 50%;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.link-button {
  color: var(--blue);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

.title-block h1,
.title-block h2,
.title-block p {
  margin: 0;
}

.title-block h1 {
  font-size: 24px;
  line-height: 1.2;
}

.title-block h2 {
  font-size: 20px;
  line-height: 1.25;
}

.title-block p {
  margin-top: 5px;
  color: var(--muted);
}

.title-block .error-text {
  color: #c2410c;
  font-weight: 650;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  background: #edf2f7;
  color: var(--text);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn.primary {
  background: var(--green);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--green-dark);
}

.btn.tiny {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.btn.danger-lite {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
}

.btn.blue {
  background: var(--blue);
  color: #ffffff;
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
}

.btn.warning {
  background: var(--amber);
  color: #ffffff;
}

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

.btn.full-width {
  width: 100%;
  margin-top: 12px;
}

.compact-btn {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 16px;
}

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

.metric {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
}

.metric-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
}

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

.impact-card > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

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

.impact-card strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.impact-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow-x: auto;
}

.tab {
  position: relative;
  min-height: 48px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  background: var(--blue);
  content: "";
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.input,
.select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.input:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.12);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table th {
  height: 42px;
  color: var(--muted);
  background: #fbfcfe;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.table td,
.table th {
  padding: 9px 8px;
  border-right: 1px solid #eef1f5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table td {
  border-bottom: 1px solid #eef1f5;
  vertical-align: middle;
}

.table tr:hover td {
  background: #fafcff;
}

.clickable-row {
  cursor: pointer;
}

.test-link {
  max-width: 100%;
  overflow: hidden;
  color: #1f579d;
  font-weight: 700;
  background: transparent;
  padding: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.product-cell > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repricer-product-link {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repricer-product-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.dashboard-table th:nth-child(1),
.dashboard-table td:nth-child(1) {
  width: 10%;
}

.dashboard-table th:nth-child(2),
.dashboard-table td:nth-child(2) {
  width: 18%;
}

.dashboard-table th:nth-child(3),
.dashboard-table td:nth-child(3),
.dashboard-table th:nth-child(8),
.dashboard-table td:nth-child(8) {
  width: 7%;
}

.dashboard-table th:nth-child(4),
.dashboard-table td:nth-child(4),
.dashboard-table th:nth-child(9),
.dashboard-table td:nth-child(9),
.dashboard-table th:nth-child(10),
.dashboard-table td:nth-child(10),
.dashboard-table th:nth-child(11),
.dashboard-table td:nth-child(11) {
  width: 9%;
}

.dashboard-table th:nth-child(5),
.dashboard-table td:nth-child(5) {
  width: 14%;
}

.dashboard-table th:nth-child(6),
.dashboard-table td:nth-child(6) {
  width: 10%;
}

.dashboard-table th:nth-child(7),
.dashboard-table td:nth-child(7) {
  width: 9%;
}

.dashboard-table th:nth-child(12),
.dashboard-table td:nth-child(12) {
  width: 10%;
}

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

.module-grid > .surface {
  min-width: 0;
}

.module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.module-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.module-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.ads-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ads-layout {
  display: grid;
  grid-template-columns: minmax(520px, 0.95fr) minmax(560px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.ads-list-page,
.ads-detail-page {
  display: grid;
  gap: 16px;
}

.ads-list-full,
.ads-detail-full {
  width: 100%;
  min-width: 0;
}

.ads-detail-full {
  min-height: calc(100vh - 180px);
  overflow: visible;
}

.ads-list,
.ads-detail {
  min-width: 0;
}

.ads-controls {
  display: grid;
  grid-template-columns: 135px 135px 230px 170px 150px minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.ads-search-field {
  min-width: 0;
}

.ads-table-wrap,
.ads-keyword-wrap {
  max-height: calc(100vh - 320px);
  overflow: auto;
}

.ads-list-page .ads-table-wrap {
  max-height: calc(100vh - 395px);
}

.ads-campaign-table th,
.ads-campaign-table td,
.ads-keyword-table th,
.ads-keyword-table td {
  padding: 8px 9px;
  vertical-align: middle;
  white-space: nowrap;
}

.ads-campaign-table {
  min-width: 1380px;
}

.ads-campaign-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfe;
}

.ads-campaign-table .table-refreshing {
  opacity: 0.72;
}

.ads-campaign-table td:first-child {
  white-space: normal;
}

.ads-campaign-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.ads-campaign-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ads-campaign-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ads-campaign-meta .table-link {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ads-campaign-meta small {
  margin-top: 0;
}

.ads-campaign-metric {
  font-weight: 700;
  text-align: right;
}

.ads-stock-cell {
  display: inline-grid;
  gap: 2px;
  min-width: 112px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.ads-stock-cell strong {
  font-size: 15px;
  line-height: 1;
}

.ads-stock-cell small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.ads-stock-cell.stock-ok {
  border-color: #b7dfc4;
  background: #f0faf3;
  color: #176339;
}

.ads-stock-cell.stock-empty {
  border-color: #f0c2bd;
  background: #fff4f2;
  color: #a2392f;
}

.ads-period-field {
  min-width: 0;
}

.ads-campaign-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.ads-campaign-thumb.large {
  width: 72px;
  height: 72px;
  flex-basis: 72px;
  border-radius: 8px;
}

.ads-campaign-thumb > img,
.ads-campaign-thumb > .pack-visual {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.ads-campaign-thumb > img {
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.ads-campaign-extra {
  position: absolute;
  top: -8px;
  right: -10px;
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #3d4052;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.ads-detail-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ads-detail-title > div:last-child {
  min-width: 0;
}

.table-link {
  padding: 0;
  color: #255aa5;
  background: transparent;
  font-weight: 750;
  text-align: left;
}

.selected-row {
  background: #f1f7ff;
}

.muted-row {
  background: #fafafa;
  color: var(--muted);
}

.inline-field {
  min-width: 170px;
  margin: 0;
}

.ads-detail-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.ads-detail-stats > div,
.state-grid > div {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ads-detail-stats span,
.state-grid > div span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ads-detail-stats strong,
.state-grid > div strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.ads-product-stock-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.ads-product-stock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.ads-product-stock-card.stock-ok {
  border-color: #c9e8d2;
}

.ads-product-stock-card.stock-empty {
  border-color: #f1c4bf;
  background: #fff8f7;
}

.ads-product-stock-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ads-product-stock-main > img,
.ads-product-stock-main > .pack-visual {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.ads-product-stock-main > img {
  object-fit: contain;
  object-position: center;
}

.ads-product-stock-main > div {
  min-width: 0;
}

.ads-product-stock-main strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-product-stock-main small,
.ads-product-stock-value small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ads-product-stock-value {
  flex: 0 0 auto;
  min-width: 86px;
  text-align: right;
}

.ads-product-stock-value strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.ads-keyword-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #f4f6fa;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ads-key-tabs,
.ads-keyword-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-key-tab {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 5px;
  color: #667085;
  background: #eef2f7;
  font-weight: 700;
}

.ads-key-tab.active {
  color: #252a31;
  background: #f8b53d;
}

.ads-key-tab strong {
  font-size: 14px;
}

.ads-keyword-actions .input {
  height: 36px;
}

.ads-mode-pill,
.ads-campaign-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: #475467;
  font-weight: 700;
}

.ads-period-presets {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
}

.ads-period-chip {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 4px;
  color: #667085;
  background: transparent;
  font-weight: 750;
}

.ads-period-chip.active {
  color: #20252c;
  background: #f8b53d;
}

.switch-dot {
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #46b172;
  position: relative;
}

.switch-dot::after {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  content: "";
}

.ads-keyword-subbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 0.35fr) auto minmax(220px, 1fr) minmax(200px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px 10px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.ads-keyword-subbar span {
  color: var(--muted);
  font-size: 13px;
}

.ads-keyword-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.ads-keyword-bulkbar.active {
  background: #f0f7ff;
}

.ads-keyword-bulkbar strong {
  display: block;
  font-size: 14px;
}

.ads-keyword-bulkbar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ads-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ads-key-search {
  height: 36px;
}

.ads-keyword-wrap {
  max-height: calc(100vh - 420px);
  overflow: auto;
}

.ads-strategy-page {
  display: grid;
  gap: 16px;
}

.ads-strategy-section {
  min-width: 0;
  overflow: visible;
}

.ads-strategy-detail-head {
  min-width: 0;
}

.ads-strategy-pools-section {
  min-width: 0;
}

.ads-strategy-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.ads-strategy-pool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.ads-strategy-pool-card.active {
  border-color: #94b9ff;
  background: #f6f9ff;
}

.ads-strategy-pool-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.ads-strategy-pool-main span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ads-strategy-pool-name {
  height: 34px;
  font-weight: 700;
}

.ads-strategy-pool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ads-strategy-empty-pools {
  margin: 14px;
}

.ads-strategy-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ads-strategy-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.1fr) 130px 95px 130px 130px minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ads-strategy-control-actions {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 230px;
}

.compact-number {
  max-width: 130px;
}

.ads-strategy-hint {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.ads-strategy-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #c9ddff;
  border-radius: 8px;
  background: #f3f8ff;
}

.ads-strategy-next.ready {
  border-color: #cdeabf;
  background: #f4fbef;
}

.ads-strategy-next strong {
  flex: 0 0 auto;
  font-size: 14px;
}

.ads-strategy-next span {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 13px;
}

.ads-strategy-table-wrap,
.ads-strategy-key-wrap {
  max-height: max(420px, calc(100vh - 380px));
  overflow: auto;
}

.ads-strategy-table {
  min-width: 1320px;
}

.ads-strategy-key-table {
  min-width: 980px;
}

.ads-strategy-table th,
.ads-strategy-table td,
.ads-strategy-key-table th,
.ads-strategy-key-table td {
  padding: 8px 9px;
  vertical-align: middle;
  white-space: nowrap;
}

.ads-strategy-table th,
.ads-strategy-key-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfe;
}

.ads-strategy-table td:nth-child(2),
.ads-strategy-table td:nth-child(3),
.ads-strategy-key-table td:nth-child(2) {
  white-space: normal;
}

.ads-strategy-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.ads-strategy-key-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.ads-strategy-key-head span {
  color: var(--muted);
  font-size: 13px;
}

.ads-strategy-plan {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.ads-strategy-plan-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.ads-strategy-plan-summary > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.ads-strategy-plan-summary.over-budget > div:last-child,
.ads-strategy-plan-summary.over-budget > div:nth-child(4) {
  border-color: #f1b84b;
  background: #fff8e8;
}

.ads-strategy-plan-summary span,
.ads-strategy-role-item span:last-child {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ads-strategy-plan-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.ads-strategy-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.ads-strategy-launch.running {
  border-color: #cdeabf;
  background: #f4fbef;
}

.ads-strategy-launch strong {
  display: block;
  font-size: 14px;
}

.ads-strategy-launch span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ads-strategy-run-journal {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.ads-strategy-run-journal span {
  margin-top: 0;
  color: #475569;
}

.ads-strategy-position-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.ads-strategy-position-head strong {
  display: block;
  font-size: 14px;
}

.ads-strategy-position-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ads-strategy-position-wrap {
  max-height: max(360px, calc(100vh - 430px));
  overflow: auto;
}

.ads-strategy-position-table {
  min-width: 1080px;
  table-layout: fixed;
}

.ads-strategy-position-table th,
.ads-strategy-position-table td {
  width: 128px;
  padding: 8px 9px;
  vertical-align: middle;
}

.ads-strategy-position-table th:first-child,
.ads-strategy-position-table td:first-child {
  width: 260px;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #ffffff;
}

.ads-strategy-position-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fbfcfe;
}

.ads-strategy-position-table th:first-child {
  z-index: 5;
  background: #fbfcfe;
}

.ads-strategy-position-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: normal;
}

.ads-position-cell {
  display: grid;
  gap: 2px;
  min-height: 54px;
  align-content: center;
}

.ads-position-cell strong {
  font-size: 13px;
}

.ads-position-cell small,
.ads-position-empty,
.ads-position-loading {
  color: var(--muted);
  font-size: 11px;
}

.ads-position-loading {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.ads-strategy-pool-products-wrap,
.ads-strategy-history-wrap {
  max-height: 360px;
  overflow: auto;
}

.ads-strategy-pool-products-table {
  min-width: 920px;
}

.ads-strategy-pool-products-table small,
.ads-strategy-history-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ads-strategy-history {
  border-top: 1px solid var(--line);
}

.ads-strategy-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
}

.ads-strategy-history-head strong {
  font-size: 14px;
}

.ads-strategy-history-head span {
  color: var(--muted);
  font-size: 12px;
}

.ads-strategy-history-table {
  min-width: 980px;
}

.ads-strategy-role-list {
  display: grid;
  gap: 8px;
}

.ads-strategy-role-item {
  display: grid;
  grid-template-columns: 130px 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.ads-detail-page .ads-keyword-wrap {
  max-height: max(520px, calc(100vh - 300px));
}

.ads-keyword-table {
  table-layout: fixed;
  min-width: 2430px;
  border-collapse: separate;
  border-spacing: 0;
}

.ads-keyword-table col.check-col-width {
  width: 38px;
}

.ads-keyword-table col.keyword-col-width {
  width: 430px;
}

.ads-keyword-table col.bid-col-width {
  width: 92px;
}

.ads-keyword-table col.position-col-width {
  width: 104px;
}

.ads-keyword-table col.metric-col-width {
  width: 90px;
}

.ads-keyword-table col.action-col-width {
  width: 104px;
}

.ads-keyword-table thead th {
  position: sticky;
  z-index: 2;
  background: #f8fafc;
  color: #687282;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.ads-keyword-table thead tr:first-child th {
  top: 0;
  height: 58px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.ads-keyword-table thead tr.filter-row th {
  top: 58px;
  background: #ffffff;
}

.ads-keyword-table .check-col,
.ads-keyword-table td:first-child {
  text-align: center;
}

.ads-keyword-table .wide-col,
.ads-keyword-table td.keyword-name-cell {
  width: 430px;
}

.ad-column-head {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.ads-keyword-table th[draggable="true"] {
  cursor: grab;
}

.ads-keyword-table th[draggable="true"]:active {
  cursor: grabbing;
}

.ads-keyword-table th.ad-column-drop-over {
  box-shadow: inset 3px 0 0 var(--blue);
}

.sort-head {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 13px;
  align-items: center;
  justify-items: start;
  gap: 1px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  color: inherit;
  background: transparent;
  font-weight: 750;
  line-height: 1.08;
  text-align: left;
  white-space: normal;
}

.sort-head .sort-label {
  display: block;
  min-width: 0;
  width: 100%;
  overflow: visible;
  color: inherit;
  font-size: 13px;
  line-height: 1.08;
  text-align: left;
  white-space: normal;
}

.sort-head .sort-arrow {
  display: block;
  width: 100%;
  color: #7a8595;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.sort-head.active .sort-arrow {
  color: var(--blue);
}

.filter-row th {
  padding-top: 6px;
  padding-bottom: 6px;
}

.column-filter {
  display: block;
  width: 100%;
  height: 30px;
  margin: 3px 0;
  padding: 0 7px;
  border: 1px solid #d6dbe3;
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

.column-filter:focus {
  border-color: var(--blue);
}

.fake-checkbox,
.keyword-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #b8c0cc;
  border-radius: 4px;
  background: #ffffff;
}

.keyword-checkbox {
  cursor: pointer;
}

.keyword-checkbox.checked {
  border-color: var(--blue);
  background: var(--blue);
}

.keyword-checkbox.checked::after {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  content: "✓";
}

.keyword-checkbox.partial {
  border-color: var(--blue);
  background: #dbeafe;
}

.keyword-checkbox.partial::after {
  width: 9px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
}

.keyword-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.keyword-name-cell {
  white-space: normal;
}

.keyword-name-cell > div,
.keyword-search-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.keyword-search-link {
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

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

.keyword-name-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keyword-name-cell .chevron {
  flex: 0 0 auto;
  color: #3d4653;
  font-size: 28px;
  line-height: 0.8;
}

.bid-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 78px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: #20252c;
}

.bid-input {
  width: 82px;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: #20252c;
  font: inherit;
  font-weight: 650;
  text-align: right;
}

.bid-input:focus {
  outline: 2px solid rgba(47, 109, 246, 0.24);
  border-color: #2f6df6;
}

.bid-input.default-bid {
  border-style: dashed;
  background: #f8fafc;
  color: var(--muted);
}

.bid-input.default-bid:focus {
  border-style: solid;
  background: #ffffff;
  color: #20252c;
}

.bid-input:disabled {
  background: #f5f7fa;
  color: var(--muted);
  cursor: not-allowed;
}

.bid-input::-webkit-outer-spin-button,
.bid-input::-webkit-inner-spin-button {
  margin: 0;
}

.position-cell strong,
.position-cell small {
  display: block;
}

.position-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.live-position-cell strong {
  color: #255aa5;
}

.frequency-cell strong,
.frequency-cell small {
  display: block;
}

.frequency-cell strong {
  color: #255aa5;
}

.frequency-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.position-loading {
  color: var(--muted);
  font-weight: 800;
}

.active-key-row {
  background: #ffffff;
}

.excluded-key-row,
.disabled-key-row {
  background: #fde2df;
}

.keyword-selected-row {
  background: #eaf4ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.excluded-key-row.keyword-selected-row {
  background: #f8d8d5;
}

.ads-total-row {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #ffffff;
  font-weight: 800;
  box-shadow: 0 -1px 0 var(--line);
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.source-pill {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.source-pill.ready {
  border-color: #b7e892;
  background: #f1fbe9;
  color: #336b14;
}

.source-pill.failed {
  border-color: #ffd0cc;
  background: var(--red-soft);
  color: var(--red);
}

.warning-message {
  margin: 12px 16px 0;
  color: #8a5a00;
  background: var(--amber-soft);
}

.economics-stats .metric-value {
  font-size: 24px;
}

.economics-controls {
  display: grid;
  grid-template-columns: 130px 120px 120px auto 1.1fr 1fr 1fr 1fr auto;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.compact-select,
.compact-date {
  height: 34px;
  padding: 0 9px;
  font-size: 13px;
}

.period-btn {
  align-self: end;
  min-height: 34px;
  padding: 0 12px;
}

.filtered-count {
  display: grid;
  align-content: end;
  gap: 3px;
  min-width: 82px;
}

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

.filtered-count strong {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.economics-table th,
.economics-table td {
  height: 46px;
  padding: 5px 7px;
  font-size: 13px;
}

.economics-table th:nth-child(1),
.economics-table td:nth-child(1) {
  width: 22%;
}

.economics-table th:nth-child(2),
.economics-table td:nth-child(2),
.economics-table th:nth-child(3),
.economics-table td:nth-child(3),
.economics-table th:nth-child(12),
.economics-table td:nth-child(12),
.economics-table th:nth-child(13),
.economics-table td:nth-child(13) {
  width: 7%;
}

.economics-table th:nth-child(4),
.economics-table td:nth-child(4),
.economics-table th:nth-child(5),
.economics-table td:nth-child(5),
.economics-table th:nth-child(6),
.economics-table td:nth-child(6),
.economics-table th:nth-child(7),
.economics-table td:nth-child(7),
.economics-table th:nth-child(8),
.economics-table td:nth-child(8),
.economics-table th:nth-child(9),
.economics-table td:nth-child(9),
.economics-table th:nth-child(10),
.economics-table td:nth-child(10),
.economics-table th:nth-child(11),
.economics-table td:nth-child(11) {
  width: 5.5%;
}

.economics-table th:nth-child(14),
.economics-table td:nth-child(14) {
  width: 10%;
}

.elasticity-table {
  min-width: 1420px;
}

.elasticity-table th:nth-child(1),
.elasticity-table td:nth-child(1) {
  width: 300px;
}

.elasticity-table th:nth-child(8),
.elasticity-table td:nth-child(8) {
  width: 140px;
}

.elasticity-table th:nth-child(9),
.elasticity-table td:nth-child(9),
.elasticity-table th:nth-child(10),
.elasticity-table td:nth-child(10) {
  width: 155px;
}

.elasticity-table th:nth-child(11),
.elasticity-table td:nth-child(11) {
  width: 220px;
}

.elasticity-table-wrap {
  max-height: calc(100vh - 385px);
}

.readiness-meter {
  position: relative;
  display: grid;
  align-items: center;
  width: 100%;
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.readiness-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  background: #b7ddff;
}

.readiness-meter strong {
  position: relative;
  padding: 0 8px;
  text-align: right;
  font-size: 13px;
}

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

.repricer-grid {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.repricer-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.repricer-form {
  display: grid;
  gap: 12px;
}

.repricer-settings {
  display: grid;
  gap: 10px;
}

.repricer-import {
  display: grid;
  gap: 8px;
}

.repricer-import input {
  display: none;
}

.repricer-import small {
  color: var(--muted);
  line-height: 1.35;
}

.repricer-form .form-grid {
  margin-bottom: 0;
}

.form-grid.three {
  display: grid;
  grid-template-columns: 1fr 90px 92px;
  gap: 12px;
}

.check-field {
  justify-content: end;
}

.check-field input {
  width: 22px;
  height: 22px;
}

.repricer-selected-product {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.repricer-selected-product div {
  min-width: 0;
}

.repricer-selected-product strong,
.repricer-selected-product span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repricer-selected-product span {
  color: var(--muted);
  font-size: 12px;
}

.repricer-table-wrap {
  max-height: calc(100vh - 360px);
}

.repricer-table {
  min-width: 1260px;
}

.repricer-table th,
.repricer-table td {
  height: 44px;
  padding: 6px 7px;
  font-size: 12px;
}

.repricer-table th:nth-child(1),
.repricer-table td:nth-child(1) {
  width: 230px;
}

.repricer-table th:nth-child(9),
.repricer-table td:nth-child(9) {
  width: 210px;
}

.repricer-table th:nth-child(10),
.repricer-table td:nth-child(10) {
  width: 240px;
}

.repricer-price-cell {
  display: grid;
  gap: 2px;
}

.repricer-price-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repricer-journal {
  display: grid;
  gap: 8px;
}

.journal-item {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.journal-item strong {
  font-size: 13px;
}

.journal-item span,
.journal-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profitability-table {
  width: max-content;
  min-width: 2520px;
  table-layout: auto;
}

.profitability-table-wrap {
  max-width: 100%;
  max-height: calc(100vh - 430px);
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profitability-table th,
.profitability-table td {
  white-space: nowrap;
  min-width: 112px;
  max-width: none;
}

.profitability-table td {
  vertical-align: middle;
}

.cell-source {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.profitability-table th:nth-child(1),
.profitability-table td:nth-child(1) {
  min-width: 340px;
  width: 340px;
  white-space: normal;
}

.profitability-table th:nth-child(2),
.profitability-table td:nth-child(2) {
  min-width: 130px;
  width: 130px;
}

.profitability-table th:nth-child(3),
.profitability-table td:nth-child(3),
.profitability-table th:nth-child(5),
.profitability-table td:nth-child(5),
.profitability-table th:nth-child(10),
.profitability-table td:nth-child(10),
.profitability-table th:nth-child(11),
.profitability-table td:nth-child(11),
.profitability-table th:nth-child(12),
.profitability-table td:nth-child(12),
.profitability-table th:nth-child(13),
.profitability-table td:nth-child(13),
.profitability-table th:nth-child(14),
.profitability-table td:nth-child(14),
.profitability-table th:nth-child(15),
.profitability-table td:nth-child(15),
.profitability-table th:nth-child(16),
.profitability-table td:nth-child(16),
.profitability-table th:nth-child(17),
.profitability-table td:nth-child(17),
.profitability-table th:nth-child(18),
.profitability-table td:nth-child(18),
.profitability-table th:nth-child(19),
.profitability-table td:nth-child(19),
.profitability-table th:nth-child(20),
.profitability-table td:nth-child(20) {
  min-width: 124px;
  width: 124px;
}

.profitability-table th:nth-child(4),
.profitability-table td:nth-child(4),
.profitability-table th:nth-child(6),
.profitability-table td:nth-child(6),
.profitability-table th:nth-child(7),
.profitability-table td:nth-child(7),
.profitability-table th:nth-child(8),
.profitability-table td:nth-child(8) {
  min-width: 96px;
  width: 96px;
}

.profitability-table th:nth-child(9),
.profitability-table td:nth-child(9) {
  min-width: 168px;
  width: 168px;
}

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

.row-select-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.row-select-btn:hover span {
  color: var(--blue);
}

.selected-profit-row {
  background: #eef6ff;
}

.profit-calculator {
  align-self: start;
}

.cost-upload-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.cost-upload-panel input {
  display: none;
}

.cost-upload-panel span {
  color: var(--muted);
  font-size: 13px;
}

.profit-settings-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.profit-settings-panel .field {
  width: 230px;
}

.profit-mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profit-settings-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.selected-profit-product {
  display: grid;
  gap: 4px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
}

.selected-profit-product span,
.selected-profit-product small,
.profit-note {
  color: var(--muted);
}

.selected-profit-product strong {
  line-height: 1.25;
}

.profit-source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

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

.profit-field {
  min-width: 0;
}

.input-suffix {
  position: relative;
}

.input-suffix .input {
  width: 100%;
  height: 34px;
  padding-right: 34px;
}

.input-suffix em {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  pointer-events: none;
}

.profit-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.profit-result-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.profit-result-grid span {
  color: var(--muted);
  font-size: 12px;
}

.profit-result-grid strong {
  font-size: 16px;
}

.price-test-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

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

.price-test-head h3 {
  margin: 0 0 4px;
}

.price-test-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.price-test-head .field {
  min-width: 0;
}

.price-scenario-table-wrap {
  overflow-x: auto;
}

.price-scenario-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 12px;
}

.price-scenario-table th,
.price-scenario-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.price-scenario-table th {
  color: var(--muted);
  font-weight: 700;
}

.price-scenario-table tr.current {
  background: #eef6ff;
}

.profit-positive {
  color: #34720f;
}

.profit-negative {
  color: var(--red);
}

.formula-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.formula-box span {
  color: var(--muted);
  line-height: 1.4;
}

.roadmap-panel {
  padding: 18px;
}

.roadmap-panel h2 {
  margin: 0 0 14px;
}

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

.roadmap-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.roadmap-item span {
  color: var(--muted);
  line-height: 1.4;
}

.redistribution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  margin-bottom: 16px;
}

.redistribution-main,
.redistribution-side,
.redistribution-section {
  padding: 16px;
}

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

.redistribution-search {
  grid-column: span 2;
}

.redistribution-span {
  grid-column: span 2;
}

.redistribution-form .field small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.redistribution-login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ffb52e;
  border-radius: 8px;
  background: #fff8e8;
}

.redistribution-login-card strong,
.redistribution-login-card span {
  display: block;
}

.redistribution-login-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.redistribution-login-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.redistribution-picker-placeholder {
  display: block;
  min-width: 0;
  min-height: 72px;
  padding: 10px 38px 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  position: relative;
}

.redistribution-picker-placeholder::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-55%);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.redistribution-picker-placeholder:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.redistribution-picker-placeholder span,
.redistribution-picker-placeholder strong {
  display: block;
}

.redistribution-picker-placeholder span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.redistribution-picker-placeholder strong {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.redistribution-selected {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.redistribution-selected strong,
.redistribution-selected span {
  display: block;
}

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

.redistribution-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  margin-top: 10px;
  padding-right: 4px;
}

.redistribution-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.redistribution-result.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.redistribution-result strong,
.redistribution-result small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.redistribution-result small {
  color: var(--muted);
  font-size: 12px;
}

.redistribution-result em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.redistribution-priority {
  align-self: end;
  min-height: 42px;
}

.redistribution-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.redistribution-side h2 {
  margin: 0 0 12px;
}

.redistribution-checklist {
  display: grid;
  gap: 8px;
}

.redistribution-journal-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.redistribution-journal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.redistribution-journal-tab.active {
  background: #ffb52e;
  color: var(--text);
}

.redistribution-journal-tab strong {
  color: inherit;
}

.redistribution-queue {
  display: grid;
  gap: 8px;
}

.redistribution-request {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.redistribution-request strong,
.redistribution-request span,
.redistribution-request small {
  display: block;
}

.redistribution-request span,
.redistribution-request small {
  color: var(--muted);
  font-size: 12px;
}

.redistribution-request-status {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.redistribution-section {
  margin-bottom: 16px;
}

.redistribution-table-wrap {
  max-height: 430px;
}

.redistribution-product {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
}

.small-thumb {
  width: 36px;
  height: 46px;
}

.redistribution-table th,
.redistribution-table td {
  white-space: nowrap;
}

.redistribution-table th:first-child,
.redistribution-table td:first-child {
  min-width: 330px;
  white-space: normal;
}

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

.redistribution-limit-grid > div {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.redistribution-limit-grid span {
  color: var(--muted);
  line-height: 1.35;
}

.products-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.products-grid {
  grid-template-columns: minmax(720px, 1fr) 340px;
}

.products-controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 220px auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.products-import {
  display: flex;
  align-items: center;
  gap: 8px;
}

.products-import input {
  display: none;
}

.products-table-wrap {
  max-height: 590px;
}

.products-table th,
.products-table td {
  white-space: nowrap;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
  width: 280px;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2),
.products-table th:nth-child(6),
.products-table td:nth-child(6),
.products-table th:nth-child(7),
.products-table td:nth-child(7),
.products-table th:nth-child(8),
.products-table td:nth-child(8),
.products-table th:nth-child(10),
.products-table td:nth-child(10) {
  width: 96px;
}

.products-table th:nth-child(5),
.products-table td:nth-child(5) {
  width: 160px;
  max-width: 180px;
}

.products-table th:nth-child(9),
.products-table td:nth-child(9) {
  width: 145px;
}

.products-table th:nth-child(11),
.products-table td:nth-child(11) {
  width: 260px;
}

.products-table tr.selected-row td {
  background: #f1f7ff;
}

.product-catalog-product {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.product-catalog-thumb-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
}

.product-catalog-thumb-button:hover .thumb {
  border-color: var(--accent);
}

.product-catalog-product span {
  min-width: 0;
}

.product-catalog-product strong,
.product-catalog-link,
.product-catalog-product small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-catalog-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.product-catalog-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.product-catalog-product small {
  margin-top: 3px;
  color: var(--muted);
}

.description-preview {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.products-editor {
  align-self: start;
}

.products-editor-head {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.products-editor-head strong,
.products-editor-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-editor-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.large-thumb {
  width: 52px;
  height: 68px;
}

.product-description-textarea {
  min-height: 170px;
  resize: vertical;
}

.products-group-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 10px 0 4px;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1),
.campaign-table th:nth-child(1),
.campaign-table td:nth-child(1) {
  width: 42px;
}

.product-table th:nth-child(2),
.product-table td:nth-child(2) {
  width: 46%;
}

.campaign-table th:nth-child(4),
.campaign-table td:nth-child(4) {
  width: 32%;
}

.live-table th:nth-child(1),
.live-table td:nth-child(1) {
  width: 28%;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 18px;
  text-align: center;
}

.empty-state span {
  color: var(--muted);
}

.action-empty {
  justify-items: center;
  gap: 10px;
}

.api-panel {
  display: grid;
  gap: 18px;
  max-width: 1120px;
  padding: 22px;
}

.compact-summary {
  gap: 0;
}

.api-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  background: var(--amber-soft);
}

.api-status.ready {
  border-color: #b7e892;
  background: #f1fbe9;
}

.api-status.ready .info-dot {
  border-color: var(--green);
  color: var(--green);
}

.api-status p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.api-form {
  display: grid;
  gap: 14px;
}

.token-input.compact {
  min-height: 86px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.security-card {
  margin: 18px 0;
}

.security-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-card {
  width: min(560px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.modal-head h2 {
  margin: 0 0 5px;
  font-size: 22px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.password-modal .api-form {
  margin: 0;
}

.settings-card.highlight {
  border-color: #72c91f;
  background: #f7ffef;
  box-shadow: 0 0 0 4px rgba(114, 201, 31, 0.18);
}

.settings-card h2,
.settings-card h3 {
  margin: 0;
}

.settings-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.process-panel {
  margin: 18px 0;
}

.process-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.process-head p {
  margin-top: 4px;
}

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

.worker-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
}

.worker-pill strong {
  color: #64748b;
  font-size: 12px;
}

.worker-pill.ok {
  border-color: #b6e89a;
  background: #f4fde9;
  color: #2f6d1e;
}

.worker-pill.ok strong {
  color: #3f8f22;
}

.worker-pill.bad {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.process-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.process-summary div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.process-summary span,
.process-job-row span,
.process-job-meta small {
  color: var(--muted);
}

.process-summary strong {
  font-size: 20px;
}

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

.process-run-btn {
  min-height: 36px;
}

.process-jobs {
  display: grid;
  gap: 8px;
}

.process-jobs h3 {
  margin: 0;
  font-size: 16px;
}

.process-job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.process-job-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.process-job-row strong,
.process-job-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-job-row.failed {
  border-color: #fecaca;
  background: #fff7f7;
}

.process-job-row.running,
.process-job-row.pending {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.process-job-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.warning-text {
  color: #b45309;
}

.shop-summary {
  display: grid;
  gap: 4px;
}

.shop-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.shop-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 500;
}

.form-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 650;
}

.check-pill input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

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

.role-preset-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.role-preset-card:has(input:checked) {
  border-color: var(--green);
  background: #f3fce9;
}

.role-preset-card input {
  margin-top: 2px;
  accent-color: var(--green);
}

.role-preset-card strong {
  display: block;
  color: var(--text);
}

.role-preset-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.25;
}

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

.user-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.8fr 1.2fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.user-row strong {
  color: var(--text);
}

.write-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.write-guard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--amber);
  border-radius: var(--radius);
  background: #fffaf0;
}

.write-guard.enabled {
  border-color: #ffb4ad;
  background: var(--red-soft);
}

.write-guard p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.success-text {
  color: #336b14;
}

.token-input {
  width: 100%;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.token-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.12);
}

.form-message {
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 650;
}

.form-message.compact-message {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.form-message.success {
  color: #336b14;
  background: #edfbdc;
}

.form-message.error {
  color: var(--red);
  background: var(--red-soft);
}

.probe-box {
  padding: 14px;
  color: #1f579d;
  background: var(--blue-soft);
  border: 1px solid #bfdcff;
  border-radius: var(--radius);
  font-weight: 650;
}

.wb-stats-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rounds-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.rounds-toggle {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.rounds-toggle span:last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.chevron.open {
  transform: rotate(90deg);
}

.rounds-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.rounds-summary span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.confidence-explain {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cfe0f5;
  border-radius: 6px;
  background: #f7fbff;
}

.confidence-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.confidence-title strong {
  font-size: 14px;
}

.confidence-title span,
.confidence-explain p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.confidence-grid div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

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

.confidence-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-line {
  padding: 8px 10px;
  border-left: 3px solid var(--blue);
  color: #24435f;
  background: var(--surface);
  border-radius: 4px;
  font-size: 13px;
}

.rounds-table-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.rounds-table th,
.rounds-table td {
  font-size: 13px;
}

.compact-empty {
  padding: 10px;
  text-align: left;
}

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

.probe-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.probe-card.ready {
  border-color: #b7e892;
  background: #f7fff2;
}

.probe-card.failed {
  border-color: #ffd0cc;
  background: var(--red-soft);
}

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

.probe-card p {
  margin: 0;
  color: var(--muted);
}

.probe-sample {
  display: grid;
  gap: 8px;
}

.probe-row {
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.probe-row strong,
.probe-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.probe-row span {
  color: var(--muted);
  font-size: 13px;
}

.probe-error {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--red);
  font-size: 12px;
  white-space: pre-wrap;
}

.compact-field {
  min-width: min(460px, 42vw);
}

.report-period-field {
  position: relative;
  z-index: 20;
}

.report-period-select {
  min-width: min(520px, 46vw);
}

.report-period-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  min-width: min(520px, 46vw);
  height: 44px;
  text-align: left;
}

.report-period-trigger strong,
.report-period-trigger em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-period-trigger strong {
  font-size: 14px;
  font-weight: 700;
}

.report-period-trigger em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.report-period-trigger > span {
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  transition: transform 0.16s ease;
}

.report-period-trigger.open {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.12);
}

.report-period-trigger.open > span {
  transform: rotate(180deg);
}

.report-period-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(560px, 58vw);
  max-height: min(420px, 62vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(30, 41, 59, 0.16);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.report-period-menu button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.report-period-menu button:hover,
.report-period-menu button.active {
  background: var(--surface-soft);
}

.report-period-menu button.active {
  box-shadow: inset 3px 0 0 var(--blue);
}

.report-period-menu strong,
.report-period-menu span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-period-menu strong {
  font-size: 14px;
}

.report-period-menu span {
  color: var(--muted);
  font-size: 12px;
}

.report-head-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px;
}

.report-head-panel h2 {
  margin: 0 0 6px;
}

.report-head-panel p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.report-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.report-source-pill.control {
  background: #f1ecff;
  color: var(--purple);
}

.report-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-tabs button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.report-tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.08);
}

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

.report-metric-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 92px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.report-metric-card span,
.report-metric-card small,
.report-metric-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.report-metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  line-height: 1.15;
}

.report-metric-card small {
  display: block;
  margin-top: 4px;
}

.report-focus-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  gap: 14px;
  margin-bottom: 14px;
}

.report-expense-breakdown {
  margin-bottom: 14px;
  padding-bottom: 16px;
}

.report-expense-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
  padding: 0 18px;
}

.report-expense-breakdown-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-expense-breakdown-item div {
  min-width: 0;
}

.report-expense-breakdown-item strong,
.report-expense-breakdown-item small {
  display: block;
}

.report-expense-breakdown-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-expense-breakdown-item small {
  margin-top: 2px;
  color: var(--muted);
}

.report-expense-breakdown-item em {
  color: var(--text);
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.report-expense-breakdown-item.negative em {
  color: #4f7d19;
}

.report-focus-main,
.report-focus-bars {
  min-height: 180px;
  padding: 18px;
}

.report-focus-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.report-focus-main span,
.report-focus-main small {
  color: var(--muted);
}

.report-focus-main strong {
  font-size: 34px;
  line-height: 1.1;
}

.report-focus-bars {
  display: grid;
  gap: 12px;
}

.report-focus-row {
  display: grid;
  grid-template-columns: 150px minmax(120px, 1fr) 110px;
  align-items: center;
  gap: 12px;
}

.report-focus-row span {
  color: var(--muted);
}

.report-focus-row div {
  height: 12px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 999px;
}

.report-focus-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.report-focus-row strong {
  text-align: right;
  white-space: nowrap;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.report-detail-card {
  min-width: 0;
}

.report-detail-card > .report-stack {
  margin: 0 18px 18px;
}

.report-detail-card > .report-legend,
.report-detail-card > .report-donut-row {
  padding: 0 18px 18px;
}

.report-stack {
  height: 28px;
  margin-bottom: 18px;
  background: var(--surface-soft);
  border-radius: 6px;
}

.report-legend {
  display: grid;
  gap: 11px;
}

.report-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(120px, 1fr) auto auto;
  align-items: baseline;
  gap: 9px;
}

.report-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.report-legend-row strong,
.report-legend-row em {
  white-space: nowrap;
}

.report-legend-row em {
  color: var(--muted);
  font-style: normal;
}

.reports-expenses-cell {
  min-width: 210px;
}

.reports-expenses-cell strong,
.reports-expenses-cell span {
  display: block;
}

.reports-expenses-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.report-donut-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.report-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 174px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.report-donut::after {
  position: absolute;
  width: 132px;
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: 50%;
  content: "";
}

.report-donut span {
  position: relative;
  z-index: 1;
  font-weight: 800;
}

.report-compare {
  margin-bottom: 20px;
}

.reports-table th,
.reports-table td {
  white-space: nowrap;
}

.reports-table tr.selected td {
  background: #f4fbef;
}

@media (max-width: 760px) {
  .probe-grid {
    grid-template-columns: 1fr;
  }

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

  .write-guard {
    align-items: stretch;
    flex-direction: column;
  }
}

.thumb {
  width: 32px;
  height: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #ffffff;
  object-fit: contain;
  object-position: center;
}

.thumb img,
.summary-thumb img,
.photo-frame img,
.mini-photo img,
.current-photo img,
.winner-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.pack-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #b7efff 0%, #ffffff 48%, #15a0c7 100%);
}

.pack-visual.alt {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, #fef3c7 0%, #ffffff 50%, #f3b5c9 100%);
}

.pack-visual.third {
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, #d7f5c7 0%, #ffffff 52%, #2aa66a 100%);
}

.pack-visual::before {
  position: absolute;
  left: 21%;
  right: 18%;
  bottom: 13%;
  height: 40%;
  border-radius: 11px 11px 8px 8px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow: 0 4px 8px rgba(15, 23, 42, 0.12);
  content: "";
}

.pack-visual::after {
  position: absolute;
  left: 25%;
  right: 22%;
  bottom: 35%;
  height: 13%;
  border-radius: 4px;
  background: #1288a7;
  content: "";
}

.pack-visual.alt::after {
  background: #f08b9b;
}

.pack-visual.third::after {
  background: #168253;
}

.pack-title {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 7%;
  padding: 3px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.84);
  color: #0f4f68;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.pack-visual.alt .pack-title {
  color: #7f1d1d;
}

.pack-visual.third .pack-title {
  color: #14532d;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.status.done {
  background: #e6f7d7;
  color: #437a1c;
}

.status.running {
  background: var(--blue-soft);
  color: #1f579d;
}

.status.draft {
  background: #f0f2f5;
  color: #596273;
}

.status.archived {
  background: #eef0f3;
  color: #4b5563;
}

.status.paused {
  background: var(--amber-soft);
  color: #8a5a00;
}

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

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

.progress {
  position: relative;
  width: 100%;
  min-width: 92px;
  height: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
}

.progress-fill {
  height: 100%;
  background: #add9fb;
}

.progress span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #4b5563;
}

.side-panel {
  padding: 16px;
}

.side-panel h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.compact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.compact-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.wizard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 92px;
  margin-bottom: 14px;
  padding: 14px 20px;
}

.heading-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ab-icon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 44px;
  height: 58px;
  overflow: hidden;
  border: 3px solid var(--green);
  border-radius: 5px;
  color: var(--green);
  font-weight: 900;
}

.ab-icon span {
  display: grid;
  place-items: center;
  border-right: 1px solid #d9f6c4;
}

.ab-icon span:last-child {
  border-right: 0;
}

.back-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  font-size: 25px;
}

.wizard-body {
  min-height: 650px;
  padding: 22px 24px;
}

.wizard-body h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 0 0;
}

.stepper {
  padding: 22px 22px 18px;
  align-self: start;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
}

.step:not(:last-child)::after {
  position: absolute;
  left: 13px;
  top: 34px;
  bottom: -14px;
  width: 2px;
  background: #d9dee6;
  content: "";
}

.step.done:not(:last-child)::after {
  background: var(--green);
}

.step-num {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #555f6d;
  font-size: 13px;
  font-weight: 800;
}

.step.active .step-num {
  background: #2f343b;
  color: #ffffff;
}

.step.done .step-num {
  background: var(--green);
  color: #ffffff;
}

.step-title {
  font-weight: 650;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.55fr);
  gap: 14px;
  margin-bottom: 16px;
}

.switch-row,
.radio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #3f4753;
}

.switch input {
  display: none;
}

.switch-ui {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #e5e7eb;
}

.switch-ui::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8ba0b8;
  content: "";
}

.switch input:checked + .switch-ui {
  background: #dcecfb;
}

.switch input:checked + .switch-ui::after {
  left: 20px;
  background: #315d9c;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: #3d4653;
}

.radio-chip input {
  accent-color: var(--blue);
}

.warning-box {
  position: relative;
  margin-bottom: 16px;
  padding: 14px 44px 14px 16px;
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  border-radius: var(--radius);
  color: #4c3a16;
}

.warning-box p {
  margin: 0 0 6px;
  font-weight: 700;
}

.warning-box ul {
  margin: 0;
  padding-left: 20px;
}

.campaign-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.product-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.summary-thumb {
  width: 46px;
  height: 60px;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.summary-title {
  min-width: 0;
}

.summary-title h2 {
  margin: 0;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
}

.campaign-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 360px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.play-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 5px;
  background: var(--green);
  color: #ffffff;
  font-size: 19px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.media-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 14px;
}

.ai-content-panel {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.ai-content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ai-content-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.ai-content-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

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

.ai-content-presets > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.ai-content-presets span,
.ai-content-rule-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ai-content-presets strong {
  display: block;
  margin-top: 4px;
  line-height: 1.25;
}

.ai-content-prompt {
  display: grid;
  gap: 6px;
}

.textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
  outline: none;
}

.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.12);
}

.ai-content-rule-list {
  display: grid;
  gap: 4px;
}

.photo-slot {
  position: relative;
  min-height: 0;
}

.photo-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(150px, 14vw, 220px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  color: inherit;
}

.photo-frame.has-image {
  background: #f9fbff;
}

.upload-frame:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 122, 224, 0.1);
}

.photo-frame .pack-visual {
  width: 100%;
  height: 100%;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111827;
}

.video-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #111827, #253246);
  color: #ffffff;
}

.video-preview span {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(17, 24, 39, 0.74);
  font-size: 12px;
  line-height: 1.2;
}

.empty-image {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid #aab2bd;
  border-radius: 5px;
  color: #9aa3ae;
  font-size: 25px;
}

.photo-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 145px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  text-align: center;
}

.upload-zone input {
  display: none;
}

.upload-zone p {
  margin: 8px 0 0;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 14px;
}

.slider-list {
  display: grid;
  gap: 18px;
}

.setting-input {
  display: grid;
  gap: 5px;
}

.setting-input input {
  height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 18px;
}

.setting-input small {
  color: var(--muted-2);
}

.range-block {
  display: grid;
  gap: 8px;
}

.range-head {
  display: flex;
  justify-content: space-between;
  color: #3f4753;
}

.range {
  width: 100%;
  accent-color: var(--green);
}

.range-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 8px;
  overflow: hidden;
  border-radius: 5px;
}

.range-scale span:nth-child(1) {
  background: #f99595;
}

.range-scale span:nth-child(2) {
  background: #ffc350;
}

.range-scale span:nth-child(3) {
  background: #83e17d;
}

.range-scale span:nth-child(4) {
  background: #61cf79;
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

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

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

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

.estimate-item strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.summary-section {
  display: grid;
  gap: 12px;
}

.summary-line {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-line span {
  color: var(--muted);
}

.photos-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-photo {
  width: 64px;
  height: 84px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.mini-photo .pack-visual,
.mini-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.live-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.live-title {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.current-photo {
  width: 92px;
  height: 122px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid var(--green);
  border-radius: 7px;
  background: #ffffff;
}

.current-photo .pack-visual,
.current-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.state-box {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.state-box strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.campaign-control-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.campaign-control-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.campaign-control-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
}

.campaign-control-status small {
  flex-basis: 100%;
  text-align: right;
}

.funds-line {
  padding: 8px 10px;
  color: #1f579d;
  background: var(--blue-soft);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
}

.top-up-box {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(140px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: var(--amber-soft);
  border: 1px solid #ffd28a;
  border-radius: 7px;
}

.top-up-box .button-row {
  align-self: end;
}

.top-up-box p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.winner-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.continue-box {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 14px;
  background: var(--amber-soft);
  border: 1px solid #ffd28a;
  border-radius: var(--radius);
}

.continue-box p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.setting-input.compact input {
  height: 42px;
  font-size: 15px;
}

.winner-photo {
  width: 100%;
  max-width: 170px;
  aspect-ratio: 0.75;
  overflow: hidden;
  border: 2px solid var(--green);
  border-radius: 7px;
  background: #ffffff;
}

.winner-photo .pack-visual,
.winner-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.log {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1160px) {
  .dashboard-grid,
  .module-grid,
  .repricer-grid,
  .ads-layout,
  .wizard-shell,
  .live-layout,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .stepper {
    order: -1;
  }

  .campaign-summary {
    min-width: 0;
  }

  .campaign-control-head,
  .top-up-box {
    grid-template-columns: 1fr;
  }

  .campaign-control-status {
    justify-content: flex-start;
  }

  .campaign-control-status small {
    text-align: left;
  }

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

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

  .products-controls,
  .products-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .ads-strategy-control-actions {
    align-items: start;
  }

  .report-metric-grid,
  .report-focus-grid,
  .report-detail-grid,
  .report-expense-breakdown-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ads-detail-stats,
  .ads-stats,
  .repricer-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .nav-button {
    height: 40px;
  }

  .page {
    padding: 10px;
  }

  .toolbar,
  .report-head-panel,
  .wizard-head,
  .live-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-grid,
  .module-grid,
  .repricer-grid,
  .redistribution-grid,
  .redistribution-form,
  .redistribution-limit-grid,
  .stats-row,
  .repricer-stats,
  .filters,
  .economics-controls,
  .products-controls,
  .ads-controls,
  .form-grid,
  .settings-grid,
  .estimate,
  .state-grid,
  .confidence-grid {
    grid-template-columns: 1fr;
  }

  .compact-field,
  .report-period-select,
  .report-period-trigger {
    min-width: 0;
    width: 100%;
  }

  .report-period-field {
    width: 100%;
  }

  .report-period-menu {
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(360px, 58vh);
  }

  .report-metric-grid,
  .report-focus-grid,
  .report-detail-grid,
  .report-donut-row,
  .report-expense-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .report-focus-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .report-focus-row strong {
    text-align: left;
  }

  .report-legend-row {
    grid-template-columns: 10px minmax(100px, 1fr) auto;
  }

  .report-legend-row em {
    grid-column: 2 / -1;
  }

  .ads-strategy-controls,
  .ads-strategy-pool-grid {
    grid-template-columns: 1fr;
  }

  .ads-strategy-pool-card,
  .ads-strategy-pool-actions,
  .ads-strategy-history-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .ai-content-head,
  .ai-content-presets {
    grid-template-columns: 1fr;
  }

  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .ai-content-head {
    display: grid;
  }

  .campaign-summary {
    justify-content: flex-start;
    padding-left: 0;
    border-left: 0;
  }

  .module-head {
    flex-direction: column;
  }

  .ads-keyword-head,
  .ads-keyword-actions,
  .ads-keyword-subbar {
    min-width: 0;
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

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

  .source-row {
    justify-content: flex-start;
  }

  .redistribution-search {
    grid-column: auto;
  }

  .redistribution-results,
  .redistribution-request {
    grid-template-columns: 1fr;
  }

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

  .summary-title h2 {
    white-space: normal;
  }
}
