/* fz-posted.css — Posted — media performance dashboard. Owner: posted agent (ops-posted.jsx).
   Loaded AFTER nova-shell.css (see index.php), so equal-specificity rules here win.
   Light is the base theme; dark lives under [data-theme="dark"] (app.jsx always sets it on <html>).

   Only --fz-* tokens (DESIGN-SYSTEM.md). Everything is scoped under .fz-p-posted (the
   page root) or .fz-pst-drawer (the reel drawer, rendered as a fixed overlay).

   Sections
     1. Page head (CSV + round reload)
     2. Toolbar: client pill-select, Filters popover, active chips, Clear all
     3. Body container + summary (hero card + three tiles)
     4. Truncation notice, section header, pager, empty state
     5. Content cards (small result sets)
     6. Compact table (large result sets)
     7. Shared bits: platform glyph, team pair, dots
     8. Drawer: platform pill, stats, views form, approval trail */


/* ═══ 1. PAGE HEAD ══════════════════════════════════════════════════════════ */
/* Round icon button, same footprint as Today's reload. The pill radius comes from
   fz-base's !important header rule; we only size it (matched specificity + 1). */
.fz-p-posted .fz-pst-head .xcs-pagehead-cta .fz-pst-reload {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
}
.fz-p-posted .fz-pst-head .xcs-pagehead-cta .fz-pst-csv { min-height: 44px; }


/* ═══ 2. TOOLBAR ════════════════════════════════════════════════════════════
   One row: search · client · Filters · active chips … Clear all. The secondary
   filters live in a popover anchored to the toolbar (not the pill), so it never
   runs off the right edge on a phone. */
.fz-p-posted .fz-pst-tools { position: relative; min-width: 0; }
.fz-p-posted .fz-pst-tools .fz-search { width: 280px; }

/* Client filter: a real <select> dressed as a filter pill, with the chosen
   client's avatar on the left (users icon when "All clients"). */
.fz-p-posted label.fz-pst-client {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 240px;
  height: 36px;
  margin: 0;
  padding: 0 0 0 var(--fz-s-3);
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-1);
  color: var(--fz-text-2);
  cursor: pointer;
  transition: background-color var(--fz-t-fast) var(--fz-ease), border-color var(--fz-t-fast) var(--fz-ease);
}
.fz-p-posted label.fz-pst-client:hover { background: var(--fz-surface-hover); border-color: var(--fz-border-strong); }
.fz-p-posted label.fz-pst-client:focus-within { border-color: var(--fz-focus); box-shadow: 0 0 0 1px var(--fz-focus); }
.fz-p-posted label.fz-pst-client.is-on {
  background: var(--fz-accent-soft);
  border-color: var(--fz-accent-line);
  color: var(--fz-accent-ink);
}
.fz-p-posted .fz-pst-client-av { display: inline-grid; place-items: center; flex: none; pointer-events: none; }
/* Caret: a CSS chevron in the label's own ink (no SVG data URI = no colour literal). */
.fz-p-posted label.fz-pst-client::after {
  content: '';
  position: absolute;
  right: var(--fz-s-4);
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.fz-p-posted .fz-pst-client select,
[data-theme="dark"] .fz-p-posted .fz-pst-client select,
[data-theme="dark"] .fz-p-posted .fz-pst-client select:focus {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 var(--fz-s-8) 0 var(--fz-s-2);
  border: 0;
  border-radius: var(--fz-r-pill);
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--fz-text-1);
  font-family: var(--fz-font-body);
  font-size: var(--fz-fs-body);
  font-weight: var(--fz-fw-medium);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.fz-p-posted .fz-pst-client.is-on select,
[data-theme="dark"] .fz-p-posted .fz-pst-client.is-on select { color: var(--fz-accent-ink); font-weight: var(--fz-fw-semi); }
.fz-p-posted .fz-pst-client select option { color: var(--fz-text-1); background: var(--fz-surface-1); }

.fz-p-posted .fz-pst-fanchor { display: inline-flex; flex: none; }
.fz-p-posted .fz-pst-chip .fsw-ic { margin-left: calc(var(--fz-s-1) * -1); }
.fz-p-posted .fz-pst-clear {
  appearance: none;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--fz-s-3);
  border: 0;
  border-radius: var(--fz-r-pill);
  background: transparent;
  color: var(--fz-accent-ink);
  font: inherit;
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-semi);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--fz-t-fast) var(--fz-ease);
}
.fz-p-posted .fz-pst-clear:hover { background: var(--fz-accent-soft); }

/* Filters popover */
.fz-p-posted .fz-pst-pop {
  position: absolute;
  top: calc(100% + var(--fz-s-2));
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--fz-s-4);
  width: min(460px, 100%);
  padding: var(--fz-s-4);
  background: var(--fz-surface-1);
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-r-md);
  box-shadow: var(--fz-shadow-pop);
  animation: fzPstPop var(--fz-t-fast) var(--fz-ease);
}
@keyframes fzPstPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.fz-p-posted .fz-pst-pop-g { display: flex; flex-direction: column; gap: var(--fz-s-2); min-width: 0; }
.fz-p-posted .fz-pst-pop-l {
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-semi);
  line-height: 1.3;
  color: var(--fz-text-3);
}
.fz-p-posted .fz-pst-pop-o { display: flex; flex-wrap: wrap; gap: var(--fz-s-2); min-width: 0; }
.fz-p-posted .fz-pst-pop-o .fz-fpill { height: 32px; padding: 0 var(--fz-s-3); font-size: var(--fz-fs-meta); }
.fz-p-posted .fz-pst-pop-f {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fz-s-2);
  padding-top: var(--fz-s-3);
  border-top: 1px solid var(--fz-border);
}

