/* GROWTH, FINDER AND SENDING DOMAINS (public/rooms/growth/finder.js, domains.js): the day's page of a day book
   (DESIGN.md). The headline, one picture, then a ruled page: printed column heads over a double rule, one line an entry
   with a hairline between its columns, and a footing under a double rule that carries the total. Materials from
   theme.css. Blue only on the picture's leading bar, links and the focus ring: a mail state is ink, half ink, a ring
   or a dashed ring, always with its word. */
.gr-tabview:has(> .db-page){container:glance / inline-size}
.db-page{flex:1 1 auto}
.db-page .mono{font-family:var(--mono);letter-spacing:0}
.db-next{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0;color:var(--muted)}
.db-act{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1px solid var(--line2);border-radius:var(--r-ctl);background:transparent;color:var(--ink);font-weight:500;text-decoration:none}
.db-act:hover{background:var(--bg3)}

/* ---- a mail state: its mark and its word ---- */
.db-lt{display:inline-flex;align-items:center;gap:8px;color:var(--ink);white-space:nowrap}
.db-lt i{flex:none;box-sizing:border-box;width:12px;height:12px;border-radius:50%}
.db-lt.is-inbox i{background:var(--ink)}
.db-lt.is-junk i{background:linear-gradient(90deg,var(--ink) 50%,transparent 50%);box-shadow:inset 0 0 0 1.5px var(--ink)}
.db-lt.is-missing i{box-shadow:inset 0 0 0 1.5px var(--ink)}
.db-lt.is-unchecked{color:var(--muted)}
.db-lt.is-unchecked i{border:1.5px dashed var(--muted)}
.db-lt.is-stopped{color:var(--muted)}
.db-lt.is-stopped i{border-radius:2px;background:var(--muted)}

/* ---- the picture: Finder's added against found, by brand ---- */
.db-pic{margin:0}
.db-pic ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:max-content minmax(80px,1fr) max-content;column-gap:20px;row-gap:2px;align-items:center}
.db-pic li{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:center}
.db-pl{grid-column:1;grid-row:1}
.db-pt{grid-column:2;grid-row:1}
.db-pv{grid-column:3;grid-row:1}
.db-pl{display:flex;align-items:center;min-height:36px;color:var(--muted)}
.db-pt{display:block;height:14px}
.db-pt > span{display:block;box-sizing:border-box;height:100%;border-radius:2px;box-shadow:inset 0 0 0 1.5px var(--line2);overflow:hidden}
.db-pt i{display:block;height:100%;border-radius:2px;background:var(--muted)}
/* drawn to scale: above zero is at least a hairline, never a dot */
.db-pt .some{min-width:1px}
.db-pv{font-size:var(--t-head);line-height:28px;text-align:right;color:var(--ink)}
.db-pic .is-main .db-pl{color:var(--ink);font-weight:600}
.db-pic .is-main .db-pt i,.db-finder .is-main .db-pt i{background:var(--accent)}
.db-key{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:8px 0 0;padding-top:8px;border-top:1px solid var(--line);color:var(--muted);font-size:var(--t-meta);line-height:16px}
.db-sw{display:inline-block;box-sizing:border-box;width:20px;height:8px;border-radius:2px}
.db-sw.add{background:var(--muted)}
.db-sw.found{margin-left:12px;box-shadow:inset 0 0 0 1.5px var(--line2)}

/* ---- the picture: Sending domains' lights, each with its word and its count ---- */
.db-tally{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px 32px}
.db-tally li{display:flex;align-items:center;min-height:28px}
.db-tally .db-lt{gap:0}
.db-tally .db-lt i{margin-right:10px}
.db-tally b{margin-right:6px;font-family:var(--mono);font-size:var(--t-head);line-height:24px;font-weight:500;letter-spacing:0}
.db-cv{font-variant-numeric:tabular-nums}

