/* OnCue Studio's styles: the UX spec's tokens (docs/studio/ux-spec.md §8), as in the prototype.
   A calm professional tool: neutral light surfaces, one accent, the ads the most colourful thing.
   Dark mode comes later; every colour is a token so it can. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}

:root {
  --page: #f7f7f8;
  --surface: #ffffff;
  --sunken: #f1f1f4;
  --line: #e6e6eb;
  --line-strong: #d5d5de;
  --text: #16161a;
  --text-2: #5b5b66;
  --text-3: #8a8a96;
  --accent: #4b47e5;
  --accent-hover: #3e3ad0;
  --accent-tint: #eeedfc;
  --accent-line: #b9b7f5;
  --ok: #167a4a;
  --ok-bg: #e8f5ee;
  --warn: #9a5b00;
  --warn-bg: #fff4e0;
  --bad: #c2283b;
  --bad-bg: #fdecee;
  --info: #2d5fcc;
  --info-bg: #ebf1fd;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-ctl: 6px;
  --r-card: 10px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 14px / 1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
p {
  margin: 0;
}
.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.small {
  font-size: 12px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stack.tight {
  gap: 4px;
}
.stack.snug {
  gap: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.num {
  font-variant-numeric: tabular-nums;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Controls */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
}
.btn:hover {
  background: var(--sunken);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-hover);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}
.btn.ghost:hover {
  background: var(--sunken);
  color: var(--text);
}
.btn.wide {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-weight: 500;
  font-size: 13px;
}
.hint {
  font-size: 12px;
  color: var(--text-3);
}
.input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--surface);
  padding: 8px 10px;
  min-height: 36px;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.input[aria-invalid="true"] {
  border-color: var(--bad);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.pad {
  padding: 20px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chip.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.chip.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.chip.neutral {
  background: var(--sunken);
  color: var(--text-2);
}
.chip.accent {
  background: var(--accent-tint);
  color: var(--accent);
}
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-card);
  border: 1px solid;
}
.banner.info {
  background: var(--info-bg);
  border-color: #cfdcf7;
  color: #1e3f86;
}
.banner.ok {
  background: var(--ok-bg);
  border-color: #c6e6d4;
  color: #0f5634;
}
.banner.bad {
  background: var(--bad-bg);
  border-color: #f4c9cf;
  color: #8a1c2a;
}
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 12px;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Brand placeholder (UX spec §10): replace once the company has a name and a logo. */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* The OnCue logo (assets/brand), and the mark alone where the side bar is narrow. */
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}
.brand-mark {
  display: none;
  height: 32px;
  width: auto;
}
.brand-name {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-2);
}

/* Sign-in and waiting: one calm card in the middle of the page. */
.center {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding-block: 48px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px))
    max(16px, env(safe-area-inset-right, 0px));
}
.panel {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.panel.wide {
  width: min(560px, 100%);
}
.panel .card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checklist {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* The app's shell (UX spec §4) */
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100%;
}
.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand {
  padding: 4px 8px 12px;
}
.workspace {
  margin: 0 4px 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
}
.workspace small {
  display: block;
  color: var(--text-3);
  font-size: 11px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-ctl);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover {
  background: var(--sunken);
  color: var(--text);
}
.nav a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent);
}
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.main {
  min-width: 0;
}
.top {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline: 24px;
}
.top .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e9d9c9;
  color: #6b4a2b;
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.content {
  padding: 28px 24px 64px;
  max-width: 1160px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: 0;
}

