/* dashboard-posts.css (milestone U): layout for the post lists and the post page. Colours come only from the theme
   tokens and dashboard.css's --d-* mixes; chips, buttons, tabs, tables, rows, sections and fields are the shared ones.
   Calm round: no panels. The lists are one full width table on the desk under one row of tabs and search; the post
   page is sections with a heading each. The post itself is New post's form (layout-1129), which dashboard-new.css
   lays out, the When card its one panel; this file keeps the banner above it and the board, approval, review and
   history below it. The lists and the board follow the width of their own column through container queries, so they
   read the same with the sidebar, without it, in a half screen window or zoomed in; the form follows the window, so
   its phone bar stays fixed to the screen. */

/* ---------- the lists: tabs, search and Filters on one row ---------- */
.posts-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 32px;margin:0 0 16px}
.posts-bar .tabs{flex:1 1 auto;min-width:0;margin:0}
.posts-filters{display:flex;flex:0 1 420px;align-items:center;gap:8px;min-width:min(100%,280px);margin:0}
.posts-f-q{flex:1 1 auto;min-width:0}
.posts-search{position:relative}
.posts-search .icon{position:absolute;left:10px;top:50%;margin-top:-8px;color:var(--muted);pointer-events:none}
.posts-search input{width:100%;padding-left:32px}
.posts-f-toggle{flex:none}
.posts-f-toggle[aria-expanded="true"] .icon{transform:rotate(180deg)}
.posts-f-n{color:inherit}
.posts-f-more{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px;margin:0 0 24px}
.posts-f-more .field{flex:0 1 220px;min-width:min(100%,170px);margin:0}
.posts-f-dates{display:flex;flex:0 1 456px;gap:12px 16px;min-width:0}
.posts-f-dates .field{flex:1 1 160px;min-width:0}
.posts-f-dates input,.posts-when-row input{width:100%;min-width:0}
.posts-f-clear{display:flex;align-items:center;min-height:var(--d-h)}

