/* =============================================================================
   ads.css — ONLY what TKATI Ads adds.

   The shell is office.css: rail, grid, view, card, table, chip, meter. This
   file holds the three things that screen does not already have — the
   attention queue, the client health matrix and the pacing bar — and nothing
   else. Anything here that could have been a .ofc- class is a second
   definition of something that already exists, and two definitions of one
   thing are how two screens stop looking like one product.
   ============================================================================= */

.ads-head__tools { display:flex; align-items:flex-end; gap:16px; }
.ads-window { display:flex; flex-direction:column; gap:2px; }
.ads-window select {
  font: inherit; padding:4px 8px; border-radius:6px;
  border:1px solid var(--o-line-3); background:var(--paper-2); color:var(--ink);
}

/* ---- the attention queue -------------------------------------------------
   IT IS A LIST, NOT A GRID OF CARDS. Six alerts as six boxes is six things of
   equal weight, and the whole job of this component is to say which one to
   look at first. A list has an order and reads top to bottom, which is what
   ranking by consequence is for. */
.ads-q { display:flex; flex-direction:column; gap:1px; background:var(--bone-line); }
.ads-q__i {
  display:grid; grid-template-columns:4px 1fr auto; gap:0 14px;
  padding:12px 16px; background:var(--paper); align-items:start;
}
.ads-q__i::before { content:""; grid-row:1 / -1; align-self:stretch; border-radius:2px; }
.ads-q__i--critical::before { background:var(--o-bad-mark); }
.ads-q__i--warning::before  { background:var(--o-warn); }
.ads-q__i--info::before     { background:var(--bone-line); }

.ads-q__h { font-weight:600; }
.ads-q__client { color:var(--stone); font-weight:400; }
.ads-q__d { color:var(--stone); font-size:.9em; margin-top:2px; }
/* THE NUMBER THAT CAUSED THE ALERT, shown rather than summarised. An alert
   that cannot say what it saw is one people learn to dismiss. */
.ads-q__ev { font-variant-numeric:tabular-nums; color:var(--ink); font-size:.9em; margin-top:2px; }
.ads-q__impact { color:var(--stone); font-size:.85em; margin-top:4px; font-style:italic; }
.ads-q__act { align-self:center; white-space:nowrap; }

.ads-q__none { padding:20px 16px; color:var(--stone); background:var(--paper); }

/* ---- the client health matrix -------------------------------------------
   Four signals per client, each its own column, because "is this client fine"
   is four questions and one traffic light throws away the part that says what
   to do about it. */