/* Layout helpers */
.grow {
  flex: 1;
  min-width: 0;
}
.wide-gap {
  gap: 24px;
}
.narrow {
  max-width: 860px;
}
.right {
  text-align: right;
}
.nowrap {
  flex-wrap: nowrap;
}
.normal {
  font-weight: 400;
}
.label {
  font-weight: 500;
  font-size: 13px;
}
.need-text {
  color: var(--warn);
}
.bad-text {
  color: var(--bad);
}
.warn-text {
  color: var(--warn);
}
fieldset.plain {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
fieldset.plain legend {
  padding: 0;
  margin-bottom: 6px;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.card-head {
  padding-bottom: 8px;
}
.pad-x {
  padding: 0 20px 16px;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0 4px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chip.info {
  background: var(--info-bg);
  color: var(--info);
}
.chip svg {
  width: 12px;
  height: 12px;
}
.select {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl);
  background: var(--surface);
  min-height: 36px;
  padding: 0 8px;
}
.select.compact {
  min-height: 30px;
  font-size: 13px;
}
.input.date {
  max-width: 220px;
}
.grow-input {
  flex: 1;
  min-width: 180px;
  width: auto;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-ctl);
  border: 0;
  background: transparent;
  display: inline-grid;
  place-items: center;
  color: var(--text-2);
  flex: none;
}
.icon-btn:hover {
  background: var(--sunken);
  color: var(--text);
}

/* Shell additions: icons in the navigation, the advertiser picker, the breadcrumb, the menu */
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav svg {
  flex: none;
}
.workspace-pick {
  width: 100%;
  border: 0;
  background: transparent;
  font-weight: 600;
  padding: 0;
  margin-left: -2px;
}
.crumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--text-3);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.crumb {
  display: inline-flex;
  gap: 6px;
}
.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--text);
}
.crumbs b {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top {
  position: sticky;
  top: 0;
  z-index: 5;
}
.menu-box {
  position: relative;
}
.avatar-btn {
  border: 0;
  background: none;
  padding: 2px;
  border-radius: 50%;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 12px 32px rgba(22, 22, 26, 0.14);
  padding: 6px;
  z-index: 20;
}
.menu-head {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: var(--r-ctl);
}
.menu-item:hover {
  background: var(--sunken);
}

/* The way on from each step of a campaign, at the lower right */
.next-step {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 0;
  background: linear-gradient(to bottom, transparent, var(--page) 30%);
}

/* A text box with matches under it: the country picker */
.combo {
  position: relative;
}
.combo-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 12px 32px rgba(22, 22, 26, 0.14);
  z-index: 20;
}
.combo-option {
  padding: 8px 10px;
  border-radius: var(--r-ctl);
  cursor: pointer;
}
.combo-option[aria-selected="true"],
.combo-option:hover {
  background: var(--sunken);
}

