/* dw3-tasks.css — DW3-12 (B3): the project To-Dos list (project-tasks.js)
 * and the To-Do record sheet (todo-record.js), built to Buildern's list
 * and edit page in the portal's light skin. List classes are .tdl-*;
 * the record lives under .td-sheet (calendar.js's own to-do dialog uses
 * a few .td-* names of its own — nothing here reaches outside the sheet
 * except the shared pieces named .td-check / .td-stack / .td-prio /
 * .td-waiting, which calendar.js does not use). Gold is the one primary
 * action (New to-do / Save changes); icons are never gold. */

/* ---------------- shared pieces ---------------- */
body.skin-billdr .td-waiting {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 10px 14px;
  background: var(--ds-fill); border-radius: var(--ds-r-ctl); color: var(--ds-neutral-ink);
  font-size: var(--ds-fs-sm); line-height: 1.45;
}
body.skin-billdr .td-waiting .ico { flex: none; margin-top: 2px; color: var(--ds-muted); }
body.skin-billdr .td-waiting-bad { background: var(--ds-bad-bg); color: var(--ds-bad-ink); }
body.skin-billdr .td-dash { color: var(--ds-faint); }
body.skin-billdr .td-unassigned { color: var(--ds-faint); font-size: var(--ds-fs-sm); }

/* the completion circle (Buildern: "complete by clicking the circle") */
body.skin-billdr .td-check {
  flex: none; width: 20px; height: 20px; border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ds-card); border: 1.5px solid var(--ds-line-strong); color: transparent;
  transition: background .12s, border-color .12s, color .12s;
}
body.skin-billdr .td-check .ico { width: 12px; height: 12px; stroke-width: 2.6; }
body.skin-billdr .td-check:hover:not(:disabled) { border-color: var(--ds-k-green); color: var(--ds-k-green); }
body.skin-billdr .td-check.on { background: var(--ds-k-green); border-color: var(--ds-k-green); color: #fff; }
body.skin-billdr .td-check:disabled { opacity: .45; cursor: default; }
body.skin-billdr .td-check:focus-visible { outline: none; box-shadow: var(--ds-focus); }

/* stacked avatars with +N */
body.skin-billdr .td-stack { display: inline-flex; align-items: center; }
body.skin-billdr #app .td-stack .avatar-chip.td-av,
body.skin-billdr .fx-overlay .td-stack .avatar-chip.td-av {
  width: 28px; height: 28px; font-size: 10.5px; margin: 0; border: 2px solid var(--ds-card);
}
body.skin-billdr .td-stack .td-av + .td-av { margin-left: -8px; }
body.skin-billdr .td-av-more {
  margin-left: -8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ds-card);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ds-neutral-bg); color: var(--ds-neutral-ink); font-size: 10.5px; font-weight: 700;
}
body.skin-billdr .fx-overlay .avatar-chip.td-av { background: var(--ds-gold-tint); color: var(--ds-gold-ink); font-weight: 700; }

