/* ==========================================================================
   GLOBAL-OS — shared/ds.css  (the redesign, .pf-*)
   Plain CSS, custom properties, no build step. Replaces shared/base.css once
   every page has moved over; until then each page links one or the other.

   The look: a black canvas (warm paper in the light theme), ONE action colour,
   one warm "needs you" colour, weight-400 display type that gets its hierarchy
   from scale, pill buttons, hairlines instead of boxes, no gradients. Motion is
   reserved for the sign-in scene and the hub (shared/constellation.js).

   Colour has jobs, not decoration:
     --accent    cyan #5EC7EB  = "you can act on this": filled buttons, focus, selection
     --highlight yellow        = "this changed / needs you": edited cells, staged rows, eyebrows
     --commit    white (dark) / black (light) = the irreversible write to another system
     --ink / --bg              = structure and ground

   Every class name and token name of base.css is kept, so a page moves over by
   swapping one <link>. Theme: light by default (<html data-theme="light">), dark on a choice.

   0. Tokens (dark) · 1. Light theme · 2. Base · 3. Chrome · 4. Type · 5. Surfaces
   6. Hub + gate · 7. Buttons · 8. Forms · 9. Tables · 10. Status · 11. Feedback
   12. Overlays · 13. Utilities + motion · 14. Print · 15. DOM reality notes
   ========================================================================== */


/* ==== BEGIN SHARED TOKENS ================================================ */
:root {
  color-scheme: dark;

  /* Brand core: Initiative's colours. */
  --primary:   #5EC7EB;
  --secondary: #FFFF99;
  --accent:    #5EC7EB;
  --bg:        #000000;
  --ink:       #FFFFFF;

  /* Surfaces & ink. The canvas is black; one raised level for controls, panels and overlays. */
  --surface:     #0C0C0D;
  --surface-2:   #161618;
  --surface-3:   #212124;
  --line:        #232326;
  --line-strong: #3A3A3E;
  --ink-2:       #BDBDBD;   /* secondary text, 11.5:1 on --bg */
  --ink-3:       #9A9A9A;   /* labels, meta, placeholders, 7.4:1 on --bg */

  /* Interaction (accent family) */
  --link:         #5EC7EB;
  --accent-hover: #86D6F1;
  --accent-press: #3DB4DE;
  --accent-tint:  #0D2A33;  /* selected rows, focus wash */
  --accent-edge:  #5EC7EB;  /* border of a filled button: the fill itself on black */
  --on-accent:    #000000;  /* black on cyan, 10.8:1 */

  /* Information (primary family) */
  --primary-tint: #0D2A33;
  --primary-ink:  #9FE0F5;

  /* Attention: "you touched this" */
  --highlight:     #2B2B12;
  --highlight-ink: #FFFF99;
  --eyebrow-ink:   #FFFF99;
  --eyebrow-bg:    transparent;
  --eyebrow-pad:   0;

  /* Irreversible commit (writes to an external system: CM360, finance) */
  --commit-bg:    #FFFFFF;
  --commit-ink:   #000000;
  --commit-hover: #E8E8E8;
  --commit-press: #D2D2D2;

  /* Page chrome: the header sits on the canvas */
  --chrome:       #000000;
  --chrome-ink:   #FFFFFF;
  --chrome-ink-2: #9A9A9A;
  --chrome-line:  #1E1E21;
  --logo-filter:  none;

  /* Semantic states: base = solid/icon, tint = fill, ink = text on tint */
  --ok:   #3DDC97;  --ok-tint:   #0E2A1E;  --ok-ink:   #7BE8B5;  --on-ok: #000000;
  --warn: #FFB547;  --warn-tint: #33240A;  --warn-ink: #FFCD80;  --on-warn: #000000;
  --bad:  #FF6B5E;  --bad-tint:  #3A1411;  --bad-ink:  #FF9C92;  --on-bad: #000000;
  --info: var(--primary); --info-tint: var(--primary-tint); --info-ink: var(--primary-ink);
  --neutral-tint: #1A1A1C;  --neutral-ink: #BDBDBD;

  /* Data viz, categorical, use in order. Plain 6-digit hex: PMax appends alpha as text. */
  --viz-1: #5EC7EB;  --viz-2: #2196F3;  --viz-3: #F5F2EE;  --viz-4: #FFB547;
  --viz-5: #FF6B5E;  --viz-6: #3DDC97;  --viz-7: #B3A6F0;
  --viz-planned: #5A5A5E;
  --viz-grid: #232326;

  /* Type: one family. Hierarchy from scale and tracking, not weight. */
  --font-display: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 11px;    /* labels (caps), pills, counts */
  --fs-sm: 13px;    /* tables, secondary UI */
  --fs-md: 14px;    /* body + controls: the default */
  --fs-lg: 17px;    /* lede */
  --fs-d3: 24px;    /* display: section heads */
  --fs-d2: 34px;    /* display: figures, modal titles */
  --fs-d1: 48px;    /* display: page titles */
  --lh: 1.5;
  --lh-tight: 1.05;
  --track-caps: .08em;
  --track-display: -.035em;

  /* Spacing: 4px grid */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  /* Shape: pills for things you press, soft corners for things you fill in, none for tables. */
  --r-0: 0;
  --r-1: 10px;
  --r-2: 16px;
  --r-round: 999px;
  --bw: 1px;

  /* Elevation: flat at rest, shadows only for things that float */
  --shadow-pop:   0 0 0 1px rgba(255,255,255,.04), 0 12px 32px -8px rgba(0,0,0,.8);
  --shadow-modal: 0 0 0 1px rgba(255,255,255,.05), 0 32px 80px -16px rgba(0,0,0,.9);
  --scrim: rgba(0,0,0,.72);

  /* Layers */
  --z-sticky: 10;  --z-top: 100;  --z-menu: 200;  --z-overlay: 300;  --z-toast: 400;

  /* Sizes */
  --top-h: 60px;
  --ctl-h: 36px;
  --ctl-h-sm: 28px;
  --row-h: 34px;
  --row-h-dense: 26px;
  --main-max: 1100px;
  --gutter: 40px;

  /* Motion */
  --dur: 160ms;
  --ease: cubic-bezier(.2,.7,.2,1);

  /* Select chevron, per theme (a data URI cannot follow currentColor) */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9A9A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* ---- COMPATIBILITY: pre-redesign token names -------------------------------
   * Tool CSS and tool JS (inline styles) still use these. They alias to var(),
   * so they follow the theme. Delete one only when
   * `grep -r "var(--<name>" apps/ shared/` is empty. */
  --body: var(--font-body);        --head: var(--font-display);
  --mono: var(--font-mono);
  --muted: var(--ink-2);           --faint: var(--ink-3);
  --accent-700: var(--link);
  --sky-050: var(--primary-tint);  --blue-050: var(--accent-tint);
  --green: var(--ok);              --green-050: var(--ok-tint);
  --red: var(--bad);               --red-050: var(--bad-tint);
  --amber: var(--warn);            --amber-050: var(--warn-tint);
  --shadow: var(--shadow-pop);
  --yellow-050: var(--highlight);
  --r: var(--r-1);
  /* Names some tools used that never existed in base.css; they fell back to light literals. */
  --text: var(--ink);  --accent-050: var(--accent-tint);  --pf-border: var(--line);
}