/* States (UX spec §6) */
.skeleton {
  height: 64px;
  border-radius: var(--r-card);
  background: linear-gradient(90deg, var(--sunken) 25%, #f7f7f9 50%, var(--sunken) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}
.empty {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(22, 22, 26, 0.18);
  max-width: min(560px, calc(100vw - 32px));
}

/* Lists of rows in a card */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rows > li {
  border-top: 1px solid var(--line);
}
.attn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
}
.attn-row .ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.ic.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.ic.neutral {
  background: var(--sunken);
  color: var(--text-2);
}
.camp-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: inherit;
}
.camp-row:hover {
  background: #fbfbfc;
}
.thumb {
  width: 64px;
  height: 53px;
  border-radius: 4px;
  background: var(--sunken);
  color: var(--text-3);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
td .thumb {
  width: 48px;
  height: 40px;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
}

/* A campaign */
.camp-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13px;
}
.meta > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.meta svg {
  color: var(--text-3);
}
.banner.spaced {
  margin-bottom: 16px;
}
.banner svg {
  flex: none;
  margin-top: 1px;
}
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tabs a {
  padding: 10px 12px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.tabs a:hover {
  color: var(--text);
}
.tabs a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tabs .count {
  font-size: 11px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  padding: 0 6px;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.step-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex: none;
}
.steps .done .step-mark {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.steps .now .step-mark {
  border-color: var(--accent);
}
.steps .later {
  color: var(--text-2);
}
.canvas {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: var(--r-card) var(--r-card) 0 0;
  background-color: #fafafb;
  background-image:
    linear-gradient(45deg, #f0f0f3 25%, transparent 25%),
    linear-gradient(-45deg, #f0f0f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f3 75%),
    linear-gradient(-45deg, transparent 75%, #f0f0f3 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  border-bottom: 1px solid var(--line);
}
.canvas img {
  max-width: 100%;
  /* Ads are made at twice their size for sharp screens: 250 px shows a 300×250 at its real size. */
  max-height: 250px;
  box-shadow:
    0 1px 0 var(--line),
    0 6px 20px rgba(22, 22, 26, 0.12);
}

/* Materials (UX spec §5.2) */
.materials-head {
  padding-bottom: 16px;
}
.dropzone {
  width: 100%;
  text-align: left;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-card);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--page);
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.sorted {
  margin-top: 8px;
}
.file-ic {
  width: 36px;
  height: 44px;
  border-radius: 4px;
  background: #e9eef9;
  color: var(--info);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: end center;
  padding-bottom: 6px;
  flex: none;
}
.file-ic.accent {
  background: var(--accent-tint);
  color: var(--accent);
  place-items: center;
  padding: 0;
}
.mat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mat {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.mat-state {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.mat-state.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.mat-state.need {
  background: var(--warn-bg);
  color: var(--warn);
}
.mat-state.opt {
  background: var(--sunken);
  color: var(--text-3);
}
.check-line {
  gap: 8px;
  margin-top: 4px;
}
.check-line input,
.radio-card input,
.switch input {
  accent-color: var(--accent);
}
.file-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
}
.file-line .file-ic {
  width: 28px;
  height: 34px;
  font-size: 8px;
  padding-bottom: 4px;
}
.file-line.failed {
  border-color: #f4c9cf;
  background: var(--bad-bg);
}
.file-line.uploading .file-ic {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
.file-name {
  overflow-wrap: anywhere;
  font-weight: 500;
}
.file-name a {
  color: var(--text);
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--page);
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

/* Pills, radio cards, switches */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}
.pill[aria-pressed="true"] {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  color: var(--accent);
  font-weight: 500;
}
.radio-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.radio-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  padding: 12px;
  cursor: pointer;
}
.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* Dialogs */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 26, 0.28);
  z-index: 30;
}
.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 32px));
  background: var(--surface);
  border-radius: 12px;
  z-index: 31;
  box-shadow: 0 20px 48px rgba(22, 22, 26, 0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* The brief (UX spec §5.3) */
.brief-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.brief-fields {
  gap: 22px;
}
.brief-field.is-suggested {
  border-left: 3px solid var(--accent-line);
  padding-left: 12px;
  margin-left: -15px;
}
.textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}
.btn.compact-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}
.icon-btn.small-icon {
  width: 24px;
  height: 24px;
}
.item-list,
.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.item-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--page);
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-list li {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
}
.legal-line {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.fixed-line {
  display: flex;
  gap: 8px;
  align-items: center;
}
.draft-panel {
  border-color: var(--accent-line);
  background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box;
}
.never {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--sunken);
  padding: 16px 20px;
}
.never h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.never ul {
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

/* Ads (UX spec §5.4) */
.ok-text {
  color: var(--ok);
}
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* An icon, then the words; an action such as Upload font goes under the words. */
.check-list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 8px;
  align-items: start;
}
.check-list li > span:first-child {
  display: inline-flex;
  padding-top: 2px;
}
.check-list li > :nth-child(n + 3) {
  grid-column: 2;
}
.ad-family h3,
.add-ad h3,
.found h3,
.ed-layers h3,
.ed-panel h3 {
  margin: 0;
}
.ad-family h3 {
  font-size: 16px;
}
.ad-family-head {
  padding: 14px 20px;
}
/* In the editor, toasts sit above the context bar. */
.content.bare .toast-root {
  bottom: 72px;
}
.ad-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.ad-thumb {
  width: 120px;
  height: 100px;
  border-radius: var(--r-ctl);
  background: var(--sunken);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ad-thumb img {
  max-width: 100%;
  max-height: 100%;
}
.font-upload label.btn.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
.font-upload .check-line {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.font-upload input[type="file"]:focus-visible + label,
.font-upload label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.source {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.source.rec {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint);
}
.source.later {
  background: var(--page);
  color: var(--text-2);
}
.found-layers {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.found-layers li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.layer-type {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  background: var(--sunken);
  color: var(--text-2);
  flex: none;
}

/* The editor (UX spec §5.5) */
.content.bare {
  padding: 0;
  max-width: none;
}
.pad-page {
  padding: 28px 24px;
}
.editor {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 312px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "bar bar bar"
    "alert alert alert"
    "layers stage panel"
    "ctx ctx ctx";
  height: calc(100vh - 56px);
  min-height: 520px;
  background: var(--surface);
}
.ed-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.ed-alert {
  grid-area: alert;
  padding: 8px 16px 0;
}
.flip {
  transform: scaleX(-1);
}
.icon-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}
.ed-layers {
  grid-area: layers;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 12px 8px;
}
.ed-layers h3 {
  padding: 4px 8px 4px;
  font-size: 14px;
}
.legend {
  display: flex;
  gap: 12px;
  padding: 0 8px 8px;
}
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.layer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r-ctl);
  border: 0;
  background: transparent;
  text-align: left;
}
.layer:hover {
  background: var(--sunken);
}
.layer[aria-selected="true"] {
  background: var(--accent-tint);
}
.layer[aria-selected="true"] .layer-type {
  background: var(--surface);
}
.layer .nm {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.st.p {
  color: var(--accent);
}
.st.f {
  color: var(--text-3);
}
.ed-stage {
  grid-area: stage;
  position: relative;
  overflow: auto;
  display: flex;
  flex-direction: column;
  /* "safe": at 200% a big ad scrolls from its top-left edge instead of being cut off there. */
  align-items: safe center;
  justify-content: safe center;
  padding: 24px 32px;
  border-radius: 0;
  border-bottom: 0;
  min-height: 0;
}
.ad-frame {
  position: relative;
  box-shadow:
    0 1px 0 var(--line),
    0 6px 20px rgba(22, 22, 26, 0.14);
  background: var(--surface);
}
.ed-stage .ad-frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  box-shadow: none;
  user-select: none;
}
.ad-layer {
  position: absolute;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
}
.ad-layer:hover {
  outline: 1px solid rgba(143, 140, 255, 0.9);
  outline-offset: 1px;
}
/* Personalized: a dashed accent outline (UX spec §5.5). Fixed layers have none. */
.ad-layer.p {
  outline: 1.5px dashed #a9a6ff;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(75, 71, 229, 0.35);
}
.ad-layer.sel {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ad-layer.bg.p,
.ad-layer.bg.sel {
  outline-offset: -3px;
}
.ad-layer.bg:hover {
  outline-offset: -2px;
}
.keep-clear {
  position: absolute;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    rgba(75, 71, 229, 0.22) 0 4px,
    rgba(255, 255, 255, 0.12) 4px 8px
  );
  border: 1px solid rgba(169, 166, 255, 0.9);
}
/* Above the ad, in its own row: over a tall ad it hid the headline (2026-11-26). */
.stage-note {
  flex: none;
  width: min(520px, 100%);
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(22, 22, 26, 0.06);
}
/* The space the ad is fitted to: what the hint and the line under the ad leave. */
.stage-fit {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
}

