:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #7a8699;
  --line: #dfe5ee;
  --line-strong: #c8d1de;
  --blue: #2f80ed;
  --green: #16a163;
  --amber: #c7831c;
  --gray: #aeb7c3;
  --shadow: 0 12px 30px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.shell {
  width: min(1680px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0;
}

.mode-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mode-tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0 16px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.mode-tab.is-active {
  background: var(--blue);
  color: #fff;
}

.mode-view {
  display: none;
}

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

.topbar,
.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar {
  flex-wrap: wrap;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.period,
.account-chip,
.toolbar span {
  color: var(--muted);
  font-size: 14px;
}

.period,
.icon-button,
.secondary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.period {
  padding: 10px 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

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

.metrics article {
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics span {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  font-size: 26px;
}

.file-input-hidden {
  display: none;
}

.manual-metrics {
  margin-top: 0;
}

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

.autocreative-topbar {
  margin-bottom: 14px;
}

.autocreative-workspace {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.autocreative-panel {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.autocreative-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.autocreative-actions .primary,
.autocreative-actions .secondary {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.secondary.danger {
  color: #c2410c;
}

.secondary.danger:not(:disabled):hover {
  border-color: #fed7aa;
  background: #fff7ed;
}

.autocreative-dropzone {
  display: grid;
  width: calc(100% - 32px);
  min-height: 168px;
  margin: 16px;
  border: 1px dashed rgba(226, 232, 240, 0.4);
  border-radius: 8px;
  background: #24262d;
  color: #e5e7eb;
  place-items: center;
  align-content: center;
  gap: 8px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.autocreative-dropzone:hover,
.autocreative-dropzone.is-dragging {
  border-color: rgba(147, 197, 253, 0.95);
  background: #1f2937;
  transform: translateY(-1px);
}

.autocreative-dropzone strong {
  font-size: 18px;
  font-weight: 800;
}

.autocreative-dropzone small {
  color: #aeb7c3;
  font-size: 13px;
  font-weight: 700;
}

.autocreative-upload-icon {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid #c8d1de;
  border-bottom-color: transparent;
  border-radius: 999px;
}

.autocreative-upload-icon::before,
.autocreative-upload-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  background: #c8d1de;
  transform: translateX(-50%);
}

.autocreative-upload-icon::before {
  top: 8px;
  width: 2px;
  height: 14px;
}

.autocreative-upload-icon::after {
  top: 7px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #c8d1de;
  border-left: 2px solid #c8d1de;
  background: transparent;
  transform: translateX(-50%) rotate(45deg);
}

.autocreative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  max-height: min(54vh, 560px);
  overflow: auto;
  padding: 0 16px 16px;
}

.autocreative-grid-ready {
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
}

.autocreative-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.autocreative-card.is-selectable {
  cursor: pointer;
}

.autocreative-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.16);
}

.autocreative-card.is-error {
  border-color: #fed7aa;
  background: #fff7ed;
}

.autocreative-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #eef2f7 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #eef2f7 75%) 9px 9px / 18px 18px,
    linear-gradient(45deg, #eef2f7 25%, #f8fafc 25%) 9px 9px / 18px 18px;
}

.autocreative-thumb img,
.autocreative-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.autocreative-badge,
.autocreative-check {
  position: absolute;
  z-index: 2;
  display: inline-grid;
  min-height: 24px;
  border-radius: 999px;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.autocreative-badge {
  left: 8px;
  top: 8px;
  padding: 0 8px;
  background: rgba(17, 24, 39, 0.76);
  color: #fff;
}

.autocreative-check {
  right: 8px;
  top: 8px;
  width: 24px;
  border: 2px solid #fff;
  background: rgba(47, 128, 237, 0.9);
  color: #fff;
}

.autocreative-card-copy {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.autocreative-card-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocreative-card-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.autocreative-download {
  width: calc(100% - 20px);
  min-height: 34px;
  margin: 0 10px 10px;
  padding: 0 10px;
  font-size: 13px;
}

.autocreative-empty {
  grid-column: 1 / -1;
  min-height: 112px;
  display: grid;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  place-items: center;
  text-align: center;
  font-weight: 700;
}

.autocreative-ready-summary {
  margin: 16px 16px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.autocreative-error-mark {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #c2410c;
  font-size: 34px;
  font-weight: 900;
}

.api-summary-hidden {
  display: none;
}

.creative-panel,
.audience-api-panel {
  margin-top: 14px;
}

.api-block-head,
.creative-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.api-block-head h2,
.creative-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.api-block-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.creative-head #creativeSummary,
.creative-head #audienceSummary {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.api-calendar-slot {
  position: relative;
  width: max-content;
  max-width: 100%;
  flex: 0 0 auto;
}

.api-calendar-shell {
  position: relative;
}

.api-date-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  max-width: 236px;
  padding: 0 12px;
  border: 1px solid #d7dbe1;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.03);
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.api-date-button strong {
  color: #000;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-date-button.is-range strong {
  font-size: 13px;
}

.api-date-icon {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #9aa3af;
  border-radius: 5px;
}

.api-date-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 5px;
  height: 2px;
  border-radius: 99px;
  background: #9aa3af;
}

.api-date-icon::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: -5px;
  height: 7px;
  border-left: 2px solid #9aa3af;
  border-right: 2px solid #9aa3af;
  border-radius: 2px;
}

.api-date-button:hover,
.api-date-button.is-active {
  border-color: #9cc3f7;
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.1), 0 12px 28px rgba(31, 41, 55, 0.08);
  transform: translateY(-1px);
}

.api-calendar-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(344px, calc(100vw - 38px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.18);
}

.api-calendar-controls {
  display: grid;
  grid-template-columns: auto minmax(96px, 1fr) minmax(78px, 0.75fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.api-calendar-apply,
.api-calendar-select {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.api-calendar-apply {
  padding: 0 12px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

.api-calendar-apply:hover {
  background: #1f6fd5;
}

.api-calendar-select {
  padding: 0 10px;
}

.api-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.api-calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.api-calendar-days {
  gap: 4px 0;
}

.api-calendar-days.is-next {
  animation: calendarMonthNext 0.18s ease-out;
}

.api-calendar-days.is-prev {
  animation: calendarMonthPrev 0.18s ease-out;
}

.api-calendar-day {
  position: relative;
  display: grid;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  place-items: center;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.api-calendar-day.is-muted {
  color: #b1bac8;
}

.api-calendar-day.is-in-range,
.api-calendar-day.is-draft {
  background: #eff6ff;
}

.api-calendar-day span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  place-items: center;
}

.api-calendar-day:hover span::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(47, 128, 237, 0.48);
  border-radius: 999px;
  animation: calendarRing 0.22s ease-out;
}

.api-calendar-day.is-start span,
.api-calendar-day.is-end span {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 128, 237, 0.28);
}

.api-calendar-day.is-today:not(.is-start):not(.is-end) span {
  color: var(--blue);
}

.audience-chart-panel {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.chart-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.chart-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

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

.chart-mode-control select {
  min-width: 128px;
}

.audience-chart {
  min-height: 360px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding: 18px;
  transition: min-height 0.18s ease;
}

.audience-plot {
  min-width: 720px;
}

.audience-row,
.audience-axis {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(360px, 1fr);
  gap: 18px;
  align-items: center;
}

.audience-row {
  opacity: 0;
  transform: translateY(6px);
  animation: audienceRowIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--row-index, 0) * 42ms);
}

.audience-row + .audience-row {
  margin-top: 12px;
}

.audience-label {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-bar-track {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 36px;
  border-left: 1px solid var(--line-strong);
  background:
    linear-gradient(to right, rgba(223, 229, 238, 0.85) 1px, transparent 1px) 0 0 / 25% 100%,
    #fbfcfe;
}

.audience-bar {
  flex: 0 0 min(var(--bar-width), calc(100% - 82px));
  width: min(var(--bar-width), calc(100% - 82px));
  height: 16px;
  border-radius: 2px;
  background: var(--bar-color, #16a163);
  transform-origin: left center;
  animation: audienceBarIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--row-index, 0) * 42ms);
}

.audience-value {
  flex: 0 0 72px;
  width: 72px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.audience-axis {
  margin-top: 10px;
}

.audience-axis div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.audience-empty {
  height: 320px;
}

.mismatch-chart {
  max-height: min(54vh, 560px);
  overflow: auto;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.mismatch-plot {
  display: grid;
  gap: 14px;
  min-width: 760px;
}

.mismatch-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(420px, 1fr) minmax(180px, 220px);
  gap: 18px;
  align-items: center;
  opacity: 0;
  transform: translateY(6px);
  animation: audienceRowIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--row-index, 0) * 42ms);
}

.mismatch-label {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mismatch-bars {
  display: grid;
  gap: 8px;
}

.mismatch-bar-track {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(220px, 1fr) 58px;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-left: 1px solid var(--line-strong);
  background:
    linear-gradient(to right, rgba(223, 229, 238, 0.85) 1px, transparent 1px) 0 0 / 25% 100%,
    #fbfcfe;
}

.mismatch-bar-caption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mismatch-bar-fill {
  width: min(var(--bar-width), 100%);
  height: 14px;
  border-radius: 999px;
  transform-origin: left center;
  animation: audienceBarIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--row-index, 0) * 42ms);
}

.mismatch-bar-track.is-result .mismatch-bar-fill {
  background: #2f80ed;
}

.mismatch-bar-track.is-registrations .mismatch-bar-fill {
  background: #16a163;
}

.mismatch-bar-track strong,
.mismatch-delta {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.mismatch-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.mismatch-prices {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.mismatch-prices span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.mismatch-prices strong {
  color: var(--text);
  font-weight: 800;
}

.mismatch-row.is-result-higher .mismatch-delta,
.mismatch-table-row.is-result-higher .mismatch-delta-cell {
  color: #2f80ed;
}

.mismatch-row.is-registrations-higher .mismatch-delta,
.mismatch-table-row.is-registrations-higher .mismatch-delta-cell {
  color: #16a163;
}

.mismatch-price-delta-cell.is-result-higher {
  color: #2f80ed;
}

.mismatch-price-delta-cell.is-registrations-higher {
  color: #16a163;
}

.mismatch-list-wrap {
  --mismatch-visible-rows: 5;
  max-height: min(calc(58px + (68px * var(--mismatch-visible-rows))), 70vh);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #98a3b3 #eef2f7;
}

.mismatch-list-wrap.show-all {
  max-height: none;
}

.mismatch-list-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.mismatch-list-wrap::-webkit-scrollbar-track {
  background: #eef2f7;
  border-left: 1px solid #dde4ee;
}

.mismatch-list-wrap::-webkit-scrollbar-thumb {
  background: #98a3b3;
  border: 2px solid #eef2f7;
  border-radius: 999px;
}

.mismatch-list-wrap::-webkit-scrollbar-thumb:hover {
  background: #7f8b9d;
}

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

.mismatch-table th,
.mismatch-table td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.mismatch-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mismatch-table .numeric {
  text-align: right;
}

.mismatch-table td:first-child {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.age-matrix-chart {
  min-height: 430px;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding: 18px;
}

.age-matrix-plot {
  min-width: var(--plot-min-width, 760px);
}

.age-matrix-grid {
  display: flex;
  align-items: flex-end;
  gap: 26px;
  min-height: 330px;
  padding: 18px 8px 0;
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(to top, rgba(200, 209, 222, 0.7) 1px, transparent 1px) 0 0 / 100% 25%,
    #fbfcfe;
}

.age-matrix-group {
  display: grid;
  grid-template-rows: 62px 260px auto;
  gap: 8px;
  min-width: var(--group-width, 132px);
  opacity: 0;
  transform: translateY(8px);
  animation: audienceRowIn 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--row-index, 0) * 46ms);
}

.age-matrix-age-row {
  display: grid;
  grid-template-columns: repeat(var(--age-count), minmax(24px, 1fr));
  align-items: end;
  gap: 8px;
  height: 62px;
}

.age-matrix-age-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 58px;
  min-width: 0;
  padding-left: 36px;
}

.age-matrix-age-cell span {
  display: block;
  width: max-content;
  max-width: none;
  color: rgba(122, 134, 153, 0.58);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: 50% 100%;
  user-select: none;
}

.age-matrix-bar-slot::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(122, 134, 153, 0.18);
}

.age-matrix-bar-slot.is-after-main-age::before {
  width: 1px;
  background: rgba(122, 134, 153, 0.18);
}

.age-matrix-bars {
  display: grid;
  grid-template-columns: repeat(var(--age-count), minmax(24px, 1fr));
  align-items: end;
  gap: 8px;
  height: 260px;
}

.age-matrix-bar-slot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.age-matrix-bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 34px;
  height: var(--bar-height);
  min-height: 0;
  border: 1px solid rgba(31, 41, 55, 0.18);
  border-radius: 4px 4px 0 0;
  background: var(--age-color);
  transform-origin: bottom center;
  animation: matrixBarIn 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.age-matrix-bar span {
  position: absolute;
  top: -22px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.age-matrix-label {
  overflow: hidden;
  min-height: 42px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
}

.age-matrix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 16px 8px 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.age-matrix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.age-matrix-legend i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(31, 41, 55, 0.2);
  border-radius: 3px;
  background: var(--age-color);
}

.correlation-head {
  align-items: flex-start;
}

.correlation-actions {
  max-width: 860px;
}

.correlation-chart {
  min-height: 460px;
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 18px;
}

.correlation-layout {
  display: block;
  min-width: 1120px;
}

.correlation-bars-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.correlation-bars {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-width: var(--correlation-width, 780px);
  min-height: 330px;
  padding: 24px 16px 12px;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(to top, rgba(200, 209, 222, 0.65) 1px, transparent 1px) 0 0 / 100% 25%,
    #fbfcfe;
}

.correlation-group {
  display: grid;
  grid-template-rows: 250px auto;
  gap: 10px;
  min-width: max(132px, calc(var(--secondary-count) * 34px + 28px));
  opacity: 0;
  transform: translateY(8px);
  animation: audienceRowIn 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--row-index, 0) * 46ms);
}