/* 1. LIGHT THEME: the default. Every page's <head> snippet sets <html data-theme="light">
   unless the viewer chose dark (localStorage "pf-theme" = "dark"). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F2EE;
  --ink: #000000;
  --surface: #FFFDFA;  --surface-2: #EEEAE4;  --surface-3: #E4DFD7;
  --line: #DCD6CD;     --line-strong: #B9B2A7;
  --ink-2: #46423D;    --ink-3: #6B665F;
  --link: #075A78;
  --accent-hover: #4BB9DF;  --accent-press: #36A6CE;
  --accent-tint: #DDF3FA;   --accent-edge: #000000;
  --primary-tint: #DDF3FA;  --primary-ink: #075A78;
  --highlight: #FFFF99;     --highlight-ink: #000000;
  --eyebrow-ink: #000000;   --eyebrow-bg: #FFFF99;   --eyebrow-pad: 2px 6px;
  --commit-bg: #000000;     --commit-ink: #FFFF99;
  --commit-hover: #2A2825;  --commit-press: #3D3A36;
  --chrome: #F5F2EE;        --chrome-ink: #000000;   --chrome-ink-2: #6B665F;  --chrome-line: #DCD6CD;
  --logo-filter: invert(1);
  --ok: #1E8E4E;   --ok-tint: #DDF1E3;   --ok-ink: #0D5A2C;   --on-ok: #FFFFFF;
  --warn: #E08A00; --warn-tint: #FBEACB; --warn-ink: #7A4300;
  --bad: #C8291E;  --bad-tint: #FADFDB;  --bad-ink: #9A1B12;  --on-bad: #FFFFFF;
  --neutral-tint: #E9E4DD;  --neutral-ink: #46423D;
  --viz-1: #2196F3;  --viz-2: #1F8FC4;  --viz-3: #1F2D45;  --viz-4: #E3A21A;
  --viz-5: #E0685A;  --viz-6: #5E9F80;  --viz-7: #9B8FD6;
  --viz-planned: #B9B2A7;  --viz-grid: #DCD6CD;
  --shadow-pop:   0 1px 2px rgba(0,0,0,.08), 0 8px 24px -6px rgba(0,0,0,.18);
  --shadow-modal: 0 2px 6px rgba(0,0,0,.10), 0 24px 64px -12px rgba(0,0,0,.32);
  --scrim: rgba(12,11,10,.45);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B665F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Compact density: <html data-density="compact">. For 100+ row work. */
:root[data-density="compact"] {
  --row-h: 26px;
  --ctl-h: 30px;
  --ctl-h-sm: 24px;
}
/* ==== END SHARED TOKENS ================================================== */


/* 2. BASE ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-md)/var(--lh) var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--line-strong) transparent;
}
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--secondary); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
mark { background: var(--highlight); color: var(--highlight-ink); padding: 0 2px; border-radius: 3px; }
code, kbd, samp { font-family: var(--font-mono); font-size: .9em; }
svg { flex: none; }


/* 3. PAGE CHROME ==========================================================
   shared/platform.js emits:
     <header id="pf-header" class="pf-top">
       <img class="pf-logo"> <div class="pf-divider"> <div class="pf-title">Title<small>Sub</small></div>
       <nav class="pf-nav"><a class="pf-nav-link pf-nav-active">…</a></nav>
       <a class="pf-btn pf-onaccent pf-sm">← All tools</a> <div class="pf-spacer">
       <div class="pf-user"><span class="pf-email"> … <button class="pf-theme"> <button>Sign out</button></div>
     </header> */
.pf-top {
  position: sticky; top: 0; z-index: var(--z-top);
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--top-h);
  padding: 0 var(--gutter);
  background: var(--chrome);
  color: var(--chrome-ink);
  border-bottom: 1px solid var(--chrome-line);
}
/* .pf-logo IS the <img> (389x129 natural, a white wordmark). */
.pf-logo { display: block; flex: none; height: 22px; width: auto; font-size: 0; filter: var(--logo-filter); }
.pf-logo:hover { text-decoration: none; }

.pf-top .pf-title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0; flex: none; white-space: nowrap;
  font: 500 15px/1 var(--font-body); letter-spacing: -.01em;
  color: inherit;
}
.pf-top .pf-title small {
  font: 600 10.5px/1 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--chrome-ink-2);
}
@media (max-width: 980px) { .pf-top .pf-title small { display: none; } }

.pf-nav {
  display: flex; align-items: stretch; align-self: stretch; gap: var(--sp-1);
  min-width: 0; overflow-x: auto; scrollbar-width: none;
  margin-left: var(--sp-2);
}
.pf-nav::-webkit-scrollbar { display: none; }
.pf-nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 var(--sp-3);
  color: var(--chrome-ink-2);
  font: 600 11.5px/1 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.pf-nav-link:hover { color: var(--chrome-ink); text-decoration: none; }
.pf-nav-active, .pf-nav-link.pf-nav-active { color: var(--chrome-ink); }
.pf-nav-active::after {
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 0;
  height: 2px; border-radius: 2px; background: var(--accent);
}