.ed-stage .size {
  color: var(--text-3);
}
/* The line under the ad: its size and zoom on the left, the default ad on the right. */
.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 720px;
  margin-top: 12px;
}
.next-in-bar {
  margin-left: auto;
}
.fallback-mini {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 260px;
  box-shadow: 0 4px 14px rgba(22, 22, 26, 0.06);
}
.fallback-thumb {
  width: 72px;
  height: 60px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--sunken);
  border-radius: 4px;
  overflow: hidden;
}
.ed-stage .fallback-thumb img {
  max-width: 100%;
  max-height: 100%;
}
.ed-panel {
  grid-area: panel;
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 16px 24px;
}
.ed-panel h3 {
  font-size: 15px;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--sunken);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.seg button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  height: 30px;
  padding: 0 10px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(22, 22, 26, 0.08);
}
.seg button[aria-pressed="true"].p {
  color: var(--accent);
}
.seg button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}
/* Fit, 100% and 200%, on one line. */
.seg.zoom {
  grid-template-columns: repeat(3, auto);
  white-space: nowrap;
}
.seg.zoom button {
  height: 26px;
  font-size: 12px;
}
.fixed-line {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.facts {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.facts div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
}
.facts dt {
  color: var(--text-3);
}
.facts dd {
  margin: 0;
}
.snug-row {
  gap: 6px;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  display: inline-block;
}
.textarea.short {
  min-height: 60px;
}
.example {
  padding: 8px 10px;
  background: var(--page);
  border-radius: var(--r-ctl);
  border: 1px solid var(--line);
}
.range {
  width: 100%;
  accent-color: var(--accent);
}
.size-sample {
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-ctl);
  overflow-wrap: anywhere;
}
.fit {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 500;
}
.fit svg {
  flex: none;
}
.fit.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.fit.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.fit.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.drivers-title {
  margin-bottom: 4px;
}
.driver-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.driver-row:first-of-type {
  border-top: 0;
}
.drivers input,
.ed-panel .check-line input {
  margin-top: 3px;
  accent-color: var(--accent);
}
.ed-panel .check-line {
  display: flex;
  align-items: flex-start;
}
.styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.style-opt {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  text-align: left;
}
.style-opt .sw {
  display: block;
  height: 40px;
}
.style-opt span:last-child {
  display: block;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 500;
}
.style-opt[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint);
}
.ctx-bar {
  grid-area: ctx;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
}
.ctx-label {
  font-weight: 600;
  font-size: 13px;
}
.ctx-notice {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.shortcuts {
  top: calc(100% - 2px);
  right: 16px;
  width: 340px;
  padding: 12px 14px;
}
.shortcuts dl {
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.shortcuts dl div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px;
}
.shortcuts dd {
  margin: 0;
  color: var(--text-2);
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--page);
  white-space: nowrap;
}
.canvas.phone-canvas img {
  max-height: 220px;
}

