/* Admin uses the Studio's two-level navigation and the console's native
   materials. Section changes are immediate; each section keeps its scroll. */
.admin-view { container-type: normal; min-width: 0; }
.admin-main { min-width: 0; container-type: inline-size; }
.admin-head { padding: 20px 2px 24px; }
.admin-eyebrow { margin: 0 0 8px; color: var(--c-ink-3); font-size: 12px; font-weight: 550; }
.admin-head h1 { margin: 0; font-size: 30px; font-weight: 650; line-height: 1.18; letter-spacing: -.035em; }
.admin-head > p:last-child { margin: 9px 0 0; color: var(--c-ink-3); font-size: 14px; line-height: 1.5; text-wrap: pretty; }
.admin-subnav { display: flex; flex-direction: column; min-width: 0; }
.admin-subnav .admin-tab:focus-visible { transition: none; outline: 2px solid var(--c-on-dark); outline-offset: 2px; }
.admin-panel { min-width: 0; }
.admin-panel:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: -2px; border-radius: 12px; }
.admin-panel .card { border: 0; border-radius: 16px; box-shadow: var(--ui-card); padding: 24px; }
.admin-panel h3 { font-size: 16px; font-weight: 600; letter-spacing: -.018em; }
.admin-panel .use-note { line-height: 1.6; }
.admin-grid { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 20px; }
.admin-create-card { position: sticky; top: 2px; }
.admin-mint { margin-top: 22px; }
.admin-view label { text-transform: none; letter-spacing: 0; }
.admin-view :is(input, select, textarea) { border-color: var(--ui-edge); border-radius: 8px; }
.admin-view :is(input, select, textarea):focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; }
.admin-mint :is(input, button), .admin-field :is(input, select) { min-height: 42px; }
.admin-view button.ghost { min-height: 36px; border: 0; border-radius: 8px; background: var(--ui-fill-2); }
.admin-view .use-range { gap: 2px; padding: 3px; border-radius: 10px; background: var(--ui-fill); }
.admin-view .use-r { min-height: 32px; border: 0; border-radius: 7px; background: none; color: var(--c-ink-3); }
.admin-view .use-r.is-on { color: var(--c-ink); background: var(--c-surface); box-shadow: var(--ui-raise); }
.admin-brand-filters { padding: 20px 0; }
.admin-view .brand-row { padding: 18px 0; }
.admin-view .brand-row .b-top { flex-wrap: wrap; gap: 10px 16px; }
.admin-view .brand-row .b-name { overflow-wrap: anywhere; }
.admin-view .b-side { gap: 8px; }
.admin-view .admin-pagination { border-color: var(--ui-sep); }
.admin-view .marketing-heading { margin-top: 4px; }
.admin-view .marketing-heading h2 { font-size: 26px; }
.admin-view .marketing-eyebrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .admin-view button.ghost:hover { background: var(--ui-fill-3); }
}
@media (min-width: 761px) {
  .app.admin-workspace, .app.admin-workspace.inspecting {
    --studio-h: calc(100dvh - 32px - var(--banner-h, 0px)); --admin-nav-w: 184px; --test-w: 388px;
    grid-template-columns: 64px minmax(0, 1fr) var(--test-w); gap: 16px 0; max-width: 1920px; transition: none; }
  .admin-workspace > #content { grid-column: 2; grid-row: 1; padding: 0; }
  .admin-workspace > .nav { position: sticky; top: calc(16px + var(--banner-h, 0px)); flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 1px; }
  .admin-workspace .nav-items { flex-direction: column; flex: none; }
  .admin-workspace .nav-items:last-of-type { flex: none; }
  .admin-view { display: grid; grid-template-columns: var(--admin-nav-w) minmax(0, 1fr); align-items: start; }
  .admin-subnav { top: calc(16px + var(--banner-h, 0px)); }
  .admin-main { height: var(--studio-h); display: flex; flex-direction: column; padding: 0 20px 0 28px; }
  .admin-head { flex: none; }
  .admin-panel { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
    scrollbar-gutter: stable; padding: 2px 6px 28px 2px; }
  .admin-workspace > .rail, .admin-workspace > .insp { grid-column: 3; grid-row: 1; }
  .admin-workspace > .rail { position: sticky; top: calc(16px + var(--banner-h, 0px)); height: var(--studio-h); }
}
.admin-workspace > .insp:not(.on) { display: none; }
@media (min-width: 761px) and (max-width: 1240px) {
  .app.admin-workspace { --test-w: 352px; }
}
@media (min-width: 761px) and (max-width: 1279px) {
  .app.admin-workspace { --admin-nav-w: 164px; }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .app.admin-workspace, .app.admin-workspace.inspecting { grid-template-columns: 64px minmax(0, 1fr); }
  .admin-workspace > .rail { grid-column: 2; grid-row: 2; position: static; height: auto;
    margin-left: calc(var(--admin-nav-w) + 28px); }
  .admin-workspace .admin-main { height: auto; min-height: var(--studio-h); padding-right: 0; }
  .admin-workspace .admin-panel { overflow: visible; }
}
@container (max-width: 800px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin-create-card { position: static; }
  .admin-mint { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .6fr); gap: 8px 12px; }
  .admin-mint label { grid-row: 1; }
  .admin-mint label:not(:first-child) { margin-top: 0; }
  .admin-mint input { grid-row: 2; }
  .admin-mint #mintbtn, .admin-mint .code-out { grid-column: 1 / -1; }
  .admin-view .marketing-studio { grid-template-columns: minmax(0, 1fr); }
  .admin-view .campaign-preview-column { position: static; }
}
@media (max-width: 760px) {
  /* Do not animate the desktop test panel over the editor at this breakpoint.
     The phone dock keeps the call controls available; its transcript opens on demand. */
  .admin-workspace > .rail { transition: none; }
  .admin-subnav { position: sticky; top: -12px; z-index: 3; margin: -12px -2px 0; padding: 12px 2px;
    background: var(--ui-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .admin-subnav-label { display: none; }
  .admin-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px;
    padding: 4px; border-radius: 12px; background: var(--ui-fill); }
  .admin-tab { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 44px;
    padding: 10px 6px; border: 0; border-radius: 8px; background: none; color: var(--c-ink-2);
    font: 500 12px/1.3 var(--sans); white-space: nowrap; }
  .admin-tab svg { color: var(--c-ink-3); width: 16px; height: 16px; flex: none; }
  .admin-tab[aria-selected=true] { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--ui-raise); }
  .admin-tab:active { transform: none; background: var(--ui-fill-3); }
  .admin-tab:focus-visible { outline-color: var(--c-ink); outline-offset: -2px; }
  .admin-head { padding: 18px 2px 22px; }
  .admin-head h1 { font-size: 28px; }
  .admin-eyebrow { font-size: 11px; }
  .admin-panel .card { padding: 18px; }
  .admin-view :is(input, select, textarea) { font-size: 16px; }
  .admin-view button.ghost, .admin-view .use-r { min-height: 44px; }
  .admin-view .admin-page-buttons { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  /* Five sections: the icon sits above its label, and a two-word label may
     take a second line on a narrow phone. */
  .admin-tab { flex-direction: column; gap: 5px; padding-inline: 2px; font-size: 11px; line-height: 1.2;
    white-space: normal; text-align: center; }
}
@media (max-width: 480px) {
  .admin-mint { display: flex; }
  .admin-mint label:not(:first-child) { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .admin-subnav button { transition: none; } }
@media (prefers-reduced-transparency: reduce) { .admin-subnav { backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (max-width: 760px) and (prefers-reduced-transparency: reduce) { .admin-subnav { background: var(--c-paper); } }
@media (prefers-contrast: more) {
  .admin-tab[aria-selected=true] { outline: 1px solid currentColor; outline-offset: -1px; }
  .admin-panel .card { border: 1px solid var(--c-ink-3); }
}

/* Email is a channel inside Marketing. Keep all controls inside the same
   content column so switching channels never changes the workspace geometry. */
.marketing-channels { display: inline-flex; gap: 3px; padding: 3px; margin: 0 0 24px; border-radius: 10px; background: var(--ui-fill); }
.marketing-channels button { min-height: 36px; padding: 8px 22px; border: 0; border-radius: 7px; background: transparent; color: var(--c-ink-3); font-size: 13px; font-weight: 550; box-shadow: none; }
.marketing-channels button[aria-selected=true] { color: var(--c-ink); background: var(--c-surface); box-shadow: var(--ui-raise); }
.email-intro { margin-bottom: 24px; }
.email-intro h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
.email-intro p { margin: 0; color: var(--c-ink-3); font-size: 14px; line-height: 1.6; }
#marketing-email > .card { margin-bottom: 20px; }
.email-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.email-card-head h3 { margin: 0 0 6px; }
.email-card-head .use-note { margin: 0; }
.email-card-head > button { flex: none; }
.email-automation-copy { font-size: 13px; line-height: 1.7; color: var(--c-ink-2); max-width: 68ch; margin: 20px 0; text-wrap: pretty; }
.email-sender { border-top: 1px solid var(--ui-sep); padding-top: 16px; color: var(--c-ink-3); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.email-switch { display: flex; align-items: center; position: relative; gap: 8px; min-height: 36px; cursor: pointer; flex: none; margin: 0; font-size: 12px; }
.email-switch input { position: absolute; opacity: 0; width: 38px; height: 24px; margin: 0; }
.email-switch input + span { display: block; width: 38px; height: 24px; border-radius: 20px; background: var(--c-ink-3); padding: 3px; transition: background 150ms ease; }
.email-switch input + span::after { content: ""; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; transition: transform 150ms ease; }
.email-switch input:checked + span { background: var(--c-ink); }
.email-switch input:checked + span::after { transform: translateX(14px); }
.email-switch input:focus-visible + span { outline: 2px solid var(--c-ink); outline-offset: 3px; }
.email-switch:has(input:disabled) { opacity: .6; cursor: default; }
.email-legacy-note { padding: 12px 14px; background: var(--ui-fill-2); border-radius: 8px; margin: 20px 0; font-size: 12px; line-height: 1.65; color: var(--c-ink-2); }
.email-search { display: block; margin: 0; color: var(--c-ink-2); font-size: 12px; }
.email-search input { display: block; width: 100%; margin-top: 8px; min-height: 40px; }
.email-customer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .65fr) auto; align-items: center; gap: 16px; padding: 18px 0; border-top: 1px solid var(--ui-sep); }
.email-customer-details strong { font-size: 14px; font-weight: 600; }
.email-customer p { font-size: 12px; line-height: 1.6; color: var(--c-ink-3); margin: 5px 0 0; overflow-wrap: anywhere; }
.email-customer-details { min-width: 0; overflow-wrap: anywhere; }
.email-customer p.email-customer-expiry, .email-customer p.email-customer-followup { font-size: 11px; }
.email-status { font-size: 11px; font-weight: 550; display: inline-block; padding: 4px 8px; border-radius: 6px; background: var(--ui-fill-2); color: var(--c-ink-2); }
.email-status[data-state=missing_email], .email-status[data-state=needs_review] { color: #855714; background: #b67b1614; }
.email-status[data-state=sent], .email-status[data-state=production] { color: #426139; background: #52784412; }
.email-empty { padding: 24px 0; color: var(--c-ink-3); font-size: 13px; }
.email-delivery-note { border-top: 1px solid var(--ui-sep); padding-top: 16px; margin-bottom: 0; }
.email-preview-select { margin: 0; font-size: 11px; color: var(--c-ink-3); }
.email-preview-select select { display: block; margin-top: 6px; min-height: 36px; max-width: 220px; font-size: 12px; }
.email-preview-subject { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 18px 0; margin: 16px 0 0; border-top: 1px solid var(--ui-sep); font-size: 12px; line-height: 1.6; }
.email-preview-subject span { color: var(--c-ink-3); }
.email-preview-subject strong { font-weight: 500; }
#email-preview { display: block; width: 100%; height: 710px; border: 1px solid var(--ui-sep); border-radius: 10px; background: #faf9f6; }
#email-preview[hidden] { display: none; }
.email-preview-card .updates-test-row > label { display: block; font-size: 12px; color: var(--c-ink-2); }
#email-test-address { display: block; width: 100%; min-height: 42px; margin-top: 8px; font-size: 13px; }
@container (max-width: 620px) {
  .email-customer { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .email-customer-state { grid-column: 1; }
  .email-customer > button { grid-column: 2; grid-row: 1 / 3; }
  .email-preview-card .email-card-head { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .marketing-channels button { min-height: 44px; }
  .email-customer { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .email-customer-state { grid-column: 1; }
  .email-customer > button { grid-column: 2; grid-row: 1 / 3; }
  .email-preview-card .email-card-head { flex-wrap: wrap; }
  .email-preview-select select { max-width: 100%; }
  #email-preview { height: 790px; }
}
@media (prefers-reduced-motion: reduce) { .email-switch input + span, .email-switch input + span::after { transition: none; } }

/* Retention is Conductor's picture of each customer, shown as it is: nothing on
   this panel is computed here. Health borrows the console's own alarm (down)
   and open (watch) tokens; OK stays neutral, because green here means the
   brand, never "good". */
.retention-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.retention-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 14px;
  margin: 0; padding: 16px 18px; min-height: 0; text-align: left; border: 0; border-radius: 16px;
  background: var(--c-surface); box-shadow: var(--ui-card); color: var(--c-ink); cursor: pointer; }
.retention-tile-n { grid-row: 1 / 3; min-width: 1.4em; font: 650 30px/1 var(--sans); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.retention-tile-label { font-size: 13px; font-weight: 600; }
.retention-tile-help { font-size: 12px; color: var(--c-ink-3); }
.retention-tile[data-health=down] .retention-tile-n { color: var(--c-alarm-ink); }
.retention-tile[data-health=watch] .retention-tile-n { color: var(--c-open-ink); }
.retention-tile[aria-pressed=true] { box-shadow: var(--ui-card), inset 0 0 0 1.5px var(--c-ink); }
.retention-tile:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; }
.retention-stages { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0 0; }
.retention-stages:empty { display: none; }
.admin-view .retention-stage { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; margin: 0;
  padding: 5px 11px; border: 0; border-radius: 999px; background: var(--ui-fill-2); color: var(--c-ink-2);
  font-size: 12px; font-weight: 500; }
.retention-stage b { font-weight: 600; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.admin-view .retention-stage[aria-pressed=true] { background: var(--c-ink); color: var(--c-surface); }
.retention-stage[aria-pressed=true] b { color: var(--c-surface); }
.retention-stage:disabled { opacity: .55; cursor: default; }
.retention-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--ui-fill-2);
  color: var(--c-ink-2); font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.retention-badge[data-health=down] { color: var(--c-alarm-ink); background: var(--c-alarm-bg); }
.retention-badge[data-health=watch] { color: var(--c-open-ink); background: var(--c-open-bg); }
.retention-scroll[hidden] { display: none; }
/* Six columns, each stacking a second line, so the whole row fits beside the
   test panel without scrolling sideways: who, health, activity, where they
   came from (lane over source, campaign over term), and money. Under 560px
   it becomes one card per account. */
.admin-view .retention-table { min-width: 640px; }
.retention-attr-filters { padding-top: 0; }
.retention-table thead th { white-space: normal; vertical-align: bottom; }
.retention-table td > span.retention-attr, .retention-table td > span.retention-attr-sub {
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.retention-table td > span.retention-attr.is-none { color: var(--c-ink-3); }
.retention-table td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; white-space: normal; color: var(--c-ink); }
.retention-table td.retention-cell-name { width: 20%; min-width: 120px; }
.retention-table td.retention-cell-health { min-width: 120px; }
.retention-table td.retention-cell-balance { text-align: right; padding-right: 0; white-space: nowrap; }
.retention-table td > span:not(.retention-badge) { display: block; }
.retention-table td > span.retention-sub { margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--c-ink-3); white-space: nowrap; }
.retention-table td > span.retention-failed { color: var(--c-alarm-ink); }
.retention-name { display: block; margin: 0; padding: 0; min-height: 0; border: 0; background: none; text-align: left;
  font: 600 13.5px/1.4 var(--sans); color: var(--c-ink); cursor: pointer; border-bottom: 1px dashed transparent; overflow-wrap: anywhere; }
.retention-name:hover { background: none; border-bottom-color: var(--c-line-strong); transform: none; }
.retention-name:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; border-radius: 2px; }
.retention-why { max-width: 56ch; margin: 7px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--c-ink-2); text-wrap: pretty; }
#retention-evaluated[data-stale=true] { color: var(--c-open-ink); }
@container (max-width: 560px) {
  .retention-tiles { gap: 8px; }
  .retention-tile { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 4px; }
  .retention-tile-n { grid-row: auto; font-size: 26px; }
  .retention-tile-help { display: none; }
  /* One card per account: the name and its health first, then the two
     figures side by side under their labels. */
  .admin-view .retention-table { min-width: 0; }
  .retention-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .retention-table tbody { display: block; }
  .retention-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
    padding: 16px 0; border-bottom: 1px solid var(--c-line); }
  .retention-table tr:last-child { border-bottom: 0; }
  .retention-table td, .retention-table td.retention-cell-name { display: block; width: auto; min-width: 0; padding: 0; border: 0; }
  .retention-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px;
    font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-3); }
  .retention-table td.retention-cell-name, .retention-table td.retention-cell-health { grid-column: 1 / -1; }
  .retention-table td.retention-cell-balance { text-align: left; }
  .retention-table td > span.retention-attr, .retention-table td > span.retention-attr-sub {
    max-width: none; white-space: normal; overflow-wrap: anywhere; }
  /* An account with no campaign does not get a dash on a phone. */
  .retention-table td.retention-cell-attr.is-empty { display: none; }
  .retention-why { max-width: none; }
}

/* Cohorts. One row per week or month of customers, one column per period
   since. The grid is a single hue: ink mixed into the surface by --shade
   (set per cell from the percent), so no colour here is new. Below 70% the
   tint is at most half ink and the number stays ink; from 70% the cell is
   dark and the number turns to the surface colour. Both hold 4.5:1. */
.retention-views { margin-bottom: 20px; }
.retention-cohort-scroll { position: relative; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
.retention-cohort-scroll[hidden] { display: none; }
.retention-cohort-scroll:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; border-radius: 6px; }
.retention-cohort-grid { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.retention-cohort-caption, .retention-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* "Week" over its number when twelve columns share a narrow card. */
.retention-cohort-grid thead th { padding: 0 2px 6px; font-size: 10px; font-weight: 600; line-height: 1.35; letter-spacing: .05em;
  text-transform: uppercase; text-align: center; vertical-align: bottom; color: var(--c-ink-3); }
.retention-cohort-grid thead th:first-child { text-align: left; padding-left: 0; }
/* The cohort column stays put while the periods scroll under it. */
.retention-cohort-grid :is(thead th:first-child, th[scope=row]) { position: sticky; left: 0; z-index: 1; background: var(--c-surface); }
.retention-cohort-grid th[scope=row] { width: 1%; min-width: 124px; padding: 2px 12px 2px 0; text-align: left; white-space: nowrap;
  font: 600 12.5px/1.35 var(--sans); color: var(--c-ink); }
.retention-cohort-grid th[scope=row] small { display: block; font-size: 11.5px; font-weight: 400; color: var(--c-ink-3); }
.retention-cohort-grid th[scope=row], .retention-cohort-grid th[scope=row] small { letter-spacing: 0; text-transform: none; }
.admin-view .retention-cohort { display: block; margin: 0; padding: 0; min-height: 0; border: 0; background: none; text-align: left;
  font: inherit; color: var(--c-ink); cursor: pointer; border-bottom: 1px dashed var(--c-line-strong); }
.retention-cohort:hover { background: none; border-bottom-color: var(--c-ink-3); transform: none; }
.retention-cohort:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; border-radius: 2px; }
.retention-cohort[aria-expanded=true] { border-bottom: 1px solid var(--c-ink); }
/* `position: relative` keeps each cell's screen-reader text inside the
   scrolling box; without it the page itself would grow sideways. */
.retention-cohort-grid td { position: relative; min-width: 38px; height: 38px; padding: 0 4px; border-radius: 6px; text-align: center;
  color: var(--c-ink); background: var(--c-sunk);
  background: color-mix(in srgb, var(--c-ink) calc(var(--shade, 0) * 1%), var(--c-surface)); }
.retention-cohort-grid td.is-strong { color: var(--c-surface); }
.retention-cohort-grid td.is-zero { color: var(--c-ink-3); box-shadow: inset 0 0 0 1px var(--c-line); }
.retention-cohort-grid td.is-blank { background: none; }
.retention-cohort-grid tfoot :is(th, td) { border-top: 6px solid var(--c-surface); }
.retention-cohort-grid tfoot th[scope=row] { font-weight: 600; }
/* The funnel (Admin → Marketing → Funnel): counts in a table, each step's
   rate under its count, the group column pinned while the steps scroll. */
.funnel-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.funnel-table :is(th, td) { padding: 10px 0 10px 12px; border-bottom: 1px solid var(--c-line); text-align: right;
  vertical-align: top; white-space: nowrap; }
.funnel-table thead th { padding-top: 0; padding-bottom: 8px; font-size: 10px; font-weight: 600; line-height: 1.35; letter-spacing: .05em;
  text-transform: uppercase; color: var(--c-ink-3); vertical-align: bottom; white-space: normal; min-width: 48px;
  border-bottom-color: var(--c-line-strong); }
.funnel-table :is(thead th:first-child, th[scope=row]) { position: sticky; left: 0; z-index: 1; padding-left: 0; padding-right: 14px;
  text-align: left; background: var(--c-surface); }
.funnel-table th[scope=row] { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font: 600 13px/1.4 var(--sans);
  letter-spacing: -.005em; text-transform: none; color: var(--c-ink); }
.funnel-table th[scope=row].is-none { font-weight: 500; color: var(--c-ink-3); }
.funnel-n { display: block; color: var(--c-ink); }
.funnel-table small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--c-ink-3); }
.funnel-table tfoot :is(th, td) { border-bottom: 0; border-top: 1px solid var(--c-line-strong); }
.funnel-table tfoot .funnel-n { font-weight: 600; }
.retention-members { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ui-sep); }
.retention-members[hidden] { display: none; }
.retention-members h4 { margin: 0 0 4px; font: 600 14px/1.4 var(--sans); letter-spacing: -.01em; }
.retention-members .use-note { margin: 0 0 8px; }
.retention-members ul { list-style: none; margin: 0; padding: 0; }
.retention-member { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr) minmax(64px, auto) minmax(0, 1.1fr);
  align-items: center; gap: 6px 16px; padding: 11px 0; border-top: 1px solid var(--c-line); font-size: 13px; }