.pf-user {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-left: auto; white-space: nowrap; font-size: var(--fs-sm);
}
.pf-email {
  font-size: var(--fs-sm); color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
  margin-right: var(--sp-2);
}
.pf-top .pf-email { color: var(--chrome-ink-2); }
@media (max-width: 1200px) { .pf-top .pf-email { display: none; } }

/* Anything sitting in the header: quiet outlined pills. */
.pf-onaccent { color: var(--chrome-ink); }
.pf-btn.pf-onaccent { background: transparent; color: var(--chrome-ink); border-color: var(--line-strong); }
.pf-btn.pf-onaccent:hover { background: var(--surface-2); border-color: var(--ink-3); }
.pf-btn.pf-onaccent:active { background: var(--surface-3); }
.pf-theme .pf-ico { width: 15px; height: 15px; }

.pf-main {
  max-width: var(--main-max);
  margin: 0 auto;
  padding: var(--sp-10) var(--gutter) var(--sp-16);
}
.pf-main.pf-wide { max-width: none; }
@media (max-width: 1280px) { :root { --gutter: 28px; } }
@media (max-width: 640px)  { :root { --gutter: 16px; } }


/* 4. TYPE ================================================================= */
.pf-title {
  font: 400 var(--fs-d1)/var(--lh-tight) var(--font-display);
  letter-spacing: var(--track-display);
  margin: 0 0 var(--sp-3);
  text-wrap: balance;
}
.pf-lede {
  font-size: var(--fs-lg); line-height: 1.5; color: var(--ink-2);
  max-width: 64ch; margin: 0 0 var(--sp-8);
  text-wrap: pretty;
}
/* Section head draws its own hairline to the right edge. */
.pf-section-h {
  display: flex; align-items: center; gap: var(--sp-3);
  font: 400 var(--fs-d3)/1.1 var(--font-display);
  letter-spacing: -.02em;
  margin: var(--sp-12) 0 var(--sp-4);
}
.pf-section-h::after { content: ""; order: 1; flex: 1; height: 1px; background: var(--line); }
.pf-section-h > .pf-btn { order: 2; }
.pf-section-h h2 { font: inherit; letter-spacing: inherit; margin: 0; }
.pf-title + .pf-section-h, .pf-lede + .pf-section-h { margin-top: 0; }
/* In a section heading .pf-count is a sentence ("7 tools available"), not a badge. */
.pf-section-h > .pf-count {
  display: inline; min-width: 0; height: auto; padding: 0;
  background: none; border-radius: 0;
  font: 600 var(--fs-xs)/1 var(--font-body);
  letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--eyebrow-ink);
}

/* The small uppercase line above a big heading: yellow on black, highlighter on paper. */
.pf-eyebrow {
  display: inline-block; align-self: flex-start;
  padding: var(--eyebrow-pad);
  font: 600 var(--fs-xs)/1.4 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--eyebrow-ink); background: var(--eyebrow-bg);
}
.pf-figure { font: 400 var(--fs-d2)/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pf-label  { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-3); }
.pf-mono   { font-family: var(--font-mono); font-size: .9em; letter-spacing: 0; }
.pf-num    { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pf-muted  { color: var(--ink-3); }


/* 5. SURFACES ============================================================= */
.pf-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: var(--sp-6);
  min-width: 0;
}
.pf-panel + .pf-panel { margin-top: var(--sp-4); }
.pf-panel.pf-flush { padding: 0; overflow: hidden; }
.pf-panel-h {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  min-height: 52px;
  margin: calc(var(--sp-6) * -1) calc(var(--sp-6) * -1) var(--sp-5);
  padding: var(--sp-2) var(--sp-6);
  border-bottom: 1px solid var(--line);
}
.pf-panel.pf-flush > .pf-panel-h { margin: 0; }
.pf-panel-h h2, .pf-panel-h h3 { font-size: var(--fs-md); font-weight: 600; }

.pf-divider { border: 0; height: 1px; background: var(--line); margin: var(--sp-6) 0; }
.pf-top .pf-divider, .pf-user .pf-divider, .pf-toolbar .pf-divider {
  width: 1px; height: 20px; margin: 0; background: var(--line-strong); flex: none;
}
.pf-spacer { flex: 1 1 auto; }
.pf-toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }


/* 6. CARDS, HUB + GATE ====================================================
   .pf-card is a plain card: Media Plan and Naming build panels from it. The hub
   turns it into a typographic tile on the canvas in apps/hub/hub.css. */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-10) var(--sp-8);
}
.pf-card {
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-6);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}
a.pf-card { cursor: pointer; }
a.pf-card:hover { text-decoration: none; border-color: var(--line-strong); }
.pf-card-icon {
  display: block;
  width: 26px; height: 26px; margin-bottom: var(--sp-3);
  color: var(--ink-2);
  font-size: 22px; line-height: 1;
  transition: color var(--dur) var(--ease), transform 420ms var(--ease);
}
/* Icons are SVG files drawn through a mask, so they take the text colour in both themes:
   <span class="pf-card-icon pf-glyph" style="--icon:url(/shared/icons/x.svg)"></span> */
.pf-glyph {
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
a.pf-card:hover .pf-card-icon { color: var(--accent); transform: translateY(-2px); }
.pf-card-title { font: 400 24px/1.15 var(--font-display); letter-spacing: -.02em; }
.pf-card-desc { flex: 1; font-size: var(--fs-md); color: var(--ink-3); line-height: 1.55; text-wrap: pretty; max-width: 42ch; }
.pf-card-go {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--sp-3);
  font: 600 var(--fs-xs)/1 var(--font-body); letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--link);
}
.pf-card-go::after { content: "→"; font-size: 13px; letter-spacing: 0; transition: transform 240ms var(--ease); }
a.pf-card:hover .pf-card-go::after { transform: translateX(5px); }

.pf-locked { cursor: not-allowed; }
.pf-card.pf-locked { border-style: dashed; color: var(--ink-3); cursor: default; }
.pf-card.pf-locked .pf-card-title, .pf-card.pf-locked .pf-card-desc, .pf-card.pf-locked .pf-card-icon { color: var(--ink-3); }

/* The sign-in / access gate (shared/platform.js renderSignInGate + renderDeniedGate):
   <div class="pf-gate pf-panel"><span class="pf-eyebrow"><h2><p><button class="pf-btn pf-primary">
   A big statement on the canvas, the particle field behind it. */
