@layer components {
/* Ticket table: the title opens a ticket, every other cell edits in place; headers sort, move and hide. */
.tbl { width: 100%; padding-bottom: 90px; }
.thead { display: grid; grid-template-columns: var(--cols); position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg-1); border-bottom: 1px solid var(--line); height: 32px; align-items: center; padding: 0 14px; }
.thead > span { min-width: 0; display: flex; align-items: center; }
.th { height: 26px; padding: 0 6px; margin-left: -6px; border-radius: var(--r-6); display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  font-size: var(--fs-10-5); letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-4); font-weight: 600; white-space: nowrap; }
.th:hover, .th:focus-visible { background: var(--bg-3); color: var(--fg-2); }
.th.sorted { color: var(--fg-2); }
.th-l { overflow: hidden; text-overflow: ellipsis; }
.sort-badge { display: inline-flex; align-items: center; gap: 1px; height: 16px; padding: 0 4px; border-radius: var(--r-5); background: var(--accent-soft); color: var(--accent); letter-spacing: 0; font-variant-numeric: tabular-nums; }

.grp-h { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px; width: 100%; text-align: left; margin-top: 6px; }
.grp-h .chev { color: var(--fg-3); transition: transform var(--t-base); }
.grp.shut .grp-h .chev { transform: rotate(-90deg); }
.grp-h .gname { font-family: var(--f-display); font-weight: 700; font-size: var(--fs-15); letter-spacing: -0.005em; white-space: nowrap; }
.grp-h .gcount { color: var(--fg-3); font-variant-numeric: tabular-nums; font-size: var(--fs-12); }
.grp-h .dist { margin-left: 6px; }
.grp-h .gnote { font-size: var(--fs-11-5); color: var(--fg-3); margin-left: 8px; white-space: nowrap; }
.grp-h .gico { display: inline-flex; }

.row { display: grid; grid-template-columns: var(--cols); align-items: center; height: 40px; padding: 0 14px; border-top: 1px solid var(--line); position: relative; }
.row:hover { background: var(--bg-2); }
.row.sel { background: var(--accent-soft); }
.row.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.row > span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.row.child { background: color-mix(in srgb, var(--bg-2) 55%, transparent); border-top-color: transparent; }

.c-title { overflow: hidden; align-self: stretch; }
.c-title .tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--fg); flex: 0 1 auto; min-width: min(60%, 220px); text-align: left; height: 100%; }
.c-title .tt:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.c-title .tw { width: 16px; height: 16px; border-radius: var(--r-4); display: grid; place-items: center; color: var(--fg-3); flex: none; transition: transform var(--t-fast); }
.c-title .tw:hover { background: var(--bg-5); color: var(--fg); }
.c-title .tw.open { transform: rotate(90deg); }
.c-title .tw.none { visibility: hidden; }
.c-title .st-ico { width: 20px; height: 20px; border-radius: var(--r-5); display: grid; place-items: center; flex: none; }
.c-title .st-ico:not(:disabled):hover { background: var(--bg-5); }
.c-title .kids-chip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: var(--r-6); color: var(--fg-3); font-size: var(--fs-11); font-variant-numeric: tabular-nums; flex: none; }
.c-title .kids-chip:hover { color: var(--fg); background: var(--bg-4); }
.c-title .meta { display: flex; gap: 8px; color: var(--fg-4); font-size: var(--fs-11); flex: none; align-items: center; }
/* Tags give way first when the title column is narrow; the title keeps its minimum. */
.c-title .tags { display: flex; gap: 4px; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.c-title .meta span { display: inline-flex; align-items: center; gap: 3px; }
.c-title .meta .report-mark { color: var(--merged); }
.c-title .hover-key { margin-left: auto; padding-left: 8px; margin-right: 12px; color: var(--fg-4); font-size: var(--fs-11); flex: none; opacity: 0; transition: opacity var(--t-fast); }
.row:hover .hover-key, .row:focus-within .hover-key { opacity: 1; }
.viewing { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-10-5); color: var(--fg-3); flex: none; margin-left: auto; }
.viewing + .hover-key { margin-left: 0; }

/* Subtickets indent under their parent with a tree line that ends at the last one. */
.row.child .c-title { padding-left: 18px; }
.c-title .elbow { position: relative; width: 16px; flex: none; align-self: stretch; }
.c-title .elbow::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; border-left: 1.5px solid var(--line-2); }
.row.last .c-title .elbow::before { bottom: 50%; }
.c-title .elbow::after { content: ""; position: absolute; left: 7px; right: 0; top: 50%; border-top: 1.5px solid var(--line-2); }

/* Cells edit their field in place. */
.cellb { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 26px; padding: 0 6px; margin-left: -6px; border-radius: var(--r-6); text-align: left; overflow: hidden; }
.cellb:hover, .cellb:focus-visible { background: var(--bg-4); }
.row .add-ico { color: var(--fg-4); opacity: 0.55; display: inline-flex; }
.row:hover .add-ico { opacity: 1; }
.row .c-inherits { font-size: var(--fs-11); }

.add-row { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 52px; color: var(--fg-4); width: 100%; text-align: left; border-top: 1px solid var(--line); }
.add-row:hover { color: var(--fg-2); background: var(--bg-2); }

/* Column header menu and the view settings (cog) */
.sort-step { display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px; }
.sort-n { width: 16px; height: 16px; border-radius: var(--r-4); background: var(--bg-4); color: var(--fg-3); font-size: var(--fs-10); display: grid; place-items: center; flex: none; }
.view-set { width: 270px; }
.vs-h { display: flex; align-items: center; gap: 8px; padding: 8px 9px 4px; font-weight: 600; }
.vs-fields { max-height: 46vh; overflow-y: auto; }
.vs-field { display: flex; align-items: center; gap: 2px; padding-right: 4px; }
.vs-field .pop-i { flex: 1; min-width: 0; }
.pop-g .muted { margin-left: 6px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.vs-seg { margin: 4px 9px 6px; }
/* Menu items color their icons, which would show the check of a field that is off. */
.view-set .cb:not(.on) .i, .pop .cb:not(.on) .i { visibility: hidden; }

/* Simple data table used by settings and archive */
.stable { width: 100%; border-collapse: collapse; font-size: var(--fs-12-5); }
.stable th { font-size: var(--fs-10-5); letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-4); font-weight: 600; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.stable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stable tr:hover td { background: var(--bg-2); }
.stable td.right { text-align: right; white-space: nowrap; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell b { display: block; font-weight: 600; }
.who-cell span { font-size: var(--fs-11-5); color: var(--fg-3); }

/* Bulk action bar */
.bulk {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: var(--z-bulk); background: var(--bg-4);
  border: 1px solid var(--line-2); border-radius: var(--r-13); padding: 6px 6px 6px 14px; display: flex; align-items: center; gap: 4px;
  box-shadow: var(--shadow-pop); animation: rise 200ms ease-out; white-space: nowrap; max-width: calc(100% - 32px); overflow-x: auto;
}
@keyframes rise { from { transform: translate(-50%, 8px); } }
.bulk .cnt { font-weight: 600; margin-right: 8px; display: flex; align-items: center; gap: 8px; }
.bulk .cnt b { background: var(--accent); color: var(--fg-on-accent); border-radius: var(--r-6); padding: 0 7px; font-variant-numeric: tabular-nums; }
.bulk button.b { height: 30px; padding: 0 10px; border-radius: var(--r-8); display: flex; align-items: center; gap: 6px; color: var(--fg-2); }
.bulk button.b:hover { background: var(--bg-5); color: var(--fg); }
.bulk .vr { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
}
