/* DNEG AI Roadmap: css/views/adoption.css
   The Adoption lens (.lens-adoption): the "counted from" line on each total, the table of ComfyUI use by department (a bar
   and a number for prompts, two groups of columns counted from different days, a sticky first column, scrolling inside its card),
   the muted rows of groups that have no department, the definitions card and the panel for a missing snapshot. Everything else
   on the page is the shared kit (lk-* in site.css and department.css: the head, the brief and the folded blocks) and the shared
   components in site.css. Tokens only. */

/* ------------------------- the other totals (a folded block) ------------------------- */
/* three tiles across, one under another on a phone; the kit's auto-fit rule would leave one tile alone on the last row */
.lens-adoption .lk-mbody > .lk-stats { margin-top: 0; }
.lens-adoption .lk-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .lens-adoption .lk-stats.three { grid-template-columns: minmax(0, 1fr); } }
.lens-adoption .stat .ad-since { margin-top: .5rem; color: var(--muted); font-size: .72rem; letter-spacing: .02em; line-height: 1.35; }

/* the table block's own heading is a caption under the block's title, not a second page title */
.lens-adoption .lk-mbody > .lk-sec > .sechead .title { margin-bottom: .3rem; font-size: 1.15rem; }
.lens-adoption .lk-mbody > .lk-sec > .sechead .lede { max-width: 80ch; font-size: .92rem; }

/* the notes block */
.lens-adoption .ad-notes { display: grid; gap: .45rem; }
.lens-adoption .ad-notes .note { margin: 0; max-width: 86ch; }
.lens-adoption .ad-notes b { color: var(--fg); font-weight: 600; }
.lens-adoption .ad-notes .ad-coverage { font-size: .88rem; }
.lens-adoption .ad-notes a { color: var(--accent2); }