.ads-m__sig { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.ads-m__dot { width:8px; height:8px; border-radius:2px; flex:0 0 auto; }
/* THE OFFICE'S OWN STATE COLOURS, not new ones. Healthy was the purple accent
   while the palette had no green; it has one now (--o-ok, tkati.com's own),
   and the accent is white, which is not a state. So healthy is the green
   MARK, the same green .ofc-chip--ok uses for a healthy anything on the
   Office screen; attention is the amber pair, blocked the red mark.

   Names lie — --teal was violet, --aqua lilac, and both are white now. Read
   the token. And the word is always printed beside the dot: the three hues
   sit 1.41-1.60:1 apart in luminance and are legible only because they are
   also written down. */
.ads-m__dot--healthy   { background:var(--o-ok-mark); }
.ads-m__dot--attention { background:var(--o-warn-ink); }
.ads-m__dot--at-risk   { background:var(--o-warn); }
.ads-m__dot--blocked   { background:var(--o-bad-mark); }
/* UNKNOWN IS HOLLOW, NOT GREY-GREEN. It has to be visibly a different KIND of
   answer from the other four: not "a bit healthy" but "nobody has measured
   this", which on a dashboard is the more dangerous state of the two. */
.ads-m__dot--unknown   { background:transparent; box-shadow:inset 0 0 0 1.5px var(--bone-mute); }

/* Colour is never the only signal — the state is also written, every time. */
.ads-m__label { font-size:.85em; color:var(--stone); }

/* ---- the pacing bar ------------------------------------------------------
   Spend against the flight, with the expected position marked. A bar with no
   marker says how much was spent; a bar with one says whether that is the
   right amount, which is the only question worth a graphic. */
.ads-pace { display:flex; flex-direction:column; gap:4px; min-width:150px; }
.ads-pace__track {
  position:relative; height:8px; border-radius:4px;
  background:var(--paper-3, rgba(0,0,0,.06)); overflow:visible;
}
.ads-pace__fill { height:100%; border-radius:4px; background:var(--stone); }
/* COLOUR-ONLY STATE MODIFIERS — THE REGISTER.
   A class whose whole job is a background colour carries meaning that a
   colour-blind reader, a greyscale print and a screen reader all miss. WCAG
   2.1 SC 1.4.1, Level A. The rule this codebase follows is stated in
   page-ads.mjs's signal(): "Colour is never the only carrier: the word is
   always there too."

   Six such classes exist, and each one is paired here with the code that
   writes its word. tools/ads-check.mjs asserts this list matches the
   stylesheet exactly, so a seventh cannot be added without someone saying
   where its word comes from.

     .ads-m__dot--healthy     signal() appends ads-m__label
     .ads-m__dot--attention   signal() appends ads-m__label
     .ads-m__dot--at-risk     signal() appends ads-m__label
     .ads-m__dot--blocked     signal() appends ads-m__label
     .ads-pace__fill--over    paceBar() appends "· ahead of plan"
     .ads-pace__fill--under   paceBar() appends "· behind plan"

   The pace pair had no word at all until 2026-09-22: the line beside the bar
   read "$4,100 of $6,000 · 9d left" whether spend was ahead of plan, behind
   it, or exactly on it. The client-facing screen had always said it in
   words; the agency screen, where the decision is actually made, had not. */
.ads-pace__fill--over  { background:var(--o-warn); }
.ads-pace__fill--under { background:var(--o-neutral); }
.ads-pace__mark {
  position:absolute; top:-3px; bottom:-3px; width:2px;
  background:var(--ink); border-radius:1px;
}
.ads-pace__n { font-variant-numeric:tabular-nums; font-size:.85em; color:var(--stone); }

/* ---- provenance ----------------------------------------------------------
   §110 on screen. Every figure that came from a platform rather than from the
   business says so, in the place it is read, not in a footnote nobody reaches.
   It is deliberately plain and small: this is a qualifier, not a badge. */
.ads-src {
  font-size:.75em; letter-spacing:.02em; text-transform:uppercase;
  color:var(--bone-mute); margin-left:6px; white-space:nowrap;
}

/* ---- a flag, which is the OPPOSITE of a provenance tag -------------------
   .ads-src recedes on purpose. Four cells had reached for it to mean "look
   at this" — a creative 96 days old, an approval stalled nine days, a change
   somebody made outside TKATI — which rendered the alarming thing as the
   quietest mark on the row and shrank a number into a micro-label.
   A flag keeps the cell's own size and alignment and changes only colour and
   weight. --o-warn-ink is the TEXT member of the warn family (10.3:1); the
   MARK colour --o-warn is 3.1:1 and would fail here. Colour is never the
   only carrier: every flagged cell also says a word — "chase", "aging",
   "outside TKATI" — and carries a title with the sentence behind it. */
/* Both selectors, and that is not belt-and-braces. `.ofc-table td` sets a
   colour at (0,1,1); a bare utility class is (0,1,0) and loses to it no
   matter which stylesheet comes last. Every one of these is used BOTH on a
   <span> inside a cell — where the plain class is right — and as the class
   of the <td> itself, where it needs the table-scoped twin or it silently
   renders as an ordinary dim cell. That is exactly how the flags shipped
   looking like everything else: measured at rgb(139,147,152), which is
   --o-dim, not the warn ink the rule asked for. */
.ads-flag, .ofc-table td.ads-flag { color:var(--o-warn-ink); font-weight:600; }

/* ---- a disclosure that opens a form -------------------------------------
   The <details> is not a field grid; the <form> inside it is. */
.ads-new { margin:0 0 .9rem; }
.ads-new__s {
  display:inline-block; cursor:pointer; list-style:none;
  font-size:var(--o-t-sm); font-weight:600; color:var(--o-text);
  /* A control, so its edge is the 3:1 hairline; no tinted wash, because an
     "add" affordance is not a state. */
  padding:.3rem .6rem; border:1px solid var(--o-line-3);
  border-radius:999px; background:transparent;
}
.ads-new__s::-webkit-details-marker { display:none; }
.ads-new__s::before { content:"+ "; }
/* \0020 spelled out. A space after a hex escape TERMINATES the escape and
   is eaten, so "\\2212 " renders as a bare minus jammed against the word
   while its "+ " twin has its space. */
.ads-new[open] .ads-new__s::before { content:"\2212\0020"; }
.ads-new__s:hover { border-color:var(--o-line-4); background:var(--o-hover); }
.ads-new__s:focus-visible { outline:2px solid var(--o-accent); outline-offset:2px; }
.ads-new > form { margin-top:.8rem; align-items:end; }

/* ---- numbers -------------------------------------------------------------
   Tabular figures everywhere a column of money or counts is read down. */
.ads-num, .ofc-table td.ads-num, .ofc-table th.ads-num {
  font-variant-numeric:tabular-nums; text-align:right;
}

/* A figure that is genuinely not known, as distinct from zero. */
.ads-none, .ofc-table td.ads-none { color:var(--bone-mute); }

/* AND HOVER MUST NOT EAT THE MEANING. `.ofc-table tbody tr:hover td` repaints
   every cell in --o-text at (0,2,2), so pointing at a row turned its warning
   and its not-known cells into ordinary text — the two colours on the row
   that carry a fact rather than decoration, gone at the moment somebody is
   looking straight at them. */
.ofc-table tbody tr:hover td.ads-flag { color:var(--o-warn-ink); }
.ofc-table tbody tr:hover td.ads-none { color:var(--bone-mute); }
/* First column is bolder and lighter at (0,2,1); a flag there still has to
   read as a flag. */
.ofc-table td.ads-flag:first-child { color:var(--o-warn-ink); }

@media (prefers-reduced-motion: reduce) {
  .ads-pace__fill { transition:none; }
}

/* ---- provenance at portfolio scale --------------------------------------
   The per-figure tag says where ONE number came from. This says what a whole
   screen is made of, which is the question an owner has before they forward
   any of it to a client. A list, not a stacked bar: the shares are usually
   one big one and a tail, and a bar makes the tail unreadable at the exact
   moment the tail is the interesting part. */
.ads-mix { list-style:none; margin:.35rem 0 1rem; padding:0;
           display:flex; flex-wrap:wrap; gap:.35rem .9rem; }
.ads-mix__i { display:flex; align-items:baseline; gap:.3rem;
              font-size:var(--o-t-sm); }
.ads-mix__n { font-variant-numeric:tabular-nums; font-weight:600;
              color:var(--o-text); }
.ads-mix__p { color:var(--o-faint); font-variant-numeric:tabular-nums; }

/* A heading INSIDE a card, under the card's own h2. It was wearing
   .ofc-head__id, which does nothing to an h3, so the browser default made
   the subheading larger than the h2 above it — the hierarchy upside down in
   the one card that has two levels. */
.ads-sub__h {
  margin:.9rem 0 0; font-size:var(--o-t-sm); font-weight:600;
  letter-spacing:.06em; text-transform:uppercase; color:var(--o-faint);
}
.ads-sub__h:first-of-type { margin-top:.2rem; }

/* ---- the importer --------------------------------------------------------
   Two stages: read, then write. The report between them is the whole point,
   so it is given room rather than squeezed under the controls. */
/* Colour, ground and border come from .ofc-fields textarea. What is left is
   the one thing specific to this box: a CSV is columns, so it is monospaced
   and given enough rows to see that the columns line up. */
.ads-paste { min-height:5.5rem; font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
             font-size:var(--o-t-xs); }
.ads-report { margin:.9rem 0 .4rem; display:grid; gap:.5rem; justify-items:start; }
.ads-probs { margin:0; padding-left:1.1rem; display:grid; gap:.25rem;
             font-size:var(--o-t-sm); color:var(--o-text); }
.ads-probs li { line-height:1.45; }
/* A hint under a control, not a label above it. */
.ads-hint { font-size:var(--o-t-xs); font-weight:400; letter-spacing:0;
            text-transform:none; color:var(--o-faint); line-height:1.4; }
/* The paste box is not a field-sized field. .ofc-fields caps a column at
   18rem, which is right for a date and absurd for four lines of CSV. */
.ads-field--wide { grid-column:1 / -1; max-width:52rem; }

/* ---- deciding, inside a table row ---------------------------------------
   A note and up to four buttons have to fit in a cell without turning the
   row into a paragraph, so they live behind the same disclosure the record
   forms use and open downward. */
.ads-decide { display:grid; gap:.5rem; margin-top:.5rem; min-width:17rem; }
.ads-decide__n {
  min-height:32px; padding:0 .55rem;
  border:1px solid var(--o-line-3); border-radius:var(--o-r-sm);
  background:var(--o-inset); color:var(--o-text);
  font:500 var(--o-t-sm)/1 var(--body);
}
.ads-decide__n::placeholder { color:var(--o-faint); }
.ads-decide__b { display:flex; flex-wrap:wrap; gap:.15rem .85rem; }
/* A table cell will not let a disclosure grow the row sideways, so the panel
   is allowed out of it. */
.ofc-table td > .ads-new[open] { position:relative; z-index:1; }

/* ---- the route to live ---------------------------------------------------
   A numbered list, because the order is the dependency order and the number
   is part of the meaning: step six is blocked behind step three. Done steps
   recede rather than disappear — the route is the point, not just what is
   left of it. */
.ads-route { list-style:none; margin:.9rem 0 0; padding:0; display:grid; gap:.3rem; }
.ads-route__i {
  display:flex; align-items:center; gap:.5rem;
  font-size:var(--o-t-sm); color:var(--o-dim);
}
.ads-route__i.is-done { color:var(--o-faint); }
.ads-route__i.is-next { color:var(--o-text); font-weight:600; }
.ads-route__i.is-done .ofc-linkish { color:var(--o-faint); }
.ads-route__i .ofc-linkish { padding:.1rem 0; }

/* ---- the palette ---------------------------------------------------------
   Near the top rather than centred: the list grows downward and a centred
   box makes the whole thing jump every keystroke. */
.ads-pal {
  position:fixed; inset:0; z-index:100;
  display:flex; justify-content:center; align-items:flex-start;
  padding:12vh 1rem 1rem;
  background:rgb(0 0 0 / .55);
}
.ads-pal__box {
  width:min(42rem, 100%);
  display:flex; flex-direction:column; gap:.35rem;
  padding:.55rem;
  border:1px solid var(--o-line-2); border-radius:var(--o-r-lg);
  background:var(--o-bg);
  box-shadow:0 24px 60px -20px rgb(0 0 0 / .8);
  max-height:70vh;
}
.ads-pal__in {
  min-height:44px; padding:0 .8rem;
  border:1px solid var(--o-line-3); border-radius:var(--o-r-sm);
  background:var(--o-inset); color:var(--o-text);
  font:500 var(--o-t-lg)/1 var(--body);
}
.ads-pal__in::placeholder { color:var(--o-faint); }
.ads-pal__in:focus-visible { outline:2px solid var(--o-accent); outline-offset:1px; }
.ads-pal__l { list-style:none; margin:0; padding:0; overflow-y:auto; }
.ads-pal__i {
  display:flex; align-items:baseline; gap:.6rem;
  padding:.45rem .6rem; border-radius:var(--o-r-sm);
  font-size:var(--o-t-sm); cursor:pointer;
}
/* THE HIGHLIGHT IS NOT ONLY A TINT. A background alone at this contrast is
   invisible to some people and gone entirely in forced-colours mode, so the
   selected row also carries an accent edge. */
.ads-pal__i.is-on { background:var(--o-hover); box-shadow:inset 2px 0 0 var(--o-accent); }
.ads-pal__k {
  flex:0 0 5.2rem; font-size:var(--o-t-xs); font-weight:700;
  letter-spacing:.08em; text-transform:uppercase; color:var(--o-faint);
}
.ads-pal__t { color:var(--o-text); font-weight:600; }
.ads-pal__b { color:var(--o-faint); font-size:var(--o-t-xs); margin-left:auto;
              text-align:right; }
.ads-pal__s { margin:0; padding:.15rem .6rem .25rem; font-size:var(--o-t-xs);
              color:var(--o-faint); }
@media (forced-colors: active) {
  .ads-pal__i.is-on { outline:2px solid Highlight; }
}
/* The palette's own affordance, in the header beside the window picker. */
.ads-find { gap:.45rem; }
.ads-kbd {
  font:600 var(--o-t-xs)/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  padding:.16rem .32rem; border-radius:4px;
  border:1px solid var(--o-line-2); color:var(--o-faint);
}
/* A provider's own identifier is a string to be compared character by
   character against their interface, not prose. */
.ads-mono { font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
            font-size:var(--o-t-xs); }

/* ---- presentation mode ---------------------------------------------------
   The shell stands down. A rail full of the agency's other clients, a window
   picker and a "read 3:41 PM" stamp are all correct on a working screen and
   all wrong on one somebody is showing to the client whose plan it is. */
#ads[data-present="on"] .ofc-rail,
#ads[data-present="on"] .ofc-head,
#ads[data-present="on"] .ads-head__tools { display:none; }
#ads[data-present="on"] { grid-template-columns:1fr; }

.ads-present {
  max-width:46rem; margin:2.5rem auto 4rem; padding:0 1.25rem;
  display:grid; gap:1.1rem;
}
.ads-present__exit { justify-self:start; font-size:var(--o-t-xs); }
.ads-present__h { display:grid; gap:.3rem; }
.ads-present__who {
  margin:0; font-size:var(--o-t-xs); font-weight:700;
  letter-spacing:.1em; text-transform:uppercase; color:var(--o-faint);
}
.ads-present__t {
  margin:0; font-family:var(--display); font-size:2.6rem; font-weight:750;
  line-height:1.05; letter-spacing:-0.02em; color:var(--o-text);
}
.ads-present__m { margin:0; color:var(--o-dim); font-size:var(--o-t-md); }
.ads-present__fig {
  display:flex; align-items:baseline; gap:.75rem; flex-wrap:wrap;
  padding:1rem 0 .2rem; border-top:1px solid var(--o-line-2);
}
.ads-present__n {
  margin:0; font-family:var(--display); font-size:3.25rem; font-weight:750;
  line-height:1; letter-spacing:-0.03em; color:var(--o-text);
}
.ads-present__l { margin:0; color:var(--o-faint); font-size:var(--o-t-sm); }
.ads-present__s { margin:0; color:var(--o-dim); font-size:var(--o-t-md); line-height:1.6; }
.ads-present__tbl { width:100%; border-collapse:collapse; font-size:var(--o-t-md); }
.ads-present__tbl th {
  text-align:left; padding:.5rem .6rem; border-bottom:1px solid var(--o-line-2);
  font-size:var(--o-t-xs); font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--o-faint);
}
.ads-present__tbl td { padding:.6rem; border-bottom:1px solid var(--o-line); color:var(--o-text); }
.ads-present__tbl tfoot td {
  border-bottom:0; border-top:2px solid var(--o-line-2); font-weight:700;
}
.ads-present__f {
  display:grid; gap:.2rem; padding-top:.9rem;
  border-top:1px solid var(--o-line-2);
  color:var(--o-faint); font-size:var(--o-t-sm);
}
.ads-present__f p { margin:0; }