@media (max-width: 768px) {
  .fz-p-posted .fz-pst-tools .fz-search { width: 100%; }
  /* A 160px floor keeps Client + Filters on one row and pushes the active chips to
     the next line (with flex-basis 0 the chips squeezed the name down to "Ais…"). */
  .fz-p-posted label.fz-pst-client { height: 44px; flex: 1 1 calc(var(--fz-s-8) * 4); min-width: calc(var(--fz-s-8) * 4); max-width: none; }
  .fz-p-posted .fz-pst-clear { height: 44px; }
  .fz-p-posted .fz-pst-pop { width: 100%; }
  .fz-p-posted .fz-pst-pop-o .fz-fpill { height: 40px; }
  .fz-p-posted .fz-pst-head .xcs-pagehead-cta .fz-pst-csv { flex: 1 1 auto; }
}


/* ═══ 3. BODY + SUMMARY ═════════════════════════════════════════════════════
   .fz-pst-body is a container-query root (the content column narrows with the
   sidebar, so viewport queries would guess wrong). The drawer and the video
   modal are rendered OUTSIDE it on purpose.

   Summary = ONE hero banner (Total posted + the post-time split as a stacked
   bar whose legend doubles as the timing filter) over three supporting tiles
   (On time, Median views, FYP). Wide: the hero's number sits left, the bar
   right. Phone: the three tiles shrink to a compact three-up strip. */
/* Page stack (head → toolbar → body): the module gap every other page uses
   (16 desktop / 12 phone) instead of ops-theme's 20px .fsw-page default. */
.fsw-page.fz-p-posted { gap: var(--fz-gap); }
.fz-p-posted .fz-pst-body {
  container: fzpst / inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--fz-s-6);
  min-width: 0;
}
.fz-p-posted .fz-pst-sum {
  display: grid;
  gap: var(--fz-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}
.fz-p-posted .fz-pst-sum > .fz-pst-hero { grid-column: 1 / -1; }

/* Hero: the one big number on the page. A flat surface-1 card like Today's and
   Team's hero tiles (QA r1: the old lime corner wash was the only gradient in the
   app); its weight comes from its full width, the 44px number and the post-time bar. */
.fz-p-posted .fz-pst-hero {
  background: var(--fz-surface-1);
  gap: var(--fz-s-2);
}
.fz-p-posted .fz-pst-hero .fz-metric-l { font-size: var(--fz-fs-body); color: var(--fz-text-1); font-weight: var(--fz-fw-semi); }
.fz-p-posted .fz-pst-hero .fz-metric-num { color: var(--fz-text-1); letter-spacing: -.03em; }
.fz-p-posted .fz-pst-hero .fz-metric-h { color: var(--fz-text-2); }
.fz-p-posted .fz-pst-hero .fz-metric-x { padding-top: var(--fz-s-4); }
.fz-p-posted .fz-pst-hero-x { display: flex; flex-direction: column; gap: var(--fz-s-3); min-width: 0; }
.fz-p-posted .fz-pst-hero-cap {
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-semi);
  line-height: 1.3;
  color: var(--fz-text-3);
}
.fz-p-posted .fz-pst-hero .fz-segbar.is-lg { height: var(--fz-s-4); }
.fz-p-posted .fz-pst-leg { display: flex; flex-wrap: wrap; gap: var(--fz-s-2); min-width: 0; }
.fz-p-posted .fz-pst-leg-i {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: var(--fz-s-2);
  height: 32px;
  padding: 0 var(--fz-s-3);
  border: 1px solid transparent;
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-2);
  color: var(--fz-text-2);
  font: inherit;
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-medium);
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--fz-t-fast) var(--fz-ease), border-color var(--fz-t-fast) var(--fz-ease);
}
[data-theme="dark"] .fz-p-posted .fz-pst-leg-i { background: var(--fz-surface-3); }
.fz-p-posted button.fz-pst-leg-i { cursor: pointer; }
.fz-p-posted button.fz-pst-leg-i:hover { border-color: var(--fz-border-strong); color: var(--fz-text-1); }
.fz-p-posted .fz-pst-leg-i b { margin-left: auto; font-weight: var(--fz-fw-semi); color: var(--fz-text-1); font-variant-numeric: tabular-nums; }
.fz-p-posted button.fz-pst-leg-i.is-on,
.fz-p-posted button.fz-pst-leg-i.is-on:hover {
  background: var(--fz-accent-soft);
  border-color: var(--fz-accent-line);
  color: var(--fz-accent-ink);
  font-weight: var(--fz-fw-semi);
}
.fz-p-posted button.fz-pst-leg-i.is-on b { color: var(--fz-accent-ink); }
[data-theme="dark"] .fz-p-posted .fz-pst-leg-i:focus-visible { border-radius: var(--fz-r-pill); }