/* ---------- the lists: one full width table ---------- */
.posts-list{container:posts-list / inline-size;min-width:0}
.posts-skel{padding:8px 0}
.posts-error{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:16px 0;color:var(--text)}
.posts-error p{flex:1 1 240px;margin:0}
.posts-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:16px 0 0;border-top:1px solid var(--line)}
.posts-foot .note{margin:0}
/* The More menu hangs below its row, so the table is never clipped; it stacks before it can get wider than its column. */
.table-wrap.posts-wrap{overflow:visible}
.table.posts-table td{padding-top:12px;padding-bottom:12px;vertical-align:top}
.table.posts-table .posts-c-thumb{width:48px;padding-right:0}
.table.posts-table td.posts-c-thumb{padding-top:10px;padding-bottom:10px}
.posts-c-post{min-width:180px;overflow-wrap:anywhere}
.posts-c-when,.posts-c-state{white-space:nowrap}
.posts-c-acts{width:1%}
.posts-thumb{display:block;width:36px;height:48px;object-fit:cover;background:var(--panel-deep)}
.posts-thumb-none{display:grid;place-items:center;color:var(--muted)}
.table td a.posts-title{font-size:14px;font-weight:600;line-height:1.35;color:var(--text)}
.posts-snip{display:-webkit-box;max-width:64ch;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical}
/* W1: who made a post an AI made, or whose send waits for an OK: one quiet line under the name */
.posts-from{display:block;margin-top:2px}
.posts-when{display:block}
.table.posts-table .posts-c-when .num{text-align:left}
.posts-tgs{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0;padding:0;list-style:none}
.posts-tg{display:inline-flex;align-items:center;gap:6px;font-size:13px;white-space:nowrap}
.table td a.posts-tg-link{display:inline-flex;align-items:center;gap:4px}
.posts-tg-link .icon{color:var(--muted)}
.posts-acts{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.posts-c-acts .posts-acts{flex-wrap:nowrap;justify-content:flex-end}

/* the quiet More button and its menu, on both pages */
.posts-more{position:relative}
.btn.ghost.posts-more-btn{border-color:transparent;color:var(--muted)}
.btn.ghost.posts-more-btn:not(:disabled):not([aria-disabled="true"]):hover,.btn.ghost.posts-more-btn[aria-expanded="true"]{border-color:var(--d-edge);color:var(--text)}
.posts-more-btn[aria-expanded="true"] .icon{transform:rotate(180deg)}
.posts-menu{position:absolute;right:0;top:calc(100% + 4px);z-index:15;min-width:184px;padding:4px 0;background:var(--panel-deep);border:1px solid var(--d-edge);box-shadow:6px 6px 0 0 var(--shadow-ink)}
.posts-menu button{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:0 14px;border:0;background:none;color:var(--text);font:400 13px/1.2 var(--d-body);text-align:left;white-space:nowrap;cursor:pointer}
.posts-menu button:hover,.posts-menu button:focus{background:var(--d-hover)}
.posts-menu button:focus-visible{outline-offset:-3px}
.posts-menu .icon{color:var(--muted)}

/* A narrower column: each post is a row of its own. The video on the left; the name with More at its right; then
   the state and the time; then the accounts. */
@container posts-list (max-width:979.98px){
  .table.posts-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .table.posts-table,.table.posts-table tbody{display:block;width:100%}
  .table.posts-table tr{display:grid;grid-template-columns:36px auto minmax(0,1fr) auto;column-gap:16px;row-gap:6px;align-items:center;padding:14px 0;border-bottom:1px solid var(--line)}
  .table.posts-table tbody tr:last-child{border-bottom:0}
  .table.posts-table td{display:block;width:auto;min-width:0;height:auto;padding:0;border:0;text-align:left}
  .table.posts-table td.posts-c-thumb{grid-column:1;grid-row:1 / span 3;align-self:start;padding:0;width:auto}
  .table.posts-table .posts-c-post{grid-column:2 / span 2;grid-row:1;align-self:start}
  .table.posts-table .posts-c-acts{grid-column:4;grid-row:1;align-self:start;width:auto}
  .table.posts-table .posts-c-state{grid-column:2;grid-row:2}
  .table.posts-table .posts-c-when{display:flex;flex-wrap:wrap;gap:2px 8px;align-items:baseline;grid-column:3 / span 2;grid-row:2;white-space:normal}
  .table.posts-table .posts-c-when .sub{margin-top:0}
  .table.posts-table .posts-c-tg{grid-column:2 / span 3;grid-row:3}
}
/* Phone width: the state and the time each get a line. */
@container posts-list (max-width:519.98px){
  .table.posts-table tr{grid-template-columns:36px minmax(0,1fr) auto;column-gap:12px}
  .table.posts-table td.posts-c-thumb{grid-row:1 / span 4}
  .table.posts-table .posts-c-post{grid-column:2}
  .table.posts-table .posts-c-acts{grid-column:3}
  .table.posts-table .posts-c-state{grid-column:2 / span 2;grid-row:2}
  .table.posts-table .posts-c-when{grid-column:2 / span 2;grid-row:3}
  .table.posts-table .posts-c-tg{grid-column:2 / span 2;grid-row:4}
  .table.posts-table .posts-c-when .num{white-space:nowrap}
}

/* ---------- the post page ---------- */
/* no size container here: it would hold the form's fixed phone bar to the page instead of the screen */
.posts-page{min-width:0}
.posts-page > .new-form{margin:0 0 var(--d-section)}

/* where the post is: one line, no box */
.posts-banner-main{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.posts-banner-text{max-width:80ch;margin:0;font-size:16px;line-height:1.4;color:var(--text);font-variant-numeric:tabular-nums}
.posts-banner-text:focus:not(:focus-visible),.posts-name:focus:not(:focus-visible){outline:none}
.posts-meta{margin:6px 0 0}
.posts-warn{display:grid;gap:6px;margin:12px 0 0;padding:0;list-style:none}
.posts-warn li,.posts-reconnect{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px 8px;font-size:13px;color:var(--text)}
.posts-warn li{flex-wrap:nowrap}
.posts-warn li > span{flex:1 1 0;min-width:0}
.posts-reconnect{margin:12px 0 0}
.posts-warn .icon,.posts-reconnect .icon,.posts-hint .icon{margin-top:2px;color:var(--muted)}

/* the results board: one row per platform, readable at every width */
.posts-board{container:posts-board / inline-size}
.posts-head-acts{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;font-family:var(--d-body);letter-spacing:0;text-transform:none}
.posts-board-note{margin:-8px 0 4px}
.rows > li.posts-row{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"who st" "detail detail" "acts acts";align-items:start;gap:8px 16px;min-height:0;padding:16px 0}
.posts-row > .posts-who{grid-area:who}
.posts-row > .posts-st{grid-area:st;justify-content:flex-end}
.posts-row > .posts-detail{grid-area:detail}
.posts-row > .posts-row-acts{grid-area:acts;justify-content:flex-start}
@container posts-board (min-width:760px){
  .rows > li.posts-row{grid-template-columns:minmax(150px,220px) minmax(0,1fr) auto;grid-template-rows:auto 1fr;grid-template-areas:"who detail acts" "st detail acts";row-gap:6px;column-gap:24px}
  .posts-row > .posts-st{justify-content:flex-start}
  .posts-row > .posts-row-acts{justify-content:flex-end;max-width:320px}
}
.posts-who{display:grid;gap:2px;min-width:0}
.posts-who .sub{font-size:12px;color:var(--muted);overflow-wrap:anywhere}
.section h3.posts-name{margin:0;font-size:15px;line-height:1.25;color:var(--text)}
.posts-st{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.posts-detail{display:grid;gap:8px;min-width:0}
.posts-line{display:flex;align-items:center;gap:8px;margin:0;color:var(--text);font-variant-numeric:tabular-nums}
.posts-line.sub{font-size:12px;color:var(--muted)}
.posts-said{display:grid;gap:4px}
.posts-quote{margin:0;padding:2px 0 2px 12px;border-left:2px solid var(--line-strong);color:var(--text);overflow-wrap:anywhere}
.posts-hint{display:flex;align-items:flex-start;gap:8px;margin:0;font-size:13px;color:var(--text)}
.posts-why{margin:0}
.posts-fc{display:grid;gap:6px;margin-top:4px}
.posts-fc .posts-acts{margin-top:2px}
.posts-fc-text{margin:0;overflow-wrap:anywhere}
.posts-progress{display:grid;gap:6px;max-width:360px}
.posts-checks{display:grid;gap:2px;margin:0;padding:0 0 0 16px;font-size:13px;color:var(--muted);overflow-wrap:anywhere}
.posts-checks li{margin:0}
.posts-progress .note{margin:0}

/* the form's When card holds the page's notes: approval, which file each platform gets, read only */
.posts-approval-note,.posts-files,.posts-readonly{margin:12px 0 0}
/* approval notes and the script keep their line breaks */
.posts-caption{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
/* the dialogs: Accept's link to the page that plays the copy, and Pick a new time's date and time */
.posts-acc-files{margin:0 0 12px}
.posts-when-row{display:flex;flex-wrap:wrap;gap:12px 16px}
.posts-when-row .field{flex:1 1 150px;max-width:220px;min-width:0;margin:0}
.posts-form-acts{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin-top:24px}
.posts-later .posts-when-row{margin:0 0 8px}
.posts-later .err{margin:0 0 8px}

/* approval, review, project and history: side by side when there is room */
.posts-extra{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr));column-gap:48px;align-items:start}
.posts-extra > .section{margin:0 0 var(--d-section)}
.posts-approvals{margin:0 0 8px}
.rows.posts-approvals > li{align-items:flex-start}
.posts-ap-text{display:grid;gap:4px;min-width:0}
.posts-stale,.posts-stale .posts-caption{color:var(--muted)}
.posts-ap-controls{margin-top:12px}
.posts-ap-decide .note{margin:0}
.posts-ap-form .field{margin:0}
/* W1: a post an AI sent: Accept at the top says what a press does, so on a narrow screen its words wrap rather than
   run off it; who asked; a Posts row's Accept dialog's time choice */
.btn.posts-accept{height:auto;min-height:var(--d-h);padding-top:6px;padding-bottom:6px;line-height:1.3;white-space:normal;text-align:center}
.posts-held-who{margin:0;max-width:72ch}
.posts-acc-when{display:grid;gap:10px;margin:0;padding:0;border:0;min-width:0}
.posts-acc-opt{align-items:flex-start;line-height:1.4}
.posts-acc-opt input{flex:none;margin-top:2px}
.posts-acc-pick{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:8px 12px;margin:4px 0 0 24px}
.posts-acc-pick .field{margin:0}
.posts-acc-zone{grid-column:1 / -1;margin:0}
.posts-review p{margin:0 0 12px}
.posts-new{color:var(--text)}
.posts-project p{margin:0 0 8px}
.posts-script summary{color:var(--text);cursor:pointer}
.posts-script[open] summary{margin-bottom:8px}
.posts-history .rows > li{align-items:baseline}
.posts-history time{flex:0 0 150px}

/* ---------- phone width ---------- */
@media (max-width:720px){
  .posts-filters{flex:1 1 100%}
  .posts-f-more .field{flex:1 1 150px}
  .posts-f-dates{flex:1 1 100%}
  .posts-history .rows > li{flex-wrap:wrap;gap:2px 12px}
  .posts-history time{flex:1 1 100%}
  .posts-form-acts .btn{flex:1 1 auto}
}
/* the When card's buttons sit in New post's bar at the bottom of the screen; New post keeps room under its form for
   it. The post page reserves that space below its last section */
@media (max-width:599.98px){
  .posts-page .new-form{padding-bottom:0}
  .posts-page:has(#new-actions){padding-bottom:calc(150px + env(safe-area-inset-bottom))}
}
@media (max-width:400px){
  .posts-f-dates{flex-direction:column}
  .posts-f-dates .field{flex:0 0 auto}
  .posts-when-row .field{max-width:none}
}