.correlation-group-bars {
  display: grid;
  grid-template-columns: repeat(var(--secondary-count), minmax(24px, 1fr));
  align-items: end;
  gap: 8px;
  height: 250px;
}

.correlation-bar-slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.correlation-bar {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 34px;
  height: var(--bar-height);
  border-radius: 4px 4px 0 0;
  background: var(--series-color);
  transform-origin: bottom center;
  animation: matrixBarIn 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.correlation-bar.is-stacked {
  overflow: hidden;
  align-items: stretch;
  flex-direction: column-reverse;
  justify-content: flex-start;
  border: 1px solid rgba(31, 41, 55, 0.14);
  background: transparent;
}

.correlation-stack-segment {
  display: block;
  width: 100%;
  flex: 0 0 var(--segment-height);
  min-height: 2px;
  background: var(--series-color);
}

.correlation-bar span {
  position: absolute;
  top: -22px;
  z-index: 2;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.correlation-group-label {
  overflow: hidden;
  min-height: 42px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
}

.correlation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.correlation-legend-section {
  display: contents;
}

.correlation-legend-section strong,
.correlation-legend-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.correlation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.correlation-legend i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--series-color);
}

@keyframes audienceRowIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes audienceBarIn {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes matrixBarIn {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 0;
  background: #e6ebf2;
}

.tab {
  min-width: 126px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 18px 22px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  background: var(--panel);
  color: #111827;
}

.tab span {
  margin-left: 6px;
  color: inherit;
  font-size: 13px;
}

.toolbar {
  min-height: 76px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.rows-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.rows-control select {
  height: 38px;
  min-width: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 10px;
}

#creativeTypeFilter {
  min-width: 112px;
}

.columns-preset select {
  min-width: 132px;
}

.preset-name-input {
  height: 38px;
  width: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.icon-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.primary,
.secondary {
  min-height: 42px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 700;
}

.manual-refresh-button,
.chart-refresh-button,
.api-refresh-button {
  display: inline-grid;
  width: 42px;
  min-width: 42px;
  padding: 0;
  place-items: center;
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.manual-refresh-button.is-refreshing,
.chart-refresh-button.is-refreshing,
.api-refresh-button.is-refreshing {
  border-color: #93c5fd;
  background: #eff6ff;
  animation: refreshSpin 0.5s ease-in-out;
}

.manual-refresh-button.is-done,
.chart-refresh-button.is-done,
.api-refresh-button.is-done {
  border-color: #86efac;
  background: #dcfce7;
  color: var(--green);
  transform: scale(1.04);
}

.manual-refresh-button.is-warning,
.chart-refresh-button.is-warning,
.api-refresh-button.is-warning {
  border-color: #f5c16f;
  background: #fff7e6;
  color: var(--amber);
  animation: refreshNudge 0.32s ease-in-out;
}

.primary {
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
}

.primary:disabled,
.secondary:disabled {
  opacity: 0.55;
}

.account-chip {
  margin-left: auto;
}

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

.api-table-wrap {
  --api-visible-rows: 5;
  max-height: min(calc(116px + (68px * var(--api-visible-rows))), 76vh);
  overflow: auto;
}

.manual-table-wrap {
  --manual-visible-rows: 10;
  max-height: calc(58px + (68px * var(--manual-visible-rows)));
  overflow: auto;
}

.manual-table-wrap.show-all {
  max-height: none;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  font-size: 14px;
}

.manual-analytics-table {
  min-width: 2500px;
}

.creative-table {
  min-width: 1160px;
}

.audience-table {
  min-width: 1280px;
}

.creative-table th:first-child,
.creative-table td:first-child {
  min-width: 210px;
  width: 210px;
}

.audience-table th:first-child,
.audience-table td:first-child {
  width: 220px;
  min-width: 220px;
}

.creative-id-cell {
  width: 160px;
  min-width: 160px;
  overflow: visible;
}

.audience-inside-cell {
  width: 220px;
  min-width: 220px;
  overflow: visible;
}

.creative-table-wrap,
.audience-table-wrap {
  --creative-visible-rows: 5;
  max-height: min(calc(58px + (68px * var(--creative-visible-rows))), 70vh);
  overflow: auto;
}

.audience-table-wrap {
  --audience-visible-rows: 5;
  max-height: min(calc(58px + (68px * var(--audience-visible-rows))), 70vh);
}

.manual-analytics-table th:nth-child(2),
.manual-analytics-table td:nth-child(2) {
  min-width: 280px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 58px;
  color: var(--muted);
  font-weight: 600;
  background: #fbfcfe;
}

.manual-header {
  cursor: grab;
  user-select: none;
}

.manual-header:active {
  cursor: grabbing;
}

.manual-header.is-sorted {
  color: #4f46e5;
}

.column-sort {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-align: inherit;
  cursor: pointer;
}

.numeric .column-sort {
  justify-content: flex-end;
}

.sort-arrow {
  color: #9aa5b5;
  font-size: 16px;
  line-height: 1;
}

.manual-header.is-sorted .sort-arrow {
  color: #4f46e5;
}

td {
  height: 68px;
}

tfoot td {
  height: 58px;
  background: #fbfcfe;
  font-weight: 700;
}

.api-table-wrap tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  box-shadow: 0 -1px 0 var(--line);
}

.select-cell {
  width: 44px;
  text-align: center;
}

.switch-cell {
  width: 74px;
}

.numeric {
  text-align: right;
}

.entity-name {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.ad-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.creative-name-cell {
  min-width: 180px;
}

.audience-name-cell {
  min-width: 180px;
}

.creative-id-dropdown {
  position: relative;
  display: inline-block;
}

.creative-id-dropdown summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.creative-id-dropdown summary::-webkit-details-marker {
  display: none;
}

.creative-id-dropdown summary::after {
  content: "▾";
  margin-left: 8px;
  color: #8a96a8;
  font-size: 12px;
}

.creative-id-dropdown[open] summary {
  border-color: #9eb8de;
  background: #f6f9ff;
}

.creative-id-dropdown[open] summary::after {
  content: "▴";
}

.creative-id-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  left: 0;
  width: max-content;
  min-width: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.16);
}

.audience-inside-dropdown {
  position: relative;
  display: inline-block;
}

.audience-inside-dropdown summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.audience-inside-dropdown summary::-webkit-details-marker {
  display: none;
}

.audience-inside-dropdown summary::after {
  content: "▾";
  margin-left: 8px;
  color: #8a96a8;
  font-size: 12px;
}

.audience-inside-dropdown[open] summary {
  border-color: #9eb8de;
  background: #f6f9ff;
}

.audience-inside-dropdown[open] summary::after {
  content: "▴";
}

.audience-inside-menu {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  width: max-content;
  min-width: 220px;
  max-width: min(520px, calc(100vw - 80px));
  max-height: 280px;
  overflow: auto;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.16);
}