/* Wide hero: number block left, bar + legend right (bottom-aligned with the hint). */
@container fzpst (min-width: 720px) {
  .fz-p-posted .fz-pst-hero {
    display: grid;
    grid-template-columns: minmax(200px, 30%) minmax(0, 1fr);
    grid-template-areas: "l x" "v x" "h x";
    grid-template-rows: auto auto 1fr;
    align-items: start;
    column-gap: var(--fz-s-8);
    row-gap: var(--fz-s-2);
    padding: var(--fz-s-6);
  }
  .fz-p-posted .fz-pst-hero .fz-metric-l { grid-area: l; }
  .fz-p-posted .fz-pst-hero .fz-metric-v { grid-area: v; }
  .fz-p-posted .fz-pst-hero .fz-metric-h { grid-area: h; }
  .fz-p-posted .fz-pst-hero .fz-metric-x { grid-area: x; align-self: end; margin: 0; padding: 0; }
}

/* Supporting tiles: one shape for all three — label on top, the number is the
   point, hint one quiet line. No bars (QA r1: only two of the three had one, so
   the tiles ended at different weights; the post-time bar lives in the hero). */
.fz-p-posted .fz-pst-tile .fz-metric-v { margin-top: var(--fz-s-1); }
.fz-p-posted .fz-pst-tile.is-accent .fz-metric-num { color: var(--fz-text-1); }
.fz-p-posted .fz-pst-tile.is-click.is-on { background: var(--fz-accent-soft); }

/* Phone column: hero legend becomes a tidy 2×2 grid; tiles a compact 3-up strip
   (icon and the long hints fold away — the hero legend and the tooltips carry them). */
@container fzpst (max-width: 559px) {
  .fz-p-posted .fz-pst-sum { gap: var(--fz-s-3) var(--fz-s-2); }
  .fz-p-posted .fz-pst-hero { padding: var(--fz-s-5); }
  .fz-p-posted .fz-pst-leg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fz-p-posted .fz-pst-leg-i { height: 40px; min-width: 0; }
  .fz-p-posted .fz-pst-tile { padding: var(--fz-s-3); gap: var(--fz-s-1); border-radius: var(--fz-r-md); }
  .fz-p-posted .fz-pst-tile .fz-metric-ico { display: none; }
  .fz-p-posted .fz-pst-tile .fz-metric-l { white-space: nowrap; }
  .fz-p-posted .fz-pst-tile .fz-metric-lt { overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .fz-p-posted .fz-pst-tile .fz-metric-num { font-size: var(--fz-fs-num-sm); }
  /* Every tile keeps its hint (QA r1: the tiles have no bars any more, so a tile
     without its line would end short of its neighbours). Up to two lines. */
  .fz-p-posted .fz-pst-tile .fz-metric-h {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: normal;
    /* Balanced breaks: "1 on slot ·" / "0 late", "≥ 10×" / "client avg" —
       never a lone unit ("late", "avg") on the second line of a 114px tile. */
    text-wrap: balance;
  }
}


/* ═══ 4. NOTICE, SECTION HEADER, PAGER, EMPTY ═══════════════════════════════ */
.fz-p-posted .fz-pst-trunc {
  display: flex;
  align-items: flex-start;
  gap: var(--fz-s-2);
  padding: var(--fz-s-3) var(--fz-s-4);
  border-radius: var(--fz-r-sm);
  background: var(--fz-warn-soft);
  color: var(--fz-warn-ink);
  font-size: var(--fz-fs-body);
  line-height: 1.45;
}
/* Centre the 15px icon on the first 1.45 line (derived, not a spacing step). */
.fz-p-posted .fz-pst-trunc > .fsw-ic { flex: none; margin-top: calc((1.45em - 15px) / 2); }
.fz-p-posted .fz-pst-trunc b { font-weight: var(--fz-fw-semi); }

.fz-p-posted .fz-pst-list { display: flex; flex-direction: column; gap: var(--fz-s-4); min-width: 0; }
.fz-p-posted .fz-pst-sec-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--fz-s-2) var(--fz-s-3);
  min-width: 0;
}
.fz-p-posted .fz-pst-sec-h h2 {
  display: inline-flex;
  align-items: center;
  gap: var(--fz-s-2);
  margin: 0;
  font-family: var(--fz-font-display);
  font-size: var(--fz-fs-section);
  font-weight: var(--fz-fw-semi);
  letter-spacing: -.015em;
  line-height: 1.3;
  color: var(--fz-text-1);
}
.fz-p-posted .fz-pst-n {
  display: inline-grid;
  place-items: center;
  min-width: var(--fz-s-6);
  height: var(--fz-s-6);
  padding: 0 var(--fz-s-2);
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-3);
  color: var(--fz-text-2);
  font-family: var(--fz-font-body);
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-semi);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
}
.fz-p-posted .fz-pst-sec-m { flex: 1 1 auto; min-width: 0; font-size: var(--fz-fs-meta); color: var(--fz-text-3); }
.fz-p-posted .fz-pst-sec-h .fz-viewtog { margin-left: auto; }
@container fzpst (max-width: 559px) {
  /* Title + layout switch share the first line; the meta line drops under them. */
  .fz-p-posted .fz-pst-sec-m { order: 3; flex-basis: 100%; }
}