/* ------------------------- the table ------------------------- */
/* below the table's minimum width it scrolls inside its card, and this line says so */
.lens-adoption .ad-hint { display: none; margin: .9rem 0 0; }
@media (max-width: 930px) { .lens-adoption .ad-hint { display: block; } }
.lens-adoption .ad-hint + .ad-card { margin-top: .5rem; }
.lens-adoption .ad-card { margin-top: 1rem; padding: 0; overflow: hidden; background: var(--panel); }
.lens-adoption .ad-scroll { overflow-x: auto; scrollbar-width: thin; }
.lens-adoption .ad-scroll:focus-visible { outline-offset: -3px; }
.lens-adoption .ad-table { width: 100%; min-width: 880px; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.lens-adoption .ad-table th, .lens-adoption .ad-table td { padding: 9px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.lens-adoption .ad-table tbody tr:last-child > * { border-bottom: 0; }
.lens-adoption .ad-table .num { text-align: right; }
.lens-adoption .ad-table .ad-sep { border-left: 1px solid var(--line); }

/* header: the first row says from when a group of columns is counted, the second names the columns */
.lens-adoption .ad-table thead th { background: var(--panel2); color: var(--muted); font-size: .68rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.lens-adoption .ad-table thead .ad-cols th { white-space: normal; vertical-align: bottom; }
.lens-adoption .ad-table thead .ad-top th { border-bottom-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.lens-adoption .ad-table .ad-span { color: var(--accent2); font-size: .64rem; letter-spacing: .12em; }
.lens-adoption .ad-table .ad-corner { position: sticky; left: 0; z-index: 2; min-width: 12rem; vertical-align: bottom; border-right: 1px solid var(--line); }
.lens-adoption .ad-table .ad-corner small { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; font-weight: 400; letter-spacing: .04em; text-transform: none; }

/* rows */
.lens-adoption .ad-table tbody th, .lens-adoption .ad-table tbody td { background: var(--panel); }
.lens-adoption .ad-row:hover > * { background: color-mix(in srgb, var(--panel2) 70%, var(--panel)); }
.lens-adoption .ad-table .ad-name { position: sticky; left: 0; z-index: 1; min-width: 12rem; font-weight: 500; border-right: 1px solid var(--line); }
.lens-adoption .ad-name a { color: var(--fg); text-decoration: none; }
.lens-adoption .ad-name a:hover { color: var(--accent2); text-decoration: underline; }
.lens-adoption .ad-groups { display: block; margin-top: 1px; color: var(--muted); font-family: var(--mono); font-size: .72rem; font-weight: 400; line-height: 1.3; }
.lens-adoption .ad-gname.mono { font-size: .88em; }
.lens-adoption .ad-groups.ad-none { font-family: var(--font); font-size: .74rem; }
.lens-adoption .ad-table .zero { color: var(--muted); opacity: .85; }
.lens-adoption .ad-table .ad-people { white-space: nowrap; }

/* prompts: a bar scaled to the busiest row, then the number */
.lens-adoption .ad-pcell { display: flex; align-items: center; gap: 10px; }
.lens-adoption .ad-meter { flex: 0 0 110px; height: 8px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.lens-adoption .ad-meter i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.lens-adoption .ad-n { min-width: 6.2ch; text-align: right; }

/* groups with no department: muted, with a quieter bar */
.lens-adoption .ad-unmapped > th, .lens-adoption .ad-unmapped > td { color: var(--muted); }
.lens-adoption .ad-unmapped .ad-meter i { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.lens-adoption .ad-empty > td { color: var(--muted); }

/* the label rows above each block of rows */
.lens-adoption .ad-table tbody .ad-grp th { padding: 7px 14px; background: color-mix(in srgb, var(--panel2) 70%, var(--panel)); color: var(--accent2); font-size: .64rem; font-weight: 500; letter-spacing: .14em; text-align: left; text-transform: uppercase; }
.lens-adoption .ad-grp th span { position: sticky; left: 14px; }

/* ------------------------- what the numbers mean ------------------------- */
.lens-adoption .ad-means { padding: 4px 22px; }
.lens-adoption .ad-defs { margin: 0; }
.lens-adoption .ad-defs > div { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); gap: 4px 24px; padding: 13px 0; border-top: 1px solid var(--line); }
.lens-adoption .ad-defs > div:first-child { border-top: 0; }
.lens-adoption .ad-defs dt { font-weight: 600; }
.lens-adoption .ad-defs dd { margin: 0; max-width: 80ch; color: var(--muted); }
.lens-adoption .ad-defs dd a { color: var(--accent2); }
.lens-adoption .ad-defs dd code { color: var(--fg); }

/* ------------------------- no snapshot ------------------------- */
.lens-adoption .ad-nodata { max-width: 68ch; }
.lens-adoption .ad-nodata .lede { margin-bottom: 1rem; }
.lens-adoption .ad-steps { display: grid; gap: .55rem; margin: 0; padding-left: 1.3rem; color: var(--muted); }
.lens-adoption .ad-steps code, .lens-adoption .ad-nodata .note code { color: var(--fg); }
.lens-adoption .ad-nodata .note { margin-top: 1.1rem; }

/* ------------------------- phone ------------------------- */
@media (max-width: 700px) {
  .lens-adoption .ad-table { min-width: 760px; font-size: .84rem; }
  .lens-adoption .ad-table th, .lens-adoption .ad-table td { padding: 8px 10px; }
  .lens-adoption .ad-table .ad-name, .lens-adoption .ad-table .ad-corner { min-width: 7.5rem; max-width: 9rem; }
  .lens-adoption .ad-meter { flex-basis: 64px; }
  .lens-adoption .ad-means { padding: 2px 16px; }
  .lens-adoption .ad-defs > div { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 11px 0; }
}

/* ------------------------- print ------------------------- */
@media print {
  .lens-adoption .ad-hint { display: none; }
  .lens-adoption .ad-card { overflow: visible; }
  .lens-adoption .ad-scroll { overflow: visible; }
  .lens-adoption .ad-table { min-width: 0; font-size: .72rem; }
  .lens-adoption .ad-table th, .lens-adoption .ad-table td { padding: 5px 8px; }
  .lens-adoption .ad-table .ad-name, .lens-adoption .ad-table .ad-corner { position: static; min-width: 0; }
  .lens-adoption .ad-grp th span { position: static; }
  .lens-adoption .ad-meter, .lens-adoption .ad-meter i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lens-adoption .ad-row, .lens-adoption .ad-grp, .lens-adoption .ad-defs > div { break-inside: avoid; }
}