.retention-member:first-child { border-top: 0; }
.retention-member .retention-badge { justify-self: start; }
.retention-member-stage { color: var(--c-ink-2); }
.retention-member-hits { color: var(--c-ink-3); font-variant-numeric: tabular-nums; text-align: right; }
@container (max-width: 560px) {
  .retention-cohort-grid th[scope=row] { min-width: 108px; padding-right: 8px; }
  .retention-cohort-grid td { min-width: 44px; }
  .retention-member { grid-template-columns: minmax(0, 1fr) auto; }
  .retention-member-hits { grid-column: 1 / -1; text-align: left; }
}

/* One account, in the shared modal (THE MODAL in app.css). */
.retention-detail-status { margin: 0; font-size: 13px; color: var(--c-ink-3); }
.retention-detail-status:empty { display: none; }
.retention-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 24px; margin: 6px 0 0; }
.retention-facts dt { margin: 0 0 4px; font-size: 11.5px; color: var(--c-ink-3); }
.retention-facts dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--c-ink); overflow-wrap: anywhere; }
.retention-section { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--ui-sep); }
.retention-internal { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; margin: 0 0 18px; background: var(--ui-fill-2); border-radius: 10px; }
.retention-internal strong { font-size: 13px; font-weight: 600; }
.retention-internal .use-note { margin: 3px 0 0; }
.retention-viewas { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; margin: 0 0 18px; background: var(--ui-fill-2); border-radius: 10px; }
.retention-viewas[hidden] { display: none; }
.retention-viewas strong { font-size: 13px; font-weight: 600; }
.retention-viewas .use-note { margin: 3px 0 0; overflow-wrap: anywhere; }
.retention-viewas-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.retention-viewas-actions [hidden] { display: none; }
.retention-internal-status:empty { display: none; }
.retention-internal-status { margin: -10px 0 16px; }
.retention-show-internal { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 40px; margin: 0; font-size: 12px; color: var(--c-ink-2); white-space: nowrap; }
.retention-internal-tag { display: inline-block; margin-top: 4px; padding: 2px 6px; border-radius: 5px; background: var(--ui-fill-2); color: var(--c-ink-3); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.retention-section h3 { margin: 0 0 10px; font: 600 14px/1.4 var(--sans); letter-spacing: -.01em; }
.retention-section .use-note { margin: -4px 0 12px; }
.retention-signal { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: start; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--c-line); }
.retention-signal:first-child { border-top: 0; padding-top: 2px; }
.retention-signal .retention-badge { justify-self: start; }
.retention-signal p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--c-ink); }
.retention-signal p.retention-evidence { margin-top: 3px; font-size: 12px; color: var(--c-ink-3); }
.retention-signal p.retention-evidence:empty { display: none; }
.retention-none { margin: 0; padding: 6px 0; font-size: 13px; color: var(--c-ink-3); }
.retention-timeline { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; }
.retention-timeline li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 14px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--c-line); font-size: 13px; }
.retention-timeline li:first-child { border-top: 0; }
.retention-timeline li.retention-none { display: block; }
.retention-time { color: var(--c-ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.retention-event { min-width: 0; color: var(--c-ink); }
.retention-event small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--c-ink-3); overflow-wrap: anywhere; }
.retention-count { color: var(--c-ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.retention-daily th[scope=row] { position: sticky; left: 0; z-index: 1; padding-right: 16px; background: var(--c-surface);
  font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-ink); border-bottom: 1px solid var(--c-line); }
.retention-daily thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--c-surface); }
.retention-daily td.retention-zero { color: var(--c-ink-3); }
@media (max-width: 640px) {
  .retention-signal { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .retention-timeline { max-height: none; }
  .retention-timeline li { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .retention-time { grid-column: 1 / -1; }
}

/* ── Admin → Usage ───────────────────────────────────────────────────────────
   One report, read top to bottom: the range, five products, a day-by-day
   chart, then the companies. Console colours only — ink and warm-grey steps
   tell series apart, and the alarm red means a failure and nothing else. */
.ur-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 12px; }
.ur-head-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ur-internal { font-size: 13px; color: var(--c-ink-2); }
.ur-status { margin: 0 0 18px; min-height: 1.5em; font-size: 12.5px; line-height: 1.5; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.admin-view .ur-retry { padding: 0; min-height: 0; font-size: inherit; color: var(--c-ink); text-decoration: underline; text-underline-offset: 2px; }
.ur-banner { margin: -6px 0 18px; padding: 12px 14px; border-radius: 10px; background: var(--ui-fill-2); color: var(--c-ink-2);
  font-size: 13px; line-height: 1.55; text-wrap: pretty; box-shadow: inset 3px 0 0 var(--c-ink-3); }
/* Refetching keeps the frame: the last report stays, quieter, until the next. */
#adminpanel-usage :is(.ur-tiles, .card) { transition: opacity 160ms var(--ease-out); }
#adminpanel-usage.ur-loading :is(.ur-tiles, .card) { opacity: .55; }

.ur-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 12px; }
.ur-tile { display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "name" "figure" "spark" "money" "meta"; align-content: start;
  margin: 0; padding: 14px 14px 13px; min-height: 0; min-width: 0; text-align: left; border: 0; border-radius: 14px;
  background: var(--c-surface); box-shadow: var(--ui-card); color: var(--c-ink); cursor: pointer; font: inherit;
  transition: box-shadow 160ms var(--ease-out), transform 120ms var(--ease-out); }
.ur-tile:active { transform: scale(0.98); }
.ur-tile:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; }
.ur-tile[aria-pressed=true] { box-shadow: var(--ui-card), inset 0 0 0 1.5px var(--c-ink); }
.ur-tile-name { grid-area: name; font-size: 12.5px; font-weight: 600; line-height: 1.35; color: var(--c-ink-2); letter-spacing: -.005em; }
.ur-tile-figure { grid-area: figure; display: flex; flex-direction: column; min-width: 0; }
.ur-tile-n { margin-top: 8px; font: 650 26px/1.05 var(--sans); letter-spacing: -.035em; color: var(--c-ink); }
.ur-tile-noun, .ur-tile-sec { font-size: 12px; line-height: 1.45; color: var(--c-ink-3); overflow-wrap: anywhere; }
.ur-tile-noun { margin-top: 4px; }
.ur-spark { grid-area: spark; display: block; width: 100%; height: 26px; margin: 12px 0 10px; overflow: visible; }
.ur-spark rect { fill: var(--c-ink-3); }
.ur-spark rect.ur-spark-base { fill: var(--c-line-strong); }
.ur-tile[aria-pressed=true] .ur-spark rect:not(.ur-spark-base) { fill: var(--c-ink); }
.ur-tile-money { grid-area: money; font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ur-tile-meta { grid-area: meta; display: flex; flex-direction: column; margin-top: 2px; font-size: 12px; line-height: 1.45; color: var(--c-ink-3); }
.ur-tile-fail { color: var(--c-alarm-ink); font-weight: 500; }
.ur-tile-partial { color: var(--c-ink-2); }
.ur-tile.is-unavailable :is(.ur-tile-n, .ur-tile-money) { color: var(--c-ink-3); }
/* A focused product: the others step back a little, so the page reads as being about one thing. */
.ur-tiles.has-focus .ur-tile[aria-pressed=false] :is(.ur-tile-figure, .ur-spark, .ur-tile-money) { opacity: .5; }
.ur-tiles.has-focus .ur-tile :is(.ur-tile-figure, .ur-spark, .ur-tile-money) { transition: opacity 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ur-tile:hover { box-shadow: var(--ui-card), 0 6px 18px rgba(27, 26, 22, 0.06); }
  .ur-tile[aria-pressed=true]:hover { box-shadow: var(--ui-card), inset 0 0 0 1.5px var(--c-ink), 0 6px 18px rgba(27, 26, 22, 0.06); }
  .ur-tiles.has-focus .ur-tile[aria-pressed=false]:hover :is(.ur-tile-figure, .ur-spark, .ur-tile-money) { opacity: .8; }
}
.ur-tile.is-skeleton { cursor: default; box-shadow: var(--ui-card); }
.ur-sk { display: block; height: 10px; margin-top: 8px; width: 62%; border-radius: 4px; background: var(--ui-fill-2); }
.ur-sk-n { height: 24px; width: 46%; margin-top: 10px; }
.ur-sk-spark { height: 26px; width: 100%; margin-top: 14px; }
.ur-inside { margin: 0 0 20px; font-size: 12px; line-height: 1.55; color: var(--c-ink-3); max-width: 86ch; text-wrap: pretty; }

.admin-panel .card.ur-chart-card, .admin-panel .card.ur-companies { margin: 0 0 20px; }
.ur-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin: 0 0 18px; }
.ur-card-head h3 { margin: 0 0 4px; }
.ur-card-head .use-note { margin: 0; }
.ur-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-top: 3px; font-size: 12px; color: var(--c-ink-2); }
.ur-legend:empty { display: none; }
.ur-key { display: inline-flex; align-items: center; gap: 6px; }
.ur-sw { width: 10px; height: 10px; border-radius: 2px; }
.ur-sw-fail { width: 7px; height: 7px; border-radius: 50%; background: var(--c-alarm); }
/* Series tones, darkest first. Fixed per channel, never per rank. */
#adminpanel-usage .tone-0 { background: var(--c-ink); }
#adminpanel-usage .tone-1 { background: var(--c-ink-3); }
#adminpanel-usage .tone-2 { background: var(--c-ink-4); }
#adminpanel-usage .tone-3 { background: var(--c-line-strong); }

