:root {
  color-scheme: light;
  --ink: #15191f;
  --muted: #5f6b7a;
  --line: #d8e0e8;
  --panel: #ffffff;
  --surface: #f5f7fa;
  --soft: #edf2f6;
  --dark: #101820;
  --brand: #12765a;
  --brand-strong: #0b5f48;
  --blue: #255fc7;
  --amber: #9b6414;
  --red: #b42318;
  --shadow: 0 12px 30px rgba(22, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  align-items: center;
  background: var(--brand);
  border: 0;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  max-width: 100%;
  min-height: 42px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 10px 15px;
  text-align: center;
}

button:hover {
  background: var(--brand-strong);
}

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

button.ghost,
.sidebar-link {
  background: var(--soft);
  color: var(--ink);
}

button.ghost:hover,
.sidebar-link:hover {
  background: #dfe7ef;
}

button.small {
  min-height: 34px;
  padding: 7px 10px;
}

.icon-button,
.targeting-detail {
  align-items: center;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  min-height: 34px;
  padding: 0;
  width: 34px;
}

.icon-button {
  border-radius: 7px;
}

.icon-button svg,
.targeting-detail svg {
  height: 17px;
  width: 17px;
}

.targeting-detail {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.targeting-detail:hover {
  background: #dfe7ef;
}

.danger-action {
  color: var(--red) !important;
}

label {
  color: var(--ink);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 7px;
}

input:not([type="checkbox"]),
select,
textarea {
  appearance: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  display: block;
  font-size: 14px;
  min-height: 42px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

input[type="checkbox"] {
  appearance: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 auto;
  height: 17px;
  margin: 0;
  padding: 0;
  place-content: center;
  width: 17px;
}

input[type="checkbox"]::after {
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  display: block;
  height: 8px;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  width: 4px;
}

input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}

input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

input[type="checkbox"]:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 118, 90, 0.16);
  outline: none;
}

textarea {
  line-height: 1.45;
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 118, 90, 0.16);
  outline: none;
}

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

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  margin-bottom: 12px;
}

h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

pre {
  background: #111820;
  border-radius: 8px;
  color: #eef8f3;
  margin: 0;
  overflow-x: auto;
  padding: 14px;
  white-space: pre-wrap;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
}

.is-hidden {
  display: none !important;
}

.brand {
  align-items: center;
  color: inherit;
  display: inline-flex;
  font-weight: 900;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--dark);
  border: 1px solid #263241;
  border-radius: 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 20px rgba(20, 32, 43, 0.1);
  color: #fff;
  display: inline-flex;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 17px;
  font-weight: 850;
  gap: 5px;
  height: 33px;
  justify-content: center;
  line-height: 1;
  overflow: hidden;
  position: relative;
  width: 44px;
}

.brand-mark::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 52%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.prompt-symbol {
  color: #7be1b1;
  transform: translateY(-1px);
}

.prompt-cursor {
  animation: promptCursorBlink 1.05s steps(2, start) infinite;
  background: #b8ffd6;
  display: inline-block;
  height: 16px;
  width: 2px;
}

@keyframes promptCursorBlink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-cursor {
    animation: none;
  }
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  min-height: 100vh;
}

.auth-copy {
  background:
    linear-gradient(135deg, rgba(18, 118, 90, 0.22), transparent 42%),
    var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
}

.auth-copy p {
  color: #c6d2dc;
  max-width: 650px;
}

.auth-copy .eyebrow {
  color: #8ee0bd;
}

.auth-copy-main {
  margin: 60px 0;
  max-width: 760px;
}

.switch-link a {
  color: #fff;
  font-weight: 800;
}

