/* GROWTH, TO DO (public/rooms/growth/approve.js: the page is the one-glance pieces, room-layout.css .rv-g-*), its item
   screen (public/rooms/queue.js) and the calling screen (public/rooms/growth/calls.js). A campaign, a meeting, a list ask,
   Hermes's question and a group's every row open centred dialogs. The item screen shows the letter and its
   buttons, the facts beside it from 1024. A call sheet holds who and Call on top, the script in the middle (held to the
   window, scrolling inside itself when long) and the outcome at its foot, always in sight. */
.rv-room.cl .cl-dim,.ap-dialog .ap-dim,.cl-dialog .cl-dim{color:var(--muted)}
.rv-room.cl .cl-line{font-size:var(--t-row);color:var(--muted)}

/* The longest brand can wrap so the bar and its figure stay inside the room. */
.ap .rv-g-bars{grid-template-columns:fit-content(45%) minmax(0,1fr) auto}
.ap .rv-g-bl{min-width:0;min-height:28px;overflow-wrap:anywhere}
.rv-growth .ap .rv-g-tools .btn{min-width:0;padding-inline:14px}

/* A group's dialog lays its rows out by its own width. */
.ap-dialog.ap-group .rv-dialog-body{container:glance / inline-size}
.ap-group-content{display:flex;flex-direction:column;gap:12px}
.ap-group-content > *{flex:none}
.ap-group-content .rv-pager{margin-top:0;border-top:1px solid var(--line);padding-top:12px}
@media (max-width:559px){
  .ap-dialog.ap-group .rv-dialog-body{min-height:0}
  .ap-dialog.ap-group .ap-group-content{flex:1 1 auto;min-height:0}
  .ap-group-content .rv-pager{margin-top:auto}
}
.ap-dialog .ap-q-words{text-wrap:pretty}
.ap-dialog .ap-q-words + .ap-dim{margin-top:8px}