.audience-inside-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #cfe1f8;
  border-radius: 999px;
  background: #f5f9ff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.audience-inside-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.creative-id-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 5px 6px;
  color: var(--text);
}

.creative-id-item + .creative-id-item {
  border-top: 1px solid #edf1f7;
}

.creative-id-item span {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 700;
}

.creative-id-copy {
  --copy-button-bg: #f8fafc;
  display: inline-grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--copy-button-bg);
  color: var(--blue);
  font-size: 0;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.copy-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: var(--copy-button-bg);
}

.copy-icon::before {
  left: 1px;
  top: 5px;
}

.copy-icon::after {
  left: 5px;
  top: 1px;
}

.creative-id-copy:hover {
  --copy-button-bg: #eff6ff;
  border-color: #9eb8de;
  transform: translateY(-1px);
}

.creative-id-copy.is-copied {
  --copy-button-bg: #dcfce7;
  border-color: #86efac;
  color: var(--green);
}

.creative-id-copy.is-copied .copy-icon::before {
  left: 2px;
  top: 2px;
  width: 12px;
  height: 7px;
  border-top: 0;
  border-right: 0;
  border-radius: 0;
  background: transparent;
  transform: rotate(-45deg);
}

.creative-id-copy.is-copied .copy-icon::after {
  content: none;
}