/* AND IT HAS TO PRINT, because half the time this is sent as a PDF rather
   than shown on a screen. Ink on paper, and the way back does not print. */
@media print {
  #ads[data-present="on"] { background:#FFFFFF; }
  #ads[data-present="on"] .ads-present__exit { display:none; }
  #ads[data-present="on"] .ads-present { margin:0; max-width:none; }
  #ads[data-present="on"] .ads-present__t,
  #ads[data-present="on"] .ads-present__n,
  #ads[data-present="on"] .ads-present__tbl td { color:#000000; }
  #ads[data-present="on"] .ads-present__m,
  #ads[data-present="on"] .ads-present__s { color:#333333; }
  #ads[data-present="on"] .ads-present__who,
  #ads[data-present="on"] .ads-present__l,
  #ads[data-present="on"] .ads-present__tbl th,
  #ads[data-present="on"] .ads-present__f { color:#555555; }
  #ads[data-present="on"] .ads-present__tbl td { border-bottom-color:#DDDDDD; }
  #ads[data-present="on"] .ads-present__fig,
  #ads[data-present="on"] .ads-present__f,
  #ads[data-present="on"] .ads-present__tbl tfoot td { border-color:#999999; }
}

/* ---- a signal somebody is already on --------------------------------------
   It stays on the list, because the connection really is still expired. What
   changes is that it stops shouting: the severity edge goes neutral and the
   row says who has it. A queue that raises a handled item at full volume
   every morning is one people learn to scroll past. */