.auth-screenshot-frame {
  aspect-ratio: 16 / 9;
  background: #0c1117;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  margin-top: 28px;
  max-width: 760px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.auth-screenshot-slide {
  animation: authScreenshotFade 12s infinite;
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
}

.auth-screenshot-static {
  margin: 28px 0 0;
}

.auth-screenshot-static.advertiser-campaign-preview {
  aspect-ratio: 2072 / 710;
  max-width: 920px;
}

[data-dashboard="advertiser"] .auth-copy-main {
  max-width: 920px;
}

.auth-screenshot-slide:nth-child(2) {
  animation-delay: 3s;
}

.auth-screenshot-slide:nth-child(3) {
  animation-delay: 6s;
}

.auth-screenshot-slide:nth-child(4) {
  animation-delay: 9s;
}

.auth-screenshot-slide img,
.auth-screenshot-static img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.auth-screenshot-slide figcaption,
.auth-screenshot-static figcaption {
  background: rgba(8, 12, 17, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  left: 14px;
  padding: 7px 11px;
  position: absolute;
}

@keyframes authScreenshotFade {
  0%,
  20% {
    opacity: 1;
  }

  25%,
  100% {
    opacity: 0;
  }
}

.auth-panel {
  align-items: center;
  display: flex;
  padding: 28px;
}

.dash-card,
.metric-card,
.table-wrap,
.summary-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dash-card {
  padding: 20px;
  width: 100%;
}

.dash-card label:not(:first-of-type),
.field {
  margin-top: 12px;
}

.card-heading {
  margin-bottom: 16px;
}

.button-row,
.toolbar,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-command {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-size: 28px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 44px;
}

.button-row {
  margin-top: 18px;
}

.status-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  margin-top: 14px;
  padding: 12px 14px;
}

.status-message.neutral {
  background: #f8fafc;
  color: var(--muted);
}

.status-message.success {
  background: #e9f7f1;
  border-color: #b8e4d2;
  color: var(--brand-strong);
}

.status-message.warning {
  background: #fff7e8;
  border-color: #f0d39c;
  color: var(--amber);
}

.status-message.danger {
  background: #fff0ef;
  border-color: #f1b6b0;
  color: var(--red);
}

.toast-status {
  box-shadow: var(--shadow);
  margin-top: 0;
  max-width: min(420px, calc(100vw - 32px));
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 60;
}

.dashboard-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 24px;
  position: sticky;
  top: 0;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.side-nav a,
.sidebar-link {
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
  padding: 11px 12px;
  text-decoration: none;
}

.side-nav a.active,
.side-nav a:hover {
  background: #e9f7f1;
  color: var(--brand-strong);
}

.sidebar-link {
  border: 0;
  justify-content: flex-start;
  margin-top: auto;
  width: 100%;
}

.dashboard-main {
  min-width: 0;
  padding: 30px;
}

.dashboard-topbar,
.section-title-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.dashboard-topbar {
  margin-bottom: 20px;
}

.dashboard-topbar h1,
.section-title-row h2 {
  margin-bottom: 0;
}

.toolbar {
  align-items: center;
  justify-content: flex-end;
}

.user-chip,
.status-pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  max-width: 100%;
  padding: 8px 11px;
  white-space: nowrap;
}