.creative-id-copy.is-copy-error {
  --copy-button-bg: #fff7e6;
  border-color: #f5c16f;
  color: var(--amber);
}

.creative-id-copy.is-copy-error .copy-icon::before {
  left: 7px;
  top: 2px;
  width: 2px;
  height: 9px;
  border: 0;
  border-radius: 2px;
  background: currentColor;
}

.creative-id-copy.is-copy-error .copy-icon::after {
  left: 7px;
  top: 13px;
  width: 2px;
  height: 2px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
}

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

.ad-preview-link {
  position: relative;
  display: inline-grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f5f7fb;
  cursor: pointer;
  text-decoration: none;
}

.ad-preview-link:hover {
  border-color: #9eb8de;
  box-shadow: 0 6px 16px rgba(47, 128, 237, 0.16);
}

.ad-preview-link:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.28);
  outline-offset: 2px;
}

.ad-preview-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-preview-button {
  padding: 0;
  font: inherit;
}

.ad-preview-link.is-video::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ad-preview-link.is-video::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid rgba(255, 255, 255, 0.88);
  transform: translate(-34%, -50%);
  pointer-events: none;
}

.ad-preview-link.is-empty::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid #b6c0ce;
  border-radius: 4px;
  box-shadow: inset 0 -5px 0 rgba(182, 192, 206, 0.28);
}

