/* The Work tab's List layout (views/board-list.js). Loaded after work.css, so it wins over the older list rules there; those can go
   when work.css is next touched. Colours, sizes and corners come from tokens.css only. */

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.lhead { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.lhead, .lrow {
  display: grid; align-items: center; column-gap: 14px; padding: 0 14px;
  grid-template-columns: minmax(220px, 2.6fr) minmax(130px, 1.2fr) minmax(110px, 1fr) 104px 84px 88px minmax(140px, .9fr) 84px;
}
.lhead { min-height: 38px; background: var(--panel2); border-bottom: 1px solid var(--line); color: var(--dim); font-size: var(--fs-caption); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.lh-cell { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.lh-sort:hover, .lh-sort.is-on { color: var(--text); }
.lh-sort:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: var(--r-sm); }
.lh-arrow { color: var(--acc); font-size: var(--fs-body); line-height: 1; }

.lgroup { border-bottom: 1px solid var(--line); }
.lgroup:last-child { border-bottom: 0; }
.lgroup:last-child > :last-child { border-radius: 0 0 calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px); }
.lgroup-head { display: flex; flex-wrap: wrap; align-items: center; min-height: 40px; padding: 0 8px; background: var(--panel); }
.lgroup .lg-toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; padding: 6px 6px; border-radius: var(--r-sm); }
.lgroup .lg-toggle { min-width: 0; max-width: 100%; }
.lgroup .lg-toggle h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; font-size: var(--fs-lead); font-weight: 600; }
.lgroup .lg-chev { display: inline-flex; color: var(--dim); transform: rotate(-90deg); }
.lgroup .lg-chev.is-open { transform: none; }
.lg-n { font-size: var(--fs-caption); font-family: var(--mono); color: var(--mute); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 0 6px; }
.lg-hidden { margin-left: 10px; color: var(--dim); font-size: var(--fs-caption); }

.lrow { min-height: 44px; border-top: 1px solid var(--line); cursor: pointer; font-size: var(--fs-body); color: var(--mute); }
.lrow:hover { background: var(--panel2); }
.lrow.is-selected { background: var(--panel3); outline: 1px solid var(--acc); outline-offset: -1px; }
.lrow.is-closed .lr-title { color: var(--mute); }
.lr-work { display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: calc(var(--depth, 0) * 24px); }
.lr-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; text-decoration: none; }
.lrow:not(.is-child) .lr-title { font-weight: 600; }
.lr-title:hover { color: var(--acc); }
.lr-flag { color: var(--warn); display: inline-flex; flex: none; }
.lr-count { font-size: var(--fs-caption); font-family: var(--mono); color: var(--dim); flex: none; }
.lr-arrow, .lr-arrow-gap { width: 20px; height: 20px; flex: none; }
.lr-arrow { display: inline-grid; place-items: center; border: 0; background: none; color: var(--dim); border-radius: var(--r-sm); padding: 0; cursor: pointer; }
.lr-arrow svg { transition: transform 120ms; }
.lr-arrow.is-open svg { transform: rotate(90deg); }
.lr-arrow:hover { color: var(--text); background: var(--panel3); }
.lr-note { display: inline-flex; width: 18px; justify-content: center; color: var(--dim); flex: none; }

.lr-tick { width: 18px; height: 18px; flex: none; display: inline-grid; place-items: center; padding: 0; border: 1.5px solid var(--line2); border-radius: var(--r-sm); background: var(--panel); color: var(--on-acc); cursor: pointer; }
.lr-tick:hover:not(:disabled) { border-color: var(--acc); }
.lr-tick.is-on { background: var(--acc); border-color: var(--acc); }
.lr-tick:disabled { opacity: .45; cursor: not-allowed; }
.lr-tick:focus-visible, .lr-arrow:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.lr-status { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lr-reason { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: var(--fs-caption); }
.lr-progress { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lr-progress b { min-width: 34px; font-size: var(--fs-caption); font-weight: 600; font-family: var(--mono); color: var(--text); text-align: right; }
.lr-progress .wbar { flex: 1; min-width: 40px; }
.lr-prio { display: inline-flex; align-items: center; gap: 8px; }
.lr-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; flex: none; }
.lr-bars i { width: 3px; border-radius: 1px; background: var(--line2); }
.lr-bars i.on { background: var(--mute); }
.lr-bars.p3 i.on, .lr-bars.p4 i.on { background: var(--warn); }
.lr-prio-t { font-size: var(--fs-caption); color: var(--dim); }
.lr-none { color: var(--dim); }
.lr-due { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); font-family: var(--mono); color: var(--mute); white-space: nowrap; }
.lr-due.is-over { color: var(--bad); }
.lr-al { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); font-family: var(--mono); color: var(--mute); }
.lr-who, .lr-when { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-when { font-size: var(--fs-caption); font-family: var(--mono); color: var(--dim); }
.lr-ov { color: var(--acc2); }
.lr-sys { color: var(--dim); }
.lr-cell { min-width: 0; }

.lgroup-foot { display: flex; padding: 4px 12px 8px; }
.lgroup-foot .wadd-link { margin-left: auto; }

/* Narrower pages drop the least needed columns, last first. The page's width decides (it is a container), not the window's: the side
   bar takes 264 px of it. The widths are the sum of each layout's column minimums, gaps, padding and border. The list is not clipped, so
   a category menu can hang below the last group. */
@container page (max-width: 1099px) {
  .lhead, .lrow { grid-template-columns: minmax(200px, 2.4fr) minmax(120px, 1.1fr) minmax(100px, 1fr) 104px 84px minmax(100px, .9fr) 84px; }
  .lhead > :nth-child(6), .lrow > :nth-child(6) { display: none; }
}
@container page (max-width: 909px) {
  .lhead, .lrow { grid-template-columns: minmax(200px, 2fr) minmax(130px, 1fr) minmax(110px, 1fr) 84px 84px; }
  .lhead > :nth-child(4), .lrow > :nth-child(4), .lhead > :nth-child(7), .lrow > :nth-child(7) { display: none; }
}
@container page (max-width: 699px) {
  .lhead, .lrow { grid-template-columns: minmax(0, 1fr) 120px 84px; column-gap: 10px; padding: 0 10px; }
  .lhead > :nth-child(3), .lrow > :nth-child(3), .lhead > :nth-child(5), .lrow > :nth-child(5) { display: none; }
  .lr-reason { display: none; }
}
@container page (max-width: 359px) {
  .lhead, .lrow { grid-template-columns: minmax(0, 1fr) 72px; }
  .lhead > :nth-child(2), .lrow > :nth-child(2) { display: none; }
}