/* priority: a coloured dot + word (High red, Medium orange, Low grey) */
body.skin-billdr .td-prio { display: inline-flex; align-items: center; gap: 7px; font-size: var(--ds-fs-sm); color: var(--ds-ink); white-space: nowrap; }
body.skin-billdr .td-prio-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ds-faint); }
body.skin-billdr .td-prio-high .td-prio-dot { background: var(--ds-k-red); }
body.skin-billdr .td-prio-medium .td-prio-dot { background: var(--ds-k-orange); }
body.skin-billdr .td-prio-low .td-prio-dot { background: #9fb3c8; }
body.skin-billdr .ds-pill.td-cancelled { text-decoration: line-through; }

/* ---------------- the list ---------------- */
body.skin-billdr #app .tdl-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
body.skin-billdr #app .tdl-counts { margin: 0; font-size: var(--ds-fs-sm); color: var(--ds-muted); }
body.skin-billdr #app .tdl-counts b { color: var(--ds-navy); }
body.skin-billdr #app .tdl-over { color: var(--ds-bad-ink); font-weight: 600; }
body.skin-billdr #app .tdl-filters { margin-bottom: 14px; }
body.skin-billdr #app .tdl-filters input[type="search"] { flex: 1 1 260px; max-width: 360px; }

body.skin-billdr #app .tdl-table th.tdl-th-name { width: 46%; }
body.skin-billdr #app .tdl-table th.tdl-th-menu { width: 44px; }
body.skin-billdr #app table.ds-table.tdl-table td { padding-top: 13px; padding-bottom: 13px; }
body.skin-billdr #app .tdl-row { cursor: pointer; }
body.skin-billdr #app .tdl-row.is-sub td { background: #fbfcfe; }
body.skin-billdr #app .tdl-row.is-context { opacity: .62; }
body.skin-billdr #app .tdl-name-wrap { display: flex; align-items: flex-start; gap: 8px; padding-left: calc(var(--tdl-depth, 0) * 28px); }
body.skin-billdr #app .tdl-name-wrap > .td-check { margin-top: 1px; }
body.skin-billdr #app .tdl-twist, body.skin-billdr #app .tdl-twist-gap { flex: none; width: 20px; height: 22px; }
body.skin-billdr #app .tdl-twist {
  display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none;
  color: var(--ds-muted); cursor: pointer; border-radius: 6px;
}
body.skin-billdr #app .tdl-twist:hover { background: var(--ds-bg); color: var(--ds-navy); }
body.skin-billdr #app .tdl-twist .ico { width: 13px; height: 13px; transition: transform .15s ease; }
body.skin-billdr #app .tdl-twist.open .ico { transform: rotate(90deg); }
body.skin-billdr #app .tdl-name-text { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
body.skin-billdr #app .tdl-name {
  padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
  font-size: var(--ds-fs); font-weight: 600; color: var(--ds-navy); line-height: 1.35;
}
body.skin-billdr #app .tdl-name:hover { text-decoration: underline; text-underline-offset: 3px; }
body.skin-billdr #app .tdl-row.is-done .tdl-name { color: var(--ds-muted); text-decoration: line-through; font-weight: 500; }
body.skin-billdr #app .tdl-row.is-cancelled .tdl-name { color: var(--ds-faint); text-decoration: line-through; font-weight: 500; }
body.skin-billdr #app .tdl-sub { flex-basis: 100%; font-size: var(--ds-fs-xs); color: var(--ds-muted); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
body.skin-billdr #app .tdl-progress {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--ds-r-pill);
  background: var(--ds-neutral-bg); color: var(--ds-neutral-ink); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
body.skin-billdr #app .tdl-progress.full { background: var(--ds-ok-bg); color: var(--ds-ok-ink); }
body.skin-billdr #app .tdl-proposal { font-size: 11px; padding: 1px 8px; }
body.skin-billdr #app .tdl-label { display: inline-flex; padding: 1px 8px; border-radius: var(--ds-r-pill); background: var(--ds-info-bg); color: var(--ds-info-ink); font-size: 11.5px; font-weight: 600; }
body.skin-billdr #app .tdl-due { font-size: var(--ds-fs-sm); color: var(--ds-ink); white-space: nowrap; }
body.skin-billdr #app .tdl-due.over { color: var(--ds-bad-ink); font-weight: 600; }
body.skin-billdr #app .tdl-status-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--ds-r-pill); }
body.skin-billdr #app .tdl-status-btn:hover .ds-pill { box-shadow: 0 0 0 2px var(--ds-line); }
body.skin-billdr #app .tdl-status-btn:focus-visible { outline: none; box-shadow: var(--ds-focus); }
body.skin-billdr #app .tdl-menu-cell { text-align: right; }

/* quick add: Buildern's "Add new line" at the foot */
body.skin-billdr #app table.ds-table.tdl-table tfoot td.tdl-quick {
  display: table-cell; padding: 8px 16px; font-weight: 400; background: var(--ds-card); border-top: 1px solid var(--ds-hair);
}
body.skin-billdr #app .tdl-quick { position: relative; }
body.skin-billdr #app .tdl-quick .td-plus { position: absolute; left: 30px; top: 50%; transform: translateY(-50%); color: var(--ds-muted); display: inline-flex; }
body.skin-billdr #app .tdl-quick input {
  width: 100%; min-height: 40px; padding: 0 240px 0 40px; border: 1px dashed transparent; border-radius: var(--ds-r-ctl);
  background: transparent; font: inherit; font-size: var(--ds-fs); color: var(--ds-ink);
}
body.skin-billdr #app .tdl-quick input:hover { border-color: var(--ds-line); }
body.skin-billdr #app .tdl-quick input:focus { outline: none; border: 1px solid var(--ds-gold); box-shadow: var(--ds-focus); background: var(--ds-card); }
body.skin-billdr #app .tdl-quick-hint { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); font-size: var(--ds-fs-xs); color: var(--ds-faint); pointer-events: none; }
body.skin-billdr #app .tdl-quick input:not(:placeholder-shown) ~ .tdl-quick-hint { display: none; }