.ads-q__i--held::before { background:var(--o-neutral); }
.ads-q__held { margin:.3rem 0 0; font-size:var(--o-t-sm); color:var(--o-dim); }
.ads-q__raise { align-self:start; font-size:var(--o-t-xs); white-space:nowrap; }

/* ---- the scope checklist -------------------------------------------------
   Each permission says what it actually lets somebody do, because "approve"
   as a bare word is a guess and the guess is made by whoever is handing out
   access at the time. */
.ads-scopes { border:0; margin:.4rem 0 .9rem; padding:0; display:grid; gap:.4rem; }
.ads-scopes legend { padding:0 0 .3rem; }
.ads-scope__l { align-items:flex-start; }
.ads-scope__l .ads-m__label { text-transform:none; letter-spacing:0; }

/* ---- the client's own screen --------------------------------------------
   No rail. A client with four destinations does not need a navigation
   column, and one makes the product look bigger than the part of it they
   are allowed into. */
/* #ads.acl, not .acl. office.css declares #ads as the two-column shell grid
   at (1,0,0); a bare class is (0,1,0) and loses, so the client page laid
   itself out inside a 248px rail column that is not even there. The same
   trap .ads-flag hit against .ofc-table td, in a different place. */
#ads.acl {
  display:block; max-width:64rem; margin:0 auto; padding:0 1.25rem 4rem;
  overflow:auto;
}
#ads.acl .ofc-head { display:flex; align-items:flex-end; justify-content:space-between;
                     gap:1rem; flex-wrap:wrap; }