.pf-gate, .pf-gate.pf-panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start;
  width: min(640px, 100%);
  margin: 0;
  padding: clamp(40px, 13vh, 150px) 0 var(--sp-16);
  background: none; border: 0; border-radius: 0;
}
.pf-gate h2 {
  margin: var(--sp-5) 0 0;
  font: 400 clamp(44px, 6.4vw, 96px)/.95 var(--font-display);
  letter-spacing: -.04em;
  color: var(--ink);
  text-wrap: balance;
}
.pf-gate p { margin: var(--sp-6) 0 0; max-width: 34em; color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.5; text-wrap: pretty; }
/* A tool without .pf-main (PPT Builder's full-width root) still lines the gate up with the
   standard page column instead of the window edge. */
:not(.pf-main) > .pf-gate { margin-left: max(var(--gutter), calc((100% - var(--main-max)) / 2 + var(--gutter))); }
.pf-gate .pf-btn { --h: 48px; padding: 0 26px; font-size: 15px; }
.pf-gate > .pf-btn, .pf-gate > div { margin-top: var(--sp-10); }
.pf-gate .pf-btn.pf-primary::after { content: "→"; transition: transform 220ms var(--ease); }
.pf-gate .pf-btn.pf-primary:hover::after { transform: translateX(4px); }
/* The privacy link under the sign-in button (Google's brand verification wants it on the home page). */
.pf-gate .pf-gate-legal { margin-top: var(--sp-6); font-size: var(--fs-sm); color: var(--ink-3); }

/* The particle field behind the gate and the hub hero (shared/constellation.js).
   z-index -1 paints it above the page background and below every piece of content,
   which is why the body itself turns transparent in scene mode (html keeps --bg). */
.pf-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; display: block; }
body.pf-scene { background: transparent; }
body.pf-scene .pf-top { background: transparent; border-bottom-color: transparent; transition: background-color 240ms var(--ease), border-color 240ms var(--ease); }
body.pf-scene.pf-scrolled .pf-top { background: var(--chrome); border-bottom-color: var(--chrome-line); }


/* 7. BUTTONS ==============================================================
   Hierarchy, lightest to heaviest:
     .pf-btn.pf-ghost   toolbar / cancel
     .pf-btn            default: outlined pill (Export, Copy, Filter)
     .pf-btn.pf-primary the ONE main action of a view: cyan fill
     .pf-btn.pf-commit  irreversible write to another system (Push to CM360,
                        Send to finance): white fill on black, black on paper
     .pf-btn.pf-bad     destroys data here. Outlined; .pf-bad.pf-primary is the confirm. */
.pf-btn {
  --h: var(--ctl-h);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h); padding: 0 18px;
  font: 500 var(--fs-md)/1 var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-round);
  cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pf-btn:hover { background: var(--surface-2); border-color: var(--ink-3); text-decoration: none; }
.pf-btn:active { background: var(--surface-3); transform: translateY(1px); }
.pf-btn:disabled, .pf-btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; pointer-events: none; }
.pf-btn svg, .pf-btn .pf-ico { width: 16px; height: 16px; margin-inline: -2px; }
.pf-btn[aria-busy="true"] { cursor: progress; }

.pf-btn.pf-primary { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); font-weight: 600; }
.pf-btn.pf-primary:hover { background: var(--accent-hover); border-color: var(--accent-edge); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent); }
.pf-btn.pf-primary:active { background: var(--accent-press); }

.pf-btn.pf-commit { background: var(--commit-bg); border-color: var(--commit-bg); color: var(--commit-ink); font-weight: 600; }
.pf-btn.pf-commit:hover { background: var(--commit-hover); border-color: var(--commit-hover); }
.pf-btn.pf-commit:active { background: var(--commit-press); border-color: var(--commit-press); }

.pf-btn.pf-bad { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad) 70%, transparent); background: transparent; }
.pf-btn.pf-bad:hover { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.pf-btn.pf-bad.pf-primary { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.pf-btn.pf-bad:active, .pf-btn.pf-bad.pf-primary:active { filter: brightness(.9); }

.pf-btn.pf-ghost { background: transparent; border-color: transparent; }
.pf-btn.pf-ghost:hover { background: var(--surface-2); border-color: transparent; }

.pf-btn.pf-sm { --h: var(--ctl-h-sm); padding: 0 13px; font-size: var(--fs-sm); gap: 6px; }
.pf-btn.pf-sm svg, .pf-btn.pf-sm .pf-ico { width: 14px; height: 14px; }
.pf-btn.pf-square { width: var(--h); padding: 0; }

.pf-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }


/* 8. FORM CONTROLS ========================================================
   Bare inputs inside .pf-main — or inside an overlay root marked .pf-layer, for
   pop-ups attached to <body> — pick these up at zero specificity. .pf-input is
   the explicit form. */
.pf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-field > label:not(.pf-check), .pf-field > .pf-label {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-caps);
  text-transform: uppercase; color: var(--ink-3);
}
.pf-hint { font-size: var(--fs-xs); color: var(--ink-3); }
.pf-field.pf-bad .pf-hint { color: var(--bad-ink); }