.ur-chart { --ur-gutter: 48px; position: relative; }
.ur-plot { position: relative; height: 188px; border-radius: 6px; }
.ur-plot:focus { outline: none; }
.ur-plot:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 6px; }
.ur-grid { position: absolute; inset: 0; pointer-events: none; }
.ur-gl { position: absolute; left: var(--ur-gutter); right: 0; height: 0; border-top: 1px solid var(--c-line); }
.ur-gl.is-base { border-top-color: var(--c-line-strong); }
.ur-gl span { position: absolute; right: calc(100% + 10px); top: 0; transform: translateY(-50%); font-size: 11px;
  line-height: 1; color: var(--c-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ur-cols { position: absolute; left: var(--ur-gutter); right: 0; top: 0; bottom: 0; display: flex; align-items: stretch; }
.ur-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.ur-col.on { background: var(--ui-fill-2); }
/* The day being read stays; the rest step back. */
.ur-stack, .ur-failmark { transition: opacity 120ms var(--ease-out); }
.ur-cols.has-on .ur-col:not(.on) :is(.ur-stack, .ur-failmark) { opacity: .35; }
.ur-stack { display: flex; flex-direction: column-reverse; gap: 2px; width: min(24px, 64%); min-width: 1px; }
.ur-seg { display: block; flex: 0 0 0; min-height: 1px; }
.ur-stack > .ur-seg:last-child { border-radius: 3px 3px 0 0; }
.ur-plot.is-dense .ur-stack { width: calc(100% - 1px); gap: 1px; }
.ur-plot.is-dense .ur-stack > .ur-seg:last-child { border-radius: 1px 1px 0 0; }
.ur-failmark { position: absolute; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: var(--c-alarm); box-shadow: 0 0 0 2px var(--c-surface); }
.ur-plot.is-dense .ur-failmark { width: 5px; height: 5px; margin-left: -2.5px; }
.ur-plot-empty { position: absolute; left: var(--ur-gutter); right: 0; top: 42%; margin: 0; text-align: center; font-size: 13px; color: var(--c-ink-3); pointer-events: none; }
.ur-xaxis { position: relative; height: 16px; margin: 9px 0 0 var(--ur-gutter); }
.ur-xaxis span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; line-height: 16px; color: var(--c-ink-3);
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.ur-xaxis span.is-end { left: auto !important; right: 0; transform: none; }
.ur-tip { position: absolute; top: 2px; z-index: 2; min-width: 150px; max-width: 230px; padding: 10px 12px 11px; border-radius: 10px;
  background: var(--c-surface); box-shadow: var(--ui-float); pointer-events: none; font-size: 12px; line-height: 1.4;
  opacity: 1; transition: opacity 120ms var(--ease-out); }
@starting-style { .ur-tip { opacity: 0; } }
.ur-tip[data-side=left] { transform: translateX(-100%); }
.ur-tip-day { margin: 0; font-size: 11.5px; color: var(--c-ink-3); }
.ur-tip-total { margin: 2px 0 0; font: 650 15px/1.3 var(--sans); letter-spacing: -.01em; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ur-tip-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 18px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--ui-sep); }
.ur-tip-list dt { display: flex; align-items: center; gap: 6px; color: var(--c-ink-3); }
.ur-tip-list dd { margin: 0; text-align: right; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.ur-tip-list .is-zero { color: var(--c-ink-3); }
.ur-tip-list .is-fail { color: var(--c-alarm-ink); }
.ur-tip-key { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.ur-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The companies: one row each, sortable, a muted dash where a product is not
   used so "who uses what" reads straight down a column. */
/* Wider than its card (a narrow window, or the twelve-column Agents view):
   it scrolls in place, the company column stays put, and a soft edge on the
   right says there is more. */
.ur-scroll, .ulog-scroll { position: relative; overscroll-behavior-x: contain;
  background: linear-gradient(to left, var(--c-surface) 40%, rgba(255, 255, 255, 0)) right center / 32px 100% no-repeat local,
              radial-gradient(farthest-side at 100% 50%, rgba(27, 26, 22, 0.10), rgba(27, 26, 22, 0)) right center / 12px 100% no-repeat scroll; }
.ur-scroll[hidden] { display: none; }
/* Sentence-case headers, as on the model pages: narrower than the ledger's
   small caps, so a nine-column table still fits beside the test panel. */
.ur-table th, .ulog-table th { padding-bottom: 9px; border-bottom-color: var(--ui-sep); font-size: 12px; font-weight: 500;
  letter-spacing: 0; text-transform: none; color: var(--c-ink-3); white-space: nowrap; vertical-align: bottom; }
.ur-table td, .ulog-table td { border-bottom-color: var(--ui-sep); }
.ur-table th.r { padding-right: 0; }
.admin-view .ur-sort { display: inline-flex; align-items: center; gap: 3px; margin: 0; padding: 0; min-height: 0; border: 0; background: none;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.admin-view .ur-sort:active { transform: none; }
.ur-sort:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 3px; border-radius: 2px; }
.ur-table th:is([aria-sort=ascending], [aria-sort=descending]) { color: var(--c-ink); }
.ur-table th[aria-sort=descending] .ur-sort::after { content: "↓"; }
.ur-table th[aria-sort=ascending] .ur-sort::after { content: "↑"; }
.ur-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.ur-table td.r, .ur-table th.r { padding-left: 14px; }
.ur-table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--c-surface); }
.ur-table td.ur-who, .ur-table th.ur-who { min-width: 118px; max-width: 168px; white-space: normal; padding-right: 10px; }
.admin-view .ur-name { display: block; max-width: 100%; min-height: 0; padding: 0; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.admin-view :is(.ur-table, .ur-facts) .u-capval { min-height: 0; }
.admin-view .ur-table :is(.ur-name, .u-capval):hover { color: var(--c-ink); border-bottom-color: var(--c-ink-3); }
.ur-name:focus-visible, .ur-table .u-capval:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; border-radius: 2px; }
.ur-keys { display: block; margin-top: 2px; font: 11px/1.45 var(--mono); color: var(--c-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ur-v { display: block; color: var(--c-ink); font-weight: 500; }
.ur-u { display: block; margin-top: 2px; font-size: 11.5px; color: var(--c-ink-3); white-space: nowrap; }
.ur-f, .ur-red { color: var(--c-alarm-ink); }
.ur-f { display: block; margin-top: 2px; font-size: 11.5px; white-space: nowrap; }
.ur-dash { color: var(--c-ink-3); }
.ur-na { font-size: 11.5px; color: var(--c-ink-3); font-style: italic; }
.ur-ago { color: var(--c-ink-3); white-space: nowrap; }
.ur-table :is(td.ur-ago, th[data-col=last]) { padding-left: 20px; }
.ur-table .ur-cap { white-space: nowrap; }
.ur-row { cursor: pointer; }
.ur-row:focus { outline: none; }
.ur-row:focus-visible td { box-shadow: inset 0 2px 0 var(--c-ink-3), inset 0 -2px 0 var(--c-ink-3); }
@media (hover: hover) and (pointer: fine) { .ur-row:hover td { background: var(--c-sunk); } }
.ur-total td { border-top: 1px solid var(--c-line-strong); border-bottom: 0; padding-top: 12px; font-weight: 600; color: var(--c-ink); }
.ur-total .ur-v { font-weight: 650; }
.ur-idle { margin: 14px 0 0; }
.admin-view .ur-idle .linkbtn { padding: 0; min-height: 0; font-size: inherit; color: var(--c-ink); text-decoration: underline; text-underline-offset: 2px; }
.ur-idle-names { color: var(--c-ink-2); }
.ur-notes { margin: 0 0 8px; padding: 0 0 0 18px; font-size: 12px; line-height: 1.6; color: var(--c-ink-3); }
.ur-notes li + li { margin-top: 4px; }

/* One company, in THE MODAL. */
.ur-facts { margin-top: 2px; }
.ur-days th[scope=row] { position: sticky; left: 0; z-index: 1; padding-right: 16px; background: var(--c-surface); font-size: 12.5px;
  font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-ink); white-space: nowrap; border-bottom: 1px solid var(--c-line); }
.ur-days thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--c-surface); }
.ur-days th, .ur-days thead th { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-ink-3);
  border-bottom-color: var(--ui-sep); padding-left: 20px; }