#ads.acl #ofc-grid { display:block; overflow:visible; }
.acl__head { padding-top:1.6rem; }
.acl__tabs {
  display:flex; flex-wrap:wrap; gap:.3rem;
  margin:.9rem 0 1.2rem; padding-bottom:.2rem;
  border-bottom:1px solid var(--o-line-2);
}
.acl__tab {
  padding:.45rem .8rem; border-radius:var(--o-r-sm) var(--o-r-sm) 0 0;
  font-size:var(--o-t-sm); font-weight:600; color:var(--o-dim);
  text-decoration:none; border-bottom:2px solid transparent;
  margin-bottom:-1px;
}
.acl__tab:hover { color:var(--o-text); }
.acl__tab[aria-current="page"] {
  color:var(--o-text); border-bottom-color:var(--o-accent);
}
.acl__tab:focus-visible { outline:2px solid var(--o-accent); outline-offset:2px; }
@media (max-width: 40rem) { .acl { padding:0 .9rem 3rem; } }

/* ═══ PHASE VI: ADS WEARS THE OFFICE'S SHELL ════════════════════════════════
   The rail is the Office's own now (ads.html), and the header and the work area
   follow the same grammar as office.html's: one 64px location bar with the
   page's name and purpose on the left and its tools on the right, and the work
   padded exactly like .ofc-scroll. Nothing here moves for presentation mode,
   which hides the rail as before. */