.pf-input,
:where(.pf-main, .pf-layer) :where(input:not([type]), input[type="text"], input[type="email"], input[type="search"],
  input[type="number"], input[type="date"], input[type="password"], input[type="url"], input[type="tel"],
  input[type="month"], input[type="time"], select, textarea) {
  width: 100%; min-width: 0;
  height: var(--ctl-h);
  padding: 0 12px;
  font: 400 var(--fs-md)/1.2 var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.pf-input:hover, :where(.pf-main, .pf-layer) :where(input, select, textarea):hover { border-color: var(--ink-3); }
.pf-input:focus, :where(.pf-main, .pf-layer) :where(input, select, textarea):focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
.pf-input::placeholder, :where(.pf-main, .pf-layer) :where(input, textarea)::placeholder { color: var(--ink-3); opacity: 1; }
.pf-input:disabled, :where(.pf-main, .pf-layer) :where(input, select, textarea):disabled {
  background: var(--surface-2); color: var(--ink-3); border-color: var(--line); cursor: not-allowed;
}
.pf-input[aria-invalid="true"], .pf-field.pf-bad .pf-input,
:where(.pf-main, .pf-layer) :where(input, select, textarea)[aria-invalid="true"] { border-color: var(--bad); }
.pf-input[aria-invalid="true"]:focus, .pf-field.pf-bad .pf-input:focus { box-shadow: 0 0 0 3px var(--bad-tint); }

select.pf-input, :where(.pf-main, .pf-layer) :where(select) {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 12px center;
}
:where(.pf-main, .pf-layer) :where(select[multiple]) { height: auto; padding: 6px; background-image: none; }
textarea.pf-input, :where(.pf-main, .pf-layer) :where(textarea) { height: auto; min-height: 80px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input.pf-mono, .pf-input.pf-mono { font-family: var(--font-mono); font-size: 12.5px; }
.pf-input.pf-num { text-align: right; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.pf-check { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); cursor: pointer; }

input[type="checkbox"].pf-switch {
  appearance: none; -webkit-appearance: none;
  width: 32px; height: 18px; flex: none;
  border-radius: var(--r-round);
  background: radial-gradient(circle at 9px 50%, #fff 6px, transparent 6.5px) var(--line-strong);
  transition: background-color var(--dur) var(--ease);
}
input[type="checkbox"].pf-switch:checked { background: radial-gradient(circle at 23px 50%, #000 6px, transparent 6.5px) var(--accent); }
input[type="checkbox"].pf-switch:disabled { opacity: .4; cursor: not-allowed; }

.pf-search { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.pf-search > svg { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.pf-search > input { padding-left: 34px; }


/* 9. TABLES ===============================================================
   <div class="pf-tablewrap"><table class="pf-table">…</table></div>
   Sticky header inside the wrap; numbers right-aligned in tabular figures. */
.pf-tablewrap { overflow: auto; max-width: 100%; }
.pf-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.pf-table th {
  position: sticky; top: 0; z-index: 1;
  height: 34px; padding: 0 var(--sp-3);
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
  text-align: left; white-space: nowrap;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase;
  color: var(--ink-3);
}
.pf-table td {
  height: var(--row-h); padding: 0 var(--sp-3);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.pf-table td.pf-wrap { white-space: normal; }
.pf-table tbody tr:hover td { background: var(--surface-2); }
.pf-table tr.pf-sel td { background: var(--accent-tint); }
.pf-table td.pf-edited { background: var(--highlight); color: var(--highlight-ink); }
.pf-table th.pf-num { text-align: right; }
.pf-table .pf-cb { width: 36px; padding-right: 0; }
.pf-table .pf-pin { position: sticky; left: 0; z-index: 1; }
.pf-table th.pf-pin { z-index: 2; }
.pf-table tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.pf-table td.pf-ok   { color: var(--ok-ink); }
.pf-table td.pf-warn { color: var(--warn-ink); }
.pf-table td.pf-bad  { color: var(--bad-ink); }
.pf-table th[aria-sort] { cursor: pointer; }
.pf-table th[aria-sort="ascending"]::after  { content: " \2191"; color: var(--ink); }
.pf-table th[aria-sort="descending"]::after { content: " \2193"; color: var(--ink); }
.pf-table.pf-dense td { height: var(--row-h-dense); }
.pf-table.pf-dense th { height: 28px; }
.pf-table input:not([type="checkbox"]), .pf-table select { height: calc(var(--row-h) - 8px); font-size: var(--fs-sm); }


/* 10. STATUS ==============================================================
   <span class="pf-pill pf-ok">Live</span>: always text + colour, never colour alone. */
.pf-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 10px;
  font: 600 var(--fs-xs)/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
  border-radius: var(--r-round);
  background: var(--neutral-tint); color: var(--neutral-ink);
}
.pf-pill::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-round); background: currentColor; }
.pf-pill.pf-ok   { background: var(--ok-tint);   color: var(--ok-ink); }
.pf-pill.pf-warn { background: var(--warn-tint); color: var(--warn-ink); }
.pf-pill.pf-bad  { background: var(--bad-tint);  color: var(--bad-ink); }
.pf-pill.pf-info { background: var(--info-tint); color: var(--info-ink); }
.pf-pill.pf-pulse::before { animation: pf-pulse 1.6s var(--ease) infinite; }

.pf-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  font: 600 var(--fs-xs)/1 var(--font-body); font-variant-numeric: tabular-nums;
  border-radius: var(--r-round);
  background: var(--surface-3); color: var(--ink);
}
.pf-count.pf-warn { background: var(--warn); color: #000; }
.pf-count.pf-bad  { background: var(--bad);  color: var(--on-bad); }
.pf-top .pf-count { background: var(--surface-3); color: var(--chrome-ink); }
.pf-top .pf-count.pf-bad { background: var(--bad); color: var(--on-bad); }


/* 11. FEEDBACK ============================================================ */
.pf-notice {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 12px var(--sp-4);
  font-size: var(--fs-md); line-height: 1.5;
  background: var(--info-tint); color: var(--info-ink);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: var(--r-1);
}
.pf-notice > svg, .pf-notice > .pf-ico { margin-top: 2px; }
.pf-notice > div { flex: 1; min-width: 0; }
.pf-notice strong { font-weight: 600; }
.pf-notice .pf-btn { margin-left: auto; align-self: center; }
.pf-notice.pf-warn { background: var(--warn-tint); color: var(--warn-ink); }
.pf-notice.pf-bad  { background: var(--bad-tint);  color: var(--bad-ink); }
.pf-notice.pf-ok   { background: var(--ok-tint);   color: var(--ok-ink); }
.pf-notice.pf-locked { background: transparent; color: var(--ink-2); border: 1px dashed var(--line-strong); }
/* Platform.clientGaps(): the clients a tool lists greyed, each with its reason. */
.pf-notice.pf-gaps { margin: var(--sp-3) 0; }
.pf-gaps-list { margin: var(--sp-2) 0 0; padding-left: 18px; }
.pf-gaps-list li + li { margin-top: 4px; }

.pf-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 36px var(--sp-6);
  text-align: center; color: var(--ink-2);
  border: 1px dashed var(--line-strong); border-radius: var(--r-2);
}
.pf-empty > svg, .pf-empty > .pf-ico { width: 28px; height: 28px; color: var(--ink-3); margin-bottom: var(--sp-2); }
.pf-empty h3, .pf-empty strong { font: 400 22px/1.15 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.pf-empty p { max-width: 46ch; font-size: var(--fs-md); text-wrap: pretty; }
.pf-empty .pf-btn { margin-top: var(--sp-3); }

.pf-skel {
  display: block; height: 10px; border-radius: var(--r-round);
  background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%) 0 0 / 200% 100%;
  animation: pf-shimmer 1.3s linear infinite;
}
.pf-spin {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 1.5px solid currentColor; border-right-color: transparent; border-radius: var(--r-round);
  animation: pf-rot .7s linear infinite;
}


/* 12. OVERLAYS ============================================================ */
.pf-tabs { display: flex; gap: var(--sp-2); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-6); overflow-x: auto; scrollbar-width: none; }
.pf-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 var(--sp-3);
  font: 500 var(--fs-md)/1 var(--font-body); color: var(--ink-3); white-space: nowrap;
  background: none; border: 0; cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.pf-tab:hover { color: var(--ink); }
.pf-tab.pf-tab-active { color: var(--ink); }
/* bottom: 0, not -1px: .pf-tabs scrolls sideways, so anything outside its box is clipped. */
.pf-tab.pf-tab-active::after { content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }

.pf-backdrop {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: none; align-items: center; justify-content: center;
  padding: var(--sp-8);
  background: var(--scrim);
}
.pf-backdrop.pf-show { display: flex; animation: pf-fade 180ms var(--ease) both; }
.pf-modal {
  display: flex; flex-direction: column;
  width: min(560px, 100%); max-height: calc(100vh - 64px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.pf-backdrop.pf-show .pf-modal { animation: pf-lift 240ms var(--ease) both; }
.pf-modal.pf-wide { width: min(920px, 100%); }
.pf-modal-h { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.pf-modal-h h2 { font: 400 24px/1.1 var(--font-display); letter-spacing: -.02em; flex: 1; }
.pf-modal-b { padding: var(--sp-6); overflow: auto; display: flex; flex-direction: column; gap: var(--sp-4); }
.pf-modal-f { display: flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--line); }
.pf-modal.pf-bad .pf-modal-h { background: var(--bad-tint); color: var(--bad-ink); border-bottom-color: color-mix(in srgb, var(--bad) 30%, transparent); }

/* Dialog: Platform.confirm / prompt / alert (shared/platform.js), never the browser's own.
   A <dialog> in the top layer. It rises out of a blurred page, a line sweeps across its
   top, the icon pops, the words follow; leaving is quicker than arriving. .pf-danger is
   red throughout (a delete, a block). */
.pf-dialog {
  width: min(460px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px);
  margin: auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible;
}
.pf-dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(6px) saturate(.85); backdrop-filter: blur(6px) saturate(.85); }
.pf-dialog-box {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3);
  max-height: inherit; padding: var(--sp-8) var(--sp-8) var(--sp-6);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-2);
  box-shadow: var(--shadow-modal);
}
.pf-dialog-sweep { position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--secondary)); transform-origin: left; }
.pf-danger .pf-dialog-sweep { background: linear-gradient(90deg, var(--bad), var(--warn)); }
.pf-dialog-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; margin-bottom: var(--sp-1);
  border-radius: var(--r-round); background: var(--accent-tint); color: var(--primary-ink);
}
.pf-dialog-icon svg { width: 22px; height: 22px; }
.pf-danger .pf-dialog-icon { background: var(--bad-tint); color: var(--bad-ink); }
.pf-dialog-title { font: 400 26px/1.15 var(--font-display); letter-spacing: -.02em; text-wrap: balance; overflow-wrap: anywhere; }
.pf-dialog-msg { font-size: var(--fs-md); line-height: 1.55; color: var(--ink-2); text-wrap: pretty; overflow-wrap: anywhere; }
.pf-dialog-msg p + p { margin-top: var(--sp-2); }
.pf-dialog-field { width: 100%; margin-top: var(--sp-1); }
.pf-dialog-text { min-height: 140px; font: 12.5px/1.5 var(--font-mono); resize: vertical; }
.pf-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); align-self: stretch; margin-top: var(--sp-3); }
@media (max-width: 480px) {
  .pf-dialog-box { padding: var(--sp-6) var(--sp-5) var(--sp-5); }
  .pf-dialog-actions > .pf-btn { flex: 1; }
}