.fz-p-posted .fz-pst-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--fz-s-3);
  padding-top: var(--fz-s-2);
}
.fz-p-posted .fz-pst-more > span { font-size: var(--fz-fs-meta); color: var(--fz-text-3); }

/* Empty list = ONE compact row on a surface-1 card (QA r1; same shape as the kit's
   in-module OpsEmpty row): disc left, title + one short line beside it, the action
   on the right (under the text on phones). The how-to sits in the "i" tooltip. */
.fz-p-posted .fz-pst-empty {
  position: relative;          /* the tooltip anchors to the card, not to the tiny icon */
  padding: var(--fz-s-4) var(--fz-card-pad);
  background: var(--fz-surface-1);
  border-radius: var(--fz-r-lg);
  box-shadow: var(--fz-shadow-soft);
}
[data-theme="dark"] .fz-p-posted .fz-pst-empty { box-shadow: none; }
.fz-p-posted .fz-pst-empty > .fsw-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-auto-columns: auto;
  gap: 2px var(--fz-s-3);
  align-items: center;
  justify-items: start;
  min-height: var(--fz-s-8);
  padding: 0;
  background: transparent;
  text-align: left;
}
.fz-p-posted .fz-pst-empty .fsw-empty-ico { grid-column: 1; grid-row: 1 / span 2; margin: 0; background: var(--fz-surface-3); }
.fz-p-posted .fz-pst-empty .fsw-empty-title { grid-column: 2; grid-row: 1; align-self: end; }
.fz-p-posted .fz-pst-empty .fsw-empty-sub { grid-column: 2; grid-row: 2; align-self: start; max-width: none; }
.fz-p-posted .fz-pst-empty .fsw-empty > button { grid-row: 1 / span 2; align-self: center; margin: 0 0 0 var(--fz-s-1); }
@container fzpst (max-width: 559px) {
  .fz-p-posted .fz-pst-empty .fsw-empty > button { grid-column: 2; grid-row: auto; justify-self: start; margin: var(--fz-s-2) 0 0; }
}

/* "i" + tooltip: the same quiet disc as Team's "How the numbers are calculated". */
.fz-p-posted .fz-pst-info { display: inline; }
/* The sentence's last word and the "i" wrap together (never an orphaned icon). */
.fz-p-posted .fz-pst-nowrap { white-space: nowrap; }
/* The button is the hit area (32px, 44px on phones); negative margins give back
   the extra size, so the line box and the text around it don't move. The 20px
   disc inside is what you see. */
.fz-p-posted .fz-pst-info-b {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: var(--fz-s-7);
  height: var(--fz-s-7);
  margin: calc(var(--fz-s-2) * -0.75) calc(var(--fz-s-2) * -0.75) calc(var(--fz-s-2) * -0.75) calc(var(--fz-s-1) * 0.5);
  padding: 0;
  border: 0;
  border-radius: var(--fz-r-pill);
  background: transparent;
  vertical-align: middle;
  cursor: pointer;
}
.fz-p-posted .fz-pst-info-d {
  display: grid;
  place-items: center;
  width: var(--fz-s-5);
  height: var(--fz-s-5);
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-3);
  color: var(--fz-text-2);
  font-family: var(--fz-font-display);
  font-size: var(--fz-fs-micro);
  font-weight: var(--fz-fw-bold);
  line-height: 1;
  transition: background-color var(--fz-t-fast) var(--fz-ease), color var(--fz-t-fast) var(--fz-ease);
}
.fz-p-posted .fz-pst-info-b:hover .fz-pst-info-d,
.fz-p-posted .fz-pst-info.is-open .fz-pst-info-d { background: var(--fz-border-strong); color: var(--fz-text-1); }
.fz-p-posted .fz-pst-tip {
  position: absolute;
  z-index: 30;
  top: calc(100% + var(--fz-s-2));
  left: var(--fz-card-pad);
  width: max-content;
  max-width: min(400px, calc(100% - var(--fz-card-pad) * 2));
  padding: var(--fz-s-3) var(--fz-s-4);
  background: var(--fz-surface-1);
  border: 1px solid var(--fz-border);
  border-radius: var(--fz-r-sm);
  box-shadow: var(--fz-shadow-pop);
  color: var(--fz-text-2);
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-regular);
  line-height: 1.5;
  text-align: left;
  white-space: normal;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--fz-t-fast) var(--fz-ease), transform var(--fz-t-fast) var(--fz-ease), visibility 0s linear var(--fz-t-fast);
}
.fz-p-posted .fz-pst-info-b:hover + .fz-pst-tip,
.fz-p-posted .fz-pst-info-b:focus-visible + .fz-pst-tip,
.fz-p-posted .fz-pst-info.is-open > .fz-pst-tip {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}
@container fzpst (max-width: 559px) {
  .fz-p-posted .fz-pst-info-b { width: 44px; height: 44px; margin: calc(var(--fz-s-3) * -1) calc(var(--fz-s-3) * -1) calc(var(--fz-s-3) * -1) calc(var(--fz-s-1) * -1); }
}