@media (max-width: 1100px) {
  body.skin-billdr #app .tdl-quick-hint { display: none; }
  body.skin-billdr #app .tdl-quick input { padding-right: 12px; }
  body.skin-billdr #app .tdl-sub { max-width: 340px; }
}
@media (max-width: 760px) {
  body.skin-billdr #app .tdl-table thead { display: none; }
  body.skin-billdr #app .tdl-table, body.skin-billdr #app .tdl-table tbody, body.skin-billdr #app .tdl-table tr { display: block; }
  body.skin-billdr #app .tdl-table tr.tdl-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 10px; padding: 12px 14px; border-bottom: 1px solid var(--ds-hair); }
  body.skin-billdr #app .tdl-table tr.tdl-row td { display: block; padding: 0; border: 0; }
  body.skin-billdr #app .tdl-table td.tdl-name-cell { grid-column: 1 / -1; }
}

/* ---------------- the record sheet ---------------- */
body.skin-billdr .fx-dialog.td-sheet { max-width: 980px; width: min(980px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
body.skin-billdr .td-sheet .td-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--ds-hair); }
body.skin-billdr .td-sheet .td-kicker { margin: 0 0 2px; font-size: var(--ds-fs-xs); font-weight: 600; color: var(--ds-muted); letter-spacing: .02em; }
body.skin-billdr .td-sheet .td-title-view { margin: 0; font-size: var(--ds-fs-xl); font-weight: 700; color: var(--ds-navy); line-height: 1.25; word-break: break-word; }
body.skin-billdr .td-sheet > .td-waiting { margin: 14px 24px 0; }
body.skin-billdr .td-sheet .td-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
body.skin-billdr .td-sheet .td-main { padding: 6px 24px 18px; min-width: 0; }
body.skin-billdr .td-sheet .td-side { padding: 18px 20px; background: var(--ds-tint); border-left: 1px solid var(--ds-hair); display: flex; flex-direction: column; gap: 12px; }