/* the dialogs: the facts, the words, then what deciding means in one plain paragraph */
.ap-dialog .rv-dialog-body .ap-say{margin-top:12px;color:var(--ink)}
.ap-dialog form{margin-top:16px}
.ap-dialog .ap-two{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.ap-dialog .ap-words{white-space:pre-wrap;overflow-wrap:break-word}
/* a letter batch: the first letter as it prints, set apart as the campaign's example is; the print batch's two files */
.ap-dialog.ap-letters .label{margin-top:16px}
.ap-dialog.ap-letters .ap-letter{margin-top:6px;padding-block:12px;border-block:1px solid var(--line)}
.ap-dialog.ap-letters .ap-files{margin-top:12px}
.ap-dialog .go,.cl-dialog .go{margin-top:16px}
.ap-dialog.ap-ask .go{margin-top:20px}
.ap-dialog .card .f.ap-addr .v{overflow-wrap:break-word}
@media (max-width:479px){.ap-dialog .ap-two{grid-template-columns:1fr}.ap-dialog .card .f.ap-addr .v{flex-basis:100%}}
/* a campaign's words as one email reads them; a blank no waiting email fills stays its words, marked as a blank */
.ap-dialog .ap-ex{margin-top:12px;padding-block:12px;border-block:1px solid var(--line)}
.ap-dialog .ap-ex .label{margin-bottom:4px}
.ap-dialog .ap-blank{color:var(--muted);text-decoration:underline dashed;text-underline-offset:4px}
.ap-dialog .ap-ex .ap-open{margin-top:8px}
.cl-dialog form{display:grid;gap:16px;margin-top:12px}

/* THE ITEM SCREEN inside the tab (public/rooms/queue.js): the tab's heading, then the one item. The way back sits beside
   the heading at every width */
.rv-room.rv-queue .rv-head,.rv-room.cl .rv-head{flex-wrap:nowrap;align-items:center}
.rv-room.rv-queue .rv-title,.rv-room.cl .rv-title{flex:1 1 auto}
.rv-room.rv-queue .rv-tools,.rv-room.cl .rv-tools{flex:none}
.rv-room.cl .rv-tools{display:flex;align-items:center;gap:12px}
.rv-queue .stage{grid-template-columns:minmax(0,1fr)}
/* who it goes to and the button on one line, the address under them on its own, breaking only before its @ */
.rv-queue .q .ctx{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"chan why" "to to";align-items:center;column-gap:12px}
.rv-queue .q .ctx .who{display:contents}
.rv-queue .q .ctx .chan{grid-area:chan}
.rv-queue .q .ctx .to{grid-area:to;color:var(--ink);font-size:var(--t-row);overflow-wrap:break-word}
.rv-queue .q .ctx .whyb{grid-area:why}
.rv-queue .q .mono{font-family:var(--body);letter-spacing:0}
.rv-queue .q .qwhy{padding:4px 0 12px;color:var(--ink);text-wrap:pretty}
.rv-queue .q .qwhy .label{display:inline;margin-right:8px;color:var(--muted)}
.rv-queue .q .qwhy .nos{color:var(--dim)}
/* the buttons: one height, one row */
.rv-queue .q .acts{flex-wrap:wrap;gap:8px}
.rv-growth .rv-queue .q .whyb span,.rv-growth .rv-queue .q .acts :is(.quiet,.ctl){background:none}
.rv-growth .rv-queue .q .whyb span{border:0;padding-inline:0;color:var(--accent)}
.rv-growth .rv-queue .q .ctx{padding-bottom:8px}
.rv-growth .rv-queue .q .dock{border-top:1px solid var(--line)}
.rv-queue .q .acts .btn,.rv-queue .q .acts .quiet,.rv-queue .q .acts .ctl{flex:1 1 auto;min-height:44px;padding:0 12px;white-space:nowrap}
.rv-queue .q .acts .btn{flex-grow:2}
.rv-queue .q .ctl{min-height:44px}
.rv-queue .q-about{display:none}
/* the card is a page: on a tall window it keeps a page's height, the letter on top and its buttons at the foot */
.rv-growth .rv-queue .item.rv-panel{display:flex;flex-direction:column;min-height:min(480px,calc(100svh - 270px));padding:0}
.rv-queue .item > .ltr{flex:1 0 auto;display:flex;flex-direction:column}
.rv-queue .item > .ltr > .dock{margin-top:auto}
/* The letter scrolls separately from its controls. */
@media (max-width:559px){
  .rv-growth .rv-queue .q .qw{inset:0;width:auto;max-height:none;translate:none;border:0;border-radius:0;background:var(--bg);padding:env(safe-area-inset-top) var(--gutter) max(16px,env(safe-area-inset-bottom))}
  .rv-growth .rv-queue .q .qw-head{min-height:68px}
  .rv-growth .rv-queue .q .qw-head .label{font-size:var(--t-room)}
}
@media (max-width:767px){
  .rv-queue .q div.ltr > .sheet{padding-bottom:40px;-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 40px),transparent);mask-image:linear-gradient(to bottom,#000 calc(100% - 40px),transparent)}
  .rv-queue .q div.ltr > .sheet::-webkit-scrollbar{width:6px}
  .rv-queue .q div.ltr > .sheet::-webkit-scrollbar-thumb{background:var(--line2);border-radius:3px}
}
@media (max-width:1023px){
  /* while he edits or rejects, the form takes the why line's and the facts button's room: he read them on the way in */
  .rv-queue .item:has(> form.ltr) > p.qwhy,.rv-queue .item:has(> form.ltr) .whyb{display:none}
  .rv-queue .item:has(> form.ltr) .ctx{min-height:0;padding-bottom:12px}
  .rv-queue .q .qw-scrim{bottom:0}
  .rv-queue .q .qw{left:50%;right:auto;top:50%;bottom:auto;translate:-50% -50%;width:min(560px,calc(100vw - 24px));max-height:calc(100svh - 48px);border:1px solid var(--line2);border-radius:12px}
}
/* a short window: a one-line field takes its label beside it, so the message keeps its room */
@media (max-height:760px) and (max-width:1023px){.rv-queue form.ltr .fld:has(> input){grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:12px}}
/* From 1024, the letter and its controls sit next to the facts. */
@media (min-width:1024px){
  .rv-growth .rv-queue .item.rv-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,360px);grid-template-rows:auto auto 1fr;column-gap:32px;align-items:start}
  .rv-queue .item > *{grid-column:1}
  .rv-queue .item > .ctx{grid-row:1}
  .rv-queue .item > p.qwhy ~ p.qwhy{grid-row:2}
  .rv-queue .item > .ltr{grid-row:3;align-self:stretch}
  .rv-queue .q .sheet .words{max-width:72ch}
  .rv-queue .item > .q-about{display:block;grid-column:2;grid-row:1 / -1;align-self:stretch;padding-left:32px;border-left:1px solid var(--line)}
  .rv-queue .q .q-about .qw-facts .f{grid-template-columns:104px minmax(0,1fr)}
  .rv-queue .q .q-about .qw-facts dd{overflow-wrap:break-word;word-break:normal}
  .rv-queue .q .q-about .qw-facts .f:first-child{padding-top:4px}
  .rv-queue .q .ctx .whyb,.rv-queue .item > p.qwhy:first-of-type{display:none}
  .rv-queue .q .ctx{grid-template-areas:"chan" "to";grid-template-columns:minmax(0,1fr);padding-bottom:12px}
  .rv-queue .q .acts .btn,.rv-queue .q .acts .quiet,.rv-queue .q .acts .ctl{flex:0 0 auto;padding:0 20px}
  .rv-queue .q .acts .btn{min-width:160px}
}