.ur-days thead th:first-child { padding-left: 0; }
.ur-days td { vertical-align: top; padding-left: 20px; border-bottom-color: var(--ui-sep); }
.ur-days tbody th[scope=row] { vertical-align: top; padding: 9px 24px 9px 0; border-bottom-color: var(--ui-sep); }
.ur-days :is(th, td) { line-height: 1.45; }
.ur-days :is(td, thead th).r { padding-left: 32px; }
.ur-days td small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--c-ink-3); white-space: nowrap; }
.ur-days td small .ur-red { color: var(--c-alarm-ink); }
.ur-days td.is-zero { color: var(--c-ink-3); }
.ur-days .is-focus { background: var(--ui-fill-2); }
.ur-days th.is-focus { color: var(--c-ink); }

@container (max-width: 640px) {
  .ur-tiles { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ur-tile { grid-template-columns: minmax(0, 1fr) 104px; column-gap: 16px; padding: 13px 14px;
    grid-template-areas: "name money" "figure spark" "meta spark"; }
  .ur-tile-money { text-align: right; }
  .ur-tile-figure { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin-top: 6px; }
  .ur-tile-n { margin: 0; font-size: 22px; }
  .ur-tile-noun { margin: 0; }
  .ur-tile-sec::before { content: "· "; }
  .ur-tile-sec:empty { display: none; }
  .ur-spark { align-self: center; margin: 4px 0 0; height: 30px; }
  .ur-tile-meta { flex-direction: row; flex-wrap: wrap; column-gap: 6px; margin-top: 3px; }
  .ur-tile-meta > span + span::before { content: "· "; color: var(--c-ink-3); }
  .ur-chart { --ur-gutter: 40px; }
  .ur-plot { height: 150px; }
  .ur-tip { min-width: 136px; }
  .ur-head { align-items: flex-start; }
}
@media (max-width: 760px) {
  .ur-head .use-range { flex: 1 1 100%; }
  .ur-head .use-r { flex: 1; }
  .ur-head-tools { flex: 1 1 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .ur-tile, .ur-tip, .ur-stack, .ur-failmark, #adminpanel-usage :is(.ur-tiles, .card), .ur-tiles .ur-tile * { transition: none; }
  .ur-tile:active { transform: none; }
}
@media (prefers-contrast: more) {
  .ur-tile { box-shadow: none; border: 1px solid var(--c-ink-3); }
  .ur-tile[aria-pressed=true] { outline: 2px solid var(--c-ink); outline-offset: -2px; }
}

/* ── Admin → Logs ────────────────────────────────────────────────────────────
   Every product's requests in one table. A row is the keyboard stop; speech
   rows open the speech inspector, the rest open their details in place. */
.ulog-products { display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 0 2px; }
.admin-view .ulog-products button { min-height: 32px; margin: 0; padding: 6px 13px; border: 0; border-radius: 999px;
  background: var(--ui-fill-2); color: var(--c-ink-2); font-size: 12.5px; font-weight: 500; }
.admin-view .ulog-products button[aria-pressed=true] { background: var(--c-ink); color: var(--c-surface); }
.ulog-products button:focus-visible { outline: 2px solid var(--c-ink-3); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .admin-view .ulog-products button[aria-pressed=false]:hover { background: var(--ui-fill-3); color: var(--c-ink); }
}
.admin-requests .use-head > div { flex: 1 1 340px; }
.admin-requests .use-head > button { flex: none; }
/* Seven columns that fit beside the test panel: What takes the room that is
   left and ellipsises; a phone scrolls the table in place instead. */
@container (max-width: 440px) {
  .admin-view .ulog-table { min-width: 560px; }
  /* Scrolling sideways on a phone: the time stays put, and carries the
     state as a dot because Status may be off-screen. */
  .ulog-table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--c-surface);
    box-shadow: inset 0 -1px 0 var(--ui-sep); }
}
/* A sticky cell paints over a collapsed border; draw its rule itself. */
.ur-table tbody td:first-child, .ur-table thead th:first-child { box-shadow: inset 0 -1px 0 var(--ui-sep); }
.ulog-table td { vertical-align: top; padding-top: 11px; padding-bottom: 11px; font-size: 12.5px; }
.ulog-table :is(th, td) { padding-left: 12px; padding-right: 0; }
.ulog-time { position: relative; color: var(--c-ink-3); white-space: nowrap; }
.ulog-table :is(td, th):first-child { padding-left: 0; }
.ulog-dot { display: none; position: absolute; left: 2px; top: 17px; width: 6px; height: 6px; border-radius: 50%; }
.ulog-dot.is-failed { background: var(--c-alarm); }
.ulog-dot.is-running { box-shadow: inset 0 0 0 1.5px var(--c-ink-3); }
.ulog-ws { max-width: 9em; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--c-ink); }
.ulog-sub { display: block; margin-top: 2px; font-size: 11.5px; color: var(--c-ink-3); }
.stm-table td.ulog-what { width: 100%; max-width: 0; white-space: normal; }
.ulog-kind { display: block; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: var(--c-ink-3); }
.ulog-subject { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink); }
.ulog-error { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--c-alarm-ink); }
.ulog-table .is-muted { color: var(--c-ink-3); }
.ulog-state { font-size: 11.5px; font-weight: 500; color: var(--c-ink-2); white-space: nowrap; }
.ulog-state.is-failed { color: var(--c-alarm-ink); }
.ulog-state.is-failed::before { content: "\25CF\00a0"; font-size: 8px; vertical-align: 1px; }
.ulog-state.is-running::before { content: "\25CC\00a0"; }
.ulog-idpair code { font: 12px/1.45 var(--mono); color: var(--c-ink); overflow-wrap: anywhere; }
.admin-view .ulog-copy { margin-left: 4px; padding: 0; min-height: 0; font-size: 12px; color: var(--c-ink-2);
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.admin-view .ulog-copy:hover { color: var(--c-ink); }
.ulog-click { cursor: pointer; }
.ulog-row:focus { outline: none; }
.ulog-row:focus-visible td { box-shadow: inset 0 2px 0 var(--c-ink-3), inset 0 -2px 0 var(--c-ink-3); }
@media (hover: hover) and (pointer: fine) { .ulog-click:hover td { background: var(--c-sunk); } }
.ulog-row.sel td, .ulog-row[aria-expanded=true] td { background: var(--c-sunk); }
.ulog-row.sel td:first-child { box-shadow: inset 2px 0 0 var(--c-ink), inset 0 -1px 0 var(--ui-sep); }
.ulog-row[aria-expanded=true] td { border-bottom-color: transparent; }
.ulog-table .ulog-row[aria-expanded=true] td:first-child { box-shadow: none; }
.ulog-table .ulog-more td { position: static; padding: 2px 0 16px; background: var(--c-sunk); box-shadow: inset 0 -1px 0 var(--ui-sep); white-space: normal; }
/* Pinned to the visible part of the scroller, however far the table is scrolled. */
.ulog-facts { position: sticky; left: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 24px;
  width: min(100%, calc(100vw - 64px)); margin: 0; padding: 6px 14px 0; box-sizing: border-box; }
.ulog-facts > div { min-width: 0; }
.ulog-facts dt { margin: 0 0 2px; font-size: 11px; color: var(--c-ink-3); }
.ulog-facts dd { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--c-ink); overflow-wrap: anywhere; }
@container (max-width: 440px) {
  .ulog-table :is(.ulog-row > td, thead th):first-child { padding-left: 14px; }
  .ulog-dot { display: block; }
}
/* Beside the test panel on a 1280 screen: Latency rides under Usage and the
   gutters narrow, so all of it — Status included — fits without scrolling. */
.ulog-lat2 { display: none; margin-top: 2px; font-size: 11.5px; color: var(--c-ink-3); }
@container (min-width: 441px) and (max-width: 640px) {
  .ulog-table .ulog-latcol { display: none; }
  .ulog-lat2 { display: block; }
  .ulog-table :is(th, td) { padding-left: 10px; }
  .ulog-table :is(td, th):first-child { padding-left: 0; }
  .ulog-ws { max-width: 7.5em; }
}

/* Guest passes, apart from the brands (views.js · paintGuests). */
.admin-guests[hidden] { display: none; }
.admin-guests { margin: 0 0 12px; }
.admin-guest-list summary { cursor: pointer; font-size: 12.5px; color: var(--c-ink-2); }
.admin-guest-list .guest-row { margin: 4px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