.ad-preview-link.is-empty.is-video::before {
  position: static;
  inset: auto;
  background: transparent;
  transform: none;
}

.ad-preview-link.is-empty.is-video::after {
  content: none;
}

.ad-name-copy {
  min-width: 0;
}

.ad-name-copy .entity-name,
.ad-name-copy .subline {
  display: block;
  overflow: hidden;
  max-width: 330px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.54);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.ad-preview-overlay.is-open {
  opacity: 1;
}

.ad-preview-overlay.is-closing {
  opacity: 0;
}

.ad-preview-modal {
  position: relative;
  display: grid;
  gap: 10px;
  max-width: min(760px, calc(100vw - 40px));
  padding: 12px;
  border: 1px solid rgba(223, 229, 238, 0.9);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  transform: scale(0.72);
  transition: transform 0.16s cubic-bezier(0.2, 0.85, 0.2, 1);
}

.ad-preview-overlay.is-open .ad-preview-modal {
  transform: scale(1);
}

.ad-preview-overlay.is-closing .ad-preview-modal {
  transform: scale(0.86);
}

.ad-preview-overlay.is-video .ad-preview-modal::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.48);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ad-preview-overlay.is-video .ad-preview-modal::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 19px solid rgba(255, 255, 255, 0.9);
  transform: translate(-36%, -50%);
  pointer-events: none;
}

