/* The worktree janitor (web/worktrees.js): a list dialog, one row per worktree.
   Only the shared tokens from base.css are read here, and nothing in base.css or
   colours.css is overridden, so a change to the palette reaches this dialog
   without an edit. */

.modal.wt { width: min(760px, 100%); }
.modal.wt .modal-body { padding-bottom: var(--sp-4); }

.wt-list { display: flex; flex-direction: column; gap: var(--sp-3); transition: opacity var(--t-fast) var(--ease); }
.wt-list.loading { opacity: 0.6; }

.wt-summary {
    display: flex;
    gap: var(--sp-3);
    align-items: baseline;
    padding: 0 var(--sp-1) var(--sp-3);
    font: 400 var(--fs-md)/var(--lh-snug) var(--sans);
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.wt-summary .sep { color: var(--text-4); }

.wt-note {
    padding: var(--sp-4) var(--sp-6);
    border-radius: var(--r-sm);
    background: var(--s3);
    font: 400 var(--fs-md)/var(--lh-base) var(--sans);
    color: var(--text-2);
}
.wt-note.warn { color: var(--yellow); }

.wt-row {
    display: flex;
    align-items: center;
    gap: var(--sp-6);
    padding: var(--sp-5) var(--sp-6);
    border-radius: var(--r);
    background: var(--s3);
    border: 1px solid transparent;
}
.wt-row.safe { border-color: var(--outline-soft); }
.wt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.wt-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3) var(--sp-4); min-width: 0; }

.wt-name {
    font: 500 var(--fs-base)/var(--lh-tight) var(--sans);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wt-branch {
    font: 400 var(--fs-xs)/var(--lh-tight) var(--mono);
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wt-small { font: 400 var(--fs-sm)/var(--lh-tight) var(--sans); color: var(--text-3); }
.wt-why { font: 400 var(--fs-sm)/var(--lh-snug) var(--sans); color: var(--text-3); }

.wt-chip {
    display: inline-flex;
    flex: none;
    width: auto;
    align-items: center;
    /* 1px, not a step: the chip keeps the 18px of the line it sits on. */
    padding: 1px var(--sp-4);
    border-radius: var(--pill);
    background: var(--s4);
    border: 0;
    font: 500 var(--fs-xs)/var(--lh-prose) var(--sans);
    color: var(--text-2);
    text-decoration: none;
    white-space: nowrap;
}
a.wt-chip:hover, button.wt-chip:hover { background: var(--s5); color: var(--text); }
button.wt-chip { cursor: pointer; }
.wt-chip.pr-open { color: var(--green); }
.wt-chip.pr-merged { color: var(--purple); }
.wt-chip.pr-closed { color: var(--red); }
.wt-chip.warn { color: var(--yellow); }
.wt-chip.session.live { color: var(--blue); }

.wt-remove { flex: none; }
.wt-actions { flex: none; display: flex; flex-direction: column; gap: var(--sp-2); align-items: stretch; }
.wt-chip.ports { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wt-chip.setup.ok { color: var(--green); }
.wt-chip.setup.bad { color: var(--red); }
.wt-chip.setup.warn { color: var(--yellow); }
.wt-chip.setup.live { color: var(--blue); }
/* A setup or cleanup confirm, and a setup's last lines, inside the row. */
.wt-ask {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-2);
    padding: var(--sp-4) var(--sp-5);
    border-radius: var(--r-sm);
    background: var(--s4);
}
.wt-cmd {
    font: 400 var(--fs-xs)/var(--lh-snug) var(--mono);
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
.wt-ask-btns { display: flex; gap: var(--sp-3); justify-content: flex-end; }
.wt-tail {
    margin: var(--sp-2) 0 0;
    padding: var(--sp-4) var(--sp-5);
    max-height: 220px;
    overflow: auto;
    border-radius: var(--r-sm);
    background: var(--s1);
    font: 400 var(--fs-xs)/var(--lh-snug) var(--mono);
    color: var(--text-2);
    white-space: pre-wrap;
    word-break: break-word;
}

.wt-confirm-lead { margin: var(--sp-2) 0 var(--sp-5); font: 500 var(--fs-lg)/var(--lh-snug) var(--sans); color: var(--text); }
.wt-confirm-list {
    margin: 0 0 var(--sp-6);
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    max-height: 50vh;
    overflow-y: auto;
}
.wt-confirm-list li { display: flex; gap: var(--sp-4); align-items: baseline; min-width: 0; }

/* On the work-in-flight board, beside a project's counts. */
.dproj-wt {
    padding: 2px 10px;
    border: 0;
    border-radius: var(--pill);
    background: transparent;
    font: 500 11.5px/1.5 var(--sans);
    color: var(--text-3);
    cursor: pointer;
}
.dproj-wt:hover { background: var(--s3); color: var(--text); }