#ads .ofc-head {
  flex-wrap: nowrap;
  min-height: 64px;
  margin: 0;
  padding: 0.75rem clamp(1rem, 2.4vw, 2rem);
  border-bottom: 1px solid var(--o-line-2);
}
#ads .ofc-head h1 { font-weight: 650; letter-spacing: -0.022em; }
#ads .ofc-head > div:first-child p { margin: 0.2rem 0 0; font-size: var(--o-t-sm); font-weight: 450; color: var(--o-faint); }
#ads #ofc-grid { padding: 1.25rem clamp(1rem, 2.4vw, 2rem) 3rem; }
#ads .ads-head__tools { display: flex; align-items: center; gap: 0.6rem; flex: none; }
#ads .ads-window { display: flex; align-items: center; gap: 0.5rem; }
#ads .ads-window[hidden] { display: none; }
#ads .ads-window .ofc-side__g { margin: 0; padding: 0; }
#ads .ads-window select { min-height: 34px; border-radius: var(--o-r); }
#ads .ads-find {
  min-height: 34px;
  border-radius: var(--o-r);
  border-color: var(--o-line-2);
  background: var(--o-inset);
  color: var(--o-faint);
  font-weight: 550;
}
#ads #ads-fresh { margin: 0 0 0 0.25rem; font-size: var(--o-t-xs); color: var(--o-faint); white-space: nowrap; }
/* The sample switch is a demonstration tool: it stays in the rail's foot,
   for those allowed to see it, as a quiet link rather than a button. */