/* THE CALL SHEET: who and Call on top, the script under them, the outcome last; nothing past the window */
.rv-room.cl .cl-sheet{display:flex;flex-direction:column;gap:12px;padding:0}
.rv-room.cl .cl-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px}
.rv-room.cl .cl-whom{min-width:0}
.rv-room.cl .cl-who{font-size:var(--t-head)}
.rv-room.cl .cl-who .label{display:inline;margin-right:4px}
.rv-room.cl .cl-who b{font-weight:var(--w-strong)}
.rv-room.cl .cl-call{flex:none;font-size:var(--t-head)}
.rv-room.cl .cl-num{font-size:var(--t-head)}
.rv-room.cl .cl-wait{max-width:360px;color:var(--muted)}
.rv-room.cl .cl-wait b{color:var(--ink);font-weight:var(--w-mid)}
.rv-room.cl .cl-closed{display:flex;flex-direction:column;align-items:flex-start;gap:8px;max-width:360px}
.rv-room.cl .cl-script{display:flex;flex-direction:column;gap:8px;min-height:0;overflow:auto;overscroll-behavior:contain;padding-top:12px;border-top:1px solid var(--line)}
.rv-room.cl .cl-script > .label:not(:first-child){margin-top:8px}
/* a script longer than its box shows a shade at the edge that has more; the shade goes when that edge is reached */
.rv-room.cl .cl-script{background:linear-gradient(var(--bg2) 30%,transparent) top/100% 32px no-repeat local,linear-gradient(transparent,var(--bg2) 70%) bottom/100% 32px no-repeat local,linear-gradient(color-mix(in srgb,var(--ink) 16%,transparent),transparent) top/100% 16px no-repeat scroll,linear-gradient(transparent,color-mix(in srgb,var(--ink) 16%,transparent)) bottom/100% 16px no-repeat scroll}
.rv-room.cl .cl-script:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.rv-room.cl .cl-they{color:var(--muted)}
.rv-room.cl .cl-ask{font-weight:var(--w-mid)}
.rv-room.cl .cl-moreb > summary{display:flex;align-items:center;min-height:44px;color:var(--accent);cursor:pointer}
/* the source: a 44px target around the words, the line itself unmoved */
.rv-room.cl .cl-src{padding-block:14px;color:var(--accent);overflow-wrap:break-word}
.rv-room.cl .cl-script > p:has(> .cl-src){padding-bottom:14px}
.rv-room.cl .cl-after,.rv-room.cl .cl-foot{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding-top:12px;border-top:1px solid var(--line)}
.rv-room.cl .cl-after .fld{display:grid;gap:4px;min-width:0}
.rv-room.cl .cl-after textarea{width:100%;min-height:48px;height:48px;padding:12px;border:1px solid var(--line2);border-radius:10px;background:var(--bg);color:var(--ink);font:var(--w-row) var(--t-head)/1.4 var(--body);resize:vertical}
.rv-room.cl .cl-out{display:flex;flex-wrap:wrap;gap:8px}
.rv-room.cl .cl-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}
.rv-room.cl .cl-nav span{color:var(--muted)}
/* a long script shows that it scrolls */
.rv-room.cl .cl-script::-webkit-scrollbar{width:6px}
.rv-room.cl .cl-script::-webkit-scrollbar-thumb{background:var(--line2);border-radius:3px}
/* the phone: the four outcomes share one row where they fit, two rows of two where they do not */
@media (max-width:479px){
  .rv-room.cl .cl-out{flex-wrap:nowrap}
  .rv-room.cl .cl-out .btn{flex:1 1 auto;min-width:44px;padding:0 10px;white-space:nowrap}
  .rv-room.cl .cl-call{width:100%}
}
@media (max-width:419px){.rv-room.cl .cl-out{display:grid;grid-template-columns:1fr 1fr}}
/* a short window: what they said takes its label beside it, so the script keeps its room */
@media (max-height:760px){.rv-room.cl .cl-after .fld{grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:12px}}
/* a wide screen: what they said and the outcomes on one line */
@media (min-width:1024px){
  .rv-room.cl .cl-after{grid-template-columns:minmax(0,1fr) auto;align-items:end;column-gap:16px}
  .rv-room.cl .cl-after > [role=status]{grid-column:1 / -1}
}