/* Laptops at the narrow end: slimmer panels */
@media (max-width: 1280px) {
  .editor {
    grid-template-columns: 200px minmax(0, 1fr) 280px;
  }
}
@media (max-width: 1100px) {
  .editor {
    grid-template-columns: 180px minmax(0, 1fr) 260px;
  }
  .ad-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .ad-row > :last-child {
    grid-column: 2;
    justify-self: start;
  }
  .ad-thumb {
    width: 96px;
    height: 80px;
  }
  .sources {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .content.bare {
    padding: 20px 16px 48px;
  }
}

/* Below a laptop: the sidebar becomes icons (UX spec §9) */
@media (max-width: 1100px) {
  .grid-2,
  .brief-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .side {
    padding: 12px 8px;
  }
  .side .brand-name,
  .side .brand-logo,
  .workspace {
    display: none;
  }
  .side .brand-mark {
    display: block;
  }
  /* The words stay for screen readers and tooltips' sake; only the icons show. */
  .nav span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .side .brand {
    justify-content: center;
    padding-inline: 0;
  }
  .nav a {
    justify-content: center;
  }
}

/* Phones: the navigation moves to the bottom */
@media (max-width: 720px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 64px;
  }
  .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    z-index: 20;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 6px max(8px, env(safe-area-inset-right, 0px))
      calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    justify-content: space-around;
  }
  .side .brand {
    display: none;
  }
  .nav,
  .side-foot {
    flex-direction: row;
    margin-top: 0;
  }
  .top {
    padding-inline: 16px;
  }
  .content {
    padding: 20px 16px 48px;
  }
  .radio-cards,
  .legal-line {
    grid-template-columns: minmax(0, 1fr);
  }
  .camp-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .camp-row > :last-child {
    grid-column: 2;
    justify-self: start;
  }
  .dropzone {
    flex-wrap: wrap;
  }
  .toast-root {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* Previews (UX spec §5.6, ADR 0056): the tag's renderer, the grid, its cards and the drawer */
.chip.bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.pv-real svg {
  flex: none;
  color: var(--accent);
  margin-top: 2px;
}
.pv-fallback-label svg {
  width: 14px;
  height: 14px;
  color: var(--bad);
}
.pv-checks li svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}
.btn.compact {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}
.ad-render {
  position: relative;
  flex: none;
  overflow: hidden;
  background: var(--sunken);
  box-shadow:
    0 1px 0 var(--line),
    0 4px 14px rgba(22, 22, 26, 0.1);
}
.ad-render-host {
  transform-origin: 0 0;
}
.pv-setup .pv-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fbfbfc;
  border-radius: 0 0 var(--r-card) var(--r-card);
}
.pv-dims {
  display: grid;
  gap: 14px;
}
.pv-dim .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pv-dim .pill svg {
  width: 13px;
  height: 13px;
}
.pv-dim .pill[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.pv-dim-hint {
  align-self: center;
}
.pv-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pv-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pv-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--sunken);
  overflow: hidden;
}
.pv-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 200ms ease-out;
}
.pv-reasons {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
}
.pv-real {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 0;
}
.pv-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--ad-w, 300px) + 26px), 1fr));
  gap: 16px;
}
.pv-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  min-width: 0;
}
.pv-card.failed,
.pv-card.rejected {
  border-color: #f4c9cf;
}
.pv-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pv-meta .spread {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.pv-line {
  font-weight: 500;
  font-size: 13px;
  min-width: 0;
}
.pv-meta .warn-text svg {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
}
/* What a viewer sees when a check fails: the default ad, dimmed behind a label. */
.pv-fallback {
  position: relative;
  flex: none;
}
.pv-fallback .ad-render {
  opacity: 0.38;
  filter: grayscale(0.4);
}
.pv-fallback-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(22, 22, 26, 0.12);
}
/* A variation being made keeps the ad's outline, with a moving shimmer (UX spec §6). */
.pv-pending {
  flex: none;
  display: grid;
  place-items: center;
  color: var(--text-2);
  border: 1px dashed var(--accent-line);
  background: linear-gradient(90deg, var(--sunken) 25%, #f7f7f9 50%, var(--sunken) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.pv-card > .ad-render,
.pv-card > .pv-fallback,
.pv-card > .pv-pending {
  align-self: center;
}
.ad-frame.generating {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
  animation: pulse 1.2s ease-in-out infinite;
}
.ad-frame .ad-render {
  box-shadow: none;
}
.gen-label {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  z-index: 3;
}
@media (prefers-reduced-motion: reduce) {
  .pv-pending,
  .ad-frame.generating {
    animation: none;
  }
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 100%);
  overflow-y: auto;
  background: var(--surface);
  z-index: 31;
  box-shadow: -12px 0 40px rgba(22, 22, 26, 0.18);
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.drawer > * {
  flex: none;
}
.drawer h2 {
  font-size: 20px;
}
.drawer h3 {
  font-size: 14px;
}
.drawer-canvas {
  border-radius: var(--r-card);
  overflow: auto;
  place-items: start center;
}
.pv-texts {
  margin: 0;
  display: grid;
  gap: 8px;
}
.pv-texts dd {
  margin: 0;
}
.pv-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.pv-checks li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
}
.pv-checks li.ok svg {
  color: var(--ok);
}
.pv-checks li.bad svg {
  color: var(--bad);
}
.pv-stopped summary {
  cursor: pointer;
  margin-bottom: 8px;
}
.pv-compare {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.pv-compare h3 {
  margin: 0;
}
.pv-compare-pair {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

/* ---------- Results (UX spec §5.1, §5.9, ADR 0060) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.stats.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.stats.compact .stat {
  padding: 10px;
}
.stats.compact .stat-value {
  font-size: 20px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  min-width: 0;
}
.stat.hero {
  background: var(--accent-tint);
  border-color: var(--accent-line);
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}
.hero-value {
  font-size: 32px;
}
.placeholder-box {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-ctl);
  color: var(--text-2);
}
.placeholder-box svg {
  flex: none;
  margin-top: 1px;
}
.how-sure > summary {
  cursor: pointer;
  color: var(--text-2);
}
/* The lift by week: thin bars from a zero line, up for more clicks, down for fewer. */
.wk-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  height: 110px;
}
.wk-col {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wk-half {
  display: flex;
  justify-content: center;
}
.wk-half.pos {
  align-items: flex-end;
  border-bottom: 1px solid var(--line-strong);
}
.wk-half.neg {
  align-items: flex-start;
}
.wk-bar {
  display: block;
  width: min(18px, 60%);
  min-height: 2px;
  background: var(--accent);
}
.wk-half.pos .wk-bar {
  border-radius: 4px 4px 0 0;
}
.wk-half.neg .wk-bar {
  border-radius: 0 0 4px 4px;
}
.wk-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: var(--r-ctl);
  background: var(--text);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(22, 22, 26, 0.18);
}
.wk-col:hover .wk-tip {
  display: block;
}
.wk-col:hover .wk-bar {
  background: var(--accent-hover);
}
.wk-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  text-align: center;
}
.results-pair {
  align-items: start;
}
.bar-rows > li {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 20px;
}
.bar-name {
  min-width: 0;
}
.bar-name .warn-text {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--sunken);
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}
.metric {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.metric-value {
  font-size: 16px;
  font-weight: 600;
}
.reasons {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
  color: var(--text);
}
.reasons li {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.reasons svg {
  flex: none;
  color: var(--warn);
  margin-top: 1px;
}
.strip {
  list-style: none;
  margin: 0;
  padding: 16px 20px 20px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
}
.strip-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}
.strip-item:hover .small {
  color: var(--accent);
}

/* ---------- Served ads (UX spec §5.10) ---------- */
.served-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.served-filters .field {
  gap: 4px;
  min-width: 0;
}
.served-filters .select {
  max-width: 220px;
}
.date-range {
  border: 0;
  margin: 0;
  padding: 0;
}
.date-range legend {
  padding: 0;
  margin-bottom: 4px;
}
.date-range .row {
  flex-wrap: nowrap;
}
.date-range .input.date {
  width: 150px;
}
.served-filters .ref-field {
  flex: 1 1 240px;
  max-width: 320px;
}
.served-filters .ref-field .grow-input {
  min-width: 0;
}
.served-filters .clear {
  align-self: center;
}
.served-missing {
  width: 300px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-ctl);
  align-self: center;
}
.ref {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.04em;
}
.pager {
  justify-content: center;
}
.facts.wide div {
  grid-template-columns: 110px minmax(0, 1fr);
}

