/* A phone, where the app is laid out for a narrow screen:
     @media (max-width: 40rem), (max-height: 30rem)
   No wider than 40rem, or under 30rem tall -- a phone held sideways, some
   900px wide but only 400 tall, where the wide layout leaves room for hardly
   a row. By size alone: a window as short on a computer has as little room.
   A media query cannot take a variable, so each says it in full, as do the
   scripts in app.js and the menu's fallback in views/layout.go: changed,
   it changes in all of them. */
:root {
  /* The accent's hue, which every grey of the app leans towards. Each colour
     is oklch: a lightness as the eye sees it, how much colour, and the hue. */
  --hue: 242;
  --bg: oklch(97.5% 0.001 var(--hue));
  /* A card, set off from the page it sits on: in the light as white as the
     page, and set off by its border; a step lighter than the dark one. */
  --surface: #ffffff;
  /* A campaign's settings, a box of rows: a touch lighter than the page. */
  --setting: oklch(98.7% 0.003 var(--hue));
  /* The edge of a setting box, and the line between two of its rows. */
  --setting-edge: var(--border);
  /* The raised colour, mostly opaque, for a button drawn over a picture or
     the panel -- the ad preview panel's ✕: each theme's own, as --raised-2
     is. */
  --semi-transparent-bg: color-mix(in srgb, var(--raised-2) 75%, transparent);
  --semi-transparent-bg-hover: color-mix(in srgb, var(--raised-2) 95%, transparent);
  /* What lies on top of the page, as Material 3 has it: a step away from the
     page in tone for each step up. On the light page that is darker, and the
     shadow says it is lifted; on the dark one lighter, where a shadow barely
     shows. A menu or a popover is raised. A dialog over the light page is
     not: the page under it is dimmed, or it is the whole screen, and it keeps
     the page's colour. Over the dark page, dimmed is barely darker, and the
     dialog is raised as a menu is; a menu opened in it goes a step further. */
  /* Tinted with the blue, as Material tints its surfaces with the primary
     colour: a grey that belongs to the app rather than a plain one. */
  --raised: oklch(95% 0.01 var(--hue));
  /* Two steps up: what opens over something raised -- the team picker's list
     over the sidebar -- and would be lost on it in the same colour. */
  --raised-2: oklch(91% 0.015 var(--hue));
  --dialog: var(--bg);
  /* The edge round a menu, a popover or a dialog, apart from the lines in it:
     none for now, to see whether the colour and the shadow are enough. */
  --raised-edge: transparent;
  --shadow-raised: 0 4px 8px rgb(0 0 0 / 0.18);
  --shadow-overlay: 0 12px 32px rgb(0 0 0 / 0.2);
  /* A full-screen dialog's bar once something is scrolled under it: raised
     from the dialog -- in the light the page, so the raised colour; in the
     dark a step lighter than the dialog. */
  --raised-bar: var(--raised);
  /* How much of the blue what is chosen takes: more in the dark, where as
     little barely shows. */
  --active-share: 16%;
  /* A phone's top bar -- the app's with its ☰, a full-screen dialog's, a
     menu's that fills the screen, a takeover's -- one height for all of
     them, so one taking another's place changes what the bar says and not
     where: 64px, with a 48px circle to tap round each 24px icon, as
     Material's top app bar has. The icon stays 16px from the screen's edge
     (--bar-edge is where its circle starts) and the title 72px
     (--bar-title is the gap after the circle). */
  --bar-height: 4rem;
  --bar-button: 3rem;
  --bar-pad: calc((var(--bar-height) - var(--bar-button)) / 2);
  --bar-inset: calc((var(--bar-button) - 1.5rem) / 2);
  --bar-edge: calc(1rem - var(--bar-inset));
  --bar-title: calc(4.5rem - var(--bar-edge) - var(--bar-button));
  /* The room a phone on its side asks for at each side. An iPhone asks for
     the same at both, its camera's cut-out's, though the cut-out is at one
     side only and the other has only its rounded corners, which the page's
     own margin keeps clear of; where app.js knows the side (data-cutout),
     the other asks for none. */
  --inset-left: env(safe-area-inset-left, 0px);
  --inset-right: env(safe-area-inset-right, 0px);
  /* What a phone on its side keeps clear for its camera's cut-out and its
     rounded corners, less most of the 1rem from the screen's edge that a
     page, a dialog or a bar keeps anyway: added to that, it is the cut-out's
     room and a little more where there is one -- 0.5rem, so the page does
     not stand right up against it -- and the page's own margin where there
     is not, rather than the two together. 0 wherever nothing is in the
     way. */
  --safe-left: max(0px, calc(var(--inset-left) - 0.5rem));
  --safe-right: max(0px, calc(var(--inset-right) - 0.5rem));
  /* How far past the page's 1rem margin a block reaching for the screen's
     edge goes -- the tabs, a table, a list on a phone: all of it where
     nothing is in the way, and none where something is, so that it starts
     where the page's words do (--safe-left), rather than under the cut-out,
     its words next to it. */
  --edge-left: min(0px, calc(var(--inset-left) - 1rem));
  --edge-right: min(0px, calc(var(--inset-right) - 1rem));
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: oklch(50.7% 0.119 var(--hue)); /* the blue of the icon in the browser tab */
  /* Lines and the greys behind things carry a little of the blue, as the
     raised colour does, so that every grey leans the same way; text does not.
     Lines are seen through: the same line on the page, in a box or on a menu,
     a step darker than whatever it is drawn on. --ink is what the greys are
     mixed from: the text's colour with the blue in it. */
  --border: oklch(25% 0.04 var(--hue) / 0.12);
  --ink: oklch(33.4% 0.059 var(--hue));
  --radius: 6px;
  /* A button's blue, and what is written on it: the icon's blue in either
     theme, with white on it -- 5.6 to 1. The dark theme lightens --accent,
     which words and lines need to be read on a dark page, but white on that
     lighter blue reads at only 3.1. */
  --accent-fill: oklch(50.7% 0.119 var(--hue));
  --on-accent: #ffffff;
  --row-hover: color-mix(in srgb, var(--ink) 4%, var(--bg));
  --subtle: color-mix(in srgb, var(--ink) 5%, var(--bg));
  --nav-active: color-mix(in srgb, var(--accent) var(--active-share), var(--bg));
  /* The tints that mean something -- a state, a kind of feed -- and the one
     button that is somebody else's. They are tokens rather than colours in the
     rules because each has a dark twin, and a token is the only way to write
     the twin once instead of writing every rule twice. */
  --ok-bg: #d9f0e1;
  --ok-fg: #1b6b37;
  --bad-bg: #fadcdc;
  --bad-fg: #a92222;
  /* A campaign's state in its row of the list: the old app's green running
     and light grey paused; removed, the red of a removed badge's text. In the
     dark that text is light, to read on the badge's dark red, and the mark is
     on the page itself: the old app's red there. */
  --campaign-running: hsl(124 48% 40%);
  --campaign-paused: hsl(202 10% 80%);
  --campaign-removed: var(--bad-fg);
  --amber-bg: #fbf0d9;
  --amber-fg: #875500;
  /* What is new and may still change -- a tab marked beta: violet, apart
     from the accent's blue, the amber of something to do and the red of
     something wrong. */
  --beta-bg: #ece4fb;
  --beta-fg: #5b2bb5;
  /* Something to be done, not something wrong: amber, and its dark twin
     with it. */
  --pending-bg: var(--amber-bg);
  /* The corner mark on a figure still collecting conversions: a light
     yellow, seen without drawing the eye from the figure itself. */
  --maturing-mark: #f5d76e;
  --pending-fg: var(--amber-fg);
  /* The number beside the dashboard in the menu: bright enough to be seen on
     either background, so it has no dark twin. */
  --attention-dot: #f2b705;
  --google-bg: #ffffff;
  --google-fg: #1f1f1f;
  --google-border: #747775;
  /* The type scale: every size of the app's own text is one of these, and
     each step is at least 2px from the next, so two sizes never look almost
     alike. The ad previews are left out: they copy each network's own sizes.
     xs (12px) badges, chips, chart labels and other short marks glanced at;
     sm (14px) small text that is read -- labels, tables, notes, code to read;
     base (16px) body text and h3; lg (18px) a figure or card name; xl (20px)
     h2; 2xl (24px) the login page's heading; 3xl (28px) h1 and the dashboard's figures. */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  color-scheme: light dark;
}
/* The side with no cut-out still has the rounded corners: the page's
   margin and a little, 0.5rem, where the phone asks for room at all --
   not on one that asks for none -- with the blocks that reach for the
   screen's edge still reaching it. */
:root[data-cutout="left"] {
  --inset-right: 0px;
  --safe-right: min(0.5rem, env(safe-area-inset-right, 0px));
  --edge-right: calc(-1rem - var(--safe-right));
}
:root[data-cutout="right"] {
  --inset-left: 0px;
  --safe-left: min(0.5rem, env(safe-area-inset-left, 0px));
  --edge-left: calc(-1rem - var(--safe-left));
}

/* Dark, and who asks for it. The system's own preference is followed unless
   somebody has said otherwise on their profile, and what they said is on the
   html element before the page is drawn -- so there is no flash of the wrong
   one and no script deciding it.
   The list is written twice because CSS has no way to say "this selector or
   that one" across a media query. Everything else reads the tokens. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(21.6% 0.007 var(--hue));
    --surface: oklch(25% 0.009 var(--hue));
    --setting: oklch(24.6% 0.007 var(--hue));
    /* In the dark, a setting box is set apart by its own shade alone: its
       edge, and the line between two rows, in the page's, not a third. */
    --setting-edge: var(--bg);
    --raised: oklch(27.8% 0.01 var(--hue));
    --raised-2: oklch(33.4% 0.016 var(--hue));
    --dialog: var(--raised);
    --raised-bar: var(--raised-2);
    --shadow-raised: 0 4px 12px rgb(0 0 0 / 0.5);
    --shadow-overlay: 0 12px 32px rgb(0 0 0 / 0.6);
    --fg: #ececec;
    --muted: #9a9a9a;
    /* The same blue, lightened: the icon's own is too dark to read here. */
    --accent: oklch(65.8% 0.124 var(--hue));
    --border: oklch(92% 0.02 var(--hue) / 0.12);
    --ink: oklch(82.4% 0.052 var(--hue));
    /* The same two colours, dark enough to sit on the page and light enough to
       read on. Paused follows the border and the text, which already turn. */
    --ok-bg: #17371f;
    --ok-fg: #7fd39b;
    --bad-bg: #3b1d1d;
    --bad-fg: #f0a0a0;
    /* What is chosen -- the page in the menu, a ticked row -- takes more of
       the blue than on white, where as little barely shows on a dark page. */
    --active-share: 24%;
    --nav-active: color-mix(in srgb, var(--accent) var(--active-share), var(--bg));
    --campaign-paused: hsl(202 10% 35%);
    --campaign-removed: hsl(0 100% 49%);
    /* The feed formats turn the same way: the hue stays, the lightness swaps. */
    --amber-bg: #3a2e13;
    --beta-bg: #2e2347;
    --beta-fg: #c7b2f5;
    --maturing-mark: #c9a83c;
    --amber-fg: #e0bc74;
    --google-bg: #131314;
    --google-fg: #e3e3e3;
    --google-border: #8e918f;
  }
}

:root[data-theme="dark"] {
  --bg: oklch(21.6% 0.007 var(--hue));
  --surface: oklch(25% 0.009 var(--hue));
  --setting: oklch(24.6% 0.007 var(--hue));
  --setting-edge: var(--bg);
  --raised: oklch(27.8% 0.01 var(--hue));
  --raised-2: oklch(33.4% 0.016 var(--hue));
  --dialog: var(--raised);
  --raised-bar: var(--raised-2);
  --shadow-raised: 0 4px 12px rgb(0 0 0 / 0.5);
  --shadow-overlay: 0 12px 32px rgb(0 0 0 / 0.6);
  --fg: #ececec;
  --muted: #9a9a9a;
  --accent: oklch(65.8% 0.124 var(--hue));
  --border: oklch(92% 0.02 var(--hue) / 0.12);
  --ink: oklch(82.4% 0.052 var(--hue));
  --ok-bg: #17371f;
  --ok-fg: #7fd39b;
  --bad-bg: #3b1d1d;
  --bad-fg: #f0a0a0;
  --active-share: 24%;
  --nav-active: color-mix(in srgb, var(--accent) var(--active-share), var(--bg));
  --campaign-paused: hsl(202 10% 35%);
  --campaign-removed: hsl(0 100% 49%);
  --amber-bg: #3a2e13;
  --beta-bg: #2e2347;
  --beta-fg: #c7b2f5;
  --maturing-mark: #c9a83c;
  --amber-fg: #e0bc74;
  --google-bg: #131314;
  --google-fg: #e3e3e3;
  --google-border: #8e918f;
}

/* What a browser draws itself -- form controls, scrollbars, the space behind
   the page -- follows the choice too, or it is a dark page with white edges. */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* What lies on top of the page is a page of its own colour: what is drawn in
   it on --bg -- a sticky header, a calendar -- takes that colour, and hovering
   and choosing go a step further from it, as they do from the page. The tints
   are written again because a token mixed from --bg is mixed where it is
   declared, on :root, and would keep the page's colour. */
.sidebar, .team-picker ul, .menu-panel, .submenu-panel, .note-popover, .forecast-tip, .dialog {
  --bg: var(--raised);
  --row-hover: color-mix(in srgb, var(--ink) 6%, var(--bg));
  --subtle: color-mix(in srgb, var(--ink) 6%, var(--bg));
  --nav-active: color-mix(in srgb, var(--accent) var(--active-share), var(--bg));
}
.dialog { --bg: var(--dialog); }
/* A menu opened in a dialog is a step above it, as one on the page is above
   the page: the colour a bar over a dialog turns, the same as --raised in
   light, where the dialog is the page's colour. */
.dialog :is(.team-picker ul, .menu-panel, .submenu-panel, .note-popover, .forecast-tip) { --bg: var(--raised-bar); }
/* And one opened over the sidebar, which is raised itself: two steps up, so
   the team picker's list stands off it, rather than the shadow alone. */
.sidebar :is(.team-picker ul, .menu-panel, .submenu-panel, .note-popover, .forecast-tip) { --bg: var(--raised-2); }

*, *::before, *::after { box-sizing: border-box; }

/* Where the keyboard is: whatever it has reached is ringed in the accent,
   2px, the ring a component of its own draws too (.icon-button, the tick
   boxes...). The browser's own ring is thin and its own colour, and lost in
   the dark. :focus-visible, so a tap or a click rings nothing -- a text box
   is the exception, as it should be: it is where the typing goes. Early and
   plain, so that a component's own way of showing it, later (a halo, a lit
   column, a ring set inside), takes its place. Inside a menu and the strip
   of the list's tabs, set inside the thing ringed: those are boxes that
   scroll, and cut off whatever stands out of them (and see .level-tab). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:is(.menu-panel, .submenu-panel, .level-tabs) :focus-visible { outline-offset: -2px; }
/* The sidebar's pages lie close, each placed (position: relative), so the
   one below is drawn over the ring of the one above -- the chosen page's
   colour over it, most of all. Lifted over its neighbours while it has the
   ring. Only here: lifting whatever has the ring would cover what is drawn
   on a thing -- the search's magnifying glass on its box, a tile's tick
   box, an image's crop and remove buttons. */
.sidebar a:focus-visible { z-index: 1; }

/* Text the size it is set, everywhere. Safari on iOS otherwise enlarges the
   text of some blocks it takes for running text -- one campaign's name of a
   list, the longest, drawn bigger and bolder than the rest. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  /* Body text on the scale, said rather than left to the browser. In rem, so
     it is still the size the person has chosen in their browser: the html
     element's size is never set. */
  font-size: var(--text-base);
  line-height: 1.5;
}

a { color: var(--accent); }

.muted { color: var(--muted); }
/* Text for screen readers only. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.error { color: #d33; }
/* What a sync left out, not sending it, rather than what the network refused:
   amber, as what needs doing is, not red. */
.unsent { color: var(--pending-fg); }

/* A button marked hidden stays hidden: the display below would otherwise
   outrank the browser's own rule for hidden, and show it. */
button[hidden] { display: none; }

button, .button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-fill);
  border-radius: var(--radius);
  background: var(--accent-fill);
  color: var(--on-accent);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}


.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  /* Round, as Material has an icon on its own: what lights up under the
     pointer is a circle round the icon, where a button of words has a
     rounded box. */
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover { background: var(--border); color: var(--fg); }
/* Pressed, an icon on its own is a circle, as hovered -- its buttons, a ⋮
   menu's and the ☰ that opens the app's menu -- with a ripple in it. */
.icon-button:active, .actions-menu > summary:active, .sidebar-toggle:active { background: var(--border); }

/* The ripple, as Material has one: a circle in the colour of what is pressed,
   faint, growing from the finger -- from the middle of an icon on its own --
   and fading. app.js puts it in on a press and takes it out once it has
   played; the press itself is not held up for it. What ripples keeps it
   within its own edges, and wants no flash of the browser's laid over it,
   which a phone draws square whatever the shape. Of no weight, so anything
   placed or clipped otherwise stays so. Not a row's name that is a button
   (button.row-name), which is drawn as a link and answers as one; a tab
   is a link drawn as a button would be, and ripples. */
:where(button:not(.row-name), .button, .icon-button, .menu-dropdown > summary, .menu-panel a, .level-tab > a, .sidebar-toggle, .setting-chevron, .ad-preview-button) {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  transform: scale(0);
  pointer-events: none;
  animation: ripple 450ms ease-out forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.icon-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-button svg { width: 1.25rem; height: 1.25rem; }
/* Only a button that takes something away warns under the pointer; the
   rest of a row's buttons -- edit, clone -- are hovered as any other. */
.icon-button.remove:hover { color: #d33; }

.login { max-width: 20rem; margin: 6rem auto; padding: 1rem; text-align: center; }
.login h1 { font-size: var(--text-2xl); }
/* A card dialog holds both kinds of card's questions, and shows the ones
   belonging to the kind that is chosen. The browser decides it, so choosing a
   kind costs nothing and asks nobody. */
.card-form .for-kpi, .card-form .for-graph, .card-form .for-contribution-cost, .card-form .for-favorite, .card-form .for-data-point, .card-form .for-forecast { display: none; }
.card-form:has(#field-kind option[value="kpi"]:checked) .for-kpi,
.card-form:has(#field-kind option[value="graph"]:checked) .for-graph,
.card-form:has(#field-kind option[value="contribution-cost"]:checked) .for-contribution-cost,
.card-form:has(#field-kind option[value="favorite"]:checked) .for-favorite,
.card-form:has(#field-kind option[value="data-point"]:checked) .for-data-point,
.card-form:has(#field-kind option[value="forecast"]:checked) .for-forecast { display: revert; }
/* A dialog for a card that is being changed has one kind's questions and no
   choice above them, so they are simply there. */
.card-form:not(:has(.card-kinds)) .for-kpi,
.card-form:not(:has(.card-kinds)) .for-graph,
.card-form:not(:has(.card-kinds)) .for-contribution-cost,
.card-form:not(:has(.card-kinds)) .for-favorite,
.card-form:not(:has(.card-kinds)) .for-data-point,
.card-form:not(:has(.card-kinds)) .for-forecast { display: revert; }
/* The card dialog: heading and buttons where they are, what is asked between
   them scrolling; no taller than it needs to be. */
.dialog-picker.dialog-card { width: min(32rem, calc(100vw - 2rem)); height: min(44rem, calc(100vh - 4rem)); }
.dialog-card .picker-list { padding-top: 1rem; }
/* A card's labels: a box and its name a row each, as the platforms' are, and
   under them whether a campaign is to have all of them or any. */
.label-boxes { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.3rem 0.5rem; padding: 0.15rem 0; }
.label-boxes input { width: auto; margin: 0; }
.field .label-boxes label { margin: 0; font-weight: normal; cursor: pointer; }
.label-match { display: flex; margin-top: 0.5rem; gap: 0.25rem 1.25rem; flex-wrap: wrap; }
/* A stale data point's card: the badge is the line, from its start. */
.card-period .badge { margin-left: 0; }

/* Moving from one page to another fades the one into the other, rather than
   blanking and redrawing: every page is a full load, and the browser cross-
   fades the two. The menu down the side is the same on both, so it stays
   where it is and only what is beside it fades. Quick, and not at all for
   someone who has asked for less motion. Where a browser does not do it, the
   page simply changes, as before. */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 150ms; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

/* Google's own button: their mark, on white, with the word beside it. Their
   guidelines are particular about it, and the app's blue behind the mark would
   be neither their button nor ours. Dark mode has a dark variant of its own. */
.button.google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  background: var(--google-bg);
  color: var(--google-fg);
  border-color: var(--google-border);
}
.button.google svg { width: 1.25rem; height: 1.25rem; }

/* The two ways in, one under the other, with the second offered more quietly
   than the first. */
.login .form { margin-top: 1rem; text-align: left; }
.login .form button { width: 100%; }
.login .or { position: relative; margin: 1.25rem 0 0; font-size: var(--text-sm); }
.login .or::before,
.login .or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 1.5rem);
  border-top: 1px solid var(--border);
}
.login .or::before { left: 0; }
.login .or::after { right: 0; }
/* A code is read off a screen and typed back, so it is set wide and plain. */
.code-field {
  font-size: var(--text-xl);
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
}
/* A button that is really a way back, not a thing to do. */
button.link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* App layout: fixed left menu, content to the right. Stacks on narrow screens. */

.app {
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: 100vh;
}
/* The page reaches the screen's edges (viewport-fit=cover in the layout), so
   a phone on its side has its camera's cut-out and rounded corners over the
   page's sides: what the page holds keeps clear of them (--safe-left), its
   colour going on under them. */
.app, .takeover { padding-inline: var(--safe-left) var(--safe-right); }

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  /* Raised beside the page, as a menu is: set off by its colour, without a
     line. */
  background: var(--bg);
  /* The page scrolls; the menu beside it stays where it is. A screen tall
     rather than as tall as the page, so the user at the foot of it is at the
     foot of the window and not somewhere below a long table. It scrolls on its
     own if it is ever taller than the window. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
  /* A dialog, open, standing in the column as a box would: none of the
     browser's placing, border or colours for one. */
  position: static;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}
/* Its ✕, which only the drawer it is on a phone has. */
.sidebar-close { display: none; margin: 0; }

/* The bar the menu folds up into, which only a narrow screen shows. */
.sidebar-bar { display: none; }
.hamburger { display: flex; }
.hamburger svg { width: 1.5rem; height: 1.5rem; }

/* The logo, and beside it the button that folds the menu down to its icons. */
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0 0 0.5rem;
}
.brand-full svg { display: block; width: 6rem; height: auto; color: var(--accent); }
.brand-mark { display: none; }
.brand-mark svg { display: block; width: 1.75rem; height: 1.75rem; color: var(--accent); }
.sidebar-collapse { margin: 0; }
.login h1 svg { display: block; width: 8rem; height: auto; margin: 0 auto 0.5rem; color: var(--accent); }

.content { padding: 1.5rem 2rem var(--page-foot, calc(1.5rem + env(safe-area-inset-bottom, 0px))); min-width: 0; }
/* Headings on the type scale (--text-*): 28 / 20 / 16 / 14 px, body text 16.
   Set here rather than left to the browser's em defaults, which made an h2
   (1.5em) as big as the page's h1. On a phone the bar at the top names the
   section and the page's h1 is left to screen readers; a takeover's title
   has its own size, in its bar. */
.content h1, .api-docs h1 { margin: 0 0 1rem; font-size: var(--text-3xl); }
/* Semibold rather than the browser's bold: in system-ui (SF Pro) it reads as a
   heading without weighing the page down. */
h1, h2, h3, h4, h5, h6 { font-weight: 600; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-base); }
h4 { font-size: var(--text-sm); }

.menu { list-style: none; margin: 0; padding: 0; }
.menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.menu-icon { display: flex; flex: none; }
.menu-icon svg { width: 1.25rem; height: 1.25rem; }
.menu a:hover { background: var(--row-hover); }
.menu a.active { background: var(--nav-active); color: var(--accent); font-weight: 600; }
/* How many things on the dashboard are to be done: a number at the end of its
   line, or on its icon where the menu is folded. */
.menu a { position: relative; }
.menu-count {
  flex: none; margin-left: auto; min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem;
  border-radius: 999px; background: var(--attention-dot); color: #3a2c00;
  font-size: var(--text-xs); font-weight: 700; line-height: 1.1rem; text-align: center;
}

.account {
  margin-top: auto;
  padding: 0 0.5rem;
  font-size: var(--text-sm);
}
.field p { margin: 0; }
/* A line under a field saying what may go in it. */
.field-hint { margin: -0.75rem 0 1rem; }
/* Under a list rather than a field: apart from it, not drawn up to it. */
.text-list + .field-hint { margin-top: 0.75rem; }
/* Under a row's buttons: the shapes its pictures take, said whatever is chosen. */
.setting-actions + .field-hint { margin: 0.75rem 0 0; }
/* A budget a day or for the whole flight: the fields of the one chosen. */
.budget-form:has(.budget-kinds) .lifetime-only,
.budget-form:has(.budget-kinds input[value="lifetime"]:checked) .daily-only { display: none; }
.budget-form:has(.budget-kinds input[value="lifetime"]:checked) .lifetime-only { display: block; }
/* A collection's button text, asked for only while a collection is chosen. */
.format-form .collection-only { display: none; }
.format-form:has(option[value="collection"]:checked) .collection-only { display: block; }

.team-picker { position: relative; }
.team-picker summary {
  list-style: none;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-picker summary::-webkit-details-marker { display: none; }
/* Open, its name and arrow in the accent, on its own colour: lit as an open
   menu's button is, its tint looked too like the list under it. Not ringed
   either, while the pointer opened it -- the ring is the keyboard's. A test. */
.team-picker[open] summary { color: var(--accent); }
.team-picker[open] summary::after { background: var(--accent); }
/* Back from a menu the pointer opened, shut with Escape: focused, so the
   keyboard can go on from it, but not ringed -- see app.js. Opened again by
   a click as well: the browser takes Escape for the keyboard, and would ring
   it. A key pressed on it takes the quiet away, and the ring is back. */
summary[data-quiet-focus]:focus-visible { outline: none; }
.team-picker ul {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  margin: 0.25rem 0 0;
  /* Somebody in twenty teams gets a list longer than the window, and the menu
     it hangs in scrolls rather than spills. */
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.25rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--raised-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
}
.team-picker a, .team-picker button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.team-picker a:hover, .team-picker button:hover { background: var(--row-hover); }
/* The team one is in, as a chosen filter is: the tick before it, and the
   colour of what is chosen behind it. */
.team-picker a.active { background: var(--nav-active); color: var(--accent); font-weight: 500; }
.team-picker .check { display: flex; flex: none; width: 1rem; }
.team-picker .check svg { width: 1rem; height: 1rem; }
/* Making a team is not switching to one, so it sits under a line. */
.team-picker .new-team {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}
/* Its plus at the start, the words beside it. */
.team-picker .new-team svg { flex: none; width: 1.25rem; height: 1.25rem; margin-left: -0.125rem; }

@media (max-width: 40rem), (max-height: 30rem) {
  /* Stacked, the two become rows of a grid that is at least a screen tall, and
     rows share the height left over. The menu is to be as tall as what it holds
     -- a bar, folded up -- and the page is to have the rest. */
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  /* Stacked, the menu is a bar above the page rather than a column beside it,
     so it is as tall as what it holds and scrolls away with everything else. */
  .sidebar {
    padding: 0.5rem 1rem;
    /* The bar is the page's own top, in its colour; the drawer it opens
       keeps the menu's. */
    background: none;
    position: static;
    height: auto;
    overflow: visible;
  }
  .content { padding: 1rem 1rem var(--page-foot, calc(1rem + env(safe-area-inset-bottom, 0px))); }

  /* The menu stands on its own screen here, so it folds up into a bar saying
     which page one is on, and the page starts under it: the ☰ that opens it,
     a circle to tap, and beside it the page's name, to be read: a bar
     --bar-height tall, the ☰ where it would be without its circle. */
  .sidebar-bar { display: flex; align-items: center; min-height: var(--bar-height); margin: -0.5rem 0; }
  .sidebar-toggle {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--bar-button);
    height: var(--bar-button);
    margin-left: calc(var(--bar-edge) - 1rem);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  /* The words 72px from the edge, as Material has a top bar's title after
     its icon at 16px -- and as the period menu and a dialog have theirs. */
  .sidebar-title { min-width: 0; margin-left: var(--bar-title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  /* Folded unless it has been opened, and then a drawer from the left edge
     over the page, as Material's navigation drawer is: as tall as the screen,
     as wide as its longest name allows, and leaving a strip of the page in
     sight to tap to close it. Folded is said by the stylesheet rather than by
     a script once it has run, as a menu that stands for a moment and is then
     taken away moves the whole page under whoever is reading it. It slides
     in, and out again where the browser can keep it on top while it does. */
  .sidebar-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(20rem, calc(100vw - 3.5rem));
    height: auto;
    padding: calc(var(--bar-pad) + env(safe-area-inset-top, 0px)) 1rem calc(2rem + env(safe-area-inset-bottom, 0px)) calc(1rem + var(--safe-left));
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
    translate: -100% 0;
  }
  /* It slides in as it opens, and out as it goes ([data-closing], below),
     but never otherwise: folded is simply not there. Given to the folded
     menu, the slide also played as a page loaded -- an iPhone's home-screen
     app lays a page out wide for a moment, and the menu standing in its
     column then slid away across the page as the phone's width took over. */
  .sidebar-nav:modal {
    display: flex;
    translate: 0 0;
    transition: translate 200ms cubic-bezier(0, 0, 0.2, 1), overlay 200ms allow-discrete, display 200ms allow-discrete;
  }
  /* Focused itself as it opens -- see app.js -- which needs no ring. */
  .sidebar-nav:focus { outline: none; }
  @starting-style { .sidebar-nav:modal { translate: -100% 0; } }
  .sidebar-nav::backdrop {
    background: rgb(0 0 0 / 0.4);
    transition: background-color 200ms cubic-bezier(0, 0, 0.2, 1), overlay 200ms allow-discrete, display 200ms allow-discrete;
  }
  @starting-style { .sidebar-nav:modal::backdrop { background-color: rgb(0 0 0 / 0); } }
  /* Going, the drawer slides out first and the page it covered lightens
     after, quickly -- speeding up as they leave, where they slowed down as
     they came -- while the drawer is still open: app.js closes it once
     both have played, which a browser that cannot keep a closed dialog on
     top for its last moments plays as well. */
  .sidebar-nav[data-closing] { translate: -100% 0; transition: translate 200ms cubic-bezier(0.4, 0, 1, 1); }
  .sidebar-nav[data-closing]::backdrop { background-color: rgb(0 0 0 / 0); transition: background-color 100ms cubic-bezier(0.4, 0, 1, 1) 200ms; }
  /* Closed, it stays light: Chrome keeps a closed dialog's backdrop on top a
     moment longer, which would darken again on its way out. */
  .sidebar-nav:not(:modal)::backdrop { background-color: rgb(0 0 0 / 0); }
  @media (prefers-reduced-motion: reduce) {
    .sidebar-nav, .sidebar-nav:modal, .sidebar-nav::backdrop { transition: none; }
  }
  /* The ✕ alone at its top, where the ☰ was, and the name under whoever is
     signed in at its foot, as the old app's drawer has it: the logo's row
     is taken apart and its two put each in its place. */
  .sidebar-nav .brand { display: contents; }
  .sidebar-close { display: block; order: -1; align-self: flex-start; }
  .sidebar-close .icon-button { width: var(--bar-button); height: var(--bar-button); margin-left: calc(var(--bar-edge) - 1rem); color: var(--fg); }
  .sidebar-close .icon-button svg { width: 1.5rem; height: 1.5rem; }
  .sidebar-nav .brand-full { order: 1; margin-top: 1rem; margin-bottom: 1rem; padding: 0 0.5rem; }
  /* Tapped with a finger here, each page's row is 44px tall, the touch
     target Apple asks for, rather than the 36px a pointer is fine with. */
  .sidebar-nav .menu a { min-height: 2.75rem; }
}

.user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  min-width: 0;
}
.user span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .user { display: inline-flex; margin: 0; vertical-align: middle; }

a.user {
  margin: 0 -0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
a.user:hover { background: var(--row-hover); }
a.user.active { background: var(--nav-active); color: var(--accent); font-weight: 600; }

.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Who the user is, on the profile's first tab: their picture, and under it
   their name, email and phone to read, each with a pencil opening the dialog
   that changes it. One column on every screen. */
/* The picture a little further from the tabs than a heading would be: a
   heading's line has room above its letters, and the picture has none. */
.profile-details { display: grid; justify-items: start; gap: 1.25rem; margin-top: 1.5rem; }
.avatar.profile-picture { width: 5rem; height: 5rem; font-size: var(--text-xl); }
.profile-facts { display: grid; gap: 0.75rem; margin: 0; min-width: 0; }
.profile-facts dt { color: var(--muted); font-size: var(--text-sm); }
.profile-facts dd { display: flex; align-items: center; gap: 0.25rem; margin: 0.15rem 0 0; overflow-wrap: anywhere; }
/* The pencil after each detail, kept from making its line taller: a
   person's on the profile, a feed's under its name. */
:is(.profile-facts, .feed-fact) .icon-button { flex: none; margin-block: -0.375rem; }
:is(.profile-facts, .feed-fact) .icon-button svg { width: 1.125rem; height: 1.125rem; }
/* Where there is no phone number, a small button to add one in its place. */
button.add-phone { margin-top: 0.25rem; padding: 0.25rem 0.75rem; font-size: var(--text-sm); }
/* Signing out this device, under a line apart from the details above it,
   the other places one is signed in a link away under it. */
.this-session { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.other-sessions { margin: 0.75rem 0 0; font-size: var(--text-sm); }

.form { max-width: 28rem; }
.form h2 { margin-top: 0; }
/* One form under another on the same page: the second is a different question
   and stands apart from the first rather than running on from it. */
.form + .form { margin-top: 2.5rem; }

.field { margin-bottom: 1rem; }
.field label, .field .label { display: block; margin-bottom: 0.25rem; font-size: var(--text-sm); font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
}
.field input:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #d33; }
/* A textarea as tall as what is in it, from a few lines to where it scrolls,
   rather than a corner to drag: the lines are the thing being counted, and
   all of them should be in view. Where field-sizing is not known the rows
   the server gives it decide. */
.field textarea {
  display: block;
  resize: none;
  line-height: 1.5;
  field-sizing: content;
  min-height: calc(8lh + 1rem + 2px);
  max-height: calc(15lh + 1rem + 2px);
}
.field .error { margin: 0.25rem 0 0; font-size: var(--text-sm); }

.actions { display: flex; align-items: center; gap: 1rem; }
.saved { color: var(--muted); font-size: var(--text-sm); }
/* Team settings' email notifications: a section of their own under the
   members, as far from them as one list is from the next, each kind a switch. */
.notifications { margin-top: 2.5rem; }
.switches { list-style: none; margin: 0; padding: 0; }
.switches label { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0; cursor: pointer; }
/* A tick box drawn as the app's switches are: a track, and a knob that moves
   across it as it is turned on. Still a tick box, so a form sends it as one. */
input.switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 1.25rem;
  margin: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
input.switch::before {
  content: "";
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: transform 0.15s;
}
input.switch:checked { background: var(--accent); }
input.switch:checked::before { transform: translateX(1rem); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.switch:disabled { cursor: default; background: var(--subtle); box-shadow: inset 0 0 0 1px var(--border); }
input.switch:disabled::before { background: var(--border); box-shadow: none; }
/* A row's name that opens a dialog rather than a page is a button, drawn as
   the link a name that leads to a page is: the name alone answers the
   pointer, as it does on Feeds and Keywords, and the row does not. */
button.row-name { padding: 0; border: 0; background: none; text-align: left; font: inherit; font-weight: 600; cursor: pointer; }

button.secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

/* A button that has been pressed and is waiting. app.js puts the class on, half
   a second after the press rather than at once: an answer that comes back in a
   moment would otherwise flash a spinner and take it away again.

   The icon steps aside for the spinner rather than sitting beside it: a button
   that grew while it worked would move the buttons next to it. One without an
   icon gets the spinner in front of its word, which is the same thing. */
button.is-busy, .button.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  /* Not `disabled`, which would grey the button out and, on a plain submit,
     drop the name and value it carries. This only stops a second press. */
  pointer-events: none;
}
button.is-busy > svg, .button.is-busy > svg { display: none; }
/* Hidden stays hidden, busy or not: is-busy's display is later than [hidden]'s. */
button.is-busy[hidden] { display: none; }
button.is-busy::before, .button.is-busy::before, .installed-tools .is-reloading::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(1turn); }
}
/* A dialog on its way: its name, and a spinner where what it holds will be. */
.dialog-loading .loading { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0 1rem; color: var(--muted); }
.spinner {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
/* Something that turns for no reason should turn slowly, or not at all. */
@media (prefers-reduced-motion: reduce) {
  button.is-busy::before, .button.is-busy::before, .installed-tools .is-reloading::before, .spinner {
    animation-duration: 2.4s;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A network's mark before a name, where a row's own column has to say which
   network it came from. */
.row-mark { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.row-mark svg { flex: none; width: 0.9rem; height: 0.9rem; }
/* The mark in a box of its own where it alone carries the network's name. */
.row-mark-icon { display: flex; flex: none; }

.table-section { margin-top: 2.5rem; }
/* A page that takes over the window: no menu, one thing to do, and a cross to
   leave by. */
.takeover {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}
.takeover-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* Less than its 0.75rem and 1.5rem by the room the 44px squares below keep
     round their icons, so the bar is as tall as it was and the ✕ where it
     was. */
  padding: 0.375rem 0.875rem;
  background: var(--bg);
}
/* No line under it: once the page is scrolled under it, it is raised, as a
   full-screen dialog's bar is -- see bar-raised. */
@supports (animation-timeline: scroll()) {
  .takeover-bar {
    animation: bar-raised linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 1rem;
  }
}
/* The bar's ✕, arrows, Rename and ⋮ as big as the menu's ☰ and the page's
   ⋮ in the app's own bar: 24px, each in a 44px square to tap or click. */
.takeover-bar .icon-button,
.takeover-more .actions-menu > summary { width: 2.75rem; height: 2.75rem; }
.takeover-bar .icon-button svg,
.takeover-more .actions-menu > summary svg { width: 1.5rem; height: 1.5rem; }
/* The way through the campaigns list, between the cross and the name: the
   arrows side by side, their squares' room between them. */
.campaign-steps { display: flex; flex: none; align-items: center; gap: 0; }
.campaign-steps .small { margin-left: 0.25rem; white-space: nowrap; }
/* The count is the way to the list: underlined faintly, as a link that is
   not the page's own business, plainly where it is pointed at. */
.campaign-steps a.small { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.campaign-steps a.small:hover, .campaign-steps a.small:focus-visible { text-decoration-color: currentColor; }
/* The badges go under a name too long to leave room for them, and a name with
   nowhere to break -- Search_Spanien_[city]_Broad_Nobrand -- breaks anyway
   rather than push the page wider than the window. */
/* Centred on the bar's line rather than on the words' baseline: the 44px
   square of Rename beside the name would otherwise set the baseline at its
   foot, and push the name down below the bar's other buttons. */
.takeover-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; min-width: 0; }
.takeover-title h1 { min-width: 0; margin: 0; font-size: var(--text-xl); overflow-wrap: anywhere; }
.takeover-title .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a narrow screen the bar is one line. The name is cut short where it runs
   out of room -- a feed named by its address would otherwise fill the bar
   four lines deep -- with Rename beside it rather than under it, and the
   page's actions in a ⋮ menu at the end, where they would otherwise leave the
   name a word or two. */
.takeover-more { display: none; margin: 0; }
@media (max-width: 40rem), (max-height: 30rem) {
  .takeover-bar { gap: 0.5rem 0.75rem; padding: 0.6rem 1rem; }
  .takeover-title { flex: 1 1 0; flex-wrap: nowrap; align-items: center; }
  .takeover-title > * { flex: none; }
  .takeover-title h1, .takeover-title .muted { flex: 0 1 auto; min-width: 0; }
  .takeover-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
  /* The name as the app's bar has a page's and a full-screen dialog its
     title: 16px and semibold, 72px from the screen's edge -- the bar's own
     gap and this after the ✕ -- so going from a list into one of its rows
     changes what the bar says and not how. */
  .takeover-title { margin-left: calc(var(--bar-title) - 0.25rem); }
  .takeover-title h1 { font-size: var(--text-base); font-weight: 600; line-height: 1.25; }
  /* The arrows alone: the name needs the room more than the count. */
  .campaign-steps .small { display: none; }
  /* A page's buttons and Rename go into its ⋮ menu where it has one; an
     action marked to be kept stays. */
  .takeover-bar:has(.takeover-more) > .takeover-action:not(.takeover-keep),
  .takeover-bar:has(.takeover-more) .takeover-title > .icon-button { display: none; }
  .takeover-more { display: block; flex: none; margin-left: auto; }
  /* The squares' room round their icons stands in for the gaps between
     them, and at the bar's ends lets the ✕ sit where the menu's ☰ does in
     the app's own bar, so the name keeps what room it can. */
  .takeover-bar { gap: 0.5rem 0.25rem; padding: var(--bar-pad) var(--bar-edge); }
  .takeover-bar .icon-button,
  .takeover-more .actions-menu > summary { width: var(--bar-button); height: var(--bar-button); }
  /* Fixed rather than stuck, so it stays put as iOS pulls the page past its
     top, where a stuck bar was pulled down with it; the page starts under it,
     by its height. */
  .takeover-bar {
    position: fixed; top: 0; left: 0; right: 0;
    padding-top: calc(var(--bar-pad) + env(safe-area-inset-top, 0px));
    padding-left: calc(var(--bar-edge) + var(--safe-left));
    padding-right: calc(var(--bar-edge) + var(--safe-right));
  }
  .takeover { padding-top: calc(var(--bar-height) + env(safe-area-inset-top, 0px)); }
  /* A campaign's bar scrolls away with the page here, leaving the screen to
     the campaign: it is read top to bottom, and the ✕ and the arrows are
     wanted at its top, where one starts. Never raised, as nothing goes under
     it. */
  .takeover-bar.campaign-bar { position: static; animation: none; }
  /* In the page, it has the page's room for a cut-out already. */
  .takeover-bar.campaign-bar { padding-left: var(--bar-edge); padding-right: var(--bar-edge); }
  .takeover:has(> .campaign-bar) { padding-top: 0; }
}
/* Where a negative keyword list came from, over its search. */
.list-source { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
/* On a phone the account's name has a line of its own, first, and the
   network's pill and the badges go under it, rather than the three squeezed
   onto one line and the name broken over two. */
@media (max-width: 40rem), (max-height: 30rem) {
  .list-source { flex-wrap: wrap; }
  .list-source > .list-source-account { order: -1; flex-basis: 100%; }
}
/* The way out sits first and the name beside it; a page with an action of its
   own puts that at the far end. */
.takeover-action { margin-left: auto; }
.takeover-actions { display: flex; align-items: center; gap: 0.5rem; }
.takeover-actions button svg { width: 1rem; height: 1rem; }
.takeover-actions button { display: inline-flex; align-items: center; gap: 0.35rem; }
.takeover-body { padding: 1.5rem 1.5rem var(--page-foot, calc(1.5rem + env(safe-area-inset-bottom, 0px))); }
/* A save draws a campaign's settings again in place. Scroll anchoring would
   keep the window on the element that had focus -- the Save button, gone with
   its row shut -- and move it far down; without it the window stays put. */
#campaign-settings { overflow-anchor: none; }
/* On a phone the top of a campaign's page -- what it is, its ad -- fills
   the width, edge to edge, and starts right under the bar rather than under
   a dark strip of the page's own, the first one's line given up to the
   bar's. What is under it -- what needs attention, the boxes of settings --
   are cards as on a wide screen, round-cornered with their own edges, in a
   narrower margin that leaves their rows most of the width; the headings
   over them in line with them. */
@media (max-width: 40rem), (max-height: 30rem) {
  #campaign-settings { padding-inline: 0; padding-top: 0; }
  #campaign-settings > :not(.campaign-overview) { margin-inline: 0.75rem; }
  #campaign-settings .overview-facts,
  #campaign-settings .overview-preview { border: 0; border-radius: 0; }
  /* The lines over and under what it is as wide as what is in it, not the
     screen: drawn in its padding's room, as backgrounds. */
  #campaign-settings .overview-facts {
    --facts-line: linear-gradient(var(--border), var(--border)) center / calc(100% - 2.5rem) 1px no-repeat;
    background: var(--facts-line), var(--facts-line), var(--bg);
    background-position: center top, center bottom;
  }
  /* The first under the bar gives its line over it up to the bar's. */
  #campaign-settings > .campaign-overview:first-child .overview-facts { background: var(--facts-line), var(--bg); background-position: center bottom; }
}
/* A row the page is loaded at -- back from the picker -- clear of the bar that
   stays at the top. */
#campaign-settings details.setting { scroll-margin-top: 5rem; }
/* What is said of a feed under its name -- where its products come from,
   how many, what tells them apart -- a part each, one over the next, written
   as the profile writes a person's details: the name over what it is, close
   under it, and a button beside kept from making its line taller. */
.feed-meta { display: grid; justify-items: start; gap: 0.75rem; margin: 0 0 1.5rem; min-width: 0; }
/* A part no wider than the page, so a long source cuts short with an
   ellipsis rather than widening it. */
.feed-fact { max-width: 100%; min-width: 0; }
.feed-fact .meta-url { min-width: 0; }
.feed-fact .setting-part { margin: 0; }
.feed-fact .setting-value { margin: 0.15rem 0 0; overflow-wrap: anywhere; }
.feed-fact form { display: contents; }
.takeover-body > .table-section:first-child,
.feed-meta + .table-section,
.level-tabs + .table-section { margin-top: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  /* On a narrow screen the buttons drop under the heading rather than pressing
     it into one word per line. */
  flex-wrap: wrap;
}
.section-header h2 { margin: 0; }
/* A section's buttons keep together at the right, however many there are, and
   wrap as a group before any of them breaks its own label in half. */
.section-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
/* A button says what it does on one line: "Upload file" over two lines is two
   words to read rather than one thing to press. */
.section-actions button, .section-actions .button,
.page-actions button, .page-actions .button { white-space: nowrap; }
.buttons { display: flex; gap: 0.5rem; }
/* A button in the page's heading may carry a mark beside its word, which sits
   on the word's line and at the word's size. */
.page-actions .button, .page-actions button:has(> svg) { display: inline-flex; align-items: center; gap: 0.4rem; }
.page-actions .button svg, .page-actions button > svg { width: 1rem; height: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { padding: 0.5rem 0.75rem 0.5rem 0; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--muted); }
td.actions-cell { text-align: right; padding-right: 0; }
td.actions-cell form { display: inline-block; }

.badge {
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--border);
  font-size: var(--text-xs);
  white-space: nowrap;
}

@media (max-width: 40rem), (max-height: 30rem) {
  .sessions th:nth-child(3), .sessions td:nth-child(3) { display: none; }
}

.small { font-size: var(--text-xs); }

.button.secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.connect { margin-bottom: 1.5rem; }


table.accounts td { vertical-align: top; }
.status-warning { color: #b7791f; }
.status-error { color: #d33; font-weight: 600; }

/* Choosing the accounts to connect: a wide picker, so an account's name and
   what it is sit on one line. As tall as its accounts need past a wide
   dialog's least, so a few are not a window-high empty dialog; many scroll.
   fit-content is the browser's own height for a modal dialog, which auto
   would replace with the whole window. */
.dialog-picker.dialog-accounts { height: fit-content; max-height: min(56rem, calc(100vh - 4rem)); }
/* Moving a card to another dashboard: each dashboard a choice, in bold, and
   its sections indented under it where it has more than one. */
.move-to { margin: 0 0 1rem; padding: 0; border: 0; }
.move-to ul { list-style: none; margin: 0; padding: 0; }
.move-to ul ul { padding-left: 1.75rem; }
.move-to label { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.35rem 0; cursor: pointer; }
.move-to > ul > li > label > span:first-of-type { font-weight: 600; }
.move-to label .muted { font-size: var(--text-sm); }
.move-to input { flex: none; margin: 0; }
.choices { list-style: none; margin: 0; padding: 0; }
.choices li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.choices li:last-child { border-bottom: 0; }
.choices input { margin-top: 0.3rem; }
.choices label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; cursor: pointer; }
.choices label > span:first-child { font-weight: 600; }

.dialog {
  width: min(26rem, calc(100vw - 2rem));
  /* A form with many fields scrolls inside the dialog rather than off-screen. */
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem;
  border: 1px solid var(--raised-edge);
  border-radius: calc(var(--radius) * 2);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-overlay);
}
/* A dialog for something that is looked at rather than filled in. Tall
   enough from the start to look wide: one waiting for what it shows is not
   a strip that grows into a dialog once that comes. */
.dialog-wide { width: min(64rem, calc(100vw - 2rem)); min-height: min(28rem, calc(100vh - 4rem)); }
.dialog-filters { width: min(40rem, calc(100vw - 2rem)); }
.dialog-platforms { width: min(40rem, calc(100vw - 2rem)); }
/* Sync now's dialog: what a send would change, then the send followed. Its
   heading and its buttons stay where they are and what is between them
   scrolls, so the button that sends is never at the far end of a long list.
   Only while it is open: a dialog shut is display: none, which this must not
   undo. */
/* As large as a picker, and laid out as one: what scrolls between a line
   under the heading and a line over the buttons. */
.dialog-sync { width: min(48rem, calc(100vw - 2rem)); height: min(56rem, calc(100vh - 4rem)); overflow: hidden; }
.dialog-sync[open] { display: flex; flex-direction: column; }
.dialog-sync .dialog-header { position: static; flex: none; }
.dialog-sync .sync-dialog { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dialog-sync .sync-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin-bottom: 1rem; padding: 1rem 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.dialog-sync .sync-footer { flex: none; }
.dialog-sync .sync-footer .buttons { margin: 0; }
.sync-dialog .sync-changes { margin: 0.5rem 0 1rem; padding-left: 1.25rem; }
.sync-dialog .sync-changes li { margin: 0.15rem 0; overflow-wrap: anywhere; }
.sync-dialog h3 { margin: 1rem 0 0.25rem; }
/* What a network said, as it wrote it: TikTok gives the reasons it may have
   refused something a line each, which run together as one otherwise. */
.network-said, .network-said li { white-space: pre-line; }
.sync-progress-heading { display: flex; align-items: center; gap: 0.5rem; }
.sync-progress-heading .waiting-dots span { width: 0.25rem; height: 0.25rem; }
.sync-dialog .sync-outcome-error { color: var(--bad-fg); }
/* Every change, one at a time: under what it is about, what goes struck
   through in red and what comes in green, each on a line of its own. */
.sync-details { margin: 0 0 1rem; }
.sync-details > summary { cursor: pointer; color: var(--accent); }
.sync-detail-list { margin-top: 0.5rem; font-size: var(--text-sm); }
.sync-detail-list h4 { margin: 0.75rem 0 0.2rem; overflow-wrap: anywhere; }
.sync-detail-list ul { margin: 0; padding-left: 1.25rem; }
.sync-detail-list li { margin: 0.15rem 0; overflow-wrap: anywhere; }
.sync-detail-list del, .sync-detail-list ins { display: block; margin-left: 0.75rem; text-decoration: none; }
.sync-detail-list del { color: var(--bad-fg); text-decoration: line-through; }
.sync-detail-list ins { color: var(--ok-fg); }
.sync-detail-list del::before { content: "− "; text-decoration: none; display: inline-block; }
.sync-detail-list ins::before { content: "+ "; }
/* The page under a dialog stays where it is: it cannot be used until the
   dialog is closed, and a wheel or a finger over a dialog with nothing more
   to scroll would otherwise move the page behind it. The scrollbar's room is
   kept, where a scrollbar takes room, so the page does not shift sideways as
   its scrollbar goes. Nor does it bounce: Safari on a phone pulls a page that
   cannot scroll past its edge all the same, where nothing says not to. */
html:has(#dialogs dialog[open], .app[data-menu="open"]) { overflow: hidden; overscroll-behavior: none; scrollbar-gutter: stable; }
/* Pinned where it stood under a dialog on a phone: see app.js. */
body.pinned { position: fixed; top: var(--pinned-at); left: 0; right: 0; }
.dialog::backdrop { background: rgb(0 0 0 / 0.4); }
/* A dialog fades in, rising a little, as it opens, and out as it closes; the
   page behind it darkens and lightens with it. A dialog taking the place of
   one on the screen (data-instant) is simply there. None of it for someone
   who has asked for less motion. */
.dialog {
  transition: opacity 150ms ease-out, translate 150ms ease-out,
    overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.dialog:not([open]) { opacity: 0; translate: 0 0.5rem; }
@starting-style { .dialog[open] { opacity: 0; translate: 0 0.5rem; } }
.dialog::backdrop { transition: background-color 150ms ease-out, overlay 150ms allow-discrete, display 150ms allow-discrete; }
.dialog:not([open])::backdrop { background-color: rgb(0 0 0 / 0); }
@starting-style { .dialog[open]::backdrop { background-color: rgb(0 0 0 / 0); } }
.dialog[data-instant], .dialog[data-instant]::backdrop { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .dialog, .dialog::backdrop { transition: none; }
}
/* A press on the page behind a dialog shakes it (data-shake, from app.js):
   the dialog wants an answer, or its close button. With less motion asked
   for, the dialog's edge lights up instead. Transform, so as not to fight the
   translate it opens with. */
@keyframes dialog-shake {
  20% { transform: translateX(-0.5rem); }
  40% { transform: translateX(0.5rem); }
  60% { transform: translateX(-0.3rem); }
  80% { transform: translateX(0.3rem); }
}
@keyframes dialog-ring { 50% { outline-color: var(--accent); } }
.dialog[data-shake] { animation: dialog-shake 300ms ease-in-out; }
@media (prefers-reduced-motion: reduce) {
  .dialog[data-shake] { outline: 2px solid transparent; animation: dialog-ring 400ms ease-in-out; }
}
.dialog-header {
  position: sticky;
  top: -1.25rem;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -1.25rem -1.25rem 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  background: var(--bg);
}
/* A title too long for its line wraps onto a second close under the first,
   as a heading's lines are, not spaced as a paragraph's; its lines evened
   out, rather than one word left alone on the last. */
.dialog-header h2 { margin: 0; line-height: 1.25; text-wrap: balance; }
/* A heading's subtitle, where it has one (views.Heading): a line of its own
   under the title, smaller, plain and greyed, so the title is the one read
   first. */
:is(.dialog-header h2, .menu-title) .subtitle {
  display: block;
  font-size: var(--text-sm);
  font-weight: normal;
  color: var(--muted);
}
/* Raised once what the dialog holds is scrolled under it, as a full-screen
   dialog's bar is on a phone (where it is told which list to follow). */
@supports (animation-timeline: scroll()) {
  .dialog-header {
    animation: bar-raised linear both;
    animation-timeline: scroll(nearest block);
    animation-range: 0 1rem;
  }
}
/* The ✕ in the title's colour, as a bar's ✕ and ☰ are, rather than grey,
   and as big: a 24px icon in a 44px circle. Drawn out past the header's
   room by the circle's more, so the header is no taller than it was and the
   ✕ where it was. */
.dialog-header .icon-button { width: 2.75rem; height: 2.75rem; margin: -0.375rem -0.25rem -0.375rem 0; color: var(--fg); }
.dialog-header .icon-button svg { width: 1.5rem; height: 1.5rem; }

/* Two columns where there is room for them, one on a phone. */
.platforms { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.platforms a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.platforms a:hover { border-color: var(--accent); background: var(--border); }

/* Toasts: bottom center, newest last. Each is a dialog shown as it arrives,
   which fades after four seconds -- an error after eight -- and is put away;
   a pointer over it holds it. Its ✕ shuts it at once. */
.toasts {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  pointer-events: none;
}
/* A popover, to be over a modal dialog (app.js): none of the browser's own
   drawing of one, which centres it in a box. */
.toasts[popover] {
  inset: auto auto calc(1.5rem + env(safe-area-inset-bottom, 0px)) 50%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
.toast {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.25);
  pointer-events: auto;
  /* Not where a dialog would be: in the column of toasts. */
  position: static;
  margin: 0;
  border: 0;
  max-width: none;
  animation: toast-in 0.2s ease-out, toast-out 0.2s ease-in 4s forwards;
}
.toast:not([open]) { display: none; }
.toast form { display: contents; }
/* Its way on -- Show -- as a toast's action is, in its words' colour. */
.toast-link { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 0.15em; white-space: nowrap; }
.toast:hover, .toast:focus-within { animation-play-state: paused; }
.toast-error { background: #c62828; color: white; animation-delay: 0s, 8s; }
.toast .icon-button { color: inherit; opacity: 0.7; }
.toast .icon-button:hover { opacity: 1; background: rgb(255 255 255 / 0.15); color: inherit; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(0.5rem); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(0.5rem); display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .toast { animation: toast-out 0s 4s forwards; }
  .toast-error { animation-delay: 8s; }
}

/* Tables scroll sideways rather than wrap. position: relative makes the scroller
   clip absolutely positioned content too, such as .visually-hidden headers,
   which would otherwise widen the page. */
/* A table sits in a frame, like the lists on the other pages, its header on
   the page's own colour under a line: grey is kept for what lies on top. */
.table-scroll {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-scroll th, .table-scroll td { white-space: nowrap; padding: 0.5rem 0.75rem; }
.table-scroll thead th { background: var(--bg); }
.table-scroll tbody tr:last-child td { border-bottom: 0; }
/* The row under a table saying what all of its rows come to: set apart by
   its line and its weight, and in place beside the sticky column as the
   header is. */
.table-scroll tfoot td, .table-scroll tfoot td:first-child {
  background: var(--bg); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0;
}
.table-scroll td.actions-cell { padding-right: 0.75rem; }
/* A column of tick boxes is as narrow as the box and the room either side of
   it -- room on the right too, so a name sliding under it on a phone does not
   run up against the box -- and exactly so in a .sticky-first table, where the
   name beside it sticks that far in. */
.table-scroll {
  --select-width: 2.5rem;
}
.table-scroll :is(th, td).select-column {
  box-sizing: border-box;
  width: var(--select-width);
  min-width: var(--select-width);
  max-width: var(--select-width);
}
/* A column of tick boxes stays in place while the rest scrolls, in any table
   and at any width: a row scrolled to has to be tickable where it is. */
.table-scroll .select-column {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
}
/* With .sticky-first the first column stays in place too -- the name, after
   the tick boxes where there are any -- where there is room for it to: on a
   phone the name would take half the screen and leave the numbers it is
   scrolled for a sliver, so there it scrolls with the rest and only the
   tick boxes stay. By width alone, not the phone's layout: a phone held
   sideways has room for the name beside the numbers. */
@media not all and (max-width: 40rem) {
  .sticky-first th:first-child, .sticky-first td:first-child,
  .sticky-first .select-column + * {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg);
  }
  .sticky-first .select-column + * { left: var(--select-width); }
}
/* The campaigns' row under the pointer is shaded, since a row runs wider
   than the eye follows and opens its campaign where its name is clicked.
   Opaque, so content scrolling under the sticky column stays hidden. Other
   tables are not: a row that cannot be clicked does not look as if it can. */
table.campaigns tbody tr:hover td { background: var(--row-hover); }
/* A table walked with the arrows (data-grid, app.js) shades the row the
   keyboard is in, as the pointer's is, to read across by. A cell reached by
   itself, a number, is ringed inside, where the box it scrolls in does not
   cut the ring off, and in grey: Enter does nothing there. The accent's ring
   is for what does something -- a name, a heading, a tick box, a badge --
   and those look as under the pointer too (.row-name, .name-link, th a,
   .name-more, .zone-button, .adjusted-icon). */
table[data-grid] tbody tr:has(:focus-visible) td { background: var(--row-hover); }
table[data-grid] :is(td, th):focus-visible { outline-color: var(--muted); outline-offset: -2px; }
/* A ticked row stands out as a ticked row of a list does, and the total row
   under them takes the same colour while it is of them alone. Every cell,
   the sticky name among them, which has a background of its own. */
.table-scroll tbody tr:has(.select-cell input:checked) td,
.table-scroll tfoot tr.selected td { background: var(--nav-active); }
/* A campaign's row gone to by its address -- Show in list -- found: lit up
   for a moment and fading, so it is not read as ticked, and an edge before
   it that stays while the address says it. */
.table-scroll tbody tr:target td { animation: row-found 2.5s ease-out; }
.table-scroll tbody tr:target td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
@keyframes row-found { from { background: var(--nav-active); } }
@media (prefers-reduced-motion: reduce) {
  .table-scroll tbody tr:target td { animation: none; }
}

/* Show an edge on the sticky column once the table is scrolled: on the
   last of the columns that stay, the tick boxes' where the name scrolls. */
@supports (animation-timeline: scroll()) {
  .table-scroll { scroll-timeline: --table-scroll x; }
  .table-scroll .select-column {
    animation: sticky-column-edge linear both;
    animation-timeline: --table-scroll;
    animation-range: 0 1rem;
  }
  @media not all and (max-width: 40rem) {
    .sticky-first .select-column { animation: none; }
    .sticky-first :is(th, td):first-child:not(.select-column),
    .sticky-first .select-column + * {
      animation: sticky-column-edge linear both;
      animation-timeline: --table-scroll;
      animation-range: 0 1rem;
    }
  }
  /* With the line a header or a total cell draws as a shadow of its own
     (--row-edge), which a box-shadow of the animation's would otherwise
     take the place of: the line under Name went once the table scrolled. */
  @keyframes sticky-column-edge {
    to { box-shadow: var(--row-edge, 0 0 transparent), inset -1px 0 0 var(--border), 8px 0 8px -8px rgb(0 0 0 / 0.3); }
  }
}

button.danger, .button.danger { background: #c62828; border-color: #c62828; color: white; }

.danger-zone {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e0a0a0;
  border-radius: var(--radius);
}
.danger-zone h2 { margin: 0 0 0.75rem; color: #c62828; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.danger-row p { margin: 0.25rem 0 0; }
/* The button as wide as its words, on one line: squeezed by the words
   beside it, "Delete team" broke in two and "Transfer" was cut short. */
.danger-row > :is(button, .button) { flex: none; white-space: nowrap; }
/* On a phone the words have the width, and the button goes under them, at
   their start. */
@media (max-width: 40rem), (max-height: 30rem) {
  .danger-row { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
.danger-row + .danger-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Transparent, as the buttons and fields are: the colour of what it sits on,
   white on a card and the page's own on the page. The arrow is drawn here
   rather than by the browser, which sets its own well in from the edge and
   will not be moved: the chevron the setting rows open with, near the right
   edge, in a grey that reads on either theme. */
select {
  /* As tall as a button beside it: the same padding, the same line. */
  padding: 0.5rem 2rem 0.5rem 0.5rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E") no-repeat right 0.6rem center / 0.9rem;
  color: inherit;
  font: inherit;
  appearance: none;
}
select[multiple] { padding-right: 0.5rem; background-image: none; }
.field select { width: 100%; }

/* A page header: the way back, the page's name, and a quiet line about it. */
/* A page title with its main action on the same line, at the far right. */
/* The heading and the page's buttons on a line, the buttons at its end; where
   the two do not fit -- a phone, a long name -- the buttons go onto a line of
   their own under it, still at the end, rather than off the edge. */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.page-header h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* A page's buttons drawn again in a ⋮ menu, for a phone, or its one button
   drawn again small for the bar. */
.page-more, .page-add, .page-icon { display: none; }
/* On a phone the menu's bar says the section's name: a heading that only
   says it again is left to screen readers. The page's buttons go into a ⋮
   menu at the end of that bar, where they leave the page itself to start
   with what is on it. */
@media (max-width: 40rem), (max-height: 30rem) {
  .app { position: relative; }
  .page-header .section-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .page-header:has(> .page-more) > .page-actions { display: none; }
  .page-header:has(> .section-heading) { margin-bottom: 0; }
  /* The page's ⋮ as big as the menu's ☰ across the bar from it, 24px, and a
     44px square to tap: the way to the page's actions on a phone. As far
     from the right edge as the ☰ is from the left, 16px, where a takeover's
     and a full-screen dialog's ⋮ are. */
  .page-more { display: block; position: absolute; top: calc(var(--bar-pad) - 0.025rem); right: var(--bar-edge); z-index: 6; }
  .page-more .actions-menu > summary { width: var(--bar-button); height: var(--bar-button); }
  .page-more .actions-menu > summary svg { width: 1.5rem; height: 1.5rem; }
  /* The page's name stops short of it, rather than running under it. */
  .app:has(.page-more) .sidebar-title { margin-right: calc(var(--bar-button) + 0.5rem); }
  /* The buttons, as a menu's lines rather than buttons. */
  .page-more .menu-panel { display: flex; flex-direction: column; }
  .page-more .menu-panel > :is(button, .button, a) {
    justify-content: flex-start;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    font-weight: normal;
    text-align: left;
    text-decoration: none;
  }
  .page-more .menu-panel > :is(button, .button, a):hover { background: var(--subtle); }
  /* The words alone: a button's icon says nothing a line of a menu does not. */
  .page-more .menu-panel svg { display: none; }
  /* A page whose one action adds something has it in the bar where another
     has its ⋮: words in the bar's own colour rather than a filled button,
     as quiet as the ☰ across from it, its middle where the ⋮'s is. */
  .page-header:has(> .page-add) > .page-actions { display: none; }
  .page-add { display: block; position: absolute; top: calc(var(--bar-pad) - 0.025rem + (var(--bar-button) - 2.25rem) / 2); right: 0.625rem; z-index: 6; }
  .page-add button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 2.25rem;
    padding: 0 0.625rem 0 0.375rem;
    border: 0;
    background: transparent;
    color: var(--fg);
    font-weight: 600;
    white-space: nowrap;
  }
  .page-add button:hover { background: var(--subtle); }
  .page-add button svg { width: 1.25rem; height: 1.25rem; }
  .app:has(.page-add) .sidebar-title { margin-right: 7rem; }
  /* A page whose one action is an icon of its own -- the dashboard's cog,
     to customise it -- has it in the bar where another has its ⋮, as big and
     as quiet, rather than a menu of one line. */
  .page-header:has(> .page-icon) > .page-actions { display: none; }
  .page-icon { display: block; position: absolute; top: calc(var(--bar-pad) - 0.025rem); right: var(--bar-edge); z-index: 6; }
  .page-icon .icon-button { width: var(--bar-button); height: var(--bar-button); }
  .page-icon .icon-button svg { width: 1.5rem; height: 1.5rem; }
  .app:has(.page-icon) .sidebar-title { margin-right: calc(var(--bar-button) + 0.5rem); }
}
/* The installed app's Reload and Share (views.installedTools): only where it
   runs from the home screen, with no browser bar to do either, and only on a
   phone, where the menu is a bar to put them in. At the bar's end, as big as
   the ☰ and in the grey of the page's own cog and ⋮, left of whichever of
   those it has; the page's name stops at them rather than at that. A page
   with words there instead ("+ New") has none of these. */
.installed-tools { display: none; }
@media (display-mode: standalone) and ((max-width: 40rem) or (max-height: 30rem)) {
  .installed-tools { display: flex; flex: none; margin-left: auto; margin-right: calc(-1 * var(--bar-inset) + 0.25rem); }
  .installed-tools .icon-button { width: var(--bar-button); height: var(--bar-button); }
  .installed-tools .icon-button svg { width: 1.5rem; height: 1.5rem; }
  .app:has(.page-more, .page-icon) .installed-tools { margin-right: calc(var(--bar-button) - var(--bar-inset) + 0.25rem); }
  .app:has(.installed-tools) .sidebar-title { margin-right: 0.25rem; }
  /* A campaign's bar has its own room at the ends. */
  .takeover-bar .installed-tools { margin-right: 0; }
}
/* Reload, while the page it asked for is on its way (app.js): its icon steps
   aside for the app's spinner, the ring drawn with a busy button's, and it
   cannot be tapped again, which would only start the load over. */
.installed-tools .is-reloading { pointer-events: none; }
.installed-tools .is-reloading svg { display: none; }
.installed-tools .is-reloading::before { width: 1.25rem; height: 1.25rem; }
/* An iPhone's share icon on an iPhone -- the one engine that knows
   -webkit-touch-callout -- and Android's everywhere else. */
.installed-tools .share-ios { display: none; }
@supports (-webkit-touch-callout: none) {
  .installed-tools .share-ios { display: block; }
  .installed-tools .share-android { display: none; }
}
.page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-left: auto; }

.meta-url {
  max-width: 32rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}
.meta-url:hover { color: var(--accent); }

.sync-error {
  margin: -1.5rem 0 1.5rem;
  font-size: var(--text-sm);
  color: #d33;
  overflow-wrap: anywhere;
}

table.items input, table.columns input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
  font: inherit;
  min-width: 12rem;
}
/* A menu keeps the arrow every select has; only its height is the table's. */
table.columns select { padding-top: 0.35rem; padding-bottom: 0.35rem; min-width: 12rem; }
table.columns input[aria-invalid="true"] { border-color: #d33; }
table.items input { width: 100%; min-width: 8rem; }
table.items td { vertical-align: middle; }

/* The empty-state row only shows while the table has no products. */
tbody tr.empty-row:not(:only-child) { display: none; }
tbody tr.empty-row td { border-bottom: 0; }
table.columns td { vertical-align: middle; }
/* The tick for a column in the product ID is a box, not a field. */
table.columns input[type="checkbox"] { min-width: 0; padding: 0; margin: 0; width: 1rem; height: 1rem; vertical-align: middle; }

/* How well the ticked columns tell the products apart, under them in the
   ID dialog. What is in it reads at a narrower width. */
.item-id { margin-top: 1.25rem; }
.item-id > * { max-width: 32rem; }
.item-id p { margin: 0 0 0.25rem; }
.item-id .ok { display: flex; align-items: center; gap: 0.4rem; color: var(--ok-fg); font-weight: 600; }
.item-id .ok svg { width: 1.1rem; height: 1.1rem; }
.item-id .feed-groups { margin: 0.25rem 0 0.5rem; }
table.feeds td { vertical-align: top; }

.item-rows td { max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }

th.number, td.number { text-align: right; font-variant-numeric: tabular-nums; }
/* A figure in a table is set in monospace, as the old app set it: every
   character as wide as a digit, the space between thousands too, so a column
   of them is compared at a glance. A touch smaller, as monospace runs large.
   Anywhere else a figure is in the page's own font: a dashboard card's number
   and a graph's totals stand alone, and the data points list is of different
   things, each read for itself rather than against the one above it. */
td[data-number], td [data-number] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
/* A share says it is one on every line, as the old app's did: 23.84%. */
[data-percent]::after { content: "%"; }
/* The activity table: one line an event, what it was there to open. */
/* In the frame the other lists have: under the bar, the header grey. */
.activity-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
table.activity { width: 100%; border-collapse: collapse; }
table.activity th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--text-sm); padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border); background: var(--subtle); }
table.activity td { vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
table.activity tbody tr:last-child td { border-bottom: 0; }
table.activity .activity-when { white-space: nowrap; color: var(--muted); }
table.activity .activity-subject { min-width: 10rem; }
table.activity .activity-name { display: inline-flex; align-items: baseline; gap: 0.4rem; }
/* What a line is about, where it can still be opened, is a name as a row's
   is: in the accent, underlined only under the pointer. */
.activity-name a { text-decoration: none; }
.activity-name a:hover { text-decoration: underline; }
table.activity .activity-icon { display: inline-flex; align-self: center; color: var(--muted); }
table.activity .activity-icon svg { flex: none; width: 0.9rem; height: 0.9rem; }
table.activity .activity-what { width: 55%; }
table.activity summary { cursor: pointer; list-style: none; }
table.activity summary::-webkit-details-marker { display: none; }
table.activity summary::after { content: " ▸"; color: var(--muted); }
table.activity details[open] > summary::after { content: " ▾"; }
.change-details { margin: 0.5rem 0 0; }
/* A value changed, whole: what differs marked, the rest as it is. */
.change-details .value-changes { list-style: none; padding-left: 0; }
.change-details .value { overflow-wrap: anywhere; }
.change-details del { background: var(--bad-bg); color: var(--bad-fg); text-decoration: none; border-radius: 2px; }
.change-details ins { background: var(--ok-bg); color: var(--ok-fg); text-decoration: none; border-radius: 2px; }
.change-details p { margin: 0 0 0.35rem; }
.change-details ul { margin: 0 0 0.35rem; padding-left: 1.25rem; }
table.activity .activity-type, table.activity .activity-user { white-space: nowrap; }
/* A feed's syncs one line stands for, opened: each at its time, what it
   changed beside it. */
.change-details .activity-runs { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.activity-runs li { display: flex; gap: 0.75rem; padding: 0.35rem 0; border-top: 1px solid var(--border); }
.activity-runs .activity-when { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-runs .change-details { margin-top: 0.35rem; }
/* On a phone each event is a block of its own: when and what it happened to
   on a line, then what, then which user. */
@media (max-width: 40rem), (max-height: 30rem) {
  table.activity thead { display: none; }
  table.activity tr { display: block; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
  table.activity tbody tr:last-child { border-bottom: 0; }
  table.activity td { display: inline; padding: 0; border: 0; }
  table.activity td + td::before { content: " · "; color: var(--muted); }
  table.activity td:empty { display: none; }
  table.activity .activity-what { display: block; width: auto; margin-top: 0.25rem; }
  table.activity .activity-what::before, table.activity .activity-user::before { content: none; }
  table.activity .activity-user { display: block; color: var(--muted); font-size: var(--text-sm); }
}
.change-details ul.error { color: var(--bad-fg); }
/* What a send sent: one call a line, what it said and what came back there
   to open. */
.sent-calls ol { margin: 1rem 0; padding-left: 2rem; }
.sent-call { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.sent-call-about { margin: 0 0 0.15rem; font-weight: 600; }
.sent-call-head { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: baseline; }
.sent-call-head code { font-size: var(--text-xs); overflow-wrap: anywhere; }
.sent-call summary { cursor: pointer; color: var(--muted); font-size: var(--text-sm); margin-top: 0.25rem; }
.sent-call pre { margin: 0.25rem 0 0; padding: 0.5rem; max-height: 30rem; overflow: auto; background: var(--subtle);
  border-radius: var(--radius); font-size: var(--text-xs); white-space: pre-wrap; overflow-wrap: anywhere; }
/* What the feed's sync measured of a picture, under it. */
.picture-meta { display: block; margin-top: 0.25rem; white-space: nowrap; }
.thumb {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 4px;
  background: var(--border);
}

/* Radio choices, and fields that depend on the chosen one. */
fieldset.choice { border: 0; margin: 0 0 1rem; padding: 0; }
/* Three short answers to one question sit on a line, where three lines of them
   would read as three questions. */
fieldset.choice.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
fieldset.choice.inline legend { flex-basis: 100%; }
fieldset.choice legend { padding: 0; margin-bottom: 0.25rem; font-size: var(--text-sm); font-weight: 600; }
label.radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-weight: normal;
  cursor: pointer;
}
/* Radio buttons keep their own size, unlike the form's text fields. */
label.radio input { width: auto; flex: none; margin: 0; }

/* Only ask for the URL when the products come from one, and only offer a
   template when they are added in relaxad. */
.url-field, .manual-field, .catalog-field { display: none; }
form:has(input[name="source"][value="url"]:checked) .url-field { display: block; }
form:has(input[name="source"][value="facebook_catalog"]:checked) .catalog-field { display: block; }
form:has(input[name="source"][value="manual"]:checked) .manual-field { display: block; }

/* Example products come with a template, so the choice only applies to one. */
form:has(select[name="template"] option[value="none"]:checked) .examples-field { display: none; }

label.checkbox { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; cursor: pointer; }
/* Where campaigns are removed: each choice with what it means under it, in
   line with the choice's words rather than the button. */
.remove-where .field-hint { margin: 0 0 0.75rem 1.6rem; }
label.checkbox input { width: auto; flex: none; margin: 0; }
/* Ticked among choices, as far apart as radio buttons are. */
fieldset.choice label.checkbox { padding: 0.15rem 0; }
/* A bulk dialog's "Sync updated campaigns", over its buttons. */
.sync-changed { margin: 0.25rem 0 0.75rem; }

.icon-button[disabled] { opacity: 0.35; cursor: default; }
.icon-button[disabled]:hover { background: transparent; color: var(--muted); }

/* Dragging rows into another order. */
td.handle-cell { width: 2rem; padding-right: 0; }
.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--muted);
  cursor: grab;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 1.1rem; height: 1.1rem; }
tr.dragging { opacity: 0.4; }


/* The search above a list: an icon inside the field, like a browser's own. */
.search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.search-icon {
  position: absolute;
  left: 0.6rem;
  display: flex;
  color: var(--muted);
  pointer-events: none;
}
.search-icon svg { width: 1rem; height: 1rem; }
.search-field input {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.6rem 0 2.1rem;
  margin: 0;
  /* The same frame as the list below it, rather than the browser's own. */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: inherit;
  font: inherit;
  appearance: none;
}
.search-field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* The field's own clear cross, a little larger than the browser draws it. */
.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 0.9rem;
  height: 0.9rem;
  cursor: pointer;
  background: var(--muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search-field input:hover::-webkit-search-cancel-button { background: var(--fg); }
/* There whenever there is text to clear, rather than only while the box has
   the focus, as Chrome has it: the cross is the way to take a search off. */
.search-field input::-webkit-search-cancel-button { opacity: 1; pointer-events: auto; }

/* Walking through the pages of a list, under it and in the middle. */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  /* As wide as its pages, in the middle, so the ring round them all (below)
     is round them and not across the page. */
  width: fit-content;
  margin: 1rem auto;
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.pager a, .pager .step, .pager .gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
}
.pager a:hover { background: var(--row-hover); }
/* The page one is on is marked as what is chosen is everywhere else -- the
   page in the menu, the team, a filter's choice -- rather than filled as a
   button is, which it would be taken for. */
.pager .current { background: var(--nav-active); color: var(--accent); font-weight: 600; }
.pager .current:hover { background: var(--nav-active); }
/* Previous and Next carry a chevron the size of a small button's icon. */
.pager .step { gap: 0.25rem; }
.pager .step svg { width: 1rem; height: 1rem; flex: none; }
.pager .gap, .pager .step.disabled { color: var(--muted); }
.pager .step.disabled { cursor: default; }
/* The pages are one stop for the keyboard, walked with the arrows (app.js),
   so a thin ring goes round all of them, as round a bar of filters
   (.filter-tools), and the page the keyboard is on has the ring of its own. */
.pager:has(a:focus-visible) { outline: 1px solid var(--accent); outline-offset: 3px; }
/* So are what can be done with the ticked rows (views.rowsActions), with a
   ring round them as round the filters' bar (.filter-tools, which draws it
   for both). */
.rows-actions[role=toolbar] { border-radius: var(--radius); }

/* A list of rows with a bar above them. Selecting rows turns the bar into what
   can be done with them; :has() does that, so it needs no JavaScript. */
/* The frame is drawn by the bar and the rows themselves rather than by the form
   around them: the pages sit inside the form too, so that swapping the list
   replaces them, and a frame around the form would enclose those as well. */
.rows { display: block; }
/* The count reads as one thing, so it does not break across two lines, and it
   stands as tall as the buttons it shares the bar with. Everything in the bar
   being one height is what keeps the bar one height: it holds a count until a
   row is ticked and buttons after that, and a bar that grew by the difference
   would nudge the whole page down as soon as anything was picked. */
.rows-count {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  white-space: nowrap;
}

.rows-bar {
  display: flex;
  align-items: center;
  /* The menus go onto a line of their own rather than off the edge when the
     window is too narrow to hold them beside the count. */
  flex-wrap: wrap;
  gap: 0.75rem;
  /* A floor, for a bar holding nothing at all. What keeps it from growing is
     that everything in it is 2rem tall, not this. */
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}
.rows-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}
/* The buttons that act on the ticked rows, straight after the count (see
   RowsLeadActions). The count is given a width to fill, so that "1 selected",
   "12 selected" and "48 campaigns" all leave them where they were. The bar
   is what the narrow version is measured against -- the sidebar takes room
   the window's width says nothing of -- and so is the ground its menus are
   drawn on: raised over the table, whose sticky head would come through. */
.rows-bar:has(> .rows-actions.at-start) { container-type: inline-size; position: relative; z-index: 4; }
.rows-bar:has(> .rows-actions.at-start) > .rows-count { min-width: 6.5rem; }
.rows-actions.at-start { flex-wrap: nowrap; justify-content: flex-start; margin-left: 0; }
.rows-actions.at-start.all-shown { flex-wrap: wrap; }
.rows-actions.at-start > .menu-dropdown { margin-left: 0; }
/* More is pressed as Edit is, so it is written as Edit is. */
.menu-dropdown.more-menu > summary { color: var(--fg); }
/* Its menus hang from their left edge, at the bar's start. */
.rows-actions.at-start .menu-panel { left: 0; right: auto; }
/* A greyed action stands back further than the filters across from it, which
   are drawn muted but can be pressed: the muted colour, and faded besides --
   its icon and words, not the button, so the keyboard's ring on it is as
   clear as on the others (views.ShutButton: it can be reached). So is one
   at the bar's end: Campaign keywords and Ad group keywords, with no keyword
   ticked. */
:is(.rows-actions, .rows-tools) > button:is(:disabled, [aria-disabled="true"]) { color: var(--muted); cursor: default; }
:is(.rows-actions, .rows-tools) > button:is(:disabled, [aria-disabled="true"]) > * { opacity: 0.5; }
/* Why it cannot be pressed, under it while the keyboard is on it: the hover's
   title, which a keyboard never brings up. Over the rows, as a menu hangs:
   out of the button, which no ripple needs to clip, since a greyed one has
   none (app.js). */
:is(.rows-actions, .rows-tools) > button[aria-disabled="true"][title] { position: relative; overflow: visible; }
:is(.rows-actions, .rows-tools) > button[aria-disabled="true"][title]:focus-visible::after {
  content: attr(title);
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 5;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  font-size: var(--text-xs);
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
}
/* At the bar's end, it hangs from the button's end, so as not to run off it. */
.rows-tools > button[aria-disabled="true"][title]:focus-visible::after { left: auto; right: 0; }
/* Where the bar is narrow -- a phone -- it hangs from the actions' start
   instead, and wraps within them, so that it never runs off the screen. */
.rows-actions[role=toolbar] { position: relative; }
@container (width < 30rem) {
  .rows-actions > button[aria-disabled="true"][title] { position: static; }
  .rows-actions > button[aria-disabled="true"][title]:focus-visible::after { width: max-content; max-width: 100%; white-space: normal; }
}
/* Without borders, as the filters over the tabs are: a row of words to press
   rather than of boxes, set closer for it. What can be pressed lights up
   under the pointer, as theirs do; an open menu keeps its ring. Columns too,
   so that the bar is all one kind of button, and the Graphs tab's
   Fullscreen as the other tabs' is. */
.rows-actions.at-start { gap: 0.125rem; }
:is(.rows-actions.at-start, .rows-bar > .rows-filters, .key-metrics-tools) > :is(button, a.button).secondary,
.rows-actions.at-start > .menu-dropdown > summary {
  border-color: transparent;
}
:is(.rows-actions.at-start, .rows-bar > .rows-filters, .key-metrics-tools) > :is(button:not(:disabled, [aria-disabled="true"]), a.button).secondary:hover,
.rows-actions.at-start > .menu-dropdown > summary:hover {
  background: var(--row-hover);
}
/* Where the bar cannot hold them all, Edit stays and the rest are in More.
   Beside Columns they need about 50rem; with the full-screen button too,
   which is there in the phone's layout only -- a phone held sideways has a
   bar about 51rem wide -- about 57 ("Exit fullscreen" the longer). */
@container (width >= 52rem) { .rows-actions.at-start > .more-menu { display: none; } }
@container (width < 52rem) { .rows-actions.at-start:has(> .more-menu) > :not(:first-child, .more-menu) { display: none; } }
@media (max-width: 40rem), (max-height: 30rem) {
  @container (width < 58rem) {
    .rows-bar:has([data-full-table]) > .rows-actions.at-start:has(> .more-menu) > .more-menu { display: revert; }
    .rows-bar:has([data-full-table]) > .rows-actions.at-start:has(> .more-menu) > :not(:first-child, .more-menu) { display: none; }
  }
}
/* The count is the label of the box that ticks them all (see RowsCount), and
   looks it where there is one. */
/* The words alone, not the room the count is given beside them -- to keep the
   actions in place, or a line to itself on a phone: a click in the empty
   space after them ticking every row would be a surprise. */
.rows-count { pointer-events: none; }
.rows-count > span { pointer-events: auto; }
/* The box and the words do the same, so they are one thing to press: the
   words' ground reaches back under the box, and lights up as the bar's
   buttons do, the words with it, whichever of the two is under the pointer.
   The box is drawn over it. 1.75rem is the box (1rem) and the bar's gap
   (0.75rem) beside it; 0.5rem is the room around the two. */
.rows-bar:has(> .select-all) > .select-all { position: relative; z-index: 1; }
.rows-bar:has(> .select-all) > .rows-count > span {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  margin-left: calc(-1.75rem - 0.5rem);
  padding: 0 0.5rem 0 calc(1.75rem + 0.5rem);
  border-radius: var(--radius);
  cursor: pointer;
}
.rows-bar:has(> .select-all):has(> .select-all:hover, > .rows-count > span:hover) > .rows-count > span {
  background: var(--row-hover);
  color: var(--fg);
}
/* Where the bar is narrow, the actions follow the count on its line while
   they fit beside it, and wrap whole to the next where they do not: what is
   ticked, then what to do with it. Drawn closer, by their buttons' own
   padding, so that wrapped, Edit's pencil is under the box; beside the count
   they still have the room it is given. */
@container (width < 30rem) {
  .rows-actions.at-start { margin-left: -0.6rem; }
  /* The filters, on a line of their own under them, start where they do
     rather than at the end: a line that starts at the right reads as
     left over, not as the next thing in the bar. */
  .rows-bar:has(> .rows-actions.at-start) > .rows-filters { justify-content: flex-start; margin-left: -0.6rem; }
  /* The order and the columns (RowsTools) share the count's line, at its far
     end, and the actions take the next: three groups are too many for a line
     this narrow, and the order and the columns are how the list is read, not
     something done to the ticked rows. */
  .rows-bar:has(> .rows-actions.at-start) > .rows-filters.rows-tools { order: 1; justify-content: flex-end; margin-left: auto; }
  .rows-bar:has(> .rows-tools) > .rows-actions.at-start { order: 2; flex-basis: 100%; }
  /* Two lines, then, of buttons 2rem tall whose words sit in their middle:
     the room between the lines counts their own twice, the room above and
     below once. Moved apart from the bar's edges and closer to each other,
     the words have about as much above, between and below them. The bar
     itself is the container, so it is spaced by what is in it. */
  .rows-bar:has(> .rows-tools) > :is(.select-all, .rows-count, .rows-tools) { margin-top: 0.5rem; }
  .rows-bar:has(> .rows-tools) > .rows-actions.at-start { margin-top: -0.25rem; margin-bottom: 0.5rem; }
}
/* Columns and Fullscreen as their icons alone where the words would not
   fit: a little wider than that, beside Edit and More, so that the bar is
   one line rather than two; narrower, on the count's line, so that it is
   two rather than three. The words stay for a screen reader. */
@container (width < 36rem) {
  .rows-tools .tool-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* A checkbox drawn by the app rather than the browser, whose box is white
   whatever it sits on: on the colour of what it is in, and the same in every
   browser. The select-all control is drawn the same, a button since the
   server renders its state. The tick and the dash are white, as --on-accent
   is in either theme. */
:root {
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
input[type="checkbox"]:not(.switch), .select-all {
  appearance: none;
  /* A square, and one that stays square: as a flex item it would otherwise be
     squeezed to a sliver when the bar runs out of room. */
  flex: none;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: 1px solid var(--muted);
  border-radius: 3px;
  background: transparent center / 100% no-repeat;
  vertical-align: middle;
  cursor: pointer;
}
:is(input[type="checkbox"]:not(.switch):is(:checked, :indeterminate), .select-all:is([data-state="all"], [data-state="some"])) {
  border-color: var(--accent-fill);
  background-color: var(--accent-fill);
}
input[type="checkbox"]:not(.switch):checked, .select-all[data-state="all"] { background-image: var(--tick); }
input[type="checkbox"]:not(.switch):indeterminate, .select-all[data-state="some"] { background-image: var(--dash); }
:is(input[type="checkbox"]:not(.switch), .select-all):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"]:not(.switch):disabled { cursor: default; opacity: 0.5; }
/* A selected row stands out, as in a mail client. */
.rows-list li:has(input[type="checkbox"]:checked) { background: var(--nav-active); }

/* Everything in the bar is the same height, so the bar keeps its own. */
.rows-actions > button:not(.icon-button), .rows-actions > a.button, .rows-filters > button:not(.icon-button), .rows-filters > a.button, .key-metrics-tools > button:not(.icon-button), .rows-filters .filter-picker, .menu-dropdown > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2rem;
  padding: 0 0.6rem;
  font-size: var(--text-sm);
}
.rows-actions > button:not(.icon-button) svg, .rows-actions > a.button svg, .rows-filters > button:not(.icon-button) svg, .rows-filters > a.button svg, .key-metrics-tools > button:not(.icon-button) svg { width: 1rem; height: 1rem; }
/* An icon alone -- the columns -- is the square every icon button is, beside
   the bar's worded buttons: their padding in a button 2rem wide left its icon
   a little over half the size it is anywhere else. */

/* A menu opened from a bar: the summary is the button, the panel hangs below it. */
.menu-dropdown { position: relative; margin-left: auto; }
.menu-dropdown > summary {
  list-style: none;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
}
.menu-dropdown > summary::-webkit-details-marker { display: none; }
/* A filter of many choices opens a dialog rather than a menu, and looks the
   same as one in the bar -- wherever in the bar it is: the campaigns table
   holds its filters in a row of their own. */
.rows-filters .filter-picker {
  margin-left: auto;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font-weight: normal;
  cursor: pointer;
}
.rows-filters .filter-picker:hover { background: var(--row-hover); color: var(--fg); }
/* A filter with nothing to filter by yet, such as a team's labels before it
   has any: there, but greyed and still. */
.rows-filters .filter-picker:disabled { opacity: 0.45; cursor: default; }
.rows-filters .filter-picker:disabled:hover { background: none; color: var(--muted); }
/* The arrow on whatever opens a list: Material Symbols' arrow_drop_down, a
   triangle drawn rather than the ▾ of the font, which San Francisco draws
   narrow and low. Its box is the icon's whole 24 squares, the triangle in the
   middle of them, so the margins take back the empty sides. */
.rows-filters .filter-picker::after, .menu-dropdown > summary::after, .team-picker summary::after, .shut-menu::after {
  content: "";
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0 -0.3rem 0 -0.25rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-360 280-560h400L480-360Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* The team picker's arrow keeps to the right of the name, in the muted colour. */
.team-picker summary::after { float: right; margin-right: -0.3rem; background: var(--muted); }
.menu-dropdown > summary:hover { background: var(--row-hover); color: var(--fg); }
/* Open, its button is lit as a chosen page in the sidebar is -- the accent's
   tint, the accent's words, icon and arrow -- so it is plain which menu is
   showing. Not ringed: the ring is the keyboard's (see :focus-visible), and
   a menu opened from the keyboard shows both. Lit under the pointer too,
   and in the bar, where its buttons light up grey. */
.menu-dropdown[open] > summary,
.menu-dropdown[open] > summary:hover,
.rows-actions.at-start > .menu-dropdown[open] > summary:hover { background: var(--nav-active); color: var(--accent); }
/* A menu that would run off the window hung from one edge of its button is
   hung from the other: app.js measures it as it opens (data-hang). */
details.menu-dropdown[data-hang="start"] > .menu-panel { left: 0; right: auto; }
details.menu-dropdown[data-hang="end"] > .menu-panel { left: auto; right: 0; }
.menu-panel {
  position: absolute;
  z-index: 10;
  right: 0;
  min-width: 13rem;
  /* A team's labels have no set number, so the menu scrolls rather than growing
     out of the window. Finding one among many is the search box's job: typing
     label: there offers them as they are narrowed down. */
  max-height: min(60vh, 22rem);
  overflow-y: auto;
  margin-top: 0.25rem;
  padding: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--raised-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  text-align: left;
}
/* The period menu: the periods offered, and beside them a calendar of two
   months for days of one's own -- under them, and of one month, on a phone.
   Wide, it reaches past the window's left edge rather than its right one,
   the menu being at the bar's right end. */
.period-panel {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: none;
  overflow: visible;
  /* Over the assistant's button in the corner, which would cover Ok, and
     under its chat, which is opened over everything. */
  z-index: 55;
  /* As wide as what it holds at its widest, rather than at its narrowest,
     which a menu hung from a small button would otherwise be: the two
     columns of periods come out the same width. */
  width: max-content;
  /* No room of its own at the sides: the tabs and the lines between the
     parts reach its edges, and each part keeps its own room. */
  padding: 0;
  --side-left: 0.75rem;
  --side-right: 0.75rem;
}
/* Each part's own room at the sides; the list through the panel, to win
   over .menu-panel ul's sides of 0. */
.period-adjust, .period-panel ul.period-choices, .period-custom > :not(.period-actions) { padding-left: var(--side-left); padding-right: var(--side-right); }
/* Two tabs over the panel, Interval and Custom dates: radios, the one ticked
   underlined, and the stylesheet shows its half of the panel. */
.period-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.period-tab {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
/* Hovering only where there is a pointer to hover with. On a phone the tap
   that opens the menu is taken for one over whatever the panel then puts
   under the finger, which lit up as the menu opened -- here and below. */
@media (hover: hover) { .period-tab:hover { color: var(--fg); } }
.period-tab:has(input:checked) { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.period-tab:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.period-panel:has(.period-tab input[value="custom"]:checked) .period-interval,
.period-panel:has(.period-tab input[value="interval"]:checked) .period-custom { display: none; }
/* The interval: as wide as its widest line, so a period and its days, and the
   four adjustments, each stay on one line. */
.period-interval { min-width: 15rem; }
/* A label over the four choices rather than a heading: as the periods'
   words are, not bold. */
.period-adjust .menu-heading { white-space: nowrap; border-bottom: 0; font-weight: normal; }
.period-adjust { border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; margin-bottom: 0.25rem; }
/* The choices from edge to edge of their part, as the periods under them
   are: the chosen one's colour lines up with a chosen period's, and the
   label's words over them with the periods' words. */
.period-adjust-choices { display: flex; gap: 0.25rem; padding: 0.25rem 0 0; }
.period-adjust-choices label {
  flex: 1;
  padding: 0.25rem 0.375rem;
  /* No line round them: the chosen one has its colour, the rest are words.
     Kept, unseen, so none changes size as it is chosen. */
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--fg);
  font-size: var(--text-xs);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
@media (hover: hover) { .period-adjust-choices label:hover { background: var(--row-hover); } }
.period-adjust-choices label:has(input:checked) { background: var(--nav-active); color: var(--accent); font-weight: 500; }
.period-adjust-choices label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The periods, a radio each, laid out as the menu's links are: the tick
   before the one chosen. In two columns -- the days the calendar names, then
   the counts of days back, which an adjustment moves -- however many each
   has: each period is put in its column, and down it in order. */
.period-choices { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; column-gap: 0.5rem; }
.period-choices > li { grid-column: 1; }
.period-choices > li.counts-back { grid-column: 2; }
.period-choices label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Room at the end for the tick a chosen one has at its start -- the tick
     and its gap -- so choosing the longest does not widen the menu. */
  padding: 0.45rem 2rem 0.45rem 0.5rem;
  border-radius: var(--radius);
  color: var(--fg);
  white-space: nowrap;
  cursor: pointer;
}
@media (hover: hover) { .period-choices label:hover { background: var(--row-hover); } }
/* Chosen as a menu's choice is: ticked, in the colour of what is chosen, and
   a little bolder, so it is seen to be chosen whatever the colour says to whoever
   reads it. */
.period-choices label:has(input:checked) { padding-right: 0.5rem; background: var(--nav-active); color: var(--accent); font-weight: 500; }
/* A period's name as wide as it is when chosen, bolder: drawn again under
   itself in that weight, unseen and no taller than nothing. */
.period-name { display: inline-grid; }
.period-name::after { content: attr(data-name); height: 0; overflow: hidden; visibility: hidden; font-weight: 500; }
.period-choices label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Through the label, so as not to lose to .menu-panel .check, which shows
   every menu's tick and comes later. */
.period-choices label .check { display: none; }
.period-choices label:has(input:checked) .check { display: flex; }
/* A period's days, smaller and grey beside its name: 7 days 3–9 Oct. In the
   menu each period has them under every adjustment, and only those under the
   one ticked show, so they follow a tick before Ok. */
.period-days { color: var(--muted); font-size: var(--text-xs); font-weight: normal; }
.period-said { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; column-gap: 0.3em; }
.period-said > span { white-space: nowrap; }
.period-days-set { display: inline-grid; margin-left: 0.3em; }
.period-days-set > .period-days { grid-area: 1 / 1; visibility: hidden; }
.period-interval:has(input[name="adjust-choice"][value="0"]:checked) .period-days[data-adjust="0"],
.period-interval:has(input[name="adjust-choice"][value="1"]:checked) .period-days[data-adjust="1"],
.period-interval:has(input[name="adjust-choice"][value="3"]:checked) .period-days[data-adjust="3"],
.period-interval:has(input[name="adjust-choice"][value="7"]:checked) .period-days[data-adjust="7"] { visibility: visible; }
/* Ok, under each tab, at its start: under the choices it confirms, where
   the eye already is, on the edge everything else in the panel lines up on. */
.period-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0.5rem var(--side-right) 0.5rem var(--side-left);
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}
/* Custom dates' Ok, until the calendar has its two days. */
.period-actions button:disabled { opacity: 0.4; cursor: default; }
.period-hint { margin: 0.25rem 0.5rem 0.75rem; }
/* Shown only on a phone, where the panel is a screen of its own. */
.period-head { display: none; }
/* No grey flash where the button was tapped: a phone's browser lays it over
   everything, the panel the tap has just opened over the button too, so it
   showed through the panel as it came up. The panel opening is what says
   the tap was taken. */
.period-menu > summary { -webkit-tap-highlight-color: transparent; }
/* On a phone the period menu is a screen of its own, as a date picker is
   there: too much for a menu hung from a button, which ran off the window's
   edge. The ✕, what it is for and Ok at the top, then the tabs and the
   adjustment, and under them the one part that scrolls -- the periods in one
   column, or the calendar. Kept out of what scrolls, the top stays still as
   iOS pulls it past its ends. The page behind
   stays still too. Through details > .menu-panel, to win over the
   filter bar's placing of its menus. */
@media (max-width: 40rem), (max-height: 30rem) {
  details.period-menu > .menu-panel.period-panel {
    position: fixed;
    inset: 0;
    width: auto;
    min-width: 0;
    max-height: none;
    margin: 0;
    /* The whole screen, as a dialog is on a phone, and in a dialog's colour
       rather than a menu's: the page's own in the light, raised in the dark.
       Hovering and choosing in it follow, being mixed from --bg. */
    --bg: var(--dialog);
    /* Each part reaches from edge to edge, its lines with it, and keeps its
       own room at the sides, as in the menu a wider window shows -- or the
       notch's, where that is wider. */
    --side-left: max(0.75rem, var(--inset-left));
    --side-right: max(0.75rem, var(--inset-right));
    padding: env(safe-area-inset-top, 0px) 0 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    overscroll-behavior: none;
  }
  body:has(details.period-menu[open]) { overflow: hidden; }
  /* The ✕ and "Select dates" where the app's bar has its ☰ and the page's
     name, the same size and as tall, so opening the menu changes what the
     bar says and not where (--bar-height), and the ✕ in the words'
     colour. */
  .period-head { display: flex; flex: none; align-items: center; gap: 0; padding: var(--bar-pad) var(--side-right) var(--bar-pad) var(--side-left); }
  .period-head .icon-button { width: var(--bar-button); height: var(--bar-button); margin-left: calc(var(--bar-edge) - var(--side-left)); color: var(--fg); }
  .period-head .period-title { margin-left: var(--bar-title); }
  .period-head .icon-button svg { width: 1.5rem; height: 1.5rem; }
  .period-title { font-size: var(--text-base); font-weight: 600; color: var(--fg); }
  .period-tabs { flex: none; }
  .period-tab { display: flex; align-items: center; justify-content: center; min-height: 2.75rem; }
  .period-interval, .period-custom { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
  .period-adjust { flex: none; padding-bottom: 1rem; }
  /* The adjustment scrolls away with the periods under it, leaving them the
     screen: what scrolls is the tab, not the list alone. */
  .period-interval, .period-custom > [data-period-calendar] {
    min-height: 0;
    overflow-y: auto;
    /* Its own bounce at its ends, which a list on a phone is expected to
       have, without its scrolling going on to the page behind. */
    overscroll-behavior: contain;
  }
  .period-choices { flex: none; }
  .period-custom > [data-period-calendar] { flex: 1; }
  /* Scrolled, the bar and the tabs above what scrolls are raised, as
     Material's top bar is once something has gone under it. Drawn from how
     far the periods are scrolled, the first 1rem of it, so the bar turns as
     they go and turns back at the top; a browser that cannot keeps it flat. */
  /* The bar and the tabs one block, with no gap between them or under them
     for the page's colour to show through once they are raised; the room
     under the tabs is the first of what scrolls instead. */
  details.period-menu > .menu-panel.period-panel { gap: 0; }
  .period-tabs { margin-bottom: 0; }
  .period-interval { padding-top: 0.25rem; }
  @supports (animation-timeline: scroll()) {
    details.period-menu > .menu-panel.period-panel { timeline-scope: --period-scroll; }
    .period-interval { scroll-timeline: --period-scroll block; }
    .period-head, .period-tabs {
      background: var(--bg);
      animation: bar-raised linear both;
      animation-timeline: --period-scroll;
      animation-range: 0 1rem;
    }
  }
  /* The calendar as tall as its month, with the hint under it, rather than
     stretched to Ok; it scrolls only on a screen too short for it. */
  .period-custom > [data-period-calendar] { flex: 0 1 auto; }
  /* Positioned, so the hidden radios of periods scrolled out of sight are
     inside what scrolls, not hanging out of the screen below it. */
  .period-choices { position: relative; grid-auto-flow: row; align-content: start; }
  /* Room after the last period, so scrolled to the end it is seen to be the
     last, clear of the bar at the foot of the screen. */
  .period-panel ul.period-choices { padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px)); }
  .period-choices > li, .period-choices > li.counts-back { grid-column: 1; }
  /* As tall as a finger needs: 44px, Apple's least for something to tap --
     the tabs, the periods, the four adjustments and Ok alike, with room
     round the adjustments and Ok to tell them apart. A pointer needs less, so
     a wider window keeps them close. */
  .period-choices label, .period-adjust-choices label, .period-actions button { min-height: 2.75rem; }
  .period-adjust-choices label { display: flex; align-items: center; justify-content: center; }
  /* Ok at the right of the top bar, in words, as a dialog's Save is on a
     phone and as Material's full-screen dialog has it: each tab's own, so
     the one shown is the one there, Custom dates' faint until its two days
     are chosen. Placed from the panel's corner, which does not scroll; the
     foot it stood in holds nothing then. */
  .period-actions { padding: 0; margin: 0; border: 0; }
  .period-actions button {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + var(--bar-pad));
    right: max(0.5rem, var(--inset-right));
    min-height: var(--bar-button);
    padding: 0 0.75rem;
    border-color: transparent;
    background: transparent;
    color: var(--accent);
    /* The size of the title beside it, as a dialog's Save is, rather than
       the menu's smaller words. */
    font-size: var(--text-base);
    font-weight: 600;
    /* As wide as a dialog's, however short its word: Ok is a small thing to
       tap on its own. */
    min-width: 3.75rem;
  }
  .period-head { padding-right: 4.5rem; }
}
/* Flatpickr's calendar in the app's colours, flat inside the menu, and
   without the arrow it points with when it hangs from a field. */
.period-custom .flatpickr-calendar.inline {
  box-shadow: none;
  background: var(--bg);
  margin-top: 0.25rem;
}
.period-custom .flatpickr-calendar::before,
.period-custom .flatpickr-calendar::after { display: none; }
/* The calendar is a part of the panel's too, set beside the element it is
   made from, and takes a part's room at the sides. Round flatpickr's own
   width rather than out of it, which cut the last column of days off. */
.period-custom > .flatpickr-calendar { box-sizing: content-box; }
/* The line between two months in the app's colour for lines, rather than
   flatpickr's light grey, which on a dark page was nearly white -- and a
   band of days going on into the second month joined to it in the band's
   colour, where flatpickr's grey drew a white bar beside its first column. */
.period-custom .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer + .dayContainer { box-shadow: -1px 0 0 var(--border); }
.period-custom .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {
  box-shadow: -2px 0 0 color-mix(in srgb, var(--accent) 15%, var(--bg)), 5px 0 0 color-mix(in srgb, var(--accent) 15%, var(--bg));
}
/* The month over it as a heading of the app's: the size of the text round it,
   the month half bold and the year not, rather than flatpickr's large and
   light. Its arrows are the app's chevrons, in the muted colour. */
.period-custom .flatpickr-current-month { font-size: var(--text-base); font-weight: normal; }
.period-custom .flatpickr-current-month span.cur-month { font-weight: 600; }
.period-custom .flatpickr-current-month input.cur-year { font-weight: normal; }
.period-custom .flatpickr-months .flatpickr-prev-month svg,
.period-custom .flatpickr-months .flatpickr-next-month svg { width: 1.25rem; height: 1.25rem; }
/* On a phone, as wide as the screen rather than flatpickr's own 308px, which
   left a strip beside it and cut Sunday off: its boxes stretched, and its
   days wider and taller to tap. */
@media (max-width: 40rem), (max-height: 30rem) {
  .period-custom > .flatpickr-calendar { box-sizing: border-box; }
  .period-custom .flatpickr-calendar.inline,
  .period-custom .flatpickr-innerContainer,
  .period-custom .flatpickr-rContainer,
  .period-custom .flatpickr-days,
  .period-custom .dayContainer { width: 100%; min-width: 0; max-width: none; }
  .period-custom .flatpickr-day { max-width: none; height: 2.75rem; line-height: calc(2.75rem - 2px); }
  /* The month's row 44px, as the rest of the screen's targets are, its
     arrows a 44px square to tap each and the month in the middle of it. */
  .period-custom .flatpickr-months .flatpickr-month { height: 2.75rem; }
  .period-custom .flatpickr-months .flatpickr-prev-month,
  .period-custom .flatpickr-months .flatpickr-next-month {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
  }
  .period-custom .flatpickr-current-month { height: 2.75rem; padding: 0; line-height: 2.75rem; }
}
.period-custom .flatpickr-calendar,
.period-custom .flatpickr-months .flatpickr-month,
.period-custom .flatpickr-current-month .flatpickr-monthDropdown-months,
.period-custom span.flatpickr-weekday,
.period-custom .flatpickr-day { color: var(--fg); fill: var(--fg); background: transparent; }
.period-custom .flatpickr-months .flatpickr-prev-month svg,
.period-custom .flatpickr-months .flatpickr-next-month svg { fill: var(--muted); }
@media (hover: hover) { .period-custom .flatpickr-day:hover { background: var(--row-hover); border-color: var(--row-hover); } }
.period-custom .flatpickr-day.flatpickr-disabled,
.period-custom .flatpickr-day.prevMonthDay,
.period-custom .flatpickr-day.nextMonthDay { color: var(--muted); opacity: 0.5; }
.period-custom .flatpickr-day.today { border-color: var(--border); }
/* The days between the first and the last in one band: flatpickr joins them
   with a shadow either side, and a colour seen through would be doubled where
   two shadows meet, a stripe between every two days. Mixed with the page
   rather than with nothing, it is solid, and the band even. */
.period-custom .flatpickr-day.inRange {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg));
  border-color: transparent;
  box-shadow: -5px 0 0 color-mix(in srgb, var(--accent) 15%, var(--bg)), 5px 0 0 color-mix(in srgb, var(--accent) 15%, var(--bg));
}
.period-custom .flatpickr-day.selected,
.period-custom .flatpickr-day.startRange,
.period-custom .flatpickr-day.endRange {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: var(--on-accent);
}

/* What a menu says when it has nothing to offer yet. */
.menu-empty { padding: 0.4rem 0.75rem; color: var(--muted); }
/* A group with nothing to choose yet, said where its choices would be. */
.menu-none { padding: 0.45rem 0.5rem; color: var(--muted); font-style: italic; }
.menu-heading {
  padding: 0.35rem 0.5rem;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
/* A little room between the choices, so chosen ones side by side read as
   several and not as one block, and each is a target of its own. */
.menu-panel ul { display: grid; row-gap: 2px; list-style: none; margin: 0; padding: 0.25rem 0; }
.menu-panel a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Room at the end for the tick a chosen one has at its start, so ticking
     the longest does not widen a menu that stays open to tick another. */
  padding: 0.45rem 2rem 0.45rem 0.5rem;
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
}
.menu-panel a:hover { background: var(--row-hover); }
/* A chosen choice stands out as a ticked row does, Material's way: the tick
   before it, and the colour of what is chosen behind it. */
.menu-panel a.chosen { padding-right: 0.5rem; background: var(--nav-active); color: var(--accent); font-weight: 500; }
.menu-panel .check { display: flex; width: 1rem; }
.menu-panel .check svg { width: 1rem; height: 1rem; }

/* The rows carry on from the bar above them, whose bottom edge is their top one. */
.rows-list, .rows > .table-scroll {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.rows-list { list-style: none; margin: 0; padding: 0; }
.rows-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.rows-list li:last-child { border-bottom: 0; border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
/* What a filter that matched nothing leaves behind, inside the list rather than
   in place of it: the filter is in the header above, and taking the header away
   would leave no way back to it. */
.rows-empty { margin: 0; padding: 0.75rem; }
/* A badge in a row's quiet line is spaced by the line's own gap, not by its
   own margin, which would leave it standing further off than its neighbours. */
.row-meta .badge { margin-left: 0; }
.row-body { min-width: 0; }
.row-name { font-weight: 600; color: var(--fg); text-decoration: none; }
/* Only a name that leads somewhere answers the pointer. */
/* And so does one the keyboard is on: Enter opens it. */
:is(a, button).row-name:is(:hover, :focus-visible) { color: var(--accent); text-decoration: underline; }
/* A name in a report's table that leads into its campaign: the cell's own
   colour and weight -- the row's own name bold, what it is in beside it not --
   answering the pointer as a campaign's name does. */
a.name-link { color: inherit; text-decoration: none; }
a.name-link:is(:hover, :focus-visible) { color: var(--accent); text-decoration: underline; }
/* The line a keyword was filled in from the feed, quiet under the keyword. */
.keyword-line { display: block; font-size: var(--text-xs); }
/* Group by keyword, at the bar's end beside Columns, in the accent while the
   keywords are grouped, so it reads as switched on; and so Campaign keywords
   and Ad group keywords while the tab is kept to them. */
.rows-bar > .rows-tools > a.button.secondary[aria-pressed="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
/* On a touch screen nothing is pointed at before it is pressed, so a name
   that opens something is in the accent from the start, and one that does
   not keeps the text's colour beside it. A trial: on touch alone for now,
   to be seen before it goes further. */
@media (hover: none) {
  :is(a, button).row-name, a.name-link { color: var(--accent); }
}
.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: var(--text-xs);
}
.select-cell {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
  cursor: pointer;
}
.select-cell input { width: auto; margin: 0; }
.meta-separator { opacity: 0.6; }

/* The campaigns table: what each campaign is, then what it delivered. */
.campaigns td { vertical-align: middle; }
.campaigns .name-cell > div { display: flex; align-items: center; gap: 0.6rem; }
.campaigns .name-cell .row-name { font-weight: 600; }
.campaigns .name-cell .row-issue { display: contents; }
/* A long name -- a campaign's, an ad group's, an ad's -- wraps within a width
   rather than stretching its column across the window, and past two lines it
   ends in an ellipsis, with a button beside it to show the whole of it.
   Wrapped rather than cut at one line: names often share a beginning and
   differ at the end.
   As wide as the name up to that width, and no narrower: a table short of
   room squeezes whatever can wrap, and would leave a name a word a line. */
.campaigns :is(a.row-name, a.name-link) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  width: max-content;
  max-width: 16rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
/* In the campaigns table a name shares its cell with a badge, and the two
   share one width rather than the badge adding to the name's: a column is
   as wide as its widest row, and a long name with a badge beside it would
   leave every row without one a gap the badge's width. The icons, the button
   and the badge keep their room; the name has what is left, all of it where
   there is no badge. As wide as what is in it up to that width, and no
   narrower, for the table's squeezing as above. */
.campaigns .name-cell > div { width: max-content; max-width: 22rem; }
.campaigns .name-cell > div > :not(.row-mark), .campaigns .name-cell .row-issue > * { flex: none; }
.campaigns .name-cell :is(.row-mark, .name-clamp) { flex: 0 1 auto; min-width: 0; }
.campaigns .name-cell a.row-name { width: auto; max-width: none; min-width: 0; }
/* Where the table itself is narrow -- a phone held sideways, a narrow
   window -- the name is given less of it, and the figures it is scrolled
   for more. By the table's width rather than the window's, which the menu
   beside it shares. */
.table-scroll:has(> table.campaigns) { container: campaigns-table / inline-size; }
@container campaigns-table (width < 46rem) {
  .campaigns :is(a.row-name, a.name-link) { max-width: 11rem; }
  /* The badge under the name rather than beside it, where it would leave
     the name a word a line. */
  .campaigns .name-cell > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 0.25rem;
    max-width: 15rem;
  }
  .campaigns .name-cell .row-issue > * { grid-column: 2; justify-self: start; }
}
/* The name and its button, the button level with the middle of the name, as
   the badge beside it is. Opened, the name takes as many lines as it needs. */
.name-clamp { display: inline-flex; align-items: center; gap: 0.125rem; }
.name-clamp:has(> .name-more[aria-expanded="true"]) > a { -webkit-line-clamp: none; line-clamp: none; }
/* Quiet, as the (i) beside a heading is: there for the name it belongs to,
   not to be read on every look down the table. app.js shows it only where
   the name was cut off. */
.name-more:not([hidden]) {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  padding: 0.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.name-more svg { width: 1rem; height: 1rem; transition: rotate 150ms; }
.name-more[aria-expanded="true"] svg { rotate: 180deg; }
.name-more:hover { color: var(--fg); }
.name-more:focus-visible { color: var(--fg); outline: 2px solid var(--accent); outline-offset: 1px; }
/* A finger needs more than the icon's own room: the button reaches 0.625rem
   further out on every side, about 44px in all, and takes no more room for
   it. Padding rather than a pseudo-element beyond its edge, which the
   ripple's overflow: hidden would clip, and a press there land on nothing. */
@media (pointer: coarse) {
  .name-more:not([hidden]) { padding: 0.875rem; margin: -0.625rem; }
}
@media (prefers-reduced-motion: reduce) {
  .name-more svg { transition: none; }
}
/* A campaign with many labels makes a tall row; the labels wrap within a width
   rather than stretching the column across the window. */
.campaigns .labels-cell { max-width: 18rem; white-space: normal; }
/* A row gone to by its address -- Show in list -- clear of the bars that
   stick above the table. */
.campaigns tr:target { scroll-margin-top: 8rem; }
/* The (i) beside a heading over times, and the note it opens saying their
   zone. Quiet until pointed at: it is there for the question, not to be read
   on every look at the table. */
.zone-button {
  display: inline-grid;
  place-items: center;
  margin-left: 0.25rem;
  padding: 0.125rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  vertical-align: middle;
  cursor: pointer;
}
.zone-button svg { width: 1rem; height: 1rem; }
.zone-button:hover { color: var(--fg); }
.zone-button:focus-visible { color: var(--fg); outline: 2px solid var(--accent); outline-offset: 1px; }
.note-popover {
  max-width: 18rem;
  padding: 0.75rem;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--raised-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  font-size: var(--text-sm);
  font-weight: 400;
  text-align: left;
  white-space: normal;
}
.note-popover p { margin: 0 0 0.5rem; }
.note-popover p:last-child { margin-bottom: 0; }
.note-popover a { color: var(--accent); }

/* A keyword grouped over several campaigns, or ad groups: the count, muted
   as it was, which opens the note naming them (views.keywordPlaces). */
.keyword-places-button {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.keyword-places-button svg { flex: none; width: 1rem; height: 1rem; transition: rotate 150ms; }
.keyword-places-button:hover { color: var(--fg); text-decoration: underline; }
.keyword-places-button:focus-visible { color: var(--fg); outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.keyword-places-button:has(+ :popover-open) svg { rotate: 180deg; }
/* As high as the window leaves it under the count, scrolling past that: a
   keyword can be in a long list of ad groups. Those under their campaign's
   name, in from it. */
.keyword-places { max-height: min(24rem, var(--note-room, 60vh)); overflow-y: auto; overscroll-behavior: contain; }
.keyword-places ul { display: grid; gap: 0.4rem; margin: 0 0 0.5rem; padding: 0; list-style: none; }
.keyword-places ul:last-child { margin-bottom: 0; }
.keyword-places ul ul { gap: 0.25rem; margin: 0.25rem 0 0.25rem 1.3rem; }
.keyword-places .name-link { color: var(--fg); }
.keyword-places .name-link:hover { color: var(--accent); }

/* Every heading orders the table by its column: the campaigns', and a
   feed's items'. */
:is(.campaigns, .items) th a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}
/* The column the table is ordered by stands out from the grey headings in
   the text's own colour, its arrow saying which way: the accent is kept for
   what can be chosen or opened, and every heading can be. */
:is(.campaigns, .items) th[aria-sort] a { color: var(--fg); }
:is(.campaigns, .items) .sort-arrow { font-size: var(--text-xs); }
/* Under the pointer a grey heading takes the text's colour, as the one the
   table follows has: each can be clicked. */
:is(.campaigns, .items) th a:is(:hover, :focus-visible) { color: var(--fg); }
/* A number nobody has recorded yet is a dash, and stays out of the way. */
.campaigns td.number.muted { color: var(--muted); }


/* The menus that narrow a list sit together at the right of its bar. Each one
   pushes itself right on its own, so grouped they share the free space between
   them; inside the group they follow one another instead. */
.rows-filters {
  display: flex;
  align-items: center;
  /* They wrap among themselves before the bar breaks, and each row of them
     stays at the end where they belong. */
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-left: auto;
}
.rows-filters .menu-dropdown { margin-left: 0; }
/* A menu per filter while they fit; below, one menu holding all of them. Five
   menus is more chrome than a phone can spare above a table. The days the
   numbers cover stay beside it either way: they change what the numbers mean
   rather than which campaigns are listed.

   The narrow rule sits here rather than with the rest of the stacked layout,
   since it and the rule it overrides carry the same weight and the later one
   would otherwise win whatever the window is doing. */
.filters-wide { display: flex; align-items: center; gap: 0.25rem; }
.filters-narrow { display: none; }
/* In the campaigns' bar the menus wrap as the rest of the bar does, a whole
   menu to the next line rather than every button squeezed until its words
   break: the box holding them gives way to them. */
.filter-tools > .filters-wide { display: contents; }
.filter-bar summary, .filter-bar .filter-picker { white-space: nowrap; }
/* A filter of many choices follows the one before it here, as a menu does,
   rather than pushing itself to the end of the line as it does in a list's
   own bar. */
.filter-bar .filter-picker { margin-left: 0; }
/* The campaigns' filters in a bar of their own under the search box, rather
   than in the table's header, which turns into what can be done with the
   rows once one is ticked. The filters and the saved searches from the start
   of it, the days at its end. */
.filter-bar {
  justify-content: flex-start;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: var(--text-sm);
}
.filter-bar-end { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
/* The bar's buttons, the chips apart under them: a group the keyboard goes
   through with ← and → (views.FilterTools), ringed as a whole while it is in
   it, the button it is on ringed in it as ever -- as Google Cloud's console
   rings a bar of buttons. A tap or a click rings neither, and nor does a
   button the keyboard was put back on quietly after a menu the pointer
   opened (data-quiet-focus). Not while the keyboard is in a menu's items:
   the menu is what it is in then. */
.filter-tools {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius);
}
/* While the keyboard is on one of its buttons, and of the actions over a
   list's rows too (.rows-actions): not on a menu's items, nor a menu opened
   with the pointer (data-quiet-focus). */
:is(.filter-tools, .rows-actions)[role=toolbar]:has(:is(summary, button, a[href]):not(.menu-panel *, [data-quiet-focus]):focus-visible) {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}
/* What the list is narrowed by, a chip each, on a line of their own under the
   menus; Clear after them takes all of it off. */
.filter-chips { display: flex; flex-basis: 100%; margin-top: 0.375rem; }
/* The chips themselves, one stop for the keyboard (app.js): as wide as they
   are, so the ring round them as the keyboard is in them is round them, as
   round the bar of filters above. */
.chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; min-width: 0; border-radius: 1rem; }
.chip-group:has(> a:focus-visible) { outline: 1px solid var(--accent); outline-offset: 3px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 1.75rem;
  padding: 0 0.4rem 0 0.7rem;
  border-radius: 999px;
  background: var(--nav-active);
  color: var(--accent);
  text-decoration: none;
}
.filter-chip > span:first-child { max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip svg { width: 1rem; height: 1rem; opacity: 0.7; }
.filter-chip:hover svg { opacity: 1; }
.filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 1.75rem;
  padding: 0 0.6rem 0 0.4rem;
  /* The chips' colours as an outline rather than a fill: it goes with them,
     and is not one more of them. */
  border: 1px solid var(--nav-active);
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
}
.filter-clear svg { width: 1rem; height: 1rem; opacity: 0.7; }
.filter-clear:hover { background: var(--nav-active); }
.filter-clear:hover svg { opacity: 1; }
/* A search that matched no campaign says so in the middle of the room the
   table would have had, where it is not read past: at the size of the tabs
   above it and the menu beside it, rather than a table's smaller rows. */
.empty-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 5rem 1rem;
  color: var(--muted);
  text-align: center;
}
.empty-search p { margin: 0; }
/* The filters and the saved searches stand at the start of the bar, so their
   menus open from their left edge, toward the room the bar has; the days at
   its end open toward the start, as a menu at the end of a bar does. Opened
   from the right, the first of them hung off the window's left edge. */
.filter-tools > .filters-wide .menu-panel,
.filter-tools > .filters-narrow .menu-panel,
.filter-tools > .menu-dropdown > .menu-panel { left: 0; right: auto; }

@media (max-width: 40rem), (max-height: 30rem) {
  .filters-wide, .filter-tools > .filters-wide { display: none; }
  .filters-narrow { display: block; }
  /* The days take what the menus leave of their line, rather than wrapping
     to one of their own, and their button grows a line where that is too
     little for the name and the days side by side: the days then go under
     the name. */
  .filter-tools > .filter-bar-end { flex: 1 1 0; justify-content: flex-end; }
  .filter-bar-end .menu-dropdown > summary { height: auto; min-height: 2rem; line-height: 1; text-align: right; }
  .filter-bar-end .period-said { row-gap: 0.125rem; }
  /* Custom dates are one piece, the dates themselves, which breaks between
     its words where it has to; the name and the days of any other break
     between the two first. */
  .filter-bar-end .period-said > span { white-space: normal; }
}

/* The state a campaign is in, as a badge: green while it runs, grey while it is
   paused, red once it has been removed. */
.status-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
/* What something runs on: outlined, so a column of them does not read as a
   column of statuses. */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--subtle);
  color: var(--muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}
/* A brand mark keeps its own size whatever it stands next to. */
.type-badge svg { flex: none; width: 0.75rem; height: 0.75rem; }
.platform-name { display: inline-flex; align-items: center; gap: 0.4rem; }
.platform-name svg { flex: none; width: 1rem; height: 1rem; }

/* A campaign's on and off, at the top of its page: a switch alone, green
   while it runs. */
.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--fg);
}
.status-switch-box { display: inline-flex; flex: none; min-width: 2.25rem; }
/* A campaign's state in its row of the list: read, not pressed. */
.campaign-status { display: inline-flex; flex: none; width: 1.25rem; height: 1.25rem; }
.campaign-status svg { width: 100%; height: 100%; }
.campaign-status.running { color: var(--campaign-running); }
.campaign-status.paused { color: var(--campaign-paused); }
.campaign-status.removed { color: var(--campaign-removed); }
/* A product's switch, first in its row; switched off, the rest of the row
   fades, as it is left out of the campaigns. */
table.items .switch-cell { width: 1%; }
table.items .switch-cell form { display: inline-block; vertical-align: middle; }
/* Its buttons do not fade: see-through, the values scrolling under them
   would show through. */
table.items tr.inactive td:not(.switch-cell, .actions-cell) { opacity: 0.45; }
/* An item that carries another's ID is marked beside its switch, and its
   row is in the colour of the warning above the table that says which --
   every cell, the ones that stay in place too, which have a background of
   their own. */
.items tr.shared-id td { background: var(--pending-bg); }
/* Hovered, it stays amber: deepened as --row-hover deepens the page. */
.items tr.shared-id:hover td { background: color-mix(in srgb, var(--ink) 6%, var(--pending-bg)); }
.shared-id-mark {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 0.4rem;
  padding: 0.125rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pending-fg);
  cursor: pointer;
}
.shared-id-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.shared-id-mark svg { width: 1.1rem; height: 1.1rem; }
/* An item's buttons stay at the right edge while its values scroll under
   them, so a row scrolled to can be changed where it is -- with an edge
   while there is more of the table to scroll to. Its background, and a
   shared ID's row's, give way to the row hovered over. */
table.items .actions-cell {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--bg);
}
@supports (animation-timeline: scroll()) {
  .table-scroll table.items .actions-cell {
    animation: sticky-actions-edge linear both;
    animation-timeline: --table-scroll;
    animation-range: calc(100% - 1rem) 100%;
  }
  @keyframes sticky-actions-edge {
    from { box-shadow: inset 1px 0 0 var(--border), -8px 0 8px -8px rgb(0 0 0 / 0.3); }
  }
}
.inactive-filter { margin: 0 0 0.5rem; }
.status-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* One that cannot be pressed is drawn empty: an outline, its knob flat. */
.status-switch:disabled { cursor: default; }
.status-switch:disabled .switch-track { background: var(--subtle); box-shadow: inset 0 0 0 1px var(--border); }
.status-switch:disabled .switch-thumb { background: var(--border); box-shadow: none; }
.switch-track {
  position: relative;
  flex: none;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s;
}
.switch-thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: transform 0.15s;
}
/* On is blue, as everything chosen is. A campaign's own switch is in the
   colours of its status instead -- running green, paused grey -- the same
   as the mark in its row of the campaigns list, so the two say it alike. */
.status-switch[aria-checked="true"] .switch-track { background: var(--accent); }
.campaign-status-switch .switch-track { background: var(--campaign-paused); }
.campaign-status-switch .status-switch[aria-checked="true"] .switch-track { background: var(--campaign-running); }
.status-switch[aria-checked="true"] .switch-thumb { transform: translateX(1rem); }
.status-running { background: var(--ok-bg); color: var(--ok-fg); }
.status-paused { background: var(--border); color: var(--fg); }
.status-removed { background: var(--bad-bg); color: var(--bad-fg); }

/* The top of a campaign's page: what it is beside what its ads look like, as
   two cards side by side, one over the other on a phone. */
.campaign-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
.overview-facts,
.overview-preview {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
/* One column as wide as the card, not as its widest fact: a long label is
   cut short in it rather than pushing the page wider than the screen. */
.overview-facts { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1rem; }
.overview-facts dt { color: var(--muted); font-size: var(--text-sm); }
.overview-facts dd { display: flex; flex-direction: column; margin: 0.15rem 0 0; }
.overview-facts .overview-sync dd, .overview-facts .overview-modified dd, .overview-facts .overview-training dd {
  flex-direction: row; justify-content: space-between; align-items: baseline;
}
.overview-facts button.link, .overview-facts a { text-decoration: none; }
.overview-sync-actions { display: flex; gap: 1rem; }
/* The labels, and Add labels or Change labels at the far end, kept apart
   however many labels there are. */
.overview-facts .overview-labels dd { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 1rem; }
.overview-labels .labels { flex: 1; min-width: 0; }
.overview-labels-edit { white-space: nowrap; }
/* How it is synced, under when it last was: a quiet line that opens the Sync
   dialog, as muted as the text it is until it is pointed at. */
.overview-facts .overview-sync dd.overview-sync-settings { margin-top: 0.25rem; font-size: var(--text-sm); }
button.sync-settings-button {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0; border: 0; background: none;
  color: var(--muted); font: inherit; text-align: left; cursor: pointer;
}
button.sync-settings-button:hover, button.sync-settings-button:focus-visible { color: var(--fg); }
.sync-settings-pencil { display: inline-flex; }
.sync-settings-pencil svg { width: 0.95rem; height: 0.95rem; }
/* A choice said in a word, with a line under it saying what it means. */
label.radio.radio-hinted { align-items: flex-start; padding: 0.3rem 0; }
label.radio.radio-hinted input { margin-top: 0.2rem; }
label.radio.radio-hinted > span { display: flex; flex-direction: column; min-width: 0; }
/* What keeps a campaign linked, a line each, under its disabled choice. */
.sync-settings-unhandled { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.3rem; }
.sync-settings-unhandled > span::before { content: "– "; }
label.radio:has(input:disabled) { cursor: default; }
/* A fieldset is as wide as its longest line unless told otherwise, which
   would carry the hints past the dialog's edge rather than wrap them. */
.sync-settings fieldset.choice { min-inline-size: 0; }
/* The campaign's name and Rename, first, where a narrow screen shows them:
   the name whole, over as many lines as it takes, as big as the bar's. */
.overview-name { display: none; }
@media (max-width: 40rem), (max-height: 30rem) {
  .overview-facts .overview-name { display: block; }
  .overview-facts .overview-name dd { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; }
  .overview-name-text { min-width: 0; font-size: var(--text-xl); font-weight: 700; overflow-wrap: anywhere; }
  .overview-name .icon-button { flex: none; width: 2.75rem; height: 2.75rem; margin: -0.5rem -0.625rem -0.5rem 0; }
  .overview-name .icon-button svg { width: 1.5rem; height: 1.5rem; }
  /* The bar keeps the way out and the way through the list, with the count
     it has room for again; its name is for a screen reader alone. */
  .campaign-bar .takeover-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .campaign-bar .campaign-steps .small { display: inline; }
}
/* Whether the campaign runs, then: the switch and its word, as Sync
   automatically has them. */
.overview-status label.status-label,
.adgroup-status label.status-label { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: normal; }
.overview-status label.status-label:has(:disabled),
.adgroup-status label.status-label:has(:disabled) { cursor: default; }
/* Schedule campaign at the far end of the switch's line, as Add labels is
   of its; under the switch, when it is next started or paused by itself. */
.overview-facts .overview-status dd:first-of-type { flex-direction: row; justify-content: space-between; align-items: center; }
.overview-facts .overview-status-next:has(.status-next:empty) { display: none; }
.status-next { display: inline-flex; align-items: center; gap: 0.35rem; }
.status-next svg { width: 1rem; height: 1rem; }
/* Over the preview of a campaign whose ad groups are paused one by one: the
   switch of the ad group shown, and Schedule ad group at the far end. */
.adgroup-status { margin: 0; padding: 0.5rem 0.5rem 0; }
.adgroup-status dt { color: var(--muted); font-size: var(--text-sm); }
.adgroup-status dd { margin: 0.15rem 0 0; }
.adgroup-status-line { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.adgroup-status-line form { margin: 0; }
.adgroup-status-next:has(.status-next:empty) { display: none; }
.adgroup-status button.link { text-decoration: none; }
.status-schedules .status-schedule-form { margin-top: 1rem; }
.status-schedules .status-schedule-form h3 { margin: 0 0 0.5rem; }
/* The sync plan: what the network would refuse first, then the campaign and
   its ad groups, each ad a row of what it says. */
.sync-plan section { margin-top: 1.5rem; }
.sync-plan h2 { margin: 0 0 0.5rem; font-size: var(--text-base); }
.plan-passed { padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok-fg); font-weight: 600; }
.plan-ads { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.plan-ads th, .plan-ads td { padding: 0.35rem 0.5rem; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.plan-ads th { color: var(--muted); font-weight: 600; }
.plan-url { overflow-wrap: anywhere; }
.overview-facts button.link:disabled { color: var(--muted); cursor: default; }
.overview-preview { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; }
/* Where the preview is drawn: its room held whether or not there is an ad.
   On the box's own colour, with nothing behind the ad: the ad is the
   picture, and a frame round it is one more grey. */
.preview-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 14rem;
  padding: 1.5rem;
}
/* A search ad as Google draws one, in Google's colours whatever this page's
   theme: it is a picture of a results page, not a part of this one. */
.search-ad {
  width: 100%;
  max-width: 40rem;
  padding: 1rem 1.25rem;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #ffffff;
  color: #202124;
  font-family: Arial, sans-serif;
}
.search-ad p { margin: 0; }
.search-ad .search-ad-sponsored { font-size: 0.875rem; font-weight: 700; }
.search-ad .search-ad-url { margin-top: 0.35rem; font-size: 0.875rem; overflow-wrap: anywhere; }
.search-ad .search-ad-headline { margin-top: 0.35rem; color: #1a0dab; font-size: 1.25rem; line-height: 1.3; }
.search-ad .search-ad-description { margin-top: 0.4rem; color: #4d5156; font-size: 0.875rem; line-height: 1.45; }
.search-ad .search-ad-callouts { margin-top: 0.3rem; color: #4d5156; font-size: 0.875rem; }
.search-ad .search-ad-business { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.35rem; font-size: 0.875rem; }
.search-ad .search-ad-business img { width: 1.5rem; height: 1.5rem; border-radius: 50%; object-fit: cover; }
.search-ad .search-ad-sitelinks { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.4rem; color: #1a0dab; font-size: 0.875rem; }
/* Bing's: the headline first, and under it the address, green, after a
   small Ad mark. */
.search-ad .search-ad-text > .search-ad-headline:first-child { margin-top: 0; }
.search-ad .search-ad-badge {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0 0.25rem;
  border: 1px solid #70757a;
  border-radius: 2px;
  color: #70757a;
  font-size: 0.75rem;
  line-height: 1.3;
}
.search-ad .search-ad-url:has(.search-ad-badge) { color: #006d21; }
/* The text, and the picture beside it where there is one, as Google puts an
   image asset: a small square to the right. */
.search-ad-body { display: flex; align-items: flex-start; gap: 1rem; }
.search-ad-text { flex: 1; min-width: 0; }
.search-ad .search-ad-image {
  flex: none;
  width: 5.5rem;
  height: 5.5rem;
  margin-top: 0.35rem;
  border-radius: 8px;
  object-fit: cover;
}
.preview-empty { margin: 0; text-align: center; }
/* A responsive display ad as a card, in Google's colours whatever this page's
   theme: the picture over the text, the button to the site at its corner. */
/* A Facebook ad as the feed shows it: who it is from, the text, the picture
   square, and the grey bar under it with the site, the headline and the
   button -- in Facebook's own colours, as the Google ads are in Google's. */

/* A choice of two ways, each said under its name; the positions to tick only
   where placing by hand is chosen. */
.placement-modes { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.placement-mode { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; }
.placement-mode input { margin-top: 0.2rem; }
.placement-mode > span { display: grid; gap: 0.1rem; }
.placements-manual { display: none; gap: 1rem; margin-bottom: 1rem; }
.placements-choice:has(input[name="placement"][value="manual"]:checked) .placements-manual { display: grid; }
.placement-platform { margin: 0; padding: 0; border: 0; }
/* The days of the week, an hour to start and one to stop each. */
.schedule { margin: 0 0 1rem; border-collapse: collapse; }
.schedule th { padding: 0 1rem 0.25rem 0; text-align: left; font-size: var(--text-sm); }
.schedule td { padding: 0.2rem 1rem 0.2rem 0; }
.placement-platform legend { margin-bottom: 0.4rem; padding: 0; font-weight: 600; }

/* A catalog ad's products, a card each, swiped through side by side. */
.fb-carousel { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0 0.75rem 0.75rem; scroll-snap-type: x mandatory; }
/* A Shopping ad: the product's picture, title and price, and the shop -- as
   Google draws one among others in a row of them. */
.shopping-ad {
  width: 200px; padding: 0.75rem; border: 1px solid #dadce0; border-radius: 8px;
  background: #fff; color: #202124; font-family: Arial, sans-serif;
}
.shopping-ad p { margin: 0; }
.shopping-ad-sponsored { font-size: 0.75rem; font-weight: 700; margin-bottom: 0.5rem !important; }
.shopping-ad-image { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 4px; background: #f8f9fa; }
.shopping-ad-noimage { display: grid; place-items: center; color: #5f6368; font-size: 0.75rem; }
.shopping-ad-title {
  margin-top: 0.5rem !important; font-size: 0.875rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shopping-ad-price { margin-top: 0.35rem !important; font-size: 0.875rem; }
.shopping-ad-price del { color: #5f6368; font-size: 0.8125rem; }
.shopping-ad-shop { margin-top: 0.2rem !important; color: #5f6368; font-size: 0.8125rem; }
.fb-card { flex: none; width: 70%; overflow: hidden; border: 1px solid #dadde1; border-radius: 8px; background: #f0f2f5; scroll-snap-align: start; }
.fb-card-image { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.fb-card-text { padding: 0.5rem 0.6rem 0.25rem; }
.fb-card-cta { display: block; margin: 0.25rem 0.6rem 0.6rem; text-align: center; }
/* A collection: its picture, and four of the products in a row under it. */
.fb-collection-hero { aspect-ratio: 1.91; }
.fb-collection { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding-bottom: 2px; }
.fb-collection-item { aspect-ratio: 1; background: #f0f2f5; }
.fb-collection-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fb-ad .fb-collection-headline { padding: 0.6rem 0.75rem; }
/* Over the fourth product: there are more, a tap away. */
.fb-collection-more {
  position: absolute; top: 0; right: 0; bottom: 2px; width: calc((100% - 6px) / 4);
  display: flex; align-items: center; justify-content: center;
  background: rgb(0 0 0 / 0.35); color: #fff; font-weight: 600; font-size: 0.9rem;
}

/* From and to side by side. */
.age-range { display: flex; gap: 1rem; }

/* A Performance Max audience signal's ages, as the old app has them: one range,
   "to" and Unknown beside From and To, To's ages below From's not offered. */
.pmax-ages { align-items: flex-end; flex-wrap: wrap; }
.pmax-ages .field { margin: 0; }
/* Level with the selects rather than with their labels too: as tall as one. */
.pmax-ages > .pmax-ages-to, .pmax-ages > .checkbox { display: flex; align-items: center; min-height: calc(1.5em + 1rem + 2px); margin: 0; }
.pmax-ages:has(#field-age-from option[value="25"]:checked) #field-age-to option[value="24"],
.pmax-ages:has(#field-age-from option[value="35"]:checked) #field-age-to option[value="24"],
.pmax-ages:has(#field-age-from option[value="35"]:checked) #field-age-to option[value="34"],
.pmax-ages:has(#field-age-from option[value="45"]:checked) #field-age-to option[value="24"],
.pmax-ages:has(#field-age-from option[value="45"]:checked) #field-age-to option[value="34"],
.pmax-ages:has(#field-age-from option[value="45"]:checked) #field-age-to option[value="44"],
.pmax-ages:has(#field-age-from option[value="55"]:checked) #field-age-to option[value="24"],
.pmax-ages:has(#field-age-from option[value="55"]:checked) #field-age-to option[value="34"],
.pmax-ages:has(#field-age-from option[value="55"]:checked) #field-age-to option[value="44"],
.pmax-ages:has(#field-age-from option[value="55"]:checked) #field-age-to option[value="54"],
.pmax-ages:has(#field-age-from option[value="65"]:checked) #field-age-to option[value="24"],
.pmax-ages:has(#field-age-from option[value="65"]:checked) #field-age-to option[value="34"],
.pmax-ages:has(#field-age-from option[value="65"]:checked) #field-age-to option[value="44"],
.pmax-ages:has(#field-age-from option[value="65"]:checked) #field-age-to option[value="54"],
.pmax-ages:has(#field-age-from option[value="65"]:checked) #field-age-to option[value="64"] { display: none; }

/* The Shopping feed its products are, while no Merchant Center account is chosen; and the
   upload's fields while it is not ticked. */
.merchant-center-form:has(#field-merchant-center option[value=""]:checked) .shopping-source { display: none; }
/* What a Performance Max campaign is made of: the line of the choice ticked. */
.merchant-center-form:has(input[name="shopping-only"][value="on"]:checked) .pmax-content-assets,
.merchant-center-form:has(input[name="shopping-only"][value="off"]:checked) .pmax-content-only { display: none; }
.pmax-content-only, .pmax-content-assets { margin: 0 0 0.25rem 1.75rem; }
.shopping-upload:not(:has(input[name="upload"]:checked)) .shopping-upload-fields { display: none; }
.shopping-upload-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1rem; }
.shopping-upload-fields > p { grid-column: 1 / -1; }

/* A Performance Max campaign's split: a condition's fields side by side, and the rest's
   name once it is ticked -- what is said without it otherwise. */
/* As wide as a condition's line needs, and its form across the whole of it rather than
   at a form's own width. */
.dialog-split { width: min(36rem, calc(100vw - 2rem)); }
.dialog-split .form { max-width: none; }
/* Lines of the filters' kind, laid out as a grid of their own: .filter-row, later in the
   sheet, would have them a flex line. The column titles over their fields. */
.filter-row.split-head, .filter-row.split-condition { display: grid; grid-template-columns: 0.9fr 1.3fr 0.6fr 1.2fr 2.25rem; }
.filter-row.split-head { margin-bottom: 0.25rem; }
.filter-row.split-condition :is(select, input) { flex: none; min-width: 0; width: 100%; }
.split-cell { display: block; min-width: 0; }
.split-label { display: none; font-weight: 600; margin-bottom: 0.25rem; }
/* On a phone, a condition two fields a line, the bin under them, and the titles left to
   the fields' own names. */
@media (max-width: 40rem), (max-height: 30rem) {
  .filter-row.split-head { display: none; }
  .split-label { display: block; }
  .filter-row.split-condition { grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }
  .filter-row.split-condition .icon-button { justify-self: end; grid-column: 2; }
}
.split-rest:not(:has(input[name="split-rest"]:checked)) .split-rest-name,
.split-rest:has(input[name="split-rest"]:checked) .split-rest-off { display: none; }

/* An asset group's Shopping: its filters and products while it is not off, and a
   filter's fields side by side. */
.pmax-shopping:has(input[name="mode"][value=""]:checked) .pmax-shopping-products,
.pmax-shopping:has(input[name="mode"][value=""]:checked) .pmax-shopping-only { display: none; }
.pmax-shopping-only { margin-left: 1.75rem; }
/* An asset group Shopping only, in a row of what it sends none of: greyed,
   with nothing to set. */
.shopping-only-note {
  color: var(--muted);
  background: var(--subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: var(--text-sm);
}
.pmax-shopping-add { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; margin-bottom: 1rem; }
/* The fields' own space under them would put the button below their inputs. */
.pmax-shopping-add .field { margin-bottom: 0; }

/* And its genders: of Female and Male, the one left ticked is greyed and
   cannot be unticked, so that the signal is never of no one. */
.pmax-genders:has(input[value="FEMALE"]:not(:checked)) label:has(input[value="MALE"]),
.pmax-genders:has(input[value="MALE"]:not(:checked)) label:has(input[value="FEMALE"]) {
  opacity: 0.5;
  pointer-events: none;
}

.fb-ad {
  width: 100%;
  max-width: 22rem;
  overflow: hidden;
  border: 1px solid #dadde1;
  border-radius: 8px;
  background: #fff;
  color: #050505;
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  text-align: left;
}
.fb-ad p { margin: 0; }
.fb-ad-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0.75rem 0.5rem; }
.fb-ad-avatar {
  position: relative; overflow: hidden;
  display: flex; flex: none; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: #e4e6eb; color: #65676b; font-weight: 700;
}
/* The page's picture over its initial, which shows until it comes. */
.fb-ad-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fb-ad .fb-ad-name { font-size: 0.9rem; font-weight: 600; line-height: 1.2; }
.fb-ad .fb-ad-sponsored { color: #65676b; font-size: 0.8rem; }
/* Cut short after three lines, as Facebook does with "... See more". */
.fb-ad .fb-ad-primary {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  margin: 0 0.75rem 0.6rem; font-size: 0.9rem; line-height: 1.35; overflow-wrap: anywhere;
}
.fb-ad-image { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f0f2f5; }
.fb-ad-no-image { display: flex; align-items: center; justify-content: center; color: #65676b; font-size: 0.8rem; }
.fb-ad-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: #f0f2f5; }
.fb-ad-link-text { flex: 1; min-width: 0; }
.fb-ad .fb-ad-site { overflow: hidden; color: #65676b; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.fb-ad .fb-ad-headline {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 0.95rem; font-weight: 600; line-height: 1.25;
}
.fb-ad .fb-ad-description { overflow: hidden; color: #65676b; font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }
.fb-ad-cta {
  flex: none; padding: 0.45rem 0.8rem; border-radius: 6px;
  background: #e4e6eb; color: #050505; font-size: 0.85rem; font-weight: 600;
}
/* A Facebook ad in Stories and Reels (views.fbStoryAd), on a Snapchat ad's
   frame: the page's picture smaller than the feed's, the first primary text
   and the button over the bottom. Beside the ad in the feed, each with which
   it is over it. */
.fb-placement { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin: 0; }
.fb-placement figcaption { text-align: center; }
.preview-ads > .fb-placement:last-child { flex-basis: min(15rem, 70%); }
/* Black above and under a picture or film wider than 9:16, as Meta shows one. */
.snapchat-ad.fb-story { background: #000000; }
.fb-story-avatar { width: 2rem; height: 2rem; font-size: 0.8rem; }
.fb-story-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 2rem 0.75rem 0.9rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.5));
}
.fb-story .fb-story-text {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 0.8rem; line-height: 1.3; overflow-wrap: anywhere;
}
.fb-story-bottom .snapchat-ad-button { text-align: center; }

/* An OpenAI chat card: the picture beside the text rather than over it, and
   each line cut with an ellipsis rather than wrapped -- the card is a fixed
   height in the chat, so a long title pushes nothing down. */
.chat-ad {
  display: flex;
  width: 100%;
  max-width: 22rem;
  overflow: hidden;
  border: 1px solid #dedede;
  border-radius: 12px;
  background: #fff;
  color: #202123;
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  text-align: left;
}
.chat-ad p { margin: 0; }
.chat-ad-image { display: block; flex: none; width: 7.25rem; height: 7.25rem; object-fit: cover; background: #f3f3f3; }
.chat-ad-no-image { display: flex; align-items: center; justify-content: center; color: #6f6f6f; font-size: 0.8rem; }
.chat-ad-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.15rem; padding: 1rem 0.75rem 0.75rem 0.95rem; }
.chat-ad-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.chat-ad .chat-ad-name { overflow: hidden; flex: 1; min-width: 0; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-ad-badge { flex: none; padding: 0.1rem 0.5rem; border-radius: 9px; background: #f1f1f1; color: #666; font-size: 0.75rem; }
.chat-ad .chat-ad-title { overflow: hidden; font-size: 0.9rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.chat-ad .chat-ad-body { overflow: hidden; color: #6f6f6f; font-size: 0.9rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }

.display-ad {
  position: relative;
  width: 100%;
  max-width: 20rem;
  overflow: hidden;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #ffffff;
  color: #202124;
  font-family: Arial, sans-serif;
}
.display-ad-image { display: block; width: 100%; aspect-ratio: 1.91; object-fit: cover; background: #f1f3f4; }
/* The ad square, as Google shows it too, where it has a square picture and
   no wide one: that picture whole, narrower. */
.display-ad-square { max-width: 15rem; }
.display-ad-square .display-ad-image { aspect-ratio: 1; }
.preview-shape figcaption { margin-top: 0.35rem; text-align: center; }
/* A Demand Gen ad group's video ad under its others: the film as YouTube
   pictures it, marked to play. */
/* An ad group's ads where it has several -- its ad of pictures and a video ad
   a film: a row scrolled across, each ad stopping in the middle. In the
   middle of the box where they all fit: the first and last take what room is
   left over, which is none once there is something to scroll. */
.preview-ads {
  display: flex; gap: 1rem; align-items: flex-start; width: 100%;
  overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  padding-bottom: 0.5rem;
}
.preview-ads > * { flex: 0 0 min(20rem, 85%); scroll-snap-align: center; }
.preview-ads > :first-child { margin-left: auto; }
.preview-ads > :last-child { margin-right: auto; }
.preview-ads:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A Performance Max campaign's example: what kind of ad it is over it, and
   a Shopping one's products side by side, three at a time. */
.pmax-example { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; }
/* Its formats are of different heights: the stage as tall as the tallest, a
   display or YouTube ad with its picture and texts, so the arrows under it
   stay where they are as they go from one to the next, as the old app keeps
   them. One taller still scrolls within it. */
.preview-stage:has(> .pmax-example, > .preview-fit > .pmax-example) { flex: none; height: 27rem; min-height: 0; overflow-y: auto; }
.pmax-format { margin: 0; text-align: center; }
.pmax-products > * { flex: 0 0 min(10rem, 45%); width: auto; }
.video-ad-film { position: relative; }
.video-ad-film .display-ad-image { aspect-ratio: 16 / 9; }
.video-ad-play {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: rgb(0 0 0 / 0.6); color: #fff; font-size: 1rem;
}
.display-ad-no-image { display: flex; align-items: center; justify-content: center; color: #80868b; font-size: 0.8rem; }
.display-ad-body { position: relative; padding: 0.75rem 1rem 1rem; }
.display-ad-brand { display: flex; align-items: center; gap: 0.4rem; min-height: 1.25rem; color: #5f6368; font-size: 0.75rem; }
.display-ad-logo { width: 1.25rem; height: 1.25rem; border-radius: 3px; object-fit: contain; }
.display-ad .display-ad-headline { margin: 0.4rem 2.75rem 0 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.display-ad .display-ad-description { margin: 0.3rem 2.75rem 0 0; color: #5f6368; font-size: 0.85rem; line-height: 1.4; }
/* A Google app ad: its texts the width of the card, and under them the app as
   its store names it, beside the button to install it. */
.app-ad .display-ad-headline, .app-ad .display-ad-description { margin-right: 0; }
.app-ad-app { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.75rem; }
.app-ad-icon {
  display: grid; flex: none; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 22%;
  background: #e8f0fe; color: #1a73e8; font-weight: 700;
}
.app-ad-name { flex: 1; min-width: 0; }
.app-ad-name p { margin: 0; overflow: hidden; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.display-ad .app-ad-store { color: #5f6368; font-size: 0.75rem; }
.app-ad-install {
  flex: none; padding: 0.45rem 0.9rem; border-radius: 1.2rem;
  background: #1a73e8; color: #ffffff; font-size: 0.85rem; font-weight: 600;
}
.display-ad-cta {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
}
/* An asset's row with the ad beside it, on a screen with room for both: the
   fields as wide as they are anyway, the ad in what is left. Narrower, the ad
   at the top of the page is the one to look at. */
.with-preview { display: flex; align-items: flex-start; gap: 2rem; }
.with-preview > .row-edit { flex: 0 1 36rem; min-width: 0; }
.with-preview > .row-preview { flex: 1; min-width: 20rem; max-width: 36rem; }
/* Narrower, the ad is a panel over the page instead, shown and shut by the
   Ad preview button beside the assistant's (AdPreviewToggle): the open row's
   preview, with what is typed in it, where a row with one is open; the
   overview's otherwise. At the foot of a screen held upright, the row's
   lines in view above it; at the right of one on its side, the fields in
   view beside it. Under the two buttons, which stay over it, and with room
   at its foot for them to be scrolled clear of. Nothing darkens behind it. */
.ad-preview-button { display: none; }
.ad-preview-close { display: none; }
/* The campaign's preview as the panel (views.AdPanel), unseen but there. */
#ad-panel { display: none; }
/* The box itself unseen where its button is, so that focused as the button
   is pressed it does not scroll the page to wherever else it would be. */
.ad-preview-toggle { position: fixed; right: calc(5.25rem + var(--safe-right)); bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 72rem) {
  .with-preview { display: block; }
  .with-preview > .row-preview { display: none; }
  .ad-preview-button {
    position: fixed;
    right: calc(5.25rem + var(--safe-right));
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.75rem;
    padding: 0 1rem 0 0.8rem;
    border-radius: 1.375rem;
    border: 1px solid var(--border);
    /* Raised, as what floats over the page is: a menu, a popover. */
    background: var(--raised);
    color: var(--fg);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.2);
    cursor: pointer;
    user-select: none;
  }
  .ad-preview-button svg { display: block; width: 1.25rem; height: 1.25rem; fill: currentColor; }
  .ad-preview-show, .ad-preview-shut { display: flex; align-items: center; gap: 0.4rem; }
  .ad-preview-shut,
  .ad-preview-toggle:checked + .ad-preview-button .ad-preview-show { display: none; }
  .ad-preview-toggle:checked + .ad-preview-button .ad-preview-shut { display: flex; }
  body:not(:has(.assistant-button)) .ad-preview-button { right: 1.25rem; }
  .ad-preview-toggle:focus-visible + .ad-preview-button { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* Open, over the panel, it is a plain button as the panel's others are:
     an edge, no fill of its own, no lift off the page -- and none under the
     pointer either. */
  .ad-preview-toggle:checked + .ad-preview-button { background: transparent; box-shadow: none; }
  /* The panel is an open row's own preview, which the page does not show
     on a screen this narrow -- of the open rows with one, the one app.js
     marks (markAdPanel): more than one would be panels one over the other
     -- or else the campaign's, in a copy of its own (views.AdPanel): the
     preview at the top of the page stays where it is. */
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel],
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    max-width: none;
    /* As tall as the ad and its arrows, up to a little over half the
       screen, the rest left to the page it takes its room from; an ad taller
       still is drawn smaller to fit (fitAd), and only one too tall for that
       scrolls above the arrows (below). */
    max-height: 55dvh;
    margin: 0;
    /* At its foot a band for the buttons over it -- Close, the assistant's
       -- and, standing upright, the arrows beside them (below). */
    padding: 0.75rem 0.75rem calc(4.75rem + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-top: 1px solid var(--raised-edge);
    border-radius: 0;
    /* Raised, as a menu or a popover is: over the page, not part of it.
       (A row's preview named under #campaign-settings, to win over the
       edges a phone gives the previews in the page.) */
    background: var(--raised-2);
    /* Where it slides in from and back to (ad-preview-in, -out): the foot of
       the screen, its right on a screen on its side. */
    --ad-preview-away: 0 100%;
  }
  /* Sliding in as the button opens it, and out as the button shuts it:
     app.js says which, on the button alone -- not as a swap draws the panel
     again, for the next ad, which would slide it in again each time. */
  .takeover[data-ad-preview="opening"]:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel],
  .takeover[data-ad-preview="opening"]:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel {
    animation: ad-preview-in 260ms cubic-bezier(0.2, 0, 0, 1);
  }
  .takeover[data-ad-preview="closing"]:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel],
  .takeover[data-ad-preview="closing"]:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel {
    animation: ad-preview-out 200ms cubic-bezier(0.3, 0, 1, 1) forwards;
  }
  /* The ✕ in its top right corner, over the ad's: on a faint shade, to be
     seen over a picture. */
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > .ad-preview-close,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .ad-preview-close {
    position: absolute;
    top: 0.5rem;
    right: calc(0.5rem + var(--inset-right));
    z-index: 1;
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    background: var(--semi-transparent-bg);
    color: var(--fg);
  }
  .takeover:has(> .ad-preview-toggle:checked) .ad-preview-close:hover { background: var(--semi-transparent-bg-hover); }
  /* The ad group and the arrows at their own height, under the ad. */
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > *,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > * { flex: none; }
  /* What does not fit scrolls in the ad's place (below), not the panel; a
     strip above it, so that the ad scrolled is not cut off at the panel's
     very edge -- on its side, none (below). */
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel],
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel { overflow: hidden; padding-top: 0.5rem; }
  /* The ad scrolls in what is left above the ad group and the arrows, which
     stay put at the foot, standing upright as on its side. Laid out from its
     foot, it opens there -- as each new ad is drawn too -- next to the
     arrows, and is scrolled up for the top of the ad. */
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > .preview-stage,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-stage {
    flex: 1 1 auto;
    flex-direction: column-reverse;
    justify-content: flex-start;
    min-height: 0;
    /* To the panel's right edge, its scroll bar there; the ad kept off it,
       and off a camera's cut-out there by as much as the panel is. */
    margin-right: calc(-0.75rem - var(--inset-right));
    padding: 0 calc(0.75rem + var(--inset-right)) 0 0;
    /* The system's own scroll bar: on a phone, over the ad while it is
       scrolled, and gone again. */
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > .preview-stage > *,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-stage > * {
    /* The ad's holder (views.previewFit), as wide as the panel, the ad in
       the middle of it. */
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    margin-block: 0.75rem;
    /* Drawn smaller, all of it -- pictures, words and the room between:
       still a fair picture of it, to squint at, rather than one to scroll.
       As small as it takes to fit the panel, by --ad-scale from fitAd, and
       as tall as it is drawn (--ad-fit-height): the holder's own box ends
       where the ad drawn does, rather than the ad's box hanging out of the
       panel's foot -- which Chrome on Android drew the ad higher for, out of
       place. Scaled rather than zoomed, which neither narrows an ad as wide
       as the panel nor, in Safari, makes its words smaller. */
    height: var(--ad-fit-height, auto);
    transform: scale(var(--ad-scale, 0.8));
    transform-origin: top center;
  }
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > .preview-stage > * > *,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-stage > * > * { flex: none; }
  /* The panel takes its room from the page rather than lying over it: the
     page ends above it, and what is scrolled to stops above it too. Its
     height, which only the panel's contents decide, is measured
     (fitAdPreview). */
  .takeover:has(> .ad-preview-toggle:checked) { --page-foot: calc(var(--ad-preview-room, 0px) + var(--ad-preview-hold, 0px) + 1rem); }
  html:has(#ad-preview-open:checked) { scroll-padding-bottom: var(--ad-preview-room, 0px); }
}
/* The ad group's status is the campaign page's, at the top of it, not the
   panel's: the panel is the ad, and the way through the ads. */
@media (max-width: 72rem) {
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .adgroup-status { display: none; }
}
/* Standing upright, the arrows are in the band at the panel's foot, level
   with Close and left of it, rather than a line of their own above it: the
   room is the ad's. The ad group's choice, where there are more, is too wide
   for the band beside them: a line of its own under the ad, and the panel
   that much taller, so the ad is not drawn smaller for it. */
@media (max-width: 72rem) and (orientation: portrait) {
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser { display: contents; }
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser > .preview-steps,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser > .preview-steps {
    position: absolute;
    left: calc(0.75rem + var(--safe-left));
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    height: 2.75rem;
    margin: 0;
  }
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser > .preview-adgroups,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser > .preview-adgroups { flex: none; margin-top: 0.25rem; }
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel]:has(> .preview-browser > .preview-adgroups),
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel:has(> .preview-browser > .preview-adgroups) { max-height: 60dvh; }
}
/* The button that has the panel take the whole screen (adPreviewFull): under
   the ✕, halfway between it and the band at the panel's foot, on the same
   faint shade. On the whole screen it is the way back, where the ✕ was, and
   the ✕ steps aside: the ad is looked at there, not shut. The panel grows to
   it and shrinks back as one picture moving (app.js), and the ad is drawn as
   large as it fits, up to its own size (fitAd). Over the Close and assistant
   buttons, under the toasts. */
.ad-preview-full { display: none; }
@media (max-width: 72rem) {
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .ad-preview-full,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .ad-preview-full {
    position: absolute;
    top: calc((3rem + 100% - 4.75rem - env(safe-area-inset-bottom, 0px)) / 2 - 1.25rem);
    right: calc(0.5rem + var(--inset-right));
    z-index: 1;
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    background: var(--semi-transparent-bg);
    color: var(--fg);
  }
  .takeover:has(> .ad-preview-toggle:checked) .ad-preview-full:hover { background: var(--semi-transparent-bg-hover); }
  /* Zoom in, and on the whole screen the ✕ that brings it back: one of the two. */
  .ad-preview-full > .ad-preview-grow { display: contents; }
  .ad-preview-full > .ad-preview-shrink,
  .takeover:has(> .ad-preview-full-toggle:checked) .ad-preview-full > .ad-preview-grow { display: none; }
  .takeover:has(> .ad-preview-full-toggle:checked) .ad-preview-full > .ad-preview-shrink { display: contents; }
  .takeover:has(> .ad-preview-full-toggle:focus-visible) .ad-preview-full { outline: 2px solid var(--accent); outline-offset: 2px; }

  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel],
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel {
    inset: 0;
    z-index: 70;
    width: auto;
    max-height: none;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) calc(0.75rem + var(--inset-right))
      calc(4.75rem + env(safe-area-inset-bottom, 0px)) calc(0.75rem + var(--inset-left));
    border: 0;
    animation: none;
  }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .ad-preview-close,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .ad-preview-close { display: none; }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .ad-preview-full,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .ad-preview-full {
    /* Further from the screen's corner than the panel's ✕ is from the
       panel's: here the corner is the screen's own, rounded. */
    top: max(0.75rem, calc(0.5rem + env(safe-area-inset-top, 0px)));
    right: max(1.25rem, calc(0.5rem + var(--inset-right)));
  }
  /* Named only while it grows or shrinks, so that it is that, and not the
     page, that is seen to move; the ad in it with it. */
  html[data-ad-zoom] .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel],
  html[data-ad-zoom] .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel { view-transition-name: ad-preview; }
  html[data-ad-zoom] .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-stage > :first-child,
  html[data-ad-zoom] .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-stage > :first-child { view-transition-name: ad-preview-ad; }
}
/* Standing upright on the whole screen, the ad in the middle of the screen,
   not of the room above the arrows: as much kept clear above it as the band
   and the ad group's choice take below. And the arrows, alone in the band
   now that Close is under the panel, in the middle of it. */
@media (max-width: 72rem) and (orientation: portrait) {
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel],
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel { padding-top: calc(4.75rem + env(safe-area-inset-bottom, 0px)); }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel]:has(> .preview-browser > .preview-adgroups),
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel:has(> .preview-browser > .preview-adgroups) { padding-top: calc(8.125rem + env(safe-area-inset-bottom, 0px)); }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-stage,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-stage { justify-content: center; }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser > .preview-steps,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser > .preview-steps { left: 50%; translate: -50% 0; }
}
/* On its side the screen is wide and short: the ad in the middle of the
   left half, as large as the screen's height lets it be, and in the middle
   of the right half what goes with it -- the ad group's status, its choice,
   the arrows -- one under the other, as standing upright. No band kept at
   the foot for Close and the assistant's button, which are under it. */
@media (max-width: 72rem) and (orientation: landscape) {
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel],
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    justify-items: center;
    gap: 0.75rem 1.5rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > :not(.ad-preview-close, .ad-preview-full, .preview-stage),
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > :not(.ad-preview-close, .ad-preview-full, .preview-stage) { grid-column: 2; width: min(100%, 20rem); margin: 0; }
  /* The left half, from the top of the screen to its foot. */
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-stage,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-stage {
    position: absolute;
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    left: calc(0.75rem + var(--inset-left));
    right: 50%;
    width: auto;
    margin: 0;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
  }
  /* The ad group's choice as wide as the column, the arrows in the middle
     under it. */
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser { flex-direction: column; align-items: center; gap: 0.75rem; padding: 0; }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser > .preview-adgroups,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser > .preview-adgroups { align-self: stretch; }
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel] > .preview-browser > .preview-steps,
  .takeover:has(> .ad-preview-toggle:checked):has(> .ad-preview-full-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .preview-browser > .preview-steps { margin-left: 0; }
}
/* On its side the panel's top right is the screen's, which is rounded: its
   ✕ and the zoom button further from that edge than standing upright, or
   as far as a camera's cut-out there asks. */
@media (max-width: 72rem) and (orientation: landscape) {
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > :is(.ad-preview-close, .ad-preview-full),
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > :is(.ad-preview-close, .ad-preview-full) { right: max(1.25rem, calc(0.5rem + var(--inset-right))); }
  .takeover:has(> .ad-preview-toggle:checked) .setting[open] .with-preview > .row-preview[data-panel] > .ad-preview-close,
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel > .ad-preview-close { top: 0.75rem; }
}
/* Slow enough to be seen as the panel growing, not a jump. */
::view-transition-group(ad-preview),
::view-transition-group(ad-preview-ad),
::view-transition-old(ad-preview),
::view-transition-new(ad-preview),
::view-transition-old(ad-preview-ad),
::view-transition-new(ad-preview-ad) { animation-duration: 450ms; animation-timing-function: cubic-bezier(0.2, 0, 0, 1); }
@keyframes ad-preview-in { from { translate: var(--ad-preview-away); } }
@keyframes ad-preview-out { to { translate: var(--ad-preview-away); } }
@media (max-width: 72rem) and (orientation: landscape) {
  /* On its side, the page is narrowed to what the panel leaves -- and its
     top laid out as on a narrow screen, the facts over the ad rather than
     beside it. Said here, by the panel being open, rather than by a
     container query on the page's width: a container holds what is fixed
     inside it, and the panel is inside the page. */
  .takeover:has(> .ad-preview-toggle:checked) { padding-right: min(20rem, 45vw); }
  .takeover:has(> .ad-preview-toggle:checked) .campaign-overview { grid-template-columns: minmax(0, 1fr); }
  .takeover:has(> .ad-preview-toggle:checked) #campaign-settings .setting[open] .with-preview > .row-preview[data-panel],
  .takeover:has(> .ad-preview-toggle:checked):not(:has(.setting[open] .with-preview)) #ad-panel {
    inset: 0 0 0 auto;
    /* Just the room the page leaves it, not the least a row's preview
       beside it takes on a wide screen. */
    width: min(20rem, 45vw);
    min-width: 0;
    --ad-preview-away: 100% 0;
    max-height: none;
    padding-right: calc(0.75rem + var(--inset-right));
    border-top: 0;
    border-left: 1px solid var(--raised-edge);
    /* The ad from the panel's very top, nothing above it. */
    padding-top: 0;
  }
}

/* What holds the ad where the preview can be the panel (views.previewFit):
   only there is it a box of its own. */
.preview-fit { display: contents; }
/* The ad group whose ads the preview shows, under it beside the arrows. */
.preview-adgroups { flex: 1; min-width: 0; }
.preview-adgroups select { width: 100%; }
/* From one ad to the next, under the preview. */
.preview-browser { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 0.25rem; }
.preview-steps { display: flex; flex: none; align-items: center; gap: 0.5rem; margin-left: auto; }
.preview-steps :is(button, .button), .preview-shuffle { min-width: 2.5rem; padding: 0.5rem 0.6rem; }
/* The shuffle button (views.previewShuffle), left of the ad group's choice,
   of the arrows' size, which it is among in the panel. */
.preview-shuffle { flex: none; }
/* The arrow as tall as the line a word would be, for the button to be the
   same height as one with a word -- a button, or a locked row's link
   (views.ShownOnly). */
:is(.preview-steps :is(button, .button), .preview-shuffle) > svg { display: block; width: 1.25rem; height: 1.5rem; }
/* Waiting for the ad, the arrow's spinner (is-busy) is drawn where the arrow
   was, the arrow's room kept: a spinner smaller than the arrow would have
   the button shrink under it. */
.preview-steps :is(button, .button).is-busy { position: relative; }
.preview-steps :is(button, .button).is-busy > svg { display: block; visibility: hidden; }
.preview-steps :is(button, .button).is-busy::before { position: absolute; inset: 0; margin: auto; }
:is(.preview-steps button, .preview-shuffle):disabled { opacity: 0.4; cursor: default; }

@media (max-width: 48rem) {
  .campaign-overview { grid-template-columns: minmax(0, 1fr); }
}

/* A campaign's settings, each a line saying what it is until somebody opens it.
   Read far more often than changed, so what they are is what is shown. */
/* A box's name a heading of its own, as the old app's were, and room enough
   above it to start a new part of the page. */
.settings-group { margin-top: 3rem; }
.settings-title { margin: 0 0 0.75rem; font-size: var(--text-xl); font-weight: 700; color: var(--fg); }
/* A box kept as the network has it (views.lockableGroup): its rows still open
   to show what they hold, greyed -- their names too -- and a lock by the box's
   name; the fieldset round them is disabled, so
   nothing in them can be changed. What would only be pressed in vain -- Save,
   Add, a way to a picker -- is not shown at all. */
.settings-locked .settings-title { display: flex; align-items: center; gap: 0.4rem; }
/* A row locked on its own in a box that is not (views.settingRowLockable):
   its name greyed, with the lock by it. */
.setting-locked > summary .setting-label { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); }
.setting-locked > .setting-detail { color: var(--muted); }
.settings-lock-icon { display: inline-flex; color: var(--muted); }
.settings-lock-icon svg { width: 1.1em; height: 1.1em; }
.settings-locked-note { margin: -0.25rem 0 0.75rem; }
.settings-lock { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-lock :is(.setting-label, .setting-note:not(.warning), .setting-detail) { color: var(--muted); }
.settings-lock :is(input, select, textarea, button):disabled { opacity: 0.6; cursor: not-allowed; }
/* A locked campaign's bid set on its ad groups (Campaign.BidKeptAtNetwork), which a
   sync does not send: while such a strategy is chosen, before it is saved
   too, its target and cap are greyed and not to be pressed, and why is said.
   The server refuses a change to them all the same. */
.bidding-form .bids-kept { display: none; }
.bidding-form:has(option[data-bids-kept]:checked) .bids-kept { display: block; }
.bidding-form:has(option[data-bids-kept]:checked) :is(.bid-target, .bid-cap) { opacity: 0.5; pointer-events: none; }
/* Its pictures and films greyed as well, shut or open, as a greyed button in
   the rows' bar is. */
.settings-lock :is(.summary-thumbs, .image-tile) :is(img, video) { opacity: 0.5; }
.settings-lock :is(.setting-actions, .setting-options, a.button:not(.look), .image-remove, .icon-button.remove) { display: none; }
/* The rows of a box sit together as one, and an open row stands apart from its
   neighbours: what it holds is being worked on, and reads as a thing of its
   own. Shut, the rows are framed on the page's colour, a line between each,
   and the frame is on the rows so the box can part. Open, a row keeps its
   frame, and stands apart by the room round it. */
/* In the box, the box's colour is the page: a table's sticky header in it
   takes that colour, and hovering and choosing go a step from it. */
.setting {
  --bg: var(--setting);
  background: var(--bg);
  border: 1px solid var(--setting-edge);
  --row-hover: color-mix(in srgb, var(--ink) 4%, var(--bg));
  --subtle: color-mix(in srgb, var(--ink) 5%, var(--bg));
  --nav-active: color-mix(in srgb, var(--accent) var(--active-share), var(--bg));
}
.setting:not([open]) + .setting:not([open]) { border-top: 0; }
.setting:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.setting:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.setting[open] + .setting,
.setting + .setting[open] {
  margin-top: 0.75rem;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.setting:has(+ .setting[open]),
.setting[open]:has(+ .setting) {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
/* The hover follows the row's corners rather than showing square through them. */
.setting > summary { border-radius: inherit; }
.setting[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.setting > summary {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  list-style: none;
}
.setting > summary::-webkit-details-marker { display: none; }
.setting-label { flex: none; width: 11rem; font-weight: 500; }
/* One line, however much it says: the rest is in the open row. */
.setting-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
/* Open, the row shows what it is set to in full below, so the line saying it
   in short gives way. Hidden rather than taken out, so nothing on the line
   moves as the row opens and shuts. */
details.setting[open] > summary .setting-summary { visibility: hidden; }
/* A row opens and shuts with a short slide -- short enough not to be waited
   for -- and the chevron turns over with it. A browser that cannot animate to
   a height it does not know opens the row at once, as it always did.
   Clipped only while shut or shutting: open, what hangs below a field -- the
   columns a $ offers -- reaches past the row as it must. Opening, what the row
   holds is under the rows below it until they have moved out of the way. */
.setting { interpolate-size: allow-keywords; transition: margin-top 180ms ease; }
.setting::details-content {
  height: 0;
  overflow: clip;
  transition: height 180ms ease, content-visibility 180ms allow-discrete;
}
.setting[open]::details-content { height: auto; overflow: visible; }
/* Put open without sliding, to slide shut from there: see app.js. */
.setting.at-once, .setting.at-once::details-content { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .setting, .setting::details-content { transition: none; }
}
/* The pictures a shut Images row has chosen, small, in place of words. A
   little taller than the line, and the row kept its height by letting them
   reach into its padding. */
.summary-thumbs { display: inline-flex; gap: 0.3rem; margin-block: -0.35rem; vertical-align: middle; }
/* Nothing to cut short with an ellipsis, and the pictures reach past the line. */
.setting-summary:has(.summary-thumbs) { overflow: visible; }
/* As high as each other, as wide as their shape makes them. */
.summary-thumbs img,
.summary-thumbs video {
  width: auto;
  max-width: 5rem;
  height: 2rem;
  border-radius: 4px;
  object-fit: cover;
  background: var(--subtle);
}
/* A note at the far end of the line -- "2 ad groups differ" -- apart from what
   the setting is, and a shade darker than it. */
.setting-note {
  flex: none;
  margin-left: auto;
  color: color-mix(in srgb, var(--fg) 75%, var(--muted));
  font-size: var(--text-sm);
  white-space: nowrap;
}
.setting-note + .setting-chevron { margin-left: -0.625rem; }
/* A note of something the platform will refuse or ignore: "Needs 1:1". */
.setting-note.warning { color: var(--bad-fg); }
/* A button the ads cannot have, said under the select it is shown chosen in,
   until another is chosen: the select is required, and valid then. */
.field:has(select:valid) .wrong-button { display: none; }
/* The size of every other icon, Material's for one at a row's end. In the
   middle of the line rather than on its words' baseline, which a lone icon
   would sit its foot on. In a circle as an icon button is, a finger's size,
   reaching into the row's padding so the row is no taller and the icon keeps
   its place. */
.setting-chevron {
  display: grid;
  place-items: center;
  align-self: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.625rem -0.625rem -0.625rem auto;
  border-radius: 50%;
  color: var(--muted);
}
.setting-chevron svg { display: block; width: 1.5rem; height: 1.5rem; }
/* A row is pressed anywhere along it, but what shows the press is the
   chevron, round, rather than the browser's square flash over the whole row:
   app.js ripples it from its middle. */
.setting > summary { -webkit-tap-highlight-color: transparent; }
.setting > summary:active .setting-chevron { background: var(--border); }
.setting[open] .setting-chevron { transform: rotate(180deg); }
.setting-detail { padding: 0 1rem 1rem calc(11rem + 2.5rem); }
.setting-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.setting-facts dt { color: var(--muted); }
.setting-facts dd { margin: 0; }
/* A row's buttons -- Add, From feed, Suggest, Close -- each on one line, on
   a second line of their own where they do not all fit on the first. */
.setting-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.setting-actions > * { white-space: nowrap; }
/* A row's ways to change it, beside Add, on a line above its Close. */
.setting-options { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
/* A link out of the app among a row's buttons: Google's own page for it. */
.setting-options a.button[target="_blank"] { display: inline-flex; align-items: center; gap: 0.4rem; }
.setting-options a.button[target="_blank"] svg { width: 1rem; height: 1rem; }
/* The Feed row's Close stands apart from the table and pager above it. */
.setting-actions.feed-close { margin-top: 1.5rem; }

@media (max-width: 40rem), (max-height: 30rem) {
  /* Stacked, the label sits over what it says rather than beside it, and the
     chevron keeps to the right of the label, on its line, however long the
     line under it is. */
  .setting > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 1rem;
  }
  .setting-label { width: auto; }
  .setting-summary { grid-row: 2; }
  .setting-note { grid-row: 3; margin-left: 0; }
  .setting-chevron { grid-column: 2; grid-row: 1; margin-left: -0.625rem; }
  /* Open, the lines under the label are taken out rather than hidden: under
     it, nothing on its line moves as they go. */
  details.setting[open] > summary :is(.setting-summary, .setting-note) { display: none; }
  .setting-detail { padding-left: 1rem; }
}

/* An amount is a short number; a field the width of the form says otherwise. */
.amount { max-width: 10rem; }
.budget-form { max-width: none; }
/* How a Facebook campaign's budget is spent among its ad sets. Split evenly,
   the ad sets with a budget of their own and what the rest have each --
   and on the Ad group tab an ad set's own; under Advantage campaign budget
   neither, nor the tabs to reach one by, the stylesheet deciding as the
   choice is ticked. */
#setting-budget-split:has(input[name="split"][value=""]:checked) :is(.tabs, .budget-split-summary, .budget-split-warning) { display: none; }
.budget-split-summary { margin: -0.25rem 0 1rem 1.6rem; }
.budget-split-table { width: auto; min-width: min(24rem, 100%); }
.budget-split-table th, .budget-split-table td { padding: 0.4rem 0.75rem; }
.budget-split-table :is(th, td):first-child { padding-left: 0; overflow-wrap: anywhere; }
.budget-split-table :is(th, td):last-child { padding-right: 0; }
.budget-split-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.budget-split-table tbody tr:last-child td { border-bottom: 0; }
.budget-split-rest td { color: var(--muted); }
.budget-split-warning { color: var(--amber-fg); }
/* A PMax ad group of more products than Google takes of one by id. */
.shopping-cap-warning { color: var(--amber-fg); }
.budget-own-fields { display: flex; gap: 0.5rem; align-items: center; }
.budget-own-fields input { width: 8rem; text-align: right; }
.budget-own-fields select { width: auto; }
@media (max-width: 40rem), (max-height: 30rem) {
  .budget-split-summary { margin-left: 0; }
  .budget-split-table { width: 100%; }
}
/* A menu in a setting is as wide as its longest choice needs, not as wide as
   the row: "Target CPA" across the page reads as a field waiting for more. */
.budget-form .field select { width: auto; min-width: 12rem; max-width: 100%; }
/* Fields that go together side by side, each its own width -- a flight's
   first and last day -- one under the other where there is no room. */
.field-row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.field-row .field input[type="date"] { width: auto; }
/* A target is a number or a sum over the feed's columns -- $price * 0.1 -- so
   room for the second without a box across the page for the first. */
.field input.target { max-width: 20rem; }
/* One adjustment factor, or for view and click conversions one of each: the
   menu says which. */
.conversion-form:has(option[value="purchases_view_and_click"]:checked) .factor-factor,
.conversion-form:not(:has(option[value="purchases_view_and_click"]:checked)) .factor-view-factor,
.conversion-form:not(:has(option[value="purchases_view_and_click"]:checked)) .factor-click-factor { display: none; }
/* A unit contribution written, or taken from what the ads sold: the box says
   which. */
.unit-contribution-form:has(input[name="conversion-value"]:checked) .unit-contribution,
.unit-contribution-form:not(:has(input[name="conversion-value"]:checked)) .conversion-value { display: none; }
/* No target field under a strategy that takes none: the menu says which do. */
.bidding-form:has(option[data-target="none"]:checked) .bid-target { display: none; }
.bidding-form:has(#field-bid-strategy option:checked:not([data-calculates])) .calculate-button { display: none; }
/* The bid cap shows while a strategy that bids on products by hand is chosen. */
.bidding-form:not(:has(option[data-cap]:checked)) .bid-cap { display: none; }
/* And the bid limit while Maximize clicks is, on a campaign that takes one. */
.bidding-form:not(:has(option[data-limit]:checked)) .bid-limit { display: none; }

/* A part of a setting, named small above what it holds, and what it is set
   to with the pencil that changes it. */
.setting-part { margin: 0 0 0.25rem; font-size: var(--text-sm); font-weight: 400; color: var(--muted); }
.setting-value + .setting-part { margin-top: 1rem; }
/* A row's lines listed apart, a Performance Max custom segment's searches and
   sites: each part under a heading of its own, with room between them. */
.line-section + .line-section { margin-top: 1.5rem; }
.line-section .setting-part { margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; color: inherit; }
.line-section > p:last-child { margin-bottom: 0; }
/* The Adjustments row's two kinds, each a list of its own: headed as clearly
   as the row is, not as a field's quiet label. */
.adjustments-part { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; font-size: var(--text-base); font-weight: 600; color: var(--fg); }
/* The clock of the hourly kind, the calendar of the scheduled, as the old app
   had them. */
.adjustments-part svg { width: 1.25rem; height: 1.25rem; flex: none; }
.field + .adjustments-part { margin-top: 1.5rem; }
.setting-value { display: flex; align-items: center; gap: 0.25rem; margin: 0; }
/* A campaign's filters in their dialog: a column, a comparison and a value on
   one line, and the cross that takes the line away. Not .field, whose rules
   would stretch each of the three across the dialog. */
.filter-rows { margin-bottom: 1rem; }
.filter-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
/* The menus are drawn as every menu is; the value field to match them. */
.filter-row select { flex: 0 1 9rem; min-width: 0; }
.filter-row input {
  flex: 1 1 8rem;
  min-width: 0;
  padding: 0.5rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
}
/* Whether a column is empty takes no value: the cross stays where the rows
   above have theirs. */
.filter-row .remove { margin-left: auto; }
.filter-rows > .muted { margin: 0 0 0.75rem; }
/* A period's dialog: its two hours side by side, and a percentage the width
   of one with its sign after it. */
.adjustment-hours { display: flex; gap: 1rem; }
.adjustment-hours .field { flex: 1; }
/* Both classes, to win over .field-beside's flex-start further down. */
.field-beside.adjustment-percent { align-items: center; }
.adjustment-percent input { width: 6rem; }
/* A scheduled adjustment's time passed, said under the time zone; nothing
   there while it has not. */
#scheduled-when { margin: -0.5rem 0 1rem; }
#scheduled-when:empty { display: none; }
/* An hourly period's runs, the latest first: a tick on green where it was in
   force, a cross on red where it was skipped, and what was checked under. */
.run-history { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--border); }
.run-history li { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--border); }
.run-mark { display: grid; place-items: center; flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; }
.run-mark svg { width: 1rem; height: 1rem; }
.run-applied .run-mark { background: var(--ok-bg); color: var(--ok-fg); }
.run-skipped .run-mark { background: var(--bad-bg); color: var(--bad-fg); }
.run-missed .run-mark { background: var(--amber-bg); color: var(--amber-fg); }
.run-said { display: grid; gap: 0.1rem; min-width: 0; }
/* Scheduled adjustments passed are history: folded away under a line of
   their own, its chevron turned as a row's is when open, and greyed out, all
   but their buttons, which still clone and remove them. */
.scheduled-passed { max-width: 36rem; margin-bottom: 0.5rem; }
.scheduled-passed > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
  cursor: pointer;
  list-style: none;
}
.scheduled-passed > summary::-webkit-details-marker { display: none; }
.scheduled-passed > summary:hover { background: var(--row-hover); color: var(--fg); }
.scheduled-passed-chevron { display: flex; transition: rotate 150ms ease-out; }
.scheduled-passed-chevron svg { width: 1.25rem; height: 1.25rem; }
.scheduled-passed[open] > summary .scheduled-passed-chevron { rotate: 180deg; }
.scheduled-passed .text-list-icon, .scheduled-passed .text-list-line { opacity: 0.55; }
.scheduled-passed .text-list-line { color: var(--muted); }
/* One of one's own in a training's days, which it would spoil: in red, as
   .error is, with the line saying why under it. */
.text-list-line.in-training { color: #d33; }
/* At the top of the budget's, bidding's and adjustments' rows while a
   training runs: a change is allowed, and warned of. */
.training-in-progress { margin: 0 0 0.75rem; color: var(--amber-fg); font-size: var(--text-sm); }
/* The overview's row of a campaign in training: its icon in amber, larger
   than a network's mark, standing alone for what the row says. */
.overview-facts .training-mark svg { width: 1.25rem; height: 1.25rem; color: var(--amber-fg); }
/* And in the Adjustments row's line, shut: where its days are to be found. */
.setting-summary .training-mark { vertical-align: bottom; }
.setting-summary .training-mark svg { width: 1rem; height: 1rem; color: var(--amber-fg); }
/* A training's days folded into one line of the list, opened as the passed
   ones are, the days under it set in a little. Its bin stays by the line,
   not halfway down the days. */
.text-list li.training-item { align-items: flex-start; }
.training-item > button { margin-top: 0.5rem; }
.scheduled-training { flex: 1; min-width: 0; }
.scheduled-training > summary {
  display: flex; align-items: center; gap: 0.25rem; padding-right: 0.4rem;
  border-radius: var(--radius); cursor: pointer; list-style: none; }
.scheduled-training > summary::-webkit-details-marker { display: none; }
.scheduled-training > summary:hover { background: var(--row-hover); }
.scheduled-training > summary .text-list-line:hover { background: none; }
.scheduled-training[open] > summary .scheduled-passed-chevron { rotate: 180deg; }
.scheduled-training > .text-list { margin: 0 0 0.5rem 1.5rem; }
.scheduled-training > .text-list li:last-child { border-bottom: 0; }
/* A scheduled value: Amount or Percent, close over the box, and the %
   after the box only while it is a percentage. */
.scheduled-value fieldset.choice { margin-bottom: 0.35rem; }
.scheduled-value .percent-sign { display: none; }
.scheduled-value:has(input[type="radio"][value="percent"]:checked) .percent-sign { display: inline; }

/* A Performance Max campaign's channels, a line each as Devices has them,
   and a channel's cap offered while it is Low: Google caps only those. */
.channel-priorities li { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; }
.channel-priorities .channel-adjust { margin: 0 0 0 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.channel-priorities .channel-adjust select { width: auto; }
.channel-priorities .channel-cap { display: none; align-items: center; gap: 0.5rem; }
.channel-priorities li:has(option[value="low"]:checked) .channel-cap { display: flex; }
.channel-priorities .channel-cap input { width: 5rem; flex: none; }
.channel-priorities .channel-note { margin: 0 0 0 1.75rem; }
/* A channel the campaign does not show on, off under its Networks: shown,
   not chosen. */
.channel-priorities li.channel-off > div { opacity: 0.4; }
.channel-priorities li:has(option[value="low"]:checked) .channel-tip { display: none; }
/* Every channel Low, which Google refuses: said at once, and Save let be
   until one is High again. */
.channel-priority-form .channels-all-low { display: none; }
.channel-priority-form:not(:has(.channel-priorities option[value="high"]:checked)) .channels-all-low { display: block; }
.channel-priority-form:not(:has(.channel-priorities option[value="high"]:checked)) button[type="submit"] {
  opacity: 0.4; cursor: default; pointer-events: none;
}
/* The products a campaign keeps, under its feed settings: no taller than a
   box, scrolling within it, the column names staying at the top. */
#campaign-items { margin-top: 1.25rem; }
.campaign-items { max-height: 500px; overflow: auto; }
.campaign-items thead th { position: sticky; top: 0; z-index: 2; }
/* Under the table, at its right. */
.campaign-items-pager .pager { margin: 0.75rem 0 0 auto; }
/* What a choice of ad groups comes to, under it in the dialog: the count, and
   the groups in a list that scrolls rather than stretching the dialog. */
.ad-groups-summary { margin-bottom: 1rem; }
.ad-groups-summary:empty { display: none; }
.ad-groups-summary .setting-value { font-weight: 600; }
.ad-groups-summary .feed-groups { max-height: 16rem; overflow-y: auto; margin-top: 0.5rem; }
/* The feed dialog's list of feeds: a row each, the chosen one marked, the
   list scrolling rather than the dialog growing past the window. In its own
   dialog it fills what the dialog has, the buttons along the foot, as a
   picker's list does. */
.dialog-feeds > form { display: flex; flex-direction: column; flex: 1; min-height: 0; max-width: none; }
.dialog-feeds > form > * { flex: none; }
.dialog-feeds > form > .feed-choices { flex: 1; min-height: 0; min-width: 0; max-height: none; }
.dialog-feeds > form > .buttons { margin: 0; }
.feed-choices {
  max-height: 20rem;
  overflow-y: auto;
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feed-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  font-weight: normal;
  cursor: pointer;
}
.feed-choice-list { list-style: none; margin: 0; padding: 0; }
.feed-choice-list > li { border-bottom: 1px solid var(--border); }
.feed-choice-list > li:last-child { border-bottom: 0; }
.feed-choice-list > li[hidden] { display: none; }
.feed-choice:hover { background: var(--row-hover); }
.feed-choice:has(input:checked) { background: var(--nav-active); }
.feed-choice input { width: auto; flex: none; margin: 0; }
.feed-choice .muted { margin-left: auto; white-space: nowrap; }
/* One ad group has no column to choose. */
.form:has(.ad-groups-choice input[value="one"]:checked) .group-column { display: none; }
/* A dialog's button that has nothing to do yet -- Save with ad groups from
   columns and none chosen -- says so, and takes no hover. */
.buttons > button:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
/* The columns chosen, in a line with the button that chooses them. */
.group-columns { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
/* A column's name with what the first product has in it under it, as the old
   app listed them: an address as like as not, broken where it must rather
   than pushing the dialog wide. */
.column-choice { align-items: flex-start; }
.column-choice input { margin-top: 0.2rem; }
.column-choice-text { display: flex; flex-direction: column; min-width: 0; }
.column-choice .muted { margin-left: 0; white-space: normal; overflow-wrap: anywhere; }

/* A list of values and how many products carry each. */
.feed-groups { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.feed-groups li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}
.feed-groups li:last-child { border-bottom: 0; }

/* A dashboard: sections one under another, each with its heading and its menu
   above what it holds. */
.dash-section { margin-bottom: 2rem; }
/* The first section stands as far below the tabs, or the line naming the
   labels, as it does above the next section: they leave 1rem, this the rest.
   While the page is arranged the sections are boxes 1rem apart, and the 1rem
   above them already matches. Padding, as a margin would only fold into
   theirs. */
.dash-sections:not([data-sortable]) { padding-top: 1rem; }
/* A section without a heading follows the one above as its next row of
   cards would: as far below it as one row of cards is from the next. */
.dash-section:has(+ .dash-section.headless) { margin-bottom: 1rem; }
/* While the page is arranged, a section is a thing on the page to be moved
   about rather than a heading over some cards, so it is drawn as one. */
.dash-sections[data-sortable] .dash-section {
  cursor: grab;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--subtle);
}
.dash-section.dragging { opacity: 0.4; }
.dash-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  margin-bottom: 0.75rem;
}
.dash-head h2 { margin: 0; font-size: var(--text-lg); }
/* What a section with no heading is called while the page is arranged. It is
   not a name, so it does not read as one. */
.dash-head h2.nameless { color: var(--muted); font-weight: 500; }
/* While the page is arranged, the heading is pressed to rename the section:
   it reads as the heading still, until the pointer is on it. */
.dash-rename { all: unset; cursor: pointer; }
.dash-rename:hover { text-decoration: underline; }
.dash-rename:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* The menu stands at the far end of the section's line, where the cards'
   menus are at the far end of theirs. */
.dash-menu { margin-left: auto; }
/* A menu of things to do rather than places to go: its summary is an icon, and
   what is in it are buttons that look like the links in the other menus. */
/* An icon on its own, so it is square and wears no caret: the arrow beside a
   word says the word opens something, and an icon that is a pencil has already
   said it. */
.actions-menu > summary { width: 2rem; justify-content: center; padding: 0; border-radius: 50%; }
.actions-menu > summary::after { content: none; }
.actions-menu > summary svg { display: block; width: 1.125rem; height: 1.125rem; }
.menu-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.75rem;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
/* A link among them -- Manage, under Save this search -- lines up with the
   buttons rather than with a filter menu's choices, which .menu-panel a pads
   less. */
.menu-panel a.menu-action { padding: 0.4rem 0.75rem; }
.menu-action:hover { background: var(--row-hover); }
.menu-action:disabled { opacity: 0.4; cursor: default; }
.menu-action:disabled:hover { background: none; }
/* The bar's menu of changes: a button like the ones beside it, pencil and
   word, which opens rather than does. Its panel hangs from its right edge, as
   the bar ends there. */
.edit-menu { margin-left: 0; }
.edit-menu > summary {
  border: 1px solid var(--border);
  color: var(--fg);
}
.edit-menu > summary svg { display: block; width: 1rem; height: 1rem; }
/* The saved searches, looked after on a page of their own. */
.favourites td { vertical-align: middle; }
.favourites code { font-size: var(--text-xs); }
.menu-action svg { width: 1rem; height: 1rem; }

/* A section's cards, in a row that wraps. Every kind of card is the same shape
   and the same width: what tells them apart is what each of them says. Wide
   enough for the line under the number to hold the days and the networks beside
   each other, since that line is the one that grew. */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* At least 14rem a card, and four to a row before a fifth is made room for
     at 18rem: a fifth column at 14rem stood empty after a row of four, with
     the cards no wider than it. */
  grid-template-columns: repeat(auto-fill, minmax(clamp(14rem, (100% - 3rem) / 4, 18rem), 1fr));
  gap: 1rem;
}
/* While the page is arranged the cards can be dragged, which the pointer says
   before anything is picked up. */
.card-grid[data-sortable] > .dash-card { cursor: grab; }
.dash-sections[data-sortable] .dash-menu { cursor: auto; }
/* While the page is arranged, a card's frame with a plus after the cards:
   where the next one goes, as tall as a card. */
.card-add { display: flex; }
.card-add button {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 7.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.card-add button:hover { border-color: var(--muted); color: var(--fg); }
.card-add svg { width: 1.75rem; height: 1.75rem; }
.dash-card.dragging { opacity: 0.4; }
.dash-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.card-head { display: flex; align-items: center; gap: 0.5rem; min-height: 1.5rem; }
.card-label { color: var(--muted); font-size: var(--text-sm); }
/* A card standing for a saved search is a way into that list, so its heading is
   the way in rather than a label beside one. */
a.card-label { color: inherit; text-decoration: none; }
a.card-label:hover { color: var(--accent); text-decoration: underline; }
/* A card's own menu, at the right of its heading. It is there whether or not
   the card is pointed at: something that appears under the pointer is something
   nobody finds who is not already looking for it. */
.card-menu { margin-left: auto; }
.card-value {
  margin: 0.15rem 0 0.35rem;
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.2;
}
.card-period { color: var(--muted); font-size: var(--text-xs); }
/* The networks the number covers, on a line of their own at the foot of the
   card: their marks alone, since the name beside a mark is the same name on
   every card that carries one. */
.card-platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.card-platform svg { display: block; width: 1.125rem; height: 1.125rem; }

/* Uploaded images and videos, as tiles: what a file is, is easier seen than
   read. The tiles grow to fill the row and wrap when they run out of it. */
/* The bar stands on its own above the tiles rather than at the head of a list
   with an edge, so it is a box in its own right. */
#media-list .rows-bar { border-radius: var(--radius); }
.media-grid {
  list-style: none;
  margin: 0;
  padding: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
}
.media-tile { min-width: 0; }
/* A rectangle of its own, so a row of tiles lines up whatever shape the files
   are, and the picture fills it. Cropped, which loses the edges of anything that
   is not this shape -- a row of pictures at one size reads better than a row of
   pictures at their own, and what a file is whole is one click away. The grey
   behind it is what shows while a picture is still loading. */
.media-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--subtle);
}
.media-thumb img, .media-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The tick box sits on the picture, told apart from whatever it lands on by
   a shadow. */
.media-pick {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
}
.media-pick input {
  filter: drop-shadow(0 0 1px rgb(0 0 0 / 0.9)) drop-shadow(0 1px 2px rgb(0 0 0 / 0.5));
}
/* Unticked, it is filled, as a see-through box would be lost in the picture. */
.media-pick input:not(:checked):not(:indeterminate) { background-color: var(--surface); }
/* The image picker: the whole picture is the way to tick it -- or, one that
   can be cut, to open the crop dialog, its tick box ticking it as it is -- a
   ticked one outlined; one the campaign has already is there, faded, and
   says so. */
label.media-thumb { display: block; cursor: pointer; }
/* A tile picked by a click on it, in the media dialog. */
.media-choose { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; cursor: pointer; }
.media-choose:hover, .media-choose:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* The media dialog over a feed item's: the search box stays at the top, and
   the bar, the tiles and the pages scroll under it, as a picker's list does. */
.media-dialog { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.media-dialog > .search { flex: none; }
/* Its hidden fields take no place in the row, as .filter-fields do. */
#media-dialog-fields { display: contents; }
/* Its tabs in the heading's place, drawn as the campaigns page's are: a
   radio each, its panel shown by which is ticked. */
/* Its tabs as the other dialogs' are (.tabs), first under the heading. */
/* The media page's search box and list, one to draw again: as though they
   stood in the page themselves. */
.media-body { display: contents; }
/* The media page's Upload: Done under the tab. */
#media-upload > .media-upload-done { flex: none; margin: 1rem 0 0; }
@media (max-width: 40rem), (max-height: 30rem) {
  #media-upload > .media-upload-done { margin: 0; }
}
/* What it picks for, after its heading: the campaign's name, quieter. */
.media-dialog-subtitle { margin-left: 0.5rem; font-size: var(--text-base); font-weight: 400; }
.media-dialog-tabs { flex: none; }
.media-dialog-tabs label.tab:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
#media-dialog:has([name="media-dialog-tab"][value="upload"]:checked) .media-dialog-library,
#media-dialog:not(:has([name="media-dialog-tab"][value="upload"]:checked)) .media-dialog-upload { display: none; }
/* The Upload tab: a place to drop files on, as large as the list would be,
   its edge dashed and lit while files are dragged over it (app.js). */
.media-dialog-upload { gap: 0.75rem; }
.media-dialog-drop {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.media-dialog-drop[data-dragging] { border-color: var(--accent); background: var(--nav-active); }
.media-dialog-drop-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; height: 100%; text-align: center; }
.media-dialog-drop-empty p { margin: 0; }
.media-dialog-drop-title { font-size: var(--text-xl); }
/* On a touch screen nothing is dragged: the button alone, from the device. */
.media-dialog-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .media-dialog-drag, .media-dialog-pointer { display: none; }
  .media-dialog-touch { display: inline; }
}
.media-dialog-upload > p, .media-dialog-upload > .buttons { flex: none; margin: 0; }
/* What was wrong, 1rem from what is above and under it, as a dialog's error
   is (the tab's own gap, and this); taking no room where nothing is. */
.media-dialog-problems { flex: none; margin: 0.25rem 0; }
.media-dialog-problems:empty { margin: -0.75rem 0 0; }
.media-dialog-problems p { margin: 0; }
/* The tile that adds more: a + over its words, where a picture would be. */
.media-dialog-upload .media-dialog-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: var(--text-base);
  font-weight: 400;
  cursor: pointer;
}
.media-dialog-add-mark svg { width: 2.5rem; height: 2.5rem; }
/* A tile of the Upload tab spins until what it shows has loaded (app.js):
   one on its way, and one just come, its picture still being fetched. Not
   how far the file has gone, in the button: the tiles say it. */
.media-dialog-upload .media-tile:not([data-loaded]) .media-thumb:not(.media-dialog-add)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 1.5rem;
  height: 1.5rem;
  margin: auto;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
/* One upload at a time: Add more, and the button, wait for the one on its way
   (app.js holds what is dropped the same way). */
.media-dialog-upload:has([aria-busy="true"], .htmx-request) .picker-upload { pointer-events: none; opacity: 0.6; }
.media-dialog-upload .picker-upload > .upload-progress,
.media-dialog-upload .picker-upload > .upload-hint { display: none; }
/* Gone once files are on their way, their tiles in its place (app.js). */
.media-dialog-drop-empty[hidden] { display: none; }
.media-dialog-said-busy,
.media-dialog-upload:has([aria-busy="true"], .htmx-request) .media-dialog-said-rest { display: none; }
.media-dialog-upload:has([aria-busy="true"], .htmx-request) .media-dialog-said-busy { display: inline; }
.media-dialog > .rows { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.media-tile.added .media-thumb { cursor: default; }
/* What is added already is darkened under its pill -- a picture or a film's
   first frame -- rather than faded to the tile's grey. */
.media-tile.added :is(img, video) { filter: brightness(0.4); }
.media-added {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-xs);
  font-weight: 600;
}
.picker-actions { display: flex; align-items: center; gap: 0.5rem; }
.picker-actions form { margin: 0; }
.picker-upload[aria-busy="true"] { pointer-events: none; }
/* How much of a file has gone to the bucket, while it goes (app.js). */
.upload-progress { font-variant-numeric: tabular-nums; }
.upload-progress:empty { display: none; }
.picker-upload .upload-progress { margin-right: 0.35rem; }
/* Said while a file goes from the browser (app.js marks its box busy): it goes
   from this page, and closing it stops it. Under the field in a form; under
   the button where the button is all there is, without moving what is
   beside it. */
.upload-hint { display: none; font-size: var(--text-xs); font-weight: 400; color: var(--muted); }
[aria-busy="true"] > .upload-hint { display: block; margin-top: 0.25rem; }
/* A button cuts off what overflows it; these say nothing that could, but for
   the hint under them. */
.picker-upload { position: relative; overflow: visible; }
.picker-upload > .upload-hint {
  position: absolute;
  top: 100%;
  right: 0;
  white-space: nowrap;
}
.media-about { margin-top: 0.4rem; }
/* A file name is one line, cut where it runs out of tile; the whole of it is in
   the title and a click away. */
.media-about .row-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The name and the pencil that renames it on one line, the pencil right
   after the name however short, and the name cut short before the pencil
   is. The pencil reaches into the room round the line, so the line is no
   taller for it; on a phone it is a finger's size. */
.media-name { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.media-name .row-name { min-width: 0; }
.media-name .icon-button { flex: none; margin: -0.375rem 0; }
.media-name .icon-button svg { width: 1.25rem; height: 1.25rem; }
@media (max-width: 40rem), (max-height: 30rem) {
  .media-name .icon-button { width: 2.75rem; height: 2.75rem; margin: -0.75rem 0; }
  .media-name .icon-button svg { width: 1.5rem; height: 1.5rem; }
}
/* The picture is the button that opens the preview: no chrome of its own, since
   what is on it is the whole of it. */
.media-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.media-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* A video says it is one, since it does not play until the preview is open. */
.media-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.media-play svg {
  width: 2.5rem;
  height: 2.5rem;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.6));
}

/* A Spotify ad as the app plays one: its own dark card whatever the page's
   theme, as Spotify's player is. */
.spotify-ad {
  width: 100%;
  max-width: 21rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1.5rem;
  border-radius: 12px;
  background: #3e3e3e;
  color: #ffffff;
  display: grid;
  gap: 0.9rem;
}
.spotify-ad p { margin: 0; }
.spotify-ad-from { text-align: center; font-size: 0.8rem; font-weight: 700; }
.spotify-ad-media { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #2a2a2a; }
.spotify-ad-media img, .spotify-ad-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.spotify-ad-none { display: flex; height: 100%; align-items: center; justify-content: center; color: #b3b3b3; font-size: 0.85rem; }
.spotify-ad-who { display: flex; align-items: center; gap: 0.75rem; }
.spotify-ad-logo { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 4px; object-fit: cover; background: #ffffff; }
.spotify-ad-initial { display: flex; align-items: center; justify-content: center; color: #121212; font-weight: 700; }
.spotify-ad-name { font-size: 1.3rem; font-weight: 700; line-height: 1.15; }
.spotify-ad-kind { font-size: 0.75rem; color: #b3b3b3; }
.spotify-ad-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0; font-size: 0.75rem; color: #b3b3b3; }
.spotify-ad-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: #5e5e5e; overflow: hidden; }
.spotify-ad-bar > span { display: block; width: 0; height: 100%; background: #ffffff; }
.spotify-ad-progress > :last-child { text-align: right; }
.spotify-ad-controls { display: flex; align-items: center; justify-content: center; gap: 2.25rem; }
.spotify-ad-skip { display: inline-flex; width: 1.6rem; height: 1.6rem; color: #ffffff; opacity: 0.9; }
.spotify-ad-skip svg, .spotify-ad-play svg { width: 100%; height: 100%; }
.spotify-ad-play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.4rem; height: 3.4rem; padding: 0.8rem;
  border: 0; border-radius: 50%; background: #ffffff; color: #121212; cursor: pointer;
}
.spotify-ad-play:disabled { opacity: 0.5; cursor: default; }
.spotify-ad-play > span { display: inline-flex; width: 100%; height: 100%; }
/* Play while it is stopped, pause while it plays. */
.spotify-ad-play > .spotify-ad-icon-pause,
.spotify-ad[data-playing] .spotify-ad-play > .spotify-ad-icon-play { display: none; }
.spotify-ad[data-playing] .spotify-ad-play > .spotify-ad-icon-pause { display: inline-flex; }
.spotify-ad-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.spotify-ad-tagline { font-size: 0.85rem; font-weight: 700; }
.spotify-ad-button {
  flex: none; padding: 0.45rem 1rem; border-radius: 999px;
  background: #ffffff; color: #121212; font-size: 0.85rem; font-weight: 700;
}
.preview-network { margin: 0.75rem 0 0; text-align: center; }

/* A Snapchat ad as the app shows one: the snap the whole of a phone's
   screen, what it is from over it and what swiping up opens under it, white
   on the snap whatever the page's theme -- a shade at the top and the bottom
   keeps it legible on a light picture. */
.snapchat-ad, .snapchat-tile {
  position: relative;
  flex: none;
  width: min(15rem, 100%);
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #25282c;
  color: #ffffff;
}
.snapchat-ad { aspect-ratio: 9 / 16; }
.snapchat-ad p, .snapchat-tile p { margin: 0; }
.snapchat-ad-snap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* A film's play button, in the middle of its first frame; out of sight while
   it plays, but for a pointer over the snap or the keyboard on the button. */
.snapchat-ad-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem; padding: 0; border: 0; border-radius: 50%;
  background: rgb(0 0 0 / 0.5); color: #ffffff; cursor: pointer;
  transition: opacity 0.2s;
}
.snapchat-ad-play > span { display: inline-flex; width: 1.75rem; height: 1.75rem; }
.snapchat-ad-play svg { width: 100%; height: 100%; }
.snapchat-ad-play > .snapchat-ad-icon-pause,
.snapchat-ad[data-playing] .snapchat-ad-play > .snapchat-ad-icon-play { display: none; }
.snapchat-ad[data-playing] .snapchat-ad-play > .snapchat-ad-icon-pause { display: inline-flex; }
.snapchat-ad[data-playing] .snapchat-ad-play { opacity: 0; }
.snapchat-ad[data-playing]:hover .snapchat-ad-play, .snapchat-ad-play:focus-visible { opacity: 1; }
.snapchat-ad-none {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #b3b3b3; font-size: 0.85rem;
}
.snapchat-ad-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 0.75rem 1.5rem;
  background: linear-gradient(rgb(0 0 0 / 0.45), transparent);
}
.snapchat-ad-avatar { flex: none; width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; background: #ffffff; }
.snapchat-ad-initial { display: flex; align-items: center; justify-content: center; color: #121212; font-weight: 700; }
.snapchat-ad-who { flex: 1; min-width: 0; }
.snapchat-ad-name { font-size: 0.8rem; font-weight: 700; }
.snapchat-ad-headline { font-size: 0.7rem; opacity: 0.85; }
.snapchat-ad-name, .snapchat-ad-headline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snapchat-ad-label { flex: none; font-size: 0.7rem; font-weight: 700; }
.snapchat-ad-swipe {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding: 1.5rem 0.75rem 0.9rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.45));
}
.snapchat-ad-arrow { width: 1.1rem; height: 0.5rem; }
.snapchat-ad-button {
  padding: 0.4rem 1rem; border-radius: 999px;
  background: #ffffff; color: #121212; font-size: 0.75rem; font-weight: 700;
}
/* A collection's products, in a strip under the snap. */
.snapchat-ad-collection {
  position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.5rem;
  display: grid; gap: 0.4rem;
  padding: 0.5rem; border-radius: 8px;
  background: #ffffff; color: #121212;
}
.snapchat-ad-collection-cta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; font-weight: 700; }
.snapchat-ad-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; }
.snapchat-ad-product { aspect-ratio: 1; width: 100%; border-radius: 4px; object-fit: cover; background: #e5e5e5; }
/* A story ad's tile in Discover, beside the snap it opens. */
.snapchat-tile { aspect-ratio: 3 / 5; width: min(9rem, 100%); align-self: center; }
.snapchat-tile-picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.snapchat-tile-over {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; gap: 0.35rem; padding: 1.5rem 0.5rem 0.6rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.6));
}
.snapchat-tile-logo { width: 100%; height: auto; }
.snapchat-tile-headline { font-size: 0.75rem; font-weight: 700; }
.snapchat-story { align-items: center; }
/* Both shrink together where the preview is narrower than they are. */
.snapchat-story > .snapchat-tile { flex: 0 1 9rem; min-width: 0; }
.snapchat-story > .snapchat-ad { flex: 0 1 15rem; min-width: 0; }
/* A film or post not 9:16 -- TikTok takes 1:1 and 16:9 too -- shown whole
   across the middle, black above and under it, as TikTok shows one. */
.tiktok-ad { background: #000000; }
.tiktok-ad > .snapchat-ad-snap { object-fit: contain; }
/* A TikTok ad, drawn on a Snapchat ad's frame (views.tiktokAd): the account's
   picture and the icons down the right, its name, text and button over the
   bottom, white on the film whatever the page's theme. */
.tiktok-ad-side {
  position: absolute; right: 0.5rem; bottom: 5.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
}
.tiktok-ad-side svg { width: 1.6rem; height: 1.6rem; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.4)); }
.tiktok-ad-avatar {
  width: 2.4rem; height: 2.4rem; border: 2px solid #ffffff; border-radius: 50%;
  object-fit: cover; background: #ffffff;
}
.tiktok-ad-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 2rem 3.5rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.5));
}
.tiktok-ad-text { font-size: 0.75rem; line-height: 1.3; overflow-wrap: anywhere; }
.tiktok-ad-sponsored { font-size: 0.65rem; opacity: 0.8; }
/* A catalog's products, in a carousel across the middle of the ad, short
   of the icons down its right as the text at the bottom is. */
.tiktok-ad-carousel {
  position: absolute; left: 0; right: 3.5rem; top: 22%;
  display: flex; gap: 0.5rem; padding: 0 0 0 0.75rem; overflow-x: auto; scrollbar-width: none;
}
.tiktok-ad-carousel figure {
  flex: none; width: 7rem; margin: 0; border-radius: 6px; overflow: hidden; background: #ffffff; color: #121212;
}
.tiktok-ad-carousel img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tiktok-ad-carousel figcaption {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.3rem 0.4rem; font-size: 0.65rem; line-height: 1.25;
}
.tiktok-ad-carousel figcaption span {
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tiktok-ad-carousel figcaption p { margin: 0; }
.tiktok-ad-carousel figcaption del { opacity: 0.6; }
.tiktok-ad-button {
  margin-top: 0.35rem; margin-right: -2.75rem; padding: 0.45rem 0.75rem; border-radius: 4px;
  background: #fe2c55; color: #ffffff; font-size: 0.75rem; font-weight: 700; text-align: center;
}

/* A LinkedIn single image ad as it shows in the feed: light, as LinkedIn's
   feed is, whatever the page's theme. The picture is shown whole in its own
   shape -- landscape, square or portrait -- as LinkedIn shows it. */
.li-ad {
  width: 100%;
  max-width: 22rem;
  overflow: hidden;
  border: 1px solid #e0dfdc;
  border-radius: 8px;
  background: #fff;
  color: rgba(0, 0, 0, 0.9);
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  text-align: left;
}
.li-ad p { margin: 0; }
.li-ad-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0.75rem 0.5rem; }
/* A company's logo is square on LinkedIn, not round as a person's is. */
.li-ad-logo {
  display: flex; flex: none; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 4px;
  background: #e9e5df; color: rgba(0, 0, 0, 0.6); font-weight: 700;
}
img.li-ad-logo { object-fit: cover; }
.li-ad .li-ad-name { font-size: 0.875rem; font-weight: 600; line-height: 1.25; }
.li-ad .li-ad-promoted { color: rgba(0, 0, 0, 0.6); font-size: 0.75rem; }
/* Cut short after three lines, as LinkedIn does with "...more". */
.li-ad .li-ad-text {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  margin: 0 0.75rem 0.6rem; font-size: 0.875rem; line-height: 1.4; overflow-wrap: anywhere;
}
.li-ad-image { display: block; width: 100%; height: auto; background: #f3f2ef; }
.li-ad-no-image {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1.91;
  color: rgba(0, 0, 0, 0.6); font-size: 0.8rem;
}
.li-ad-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: #eef3f8; }
.li-ad-link-text { flex: 1; min-width: 0; }
.li-ad .li-ad-headline {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  font-size: 0.875rem; font-weight: 600; line-height: 1.3;
}
.li-ad .li-ad-site { overflow: hidden; color: rgba(0, 0, 0, 0.6); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.li-ad .li-ad-description { overflow: hidden; color: rgba(0, 0, 0, 0.6); font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.li-ad-cta {
  flex: none; padding: 0.35rem 0.9rem; border: 1px solid #0a66c2; border-radius: 999px;
  color: #0a66c2; font-size: 0.85rem; font-weight: 600;
}

/* A promoted Pin as Pinterest shows it in the home feed: light, as Pinterest
   is, whatever the page's theme. */
.pinterest-pin {
  width: min(15rem, 100%);
  margin: 0 auto;
  padding: 0.6rem;
  border-radius: 18px;
  background: #ffffff;
  color: #111111;
}
.pinterest-pin p { margin: 0; }
.pinterest-pin-picture { position: relative; aspect-ratio: 2 / 3; border-radius: 16px; overflow: hidden; background: #efefef; }
.pinterest-pin-picture img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pinterest-pin-none {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #767676; font-size: 0.85rem;
}
.pinterest-pin .pinterest-pin-title {
  margin: 0.6rem 0.15rem 0;
  font-size: 0.95rem; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pinterest-pin .pinterest-pin-by {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.5rem 0.15rem 0.15rem;
  font-size: 0.8rem; line-height: 1.25;
}
.pinterest-pin-avatar {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover;
  background: #e9e9e9; color: #111111; font-weight: 700;
}

/* A Spotify campaign's potential reach, a line in its Targeting box over the
   rows, as tall as a shut one. */
.spotify-reach { padding: 0.9rem 1rem; }
/* A box's few words of what its rows are for, first in it: Performance Max's audience signal. */
.setting-intro { padding: 0.9rem 1rem; }
.setting-intro p { margin: 0; }
.spotify-reach p { margin: 0; }
/* Each of its targeting rows with the reach beside it, as an asset's row has
   the ad: the form as wide as it is anyway, the reach in what is left; under
   the form on a narrow screen, since it is what a change comes to. */
.with-reach { display: flex; align-items: flex-start; gap: 2rem; }
.with-reach > form { flex: 0 1 36rem; min-width: 0; }
.with-reach > .row-reach { flex: 1; min-width: 14rem; max-width: 24rem; display: grid; gap: 0.35rem; }
.row-reach p { margin: 0; }
@media (max-width: 56rem) {
  .with-reach { display: block; }
  .with-reach > .row-reach { margin-top: 1rem; }
}

/* A sound has nothing to look at: a note where a picture would be, on a tile
   as on a chosen file and a row's line. */
.media-sound {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}
.media-sound svg { width: 2.5rem; height: 2.5rem; }
.image-tile .media-sound {
  width: 7rem;
  height: 7rem;
  border-radius: var(--radius);
  background: var(--subtle);
}
.image-tile audio { display: block; width: 14rem; margin-top: 0.35rem; }
.summary-thumbs .media-sound { display: inline-flex; width: 1.5rem; height: 1.5rem; }
.summary-thumbs .media-sound svg { width: 1.1rem; height: 1.1rem; }

/* A file at the size the window allows, with what is known about it underneath. */
.media-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  background: var(--subtle);
  border-radius: var(--radius);
}
.media-preview img, .media-preview video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 16rem);
  border-radius: var(--radius);
}

/* A campaign's labels, beside its name and in the dialog that sets them. */
.labels { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; max-width: 100%; }
/* A label too long for the room it has ends in an ellipsis rather than
   running past it; its title holds the whole of it. */
.label-chip {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--nav-active);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.label-choices { list-style: none; margin: 0 0 1rem; padding: 0; }
/* A label to tick, and the bin that deletes it at the far end. */
.label-choices li { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; }
.label-choices li > .checkbox { flex: 1; min-width: 0; }
.picker-list:has(.label-choices li) .labels-none { display: none; }

/* What would finish the word being typed in the search box, hanging under it.
   The menu is taken out of the row's flow: as a box of its own beside the field
   it would be a flex item of no width, with nothing to show. */
.search-box { position: relative; display: flex; flex: 1; }
/* The filters' hidden fields hold no room in the search's row: their holder
   is not a box of its own, or the gap beside it would push the field in. */
.filter-fields { display: contents; }
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
}
.suggestions .menu-panel {
  position: static;
  right: auto;
  min-width: 0;
  max-height: 16rem;
  overflow-y: auto;
  margin-top: 0.15rem;
  list-style: none;
  padding: 0.25rem;
}
.suggestions a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
}
.suggestions a:hover { background: var(--row-hover); }
/* Where the arrow keys are in that menu, which hovering does not move. */
.suggestions a.active { background: var(--nav-active); color: var(--accent); }

/* Each headline as the first product makes it, with its length beside it. */
/* Texts one a line, each as wide as its longest may be and no wider -- thirty
   characters in a box across the page reads as a mistake -- and each as tall
   as there may be of them. */
.lines-field-headlines,
.lines-field-callouts,
.lines-field-business-name { max-width: 28rem; }
.lines-field-long-headline { max-width: 44rem; }
.lines-field-descriptions,
.lines-field-keywords,
.lines-field-negative-keywords { max-width: 44rem; }
.lines-field-descriptions textarea { min-height: calc(4lh + 1rem + 2px); }

/* The feed's columns under a field that can take from the feed, offered as a $
   is typed: the same menu as the search box's, with what each column holds
   for the first product beside its name. */
.ref-box { position: relative; }
/* Raised over the page and any dialog, by the $ being typed: app.js says where.
   A popover's own box -- in the middle of the screen, with an edge and a
   background -- is the menu panel's inside it. */
.ref-box .suggestions[popover] {
  position: fixed;
  inset: auto;
  width: min(24rem, calc(100vw - 1rem));
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
/* The lines added in a dialog: a few to start, and growing as more are typed,
   so that the dialog is not all box and the menu of columns has room. */
.dialog .line-dialog-lines { min-height: calc(3lh + 1rem + 2px); max-height: calc(10lh + 1rem + 2px); }
/* All of a row's lines, to edit at once: room for many, and the box then
   scrolls rather than the dialog growing past the window. */
.dialog .line-dialog-all { min-height: calc(6lh + 1rem + 2px); max-height: 60vh; }
/* What Edit's box shows: a search, and under it keywords' match types in a
   row. */
.line-edit-filter { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
/* A row of its own, as tall as the field: .search-field grows along a row. */
.line-edit-filter .search-field { flex: none; }
.line-edit-matches { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; border: 0; }
/* What may go in a line, and beside it how long what is typed is: each line's
   length, where there are several, one too long amber as a listed example's. */
.counted-hint { display: flex; margin-top: 0.25rem; justify-content: space-between; align-items: baseline; gap: 1rem; }
.char-count { flex: none; margin-left: auto; font-variant-numeric: tabular-nums; }
.char-count .over { padding: 0 0.35rem; }
.ref-box .suggestions a { display: flex; gap: 0.75rem; align-items: baseline; cursor: pointer; }
.ref-name { flex: none; }
.ref-example { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); }

/* Tick boxes in a setting: a place or a language a line, the languages in
   columns since there are dozens, genders and ages side by side since there are
   a handful. What a search found sits apart from what is chosen. */
.ticks { list-style: none; margin: 0.5rem 0 1rem; padding: 0; }
.ticks label { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.2rem 0; cursor: pointer; }
.ticks.found { padding-top: 0.5rem; border-top: 1px dashed var(--border); }
.ticks.columns { columns: 12rem; column-gap: 1.5rem; }
.ticks.columns li { break-inside: avoid; }
.ticks.inline { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
/* BidTheatre's banner at its own shape, no larger than the preview, its size under it. */
.bt-ad { display: flex; justify-content: center; }
.bt-banner { margin: 0; max-width: 100%; }
.bt-banner img { display: block; max-width: 100%; max-height: 18rem; width: auto; height: auto; border: 1px solid var(--border); }
.bt-banner figcaption { margin-top: 0.25rem; }
/* A list as long as a network's lists of sites can be, kept to a height of its own. */
.ticks.scroll { max-height: 18rem; overflow-y: auto; padding-right: 0.5rem; }
/* A choice with its picture -- a company page's logo, a Snapchat profile's --
   small and round beside its name, the line centred on it. */
.ticks label:has(.choice-picture) { align-items: center; }
.choice-picture { flex: none; width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; background: var(--border); }
/* Who the platform signed somebody in as, over the accounts to choose. */
.signed-in { margin: 0 0 1rem; }
.signed-in-as { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.25rem; }
/* A page with no picture has its initial in the place of one. */
span.choice-picture { display: inline-grid; place-items: center; color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
/* A setting set for the campaign and, apart from it, per ad group: two tabs
   over the row's form. */
.tabs { display: flex; gap: 1.25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--border); }
/* Buttons of the row's form, since going to the other tab takes along what was
   changed on this one, but looking like tabs rather than buttons. */
button.tab, a.tab {
  margin-bottom: -1px;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
}
button.tab:hover, a.tab:hover { color: var(--fg); }
a.tab { text-decoration: none; }
button.tab[aria-selected="true"], a.tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--fg); font-weight: 500; }
/* From one ad group to the next, beside what is set for it. */
.adgroup-browser { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.adgroup-browser select { width: auto; max-width: 16rem; }
.adgroup-browser button { min-width: 2.5rem; }
.adgroup-browser button:disabled { opacity: 0.4; cursor: default; }
/* The ad group's own choices show when its box is ticked, and what it takes
   from the campaign when not -- the stylesheet deciding, so no script has to. */
.own-toggle { display: flex; align-items: baseline; gap: 0.5rem; cursor: pointer; }
.own-choices { margin-left: 1.5rem; }
.own-setting .inherited { margin: 0.25rem 0 1rem 1.5rem; }
.own-setting:has(.own-toggle input:not(:checked)) .own-choices,
.own-setting:has(.own-toggle input:checked) .inherited { display: none; }

/* The Images row: two tabs over two panels of one form, the stylesheet showing
   whichever is ticked -- both are sent, whichever is showing. The tabs are
   labels of radio buttons, drawn as the row tabs are. */
label.tab { display: inline-block; margin-bottom: -1px; padding: 0.35rem 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; }
label.tab:hover { color: var(--fg); }
label.tab input { position: absolute; opacity: 0; pointer-events: none; }
label.tab:has(input:checked) { border-bottom-color: var(--accent); color: var(--fg); font-weight: 500; }
.image-search { display: flex; gap: 0.5rem; max-width: 36rem; margin-bottom: 0.75rem; }
.image-search input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
}
.image-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.image-search select { flex: none; width: auto; }
/* The files as tiles, the chosen first, each ticked in its corner. */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.75rem;
  max-width: 60rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}
.image-grid.chosen { padding-bottom: 0.75rem; border-bottom: 1px dashed var(--border); }
.image-tile { position: relative; display: block; cursor: pointer; }
.image-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--subtle);
}
.image-tile:has(input:checked) img { border-color: var(--accent); }
/* A chosen picture pressed to be the one its row's preview shows: the whole
   picture is the choice, under the cross that takes it away. */
.preview-choice {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
/* The file and what goes over it, apart from its shape under it: the box a
   press on the file lights up, its ripple kept to the file's corners and the
   browser's own flash of a press given up for it. */
.image-media { position: relative; }
.image-media:has(> .preview-choice) { overflow: hidden; border-radius: var(--radius); }
/* Chrome flashes the nearest thing that looks pressable -- the tile, by its
   pointer, its shape under the file too -- whatever is pressed in it. */
.image-tile, .preview-choice { -webkit-tap-highlight-color: transparent; }
.image-media:has(> .preview-choice:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-tick { position: absolute; top: 0.35rem; left: 0.35rem; line-height: 0; }
.image-about { display: block; margin-top: 0.2rem; }
.image-pages { margin: 0 0 1rem; }
/* A chosen file, taken away by the cross in its corner. */
.image-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 60%);
  color: #ffffff;
  line-height: 1;
}
.image-remove:hover { background: rgb(0 0 0 / 80%); }
/* Its bin, as a row's line is taken away by. */
.image-remove { display: grid; place-items: center; }
.image-remove svg { width: 1rem; height: 1rem; }
/* A chosen picture cut to another shape, by the scissors in the corner across
   from the cross. */
.image-crop {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 60%);
  color: #ffffff;
  cursor: pointer;
}
.image-crop:hover { background: rgb(0 0 0 / 80%); }
.image-crop svg { width: 1rem; height: 1rem; fill: currentColor; }

/* The crop dialog's picture, with the part kept in a box over it: what is
   outside the box darkened, its corners pulled to make it larger or smaller.
   The picture is as large as the dialog lets it be; the box is placed in
   percentages of it, so it stays where it is however large that is. */
.crop-stage {
  position: relative;
  width: min(100%, calc(min(60vh, 36rem) * var(--shape)));
  margin: 0 auto 0.75rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--subtle);
  touch-action: none;
  user-select: none;
}
.crop-stage img { display: block; width: 100%; height: auto; }
.crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 55%);
  cursor: move;
}
.crop-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-handle {
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 2px;
  background: #ffffff;
}
/* Inside the box's corners, so that a box at the picture's edge keeps them. */
.crop-nw { top: -2px; left: -2px; cursor: nwse-resize; }
.crop-ne { top: -2px; right: -2px; cursor: nesw-resize; }
.crop-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.crop-se { bottom: -2px; right: -2px; cursor: nwse-resize; }
/* The picture as wide as the dialog, not as a form of fields is. */
.form.crop-form { max-width: none; }
.crop-form output { font-variant-numeric: tabular-nums; color: var(--fg); }
/* The pictures chosen, each in the shape the ads have it: a file in its own,
   a feed's picture in the shape it is cut to -- or its own, taken as it is.
   All as high as each other, as wide as their shape makes them, in a row. */
.image-grid.chosen-pictures { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
/* A film, its first frame, as a picture is. */
.image-tile video {
  display: block;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--subtle);
  object-fit: cover;
}
.chosen-pictures .image-tile img,
.chosen-pictures .image-tile video,
.chosen-pictures .image-feed-none { width: auto; height: 7rem; max-width: 16rem; aspect-ratio: auto; }
.chosen-pictures .image-about { margin-top: 0.35rem; white-space: nowrap; }
.row-preview .preview-stage { padding: 1rem; }
/* The address the ad shown lands on, under the URL row's preview: long, and
   broken anywhere rather than running past the card. */
.preview-landing { margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.image-feed-none {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 5%, var(--surface));
}
/* The picker's upload: a button that opens the file dialog, the file input
   itself out of sight inside it. */
.image-upload { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.image-upload input[type="file"] { display: none; }

/* An audience a line, what it is on the left and how it is used on the right. */
.segments { list-style: none; margin: 0 0 1rem; padding: 0 0.5rem 0 0; max-width: 40rem; max-height: 28rem; overflow-y: auto; }
.segments li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; }
.segments li + li { border-top: 1px solid var(--border); }
.segments label { display: flex; flex-direction: column; min-width: 0; font-weight: normal; }
.segments select { flex: none; width: auto; }
.location-search { display: flex; gap: 0.5rem; max-width: 32rem; }
.location-choices { max-width: 32rem; margin-bottom: 1rem; }

/* Choosing which columns the campaigns table shows, and in what order. */
/* The Columns dialog: a column per row, a tab per column of boxes. The names
   stand apart at the top, since they do not move. */
/* Laid out from the heading row, so the three tabs' columns are one width
   whatever the names beside them, and a long name wraps rather than pushing
   the boxes off a narrow screen. */
.column-matrix { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 0 0 1rem; }
.column-matrix th, .column-matrix td { padding: 0.25rem 0.375rem; }
.dialog-columns { width: min(36rem, calc(100vw - 2rem)); }
.dialog-columns .form { max-width: none; }
/* Its title over the tabs' names, which stick tucked under it. */
.dialog-columns .dialog-header { z-index: 2; }
.column-matrix thead th:not(:first-child) { width: 6rem; white-space: nowrap; }
@media (max-width: 30rem) {
  .column-matrix th, .column-matrix td { padding: 0.25rem; }
  .column-matrix thead th { font-size: var(--text-xs); }
  .column-matrix thead th:not(:first-child) { width: 4rem; }
}
/* The tabs' names stay in sight while the list scrolls under them, below the
   dialog's own sticky title. The row sticks, rather than each name, so it can
   ask whether it is stuck: once it is, the list runs under it, and it is
   raised as a bar over the list is. */
.column-matrix thead {
  position: sticky;
  /* Tucked a little under the dialog's title, which is over it: at the
     title's height exactly (3rem, less the padding it is pulled up into),
     a title a pixel or two shorter left a gap the rows showed through. */
  top: 2.5rem;
  z-index: 1;
  container-type: scroll-state;
}
.column-matrix thead th {
  background: var(--bg);
  transition: background-color 150ms ease-out;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  box-shadow: inset 0 -1px 0 var(--border);
}
/* After the names' own colour: a query adds nothing to a rule's weight.
   Raised, the row is set off from the list by its colour, as the title's
   bar is, and its line goes. */
@container scroll-state(stuck: top) {
  .column-matrix thead th { background: var(--raised-bar); box-shadow: none; }
}
/* On a phone the dialog's title stands above what scrolls, rather than at
   the top of it: the tabs' names stick to the top of the list itself, up
   into the room the form keeps above what it holds. */
@media (max-width: 40rem), (max-height: 30rem) {
  .column-matrix thead { top: -1rem; }
}
/* The table reaches the dialog's edges, into its margin, so the names' bar,
   raised, is as wide as the title's above it; the margin is kept inside the
   first and last cells instead. */
.column-matrix { width: calc(100% + 2.5rem); margin-inline: -1.25rem; }
.column-matrix tr > :first-child { padding-left: 1.25rem; }
.column-matrix tr > :last-child { padding-right: 1.25rem; }
.column-matrix tbody th { font-weight: normal; text-align: left; overflow-wrap: anywhere; }
.column-matrix td { text-align: center; }
.column-matrix .column-names tr:last-child > * { border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.column-matrix .column-names + tbody tr:first-child > * { padding-top: 0.5rem; }
.column-matrix .drag-handle, .column-matrix .drag-handle-space {
  display: inline-flex; width: 1rem; margin-right: 0.5rem; vertical-align: middle;
}
.column-matrix .drag-handle { cursor: grab; }
.column-matrix tr.dragging { opacity: 0.4; }
/* Save stays in reach at the foot of a list longer than the window. From
   edge to edge of the dialog, as the list is (.column-matrix, pulled into
   the dialog's padding), so the rows do not show either side of it; the
   buttons kept in by the padding they are pulled out of. */
.column-matrix ~ .buttons {
  position: sticky;
  bottom: -1.25rem;
  margin: 0 -1.25rem -1.25rem;
  padding: 0.75rem 1.25rem 1.25rem;
  background: var(--bg);
  box-shadow: 0 -1px 0 var(--border);
}

/* Someone invited has no picture yet; the space where one will be keeps the
   names in a line. */
.avatar-empty { background: var(--border); }
/* A row that cannot be picked keeps the place a tick box takes, greyed out. */
.select-cell input:disabled { opacity: 0.35; cursor: default; }
/* Something to do with one row alone sits at the end of it. */
.rows-list .row-end { margin-left: auto; }
/* More than one: side by side, and the worded one as small as the bar's. */
.row-buttons { display: flex; align-items: center; gap: 0.5rem; }
.row-buttons button:not(.icon-button) { height: 2rem; padding: 0 0.6rem; font-size: var(--text-sm); white-space: nowrap; }

/* The menu folded down to its icons, for somebody who wants the width for a
   table. A choice kept on the user and drawn with the page, so the menu
   arrives the width it will stay. Only beside the page: on a narrow screen
   the menu is a bar that folds away of its own, and the button has nothing
   to do there. */
@media (max-width: 40rem), (max-height: 30rem) {
  .sidebar-collapse { display: none; }
}
@media not ((max-width: 40rem) or (max-height: 30rem)) {
  .app { transition: grid-template-columns 150ms ease; }
  .app[data-sidebar="collapsed"] { grid-template-columns: 4.25rem 1fr; }
  .app[data-sidebar="collapsed"] .sidebar { padding: 1rem 0.5rem; overflow-x: hidden; }
  /* The mark above the button that opens the menu again, both centred in a
     column the width of an icon. */
  .app[data-sidebar="collapsed"] .brand { flex-direction: column; padding: 0; gap: 0.75rem; }
  .app[data-sidebar="collapsed"] .brand-full { display: none; }
  .app[data-sidebar="collapsed"] .brand-mark { display: block; }
  /* Which team, and a list of long names to switch between: nothing an icon
     can stand for. */
  .app[data-sidebar="collapsed"] .team-slot { display: none; }
  .app[data-sidebar="collapsed"] .menu a { justify-content: center; padding: 0.5rem; }
  .app[data-sidebar="collapsed"] .menu-count { position: absolute; top: 0; right: 0; margin: 0; }
  /* Gone from sight but not from a screen reader, which still reads each
     link by its name. */
  .app[data-sidebar="collapsed"] .menu-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .app[data-sidebar="collapsed"] .account { padding: 0; display: flex; justify-content: center; }
  .app[data-sidebar="collapsed"] .account .user > span:not(.avatar) { display: none; }
  .app[data-sidebar="collapsed"] .account .user { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .app { transition: none; }
}

/* The three ways of looking at the campaigns, above their table: the
   campaigns, the ad groups inside them, the ads inside those. A row of words
   with a line under the one on show, as a tab strip is drawn. One row, always:
   on a narrow screen it scrolls sideways rather than breaking onto a second,
   which would read as a second strip of tabs. Its scroll bar is hidden, as a
   tab strip's is; a finger or a trackpad scrolls it. */
/* The room between two tabs' words is their padding rather than a gap, half
   each, so what can be tapped or clicked runs from one tab to the next. The
   strip reaches out by as much at its ends, so the first tab's words are at
   the page's margin. */
.level-tabs { --tab-pad: 0.875rem; }
.level-tabs ul {
  display: flex;
  list-style: none;
  margin: 0 calc(0px - var(--tab-pad)) 1rem;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  /* The line under the tabs drawn inside the strip rather than as its
     border: a strip that scrolls clips what is outside it, and the line
     under the tab on show would be cut where it lies over the border. As a
     background, in the page's width rather than the strip's. */
  background: linear-gradient(var(--border), var(--border)) var(--tab-pad) bottom / calc(100% - 2 * var(--tab-pad)) 1px no-repeat;
}
.level-tabs ul::-webkit-scrollbar { display: none; }
/* In the campaigns' Fullscreen on a phone the strip runs to the screen's
   edges, as the table under it does, so a tab scrolled past the margin goes
   off the screen rather than being cut short of it. At rest the tabs' words
   keep the margin, as the first tab's own padding (below). On the page it
   is drawn as on a wider screen, within the page's margin, as the box of
   the list under it is. */
@media (max-width: 40rem), (max-height: 30rem) {
  /* The tabs padded by the page's margin, the line under the one on show
     its whole width, Material's way. */
  html[data-full-table] #campaigns-table:has([data-full-table]) .level-tabs { --tab-pad: 1rem; --tab-line: 100%; }
  html[data-full-table] #campaigns-table:has([data-full-table]) .level-tabs ul {
    margin-inline: var(--edge-left) var(--edge-right);
    /* The line the strip's whole width, to the screen's edges. */
    background: none;
    box-shadow: inset 0 -1px 0 var(--border);
  }
  /* A bar straight under the tabs, both of them running to the screen's
     edges, meets the tabs' line rather than leaving a band of the page
     between two lines; the line is the bar's top. */
  html[data-full-table] #campaigns-table:has([data-full-table]) .level-tabs:has(+ .rows-bar) ul { margin-bottom: 0; }
  html[data-full-table] #campaigns-table:has([data-full-table]) .level-tabs + .rows-bar { border-top: 0; }
}
/* What can be done with the dashboard on show while it is arranged: a row
   of buttons from the left, under its tab. */
.dash-board-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
/* The arrows either side of the tab on show while the dashboards are
   arranged, which move it along: the icon buttons' own size, centred on the
   tab's words. */
.level-tab > .tab-move { display: flex; margin-block: 0; }
/* Its buttons are drawn as the heading's are: the icon before the words. */
.dash-board-actions button:has(> svg) { display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-board-actions button > svg { width: 1rem; height: 1rem; }
.dash-board-actions form { margin: 0; }
/* What the dashboard as a whole is filtered by, over its sections: the
   labels, and which cards they narrow, wrapping as one line of text would;
   arranged, the button that sets it at the end of the row. */
.dash-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin: 0 0 1rem; font-size: var(--text-sm); }
.dash-filter button { display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-filter button > svg { width: 1rem; height: 1rem; fill: currentColor; }
.dash-filter span + button { margin-left: 0.5rem; }
/* A card's labels, while the dashboard's filter stands in for them. */
.label-choice:disabled .label-boxes, .label-choice:disabled .label-match { opacity: 0.5; }
/* Arranging the dashboard on a narrow screen takes the screen over, as editing
   a campaign does: the menu's bar and the page's heading give way to a bar of
   its own -- the way out, what is being done, Done -- fixed at the top as a
   takeover's is. The title may take two lines rather than be cut short. */
.customise-bar { display: none; }
@media (max-width: 40rem), (max-height: 30rem) {
  .customise-bar { display: flex; }
  .app:has(.customise-bar) > .sidebar,
  .content:has(> .customise-bar) > .page-header { display: none; }
  .content:has(> .customise-bar) { padding-top: calc(var(--bar-height) + 1rem + env(safe-area-inset-top, 0px)); }
  /* The title may take two lines here rather than be cut short. */
  .customise-bar .takeover-title h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  /* Done in words, as a full-screen dialog's Save is at the right of its top
     bar: the accent's colour on the bar's, wide enough to tap. */
  .customise-bar > .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-height: var(--bar-button);
    min-width: 3.75rem;
    padding: 0 0.75rem;
    border-color: transparent;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
  }
}
.level-tab { flex: none; display: flex; align-items: center; white-space: nowrap; }
/* The line under the tab on show is under its words, or as wide as
   --tab-line says, drawn over the room its border keeps for it. */
.level-tab > a {
  position: relative;
  display: inline-block;
  padding: 0.5rem var(--tab-pad);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  background-origin: border-box;
}
.level-tab > a:hover { color: var(--fg); }
.level-tab.current > a {
  color: var(--fg);
  font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: center bottom;
  background-size: var(--tab-line, calc(100% - 2 * var(--tab-pad))) 2px;
  background-repeat: no-repeat;
}
/* A tab still in beta says so in a pill at its words' top corner, raised
   rather than over them: the strip scrolls sideways, and would cut off
   what stood above it. Closer to the words than a tab's other pills, over
   its padding (see below). */
.beta-pill {
  align-self: flex-start;
  margin-top: 0.1rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--beta-bg);
  color: var(--beta-fg);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.2rem;
}
/* A tab's pill or arrows stay as close to its words as 0.5rem, over its
   padding, and take the padding over at the tab's end; drawn over the
   padding, so they are what is pressed there. */
.level-tab > :not(a) { position: relative; z-index: 1; }
.level-tab > a ~ * { margin-left: calc(0.5rem - var(--tab-pad)); }
.level-tab > :has(~ a) { margin-right: calc(0.5rem - var(--tab-pad)); }
.level-tab > a ~ :last-child { margin-right: var(--tab-pad); }
.level-tab > :first-child:has(~ a) { margin-left: var(--tab-pad); }
.level-tab > a ~ .beta-pill { margin-left: calc(0.25rem - var(--tab-pad)); }
/* What of the tab is chosen, after its pill: beside the pill, not over it. */
.level-tab > .beta-pill + * { margin-left: 0.5rem; }
/* The keyboard's ring round a tab's words, with a little room either side,
   inside the tab's padding: a tab, as a button, cuts off what stands out of
   it (see the ripple). The × of the ticked count, round it. */
.level-tab > a:focus-visible { outline: none; }
.level-tab > a:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0.25rem calc(var(--tab-pad) - 0.375rem);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  pointer-events: none;
}
.level-chosen-clear:focus-visible { outline-offset: 1px; }
/* How many campaigns are ticked, and the way to let go of them. */
.level-chosen {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.1rem 0.35rem 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--nav-active);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
/* Heard still, where it is not shown. */
@media (max-width: 40rem), (max-height: 30rem) {
  .level-chosen-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
.level-chosen-clear { display: inline-flex; color: inherit; border-radius: 999px; }
.level-chosen-clear:hover { background: var(--border); }
.level-chosen-clear svg { width: 0.9rem; height: 0.9rem; }

/* The campaigns' ads, a page further down: a card each, as many to a row as
   the window holds. */
.campaign-previews { margin-top: 1.5rem; }
/* On a phone a list -- its bar and its rows, one box, a table or a list of
   lines -- is the box it is on a wider screen, rounded, within the page's
   margin: the same list at every width. The campaigns' Fullscreen is the
   way to the room the margin takes; there the tabs, the bar and the table
   run to the screen's edges (below). The ads' previews under the campaigns
   do fill the width, as a campaign's own page has its boxes. */
@media (max-width: 40rem), (max-height: 30rem) {
  .takeover-body:not(#campaign-settings) { padding: 1rem 1rem var(--page-foot, calc(1rem + env(safe-area-inset-bottom, 0px))); }
  html[data-full-table] #campaigns-table:has([data-full-table]) :is(.rows-bar, .table-scroll),
  .content .preview-tile { margin-inline: var(--edge-left) var(--edge-right); border-inline: 0; border-radius: 0; }
  /* A preview has no box at all here: the ad, under its campaign's name,
     is enough to tell one from the next. */
  .content .preview-tile { border: 0; }
  /* Its campaign's name keeps the page's margin, though, in line with the
     box of the list over it: the tile's padding, and as much again as the
     tile reaches past the margin. */
  .content .preview-tile > header {
    margin-inline: calc(0px - var(--edge-left) - var(--tile-padding)) calc(0px - var(--edge-right) - var(--tile-padding));
  }
  /* The media's pictures one to a line, within the page's margin. */
  .content .media-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Wide enough for a search ad to be drawn as the campaign's own page draws
   it, two to a row beside the menu. */
.preview-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(32rem, 100%), 1fr)); gap: 1rem; }
.preview-tile {
  --tile-padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: var(--tile-padding);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.preview-tile > header { min-width: 0; font-weight: 600; }
.preview-tile > header a,
.preview-tile > header .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-tile > header a { color: inherit; }
/* An ad group's card names its campaign on a line of its own under it, so the
   ad group's name, the shorter and the one the card is of, is not the one cut
   short. The mark stands by the first line. */
.preview-tile > header:has(.tile-names) { align-items: flex-start; }
.preview-tile > header:has(.tile-names) svg { margin-top: 0.3rem; }
.tile-names { display: flex; flex-direction: column; min-width: 0; }
.tile-names .muted { font-weight: normal; }
.tile-names a { align-self: flex-start; max-width: 100%; }
.preview-tile .preview-stage { padding: 1rem; }
/* The ad and the ad group and arrows under it, the arrows at the card's foot
   so that a row of cards has them in line, however tall each ad. */
.preview-tile-ad { display: flex; flex: 1; flex-direction: column; gap: 0.5rem; min-width: 0; }
.preview-tile-ad > .preview-stage { flex: 1; }
/* A standing ad is held narrower than on its campaign's page: its picture is
   square, so its width is its height, and a row of cards is read down a page
   rather than one at a time. */
.preview-tile .fb-ad, .preview-tile .li-ad { max-width: 17rem; }

/* A page one window tall whose table is the part that scrolls: the campaigns
   and the tabs beside them. The heading, the search, the tabs, the bar and
   the pages stay where they are, the header row stays at the top of the
   rows, and only the rows move -- both ways, since the columns are wider
   than the window as often as the rows are longer. A table shorter than the
   window is as tall as it is, with the pages right under it.
   On a phone too, where the menu is a bar above the page: the pages are in
   sight with the rows, rather than a long scroll down past them all. */
/* No taller than the window less the page's own padding above and below,
   so a long table's foot is where it was when the page was the window, and
   what is below it is reached by scrolling the page on past it. A short
   table is as tall as it is, and what is below it starts right under it. */
/* Nothing clipped here: the rows shrink to fit and scroll within
   themselves, and a menu opened over a short table hangs out past its foot
   rather than being cut off by it. */
.fill-screen {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
}
.fill-screen > * { flex: none; }
.fill-screen > .rows {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.fill-screen > .rows > * { flex: none; }
.fill-screen > .rows > .table-scroll {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
}
.fill-screen .table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  /* Its own edge underneath. A cell's border stays behind with the table
     when the cell sticks, and without one the half of a row sliding under
     reads as a second line of the heading. */
  --row-edge: inset 0 -1px 0 var(--border);
  box-shadow: var(--row-edge);
  /* That edge is the line under the heading; the border as well would
     draw it twice. */
  border-bottom: 0;
}
/* Where the header row and the column that stays cross, above both: the
   tick boxes', and the name's where it stays too -- by width alone, as the
   name stays, so a phone held sideways has it too. Where the window is
   narrower the name scrolls, and slides under the boxes' corner as the
   names below slide under the boxes, so it is not raised there. Not above
   3: the bar over the rows, and the Edit menu hanging from it, is at 4. */
.fill-screen .table-scroll thead th.select-column,
.fill-screen .sticky-first thead th:first-child { z-index: 3; }
@media not all and (max-width: 40rem) {
  .fill-screen .sticky-first thead .select-column + th { z-index: 3; }
}
/* What the keyboard reaches in the rows is scrolled into sight clear of the
   header row and the total row, which stay over the rows' ends: by itself
   the browser scrolls it only to the box's edge, under one of them. */
.fill-screen .table-scroll { scroll-padding-block: 2.5rem 3rem; }
/* The total row stays at the foot of the rows as the header row stays at
   their top, with its own edge above for the same reason. */
.fill-screen .table-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 0;
  --row-edge: inset 0 1px 0 var(--border);
  box-shadow: var(--row-edge);
  /* Room under the figures for a scroll bar drawn over the foot of the
     rows, as a Mac draws one, which would otherwise cover them. */
  padding-bottom: 1rem;
}
.fill-screen .table-scroll tfoot td.select-column,
.fill-screen .sticky-first tfoot td:first-child { z-index: 3; }
@media not all and (max-width: 40rem) {
  .fill-screen .sticky-first tfoot .select-column + td { z-index: 3; }
}
.fill-screen > .rows > .pager { margin-block: 0.75rem 0; }
/* The Graphs tab's charts are not rows to scroll in a box: the page is as
   tall as they are, and scrolls as one. In the same wrapper as the other
   tabs, so that going between them swaps the list alone. */
.fill-screen:has(> .key-metrics),
.fill-screen > .rows.key-metrics { max-height: none; }

/* On a phone the window is too short for all of it, so the menu's bar, the
   search and the filters scroll away above, and what fills the window is the
   rows -- their tabs, bar, table and pages -- all of it: the assistant's
   button floats over the corner, and no room is kept under the rows for it.
   The window as it is with the browser's bars showing (svh), since the page
   scrolls here and they come and go as it does: by dvh the table would grow
   and shrink with them as one scrolled.
   But never so little that the table has room for only a row or two, as on
   a phone held sideways: room for six or so under the tabs and the bar and
   over the pages, and the page scrolls a little further to show the pages
   there. A limit, not a height: a table of two rows still takes two rows'. */
@media (max-width: 40rem), (max-height: 30rem) {
  .fill-screen { max-height: none; }
  .fill-screen > .rows {
    max-height: max(100vh, 30rem);
    max-height: max(100svh, 30rem);
  }
  /* The table no taller than the window, though, so its heading and its
     total are on the screen together. */
  .fill-screen > .rows > .table-scroll {
    max-height: 100vh;
    max-height: 100svh;
  }
  /* A phone's scroll bar is thin and fades, so no room for it under Total. */
  .fill-screen .table-scroll tfoot td { padding-bottom: 0.5rem; }
}

/* The campaigns' tabs, bar, table and pages over the whole window, by the
   full-screen button at the bar's end: data-full-table on <html>, set by
   app.js and drawn by the server on the pages after it, so a sort, a page
   or a tab keeps it. The layout is fill-screen's, in a box the window's
   size: the rows scroll in it, and the tabs, the bar and the pages stay.
   Only in the phone's layout, where the page scrolls and the browser's bars
   come and go: where the menu is beside the page, the rows already fill the
   window under the heading. A window made that wide -- a phone turned, a
   window widened -- shows the page, the button gone, and the box comes back
   when it is narrowed again. Only while the list has the button, too: a tab
   with none -- nothing found -- is the page as it was, and the button there
   to leave by is never out of reach.
   Under the assistant's button (50) and the toasts (100); a dialog is in
   the top layer, over all of it. */
.full-table-leave,
html[data-full-table] .full-table-enter { display: none; }
html[data-full-table] .full-table-leave { display: revert; }
/* Lit up while it is the way out, so that it is found at a glance: the
   screen is all table, with nothing else to say how to leave. In the colours
   of the tab's count of ticked campaigns (.level-chosen), the other thing on
   the screen that says what one is in and lets one out of it. A step more of
   the accent under a pointer, and a step more again as it is pressed --
   kept small, as the words are the accent on it. Under a pointer only where
   there is one: a phone keeps :hover on what was last tapped, and the button
   stayed lit after the tap. Its border is the bar's, see .rows-filters. */
html[data-full-table] #campaigns-table button[data-full-table] {
  background: var(--nav-active);
  color: var(--accent);
  font-weight: 600;
}
@media (hover: hover) {
  html[data-full-table] #campaigns-table button[data-full-table]:hover {
    background: color-mix(in srgb, var(--accent) calc(var(--active-share) + 6%), var(--bg));
  }
}
html[data-full-table] #campaigns-table button[data-full-table]:active {
  background: color-mix(in srgb, var(--accent) calc(var(--active-share) + 12%), var(--bg));
}
@media (width > 40rem) and (height > 30rem) {
  #campaigns-table button[data-full-table] { display: none; }
}
/* The room round the box's tabs, bar, table and pages, at its top and its
   left -- here and in the move out below, which takes it away. At the top
   and the bottom there is none but what the screen keeps for itself (its
   notch, its bar to go home): the screen is all table, the tabs at its top
   and Total or the pages at its foot. At the sides it is the page's own
   margin -- 1rem, and what a phone on its side keeps clear (--safe-left) --
   which the tabs' line, the bar and the table reach past (--edge-left), as
   on the page: to the screen's edge where nothing is in the way, the
   cut-out's side short of the cut-out. So the box is never narrower than
   what reaches past its padding, which it would cut off: the "C" of the
   first tab, on the side of a phone's rounded corners. */
:root {
  --full-table-top: env(safe-area-inset-top, 0px);
  --full-table-left: calc(1rem + var(--safe-left));
}
@media (max-width: 40rem), (max-height: 30rem) {
  /* The page under the box no taller than the window, not merely kept from
     scrolling: a phone flashes the scroll bar of a long page -- the ads'
     previews under the table -- as it loads, beside the box's own. */
  html[data-full-table]:has(#campaigns-table [data-full-table]) { overflow: hidden; height: 100%; }
  html[data-full-table]:has(#campaigns-table [data-full-table]) > body { overflow: hidden; height: 100%; }
  html[data-full-table] #campaigns-table:has([data-full-table]) {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    max-height: none;
    margin: 0;
    padding: var(--full-table-top) calc(1rem + var(--safe-right))
      env(safe-area-inset-bottom, 0px) var(--full-table-left);
    background: var(--bg);
    /* Up and down only, should what is in it be taller than the screen
       after all -- the rows and the charts scroll on their own (below), so
       this is a tab with neither, nothing found. Sideways, the table
       scrolls, never the box with the tabs and the bar in it. */
    overflow: hidden auto;
    overscroll-behavior: contain;
  }
  /* Where the rows or the charts scroll, the box does not: a second scroller
     round the first, which a closed menu's choices laid out under the bar
     can make taller than the screen, and a phone shows the scroll bars of
     the two by turns as a finger moves. */
  html[data-full-table] #campaigns-table:has([data-full-table]):has(> .table-scroll, > .key-metrics-charts) { overflow: hidden; }
  html[data-full-table] #campaigns-table:has([data-full-table]) > * { flex: none; }
  html[data-full-table] #campaigns-table:has([data-full-table]) > .table-scroll {
    flex: 0 1 auto;
    min-height: 0;
    max-height: none;
    /* At the rows' end a finger does not go on to scroll the page behind. */
    overscroll-behavior: contain;
  }
  /* The Graphs tab's charts scroll as the rows do, under the tabs and the
     bar, which stay -- and with them the way out. To the screen's edges as
     the bar and the table reach them, so that their scroll bar is at the
     edge, the charts kept where they were by as much padding. */
  html[data-full-table] #campaigns-table:has([data-full-table]) > .key-metrics-charts {
    flex: 0 1 auto;
    min-height: 0;
    margin-inline: var(--edge-left) var(--edge-right);
    padding-inline: calc(1rem - var(--edge-left)) calc(1rem - var(--edge-right));
    overflow: hidden auto;
    overscroll-behavior: contain;
  }
  /* The pages close under Total and the screen's foot, half the room they
     have on a page: the screen is short, and every line kept for the pages
     is one less of rows. The buttons stay 2rem, to be tapped. (The
     .fill-screen rule for the pager does not reach this one, which is in a
     div of its own to be drawn again.) */
  html[data-full-table] #campaigns-table:has([data-full-table]) .pager { margin-block: 0.5rem; }
  /* From one page to the next -- a tab, a sort, a page -- the table is
     simply there, with no fade between the pages (see @view-transition): two
     tables of figures faded into each other read as a flicker, and nothing
     is beside the table for the fade to soften. Nor is the menu a layer of
     its own, here or in the move below: the layers of a transition are
     drawn over the page, the menu with them, over the box that hides it. */
  :is(html[data-full-table]:has(#campaigns-table [data-full-table]), html[data-full-table-moving]) .sidebar { view-transition-name: none; }
  html[data-full-table]:has(#campaigns-table [data-full-table]):not([data-full-table-moving])::view-transition-group(*),
  html[data-full-table]:has(#campaigns-table [data-full-table]):not([data-full-table-moving])::view-transition-old(*),
  html[data-full-table]:has(#campaigns-table [data-full-table]):not([data-full-table-moving])::view-transition-new(*) { animation: none; }

  /* Into the whole window and back, the box grows from its place on the
     page and shrinks back into it (app.js marks the move
     data-full-table-moving, "in" or "out"). What it holds is drawn the size
     it is -- the table as it is in the whole window, uncovered as the box
     grows, covered as it shrinks -- rather than a picture of the one
     stretched into the other, which smears the figures. The page behind
     stays as it was going in, and is as it will be coming out: the box hides
     the rest. Cut short at its top and its foot; at its sides 1rem out,
     so that nothing at its edges -- the tick boxes -- is cut as it moves. */
  html[data-full-table-moving] #campaigns-table { view-transition-name: full-table; }
  html[data-full-table-moving]::view-transition-group(full-table) {
    clip-path: inset(0 -1rem);
    animation-duration: 250ms;
    animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
  }
  html[data-full-table-moving]::view-transition-old(full-table),
  html[data-full-table-moving]::view-transition-new(full-table) {
    animation: none;
    inset: 0 auto auto 0;
    width: auto;
    height: auto;
  }
  html[data-full-table-moving]::view-transition-old(root),
  html[data-full-table-moving]::view-transition-new(root) { animation: none; }
  html[data-full-table-moving="in"]::view-transition-old(full-table),
  html[data-full-table-moving="in"]::view-transition-new(root),
  html[data-full-table-moving="out"]::view-transition-old(root) { opacity: 0; }
  /* Coming out, the table in the whole window is cut down as the box
     shrinks, its bar and its total cut off, and turns into the table as it
     is on the page -- columns of other widths, scrolled to the same share --
     in the second half of the move, rather than in one frame as it ends,
     which read as a flicker. It moves up and left by the room the box had
     round it as it goes, so its tabs, bar and rows are over the page's as
     the two meet. The group's timing, so the two keep pace. */
  html[data-full-table-moving="out"]::view-transition-old(full-table) {
    animation: full-table-going 250ms cubic-bezier(0.2, 0, 0, 1) both;
  }
  html[data-full-table-moving="out"]::view-transition-new(full-table) {
    animation: full-table-coming 250ms cubic-bezier(0.2, 0, 0, 1) both;
  }
}
@keyframes full-table-going {
  0%, 45% { opacity: 1; }
  to { opacity: 0; translate: calc(-1 * var(--full-table-left)) calc(-1 * var(--full-table-top)); }
}
@keyframes full-table-coming { 0%, 45% { opacity: 0; } to { opacity: 1; } }

/* A menu that is the screen on a phone -- Edit, the period menu -- fades in
   rising a little as it opens, and out as it closes by its ✕, as a dialog
   does there (data-opening and data-closing, from app.js, which marks them
   only there and not for whoever has asked for less motion). */
@keyframes screen-menu-in { from { opacity: 0; translate: 0 0.5rem; } }
@keyframes screen-menu-out { to { opacity: 0; translate: 0 0.5rem; } }
details[data-opening] > .menu-panel { animation: screen-menu-in 150ms ease-out; }
details[data-closing] > .menu-panel { animation: screen-menu-out 150ms ease-out forwards; }

/* The Edit menu's groups, each behind an item of its own. */
.menu-rule { margin: 0.25rem 0; border: 0; border-top: 1px solid var(--border); }
/* No grey flash where a group's name was tapped: a phone's browser lays it
   over the name, which on a phone is the bar over the group a moment later,
   so the bar flashed as it came up -- going back by it too. The group
   opening, or shutting, is what says the tap was taken, as for the period
   menu's button. */
.submenu > summary { list-style: none; -webkit-tap-highlight-color: transparent; }
.submenu > summary::-webkit-details-marker { display: none; }
.menu-action .submenu-arrow { display: flex; margin-left: auto; color: var(--muted); }
.menu-action .submenu-arrow svg { width: 0.875rem; height: 0.875rem; }
.submenu[open] > summary { background: var(--row-hover); }
/* Under its name where the window is narrow, set in a little. */
.submenu-panel { padding-left: 1rem; }
/* Beside the menu where there is room: the menu hangs from the bar's right
   end, so a group opens to its left. The menu does not scroll then -- a panel
   that scrolls cuts off whatever sticks out of it -- and a group scrolls on
   its own if it has to. Never where the menu is the screen (below), as on a
   phone turned on its side -- wide enough, but too low: there a group is
   part of the screen, whatever is added here. */
@media (min-width: 48rem) and (not ((max-width: 40rem) or (max-height: 30rem))) {
  .edit-menu .menu-panel { overflow: visible; max-height: none; }
  .submenu { position: relative; }
  .submenu-panel {
    position: absolute;
    top: -0.25rem;
    right: calc(100% + 0.25rem);
    min-width: 13rem;
    max-height: min(70vh, 30rem);
    overflow-y: auto;
    padding: 0.25rem;
    background: var(--bg);
    border: 1px solid var(--raised-edge);
    border-radius: var(--radius);
    box-shadow: var(--shadow-raised);
  }
  /* A menu hung from the bar's start opens its groups to the right. */
  .rows-actions.at-start .submenu-panel { right: auto; left: calc(100% + 0.25rem); }
}
/* The Edit menu is a list of things to do rather than of values to pick, and
   grows by a heading at a time; it is let run to most of the window before it
   scrolls, so that what is further down is seen to be there. */
.edit-menu .menu-panel { max-height: min(85vh, 44rem); }
/* The bar over the menu and a group's way back, shown only on a phone. */
:is(.edit-menu, .long-menu) .menu-head, .submenu-back { display: none; }
/* On a phone the Edit menu is the screen, as the period menu is, and so is
   a menu of more choices than a phone shows at once (.long-menu, see
   DropdownMenu) -- one of a few hangs from its button there too. For Edit,
   there is no
   room beside it for a group, and under its name a group pushes the rest
   down a list already longer than the screen. The ✕ and "Edit" where the
   app's bar has its ☰ and the page's name, then the menu, in a dialog's
   colour, its items tall enough to tap. A group opens in the menu's place,
   its name over it turned into the way back -- shutting the group, as
   tapping a name does anyway. The page behind stays still. Through
   details[open] > .menu-panel, to win over the bar's placing of its menus. */
@media (max-width: 40rem), (max-height: 30rem) {
  details:is(.edit-menu, .long-menu)[open] > .menu-panel {
    position: fixed;
    inset: 0;
    z-index: 55;
    width: auto;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) var(--inset-right) env(safe-area-inset-bottom, 0px) var(--inset-left);
    --bg: var(--dialog);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* The bar stays and the items under it scroll, so iOS pulling them past
       their ends does not pull the bar along -- as in the period menu. */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
    timeline-scope: --edit-menu-scroll;
  }
  :is(.edit-menu, .long-menu) .menu-items {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body:has(details:is(.edit-menu, .long-menu)[open]) { overflow: hidden; }
  /* The bar the menu hangs from is a layer of its own, under the page's ⋮;
     open, it is lifted over it, with the menu. */
  .rows-bar:has(details:is(.edit-menu, .long-menu)[open]) { z-index: 55; }
  /* No item lit up as the menu opens: a phone takes the tap that opened it
     for a pointer resting over whatever then lies under the finger. */
  @media (hover: none) { :is(.edit-menu .menu-action, .long-menu .menu-panel a):hover { background: none; } }
  :is(.edit-menu, .long-menu) .menu-head {
    flex: none;
    display: flex;
    align-items: center;
    padding: var(--bar-pad) 0.75rem;
    background: var(--bg);
  }
  /* Once the menu is scrolled under it, the bar is raised, as a full-screen
     dialog's is: a step lighter in the dark, the raised grey in the light. */
  @supports (animation-timeline: scroll()) {
    :is(.edit-menu, .long-menu) .menu-items { scroll-timeline: --edit-menu-scroll block; }
    :is(.edit-menu, .long-menu) .menu-head {
      animation: bar-raised linear both;
      animation-timeline: --edit-menu-scroll;
      animation-range: 0 1rem;
    }
  }
  :is(.edit-menu, .long-menu) .menu-head .icon-button { width: var(--bar-button); height: var(--bar-button); margin-left: calc(var(--bar-edge) - 0.75rem); color: var(--fg); }
  :is(.edit-menu, .long-menu) .menu-head .icon-button svg { width: 1.5rem; height: 1.5rem; }
  :is(.edit-menu, .long-menu) .menu-title { margin-left: var(--bar-title); font-size: var(--text-base); font-weight: 600; line-height: 1.25; color: var(--fg); }
  .edit-menu .menu-action { min-height: 3rem; gap: 1rem; padding: 0 1rem; }
  /* A long menu's Done, at the bar's end: words in the accent, as a full-
     screen dialog's action is, the bar's height to tap. */
  .long-menu .menu-done {
    margin-left: auto;
    min-height: var(--bar-button);
    padding: 0 calc(var(--bar-edge) + 0.25rem);
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
  }
  /* A long menu as the screen is in sections, as a phone's settings are: a
     section's name muted over its choices, and a line under the choices
     closing the section, rather than under its name. Room above a name,
     but the first, sets the sections apart. */
  .long-menu .menu-heading { margin-top: 0.75rem; padding-top: 0.5rem; border-bottom: 0; color: var(--muted); font-size: var(--text-sm); }
  .long-menu .menu-items > .menu-heading:first-child { margin-top: 0; }
  .long-menu .menu-items ul { padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
  .long-menu .menu-items ul:last-child { border-bottom: 0; }
  /* A long menu's choices, as tall to tap as the Edit menu's lines. */
  /* Set in from the screen's edges, so a chosen one's colour and its round
     corners have room, and what lights up as it is tapped is the same box
     as what is coloured once it is chosen. The words stay 1rem in. */
  .long-menu .menu-panel a { display: flex; align-items: center; min-height: 3rem; margin-inline: 0.5rem; padding-inline: 0.5rem; }
  .edit-menu .menu-action svg { width: 1.25rem; height: 1.25rem; }
  :is(.edit-menu, .long-menu) .menu-heading { padding-inline: 1rem; }
  .edit-menu .menu-rule { margin: 0.5rem 0; }
  /* A group open: the menu gives way to it, its bar too. The group's name is
     the bar instead, as tall, the ← where the ✕ was and the name where the
     title was, raised as the bar is once the group is scrolled under it.
     Tapping it shuts the group, as tapping a group's name does: back to the
     menu, from where the ✕ closes it. */
  .edit-menu .menu-panel:has(.menu-items > .submenu[open]) > .menu-head,
  .edit-menu .menu-items:has(> .submenu[open]) > :not(.submenu[open]) { display: none; }
  .edit-menu .submenu[open] > summary {
    position: sticky;
    top: 0;
    z-index: 1;
    gap: 0;
    min-height: var(--bar-height);
    padding: var(--bar-pad) 0.75rem;
    background: var(--bg);
    font-size: var(--text-base);
    font-weight: 600;
  }
  .edit-menu .submenu[open] > summary :is(.check, .submenu-arrow) { display: none; }
  .edit-menu .submenu[open] .submenu-back {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--bar-button);
    height: var(--bar-button);
    margin: 0 var(--bar-title) 0 calc(var(--bar-edge) - 0.75rem);
  }
  .edit-menu .submenu[open] .submenu-back svg { width: 1.5rem; height: 1.5rem; }
  @supports (animation-timeline: scroll()) {
    .edit-menu .submenu[open] > summary {
      animation: bar-raised linear both;
      animation-timeline: --edit-menu-scroll;
      animation-range: 0 1rem;
    }
  }
  /* A group in the screen's colour, and so its items lit from it too: the
     panel would otherwise be a popup's colour (see .submenu-panel above). */
  .edit-menu .submenu-panel { padding-left: 0; --bg: inherit; }
}

/* A dialog for picking from a long list -- places, languages, audiences: the
   heading and what is typed to search stay at the top and the buttons at the
   bottom, and the list between them scrolls. Wide enough on a large screen
   for a place's whole name to sit on one line. Flex only while open: a dialog
   is hidden by its display, and setting one would show it shut. */
.dialog-picker {
  width: min(48rem, calc(100vw - 2rem));
  height: min(56rem, calc(100vh - 4rem));
  overflow: hidden;
}
.dialog-picker[open] { display: flex; flex-direction: column; }
.dialog-picker .dialog-header { position: static; flex: none; }
.picker-form { display: flex; flex-direction: column; flex: 1; min-height: 0; max-width: none; }
.picker-form > * { flex: none; }
.picker-form > .picker-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  /* From edge to edge of the dialog, its lines and its scroll bar with it,
     rather than in a box inset by the dialog's padding: what it holds keeps
     that padding inside, clear of the scroll bar. */
  margin-inline: -1.25rem;
  padding-inline: 1.25rem;
}
.picker-form .buttons { margin: 0; }
.picker-list .location-choices { max-width: none; margin: 0; }
.picker-list .ticks { margin: 0.5rem 0; }
/* A box of lines in such a dialog -- keywords -- fills the room the list
   would, and scrolls on its own. */
.picker-form > .picker-fill { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 1rem; }
.picker-fill textarea { flex: 1; min-height: 8rem; max-height: none; field-sizing: fixed; resize: none; }
.picker-fill > p { margin: 0.35rem 0 0; }
/* A radius on a map (views.RadiusDialog): the search for an address, what
   it finds floating over the map under it, which takes the room there is,
   and under that the name and the kilometres side by side. */
.dialog-radius .radius-search { position: relative; margin-bottom: 0.5rem; }
.radius-found {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 18rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}
.radius-found:empty { display: none; }
.radius-found p { margin: 0.25rem 0.5rem; }
.radius-places { list-style: none; margin: 0; padding: 0; }
.radius-place {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  color: var(--fg);
  font-size: var(--text-sm);
  cursor: pointer;
}
.radius-place:hover, .radius-place.active { background: var(--row-hover); }
.picker-form > .radius-map {
  flex: 1;
  min-height: 16rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Leaflet's own panes are numbered up to 1000; kept under the dialog's. */
  isolation: isolate;
}
.radius-fields { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.radius-fields .radius-name { flex: 1 1 16rem; }
.radius-fields .radius-km { flex: none; }
.radius-km .field-beside { align-items: center; }
.radius-km input { width: 6rem; }
.dialog-radius .picker-form > .muted { margin: 0 0 0.75rem; }
/* The marker: a dot in the app's blue, ringed so it stands out on any
   map; the circle round it the same blue, faint inside. */
.radius-marker {
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent-fill);
  box-shadow: var(--shadow-raised);
  cursor: grab;
}
.radius-marker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.leaflet-interactive.radius-circle { stroke: var(--accent); stroke-width: 2; fill: var(--accent); fill-opacity: 0.12; }
/* Where the window is narrow, the Edit menu hangs under the whole bar, from
   edge to edge, rather than from its button: the button stands first among
   the bar's, and a menu hung from it would run off the window's left edge. */
@media (max-width: 47.99rem) {
  .rows-bar:has(.edit-menu) { position: relative; }
  .edit-menu { position: static; }
  .edit-menu .menu-panel { left: 0; right: 0; }
}
/* The Feed dialog of the ticked campaigns: Close stands apart from the last
   line, as it does at the end of the campaign page's Feed row. */
.bulk-feed .buttons { margin-top: 1.5rem; }
.picker-list > .placements-choice { padding-top: 0.5rem; }
/* What a dialog to read says, in its list's place. */
.picker-list.dialog-read { padding-block: 1rem; }
.dialog-read > .attention { margin: 0; }
/* A dialog takes the focus itself as it opens -- see app.js -- and a ring
   round the whole of it says nothing. */
#dialogs dialog:focus, #dialogs dialog:focus-visible { outline: none; }
/* The ticked campaigns' pictures, in a dialog: the whole picture ticks it, a
   ticked one outlined, as in the image picker. */
.bulk-images label.media-thumb:has(input:checked) { outline: 3px solid var(--accent); outline-offset: -3px; }
.bulk-images .picker-list .media-grid { padding: 0.75rem 0; }
.dialog-picker.dialog-wide { width: min(64rem, calc(100vw - 2rem)); }
/* The search and filters over the Images dialog's grid, on a line of their
   own that wraps on a narrow window. */
.bulk-images-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.bulk-images-filters .search-field { flex: 1 1 14rem; min-width: 0; }
/* As tall as the menus beside it. */
.bulk-images-filters .search-field input { height: auto; align-self: stretch; }
.bulk-images-filters select { flex: none; }
/* Half ticked: some of the campaigns show it, and saving leaves it so. */
.bulk-images label.media-thumb:has(input:indeterminate) { outline: 3px dashed var(--accent); outline-offset: -3px; }
/* The ticked campaigns' keywords or texts, a line each: the line to change,
   in a box as tall as the line wraps to, and a bin beside it. Under each,
   how many of them have it; under a line only some of them have, Add to all
   beside that, which reads Undo once pressed and then counts all of them. The bin and Add to all are boxes drawn
   as buttons (views.bulkLineRow): what they say comes of whether they are
   ticked. A line binned is struck through, as saving takes it away, and is
   not added to all. */
.bulk-lines { list-style: none; margin: 0; padding: 0.5rem 0; }
.bulk-lines li { display: flex; align-items: flex-start; gap: 0.4rem; padding: 0.15rem 0; }
.bulk-line { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.bulk-lines textarea { width: 100%; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; color: inherit; font: inherit; line-height: 1.5; resize: none; field-sizing: content; }
.bulk-lines textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.bulk-line-remove { flex: none; margin-top: 0.2rem; }
.bulk-line-remove:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.bulk-line-count { display: flex; gap: 0.5rem; padding-left: 0.5rem; }
.bulk-line-add { position: relative; color: var(--accent); cursor: pointer; }
.bulk-line-add:hover { text-decoration: underline; }
.bulk-line-add:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.bulk-lines li :is(.bulk-line-on, .bulk-line-all) { display: none; }
.bulk-lines li label:has(:checked) .bulk-line-off { display: none; }
.bulk-lines li label:has(:checked) .bulk-line-on { display: inline; }
.bulk-lines li:has(.bulk-line-add :checked) .bulk-line-some { display: none; }
.bulk-lines li:has(.bulk-line-add :checked) .bulk-line-all { display: inline; }
.bulk-lines li:has(.bulk-line-remove :checked) textarea { text-decoration: line-through; opacity: 0.6; }
.bulk-lines li:has(.bulk-line-remove :checked) .bulk-line-add { display: none; }
/* A button standing apart from Save and Cancel, at the far end of the row. */
.buttons .buttons-end { margin-left: auto; }
/* Add label, at the end of the labels it adds to. */
.labels-add { margin: 0.75rem 0 0; }
/* A row of texts listed a line each: the line opens the dialog it is changed
   in, the bin after it takes it away. */
.text-list { list-style: none; margin: 0 0 0.5rem; padding: 0; border-top: 1px solid var(--border); max-width: 36rem; }
.text-list li { display: flex; align-items: center; gap: 0.25rem; border-bottom: 1px solid var(--border); }
.text-list-line {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.4rem;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.text-list-line:hover { background: var(--row-hover); }
.text-list-line > span { display: block; }
.text-list-example { margin-top: 0.1rem; }
/* A current budget or bid target in the campaigns table, with the clock and
   the calendar of what adjusts it: the two at the cell's left, each in its
   place whether it is there or not, and the figure at the right as every
   figure is -- so that clocks and calendars stand in columns down the table
   however wide the numbers are. */
.adjusted-figure { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.adjusted-icons { display: flex; gap: 0.25rem; }
.adjusted-icon { display: inline-flex; color: var(--muted); }
.adjusted-icon:is(:hover, :focus-visible) { color: var(--fg); }
.adjusted-icon svg { width: 1rem; height: 1rem; }
.adjusted-icon-none { visibility: hidden; }
/* What kind of line it is, before it, in the list's quiet colour. */
.text-list-icon { display: flex; flex: none; padding-left: 0.4rem; color: var(--muted); }
.text-list-icon svg { width: 1.125rem; height: 1.125rem; }
/* A line of the list there is nothing to change in but to take away. */
.text-list-text { flex: 1; min-width: 0; padding: 0.5rem 0.4rem; overflow-wrap: anywhere; }
.text-list-text > span { display: block; }
/* A YouTube video listed: its picture, as YouTube shows it, beside its
   address. */
.text-list-line.youtube-line { display: flex; align-items: center; gap: 0.75rem; }
.youtube-thumbnail { flex: none; width: 6rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--border); }
/* A TikTok post listed, or offered to tick: a still of it, upright as the
   post is, beside what it says. */
.text-list-text.post-line { display: flex; align-items: center; gap: 0.75rem; }
/* Whose a creator's post is, under what it says. */
.post-line .post-note { display: block; }
.post-still { flex: none; width: 2.25rem; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius); background: var(--border); }
/* A creator's Instagram post as Instagram shows it, in a frame of its own
   page: as wide as Instagram draws it, and tall enough for a reel and the
   lines under it. */
.partnership-embed iframe { display: block; width: min(100%, 26rem); height: min(46rem, 70vh); margin: 0 auto; border: 0; border-radius: var(--radius); background: var(--border); }
/* A product's place among the campaign's, as narrow as its number. */
.item-rows .item-place { width: 1%; white-space: nowrap; }
/* An example too long for the ad it is of: said beside it, amber as what
   needs doing is, and as a pill so it is not read as more of the example. A
   line too long in a dialog's count is the same pill. */
.text-list-warning, .char-count .over { border-radius: 999px; background: var(--pending-bg); color: var(--pending-fg); }
.text-list-warning { display: inline-block; margin-left: 0.5rem; padding: 0 0.5rem; }
/* The search over a dialog's rows of lines, or of labels. */
.lines-search { margin-bottom: 0.75rem; }
.bulk-lines li[hidden], .label-choices li[hidden] { display: none; }
.picker-list .label-choices { margin: 0; padding: 0.5rem 0; }
/* A list changed since it was last written to its network. */
.badge.needs-sync, .badge.incomplete { background: var(--pending-bg); color: var(--pending-fg); }
/* A keyword kept from its ads by a negative one, beside its words. */
.badge.excluded { margin-left: 0.5rem; background: var(--subtle); color: var(--muted); }
.badge.sync-errors, .badge.removed { background: var(--bad-bg); color: var(--bad-fg); }
/* A campaign's assets left out, or its chart asking for training: to be done,
   amber as the rest. In training is under way, the app's blue as a sync is. */
.badge.assets, .badge.needs-training { background: var(--pending-bg); color: var(--pending-fg); }
.badge.in-training { background: var(--nav-active); color: var(--accent); }
/* How many more issues the campaign has than its pill says, which pressing
   it shows: part of the pill, a space after its name. */
.badge-more { margin-left: 0.25em; font-weight: 600; }
/* A badge that opens what it is about: a badge still, not a button. */
button.badge { border: 0; font: inherit; font-size: var(--text-xs); line-height: inherit; }
.incomplete-why { display: grid; gap: 0.4rem; }
.incomplete-why p { margin: 0; }
.attention.incomplete-why ul { list-style: disc; padding-left: 1.25rem; }
.needs-sync-why h3 { margin: 1rem 0 0.4rem; font-size: var(--text-sm); }
/* A campaign's issues in one dialog: each under its name, a step over the
   text and the headings inside it, and set off from the one before by a
   line, so where one ends and the next begins is plain. */
.campaign-issue > h3 { margin: 0 0 0.5rem; font-size: var(--text-lg); font-weight: 600; }
.campaign-issue + .campaign-issue { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.campaign-issue > .attention { margin-bottom: 0; }
.needs-sync-why p { margin: 0 0 0.4rem; }
.needs-sync-edits { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.needs-sync-edits ul { margin: 0; padding-left: 1.25rem; }

/* Being sent, or waiting its turn in its account: under way, so the app's
   blue rather than a warning. */
.badge.syncing { display: inline-flex; align-items: center; gap: 0.3rem; background: var(--nav-active); color: var(--accent); }
.badge.syncing .spinner { width: 0.65rem; height: 0.65rem; border-width: 1.5px; }
.waiting-dots { display: inline-flex; gap: 0.15rem; }
.waiting-dots span {
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: currentColor;
  animation: waiting-dot 1.2s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes waiting-dot {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .waiting-dots span { animation-duration: 3.6s; } }
.badge.needs-reconnect { background: var(--bad-bg); color: var(--bad-fg); }

/* What needs doing, at the top of the dashboard: a line a thing, each a way
   to where it is done. */
.attention {
  margin-bottom: 1.5rem; padding: 0.75rem 1rem; border-radius: 8px;
  /* A link said whole, in what a network refused, breaks rather than runs out. */
  overflow-wrap: anywhere;
  background: var(--pending-bg); color: var(--pending-fg);
}
.attention ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; }
.attention a { color: inherit; font-weight: 600; }
/* On a campaign's page, under the overview, spaced from it as the groups are
   from each other. */
.takeover-body > .attention { margin: 1rem 0 0; }
.takeover-body > #spotify-audience > .attention { margin: 1rem 0 0; }
/* What went wrong with the last send, where what it lacks would be: the same
   box, red rather than yellow. */
.attention.sync-failed { background: var(--bad-bg); color: var(--bad-fg); display: grid; gap: 0.4rem; }
.attention.sync-failed p { margin: 0; }
.attention.sync-failed ul { list-style: disc; padding-left: 1.25rem; }
/* That the campaign is removed, so only looked at (views.removedNote): grey,
   as there is nothing to do about it, the lock as a locked box has it. */
.attention.removed-note {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
}
.attention.removed-note svg { flex: none; width: 1.1em; height: 1.1em; }

/* A send going on, in place of the button that started it. */
.sync-running { display: inline-flex; align-items: center; gap: 0.4rem; }
/* How long a sync under way has taken, a clock that counts on (app.js): in
   figures of one width, so that it does not shift as it counts. */
.sync-elapsed { font-variant-numeric: tabular-nums; font-weight: 400; color: var(--muted); }
.sync-elapsed::before { content: "· "; }
.sync-outcome-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; }
.sync-outcome-heading p { margin: 0; }

/* A device's adjustment, under it while it is targeted. */
.devices .device { display: grid; gap: 0.35rem; margin-bottom: 0.5rem; }
.devices .device-adjust { margin: 0 0 0 1.75rem; display: flex; align-items: center; gap: 0.5rem; }
.devices .device-adjust select { width: auto; }
.devices .device:has(input[name="device"]:not(:checked)) .device-adjust { display: none; }

/* AI Max's two parts, under it and greyed out while it is off. */
.ai-max .checkbox { display: flex; gap: 0.5rem; align-items: baseline; margin-bottom: 0.5rem; }
.ai-max-parts { margin-left: 1.5rem; }
.ai-max:has(input[name="enable"]:not(:checked)) .ai-max-parts { opacity: 0.5; pointer-events: none; }

/* A search ad's display path: its domain, then its two parts, each a box,
   as the ad shows them. */
.display-path { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.display-path input { flex: 1 1 8rem; min-width: 6rem; }

/* A data point's value at the end of its row. */
.data-point-value { font-weight: 600; white-space: nowrap; }
/* The value field of a percentage, the sign beside it. */
.field-beside.data-point-amount { align-items: center; }

/* BI Monitor's forecasts: a month at a time, a card each, the cards side by
   side where there is room for two charts to be read. */
.month-steps { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.month-steps h2 { margin: 0; font-size: var(--text-base); min-width: 9rem; text-align: center; }
.icon-button.disabled { opacity: 0.3; pointer-events: none; }
.forecast-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr));
  gap: 1rem;
}
.forecast-card { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.forecast-card .card-head h3 { margin: 0; }
.forecast-card .card-head .forecast-menu { margin-left: auto; }
.forecast-card > p { margin: 0; }
/* A forecast on the dashboard: two cards wide where its section has the room
   for two, for the chart. */
.card-grid { container-type: inline-size; }
/* A graph is a section wide, or as much of it as it is told to take: its
   chart, and its totals at the right. */
.card-grid > .dash-graph { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.5rem;
  container: dash-graph / inline-size; }
/* Half or a third of the section is that many of the columns there are,
   which is as many cards as fit with their 1rem gaps: up to four 14rem
   ones, n columns from 15n - 1rem, and from five 18rem ones, from 19n - 1rem.
   A card a column wide where there are too few to share out. */
.card-grid > .dash-card.width-half, .card-grid > .dash-card.width-third { grid-column: auto; }
.card-grid > .dash-card.width-full { grid-column: 1 / -1; }
@container (min-width: 59rem) { .card-grid > .dash-card.width-half { grid-column: span 2; } }
@container (min-width: 113rem) {
  .card-grid > .dash-card.width-half { grid-column: span 3; }
  .card-grid > .dash-card.width-third { grid-column: span 2; }
}
@container (min-width: 151rem) { .card-grid > .dash-card.width-half { grid-column: span 4; } }
.dash-contribution { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 2rem; }
.dash-graph-body { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; align-items: center; gap: 1rem; }
/* The totals over the chart rather than beside it, where the card is too
   narrow for both: on a phone, or a graph a part of its section wide. */
@media (max-width: 47.99rem) {
  .dash-graph-body { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .dash-graph-body .key-metric-totals { order: -1; flex-direction: row; align-items: baseline; gap: 0.5rem; }
}
@container dash-graph (max-width: 30rem) {
  .dash-graph-body { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .dash-graph-body .key-metric-totals { order: -1; flex-direction: row; align-items: baseline; gap: 0.5rem; }
}
/* A graph beside a taller card -- a contribution card's chart is the
   taller -- fills its own to the same height rather than leaving the space
   under it empty: its chart grows, and the networks stay at the foot. */
.dash-graph > .dash-graph-body { flex: 1; align-items: stretch; }
.dash-graph-body > .key-metric-totals { align-self: center; }
.dash-graph-body > .forecast-chart.key-metric-chart { grid-template-rows: minmax(6rem, 1fr) 1.25rem; }
@container dash-graph (max-width: 30rem) {
  .dash-graph-body { grid-template-rows: auto 1fr; }
  .dash-graph-body > .key-metric-totals { align-self: start; }
}
/* Every other day along the bottom of a graph a column or two wide, where all
   of them would run into each other. */
@container dash-graph (max-width: 24rem) { .dash-graph .forecast-x > span:nth-child(even) { display: none; } }
/* A card of figures in a section with a forecast keeps its own height
   rather than the chart's. A chart -- a graph, a forecast -- takes its row's,
   as it does in a section without one. */
.card-grid:has(> .dash-forecast) > .dash-card:not(.dash-graph, .dash-forecast) { align-self: start; }
/* Smaller than on the forecasts tab: a lower chart, closer together, and
   without the data points, which the tab has. */
.dash-card.dash-forecast { gap: 0.5rem; }
/* The chart grows to fill the card where its row is taller -- beside a
   contribution card, say -- rather than leaving the space under it empty. */
.dash-forecast > .forecast-chart { flex: 1; grid-template-rows: minmax(7rem, 1fr) 1.25rem; }
.dash-forecast .forecast-figures dd { font-size: var(--text-base); }
.dash-forecast .forecast-points { display: none; }
.dash-forecast .card-head h3 a { color: inherit; text-decoration: none; }
.dash-forecast .card-head h3 a:hover { text-decoration: underline; }
@container (min-width: 29rem) { .card-grid > .dash-forecast { grid-column: span 2; } }
.forecast-figures { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0; }
.forecast-figures dt { color: var(--muted); font-size: var(--text-sm); }
.forecast-figures dd { margin: 0; font-size: var(--text-lg); font-weight: 600; }
.forecast-legend { display: flex; gap: 1rem; color: var(--muted); font-size: var(--text-xs); }
.forecast-key { display: inline-flex; align-items: center; gap: 0.35rem; }
.forecast-swatch { width: 1.25rem; border-top: 2px solid; }
.forecast-swatch.budget { border-color: var(--muted); }
.forecast-swatch.actual { border-color: var(--accent); }
.forecast-swatch.prediction { border-color: var(--accent); border-top-style: dashed; }

/* The campaigns' key metrics: a row a number -- which, to choose another; its
   chart, the period's line over the period before's, dashed; and the totals,
   the period's over the one before's and the change between -- as the old
   app laid it out. One under another on a phone. */
.key-metrics-tools { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
/* Fullscreen as its icon alone where its words would not fit beside the
   period and the points, as the other tabs' bar has it (see .rows-tools):
   in words, and lit up as the way out, wherever there is room. The count,
   the tools and the words take about 37rem over 30 days; a little more for
   a longer period's name. */
@container (width < 40rem) {
  .key-metrics-tools .tool-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* Narrower still -- a phone's, inside the page's margin -- the period by its
   name alone, so that the tools keep to one line rather than each break
   onto two: its days are in its menu, and heard still. (The charts' period
   is never moved back for the attribution window, whose days would be all
   that said so.) */
@container (width < 22rem) {
  .key-metrics-tools .period-said .period-days {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* The key metrics to choose from: a box each, dragged into order. */
.dialog-picker.dialog-key-metrics { width: min(28rem, calc(100vw - 2rem)); }
.key-metrics-choices { list-style: none; margin: 0; padding: 0.25rem 0; }
.key-metrics-choices li { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.25rem; }
.key-metrics-choices .drag-handle { cursor: grab; color: var(--muted); display: inline-flex; }
.key-metrics-choices .drag-handle svg { width: 1rem; height: 1rem; }
.key-metrics-choices label { flex: 1; }
/* No table hangs under the bar here, so it is rounded all round, as the
   media's is over its tiles. */
.key-metrics > .rows-bar { border-radius: var(--radius); }
/* Its width is what .key-metrics-tools asks of, to say Fullscreen in words. */
.key-metrics > .rows-bar { container-type: inline-size; }
.key-metrics-charts { padding: 0 1rem; }
.key-metric {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) 8rem;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.key-metric:last-child { border-bottom: 0; }
.key-metric-choice select { width: 100%; }
.forecast-chart.key-metric-chart { grid-template-rows: 6rem 1.25rem; }
.key-metric-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; font-variant-numeric: tabular-nums; }
.key-metric-totals strong { font-size: var(--text-lg); }
.key-metric-change { color: var(--muted); }
.key-metric-none { margin: 0; text-align: center; }
.forecast-line.key-current { stroke: var(--accent); }
.forecast-line.key-previous { stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 1.5; }
/* A day with no day beside it, which no line reaches: a dot where it is,
   left to the column under it to be pointed at. */
.key-point {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  translate: -50% -50%; background: var(--accent); pointer-events: none;
}
.key-point.key-previous { opacity: 0.35; }
@media (max-width: 47.99rem) {
  .key-metric { grid-template-columns: minmax(0, 1fr) auto; }
  .key-metric-chart { grid-column: 1 / -1; grid-row: 2; }
}

/* The chart: figures up the side and days along the bottom in HTML, the lines
   in an SVG stretched over the box between them. */
.forecast-chart {
  display: grid;
  grid-template-columns: 3rem 1fr;
  grid-template-rows: 13rem 1.25rem;
  font-size: var(--text-xs);
  color: var(--muted);
}
.forecast-y, .forecast-x, .forecast-plot { position: relative; }
.forecast-y { grid-column: 1; grid-row: 1; }
.forecast-y > span { position: absolute; right: 0.5rem; transform: translateY(-50%); white-space: nowrap; }
.forecast-x { grid-column: 2; grid-row: 2; }
.forecast-x > span { position: absolute; top: 0.25rem; transform: translateX(-50%); white-space: nowrap; }
.forecast-plot { grid-column: 2; grid-row: 1; }
.forecast-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.forecast-grid { stroke: var(--border); stroke-width: 1; }
.forecast-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.forecast-line.budget { stroke: var(--muted); }
.forecast-line.actual { stroke: var(--accent); }
.forecast-line.prediction { stroke: var(--accent); stroke-dasharray: 2 3; }
/* A campaign's performance charts, side by side where there is room. */
.campaign-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 2rem; }
.campaign-charts-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.campaign-charts-controls select { width: auto; }
/* A chart of one number against another: a dot for each look back, the curve
   through them, and a line from nought at a ROAS. The dots and the marks lie
   over the SVG rather than in it, where stretched they would be ovals. */
.scatter { margin: 0; min-width: 0; }
.scatter-y-label, .scatter-x-label { color: var(--muted); font-size: var(--text-xs); }
.scatter-y-label { margin: 0 0 0.5rem; }
.scatter-x-label { margin-top: 0.25rem; text-align: right; }
/* The days the curve was drawn through, under the chart; that it is mostly
   assumed, a warning like a chart's look backs not all known. */
.scatter-fit { margin-top: 0.25rem; color: var(--muted); font-size: var(--text-xs); }
.scatter-short, .scatter-assumed { margin: 0.25rem 0 0; color: var(--amber-fg); font-size: var(--text-xs); }
.scatter-instead { margin: 0 0 0.5rem; color: var(--amber-fg); font-size: var(--text-xs); }
.scatter-train { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.scatter-train > svg { flex: none; width: 2rem; height: 2rem; color: var(--muted); }
/* Amber where the setting has varied too little, as the warning over it is. */
.scatter-train.train-weak > svg { color: var(--amber-fg); }
.scatter-train.train-weak button { border-color: var(--amber-fg); background: var(--amber-bg); color: var(--amber-fg); }
/* A slider with a handle each side of the middle (views.TrainDialog): two
   range inputs side by side, the left one right to left, over one track drawn
   here. The part between the handles is filled from --low and --high, of
   --most, which app.js keeps in step as they are dragged. A handle at nought
   sits at its half's inner end, half a handle from the middle. */
.dual-range { --thumb: 1.125rem; position: relative; display: flex; height: 1.5rem; }
.dual-range::before, .dual-range::after {
  content: ""; position: absolute; top: calc(50% - 2px); height: 4px; border-radius: 2px; }
.dual-range::before { left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); background: var(--border); }
.dual-range::after {
  left: calc(50% - var(--thumb) / 2 - var(--low) / var(--most) * (50% - var(--thumb)));
  right: calc(50% - var(--thumb) / 2 - var(--high) / var(--most) * (50% - var(--thumb)));
  background: var(--accent-fill); }
.field .dual-range input[type="range"] {
  position: relative; z-index: 1; flex: 1; width: 50%; height: 100%; margin: 0; padding: 0;
  border: 0; background: transparent; appearance: none; cursor: pointer; }
.field .dual-range input[type="range"]:focus { outline: none; }
.dual-range input::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.dual-range input::-moz-range-track { background: transparent; }
.dual-range input::-webkit-slider-thumb {
  width: var(--thumb); height: var(--thumb); margin-top: calc((1.5rem - var(--thumb)) / 2);
  border: 2px solid var(--accent-fill); border-radius: 50%; background: var(--surface); appearance: none; }
.dual-range input::-moz-range-thumb {
  box-sizing: border-box; width: var(--thumb); height: var(--thumb);
  border: 2px solid var(--accent-fill); border-radius: 50%; background: var(--surface); }
.dual-range input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.dual-range input:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.dual-range-values { display: flex; justify-content: space-between; margin-top: 0.25rem;
  color: var(--muted); font-size: var(--text-sm); }
/* As tall as a chart's plot and figures, so a row of them stays even. */
.scatter-missing { display: grid; place-items: center; height: 14.25rem; margin: 0; border: 1px dashed var(--border);
  border-radius: 6px; color: var(--muted); font-size: var(--text-sm); text-align: center; }
.scatter-dots, .scatter-marks { position: absolute; inset: 0; pointer-events: none; }
.scatter-dot, .scatter-mark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}
.scatter-mark { width: 11px; height: 11px; }
/* A dot that says what it is when pointed at, tapped or tabbed to: more to
   aim at than the dot, ringed while it is said, and its tip -- the next
   element, placed in the chart at the dot's --x and --y -- beside it, on
   the side with the room. */
.scatter-dot.has-tip { pointer-events: auto; outline: none; cursor: default; }
.scatter-dot.has-tip::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.scatter-dot.has-tip:hover, .scatter-dot.has-tip:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); z-index: 3; }
.forecast-tip.scatter-tip { top: var(--y); left: var(--x); transform: translate(0.75rem, -50%); }
.forecast-tip.scatter-tip.left { left: auto; right: calc(100% - var(--x)); transform: translate(-0.75rem, -50%); }
.scatter-dot.has-tip:hover + .scatter-tip, .scatter-dot.has-tip:focus + .scatter-tip { display: block; }
.scatter-tip > strong { display: block; font-size: var(--text-xs); }
/* On a chart too narrow for a tip beside the dot, in the top corner away
   from it, where it stays on the chart. */
.scatter { container: scatter / inline-size; }
@container scatter (max-width: 24rem) {
  .forecast-tip.scatter-tip { top: 0; left: auto; right: 0; transform: none; }
  .forecast-tip.scatter-tip.left { left: 0; right: auto; }
}
/* A card whose tip is shown is over the cards beside it, which the tip may
   reach into. */
.card-grid > .dash-card:has(.has-tip:hover, .has-tip:focus) { z-index: 3; }
.forecast-line.scatter-curve { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-opacity: 0.6; }
.scatter-target { fill: none; stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 2 4; stroke-opacity: 0.7; }
/* What a mark is, beside it; the target's line said at its top. */
.scatter-mark.muted { background: var(--muted); }
.scatter-mark-label, .scatter-upright-label {
  position: absolute;
  padding: 0 0.2rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--fg);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.scatter-mark-label { transform: translate(0.5rem, -50%); }
.scatter-mark-label.left { transform: translate(calc(-100% - 0.5rem), -50%); }
.scatter-upright-label { top: 0; transform: translate(0.25rem, -0.1rem); }
.scatter-upright-label.left { transform: translate(calc(-100% - 0.25rem), -0.1rem); }
.scatter-target-label {
  position: absolute;
  transform: translate(-100%, -130%);
  color: var(--fg);
  font-size: var(--text-xs);
  white-space: nowrap;
}
/* A line that leaves at the top is said inside the chart, under its top
   edge beside the line, over whatever dots are there as a mark's label is. */
.scatter-target-label.top {
  padding: 0 0.2rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  transform: translate(0.25rem, 0.1rem);
}
.scatter-target-label.top.left { transform: translate(calc(-100% - 0.25rem), 0.1rem); }
/* A column over each day, showing what the day was when pointed at, tapped
   or tabbed to. */
.forecast-days { position: absolute; inset: 0; display: flex; }
.forecast-day { position: relative; flex: 1; outline: none; }
.forecast-day:hover, .forecast-day:focus { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.forecast-tip {
  display: none;
  position: absolute;
  top: 0;
  left: calc(100% + 0.25rem);
  z-index: 2;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--raised-edge);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-raised);
  white-space: nowrap;
  pointer-events: none;
}
.forecast-day.tip-left .forecast-tip { left: auto; right: calc(100% + 0.25rem); }
.forecast-day:hover .forecast-tip, .forecast-day:focus .forecast-tip { display: block; }
.forecast-tip table { border-collapse: collapse; margin: 0.15rem 0 0.4rem; }
.forecast-tip table:last-child { margin-bottom: 0; }
.forecast-tip th, .forecast-tip td { border: 0; padding: 0; background: none; }
.forecast-tip th { text-align: left; font-weight: 400; color: var(--muted); padding-right: 1rem; }
.forecast-tip td { text-align: right; }

/* BI Monitor's P&L: a table of figures read across a row and down a column,
   which scrolls sideways on a narrow screen with the row names kept in view. */
.pnl-period { margin: 0 0 0.25rem; }
.pnl-period p { margin: 0; }
.pnl-period-hint { margin-top: 0.15rem; }
/* A month in the P&L's history: open, still to be closed, or closed. */
.badge.month-open { background: var(--pending-bg); color: var(--pending-fg); }
/* Which campaigns are each funnel's: its labels, how many campaigns have
   them, and the way to choose them. */
.pnl-funnels { margin: 0 0 1rem; }
.pnl-funnels dl { margin: 0; }
.pnl-funnel-row { display: flex; align-items: center; gap: 0.75rem; min-height: 2rem; }
.pnl-funnel-row dt { min-width: 6.5rem; color: var(--muted); }
.pnl-funnel-row dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pnl-funnels p { margin: 0.25rem 0 0; }
.pnl-warning { color: var(--amber-fg); }
.pnl-scroll { overflow-x: auto; }
table.pnl { width: auto; min-width: 100%; font-variant-numeric: tabular-nums; }
table.pnl th, table.pnl td { padding: 0.3rem 0 0.3rem 1.5rem; border: 0; white-space: nowrap; }
table.pnl thead th { text-align: right; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
table.pnl td { text-align: right; }
table.pnl tbody th {
  position: sticky; left: 0; z-index: 1;
  padding-left: 0; text-align: left; font-weight: 400; color: var(--fg); background: var(--bg);
}
table.pnl tbody + tbody tr:first-child > * { padding-top: 1.1rem; }
table.pnl tr.pnl-heading > * { font-weight: 600; }
/* A figure somebody sets is a button that opens its dialog, underlined so
   it reads as one; one not set says so in the colour of a warning. */
.pnl-set {
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  border-bottom: 1px dashed var(--muted); cursor: pointer;
}
.pnl-set:hover { border-bottom-style: solid; }
.pnl-set.missing { color: var(--amber-fg); border-bottom-color: currentColor; }
/* A Marketing fixed cost that is not a part of Fixed Cost: red, a warning
   before it that says why on hover. */
table.pnl td.pnl-invalid { color: var(--bad-fg); }
.pnl-invalid-mark { display: inline-flex; vertical-align: -0.15em; margin-right: 0.3rem; cursor: help; }
.pnl-invalid-mark svg { width: 1em; height: 1em; }
.pnl-cell-form .pnl-point-field { display: none; }
.pnl-cell-form:has(#field-source-point:checked) .pnl-point-field { display: block; }
.pnl-cell-form:has(#field-source-point:checked) .pnl-value-field { display: none; }
/* The P&L's settings: a row for each switched row, what is entered and what
   the remainder is against side by side, so the choices line up. */
.dialog-pnl-settings { width: min(36rem, calc(100vw - 2rem)); }
.dialog-pnl-settings .form { max-width: none; }
table.pnl-switches { width: 100%; margin-bottom: 1.25rem; }
table.pnl-switches th, table.pnl-switches td { border: 0; padding: 0.25rem 0.75rem 0.25rem 0; font-weight: 400;
  color: var(--fg); text-align: left; vertical-align: middle; }
table.pnl-switches thead th { font-size: var(--text-sm); font-weight: 600; padding-bottom: 0.5rem; }
table.pnl-switches td:last-child { padding-right: 0; }
table.pnl-switches select { width: 100%; min-width: 7.5rem; }
/* On a narrow screen the row names wrap, so the figures beside them are in
   view and the table scrolls under a column of names rather than off it. */
@media (max-width: 40rem), (max-height: 30rem) {
  table.pnl tbody th { white-space: normal; min-width: 8rem; max-width: 9rem; }
  table.pnl th, table.pnl td { padding-left: 1rem; }
}

/* A name an integration made up -- one long word with underscores -- wraps
   rather than running under the line and the value. */
#data-points-list .row-body { min-width: 0; }
#data-points-list .row-name { overflow-wrap: anywhere; }

/* An API key just made, to be copied, and how it is used. */
.copy-field { display: flex; gap: 0.5rem; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-xs); }
.api-example {
  margin: 0 0 1rem; padding: 0.75rem; overflow-x: auto;
  border-radius: var(--radius); background: var(--subtle);
  font-size: var(--text-xs); line-height: 1.5; white-space: pre;
}

/* The API's documentation: one column of prose and examples to read down. */
.api-docs { max-width: 50rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
.api-docs h2 { margin-top: 2.5rem; }
.api-docs pre {
  padding: 0.75rem; overflow-x: auto; border-radius: var(--radius);
  background: var(--subtle); font-size: var(--text-sm); line-height: 1.5;
}
.api-endpoint { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.api-endpoint h3 { margin: 0 0 0.25rem; }
.api-endpoint table { width: auto; }
.api-endpoint th { font-weight: 400; padding-right: 1.5rem; }

/* The calculator: what it works out at, one field under another, and what it
   came to per campaign in a table that scrolls on its own, the buttons in
   view. */
.calculate-scroll { max-height: 50vh; overflow: auto; margin-bottom: 1rem; }
table.calculate td.number, table.calculate th:nth-child(n+3) { text-align: right; white-space: nowrap; }
/* How far what is recommended is from what it is now: up green, down red. */
.change.up { color: var(--ok-fg); }
.change.down { color: var(--bad-fg); }
table.calculate td:first-child { width: 1.5rem; }
/* On a narrow screen the cost is left out and the change said under what is
   recommended, so what is applied is in view without scrolling sideways. */
.calculate-change-under { display: none; }
@media (max-width: 40rem), (max-height: 30rem) {
  table.calculate .calculate-cost, table.calculate .calculate-change { display: none; }
  .calculate-change-under { display: block; }
}
/* A name made of underscores has nowhere to break but anywhere. */
table.calculate .calculate-name { overflow-wrap: anywhere; }
table.calculate .calculate-name label { font-weight: normal; }
/* What worked a recommendation out: an icon in the text, as large as it,
   named at once when pointed at, tapped or tabbed to, beside it, as a
   chart's dot is. */
.calculate-source svg { width: 1.25em; height: 1.25em; vertical-align: -0.3em; }
.calculate-source-icon { position: relative; border-radius: 2px; outline: none; }
.calculate-source-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.calculate-source-icon::after {
  content: attr(aria-label); display: none; position: absolute; top: 50%; left: calc(100% + 0.35rem); z-index: 2;
  transform: translateY(-50%); padding: 0.2rem 0.5rem; border: 1px solid var(--raised-edge); border-radius: var(--radius);
  background: var(--bg); color: var(--fg); box-shadow: var(--shadow-raised); font-size: var(--text-xs); white-space: nowrap;
  pointer-events: none;
}
.calculate-source-icon:hover::after, .calculate-source-icon:focus::after { display: block; }
/* A box with a button on its line: the calculator beside a budget or a bid
   target, right after the box -- which is no wider than a box of its kind
   is (a target's 20rem, a budget's 10rem), however wide the row. */
.field-beside { display: flex; align-items: flex-start; gap: 0.5rem; }
.field-beside > :first-child { flex: 0 1 20rem; min-width: 0; }
.calculate-button { display: inline-flex; align-items: center; gap: 0.35rem; flex: none; white-space: nowrap; }
/* The team's campaign steering: the P&L has its own targets, shown in place
   of one asked for while it is chosen. */
.steering-form:has(#field-steer-by option[value="pnl"]:checked) .steering-target { display: none; }
.steering-form:not(:has(#field-steer-by option[value="pnl"]:checked)) .steering-pnl { display: none; }
/* The steering as it is set, said in a few lines; the list of what it
   recommends under it, as the other lists are. */
/* The steering as it is set, a part each, written as the profile writes a
   person's details: the name over what it is, close under it, and a pencil
   beside kept from making its line taller; side by side as far as they fit. */
.steering-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem 2rem; margin-bottom: 1.5rem; }
.steering-part .setting-part { margin: 0; }
.steering-part .setting-value { margin-top: 0.15rem; overflow-wrap: anywhere; }
.steering-part .icon-button { flex: none; margin-block: -0.375rem; }
.steering-part .icon-button svg { width: 1.125rem; height: 1.125rem; }
.steering-part .muted.small { margin: 0.15rem 0 0; }
.steering-values { white-space: nowrap; text-align: right; }
.steering-up { color: var(--ok-fg); }
.steering-down { color: var(--bad-fg); }
.steering-held { color: var(--amber-fg); }
/* Where a change came from: the correction table is the exception, so it is
   the one set off. */
.badge.steering-table { background: var(--nav-active); color: var(--accent); }
.steering-measured { color: var(--muted); }
.steering-form:not(:has(input[name="auto"]:checked)) .steering-auto-most { display: none; }
.steering-form .steering-auto-most select { max-width: 8rem; }
.steering-pnl { margin: 0 0 1rem; }
/* The recommended changes and those with none, a tab each. */
#steering-lists { margin-top: 1.5rem; }
/* A row's end: the cost, what it is set to, and by how much, a column each.
   The list is a grid and each row a subgrid of it, as a table's rows are, so
   a column is as wide as its widest figure in the whole list and every row
   keeps to it. Each part is placed in its own column, so a list with no tick
   box or no change leaves that column empty rather than shifting the rest;
   the space between columns is the cells' own, so an empty one takes none. */
.steering-scroll .rows-list { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.steering-scroll .rows-list > li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; gap: 0; }
.steering-scroll .rows-list > li > .row-end, .steering-scroll .rows-list > li > .row-end > .steering-end { display: contents; }
.steering-scroll .select-cell { grid-column: 1; padding-right: 0.75rem; }
.steering-scroll .row-body { grid-column: 2; }
.steering-cost, .steering-end .steering-values, .steering-change {
  padding-left: 2rem;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.steering-cost { grid-column: 3; }
.steering-cost .row-meta { justify-content: flex-end; }
.steering-end .steering-values { grid-column: 4; }
.steering-change { grid-column: 5; }
/* The columns named once over the rows, as a table's head names them, rather
   than under each figure. Laid out as a row, with an unseen tick box where
   the rows have one, so each name stands over its column. Written as the
   tables' heads are (th): the tables' size, bold, muted. */
.rows-list li.steering-head { padding-block: 0.5rem; color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.rows-list li.steering-head:hover { background: none; }
.steering-head .select-cell { visibility: hidden; min-height: 0; }
/* A heading that orders the list is a link, as the campaigns table's are:
   the column followed in the text's own colour, with which way, and a grey
   one taking it under the pointer -- the accent is kept for what is chosen
   or opened. */
.steering-head a { display: inline-flex; align-items: baseline; gap: 0.3rem; color: inherit; text-decoration: none; }
.steering-head a:hover, .steering-head a.chosen { color: var(--fg); }
.steering-head .sort-arrow { font-size: var(--text-xs); }
.steering-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* On a phone too narrow for the columns the rows scroll sideways under
   their head, as the campaigns table does, rather than squeeze: wide
   enough for a name beside them. */
@media (max-width: 40rem), (max-height: 30rem) {
  /* Placed, so that what is hidden for a screen reader in a row is held
     by the scroll rather than widening the page. The list's box is the
     scroll's, which stays put, rather than the list's, whose far side
     would scroll out of sight. */
  .content .steering-scroll {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .content .steering-scroll .rows-list { border: 0; border-radius: 0; }
  #steering-lists .steering-scroll .rows-list { min-width: 36rem; }
  /* Those with no change have a column fewer to make room for. */
  #steering-without .steering-scroll .rows-list { min-width: 28rem; }
}
/* What Apply is about to change, in its dialog: a line for each kind, how
   many and which way, as a bulk edit's dialog says how many it changes. */
.steering-applying { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1.5rem; margin: 0 0 1rem; }
.steering-applying > div { display: contents; }
.steering-applying dt { color: var(--muted); }
.steering-applying dd { margin: 0; }
/* What becomes of the changes, under the box asking whether to sync them:
   said one way or the other as it is ticked. */
.steering-apply-form .steering-sync-later, .steering-apply-form .steering-sync-now { margin: -0.25rem 0 1rem; }
.steering-apply-form:has(input[name="sync"]:checked) .steering-sync-later,
.steering-apply-form:not(:has(input[name="sync"]:checked)) .steering-sync-now { display: none; }
/* The target is called what it is of, whichever is chosen. */
.steering-form:not(:has(#field-steer-by option[value="roas"]:checked)) .steering-roas,
.steering-form:not(:has(#field-steer-by option[value="cpa"]:checked)) .steering-cpa,
.steering-form:not(:has(#field-steer-by option[value="cpc"]:checked)) .steering-cpc,
.steering-form:not(:has(#field-steer-by option[value="cpm"]:checked)) .steering-cpm,
.steering-form:not(:has(#field-steer-by option[value="impressions"]:checked)) .steering-impressions,
.steering-form:not(:has(#field-steer-by option[value="clicks"]:checked)) .steering-clicks,
.steering-form:not(:has(#field-steer-by option[value="conversions"]:checked)) .steering-conversions { display: none; }
/* The long term is asked for only steering by a ROAS of the team's own. */
.steering-form:not(:has(#field-steer-by option[value="roas"]:checked)) .steering-long-term { display: none; }
.calculate-button svg { width: 1rem; height: 1rem; }
.calculate-form { max-width: none; }
.dialog-wide .calculate-inputs { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.dialog-wide .calculate-inputs .field { flex: 1 1 9rem; }
.calculate-form table.calculate { width: 100%; }
.calculate-one { margin: 0.25rem 0 1.25rem; }
.calculate-one .forecast-figures { gap: 0.5rem 2.5rem; }
.calculate-one > p { margin: 0.5rem 0 0; }
/* One campaign's: its chart beside the rest where there is room, and under a
   tab of its own where there is not -- the stylesheet showing whichever tab
   is ticked, as the Images row's tabs do. */
.calculate-chart .scatter { margin-top: 0.25rem; }
.calculate-chart .forecast-chart { grid-template-rows: 15rem 1.25rem; }
@media (max-width: 47.99rem) {
  .dialog-calculate:has(#calculate-tab-chart:checked) .calculate-main,
  .dialog-calculate:has(#calculate-tab-numbers:checked) .calculate-chart { display: none; }
}
@media (min-width: 48rem) {
  .dialog.dialog-calculate { width: min(56rem, calc(100vw - 2rem)); }
  .calculate-tabs { display: none; }
  .calculate-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 2.5rem; align-items: start; }
}

/* A full-screen dialog's bar, raised once something is scrolled under it,
   as Material's top bar is: drawn from how far what is under it is
   scrolled, over its first 1rem, so it turns as that goes and turns back at
   the top. Played by the bars that want it; a browser that cannot keeps
   them flat. */
@keyframes bar-raised { to { background: var(--raised-bar); } }

/* On a narrow screen a dialog is the screen, as Material's full-screen
   dialog is: its ✕, its title and what it is for -- Save -- along the top,
   and what it asks under them, scrolling. The pickers, Sync now and the
   correction table keep the foot they lay out for themselves. Not 100dvh tall, which Safari takes to be
   less than the screen once a field has brought up the keyboard, so that the
   page showed under the dialog. */
@media (max-width: 40rem), (max-height: 30rem) {
  .dialog, .dialog.dialog-wide, .dialog.dialog-filters, .dialog.dialog-split, .dialog.dialog-columns, .dialog.dialog-platforms,
  .dialog.dialog-picker, .dialog.dialog-picker.dialog-wide {
    /* From edge to edge, and with the keyboard up only the part of the
       screen above it, where Safari has slid what is seen to: app.js says
       where. Its bar then stays in sight, and there is nothing under the
       keyboard to slide to. */
    inset: var(--seen-top, 0px) 0 auto;
    width: auto;
    max-width: none;
    height: var(--seen-height, 100%);
    max-height: none;
    margin: 0;
    /* Clear of a phone's cut-out and corners on its side, by borders the
       dialog's own colour fills: its padding is each kind's own business. */
    border: solid transparent;
    border-width: 0 var(--safe-right) 0 var(--safe-left);
    border-radius: 0;
    box-shadow: none;
  }
  /* Its top as the app's bar and the period menu's are: the ✕ first, a 24px
     icon in a 44px square 16px from the edge, in the title's colour, and
     the title 72px from the edge at the size of the bar's words -- where a
     wider window has a heading over a card with the ✕ in its corner. The
     title comes first still for a screen reader; only its place moves. No
     line under it: scrolled, it is raised instead. */
  .dialog-header {
    justify-content: flex-start;
    gap: 0;
    margin: -1.25rem -1.25rem 1rem;
    padding: calc(var(--bar-pad) + env(safe-area-inset-top, 0px)) 1rem var(--bar-pad) var(--bar-edge);
  }
  @supports (animation-timeline: scroll()) {
    .dialog { timeline-scope: --dialog-scroll; }
    .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > :last-child:not(.dialog-header),
    .picker-form > .picker-list,
    .dialog-sync .sync-scroll,
    .correction-dialog > .correction-body { scroll-timeline: --dialog-scroll block; }
    .dialog-header {
      animation: bar-raised linear both;
      animation-timeline: --dialog-scroll;
      animation-range: 0 1rem;
    }
  }
  .dialog-header > form { order: -1; }
  .dialog-header h2 { min-width: 0; margin-left: var(--bar-title); font-size: var(--text-base); font-weight: 600; }
  .dialog-header .icon-button { width: var(--bar-button); height: var(--bar-button); margin: 0; }
  /* The bar stays where it is and only what is under it scrolls -- and
     bounces, where a phone pulls it past its end -- as a picker's list does
     under its bar, and the period menu's under its top. The dialog itself does
     not scroll but what it holds last, its form: held still by being outside
     what scrolls, not by position: fixed inside it, which Safari scrolls along
     regardless. Not the chat, which lays itself out so already: this padding
     on top of its own left it a wide margin all round, and its divider short
     of the screen's edges. */
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) { overflow: hidden; padding: 0; }
  .dialog[open]:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) { display: flex; flex-direction: column; }
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > .dialog-header { position: static; flex: none; margin: 0; }
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > :not(.dialog-header) { flex: none; margin-inline: 0; padding-inline: 1.25rem; }
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > :nth-child(1 of :not(.dialog-header)) { padding-top: 1rem; }
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > :last-child:not(.dialog-header) {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 1.25rem;
  }
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > form:last-child { display: flex; flex-direction: column; max-width: none; }
  /* Each as tall as it is, the form scrolling over them, rather than all
     squeezed into the screen. */
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > form:last-child > * { flex: none; }
  /* What the dialog is for -- Save, Add, Apply -- at the right of its top
     bar, in words, as Material's full-screen dialog has it: where the keyboard
     a field brings up never covers it. Drawn there from its place among the
     buttons, placed from the dialog's corner -- which does not scroll -- so
     the same button sends the same form. Cancel is the ✕ already, and goes.
     Not a dialog that only tells something, whose form just closes it: its
     Ok stays at its foot. */
  .dialog:not(.dialog-sync) > form:not([method="dialog"]) > .buttons > button:first-child:not(.secondary) {
    position: absolute;
    top: calc(var(--bar-pad) + env(safe-area-inset-top, 0px));
    right: 0.5rem;
    z-index: 2;
    min-height: var(--bar-button);
    /* Wide enough to tap however short its word: Ok, Add. */
    min-width: 3.75rem;
    padding: 0 0.75rem;
    border-color: transparent;
    background: transparent;
    color: var(--accent);
    font-weight: 600;
  }
  /* One that cannot be undone -- Delete, Leave team -- keeps its red, as
     words: the accent's colour would say it is only another Save. */
  .dialog:not(.dialog-sync) > form:not([method="dialog"]) > .buttons > button.danger:first-child { color: var(--bad-fg); }
  .dialog:not(.dialog-sync):has(> form:not([method="dialog"]) > .buttons > button:first-child:not(.secondary)) .dialog-header { padding-right: 6rem; }
  .dialog:not(.dialog-sync) > form:not([method="dialog"]) > .buttons > button.secondary[formmethod="dialog"] { display: none; }
  /* What is left of the buttons -- Reset, Clear all -- follows what the
     dialog holds, at its end, as lesser actions to find when wanted rather
     than a bar always in view. A picker keeps them at its foot, under the
     list that scrolls. */
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > form > .buttons {
    /* In its place in the form, whatever a dialog does with it on a wider
       window -- Columns holds it at the foot -- so that what it holds is
       placed from the dialog's corner and not from the row's. */
    position: static;
    margin: 0.5rem 0 env(safe-area-inset-bottom, 0px);
    padding: 0;
    background: none;
    box-shadow: none;
  }
  .dialog:not(.dialog-picker):not(.dialog-sync):not(.correction-dialog):not(.dialog-assistant) > form > .buttons .buttons-end { margin-left: 0; }
  /* And it starts right under the bar, where the bar's own margin left a
     strip that did not scroll, without a line of its own there: the bar,
     raised once the list scrolls, says where it ends. */
  .dialog-picker .dialog-header { margin-bottom: 0; }
  .picker-form > .picker-list { border-top: 0; }
  /* A picker with nothing left at its foot ends with its list, without the
     line that parted the list from the buttons. */
  .dialog-picker > form.picker-form:not([method="dialog"]):not(:has(> .buttons > :not(:first-child, [formmethod="dialog"]))) > .picker-list {
    margin-bottom: 0;
    border-bottom: 0;
  }
}

/* The assistant: a round button in the bottom right corner of every page, over
   what scrolls beneath it, and the chat it opens -- what has been said, the
   changes to confirm, and the box for the next question at its foot. */
/* The button sits over the corner of the page, so a page that has it ends
   lower: its last rows can be scrolled up clear of the button and used. */
body:has(.assistant-button) { --page-foot: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
.assistant-button {
  position: fixed;
  right: calc(1.25rem + var(--safe-right));
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--accent-fill);
  color: var(--on-accent);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.2);
  cursor: pointer;
}
.assistant-button svg { width: 2.75rem; height: 2.75rem; }
/* The robot's faces, one at a time: smiling, but for the mood app.js puts
   it in (data-face) -- a look now and then, sleepy and asleep when nothing
   has happened for a while -- glad to be pointed at, and thinking while the
   assistant answers, whatever else. */
.robot-face { display: none; }
.robot-smiling,
[data-face="happy"] .robot-happy,
[data-face="plain"] .robot-plain,
[data-face="blink"] .robot-blink,
[data-face="left"] .robot-left,
[data-face="right"] .robot-right,
[data-face="wink"] .robot-wink,
[data-face="surprised"] .robot-surprised,
[data-face="love"] .robot-love,
[data-face="laughing"] .robot-laughing,
[data-face="thinking"] .robot-thinking,
[data-face="sleepy"] .robot-sleepy,
[data-face="asleep"] .robot-asleep { display: inline; }
[data-face] .robot-smiling { display: none; }
.assistant-button:hover .robot-face { display: none; }
.assistant-button:hover .robot-happy { display: inline; }
body:has(.assistant-form.htmx-request) .robot-face { display: none; }
body:has(.assistant-form.htmx-request) .robot-thinking { display: inline; }
/* A row's shortcut to the chat, asking what it would offer there. */
.ask-assistant-button { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.ask-assistant-button svg { width: 1rem; height: 1rem; }
/* The chat: a panel over the corner the button is in, the page beside it in
   view -- nothing darkened behind it -- with its conversation scrolling between
   the heading and the box for the next question, stacked from the foot so the
   latest is in view. */
.dialog-assistant {
  position: fixed;
  /* Not modal, so not in the top layer: over the page, under the toasts. */
  z-index: 60;
  inset: auto calc(1.25rem + var(--safe-right)) calc(5.25rem + env(safe-area-inset-bottom, 0px)) auto;
  margin: 0;
  width: min(25rem, calc(100vw - 2rem));
  height: min(40rem, calc(100vh - 7rem));
  padding: 0;
  overflow: hidden;
}
.dialog-assistant[open] { display: flex; flex-direction: column; }
/* Open, the chat is where the button was: pressed again, it would start the
   conversation over. */
body:has(.dialog-assistant[open]) .assistant-button { display: none; }
.assistant-header {
  position: static;
  flex: none;
  justify-content: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.assistant-header h2 { margin: 0; font-size: var(--text-base); }
.assistant-header p { margin: 0; }
/* Its menu beside the ✕ on a phone too, where a dialog's form -- the ✕ of
   another dialog -- is moved first: there it pushed the header over and its
   menu opened off the screen. */
.assistant-header > .assistant-menu { order: 0; margin-left: auto; }
.assistant-mark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent);
}
.assistant-mark svg { width: 1.7rem; height: 1.7rem; }
.assistant-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }
/* At least a line or two of the conversation where the chat is short -- the
   keyboard up -- the suggestions giving up their room first: the answer
   being replied to stays in view. */
.assistant-scroll {
  display: flex;
  flex: 1;
  flex-direction: column-reverse;
  min-height: 6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
}
.assistant-log { display: flex; flex-direction: column; gap: 0.6rem; }
.assistant-welcome p { margin: 0; color: var(--muted); line-height: 1.5; }
/* A bubble each, the assistant's on the left and the person's on the right in
   the accent, as a chat has them. */
.assistant-turn {
  align-self: flex-start;
  max-width: 85%;
  margin: 0;
  padding: 0.55rem 0.8rem;
  border-radius: 1rem 1rem 1rem 0.3rem;
  background: var(--subtle);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.assistant-turn.mine {
  align-self: flex-end;
  border-radius: 1rem 1rem 0.3rem 1rem;
  background: var(--accent-fill);
  color: var(--on-accent);
}
/* Three dots at the foot while a question is being answered: htmx marks the
   form for as long as its request is out. */
.assistant-thinking { display: none; gap: 0.3rem; align-items: center; padding: 0.75rem 0.9rem; }
.assistant-body:has(.assistant-form.htmx-request) .assistant-thinking { display: flex; }
/* The answer written as it comes: the dots go once some of it is there. */
.assistant-body:has(#assistant-writing:not(:empty)) .assistant-thinking { display: none; }
#assistant-writing:empty { display: none; }
.assistant-thinking span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--muted);
  animation: assistant-dot 1s ease-in-out infinite;
}
.assistant-thinking span:nth-child(2) { animation-delay: 0.15s; }
.assistant-thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistant-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-0.2rem); }
}
@media (prefers-reduced-motion: reduce) { .assistant-thinking span { animation: none; } }
.assistant-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.assistant-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  /* Said, not inherited: one that opens a dialog, the calculator, is a
     button, and a button's own colour is white for an accent fill. */
  color: var(--accent);
  text-align: left;
  text-decoration: none;
}
.assistant-link:hover { border-color: var(--accent); }
.assistant-link svg { width: 0.9rem; height: 0.9rem; }
/* A campaign, feed or keyword list the assistant names, in what it says: a
   link to its page, drawn as a button so a list of them reads as one. */
.assistant-ref {
  display: inline-block;
  margin: 0.1rem 0;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.assistant-ref:hover { border-color: var(--accent); }
/* A change to confirm: what, from what to what, and its button. */
.assistant-proposals { display: flex; flex-direction: column; gap: 0.5rem; }
.assistant-proposal {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2);
  background: var(--surface);
}
.assistant-proposal p { margin: 0; }
/* Texts to choose among: a line each with its own button, added ones ticked. */
.assistant-proposal-choices { flex-direction: column; align-items: stretch; gap: 0.5rem; }
.assistant-choices { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.assistant-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.assistant-choice > span, .assistant-choice label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.assistant-choice label { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; }
.assistant-choice input[type="checkbox"] { flex: none; margin-top: 0.2rem; }
.assistant-choices-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.assistant-choice > svg { flex: none; width: 1rem; height: 1rem; }
.assistant-choice.done { border-color: var(--ok-fg); background: var(--ok-bg); color: var(--ok-fg); }
.assistant-choice.failed { border-color: var(--bad-fg); background: var(--bad-bg); color: var(--bad-fg); flex-wrap: wrap; }
.assistant-proposal form { flex: none; margin: 0; }
.assistant-proposal > svg { flex: none; width: 1.25rem; height: 1.25rem; }
.assistant-proposal-what { flex: 1; min-width: 0; }
.assistant-proposal-label { font-size: var(--text-sm); overflow-wrap: anywhere; }
.assistant-proposal .assistant-proposal-change { margin-top: 0.15rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.assistant-proposal-change del { color: var(--muted); }
.assistant-proposal-change ins { font-weight: 600; text-decoration: none; }
/* The pictures a proposal adds, each in its own shape, side by side. */
.assistant-proposal-images { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.assistant-proposal-images img { display: block; height: 5.5rem; width: auto; border-radius: 0.375rem; border: 1px solid var(--border); }
.assistant-proposal.done { border-color: var(--ok-fg); background: var(--ok-bg); color: var(--ok-fg); }
/* A proposal read back too late to confirm: what it was, faded. */
.assistant-proposal.expired .assistant-proposal-change { opacity: 0.6; }
.assistant-proposal.failed { border-color: var(--bad-fg); background: var(--bad-bg); color: var(--bad-fg); }
.assistant-confirm-all { display: flex; justify-content: flex-end; }
.assistant-error { flex: none; margin: 0 1rem 0.5rem; }
/* What may be asked to begin with, the campaign it is about, and the box.
   Where the chat is short -- a phone's keyboard up leaves it 390px of 659 --
   the suggestions give up their room and scroll, so the box stays in view
   rather than below the chat's foot, behind the keyboard. */
.assistant-form {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.assistant-form :is(.assistant-about, .assistant-ask) { flex: none; }
.assistant-suggestions-box { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* Their heading stays as they scroll under it, to fold them away by: the
   width of the box and its space below its own, so they pass under it rather
   than beside it. */
.assistant-suggestions-box[open] .assistant-suggestions-heading { position: sticky; top: 0; z-index: 1; width: auto; padding-bottom: 0.4rem; background: var(--bg); }
/* The ring round the one chosen with Tab inside its edge: outside it, the box
   they scroll in would cut it off. */
.assistant-suggestion:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* What follows the row open beside it is one element to be fetched again, laid
   out as the form's own. */
.assistant-context { display: contents; }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
/* Their heading folds them away and out again: a line of its own, folded. */
.assistant-suggestions-heading {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  width: fit-content;
  color: var(--muted);
  font-size: var(--text-xs);
  cursor: pointer;
  list-style: none;
}
.assistant-suggestions-heading::-webkit-details-marker { display: none; }
.assistant-suggestions-heading:hover { color: var(--fg); }
.assistant-suggestions-heading svg { width: 0.9rem; height: 0.9rem; transition: rotate 150ms ease-out; }
.assistant-suggestions-box:not([open]) .assistant-suggestions-heading svg { rotate: -90deg; }
.assistant-suggestion {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: var(--text-sm);
  font-weight: normal;
  text-align: left;
}
.assistant-suggestion:hover { border-color: var(--accent); color: var(--accent); }
.assistant-about { display: flex; align-items: center; gap: 0.35rem; margin: 0; color: var(--muted); font-size: var(--text-xs); }
.assistant-about svg { flex: none; width: 0.9rem; height: 0.9rem; }
.assistant-about span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* In the conversation, where the person asked beside another campaign or row. */
.assistant-marker { display: flex; align-self: flex-end; align-items: center; gap: 0.35rem; margin: 0.4rem 0 0; color: var(--muted); font-size: var(--text-xs); }
.assistant-marker svg { flex: none; width: 0.8rem; height: 0.8rem; }
.assistant-ask {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.25rem 0.25rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.assistant-ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
/* font: inherit, the body's 16px: left to the browser it is about 13px, and
   iOS zooms the page in on a field under 16px as it is tapped. */
.assistant-ask input {
  flex: 1;
  font: inherit;
  min-width: 0;
  padding: 0.45rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.assistant-send {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent);
}
.assistant-send:hover { background: color-mix(in srgb, var(--accent-fill) 85%, black); color: var(--on-accent); }
.assistant-send svg { width: 1.05rem; height: 1.05rem; }
.assistant-body:has(.assistant-form.htmx-request) .assistant-ask { opacity: 0.6; pointer-events: none; }
/* While a question is answered there is nothing more to choose: the answer
   comes with them folded away. */
.assistant-body:has(.assistant-form.htmx-request) .assistant-suggestions-box { display: none; }
/* On a wide screen the chat has a column of its own at the right, the
   window's full height, and the page moves over for it rather than being
   covered -- the toasts with it -- unless the person would have it float
   over the page (.assistant-floating), which its menu offers only there.
   Open on the page before, its column is there from the first paint, held by
   the placeholder the panel has until the chat arrives, so the page does not
   jump sideways as it does. */
.assistant-placeholder,
.assistant-layout { display: none; }
@media (min-width: 80rem) {
  :root { --assistant-width: 26rem; --bar-height: 3.75rem; }
  .assistant-layout { display: flex; }
  body:has(#assistant-panel > :not(.assistant-floating)) { padding-right: var(--assistant-width); }
  body:has(#assistant-panel > :not(.assistant-floating)) .assistant-button { display: none; }
  /* The chat is beside the page, and no button is over it. */
  body:has(#assistant-panel > :not(.assistant-floating)) { --page-foot: initial; }
  body:has(#assistant-panel > :not(.assistant-floating)) .toasts { left: calc(50% - var(--assistant-width) / 2); }
  .dialog-assistant:not(.assistant-floating),
  .assistant-placeholder {
    position: fixed;
    inset: 0 0 0 auto;
    width: var(--assistant-width);
    height: 100vh;
    max-height: none;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
  }
  .assistant-placeholder { display: block; z-index: 60; }
  /* Its heading and the bar at the top of a page that takes the window over
     are side by side, so they are one height, a line across the window. */
  body:has(#assistant-panel > :not(.assistant-floating)) .takeover-bar { min-height: var(--bar-height); padding-block: 0; }
  .dialog-assistant:not(.assistant-floating) .assistant-header {
    min-height: var(--bar-height);
    padding-block: 0;
    align-items: center;
  }
  /* Docked, it is simply there, not rising into place. */
  .dialog-assistant:not(.assistant-floating):not([open]),
  .dialog-assistant:not(.assistant-floating)[open] { translate: none; }
  @starting-style { .dialog-assistant:not(.assistant-floating)[open] { translate: none; } }
}
/* The wider the screen, the wider the docked chat: room for its answers'
   tables and cards, where the page has room to spare beside it. */
@media (min-width: 90rem) { :root { --assistant-width: 30rem; } }
@media (min-width: 120rem) { :root { --assistant-width: 34rem; } }
/* On a phone, the whole screen, as a dialog is there: held to its four
   edges, and the box to ask in clear of the bar at the foot of the screen. */
@media (max-width: 40rem), (max-height: 30rem) {
  .dialog-assistant { inset: var(--seen-top, 0px) 0 auto; width: auto; height: var(--seen-height, 100%); max-height: none; border: solid transparent; border-width: 0 var(--safe-right) 0 var(--safe-left); border-radius: 0; }
  .assistant-form { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  /* Scrolls only where even the box no longer fits: a phone held sideways
     with its keyboard up can leave the chat less than its heading and box. */
  .assistant-body { overflow-y: auto; overscroll-behavior: contain; }
}

/* Conversion figures over days whose conversions are still arriving: see
   campaigns.Campaign.MaturingDays. A triangle in the top corner, as a
   spreadsheet marks a cell with a note, rather than a coloured cell: the
   figure stays as easy to read as its neighbours. Drawn over the cell rather
   in its background, which a hovered row paints over. The whole cell is the
   button that opens the note saying why. */
td.maturing {
  position: relative;
  padding: 0;
}
td.maturing::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 10px solid var(--maturing-mark);
  border-left: 10px solid transparent;
  pointer-events: none;
}
.maturing-button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}
.maturing-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* A Google campaign's conversion goal: the account's, or the actions ticked,
   which show only where it has actions of its own -- each its name and, under
   it, what it is. */
.goal-actions { display: none; }
.goal-choice:has(input[name="goal"][value="actions"]:checked) .goal-actions { display: block; }
.goal-action { display: grid; gap: 0.1rem; }
/* A product's picture or video in the product dialog: its address, with an
   Upload beside it that fills the address in. The file box itself is out of
   sight; the label is what is pressed, and shows the focus the box has. An
   upload that takes a while spins, as a pressed button does -- after half a
   second, so a quick one never flashes. */
.item-file { display: flex; align-items: stretch; gap: 0.5rem; }
.item-file input[type="url"] { flex: 1; min-width: 0; }
/* Add, or Edit, beside the address. */
.item-file-add { flex: none; }
/* Edit of a row or a box that holds one file: its pencil before its word, on
   the word's line and at the word's size. */
.media-edit { display: inline-flex; align-items: center; gap: 0.4rem; }
.media-edit svg { width: 1rem; height: 1rem; }
.item-file-thumb { width: auto; height: auto; max-width: 10rem; max-height: 6rem; }
/* The picture with its bin in the corner (.image-remove), as wide as it. */
.item-file-preview { position: relative; display: inline-block; margin-top: 0.5rem; line-height: 0; }

/* What a text taking from the feed comes to, under the field it is typed in: one, and
   how many more -- opened, the first few, one a line. */
.line-fill { margin-top: 0.35rem; }
.line-fill ul { list-style: none; margin: 0; padding: 0; }
.line-fill:not(:has(.line-fill-toggle input:checked)) ul { display: inline; }
.line-fill:not(:has(.line-fill-toggle input:checked)) li { display: inline; }
.line-fill:not(:has(.line-fill-toggle input:checked)) li:not(:first-child) { display: none; }
.line-fill-long { color: #d33; }
.line-fill .line-fill-toggle { display: inline; font-size: inherit; font-weight: normal; cursor: pointer; text-decoration: underline; margin: 0 0 0 0.25rem; }
.line-fill:has(.line-fill-toggle input:checked) .line-fill-toggle { display: block; margin-left: 0; }
.line-fill li { margin: 0; padding: 0; }
.line-fill-toggle:has(input:checked) .when-shut,
.line-fill-toggle:not(:has(input:checked)) .when-open { display: none; }

/* Under a row's line, on a line of its own after the line and its bin. */
.text-list li:has(> .line-fills) { flex-wrap: wrap; }
/* Drawn up into the line's padding, as close under it as its example was. */
.text-list li > .line-fills { flex-basis: 100%; order: 2; margin-top: -0.4rem; padding: 0 0.4rem 0.5rem; }
.text-list li > .line-fills .line-fill { margin-top: 0; }
.text-list li > .line-fills:empty { display: none; }

/* The steering's correction table: a bucket at a time, chosen from a row of
   buttons, and its matrix of factors -- what raises what is sent green, what
   lowers it red, a cell the team changed edged in the blue. */
/* The button that opens it, by the steering's Settings: centred as an icon
   on its own is, which the heading's buttons of words are not; said in words
   only in the phone's ⋮ menu, where the icon is not shown. */
.page-actions .correction-table-button { display: inline-grid; place-items: center; }
.page-actions .correction-table-button svg { width: 1.25rem; height: 1.25rem; }
.correction-table-label { display: none; }
.page-more .menu-panel > .correction-table-button { display: flex; align-items: center; gap: 0.5rem; height: auto; }
.page-more .menu-panel .correction-table-label { display: inline; }
/* Its icon kept in the menu, after the words, as the one other lines go
   without: it is what the button is known by on a wide screen. */
.page-more .menu-panel > .correction-table-button svg { display: block; order: 2; width: 1.25rem; height: 1.25rem; }
/* The dialog's forms as wide as it is: a form elsewhere is kept to a
   column of fields, the matrix and the calculator are not one. */
.correction-dialog .form { max-width: none; }
/* The buckets, radio buttons drawn as buttons: the one chosen shows its
   matrix, the others kept in the form and sent with it. */
.correction-buckets-field { border: 0; padding: 0; margin: 0 0 0.75rem; min-width: 0; }
.correction-buckets { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.correction-bucket { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 3.5rem; padding: 0.35rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-variant-numeric: tabular-nums; }
.correction-bucket input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.correction-bucket:has(input:checked) { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
.correction-bucket:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.correction-matrix-scroll { display: none; }
.correction-table:has(#correction-bucket-lt-25:checked) [data-bucket="lt-25"],
.correction-table:has(#correction-bucket-lt-10:checked) [data-bucket="lt-10"],
.correction-table:has(#correction-bucket-lt-5:checked) [data-bucket="lt-5"],
.correction-table:has(#correction-bucket-lt-1:checked) [data-bucket="lt-1"],
.correction-table:has(#correction-bucket-on:checked) [data-bucket="on"],
.correction-table:has(#correction-bucket-gt-1:checked) [data-bucket="gt-1"],
.correction-table:has(#correction-bucket-gt-5:checked) [data-bucket="gt-5"],
.correction-table:has(#correction-bucket-gt-10:checked) [data-bucket="gt-10"],
.correction-table:has(#correction-bucket-gt-25:checked) [data-bucket="gt-25"] { display: block; }
.correction-unsaved { color: var(--pending-fg); background: var(--pending-bg); padding: 0.4rem 0.6rem; border-radius: var(--radius); }
.correction-try { margin-top: 1rem; }
.correction-try > summary { cursor: pointer; font-weight: 600; }
.correction-try[open] > summary { margin-bottom: 0.5rem; }
.correction-matrix { border-collapse: collapse; width: 100%; }
.correction-matrix th, .correction-matrix td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
.correction-matrix thead th { text-align: center; font-weight: 500; color: var(--muted); }
.correction-matrix thead th:first-child, .correction-matrix tbody th { text-align: left; white-space: nowrap; font-weight: 500; }
.correction-matrix td { text-align: center; }
.correction-cell { width: 5.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.cell-up { color: var(--ok-fg); }
.cell-down { color: var(--bad-fg); }
.correction-cell.cell-changed { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.correction-legend-changed { color: var(--accent); }
.correction-legend { margin: 0.5rem 0 0; }
/* Laid out as Sync now's: its heading and its buttons stay where they are,
   and what is between them -- the table, and the bid adjustment simulator
   once open -- scrolls, so that Save is never under the foot of a phone's screen. As
   tall as it holds, up to the dialog's most. Only while open: a dialog shut
   is display: none, which this must not undo. */
.correction-dialog { overflow: hidden; }
.correction-dialog[open] { display: flex; flex-direction: column; }
.correction-dialog > .dialog-header { position: static; flex: none; }
.correction-dialog > .correction-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  /* Room for a bucket's focus ring, which what scrolls would clip. */
  margin-inline: -0.25rem; padding-inline: 0.25rem;
}
/* Reset at the start, Cancel and Save at the end, under a line once what is
   above them scrolls. */
.correction-buttons { align-items: center; flex-wrap: wrap; }
.correction-dialog > .correction-buttons {
  flex: none; margin: 0; padding-top: 1rem; border-top: 1px solid var(--border);
}
.correction-buttons-gap { flex: 1; }

/* The eye of what can be shown in the ad preview (views.previewShow). */
.preview-eye { display: inline-grid; flex: none; place-items: center; line-height: 0; }
.preview-eye svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
/* A line shown in the ad preview by its eye: the line itself presses
   nothing, its words in the accent while it is shown. */
.text-list-still { cursor: default; }
.text-list-still:hover { background: none; }
.text-list li:has(.preview-eye-button :checked) > .text-list-still { color: var(--accent); }
/* The eye, an icon button of a label round its box: lit as a picked
   filter is while the line is shown. */
.field label.preview-eye-button { display: inline-grid; flex: none; margin: 0; font-size: inherit; font-weight: inherit; }
.preview-eye-button:has(:checked) { background: var(--nav-active); color: var(--accent); }
@media (hover: hover) { .preview-eye-button:has(:checked):hover { background: color-mix(in srgb, var(--accent) calc(var(--active-share) + 6%), var(--bg)); } }
.preview-eye-button:has(:checked):active { background: color-mix(in srgb, var(--accent) calc(var(--active-share) + 12%), var(--bg)); }
.preview-eye-button:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
/* On a picture, the eye in its corner beside the bin, drawn as the bin and
   the scissors are and as large; the whole picture is what is pressed
   (.preview-choice). */
.image-media > .preview-eye {
  position: absolute;
  top: 0.35rem;
  right: 2.25rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgb(0 0 0 / 60%);
  color: #ffffff;
  pointer-events: none;
}
.image-media > .preview-eye svg { width: 1rem; height: 1rem; }
/* The whole tile, whatever size a box would be otherwise. */
.image-media > input.preview-choice { width: 100%; height: 100%; }
.image-media:has(> .preview-show:checked) > .preview-eye { background: var(--nav-active); color: var(--accent); }
/* A film pressed to be shown is framed as a picture is. */
/* The picture or film shown in the ad, ringed wider than a picture merely
   ticked: drawn over it, inside its edge, so that nothing moves as it is. */
.image-media:has(> .preview-show:checked)::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--accent);
  border-radius: inherit;
  pointer-events: none;
}

/* The campaign planner (views/planner.go): a timeline of each kind of
   campaign, the names and budgets in a column that stays as the days scroll
   by under the dates, which stay too, with the total at the foot. The bars
   are placed by the server, in percent of the period; a day is drawn
   --day wide, so a long period scrolls rather than squeezing its bars. */
.planner { --names: 18rem; }
/* On a phone the names' column is narrower, and a budget goes under its
   name rather than beside it, which would leave the name a few letters. */
@media (max-width: 40rem) {
  .planner { --names: 10rem; }
  .planner-row:not(.planner-network) > .planner-name { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; }
  .planner-row:not(.planner-network) > .planner-name > .planner-open { flex: none; }
  .planner-row:not(.planner-network) > .planner-name > .planner-budget { margin-left: 0; color: var(--muted); font-size: var(--text-xs); }
  .planner-total > .planner-name > .planner-budget { color: var(--fg); }
}
.planner .filter-bar { margin-bottom: 1rem; }
.planner-count { margin-left: 0.35rem; color: var(--muted); font-size: var(--text-xs); }
.planner-kind { margin-top: 1.5rem; }
.planner-kind:first-of-type { margin-top: 0; }
.planner-heading { margin: 0 0 0.5rem; font-size: var(--text-xl); }
.planner-scroll {
  overflow: auto;
  overscroll-behavior-x: contain;
  max-height: 75vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.planner-grid { position: relative; min-width: calc(var(--names) + var(--days) * var(--day)); }
.planner-row { display: grid; grid-template-columns: var(--names) 1fr; min-height: 2.5rem; border-top: 1px solid var(--border); }
.planner-head { position: sticky; top: 0; z-index: 4; min-height: 3.5rem; border-top: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
.planner-head + .planner-row { border-top: 0; }
.planner-name {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0 0.75rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-sm);
}
.planner-head .planner-name { color: var(--muted); font-weight: 600; }
.planner-track { position: relative; overflow: clip; }
.planner-network .planner-name, .planner-network .planner-track { background: var(--setting); }
.planner-network h3 { margin: 0; font-size: var(--text-sm); }
.planner-network svg { flex: none; width: 1rem; height: 1rem; }
.planner-open {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.planner-open:hover { text-decoration: underline; }
.planner-budget { flex: none; margin-left: auto; font-variant-numeric: tabular-nums; }
.planner-adgroup { min-height: 2.75rem; }
.planner-names { display: flex; flex-direction: column; min-width: 0; }
.planner-of { color: var(--muted); font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planner-total { position: sticky; bottom: 0; z-index: 4; background: var(--surface); font-weight: 600; }
/* The lines at each day, week or month, and today's, once over every row:
   under the names and the bars, over the networks' bands. */
.planner-lines { position: absolute; inset: 0 0 0 var(--names); z-index: 1; pointer-events: none; }
.planner-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.planner-now { border-left: 2px solid var(--bad-fg); }
.planner-month, .planner-tick, .planner-today { position: absolute; padding-left: 0.375rem; font-size: var(--text-xs); white-space: nowrap; }
.planner-month { top: 0.4rem; font-weight: 600; }
.planner-tick { bottom: 0.4rem; color: var(--muted); }
.planner-today {
  bottom: 0.3rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bad-fg);
  color: var(--surface);
  font-weight: 600;
}
.planner-bar {
  position: absolute;
  z-index: 1;
  top: 0.4rem;
  bottom: 0.4rem;
  min-width: 0.5rem;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 3px 0 var(--accent);
  color: var(--fg);
  font: inherit;
  text-align: left;
  overflow: clip;
  cursor: pointer;
}
.planner-bar:hover { background: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
/* The times stay in sight as a bar that started off to the left is
   scrolled along: they stick beside the names. */
.planner-bar > span {
  display: block;
  position: sticky;
  left: var(--names);
  width: fit-content;
  max-width: 100%;
  padding: 0 0.5rem 0 0.7rem;
  font-size: var(--text-xs);
  line-height: 1.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.planner-bar.before { border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; box-shadow: none; }
.planner-bar.after { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.planner-bar.open-ended { mask-image: linear-gradient(to right, #000 80%, transparent); }

/* A campaign's dialog: what it is beside its ad, the two as tall as each
   other; one above the other on a phone. */
.planner-campaign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 48rem) { .planner-campaign { grid-template-columns: minmax(0, 1fr); } }
.planner-box { display: flex; min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.planner-ad { align-items: center; justify-content: center; }
.planner-ad > * { flex: 1; min-width: 0; }
.planner-details { flex: 1; display: grid; grid-template-columns: auto 1fr; grid-auto-rows: minmax(2.25rem, auto); margin: 0; font-size: var(--text-sm); }
.planner-details > * { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding-block: 0.35rem; border-bottom: 1px solid var(--border); }
.planner-details > :nth-last-child(-n + 2) { border-bottom: 0; }
.planner-details dt { padding-right: 1.5rem; color: var(--muted); }
.planner-details dd { justify-content: flex-end; text-align: right; flex-wrap: wrap; }
.planner-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--campaign-running); }
.planner-dot.paused { background: var(--campaign-paused); }
.planner-dot.removed { background: var(--campaign-removed); }
.planner-dot.ended { background: var(--muted); }
.planner-dot.upcoming { background: var(--accent); }
/* The flight's end goes with "always on" ticked. */
.planner-schedule:has(input[name="always"]:checked) .planner-ends { display: none; }