.pf-dialog.pf-in { animation: pf-dlg-in 460ms var(--vt-in) both; }
.pf-dialog.pf-in::backdrop { animation: pf-fade 320ms var(--ease) both; }
.pf-dialog.pf-in .pf-dialog-sweep { animation: pf-dlg-sweep 720ms var(--vt-in) 90ms both; }
.pf-dialog.pf-in .pf-dialog-icon { animation: pf-dlg-pop 560ms cubic-bezier(.34, 1.56, .64, 1) 70ms both; }
.pf-dialog.pf-in .pf-dialog-title { animation: pf-rise 440ms var(--vt-in) 110ms both; }
.pf-dialog.pf-in .pf-dialog-msg { animation: pf-rise 440ms var(--vt-in) 150ms both; }
.pf-dialog.pf-in .pf-dialog-field { animation: pf-rise 440ms var(--vt-in) 180ms both; }
.pf-dialog.pf-in .pf-dialog-actions { animation: pf-rise 440ms var(--vt-in) 200ms both; }
.pf-danger.pf-in .pf-dialog-icon svg { animation: pf-dlg-wobble 640ms var(--ease) 420ms both; }
.pf-dialog.pf-out { animation: pf-dlg-out 180ms var(--vt-out) both; }
.pf-dialog.pf-out::backdrop { animation: pf-dlg-fade-out 200ms var(--ease) both; }
.pf-dialog.pf-nudge .pf-dialog-box { animation: pf-dlg-nudge 380ms var(--ease); }
@keyframes pf-dlg-in    { from { opacity: 0; transform: translateY(28px) scale(.94); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pf-dlg-out   { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes pf-dlg-fade-out { to { opacity: 0; } }
@keyframes pf-dlg-sweep { from { transform: scaleX(0); } }
@keyframes pf-dlg-pop   { from { opacity: 0; transform: scale(.4) rotate(-14deg); } }
@keyframes pf-dlg-wobble { 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(2deg); } }
@keyframes pf-dlg-nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.pf-toast {
  position: fixed; left: 50%; bottom: var(--sp-6); z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: min(560px, calc(100vw - 32px));
  min-height: 44px; padding: 10px 20px;
  font-size: var(--fs-md);
  background: var(--surface-3); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-round);
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.pf-toast.pf-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.pf-toast::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: var(--r-round); background: var(--accent); }
.pf-toast.pf-ok::before   { background: var(--ok); }
.pf-toast.pf-warn::before { background: var(--warn); }
.pf-toast.pf-bad::before  { background: var(--bad); }
.pf-toast .pf-btn { margin-left: auto; background: transparent; border-color: transparent; color: var(--link); }
.pf-toast .pf-btn:hover { background: var(--surface-2); }


/* "AI is thinking" (Platform.ai): one pill in the corner while any AI task runs, gone when the last
   ends. It never blocks: no scrim, no focus taken. A tool on a page with a fixed bottom bar lifts
   it with --pf-ai-lift. Boxes the AI is filling carry .pf-ai-fill (+ data-ai="Writing…"). */
body { --pf-ai-lift: 0px; }
.pf-ai {
  position: fixed; right: var(--sp-6); bottom: calc(var(--sp-6) + var(--pf-ai-lift, 0px)); z-index: var(--z-toast);
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: min(420px, calc(100vw - 32px)); min-height: 48px; padding: 8px 16px 8px 10px;
  font: 400 var(--fs-sm)/1.3 var(--font-body); text-align: left; cursor: default;
  background: var(--surface-3); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-round);
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(14px) scale(.96); pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.pf-ai.pf-show { opacity: 1; transform: none; pointer-events: auto; }
.pf-ai.pf-ai-link { cursor: pointer; }
.pf-ai.pf-ai-link:hover { border-color: var(--accent-edge); }
.pf-ai:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pf-ai-mark { position: relative; width: 30px; height: 30px; flex: none; display: grid; place-items: center; }
.pf-ai-mark::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-round);
  background: conic-gradient(from 0deg, var(--accent), var(--viz-7), var(--highlight-ink), var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), var(--ink) calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), var(--ink) calc(100% - 2px));
  animation: pf-rot 1.2s linear infinite;
}
.pf-ai-mark svg { width: 16px; height: 16px; fill: var(--accent); animation: pf-ai-beat 1.2s var(--ease) infinite; }
.pf-ai-t { display: flex; flex-direction: column; min-width: 0; }
.pf-ai-t b { font-weight: 600; color: var(--ink); }
.pf-ai-d { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pf-ai-time { margin-left: auto; padding-left: var(--sp-2); font: 500 var(--fs-xs)/1 var(--font-mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
:where(.pf-ai-fill) { position: relative; }
.pf-ai-fill::after {
  content: ""; position: absolute; inset: -3px; z-index: 1; border-radius: var(--r-1); pointer-events: none;
  border: 1px dashed var(--accent);
  background: linear-gradient(100deg, transparent 30%, var(--accent-tint) 50%, transparent 70%) 0 0 / 250% 100%;
  opacity: .7; animation: pf-ai-sheen 1.5s linear infinite;
}
.pf-ai-fill[data-ai]::before {
  content: attr(data-ai); position: absolute; top: -10px; right: 10px; z-index: 2; pointer-events: none;
  padding: 2px 8px; border-radius: var(--r-round);
  font: 600 10px/1.4 var(--font-body); letter-spacing: .02em;
  background: var(--accent); color: var(--on-accent);
}
@keyframes pf-ai-sheen { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@keyframes pf-ai-beat { 0%, 100% { transform: scale(.82); opacity: .75; } 50% { transform: scale(1.08); opacity: 1; } }
@media (max-width: 600px) { .pf-ai { right: var(--sp-4); left: var(--sp-4); max-width: none; } }

/* 13. UTILITIES + MOTION ================================================== */
.pf-hidden { display: none !important; }

/* Entrance for hero blocks only (hub, gate): rises from a visible start state. */
.pf-rise { animation: pf-rise 760ms var(--ease) both; }
.pf-rise.pf-d1 { animation-delay: 90ms; }  .pf-rise.pf-d2 { animation-delay: 180ms; }
.pf-rise.pf-d3 { animation-delay: 270ms; } .pf-rise.pf-d4 { animation-delay: 360ms; }

@keyframes pf-rot { to { transform: rotate(360deg); } }
@keyframes pf-shimmer { to { background-position: -200% 0; } }
@keyframes pf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes pf-rise { from { opacity: .001; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pf-lift { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* What keeps its identity from one page to the next (how it moves: SHARED MOTION below). */
.pf-top { view-transition-name: pf-top; }
.pf-top .pf-title { view-transition-name: pf-title; }
.pf-canvas { view-transition-name: pf-canvas; }

/* ==== BEGIN SHARED MOTION ================================================ */
/* Copied verbatim into apps/cm360/css/styles.css by `node scripts/design/ds.js sync`.

   Going between two pages of the platform animates instead of jumping (cross-document
   View Transitions; same origin only, so the trip to Google and back does not). Each
   stylesheet names its parts; this block only says how they move:
     pf-top     the header holds still; only what changed in it cross-fades
     root       the page beneath lifts away and the next one rises into place;
                back to the hub, or with Back, it settles the other way (.pf-vt-back),
                and another page of the same tool moves less (.pf-vt-side)
     pf-title   leaving the hub from a tile, its title flies up into the next header
     pf-canvas  a particle field rushes past the camera as its page goes
     pf-bar     a bar fixed along the bottom slides in and out with its page
     pf-view    a tool's view area, when it names one, moves on its own in a tab switch
   A view switch inside a tool (html.pf-swap, set by shared/motion.js) cross-fades with the
   same timing on both sides, so whatever did not change, a tab bar or a toolbar, holds
   perfectly still. Without View Transitions, or with reduced motion, nothing changes. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

:root {
  --vt-out: cubic-bezier(.4, 0, 1, 1);
  --vt-in:  cubic-bezier(.16, 1, .3, 1);
  --vt-fly: cubic-bezier(.7, 0, .2, 1);
}
/* A click while things move lands on the page, never on the animation. */
::view-transition { pointer-events: none; }
/* Chrome keeps an unchanged pixel at full strength through a cross-fade by blending the
   two pictures additively, and applies that blend as an animation, which the animations
   below replace. Say it outright, inside each pair only. */
::view-transition-image-pair(*) { isolation: isolate; }
::view-transition-old(*), ::view-transition-new(*) { mix-blend-mode: plus-lighter; }

::view-transition-old(root) { animation: 200ms var(--vt-out) both pf-vt-leave; }
::view-transition-new(root) { animation: 640ms var(--vt-in) 100ms both pf-vt-arrive; }
:root.pf-vt-back::view-transition-old(root) { animation-name: pf-vt-leave-back; }
:root.pf-vt-back::view-transition-new(root) { animation-name: pf-vt-arrive-back; }
:root.pf-vt-side::view-transition-new(root) { animation-name: pf-vt-arrive-side; animation-duration: 520ms; }

::view-transition-group(pf-top) { animation-duration: 360ms; animation-timing-function: var(--vt-in); }
/* A page whose header was not up yet keeps the old one in place until the end. */
::view-transition-old(pf-top):only-child { animation: 720ms linear both pf-vt-hold; }

/* Text scales by its height (its font size), never stretched sideways; the two titles
   swap with mirrored linear fades, so a title that did not change does not flicker. */
::view-transition-group(pf-title) { animation-duration: 640ms; animation-timing-function: var(--vt-fly); }
::view-transition-old(pf-title), ::view-transition-new(pf-title) { height: 100%; width: auto; }
::view-transition-old(pf-title) { animation: 640ms linear both pf-vt-title-out; }
::view-transition-new(pf-title) { animation: 640ms linear both pf-vt-title-in; }

::view-transition-old(pf-canvas):only-child { animation: 620ms cubic-bezier(.4, 0, .2, 1) both pf-vt-dive; }

::view-transition-new(pf-bar):only-child { animation: 560ms var(--vt-in) 140ms both pf-vt-bar-in; }
::view-transition-old(pf-bar):only-child { animation: 220ms var(--vt-out) both pf-vt-bar-out; }

/* Inside a tool. */
:root.pf-swap::view-transition-group(*) { animation-duration: 280ms; animation-timing-function: var(--vt-in); }
:root.pf-swap::view-transition-old(*) { animation: 280ms ease both pf-vt-fade-out; }
:root.pf-swap::view-transition-new(*) { animation: 280ms ease both pf-vt-fade-in; }
:root.pf-swap::view-transition-group(pf-view) { animation-duration: 460ms; }
:root.pf-swap::view-transition-old(pf-view) { animation: 160ms var(--vt-out) both pf-vt-view-out; }
:root.pf-swap::view-transition-new(pf-view) { animation: 420ms var(--vt-in) 50ms both pf-vt-view-in; }
:root.pf-swap::view-transition-old(pf-bar):only-child { animation: 200ms var(--vt-out) both pf-vt-bar-out; }
:root.pf-swap::view-transition-new(pf-bar):only-child { animation: 420ms var(--vt-in) 80ms both pf-vt-bar-in; }

@keyframes pf-vt-leave       { to   { opacity: 0; transform: translateY(-12px); } }
@keyframes pf-vt-arrive      { from { opacity: 0; transform: translateY(32px); } }
@keyframes pf-vt-leave-back  { to   { opacity: 0; transform: translateY(16px); } }
@keyframes pf-vt-arrive-back { from { opacity: 0; transform: translateY(-24px); } }
@keyframes pf-vt-arrive-side { from { opacity: 0; transform: translateY(14px); } }
@keyframes pf-vt-hold        { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pf-vt-title-out   { 0%, 40% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes pf-vt-title-in    { 0%, 40% { opacity: 0; } 80%, 100% { opacity: 1; } }
@keyframes pf-vt-dive        { to   { opacity: 0; transform: scale(1.8); } }
@keyframes pf-vt-bar-in      { from { transform: translateY(100%); } }
@keyframes pf-vt-bar-out     { to   { transform: translateY(100%); } }
@keyframes pf-vt-view-out    { to   { opacity: 0; transform: translateY(-6px); } }
@keyframes pf-vt-view-in     { from { opacity: 0; transform: translateY(14px); } }
@keyframes pf-vt-fade-out    { to   { opacity: 0; } }
@keyframes pf-vt-fade-in     { from { opacity: 0; } }
/* ==== END SHARED MOTION ================================================== */


/* 14. PRINT ===============================================================
   Browsers drop backgrounds when printing: always print the light palette. */
@media print {
  :root, :root[data-theme="light"] {
    color-scheme: light;
    --bg: #FFFFFF; --ink: #000000; --surface: #FFFFFF; --surface-2: #F2F2F2; --surface-3: #E6E6E6;
    --line: #D9D9D9; --line-strong: #A6A6A6; --ink-2: #333333; --ink-3: #595959;
    --link: #075A78; --highlight: #FFFF99; --highlight-ink: #000000; --eyebrow-ink: #000000;
    --chrome: #FFFFFF; --chrome-ink: #000000; --chrome-ink-2: #595959; --chrome-line: #D9D9D9;
    --logo-filter: invert(1);
    --ok-tint: #FFFFFF; --ok-ink: #0D5A2C; --warn-tint: #FFFFFF; --warn-ink: #7A4300;
    --bad-tint: #FFFFFF; --bad-ink: #9A1B12; --neutral-tint: #FFFFFF; --neutral-ink: #333333;
    --accent-tint: #FFFFFF; --primary-tint: #FFFFFF; --primary-ink: #075A78;
  }
  .pf-top { position: static; }
  .pf-canvas, .pf-toast, .pf-user, .pf-theme { display: none !important; }
}


/* 15. DOM REALITY NOTES ===================================================
   Kept from base.css, because they describe markup the CSS must match:
   - .pf-logo is the <img> itself, not a wrapper.
   - .pf-top .pf-title carries a <small> subtitle.
   - The gates use bare <h2> and <p>, plus a .pf-eyebrow span.
   - In the hub, .pf-count is a sentence inside .pf-section-h.
   ========================================================================== */