/* ---- the ruled page ---- */
.db-book{display:flex;flex-direction:column;min-width:0;border-block:1px solid var(--line)}
.db-heads,.db-row{display:grid;grid-template-columns:var(--db-cols);column-gap:0;align-items:stretch}
.db-finder{--db-cols:minmax(180px,1.6fr) repeat(5,minmax(96px,1fr)) 44px}
.db-domains{--db-cols:minmax(200px,1.7fr) minmax(92px,.6fr) minmax(92px,.6fr) minmax(150px,.9fr) minmax(150px,1fr) minmax(150px,1fr) 44px}
.db-domains.tagged{--db-cols:minmax(200px,1.7fr) minmax(150px,.8fr) minmax(92px,.6fr) minmax(92px,.6fr) minmax(150px,.9fr) minmax(150px,1fr) minmax(150px,1fr) 44px}
/* printed heads over a double rule */
.db-heads{border-bottom:3px double var(--line2);color:var(--muted);font-size:var(--t-meta);line-height:16px}
.db-h{display:flex;align-items:flex-end;padding:12px 16px 8px;text-wrap:balance}
.db-h + .db-h{border-left:1px solid var(--line)}
.db-finder .db-h[data-col],.db-domains .db-h[data-col=warm],.db-domains .db-h[data-col=sent],.db-domains .db-h[data-col=bounce]{justify-content:flex-end;text-align:right}
.db-lines{list-style:none;margin:0;padding:0}
.db-lines > li{display:flex}
.db-lines > li:not([hidden]) ~ li:not([hidden]){border-top:1px solid var(--line)}
.db-row{flex:1 1 auto;min-height:52px;padding:0;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.db-row:hover{background:var(--bg3)}
.db-row:hover .db-dn,.db-row:hover > .db-name{text-decoration:underline;text-underline-offset:3px}
.db-lines > li:last-child .db-row{border-radius:0 0 9px 9px}
.db-name{display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;min-width:0;padding:10px 16px;font-weight:600}
.db-dn{overflow-wrap:normal;word-break:normal}
.db-tag{display:none}
.db-book > .db-key,.db-name .db-pt,.db-name .db-pv{display:none}
.db-br{display:none}
.db-c[data-col=both]{display:none}
.db-c{display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:0;padding:10px 16px;border-left:1px solid var(--line)}
.db-finder .db-c,.db-domains .db-c[data-col=warm],.db-domains .db-c[data-col=sent],.db-domains .db-c[data-col=bounce]{align-items:flex-end;text-align:right}
.db-c.db-brand{color:var(--muted);white-space:nowrap}
.db-cl{display:none}
.db-cv{display:block}
.db-cv small,.db-facts small{display:block;margin-top:2px;color:var(--muted);font-size:var(--t-meta);line-height:16px}
.db-c.is-word .db-cv{color:var(--muted)}
.db-domains .db-row .db-lt{white-space:normal}
.db-row .rv-chev{align-self:center;justify-self:center;width:16px;height:16px;color:var(--muted)}
.is-stopped .db-name,.is-stopped .db-c{color:var(--muted)}
/* Finder's total line, under a double rule */
.db-total-line{display:grid;grid-template-columns:var(--db-cols);border-top:3px double var(--line2);font-weight:600}
.db-total-line .db-c{font-weight:600}
/* the footing: the total, and the pages' buttons, under a double rule */
.db-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:4px 8px 4px 16px;border-top:3px double var(--line2);color:var(--muted)}
.db-pg{display:flex;gap:8px}
.db-pg button{min-width:88px;padding:0 14px;border:1px solid var(--line2);border-radius:var(--r-ctl);background:transparent;color:var(--ink);font-weight:500}
.db-pg button:disabled{color:var(--muted);opacity:.5;cursor:default}
.db-pg button:not(:disabled):hover{background:var(--bg3)}

/* Each section in the sheet starts with a heading and ruled rows. */
.db-sheet .rv-dialog-body{display:flex;flex-direction:column;gap:20px}
.db-sheet-part{display:flex;flex-direction:column;gap:8px}
.db-sheet-part h3{margin:0;font-size:var(--t-section);line-height:22px;font-weight:var(--w-strong)}
.db-sheet .rv-dialog-body .db-facts,.db-sheet .rv-dialog-body .db-jobs{margin:0;padding:0;border-block:1px solid var(--line)}
.db-facts > div{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:0 16px;padding:10px 0}
.db-facts > div + div,.db-jobs li + li{border-top:1px solid var(--line)}
.db-facts dt{color:var(--muted)}
.db-facts dd{margin:0}
.db-sheet .db-jobs{list-style:none}
.db-missing li{display:flex;flex-direction:column;gap:2px}
.db-missing b{font-weight:600}
.db-missing span{color:var(--muted)}
.db-jobs li{display:flex;flex-direction:column;gap:2px;padding:10px 0}
.db-jobs b{font-weight:600}
.db-jobs span{color:var(--muted)}
.db-jobs .db-jf{color:var(--ink);font-variant-numeric:tabular-nums}
.db-facts dd{font-variant-numeric:tabular-nums}

