/* Project "Tree" (WBS) tab — two horizontal cards (canvas + loose tasks). */

.tree-tab {
    width: 100%;
    /* Fill the tab panel so the two cards can own independent inner scroll
       instead of growing the whole page. Offset ≈ page padding + card header
       + tabs + panel padding (re-tuned after the toolbar removal). */
    height: calc(100vh - 185px);
    min-height: 420px;
    display: flex;
}

.tree-empty,
.tree-grid-empty,
.tree-loose-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tree-cards {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.tree-card {
    /* Standard card surface: white body; the gray band lives on the header. */
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.tree-canvas-card { flex: 1 1 0; min-width: 0; }

.tree-loose-card{
    flex: 0 0 0px;
    transition: flex 0.2s cubic-bezier(.85,-0.05,.66,1.19);
}

.tree-loose-card.expanded { flex: 0 0 280px;margin-left: 16px; }


.tree-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px var(--card-pad);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.tree-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.tree-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}
.btn.btn-sm:disabled { opacity: 0.45; cursor: default; }
.btn.btn-primary.btn-sm {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */

.tree-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    container: screen / inline-size;

    /* Per-column track widths, consumed by the template below. Defaults are the
       fluid minmax() tracks; dragging a header handle overrides one of these
       inline on this element (px), and both head + rows reflow together since
       the var inherits to both. */
    --col-status: minmax(40px, 56px);
    --col-wbs: minmax(38px, 56px);
    --col-task: minmax(140px, 2.4fr);
    --col-prio: minmax(84px, 1fr);
    --col-start: minmax(92px, 1.2fr);
    --col-finish: minmax(92px, 1.2fr);
    --col-dur: minmax(56px, 0.7fr);
    --col-scope: minmax(72px, 1fr);
    --col-ms: minmax(72px, 1fr);
}

/* Column template, shared by head + rows.
   FLUID tracks (like the task board's percentage grid) so every column shrinks
   continuously as the panel narrows — not just at hard breakpoints. Each
   metadata column is `minmax(floor, fr)`: it gives up width down to its floor
   before the breakpoints drop it entirely. The inner widgets (DateInput,
   SingleSelect) already have `min-width:0`, so they shrink with their cell. */
.tree-grid-head,
.tree-row {
    display: grid;
    grid-template-columns:
        var(--col-status)          /* Status (thin color bar) — fixed */
        var(--col-wbs)             /* WBS */
        var(--col-task)            /* Task — takes the slack */
        var(--col-prio)            /* Priority */
        var(--col-start)           /* Start */
        var(--col-finish)          /* Finish */
        var(--col-dur)             /* Duration */
        var(--col-scope)           /* Scope */
        1fr              /* Milestone */
        40px;                      /* actions — fixed */
    align-items: center;
    gap: 4px;
    min-width: min-content;
}

.tree-grid-head {
    position: sticky;
    top: 0;
    z-index: 2;
    /* Header is the strong band; body sits on a slightly lifted surface below
       so the area reads as a table distinct from the card header above. */
    background: var(--bg-tertiary, color-mix(in srgb, var(--text-primary) 6%, var(--bg-secondary)));
    border-bottom: 2px solid var(--border);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

/* Table surface: a hair lighter/darker than the card so rows look tabular. */
.tree-grid-body {
    flex: 1 1 auto;
    min-height: 40px;
    background: var(--bg-primary);
}

.tree-row {
    padding: 4px 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: grab;
    background: var(--bg-primary);
}
/* Zebra striping for a clear tabular rhythm. */
.tree-row:nth-child(even) {
    background: color-mix(in srgb, var(--text-primary) 3.5%, var(--bg-primary));
}
.tree-row:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tree-row.selected { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.tree-row.tree-row-parent { background: color-mix(in srgb, var(--text-primary) 5%, var(--bg-primary)); }
.tree-row.tree-row-parent .tcol-task .tree-name-input { font-weight: 600; }

/* Subtle vertical separators between cells so columns read as a grid. */
.tree-grid-head .tcol:not(:last-child),
.tree-row .tcol:not(:last-child) {
    border-right: 1px solid color-mix(in srgb, var(--border) 30%, transparent);
}
/* The status bar is its own visual marker — no separator beside it. */
.tree-grid-head .tcol-status,
.tree-row .tcol-status { border-right: none; }

/* ── Column resize handles (header only) ──────────────────────────────────
   Each resizable header cell hosts an absolutely-positioned grab strip on its
   right edge. It's NOT a grid item (would add a phantom column), so the cell
   must allow overflow for the strip to show past its border. */
.tree-grid-head .tcol { position: relative; overflow: visible; }
.col-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -3px;
    width: 0px;
    cursor: col-resize;
    z-index: 3;
    touch-action: none;
    user-select: none;
}
.col-resize-handle::after {
    content: "";
    position: absolute;
    top: 0px;
    bottom: 0px;
    right: -6px;
    width: 1.2px;
    height: 100%;
    border-radius: 2px;
    background: var(--text-secondary);
    opacity: 0.3;
    transition: background 0.12s ease-out, opacity 0.12s ease-out;
}
.col-resize-handle:hover::after,
.col-resize-handle:active::after { background: var(--accent); width: 2px; opacity: 1; }
.col-resize-handle:hover:before{
    content:"⠿";
    position: absolute;
    color: var(--accent);
    background: var(--bg-tertiary);
    top: 25%;
    bottom: 0px;
    right: -6px;
    width: 5px;
    height: 15px;
    z-index:15;
}

/* While a header handle drags, `.tree-grid` gains `rz-N` (N = the column's
   1-based grid position). Scoped to `.tree-row` so only the body cells light up
   their divider top to bottom — the header keeps the handle's own `::after` line
   (which sits at the correct boundary). Since the dates share a class, nth-child
   is the only way to tell Start from Finish. */
.tree-grid.rz-1 .tree-row .tcol:nth-child(1),
.tree-grid.rz-2 .tree-row .tcol:nth-child(2),
.tree-grid.rz-3 .tree-row .tcol:nth-child(3),
.tree-grid.rz-4 .tree-row .tcol:nth-child(4),
.tree-grid.rz-5 .tree-row .tcol:nth-child(5),
.tree-grid.rz-6 .tree-row .tcol:nth-child(6),
.tree-grid.rz-7 .tree-row .tcol:nth-child(7),
.tree-grid.rz-8 .tree-row .tcol:nth-child(8),
.tree-grid.rz-9 .tree-row .tcol:nth-child(9) {
    border-right-color: var(--accent);
    box-shadow: inset -2px 0 0 -1px var(--accent);
}

.header-title{
    width: 100%;
    overflow: hidden;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Drop feedback while dragging over a row (3 zones) ────────────────────
   "before" → thick line on the TOP edge (insert as sibling above).
   "after"  → thick line on the BOTTOM edge (insert as sibling below).
   "nest"   → the whole row highlighted + left bar (drop becomes child). */
.tree-row.drop-before {
    box-shadow: inset 0 3px 0 0 var(--accent);
}
.tree-row.drop-after {
    box-shadow: inset 0 -3px 0 0 var(--accent);
}
.tree-row.drop-nest {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    box-shadow: inset 4px 0 0 0 var(--accent);
}
/* Hovering a 🔒/🚧 badge highlights the rows connected by a dependency. */
.tree-row.dep-connected {
    background: color-mix(in srgb, #f59e0b 18%, transparent);
    box-shadow: inset 3px 0 0 0 #f59e0b;
}

/* Floating preview tooltip following the cursor during a drag. */
.tree-drag-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 0.78rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}
.tree-drag-tooltip-verb { opacity: 0.85; }
.tree-drag-tooltip-wbs { font-weight: 700; font-variant-numeric: tabular-nums; }

.tcol {
    min-width: 0;
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;    position: relative;
}

.tcol-wbs {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.tcol-task { display: flex; align-items: center; gap: 4px; }

.tree-grid-head > .tcol{
    padding-left: 1.5em;
}

.tree-grid-head > .tcol-status{
    padding-left: 15px !important;
}

.tree-grid-head > .tcol-actions{
    padding-left: 0px !important;
    padding-right: 1.5em !important;
}


.tree-status-bar {
    display: block;
    min-width: 16px;
    max-width: 16px;
    align-self: stretch;
    max-height: 16px;
    min-height: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: width 0.1s ease, filter 0.1s ease;
}
.tree-status-bar:hover { transform: scale(110%); filter: brightness(1.1); }

.popover-panel.tree-status-popover {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    min-width: 160px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tree-status-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
}
.tree-status-option:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tree-status-option.selected { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
.tree-status-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.tree-status-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scope / Milestone inline pickers (click the cell text → popover) ─────── */
.tree-pick-trigger {
    display: block;
    width: 100%;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid transparent;
}
.tree-pick-trigger:hover {
    border-color: var(--border);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.popover-panel.tree-pick-popover {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.tree-pick-option {
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    gap: 10px;
    align-items: center;
}
.tree-pick-option:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tree-pick-option.selected { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }

.tree-pick-label{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-field{
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.status-field-label{
    font-weight: 600;
    letter-spacing: 0.3px;
    padding-left: 15px;
    opacity: 1;
    transition: opacity 0.2s ease-out;
}

.tree-twisty {
    cursor: pointer;
    width: 14px;
    flex-shrink: 0;
    color: var(--text-secondary);
    user-select: none;
    font-size: 20px;
}

.tree-name-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 3px 6px;
    border-radius: 4px;
}
.tree-name-input:hover { border-color: var(--border); }
.tree-name-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

.tree-row-badges { display: inline-flex; gap: 2px; flex-shrink: 0; }

/* The Tooltip component wraps the name in a .tooltip-trigger div — it must
   take over the name's flex slot so the ellipsis keeps working. */
.tcol-task .tooltip-trigger {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.tcol-task .tooltip-trigger .tree-name-text { display: block; }

.tree-loose-item .tooltip-trigger {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.tree-loose-item .tooltip-trigger .tree-loose-name { display: block; }

/* WBS date popovers: panel chrome comes from .date-cal itself. */
.popover-panel.tree-date-popover {
    padding: 0;
}

/* Title is now display text (click opens the task modal), like the board. */
.tree-name-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
}
.tree-name-text:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    text-decoration: underline;
}
.tree-row-parent .tcol-task .tree-name-text { font-weight: 600; }

/* Compact, click-to-edit cells (date / duration). */
.tree-date-text {
    display: block;
    width: 100%;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid transparent;
}

.default{
    opacity: 0.4;
}

.tree-date-text:hover { border-color: var(--border); color: var(--text-primary); }

/* Priority: colored dot + label; the label collapses out when narrow. */
.tree-prio-trigger {
    display: flex;
    gap: 10px;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    overflow: hidden;
}
.tree-prio-trigger:hover { border-color: var(--border); }
.tree-prio-dot { flex-shrink: 0; font-size: 0.7rem; line-height: 1; }
.tree-prio-label {
    font-size: 0.8rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.2s ease-out;
}
.tree-prio-label.hide { display: none; }

.tree-dur-input {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
}
.tree-dur-input:hover { border-color: var(--border); }
.tree-dur-input:focus { outline: none; border-color: var(--accent); background: var(--bg-primary); }

/* ── Compact DateInput inside tree cells ──────────────────────────────────
   The shared DateInput (text field + 36px calendar button) overflows a narrow
   table column and clips the date. Scope a tighter layout to date cells only,
   so the modal/board versions stay untouched. */
.tcol-date { padding-right: 2px; }
.tcol-date .date-input-wrapper { gap: 2px; width: 100%; }
.tcol-date .date-input-text {
    padding: 3px 4px;
    font-size: 0.8rem;
    border-radius: 4px;
}
.tcol-date .date-input-cal-btn {
    width: 22px;
    font-size: 0.8rem;
    border-radius: 4px;
}
/* Rolled-up parent dates already fit; keep them snug too. */
.tcol-date .tree-rollup { padding: 0 2px; }
.tcol-dur .tree-dur-input { padding: 3px 2px; }

/* Rolled-up parent dates / duration are read-only and visually subdued. */
.tree-rollup {
    color: var(--text-secondary);
    font-style: italic;
    padding: 0 6px;
}
.tree-readonly { color: var(--text-secondary); font-size: 0.8rem; padding: 0 4px; }

.tcol-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
/* Row actions menu (⋯): detach from tree / delete task. */
.tree-row-menu {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 4px;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.1s;
}
/* Reveal row actions on hover/selection to keep the grid clean. */
.tree-row:hover .tree-row-menu,
.tree-row.selected .tree-row-menu { opacity: 1; }
.tree-row-menu:hover { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 10%, transparent); }

/* Destructive option inside the row menu. */
.tree-pick-option.tree-pick-danger { color: #c0392b; }
.tree-pick-option.tree-pick-danger:hover { background: color-mix(in srgb, #c0392b 12%, transparent); }

/* Ghost row at the bottom of the canvas: click to add a root task inline. */
.tree-ghost-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 12px;
    margin: 2px 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    border: 1px dashed transparent;
    border-radius: 6px;
}
.tree-ghost-row:hover {
    border-color: var(--border);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}
/* Active drop target: dropping a dragged node here promotes it to a root. */
.tree-ghost-row.drop-root {
    border-color: var(--accent);
    border-style: solid;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.tree-ghost-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid currentColor;
    font-weight: 600;
    line-height: 1;
}

/* The inline single-select trigger should sit flush in the cell. */
.tcol-prio .multiselect-trigger { width: 100%; font-size: 0.8rem; padding: 3px 6px; }

/* PRIORITY */
/* header */
.tcol-prio-header{
    container: colPrioHeader / inline-size;
}

.tcol-prio-header > .header-icon{
    display: none;
}

@container colPrioHeader (width<60px){
    .tcol-prio-header > .header-icon{
        display: block;
    }

    .tcol-prio-header > .header-title{
        display: none;
    }
}

/* field  */
.tree-prio-trigger{
    container: colPrio / inline-size;
}

@container colPrio (width<95px){
    .tree-prio-trigger > .tree-prio-label{
        opacity: 0;
    }
}

/* DURAÇÃO */
.tcol-dur-header{
    container: colDurHeader / inline-size;
}

.tcol-dur-header > .header-icon{
    display: none;
}


@container colDurHeader (width<60px){
    .tcol-dur-header > .header-icon{
        display: block;
    }

    .tcol-dur-header > .header-title{
        display: none;
    }
}

/* STATUS  */
.tcol-status-header{
    container: colStatusHeader / inline-size;
}

.tcol-status-header > .header-icon{
    display: none;
}


@container colStatusHeader (width<60px){
    .tcol-status-header > .header-icon{
        display: block;
    }

    .tcol-status-header > .header-title{
        display: none;
    }
}

.status-field{
    container: colStatusField / inline-size;
}

@container colStatusField (width<60px){
    .status-field-label{
        opacity: 0;
    }
}

/* ── Loose tasks card ───────────────────────────────────────────────────── */

.tree-loose-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
}
.tree-loose-search,
.tree-loose-scope-select {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
}
.tree-loose-search:focus,
.tree-loose-scope-select:focus { outline: none; border-color: var(--accent); }

.tree-loose-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}

.tree-loose-group { margin-bottom: 12px; }
.tree-loose-scope {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    margin: 4px 4px 6px;
}

.tree-loose-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: grab;
}
.tree-loose-item:hover { border-color: var(--accent); }
.tree-loose-item:active { cursor: grabbing; }
/* Thin status color bar at the left of a loose item (matches the tree column). */
.tree-loose-status {
    flex: 0 0 auto;
    width: 4px;
    align-self: stretch;
    min-height: 16px;
    border-radius: 3px;
}
.tree-loose-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loose-tasks-counter{
    background-color: var(--accent);
    color: white;
    border-radius: 22px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    transition: background 0.2s ease-out, color 0.2s ease-out;
}

.loose-tasks-btn{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    transition: background 0.2s ease-out, color 0.2s ease-out;
}

.loose-tasks-btn.active{
    background-color: var(--accent);
    color:white;
}

.loose-tasks-btn.active .loose-tasks-counter{
    background-color: var(--bg-tertiary);
    color:var(--text-secondary);
}

.loose-expand-btn{transition: transform 0.2s ease-in-out;}

.loose-tasks-btn.active .loose-expand-btn{
    transform: rotate(180deg);
}



@container screen (width <= 1100px) {
    .tree-table-handle{display:none}

    .tcol-ms { display: none !important; }

    .tree-grid-head,
    .tree-row {
        grid-template-columns:
            4vw          /* Status (thin color bar) — fixed */
            5vw             /* WBS */
            1fr            /* Task — takes the slack */
            4vw            /* Priority */
            6vw            /* Start */
            6vw           /* Finish */
            4vw            /* Duration */
            6vw           /* Scope */
            5vw;                      /* actions — fixed */
    }
}
@container screen (width <= 850px) {
    .tcol-scope { display: none; }
    .tcol-prio { display: none; }
    .tree-grid-head,
    .tree-row {
        grid-template-columns:
            4vw          /* Status (thin color bar) — fixed */
            5vw          /* WBS */
            1fr   /* Task — takes the slack */
            6vw           /* Start */
            6vw          /* Finish */
            4vw             /* Duration */
            5vw;                      /* actions — fixed */
    }
}
@container screen (width <= 650px) {
    .tcol-dur { display: none; }
    .tcol-start { display: none; }
    .tree-grid-head,
    .tree-row {
        grid-template-columns:
            max(6vw,42px)          /* Status (thin color bar) — fixed */
            8vw           /* WBS */
            1fr            /* Task — takes the slack */
            6vw           /* Finish */
            4vw                      /* actions — fixed */
    }
}

@container screen (width <= 500px) {
    .tcol-dur { display: none; }
    .tcol-start { display: none; }
    .tcol-due{display: none;}
    .tree-grid-head,
    .tree-row {
        grid-template-columns:
            max(6vw,42px)          /* Status (thin color bar) — fixed */
            8vw           /* WBS */
            1fr            /* Task — takes the slack */
            4vw                      /* actions — fixed */
    }
}

/* START DATE  */

.tree-date-text.date-start,.tree-rollup.date-start{
    container: dateStart / inline-size;
    display: block;
}

.no-year-date-start{ display:none;}
@container dateStart (width<75px){
    .year-date-start{
        display: none;
    }
    .no-year-date-start{ display:block;}
}

/* DUE DATE  */

.tree-date-text.date-due,.tree-rollup.date-due{
    container: dateDue / inline-size;
    display: block;
}

.no-year-date-due{ display:none;}
@container dateDue (width<75px){
    .year-date-due{
        display: none;
    }
    .no-year-date-due{ display:block;}
}