/* ═══ 5. CONTENT CARDS ══════════════════════════════════════════════════════
   One card per reel: who + where/when, the title, a performance well (views,
   trend, vs average), then status and the editor/strategist pair. The whole card
   opens the drawer; the title is the real <button> for keyboards. */
.fz-p-posted .fz-pst-grid {
  display: grid;
  gap: var(--fz-gap);
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  min-width: 0;
}
.fz-p-posted .fz-pst-grid.is-skel .fz-skel { min-height: 196px; }
.fz-p-posted .fz-pst-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--fz-s-4);
  min-width: 0;
  padding: var(--fz-card-pad);
  background: var(--fz-surface-1);
  border-radius: var(--fz-r-lg);
  box-shadow: var(--fz-shadow-soft);
  cursor: pointer;
  transition: box-shadow var(--fz-t-fast) var(--fz-ease), background-color var(--fz-t-fast) var(--fz-ease);
}
.fz-p-posted .fz-pst-card:hover { box-shadow: var(--fz-shadow-soft), 0 0 0 1px var(--fz-border-strong); }
[data-theme="dark"] .fz-p-posted .fz-pst-card { box-shadow: none; }
[data-theme="dark"] .fz-p-posted .fz-pst-card:hover { background: var(--fz-surface-hover); box-shadow: 0 0 0 1px var(--fz-border-strong); }
.fz-p-posted .fz-pst-card:has(.fz-pst-open:focus-visible) { box-shadow: 0 0 0 2px var(--fz-focus); }

/* Cards in one grid row share their row tracks (subgrid), so a two-line title
   never pushes one card's views well below its neighbours'. Fallback: reserve
   two title lines. */
@supports (grid-template-rows: subgrid) {
  .fz-p-posted .fz-pst-grid > .fz-pst-card {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: var(--fz-s-4);
  }
  /* The title button fills its (shared) row, so its hit area matches its neighbours'. */
  .fz-p-posted .fz-pst-grid > .fz-pst-card > .fz-pst-card-t { display: flex; }
  .fz-p-posted .fz-pst-grid > .fz-pst-card > .fz-pst-card-t > .fz-pst-open { align-self: stretch; }
}
@supports not (grid-template-rows: subgrid) {
  .fz-p-posted .fz-pst-open { min-height: calc(2.7em + var(--fz-s-4)); }
}

.fz-p-posted .fz-pst-card-h { display: flex; align-items: center; gap: var(--fz-s-3); min-width: 0; }
.fz-p-posted .fz-pst-card-who { display: flex; flex-direction: column; gap: var(--fz-s-1); flex: 1 1 auto; min-width: 0; }
.fz-p-posted .fz-pst-card-who > b {
  font-size: var(--fz-fs-body);
  font-weight: var(--fz-fw-semi);
  line-height: 1.3;
  color: var(--fz-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fz-p-posted .fz-pst-meta {
  display: flex;
  align-items: center;
  gap: var(--fz-s-1);
  min-width: 0;
  font-size: var(--fz-fs-meta);
  line-height: 1.35;
  color: var(--fz-text-3);
  white-space: nowrap;
  overflow: hidden;
}
.fz-p-posted .fz-pst-meta > span { flex: none; }
.fz-p-posted .fz-pst-play {
  appearance: none;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-2);
  color: var(--fz-text-1);
  box-shadow: inset 0 0 0 1px var(--fz-border);
  cursor: pointer;
  transition: background-color var(--fz-t-fast) var(--fz-ease), color var(--fz-t-fast) var(--fz-ease), box-shadow var(--fz-t-fast) var(--fz-ease);
}
[data-theme="dark"] .fz-p-posted .fz-pst-play { background: var(--fz-surface-3); box-shadow: none; }
.fz-p-posted .fz-pst-play:hover,
[data-theme="dark"] .fz-p-posted .fz-pst-play:hover { background: var(--fz-accent); color: var(--fz-text-on-accent); box-shadow: none; }
[data-theme="dark"] .fz-p-posted .fz-pst-play:focus-visible { border-radius: var(--fz-r-pill); }

.fz-p-posted .fz-pst-card-t {
  margin: 0;
  font-family: var(--fz-font-display);
  font-size: var(--fz-fs-card);
  font-weight: var(--fz-fw-semi);
  letter-spacing: -.01em;
  line-height: 1.35;
}
/* The button keeps an 8px vertical hit margin; the two-line clamp lives on the inner
   span, which has no padding. (`overflow` clips at the padding box, so a clamp on the
   padded button let the top of a third line peek out under the ellipsis.) */
.fz-p-posted .fz-pst-open {
  appearance: none;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: calc(var(--fz-s-2) * -1) 0;
  padding: var(--fz-s-2) 0;
  border: 0;
  background: none;
  color: var(--fz-text-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fz-p-posted .fz-pst-open-t {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.fz-p-posted .fz-pst-open:focus-visible { outline: none; }
.fz-p-posted .fz-pst-seq {
  font-family: var(--fz-font-mono);
  font-size: .86em;
  font-weight: var(--fz-fw-semi);
  letter-spacing: -.02em;
  color: var(--fz-text-3);
}

/* Performance well: surface-2 inside the surface-1 card. */
.fz-p-posted .fz-pst-perf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "n s" "m s";
  align-items: end;
  gap: var(--fz-s-1) var(--fz-s-3);
  min-height: 72px;
  padding: var(--fz-s-3) var(--fz-s-4);
  background: var(--fz-surface-2);
  border-radius: var(--fz-r-sm);
}
[data-theme="dark"] .fz-p-posted .fz-pst-card:hover .fz-pst-perf { background: var(--fz-surface-3); }
.fz-p-posted .fz-pst-card.is-fyp .fz-pst-perf { background: var(--fz-accent-soft); }
.fz-p-posted .fz-pst-perf-n { grid-area: n; display: flex; align-items: baseline; gap: var(--fz-s-2); min-width: 0; }
.fz-p-posted .fz-pst-perf-n b {
  font-family: var(--fz-font-display);
  font-size: var(--fz-fs-num-sm);
  font-weight: var(--fz-fw-semi);
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--fz-text-1);
  font-variant-numeric: tabular-nums;
}
.fz-p-posted .fz-pst-perf-n span { font-size: var(--fz-fs-meta); color: var(--fz-text-3); }
.fz-p-posted .fz-pst-perf-m { grid-area: m; font-size: var(--fz-fs-meta); line-height: 1.35; color: var(--fz-text-2); font-variant-numeric: tabular-nums; }
.fz-p-posted .fz-pst-perf-spark { grid-area: s; align-self: center; line-height: 0; }
.fz-p-posted .fz-pst-perf-spark .fsw-spark { display: block; }

.fz-p-posted .fz-pst-card-f {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fz-s-2);
  margin-top: auto;
  min-width: 0;
}
.fz-p-posted .fz-pst-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--fz-s-1) var(--fz-s-2); min-width: 0; }