#ads .ofc-rail__foot #ads-sample { min-height: 0; padding: 0.2rem 0; border: 0; background: none; color: var(--o-faint); font-size: var(--o-t-xs); font-weight: 550; text-decoration: underline; text-underline-offset: 3px; }
/* The select says "30 days"; the word "Window" above it stays for a screen
   reader and leaves the bar one line tall. */
#ads .ads-head__tools .ads-window > .ofc-side__g {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- Phase VI, pass 2: drawers, the page's create, a section head that does
   not repeat the page title -------------------------------------------------- */
#ads .ads-act { display: contents; }
#ads .ads-new__page::before { content: "+"; margin-right: 0.4rem; font-weight: 500; font-size: 1.05em; }
#ads .ads-new { margin: 0 0 0.75rem; }
#ads .ads-new:has(> dialog:only-child) { display: none; }
#ads button.ads-new__s { min-height: 30px; padding: 0 0.7rem; border: 1px solid var(--o-line-3); border-radius: var(--o-r-sm);
  background: transparent; color: var(--o-dim); font: 600 var(--o-t-sm)/1 var(--body); cursor: pointer; }
#ads button.ads-new__s:hover { color: var(--o-text); border-color: var(--o-line-4); background: var(--o-hover); }
#ads .ads-field__k { font-size: var(--o-t-xs); font-weight: 600; color: var(--o-dim); }
#ads .ofc-drawer .ofc-field { display: grid; gap: 0.35rem; }
#ads .ofc-drawer .ads-scopes { margin: 0.25rem 0 0; padding: 0.75rem 0 0; border: 0; border-top: 1px solid var(--o-line-2); display: grid; gap: 0.6rem; }
#ads .ofc-drawer .ads-scopes legend { padding: 0 0 0.4rem; }
#ads .ofc-drawer form > .ofc-primary { justify-self: start; margin-top: 0.4rem; }
#ads .ofc-card__bar.is-page { margin-bottom: 0.6rem; }
#ads .ofc-card__bar.is-page .ofc-head__id { margin: 0; font-size: var(--o-t-sm); color: var(--o-faint); }
/* A ROW'S ACTION IS A SMALL BUTTON, not underlined words (Phase VI): Start,
   Done, Revoke, Decide, Take one now, I'm on it. One shape across Ads. */
#ads .ads-mini { display: inline-flex; align-items: center; min-height: 26px; padding: 0 0.55rem; margin: 0 0.3rem 0.3rem 0;
  border: 1px solid var(--o-line-2); border-radius: var(--o-r-sm); background: transparent; color: var(--o-dim);
  font: 600 var(--o-t-xs)/1 var(--body); white-space: nowrap; cursor: pointer; }
#ads .ads-mini:hover:not(:disabled) { color: var(--o-text); border-color: var(--o-line-3); background: var(--o-hover); }
#ads .ads-mini:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#ads .ads-mini:disabled { opacity: 0.5; cursor: default; }
#ads .ads-decide__b { display: flex; flex-wrap: wrap; justify-content: flex-end; }
#ads .ofc-drawer .ads-decide { display: grid; gap: 0.8rem; }
#ads .ofc-drawer .ads-decide__b { justify-content: flex-start; }
#ads .ofc-drawer .ads-decide__n { width: 100%; }
/* WHAT NEEDS ME, AS A LIST OF ROWS (Phase VI). The 4px coloured bars ran the
   full height of each item and made a page of stripes; the state is a dot at
   the title, the evidence and the consequence are one quiet line each, and the
   two moves sit together at the row's end. */
#ads .ads-q { gap: 0; background: none; border-top: 1px solid var(--o-line); }
#ads .ads-q__i { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 0 0.9rem; padding: 0.9rem 0.25rem; background: none;
  border-bottom: 1px solid var(--o-line); align-items: start; }