body.skin-billdr .td-sheet .td-sec { padding: 16px 0 6px; border-bottom: 1px solid var(--ds-hair); }
body.skin-billdr .td-sheet .td-sec:last-child { border-bottom: 0; }
body.skin-billdr .td-sheet .td-sec-h { margin: 0 0 12px; font-size: var(--ds-fs-xs); font-weight: 700; color: var(--ds-muted); letter-spacing: .06em; text-transform: uppercase; }
body.skin-billdr .td-sheet .td-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-size: var(--ds-fs-sm); font-weight: 600; color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-label { font-size: var(--ds-fs-sm); font-weight: 600; color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-help { font-weight: 400; color: var(--ds-muted); font-size: var(--ds-fs-xs); }
body.skin-billdr .td-sheet .td-field > :is(input:not([type="checkbox"]), select, textarea),
body.skin-billdr .td-sheet .td-remind input[type="datetime-local"] {
  font: inherit; font-weight: 400; font-size: var(--ds-fs); color: var(--ds-ink); min-height: var(--ds-ctl);
  padding: 8px 12px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-ctl); background: var(--ds-card); width: 100%; box-sizing: border-box;
}
body.skin-billdr .td-sheet .td-field > textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
body.skin-billdr .td-sheet :is(input, select, textarea):focus { outline: none; border-color: var(--ds-gold); box-shadow: var(--ds-focus); }
body.skin-billdr .td-sheet input[name="tdTitle"] { font-size: var(--ds-fs-md); font-weight: 600; color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
body.skin-billdr .td-sheet .td-seg { align-self: flex-start; }
body.skin-billdr .td-sheet .td-seg .seg-btn { min-width: 74px; }
body.skin-billdr .td-sheet .td-parent-crumb { margin: 0 0 10px; font-size: var(--ds-fs-sm); color: var(--ds-muted); }

/* people + label chips */
body.skin-billdr .td-sheet .td-chips, body.skin-billdr .td-sheet .td-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 400; }
body.skin-billdr .td-sheet .td-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 4px 3px 3px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-pill);
  background: var(--ds-card); font-size: var(--ds-fs-sm); color: var(--ds-ink);
}
body.skin-billdr .td-sheet .td-chip .avatar-chip.td-av { width: 24px; height: 24px; font-size: 9.5px; margin: 0; border: 0; }
body.skin-billdr .td-sheet .td-chip-x {
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ds-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
body.skin-billdr .td-sheet .td-chip-x .ico { width: 11px; height: 11px; }
body.skin-billdr .td-sheet .td-chip-x:hover { background: var(--ds-bg); color: var(--ds-bad-ink); }
body.skin-billdr .td-sheet .td-chip-add {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px; border: 1px dashed var(--ds-line-strong);
  border-radius: var(--ds-r-pill); background: none; font: inherit; font-size: var(--ds-fs-sm); color: var(--ds-muted); cursor: pointer;
}
body.skin-billdr .td-sheet .td-chip-add:hover { border-color: var(--ds-navy); color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-label-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 10px; border-radius: var(--ds-r-pill);
  background: var(--ds-info-bg); color: var(--ds-info-ink); font-size: var(--ds-fs-sm); font-weight: 600;
}
body.skin-billdr .td-sheet .td-label-chip > .ico { width: 12px; height: 12px; }
body.skin-billdr .td-sheet .td-label-chip .td-chip-x { color: var(--ds-info-ink); }
body.skin-billdr .td-sheet .td-label-input { flex: 1 1 180px; min-height: 32px; border: 0; padding: 0 6px; font: inherit; font-size: var(--ds-fs-sm); background: none; }
body.skin-billdr .td-sheet .td-label-input:focus { box-shadow: none; }
body.skin-billdr .td-sheet .td-labels { border: 1px solid var(--ds-line); border-radius: var(--ds-r-ctl); padding: 4px 6px; background: var(--ds-card); }
body.skin-billdr .td-sheet .td-labels:focus-within { border-color: var(--ds-gold); box-shadow: var(--ds-focus); }

/* reminder toggle */
body.skin-billdr .td-sheet .td-remind { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
body.skin-billdr .td-sheet .td-remind input[type="datetime-local"] { width: auto; flex: 0 1 240px; }
body.skin-billdr .td-sheet .td-remind > .td-help { flex-basis: 100%; }
body.skin-billdr .td-sheet .td-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
body.skin-billdr .td-sheet .td-switch input {
  appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; margin: 0; cursor: pointer;
  background: var(--ds-line-strong); position: relative; transition: background .15s;
}
body.skin-billdr .td-sheet .td-switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
body.skin-billdr .td-sheet .td-switch input:checked { background: var(--ds-k-green); }
body.skin-billdr .td-sheet .td-switch input:checked::after { transform: translateX(16px); }

/* attachments */
body.skin-billdr .td-sheet .td-atts { display: flex; flex-direction: column; gap: 6px; font-weight: 400; }
body.skin-billdr .td-sheet .td-att {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--ds-line);
  border-radius: var(--ds-r-ctl); background: var(--ds-tint); max-width: 460px;
}
body.skin-billdr .td-sheet .td-att > .ico { color: var(--ds-muted); flex: none; }
body.skin-billdr .td-sheet .td-att-name { flex: 1; min-width: 0; font-size: var(--ds-fs-sm); font-weight: 600; color: var(--ds-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.skin-billdr .td-sheet .td-att-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
body.skin-billdr .td-sheet .td-att-bar .btn, body.skin-billdr .td-sheet .td-upload { min-height: 34px; font-size: var(--ds-fs-sm); font-weight: 500; cursor: pointer; }
body.skin-billdr .td-sheet .td-empty { margin: 0; font-size: var(--ds-fs-sm); font-weight: 400; color: var(--ds-muted); }

/* subtasks */
body.skin-billdr .td-sheet .td-subcount { margin-left: 6px; padding: 1px 8px; border-radius: var(--ds-r-pill); background: var(--ds-neutral-bg); color: var(--ds-neutral-ink); font-size: 11.5px; font-weight: 700; }
body.skin-billdr .td-sheet .td-subs { border: 1px solid var(--ds-line); border-radius: var(--ds-r-ctl); background: var(--ds-card); font-weight: 400; }
body.skin-billdr .td-sheet .td-sub { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--ds-hair); min-height: 44px; }
body.skin-billdr .td-sheet .td-sub:last-child { border-bottom: 0; }
body.skin-billdr .td-sheet .td-sub-name { flex: 1; min-width: 0; text-align: left; font-size: var(--ds-fs); font-weight: 500; color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-sub-meta { display: inline-flex; align-items: center; gap: 10px; flex: none; }
body.skin-billdr .td-sheet .td-sub-due { font-size: var(--ds-fs-xs); color: var(--ds-muted); }
body.skin-billdr .td-sheet .td-sub .td-stack .avatar-chip.td-av { width: 24px; height: 24px; font-size: 9.5px; }
body.skin-billdr .td-sheet .td-sub-add .td-plus { width: 20px; display: inline-flex; justify-content: center; color: var(--ds-muted); }
body.skin-billdr .td-sheet .td-sub-add input { flex: 1; border: 0; min-height: 30px; padding: 0; font: inherit; font-size: var(--ds-fs); background: none; }
body.skin-billdr .td-sheet .td-sub-add input:focus { box-shadow: none; }

/* comments */
body.skin-billdr .td-sheet .td-comments { display: flex; flex-direction: column; gap: 12px; font-weight: 400; margin-bottom: 6px; }
body.skin-billdr .td-sheet .td-cmt { display: flex; gap: 10px; align-items: flex-start; }
body.skin-billdr .td-sheet .td-cmt .avatar-chip.td-av { width: 30px; height: 30px; font-size: 10.5px; margin: 0; border: 0; flex: none; }
body.skin-billdr .td-sheet .td-cmt-head { margin: 0 0 2px; font-size: var(--ds-fs-sm); color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-cmt-head .muted { font-size: var(--ds-fs-xs); margin-left: 6px; }
body.skin-billdr .td-sheet .td-cmt-del { margin-left: 10px; font-size: var(--ds-fs-xs); color: var(--ds-muted); }
body.skin-billdr .td-sheet .td-cmt-del:hover { color: var(--ds-bad-ink); }
body.skin-billdr .td-sheet .td-cmt-body { margin: 0; padding: 8px 12px; background: var(--ds-fill); border-radius: 4px var(--ds-r-ctl) var(--ds-r-ctl) var(--ds-r-ctl); color: var(--ds-ink); font-size: var(--ds-fs); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
body.skin-billdr .td-sheet [data-td-composer] .composer-box textarea { min-height: 64px; }

/* side cards */
body.skin-billdr .td-sheet .td-side-card { background: var(--ds-card); border: 1px solid var(--ds-line); border-radius: var(--ds-r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
body.skin-billdr .td-sheet .td-side-card .td-label { font-size: var(--ds-fs-xs); color: var(--ds-muted); text-transform: uppercase; letter-spacing: .06em; }
body.skin-billdr .td-sheet .td-side-note { margin: 0; font-size: var(--ds-fs-sm); color: var(--ds-muted); line-height: 1.45; }
body.skin-billdr .td-sheet .td-status-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--ds-line); border-radius: var(--ds-r-pill);
  background: var(--ds-card); cursor: pointer; color: var(--ds-muted);
}
body.skin-billdr .td-sheet .td-status-btn:hover { border-color: var(--ds-line-strong); color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-status-btn .ds-pill { font-size: var(--ds-fs-sm); padding: 4px 12px; }
body.skin-billdr .td-sheet .td-meta p { margin: 0; font-size: var(--ds-fs-sm); color: var(--ds-muted); }
body.skin-billdr .td-sheet .td-meta b { color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-hist { width: 100%; font-size: var(--ds-fs-xs); color: var(--ds-muted); }
body.skin-billdr .td-sheet .td-hist summary { cursor: pointer; font-weight: 600; color: var(--ds-gold-ink); font-size: var(--ds-fs-sm); }
body.skin-billdr .td-sheet .td-hist p { margin: 4px 0 0; font-size: var(--ds-fs-xs); }

/* footer */
body.skin-billdr .td-sheet .td-foot { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-top: 1px solid var(--ds-hair); background: var(--ds-card); }
body.skin-billdr .td-sheet .td-foot .rk-err { margin: 0; flex: 1; min-width: 0; color: var(--ds-bad-ink); font-size: var(--ds-fs-sm); }
body.skin-billdr .td-sheet .td-foot .rk-err[hidden] { display: block; visibility: hidden; }
body.skin-billdr .td-sheet .td-foot-actions { margin-left: auto; display: inline-flex; gap: 8px; flex: none; }
body.skin-billdr .td-sheet .td-del { display: inline-flex; align-items: center; gap: 6px; color: var(--ds-danger); font-size: var(--ds-fs-sm); flex: none; }

@media (max-width: 820px) {
  body.skin-billdr .td-sheet .td-body { grid-template-columns: 1fr; }
  body.skin-billdr .td-sheet .td-side { border-left: 0; border-top: 1px solid var(--ds-hair); }
  body.skin-billdr .td-sheet .td-foot { flex-wrap: wrap; }
}

/* the overlay sits outside #app, so the house pill / tag / menu dress
 * the list wears is restated for the sheet */
body.skin-billdr .td-sheet .td-head > .grow { flex: 1; min-width: 0; }
body.skin-billdr .td-sheet .ds-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--ds-r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--ds-neutral-bg); color: var(--ds-neutral-ink);
}
body.skin-billdr .td-sheet .ds-pill.ok { background: var(--ds-ok-bg); color: var(--ds-ok-ink); }
body.skin-billdr .td-sheet .ds-pill.warn { background: var(--ds-orange-bg); color: var(--ds-orange-ink); }
body.skin-billdr .td-sheet .ds-pill.info { background: var(--ds-info-bg); color: var(--ds-info-ink); }
body.skin-billdr .td-sheet .tag.tag-gold { display: inline-flex; padding: 1px 8px; border-radius: var(--ds-r-pill); background: var(--ds-gold-tint); color: var(--ds-gold-ink); font-size: 11px; font-weight: 600; margin-right: 4px; }
body.skin-billdr .td-sheet .td-sub-name.linkbtn { text-decoration: none; padding: 0; border: 0; background: none; cursor: pointer; }
body.skin-billdr .td-sheet .td-sub-name.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
body.skin-billdr .td-sheet .td-parent-crumb .linkbtn { color: var(--ds-gold-ink); font-weight: 600; }
body.skin-billdr .td-sheet .td-att .ds-menu {
  min-height: 30px; width: 30px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--ds-muted); border-radius: var(--ds-r-sm);
}
body.skin-billdr .td-sheet .td-att .ds-menu:hover { background: var(--ds-bg); border-color: var(--ds-line); color: var(--ds-navy); }
body.skin-billdr .td-sheet .td-sub.is-done .td-sub-name { color: var(--ds-muted); text-decoration: line-through; }

/* fit the column: the table never pushes the page sideways */
body.skin-billdr #app .tdl-wrap { overflow-x: auto; }
body.skin-billdr #app table.ds-table.tdl-table { table-layout: auto; min-width: 0; }
body.skin-billdr #app table.ds-table.tdl-table th, body.skin-billdr #app table.ds-table.tdl-table td { padding-left: 12px; padding-right: 12px; }
body.skin-billdr #app .tdl-table td.tdl-name-cell { min-width: 220px; }
body.skin-billdr #app .tdl-table td.tdl-duecell, body.skin-billdr #app .tdl-table td.tdl-status { white-space: nowrap; }
body.skin-billdr #app .tdl-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
@media (max-width: 1100px) {
  body.skin-billdr #app .tdl-table th.tdl-th-name { width: auto; }
  body.skin-billdr #app .tdl-label { display: none; }
}

/* An rkMenu opened from inside a dialog (the record's people / status /
 * file pickers) must sit above the overlay: files.css puts .fx-menu at
 * z-index 1200 and .fx-overlay at 1300. Lifted here (patch for files.css
 * proposed to the lead in B3's report). */
body.skin-billdr .fx-menu { z-index: 1350; }
body.skin-billdr .fx-menu { max-height: min(60vh, 420px); overflow-y: auto; }
body.skin-billdr .fx-dialog.td-sheet:focus { outline: none; }