/* ═══ 6. COMPACT TABLE ══════════════════════════════════════════════════════ */
.fz-p-posted .fz-pst-tpanel { padding-top: var(--fz-s-2); padding-bottom: var(--fz-s-2); }
.fz-p-posted .fz-pst-table { width: 100%; }
.fz-p-posted .fz-pst-table th { padding: var(--fz-s-3) var(--fz-s-3) var(--fz-s-2); white-space: nowrap; }
.fz-p-posted .fz-pst-table td { padding: var(--fz-s-3); vertical-align: middle; }
.fz-p-posted .fz-pst-table th:first-child,
.fz-p-posted .fz-pst-table td:first-child { padding-left: var(--fz-card-pad); }
.fz-p-posted .fz-pst-table th:last-child,
.fz-p-posted .fz-pst-table td:last-child { padding-right: var(--fz-card-pad); }
.fz-p-posted .fz-pst-table tr.is-click { cursor: pointer; }
.fz-p-posted .fz-pst-table tr.is-click:focus-visible { outline: 2px solid var(--fz-focus); outline-offset: -2px; }
/* The reel column takes whatever is left (max-width:0 lets the title ellipsis
   shrink it instead of pushing the fixed columns out of the card). */
.fz-p-posted .fz-pst-c-reel { width: 100%; }
.fz-p-posted td.fz-pst-c-reel { max-width: 0; }
.fz-p-posted .fz-pst-reel { display: flex; align-items: center; gap: var(--fz-s-3); min-width: 0; }
.fz-p-posted .fz-pst-reel-t { display: flex; flex-direction: column; gap: var(--fz-s-1); min-width: 0; }
.fz-p-posted .fz-pst-reel-t > b {
  max-width: 100%;
  font-size: var(--fz-fs-body);
  font-weight: var(--fz-fw-semi);
  line-height: 1.3;
  color: var(--fz-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fz-p-posted .fz-pst-meta > .fz-pst-reel-c { flex: 0 1 auto; min-width: 0; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; }
.fz-p-posted .fz-pst-sm-only { display: none; }
.fz-p-posted td.fz-pst-c-time { white-space: nowrap; font-size: var(--fz-fs-meta); color: var(--fz-text-2); font-variant-numeric: tabular-nums; }
.fz-p-posted td.fz-pst-c-st .fz-pst-pills { flex-wrap: nowrap; }
.fz-p-posted td.fz-pst-c-views { white-space: nowrap; }
.fz-p-posted td.fz-pst-c-views b { display: block; font-size: var(--fz-fs-body); font-weight: var(--fz-fw-semi); color: var(--fz-text-1); font-variant-numeric: tabular-nums; }
.fz-p-posted td.fz-pst-c-views span { display: block; font-size: var(--fz-fs-meta); color: var(--fz-text-3); font-variant-numeric: tabular-nums; }
.fz-p-posted .fz-pst-c-trend { width: 120px; }
.fz-p-posted td.fz-pst-c-trend .fsw-spark { display: block; }
.fz-p-posted .fz-pst-c-team { width: 72px; }
.fz-p-posted .fz-pst-table .fz-pst-team { --fz-pst-ring: var(--fz-surface-1); }
.fz-p-posted .fz-pst-table tr.is-click:hover .fz-pst-team { --fz-pst-ring: var(--fz-surface-hover); }
.fz-p-posted .fz-pst-none { color: var(--fz-text-3); }

.fz-p-posted .fz-pst-md-only { display: none; }
.fz-p-posted td.fz-pst-c-views .fz-pst-vspark { display: none; line-height: 0; margin-top: var(--fz-s-1); }
.fz-p-posted td.fz-pst-c-views .fz-pst-vspark .fsw-spark { display: inline-block; }

/* Tablet column: the Posted time folds into the reel's meta line and the status
   pills under the title, so the title, views, trend and team keep their room. */
@container fzpst (max-width: 759px) {
  .fz-p-posted .fz-pst-table .fz-pst-c-time,
  .fz-p-posted .fz-pst-table .fz-pst-c-st { display: none; }
  .fz-p-posted .fz-pst-table .fz-pst-meta > .fz-pst-md-only { display: inline; }
  .fz-p-posted .fz-pst-table .fz-pst-pills.fz-pst-sm-only { display: inline-flex; }
  .fz-p-posted .fz-pst-c-trend { width: 96px; }
}
@container fzpst (max-width: 559px) {
  /* Phone: Reel + Views only. The trend moves under the view count (in place of
     "× avg"); the team is one tap away in the drawer. */
  .fz-p-posted .fz-pst-table .fz-pst-c-trend,
  .fz-p-posted .fz-pst-table .fz-pst-c-team { display: none; }
  .fz-p-posted .fz-pst-table td.fz-pst-c-views .fz-pst-vspark { display: block; }
  .fz-p-posted .fz-pst-table td.fz-pst-c-views .fz-pst-nsm { display: none; }
  .fz-p-posted .fz-pst-reel { align-items: flex-start; }
  .fz-p-posted .fz-pst-reel-t > b { max-width: 100%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .fz-p-posted .fz-pst-table .fz-pst-meta > .fz-pst-pfl { display: none; }
  .fz-p-posted .fz-pst-meta > .fz-pst-reel-c { max-width: 13ch; }
  .fz-p-posted .fz-pst-table th:first-child,
  .fz-p-posted .fz-pst-table td:first-child { padding-left: var(--fz-s-4); }
  .fz-p-posted .fz-pst-table th:last-child,
  .fz-p-posted .fz-pst-table td:last-child { padding-right: var(--fz-s-4); }
}


/* ═══ 7. SHARED BITS ════════════════════════════════════════════════════════ */
.fz-pst-pf { flex: none; }
/* Editor + strategist: two overlapping circles. The inner avatar ignores the
   pointer so the wrapper's "Editor · name" tooltip shows. */
.fz-pst-team { display: inline-flex; align-items: center; flex: none; --fz-pst-ring: var(--fz-surface-1); }
.fz-pst-team-i { display: inline-flex; flex: none; border-radius: var(--fz-r-pill); }
.fz-pst-team-i + .fz-pst-team-i { margin-left: var(--fz-s-1); }
.fz-pst-team-i > .fsw-avatar { pointer-events: none; box-shadow: 0 0 0 2px var(--fz-pst-ring); }
[data-theme="dark"] .fz-p-posted .fz-pst-card:hover .fz-pst-team { --fz-pst-ring: var(--fz-surface-hover); }
.fz-pst-dot { display: inline-block; flex: none; width: var(--fz-s-2); height: var(--fz-s-2); border-radius: var(--fz-r-pill); background: var(--fz-neutral); }
.fz-pst-dot.is-ok   { background: var(--fz-ok); }
.fz-pst-dot.is-warn { background: var(--fz-warn); }
.fz-pst-dot.is-crit { background: var(--fz-crit); }


/* ═══ 8. DRAWER ═════════════════════════════════════════════════════════════
   Built on the reel-drawer recipe (fz-overlays.css: .fz-ov-card / -facts / -rows /
   -people). Only the Posted-specific parts live here. */
.fz-pst-drawer .fz-pst-pfpill {
  display: inline-flex;
  align-items: center;
  gap: var(--fz-s-1);
  height: var(--fz-s-6);
  padding: 0 var(--fz-s-3);
  border-radius: var(--fz-r-pill);
  background: var(--fz-neutral-soft);
  color: var(--fz-text-2);
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-semi);
  line-height: 1;
  white-space: nowrap;
}
.fz-pst-drawer .fz-pst-sync { flex: none; font-size: var(--fz-fs-meta); color: var(--fz-text-3); }
.fz-pst-drawer .fz-pst-sync.is-warn { color: var(--fz-warn-ink); font-weight: var(--fz-fw-semi); }
/* Likes · Comments · vs client avg: always ONE row of equal tiles (1, 2 or 3 of
   them, whichever the payload has). auto-fit at 96px broke 3 tiles into 2 + 1 with
   a half-width hole on a 360px phone; the values are short ("68", "1.0×"). */
.fz-pst-drawer .fz-pst-dstats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--fz-s-2);
}
.fz-pst-drawer .fz-pst-dstat {
  display: flex;
  flex-direction: column;
  gap: var(--fz-s-1);
  min-width: 0;
  padding: var(--fz-s-3);
  border-radius: var(--fz-r-sm);
  background: var(--fz-surface-1);
}
.fz-pst-drawer .fz-pst-dstat b {
  font-family: var(--fz-font-display);
  font-size: var(--fz-fs-section);
  font-weight: var(--fz-fw-semi);
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--fz-text-1);
  font-variant-numeric: tabular-nums;
}
.fz-pst-drawer .fz-pst-dstat span { font-size: var(--fz-fs-meta); color: var(--fz-text-3); }
/* Full-screen sheet: a 360px phone leaves ~93px per tile, 1px short of
   "vs client avg" on one line. The text is left-aligned, so only the right inset
   gives way (12 → 8); the left edge stays in line with the other tiles. */