/* Print with record: only the open ad and its record. */
@media print {
  body.printing-record .side,
  body.printing-record .top,
  body.printing-record .content > * > :not(.served-drawer),
  body.printing-record .no-print,
  body.printing-record .toast-root {
    display: none;
  }
  body.printing-record .served-drawer {
    position: static;
    width: auto;
    box-shadow: none;
    overflow: visible;
  }
}
@media (max-width: 720px) {
  .served-filters .select {
    max-width: none;
  }
  .served-filters .field {
    flex: 1 1 100%;
  }
}

/* ---------- Publish (UX spec §5.7, ADR 0059) ---------- */
.ic.info {
  background: var(--info-bg);
  color: var(--info);
}
.banner.warn {
  background: var(--warn-bg);
  border-color: #f2dcb3;
  color: #6e4100;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.break {
  overflow-wrap: anywhere;
}
.pub {
  max-width: 880px;
}
.pub-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.pub-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}
.pub-step:first-child {
  border-top: 0;
}
.pub-step .step-mark {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-top: 1px;
}
.pub-step.done .step-mark {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.pub-step.now .step-mark {
  border-color: var(--accent);
  color: var(--accent);
}
.pub-step.later .pub-title {
  color: var(--text-3);
}
.pub-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.blockers {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.blockers li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.blockers li:first-child {
  border-top: 0;
}
.blockers li > svg {
  color: var(--warn);
  flex: none;
}
.tag-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.tag-row {
  display: grid;
  gap: 8px;
}
.tag-code,
.steps-text {
  margin: 0;
  padding: 12px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.steps-text {
  font-family: var(--font);
  font-size: 14px;
  background: none;
  border: 0;
  padding: 0;
}
.radio-card.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.live-rows > li,
.compact-rows > li {
  padding: 10px 0;
}
.tag-test {
  min-height: 0;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
}
.tag-test iframe {
  border: 0;
  background: #fff;
  max-width: 100%;
}

/* ---------- The approver's screen and the agency's page: phone first (UX spec §9) ---------- */
.approve-page {
  min-height: 100%;
  background: var(--page);
}
.approve-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.approve-brand {
  color: inherit;
  text-decoration: none;
}
.approve-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}
.approve-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent-line);
  background: var(--surface);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.approve-ads,
.approve-sample {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  overflow-x: auto;
}
.approve-ad {
  margin: 0;
  display: grid;
  gap: 6px;
  max-width: 100%;
}
.approve-layers {
  list-style: none;
  margin: 0;
  padding: 0;
}
.approve-layers li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.approve-layers li:first-child {
  border-top: 0;
}
.approve-brief {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 8px 16px;
  margin: 0;
}
.approve-brief dt {
  color: var(--text-2);
  font-size: 13px;
}
.approve-brief dd {
  margin: 0;
}
.approve-brief-row {
  display: contents;
}
.approve-decide {
  position: sticky;
  bottom: 12px;
  box-shadow: 0 8px 28px rgba(22, 22, 26, 0.14);
  border-color: var(--accent-line);
}
@media (max-width: 720px) {
  .approve-brief {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .approve-brief dd {
    margin-bottom: 8px;
  }
  .approve-main {
    padding-top: 16px;
  }
  .pub-step {
    padding: 14px 12px;
    gap: 10px;
  }
}
.plain-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
fieldset.radio-cards {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
@media (max-width: 720px) {
  /* On a phone, the sample is a strip to swipe through, not a long column. */
  .approve-sample {
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
  }
  .approve-sample .approve-ad {
    scroll-snap-align: start;
    flex: none;
  }
}
@media (max-width: 720px) {
  /* The decision stays in reach while scrolling, without covering the ads. */
  .approve-decide {
    padding: 12px 16px;
    gap: 8px;
  }
  .approve-decide .decide-hint,
  .approve-decide h2 {
    display: none;
  }
}

/* The ad as designed, faded in once its image has decoded (components/AdImage.tsx) */
.ad-image {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.ad-frame .ad-image,
.ad-thumb .ad-image {
  display: block;
  width: 100%;
  height: 100%;
}
.ad-image-img {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}
.ad-image.ready .ad-image-img {
  opacity: 1;
}
.ad-image-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

/* What may drive the text and the background (ADR 0070): a row per signal, a column for each */
.drivers-grid {
  width: 100%;
  border-collapse: collapse;
}
.drivers-grid caption {
  text-align: left;
  margin-bottom: 6px;
}
.dg-cell {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.dg-col {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  padding-top: 0;
}
.dg-signal {
  text-align: left;
  font-weight: normal;
}
.dg-check {
  text-align: center;
  width: 64px;
}

/* "Designed 34 px" beside "Smallest allowed 27 px", over the slider */
.size-pair {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}

/* "Describe your own" among the background styles */
.style-opt .sw.own {
  display: grid;
  place-items: center;
  background: var(--accent-tint);
  color: var(--accent);
}

/* "Add a city" under the preview's cities */
.pv-add-city {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}