.ad-preview-modal img {
  display: block;
  max-width: min(760px, calc(100vw - 64px));
  max-height: min(78vh, calc(100vh - 96px));
  border-radius: 7px;
  object-fit: contain;
}

.ad-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ad-preview-close:hover {
  background: #f8fafc;
}

.ad-preview-video-badge {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 4;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ad-preview-caption {
  overflow: hidden;
  max-width: min(760px, calc(100vw - 64px));
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subline {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tree-cell {
  min-width: 138px;
}

.tree-cell span {
  vertical-align: middle;
}

.tree-toggle,
.tree-spacer {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  place-items: center;
  vertical-align: middle;
}

.tree-toggle {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.campaign-row td {
  font-weight: 700;
  background: #fbfcfe;
}

.group-row td {
  background: #fff;
}

.group-row .tree-cell {
  padding-left: 34px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--gray);
}

.dot.green {
  background: var(--green);
}

.dot.amber {
  background: var(--amber);
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border: 2px solid #d7deea;
  border-top-color: var(--blue);
  border-radius: 50%;
  vertical-align: -4px;
  animation: spin 0.8s linear infinite;
}

.spinner.tiny {
  width: 14px;
  height: 14px;
  border-width: 2px;
  vertical-align: -2px;
}

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

@keyframes refreshSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes refreshNudge {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-3px);
  }

  70% {
    transform: translateX(3px);
  }
}

@keyframes calendarRing {
  from {
    opacity: 0;
    transform: scale(0.72);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes calendarMonthNext {
  from {
    opacity: 0.6;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes calendarMonthPrev {
  from {
    opacity: 0.6;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #d8dee8;
  cursor: pointer;
  transition: 0.15s;
}

.switch span::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: 0.15s;
}

.switch input:checked + span {
  border-color: var(--blue);
  background: var(--blue);
}

.switch input:checked + span::before {
  transform: translateX(18px);
}

.switch input:disabled + span {
  opacity: 0.6;
  cursor: wait;
}

.empty {
  height: 160px;
  color: var(--muted);
  text-align: center;
}

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

  .autocreative-panel-ready {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .topbar,
  .top-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .mode-tabs {
    width: 100%;
  }

  .mode-tabs {
    display: flex;
  }

  .mode-tab {
    flex: 1;
    padding: 0 10px;
  }

  .tabs {
    overflow-x: auto;
  }

  .autocreative-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .autocreative-panel-ready {
    grid-column: auto;
  }

  .autocreative-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .autocreative-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .api-block-head,
  .creative-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-block-controls,
  .creative-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .api-calendar-slot,
  .api-calendar-shell,
  .api-date-button {
    width: 100%;
  }

  .api-date-button {
    min-width: 0;
  }

  .api-calendar-popover {
    left: 0;
    right: auto;
  }
}