@media (max-width: 640px) {
  .fz-pst-drawer .fz-pst-dstat { padding-right: var(--fz-s-2); }
}

/* Views form (leads): number field grows, Save sits beside it, hint below. */
.fz-pst-drawer .fz-pst-vform { display: flex; flex-direction: column; gap: var(--fz-s-2); min-width: 0; }
.fz-pst-drawer .fz-pst-vform > .fsw-field { margin: 0; min-width: 0; }
.fz-pst-drawer .fz-pst-vrow { display: flex; align-items: center; gap: var(--fz-s-2); min-width: 0; }
.fz-pst-drawer .fz-pst-vrow > .fsw-input.is-num { flex: 1 1 auto; width: auto; min-width: 0; max-width: none; height: 40px; }
.fz-pst-drawer .fz-pst-vrow > button { flex: none; min-height: 40px; }
.fz-pst-drawer .fz-pst-vform .fsw-field-hint { display: block; margin-top: var(--fz-s-2); color: var(--fz-text-3); line-height: 1.45; }
.fz-pst-drawer .fz-pst-vform > .fsw-err { margin: 0; }
@media (max-width: 640px) {
  .fz-pst-drawer .fz-pst-vrow > .fsw-input.is-num,
  .fz-pst-drawer .fz-pst-vrow > button { min-height: 44px; }
}