#ads .ads-q__i:hover { background: var(--o-hover); }
#ads .ads-q__i::before { grid-row: 1; align-self: start; width: 7px; height: 7px; margin-top: 0.42rem; border-radius: 50%; }
#ads .ads-q__i--info::before { background: var(--o-line-3); }
#ads .ads-q__i--held::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--o-line-3); }
#ads .ads-q__h { margin: 0; font-size: var(--o-t-md); color: var(--o-text); }
#ads .ads-q__client { color: var(--o-dim); }
#ads .ads-q__d, #ads .ads-q__ev, #ads .ads-q__impact, #ads .ads-q__held { margin: 0.2rem 0 0; font-size: var(--o-t-sm); line-height: 1.45; }
#ads .ads-q__d { color: var(--o-dim); }
#ads .ads-q__ev { color: var(--o-text); }
#ads .ads-q__impact { color: var(--o-faint); font-style: normal; }
#ads .ads-q__held { color: var(--o-faint); }
#ads .ads-q__i--held .ads-q__h { color: var(--o-dim); }
#ads .ads-q__acts { display: flex; gap: 0.4rem; align-items: center; justify-content: flex-end; }
#ads .ads-q__acts .ads-mini { margin: 0; text-decoration: none; }
#ads .ads-q__act { color: var(--o-text); border-color: var(--o-line-3); }
@media (max-width: 40rem) { #ads .ads-q__i { grid-template-columns: 8px minmax(0, 1fr); } #ads .ads-q__acts { grid-column: 2; justify-content: flex-start; margin-top: 0.6rem; } }
#ads .ofc-card__bar { align-items: baseline; }
#ads .ofc-card__bar .ofc-head__id { margin: 0; color: var(--o-faint); font-size: var(--o-t-sm); }
#ads .ads-drawer__intro { margin: 0 0 1rem; font-size: var(--o-t-sm); line-height: 1.5; color: var(--o-dim); }
/* Sections on one page breathe apart; a heading never sits on the table above it. */
#ads .ofc-view > div > * + .ofc-card { margin-top: 2.25rem; }
@media (max-width: 40rem) {
  #ads .ofc-head { flex-wrap: wrap; row-gap: 0.55rem; padding: 0.7rem 1rem; }
  #ads .ofc-head > div:first-child { flex: 1 1 100%; }
  #ads .ads-head__tools { flex: 1 1 100%; flex-wrap: wrap; }
  #ads #ads-fresh { display: none; }
  #ads #ofc-grid { padding: 1rem 1rem 3rem; }
}
/* Phone: Ads' tables as cards of named cells, the Office's own pattern. */
@media (max-width: 40rem) {
  #ads .ofc-table.is-cards { display: block; min-width: 0; }
  #ads .ofc-table.is-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #ads .ofc-table.is-cards tbody { display: block; }
  #ads .ofc-table.is-cards tr { display: block; padding: 0.6rem 0; border-top: 1px solid var(--o-line); }
  #ads .ofc-table.is-cards tbody tr:first-child { border-top: 0; }
  #ads .ofc-table.is-cards td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.6rem; align-items: baseline;
    padding: 0.15rem 0; border: 0; text-align: left; white-space: normal; }
  #ads .ofc-table.is-cards td::before { content: attr(data-label); color: var(--o-faint); font-size: var(--o-t-xs);
    font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
  #ads .ofc-table.is-cards td:not([data-label]) { display: block; }
  #ads .ofc-table.is-cards td:not([data-label])::before { content: none; }
  #ads .ofc-table.is-cards tbody tr:hover td { background: transparent; }
  #ads .ofc-table.is-cards .ads-decide__b { justify-content: flex-start; }
  #ads .ofc-table.is-cards td[data-label] > * { grid-column: 2; justify-self: start; }
}
/* The record page's way back, in the header line under its name. */
#ads .ofc-head .ads-crumb { color: var(--o-dim); text-decoration: none; }
#ads .ofc-head .ads-crumb:hover { color: var(--o-text); text-decoration: underline; text-underline-offset: 3px; }
#ads .ofc-head .ads-crumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 2px; }
#ads #ads-sub { display: block; }
#ads #ads-title { overflow-wrap: anywhere; }