@container glance (720px <= width < 1028px){
  .db-domains{--db-cols:minmax(0,1.7fr) minmax(0,.7fr) minmax(0,.7fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 32px}
  .db-domains.tagged{--db-cols:minmax(0,1.7fr) minmax(0,1fr) minmax(0,.7fr) minmax(0,.7fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 32px}
  .db-domains :is(.db-name,.db-h,.db-c){padding-inline:8px;overflow-wrap:anywhere}
  .db-domains :is(.db-dn,.db-brand){overflow-wrap:anywhere;white-space:normal}
}

/* ---- the phone: Sending domains keeps printed heads for its three figures (the
   bounce window among them); every other figure names itself on its line. Steps from the gap scale: 4 inside a line's
   parts, 12 between lines of the picture ---- */
@container glance (max-width:719px){
  .db-page{gap:16px}
  /* the mark's line is its pill; its 44px target overlaps the space around it */
  .db-page .rv-g-mark{margin:-10px 0}
  .db-heads{display:none}
  .db-lines > li:last-child .db-row{border-radius:0}
  .db-cl{display:none}
  .db-c{padding:0;border:0;white-space:nowrap}
  .db-cl,.db-cv{line-height:18px}
  .db-tag{display:inline;color:var(--muted);font-size:var(--t-meta);font-weight:400;line-height:18px;white-space:nowrap}
  .db-tally{gap:12px 24px}
  .db-tally li{min-height:20px}
  .db-tally .db-lt{font-size:var(--t-meta);line-height:16px}
  .db-tally .db-lt i{margin-right:8px}
  .db-tally b{margin-right:4px;font-size:var(--t-row);line-height:20px}
  .db-foot{padding:0}
  .db-pg button{min-width:0}

  /* Finder: the picture moves into the lines. A brand: its name and figure, its bar 4px under them; then its five
     figures under printed heads, 12px on. Its key heads the page; the total closes it under a double rule */
  .db-finder{--db-cols:40px 56px 50px 36px minmax(0,1fr)}
  [data-glance-picture].db-pic{display:none}
  .db-finder > .db-key{display:flex;margin:0 0 8px}
  .db-finder .db-heads{display:grid;column-gap:12px;align-items:end;padding:8px 0 4px;border-bottom:1px solid var(--line)}
  .db-finder .db-h[data-col]{padding:0;border:0;justify-content:flex-start;text-align:left;text-wrap:balance}
  .db-finder .db-hn,.db-finder .db-heads > :last-child{display:none}
  .db-finder .db-row,.db-finder .db-total-line{position:relative;column-gap:12px;row-gap:12px;padding:8px 0;min-height:0}
  .db-finder .db-name{grid-column:1 / -1;display:grid;grid-template-columns:minmax(0,1fr) max-content;row-gap:4px;column-gap:12px;padding:0 28px 0 0;line-height:20px}
  .db-finder .db-name .db-nm{grid-area:1 / 1}
  .db-finder .db-name .db-pv{display:block;grid-area:1 / 2;font-size:var(--t-head);line-height:20px}
  .db-finder .db-name .db-pt{display:block;grid-area:2 / 1 / 3 / -1;height:14px}
  .db-finder .db-total-line > :last-child{display:none}
  .db-finder .db-c[data-col]{align-items:flex-start;text-align:left}
  .db-finder .db-br{display:none}
  .db-finder .db-row .rv-chev{position:absolute;top:10px;right:4px}

  /* Sending domains: its three figures under printed heads, at the same widths. A line: its name (and brand), its
     figures, its inbox results, 12px apart; inside a part, 4 to 8 */
  .db-domains .db-heads{display:flex;gap:12px;padding:1px 0}
  .db-domains .db-h{display:none;padding:0;border:0;text-wrap:nowrap}
  .db-domains .db-h[data-col=warm],.db-domains .db-h[data-col=sent],.db-domains .db-h[data-col=bounce]{display:block;justify-content:flex-start;text-align:left}
  .db-domains .db-h[data-col=warm],.db-domains .db-c[data-col=warm]{flex:0 0 76px}
  .db-domains .db-h[data-col=sent],.db-domains .db-c[data-col=sent]{flex:0 0 64px}
  .db-domains .db-h[data-col=bounce]{flex:1 1 0;min-width:0}
  .db-domains .db-row{position:relative;display:flex;flex-wrap:wrap;align-items:baseline;align-content:center;gap:12px;padding:8px 0;min-height:0}
  .db-domains .db-name{order:-2;flex:1 1 100%;gap:0 8px;padding:0;line-height:18px}
  .db-domains .db-c{flex-direction:row;align-items:baseline;justify-content:flex-start;gap:6px}
  .db-domains .db-c[data-col]{align-items:baseline;text-align:left}
  .db-domains .db-c.db-brand,.db-domains .db-br{display:none}
  /* the bounce figure takes the rest of its line, so the inbox results always start the next one */
  .db-domains .db-c[data-col=bounce]{flex:1 1 auto;min-width:calc(100% - 164px);padding-right:28px;box-sizing:border-box}
  /* the arrow sits at the right of the figures' line, so a long name and its brand keep the whole width */
  .db-domains .db-row .rv-chev{position:absolute;top:39px;right:4px}
  .db-seed .db-cl{display:block;color:var(--muted);font-size:var(--t-meta)}
  .db-seed,.db-seed .db-cv,.db-seed .db-lt{line-height:18px}
  /* a seed's label, mark and word are one part: 4 and 6 inside it, 12 to the next */
  .db-domains .db-c.db-seed{gap:4px}
  .db-seed .db-lt{gap:6px}
  .db-domains .db-c.db-seed[data-col],.db-seed .db-cv{align-items:center}
  .db-seed .db-cv{display:flex}
  /* the state word alone: how many mailboxes were checked is in the sheet */
  .db-seed .db-cv small{display:none}
  .is-same .db-c[data-col=gmail],.is-same .db-c[data-col=outlook]{display:none}
  .is-same .db-c[data-col=both]{display:flex}
}
/* a short phone: the lights' tally gives way so three lines of the list show; each line still wears its own lights */
@media (max-height:760px){
  @container glance (max-width:719px){
    .db-page .db-tally{display:none}
  }
}