/* Approval trail: a vertical timeline of faces; the ring carries the event tone,
   the sentence carries the meaning. */
.fz-pst-drawer .fz-pst-trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fz-pst-drawer .fz-pst-trail-i {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--fz-s-3);
  padding-bottom: var(--fz-s-4);
}
.fz-pst-drawer .fz-pst-trail-i:last-child { padding-bottom: 0; }
.fz-pst-drawer .fz-pst-trail-i:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 30px;
  bottom: 4px;
  width: 2px;
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-3);
}
.fz-pst-drawer .fz-pst-trail-av { display: flex; padding-top: 1px; }
.fz-pst-drawer .fz-pst-trail-av .fsw-avatar { box-shadow: 0 0 0 2px var(--fz-surface-2); }
.fz-pst-drawer .fz-pst-trail-i.is-ok .fz-pst-trail-av .fsw-avatar,
.fz-pst-drawer .fz-pst-trail-i.is-ok .fz-pst-trail-sys { box-shadow: 0 0 0 2px var(--fz-ok); }
.fz-pst-drawer .fz-pst-trail-i.is-crit .fz-pst-trail-av .fsw-avatar,
.fz-pst-drawer .fz-pst-trail-i.is-crit .fz-pst-trail-sys { box-shadow: 0 0 0 2px var(--fz-crit); }
.fz-pst-drawer .fz-pst-trail-i.is-warn .fz-pst-trail-av .fsw-avatar,
.fz-pst-drawer .fz-pst-trail-i.is-warn .fz-pst-trail-sys { box-shadow: 0 0 0 2px var(--fz-warn); }
.fz-pst-drawer .fz-pst-trail-sys {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-3);
  color: var(--fz-text-3);
}
.fz-pst-drawer .fz-pst-trail-t { display: flex; flex-direction: column; gap: var(--fz-s-1); min-width: 0; }
.fz-pst-drawer .fz-pst-trail-l { font-size: var(--fz-fs-body); line-height: 1.45; color: var(--fz-text-2); overflow-wrap: anywhere; }
.fz-pst-drawer .fz-pst-trail-l b { color: var(--fz-text-1); font-weight: var(--fz-fw-semi); }
.fz-pst-drawer .fz-pst-trail-d { font-size: var(--fz-fs-meta); color: var(--fz-text-3); font-variant-numeric: tabular-nums; }

/* "Show N earlier events": a quiet row above the latest events. */
.fz-pst-drawer .fz-pst-trail-w { display: flex; flex-direction: column; gap: var(--fz-s-3); min-width: 0; }
.fz-pst-drawer .fz-pst-trail-more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--fz-s-3);
  min-height: 32px;
  margin: 0;
  padding: 0 var(--fz-s-3) 0 0;
  border: 0;
  border-radius: var(--fz-r-pill);
  background: transparent;
  color: var(--fz-accent-ink);
  font: inherit;
  font-size: var(--fz-fs-meta);
  font-weight: var(--fz-fw-semi);
  cursor: pointer;
}
.fz-pst-drawer .fz-pst-trail-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.fz-pst-drawer .fz-pst-trail-more-i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--fz-r-pill);
  background: var(--fz-surface-3);
  color: var(--fz-text-2);
}
@media (max-width: 640px) { .fz-pst-drawer .fz-pst-trail-more { min-height: 40px; } }