.user-chip {
  max-width: min(260px, 100%);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-pill.success {
  background: #e9f7f1;
  border-color: #b8e4d2;
  color: var(--brand-strong);
}

.status-pill.warning {
  background: #fff7e8;
  border-color: #f0d39c;
  color: var(--amber);
}

.status-pill.danger {
  background: #fff0ef;
  border-color: #f1b6b0;
  color: var(--red);
}

.metric-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.metric-card strong {
  display: block;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
  margin: 10px 0;
}

.metric-card p {
  font-size: 14px;
  margin-bottom: 0;
}

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

.dashboard-two-col {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  margin-top: 16px;
}

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

.inline-picker {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.ad-text-list {
  display: grid;
  gap: 8px;
}

.ad-text-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 58px auto;
}

.creative-review-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.creative-review-line {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 3px;
  padding: 7px 8px;
}

.creative-review-line code {
  color: #101720;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  white-space: normal;
}

.review-delta {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.review-delta-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 8px;
}

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

.review-delta-values > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.review-delta-values code {
  background: #f7f9fb;
  border-radius: 4px;
  color: #101720;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  padding: 5px 6px;
  white-space: pre-wrap;
}

.char-counter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.add-line-button {
  margin-top: 8px;
}

.limit-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.limit-toggle,
.toggle-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.limit-toggle {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  margin: 0;
  padding: 8px 10px;
}

.limit-toggle:has(input:checked) {
  background: #e9f7f1;
  border-color: #9bd5bd;
  color: var(--brand-strong);
}

.toggle-row input {
  height: auto;
  width: auto;
}

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

.option-tile {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.option-tile:has(input:checked) {
  background: #e9f7f1;
  border-color: #9bd5bd;
}

.option-tile input {
  flex: 0 0 auto;
  height: auto;
  margin-top: 3px;
  width: auto;
}

.option-tile span {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 4px;
  line-height: 1.45;
}

.option-tile strong {
  color: var(--ink);
  font-size: 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  padding: 7px 10px;
}

button.tag {
  cursor: pointer;
}

.form-grid .field {
  margin-top: 0;
}

.full {
  grid-column: 1 / -1;
}

.field-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  margin-top: 6px;
  text-align: right;
}

.command-stack {
  display: grid;
  gap: 12px;
}

.command-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.command-title {
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 10px 13px;
}

.token-summary {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 13px;
}

.token-summary span,
.summary-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.token-summary strong {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.preview-line {
  background: #111820;
  border-radius: 8px;
  color: #fff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
  min-height: 64px;
  overflow-wrap: anywhere;
  padding: 14px;
}

.campaign-editor-view {
  margin-top: 0;
}

.campaign-editor-shell {
  display: grid;
  gap: 16px;
}

.campaign-editor-header {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.campaign-editor-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(460px, 0.95fr) minmax(480px, 1.05fr);
}

.campaign-preview-card {
  position: sticky;
  top: 24px;
}

.preview-cli-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preview-cli-choice {
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  min-height: 34px;
  padding: 7px 10px;
}

.preview-cli-choice.is-active,
.preview-cli-choice:hover {
  background: #e9f7f1;
  border-color: #9bd5bd;
  color: var(--brand-strong);
}

.placement-preview-frame {
  aspect-ratio: 16 / 9;
  background: #0c1117;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 14px;
  overflow: hidden;
  position: relative;
}

.placement-preview-frame img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.placement-preview-frame figcaption {
  background: rgba(10, 14, 20, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  left: 12px;
  padding: 6px 9px;
  position: absolute;
  top: 12px;
}

.placement-preview-overlay {
  background: rgba(18, 18, 18, 0.96);
  border-radius: 0;
  box-sizing: border-box;
  font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 400;
  left: 7%;
  line-height: 1.35;
  max-width: 86%;
  overflow-wrap: anywhere;
  padding: 2px 4px;
  position: absolute;
  text-shadow: none;
  top: 49%;
  transform: translateY(-50%);
  white-space: normal;
}

.placement-preview-overlay.profile-codex {
  background: #1c1c1c;
  color: #f1f1f1;
  font-size: clamp(8px, 1.35vw, 10px);
  left: 9.25%;
  line-height: 1.23;
  max-width: none;
  overflow: hidden;
  padding: 8px 5px 8px 7px;
  top: 56.7%;
  white-space: nowrap;
  width: 90.75%;
}

.placement-preview-overlay.profile-claude {
  --placement-preview-min-font-size: 8px;
  background: #1c1c1c;
  color: #a8a8a8;
  font-size: clamp(8.5px, 1.28vw, 10.25px);
  height: 5%;
  left: 0;
  line-height: 1.25;
  max-width: none;
  overflow: hidden;
  padding: 3px 4px 3px 172px;
  top: 72%;
  white-space: nowrap;
  width: 100%;
}

.placement-preview-overlay.profile-claude::before {
  color: #858585;
  content: "└  Stop says:";
  left: 36px;
  position: absolute;
  top: 3px;
}

.placement-preview-overlay.profile-gemini {
  --placement-preview-min-font-size: 8px;
  background: #1c1c1c;
  color: #cad57c;
  font-size: clamp(8px, 1.3vw, 10px);
  left: 1.65%;
  line-height: 1.2;
  max-width: none;
  overflow: hidden;
  padding: 6px 4px;
  top: 68.75%;
  white-space: nowrap;
  width: 97.8%;
}

.placement-preview-overlay.profile-antigravity {
  --placement-preview-min-font-size: 8.5px;
  background: #242424;
  color: #a58bea;
  font-size: clamp(8.5px, 1.45vw, 11px);
  left: 2.35%;
  line-height: 1.22;
  max-width: none;
  overflow: hidden;
  padding: 7px 4px 7px 3px;
  top: 71.8%;
  white-space: nowrap;
  width: 97.1%;
}

.placement-preview-overlay.profile-copilot {
  --placement-preview-min-font-size: 7px;
  background: #050505;
  color: #b6b6b6;
  font-size: clamp(7.5px, 1.15vw, 9.25px);
  left: 18.55%;
  line-height: 1.22;
  max-width: none;
  overflow: hidden;
  padding: 5px 4px 5px 3px;
  top: 31.25%;
  white-space: nowrap;
  width: 80.6%;
}

.placement-preview-overlay.profile-opencode {
  --placement-preview-min-font-size: 8px;
  background: #141414;
  color: #dedede;
  font-size: clamp(9px, 1.35vw, 10.5px);
  height: 12.3%;
  left: 48.45%;
  line-height: 1.22;
  max-width: none;
  overflow: hidden;
  overflow-wrap: normal;
  padding: 4px 5px;
  top: 22%;
  white-space: normal;
  width: 46.8%;
}

.placement-preview-overlay.profile-pi {
  --placement-preview-min-font-size: 6.5px;
  background: #030303;
  color: #8e8e8e;
  font-size: clamp(7px, 1.1vw, 9px);
  left: 0.55%;
  line-height: 1.25;
  max-width: none;
  overflow: hidden;
  padding: 6px 4px;
  top: 31.4%;
  white-space: nowrap;
  width: 98.9%;
}

.short-link-preview {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 750;
  margin-top: 10px;
  overflow-wrap: anywhere;
  padding: 10px 12px;
}

.review-list {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: 110px minmax(0, 1fr);
  margin: 16px 0 0;
}

.review-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.review-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 16px;
}

.summary-item {
  padding: 18px;
}

.summary-item strong {
  display: block;
  font-size: 22px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.summary-item p {
  font-size: 14px;
  margin-bottom: 0;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 1120px;
  width: 100%;
}

.campaign-table {
  min-width: 1120px;
  table-layout: fixed;
}

.campaign-table .campaign-col {
  width: auto;
}

.campaign-table .status-col {
  width: 122px;
}

.campaign-table .date-col {
  width: 110px;
}

.campaign-table .bid-col {
  width: 64px;
}

.campaign-table .budget-col {
  width: 106px;
}

.campaign-table .spend-col {
  width: 98px;
}

.campaign-table .targeting-col {
  width: 64px;
}

.campaign-table .delivery-col {
  width: 82px;
}

.campaign-table .actions-col {
  width: 188px;
}

.campaign-table th,
.campaign-table td {
  padding-left: 10px;
  padding-right: 10px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 14px;
}

.stacked-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.table-actions {
  gap: 6px;
}

.campaign-table .table-actions {
  flex-wrap: nowrap;
  min-width: 166px;
}

.campaign-table .status-pill {
  justify-content: center;
  min-width: 92px;
}

.date-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.date-cell span {
  white-space: nowrap;
}

.date-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.targeting-cell {
  position: relative;
}

.targeting-popover {
  display: inline-flex;
  position: relative;
}

.targeting-popover-content {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: none;
  gap: 8px;
  left: 0;
  min-width: 240px;
  padding: 12px;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 30;
}

.targeting-popover:hover .targeting-popover-content,
.targeting-popover:focus-within .targeting-popover-content,
.targeting-popover.is-open .targeting-popover-content {
  display: grid;
}

.targeting-popover-row {
  display: grid;
  gap: 2px;
}

.targeting-popover-row strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.targeting-popover-row span {
  overflow-wrap: anywhere;
}

.health-list {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 180px;
}

.health-chip {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 9px;
}

.health-chip.success {
  background: #e9f7f1;
  border-color: #b8e4d2;
  color: var(--brand-strong);
}

.health-chip.warning {
  background: #fff7e8;
  border-color: #f0d39c;
  color: var(--amber);
}

.health-chip.danger {
  background: #fff0ef;
  border-color: #f1b6b0;
  color: var(--red);
}

.cli-target-cell {
  min-width: 270px;
}

.cli-toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 360px;
}

.cli-toggle-chip {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  gap: 5px;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.cli-toggle-chip:has(input:checked) {
  background: #e9f7f1;
  border-color: #b8e4d2;
  color: var(--brand-strong);
}

.cli-toggle-chip input {
  accent-color: var(--brand);
  height: 13px;
  margin: 0;
  width: 13px;
}

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

.empty-state {
  background: #f8fafc;
  border: 1px dashed #c6d1dc;
  border-radius: 8px;
  padding: 18px;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 0;
}

.compact-empty {
  margin: 4px 0;
}

.diagnostics {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px 16px;
}

.modal-backdrop {
  align-items: flex-start;
  background: rgba(17, 24, 32, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow: auto;
  padding: 30px;
  position: fixed;
  z-index: 20;
}

.modal-panel {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  max-width: 1180px;
  padding: 24px;
  width: min(1180px, 100%);
}

.modal-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  margin: -24px -24px 18px;
  padding: 24px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.modal-header h2 {
  margin-bottom: 0;
}

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

.small-text {
  font-size: 13px;
}

.compact-status {
  margin-bottom: 12px;
}

.modal-table-wrap {
  max-height: min(58vh, 620px);
  overflow: auto;
}

.activity-modal {
  max-width: 980px;
}

.diagnostics summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.payload-box {
  margin-top: 14px;
  max-height: 420px;
}

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

.compact {
  margin-top: 16px;
}

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

  .dashboard-two-col {
    grid-template-columns: 1fr;
  }

  .campaign-editor-grid {
    grid-template-columns: 1fr;
  }

  .campaign-preview-card {
    position: static;
  }

  .reporting-grid {
    grid-template-columns: 1fr;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .auth-page,
  .dashboard-body {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    min-height: 360px;
    padding: 32px;
  }

  .auth-copy-main {
    margin: 42px 0;
  }

  .sidebar {
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    padding: 14px 18px;
    position: relative;
  }

  .sidebar .brand {
    min-width: 0;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .side-nav a,
  .sidebar-link {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  .sidebar-link {
    justify-content: center;
    margin-top: 0;
    width: auto;
  }

  .dashboard-topbar,
  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 640px) {
  .auth-panel,
  .dashboard-main,
  .sidebar {
    padding: 18px;
  }

  .metric-strip,
  .summary-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .review-list {
    grid-template-columns: 1fr;
  }

  .button-row button {
    flex: 1 1 180px;
  }

  .inline-picker {
    grid-template-columns: 1fr;
  }

  .ad-text-row {
    grid-template-columns: 1fr;
  }

  .preview-cli-choices {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .preview-cli-choice {
    flex: 0 0 auto;
  }

  .placement-preview-overlay {
    font-size: 10px;
    left: 5%;
    max-width: 90%;
    padding: 4px 6px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-panel {
    padding: 16px;
  }

  .modal-header {
    margin: -16px -16px 14px;
    padding: 16px;
  }

  .modal-actions {
    justify-content: flex-start;
  }
}
