/* web/css/dialogs.css
 *
 * Scrims and modals and the fields, pickers and buttons inside them, then
 * notification history, the delete and restart confirmations, and toasts.
 *
 * Linked from web/index.html in the order the sections had in the old
 * web/styles.css, and concatenated in that order they reproduce it exactly, so
 * the cascade is unchanged. A rule that moves between these files moves in the
 * cascade too: check what it now comes before and after.
 */

.scrim {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-scrim);
    padding: var(--sp-9);
    /* Over the bar, which is the window's titlebar in the desktop app: a
       click on the scrim there closes the dialog rather than moving the window. */
    -webkit-app-region: no-drag;
}
.scrim[hidden] { display: none; }

.modal {
    width: min(640px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: var(--s2);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-dialog);
    overflow: hidden;
}
/* The snippet editor. A parameters table beside a body textarea does not fit in
   640px, and shrinking either to make it would be the wrong trade — the body is
   the thing you are actually writing. */
.modal.wide { width: min(880px, 100%); }

/* The title sits on --fs-xl, a step under a page title (--fs-2xl): a dialog is
   one thing in a page, not a page of its own.

   Flush to the top so a title that wraps, or a head with a project line above
   its title (colours.css), keeps the ✕ on the line it closes rather than drifting
   to the middle of the block. The ✕'s top margin is what centres its 34px
   circle on the first line of a --fs-xl title. */
.modal-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-6);
    padding: var(--sp-8) var(--sp-7) var(--sp-4) var(--sp-9);
    font: 400 var(--fs-xl)/var(--lh-tight) var(--sans);
    color: var(--text);
    transition: box-shadow var(--t-fast) var(--ease);
}
/* The body has scrolled under the head: say so, so a field cut off at the top
   edge reads as "more above" rather than as a clipped label. Set by openModal()
   in web/dom.js. */
.modal[data-scrolled] > .modal-head { box-shadow: 0 1px 0 var(--outline-soft), var(--shadow-1); }
.modal-close {
    flex: none;
    margin: calc((var(--fs-xl) * var(--lh-tight) - 34px) / 2) 0 0 auto;
    width: 34px; height: 34px;
    border-radius: 50%;
    color: var(--text-3);
    font-size: 15px;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.modal-close:hover { background: var(--s3); color: var(--text); }

/* A body taller than the window opens scrolled whenever the field that takes
   the focus is low in it — the Start dialog's First message is, under about
   1000px. The line under the head (above) is what makes that read as "more
   above" rather than as a clipped label. The scroll padding keeps a field the
   browser scrolls to off the edge it is scrolled against. */
.modal-body {
    padding: var(--sp-6) var(--sp-9) var(--sp-2);
    overflow-y: auto;
    scroll-padding-block: var(--sp-4);
}
.modal-foot {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-7) var(--sp-9) var(--sp-8);
}
.modal-foot .spacer { flex: 1; }
/* Model and permission mode ride along with the actions. They wrap rather than
   squeezing the buttons when the window is narrow. */
.modal-foot .opts { flex-wrap: wrap; margin: 0; }

/* Two rows: settings, then what to do with them. For a footer carrying more than
   a pair of buttons — see the comment on #new-scrim's. The gap is wider than the
   one between buttons because it is separating two kinds of thing rather than
   spacing a row of one kind. */
.modal-foot.stacked {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-7);
}
/* Given the whole row, the settings no longer have to squeeze past the buttons.
   Still allowed to wrap — the modal is `min(640px, 100%)` and goes narrow on a
   phone-width window — but now it can only break between the pairs, because each
   is an `.opt` of its own. The gap is the wide one for the same reason. */
.modal-foot.stacked .opts { flex-wrap: wrap; gap: var(--sp-4) var(--sp-8); padding-left: 0; }
/* The composer's rule spaces label/select pairs apart; here each pair is an .opt
   and the row's gap already does it. */
.modal-foot.stacked .opts select + label { margin-left: 0; }
.opt {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
}
/* The select gives up width before the label does: `inherit` truncated is still
   readable, whereas a clipped "Permissions" stops naming anything. */
.opt label { flex: none; }
.opt select { min-width: 0; }
/* The composer's selects rest on --s2, which is this dialog's own ground, so
   here they vanished into plain text. A control is one step above what it sits
   on. */
.modal .opts select { background: var(--s3); }
.modal .opts select:hover { background: var(--s4); }

.foot-acts {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-4);
}
/* The way out goes to the far edge, away from the things you might commit, so
   the eye that lands on the primary at the right does not land on Cancel next. */
.foot-acts > [data-close] { margin-right: auto; }

.field { margin-bottom: var(--sp-7); }
.field > label {
    display: block;
    margin-bottom: var(--sp-4);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    color: var(--text-3);
}
.field textarea, .field input[type="text"] {
    width: 100%;
    background: var(--bg);
    border-radius: var(--r);
    padding: var(--sp-6) var(--sp-7);
    font-size: var(--fs-base);
    line-height: var(--lh-prose);
    transition: box-shadow var(--t-fast) var(--ease);
}
.field textarea { min-height: 100px; resize: vertical; }
/* Sized by script from its contents (see grow()), so it needs no floor of its
   own — and it scrolls rather than growing without limit once it hits the cap. */
.field textarea.grow { min-height: 0; resize: none; overflow-y: auto; }
.field input[type="text"] { font-family: var(--mono); font-size: var(--fs-md); }
/* The one text input in this dialog that is not a path. A name is prose you
   read, so it gets the prose face rather than the monospace the directory box
   wants for lining up slashes. */
#new-name { font-family: var(--sans); font-size: var(--fs-md); }
/* A search over names as much as paths, so the prose face, and slimmer than the
   directory box above it: it is a tool on the list, not a field of the form. */
.field input.picker-filter {
    font-family: var(--sans); font-size: var(--fs-md);
    padding: var(--sp-4) var(--sp-6); margin-bottom: var(--sp-3);
}
.field textarea:focus, .field input:focus {
    outline: none;
    box-shadow: var(--ring-inset);
}
.field .note { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-3); line-height: var(--lh-base); }

.field label.check {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    margin: 0;
    font: 400 var(--fs-base)/var(--lh-snug) var(--sans);
    color: var(--text-2);
    cursor: pointer;
}
.field label.check input { accent-color: var(--blue); width: 16px; height: 16px; }
/* Several checkboxes on one line, wrapping when the dialog is narrow — the
   Start dialog's worktree and orchestrator boxes. */
.field .check-line { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-10); }
.field .check-line label.check[hidden] { display: none; }
/* Side by side, so the stacked boxes' spacing below does not apply. */
.field .check-line label.check + label.check { margin-top: 0; }

/* "From an issue…" (web/new-session/issues.js). The list is the dialog's own
   picker; a title gives way before its number, labels and age do. */
.issue-panel { margin-top: var(--sp-4); }
.issue-panel[hidden] { display: none; }
.issue-panel .note.warn { color: var(--yellow); }
.issue-row > * { flex: none; }
.issue-row .issue-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue-label {
    padding: 0 var(--sp-3);
    border-radius: var(--pill);
    background: var(--s3);
    font-size: var(--fs-xs);
    color: var(--text-3);
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.issue-row[disabled] { cursor: progress; }

.picker {
    background: var(--bg);
    border-radius: var(--r);
    max-height: 210px;
    overflow-y: auto;
    padding: var(--sp-3);
}
.picker-row {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    width: 100%;
    text-align: left;
    padding: var(--sp-4) var(--sp-6);
    border-radius: var(--r-sm);
    font: 400 var(--fs-md)/var(--lh-snug) var(--sans);
    color: var(--text-2);
    transition: background var(--t-fast) var(--ease);
}
.picker-row:hover { background: var(--s3); }
.picker-row .path { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-4); }
.picker-row .tag { margin-left: auto; font-size: var(--fs-sm); color: var(--green); }
/* Where the input currently points — so the folder you just climbed out of is
   findable in the list you land back in. */
.picker-row[aria-current="true"] { background: var(--blue-cont); color: var(--blue); }
.picker-row[aria-current="true"]:hover { background: var(--blue-cont-hover); }
.picker-row .tag.dim { color: var(--text-4); }
.picker-row.up { color: var(--text-3); }

/* Recent / Browse. These sit where a `.field > label` would, and replace it. */
.picker-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.picker-tab {
    padding: var(--sp-3) var(--sp-6);
    border-radius: var(--pill);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    color: var(--text-3);
    transition: background var(--t-fast) var(--ease);
}
.picker-tab:hover { background: var(--s3); }
.picker-tab[aria-selected="true"] { background: var(--blue-cont); color: var(--blue); }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1);
    padding: 0 var(--sp-1) var(--sp-3);
    font: 400 var(--fs-xs)/var(--lh-prose) var(--mono);
    color: var(--text-4);
}
.crumb {
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--r-xs);
    font: inherit;
    color: var(--text-3);
    transition: background var(--t-fast) var(--ease);
}
.crumb:hover { background: var(--s3); color: var(--text); }
.crumb[aria-current="page"] { color: var(--text); }

.browse-foot { display: flex; align-items: center; gap: var(--sp-4); padding-top: var(--sp-5); }
.btn.small { height: var(--ctl-sm); padding: 0 var(--sp-6); font-size: var(--fs-md); }
.browse-foot .note { margin-top: 0; flex: 1; min-width: 0; }
.mkdir-name {
    flex: 1;
    min-width: 0;
    background: var(--bg);
    border-radius: var(--r);
    padding: var(--sp-3) var(--sp-6);
    font-family: var(--mono);
    font-size: var(--fs-sm);
}
.mkdir-name:focus { outline: none; box-shadow: var(--ring-inset); }

/* Nothing to list, or nothing readable. Sits inside .picker in place of rows. */
.picker-msg { padding: var(--sp-5) var(--sp-6); font-size: var(--fs-sm); line-height: var(--lh-base); color: var(--text-3); }

.btn {
    height: var(--ctl-lg);
    padding: 0 var(--sp-9);
    border-radius: var(--pill);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    color: var(--blue);
    /* A button is a label, not a paragraph. Left to wrap, "Save as draft" broke
       across two lines and took the footer's height with it. */
    white-space: nowrap;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn:hover { background: var(--blue-tint); }
.btn.primary { background: var(--blue); color: var(--on-blue); }
.btn.primary:hover { background: var(--blue); filter: brightness(1.08); }
.btn:disabled { opacity: var(--disabled-opacity); cursor: default; }

/* The middle weight, for a footer with two things you might commit. Filled, so
   it reads as an action rather than a way out, but in the surface colour rather
   than the accent so it cannot be mistaken for the main one. The same grey-filled
   idiom the New session button in the bar uses, and it means the same thing. */
.btn.tonal { background: var(--s4); color: var(--text); }
.btn.tonal:hover { background: var(--s5); }

/* And the quietest: a text button, for the way out and for a choice that only
   changes what the dialog is doing (Schedule) rather than committing anything.
   Blue on Cancel put it in the same voice as the actions it sits beside; this
   steps it back so the eye lands on them. Narrower than a filled button, since
   there is no fill for the padding to frame. */
.btn.quiet { color: var(--text-3); padding: 0 var(--sp-7); }
.btn.quiet:hover { background: var(--s3); color: var(--text); }

/* The one button in the app that destroys something. Filled, in the error
   colour, so it can never be mistaken for the confirm it sits next to. */
.btn.destructive { background: var(--red); color: var(--on-red); }
.btn.destructive:hover { background: var(--red); filter: brightness(1.08); }

/* ── notification history ────────────────────────────────────────────────
   A log, so it reads down the left edge: the kind first, always in the same
   place, because scanning for "was there a permission I missed" is what this
   list is for. The accent stripe carries the same meaning as the kind word and
   is there to be read at arm's length; the quiet rows give theirs up, which is
   how Everything stays readable once it fills with short turns. */


/* Two states of one control, so they share a track rather than sitting apart
   as a pair of buttons that happen to be next to each other. */
.seg {
    display: flex;
    /* 3px: the 28px buttons inside a 34px track, the bar's control height. */
    padding: 3px;
    border-radius: var(--pill);
    background: var(--s2);
}
.seg-btn {
    height: var(--ctl-sm);
    padding: 0 var(--sp-6);
    border-radius: var(--pill);
    color: var(--text-3);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--s4); color: var(--text); }

.notes-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 var(--pane-x, 28px) var(--sp-10);
}

.note-row {
    position: relative;
    margin-bottom: var(--sp-3);
    border-radius: var(--r);
    background: var(--s2);
    overflow: hidden;
}
.note-row::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--edge-w);
    background: var(--accent);
}

.note-main {
    display: block;
    width: 100%;
    /* The left is the edge's width on top of the row's own inset. */
    padding: var(--sp-5) var(--sp-7) var(--sp-6) calc(var(--edge-w) + var(--sp-7));
    text-align: left;
    transition: background var(--t-fast) var(--ease);
}
.note-main:hover { background: var(--s3); }

.note-head {
    display: flex;
    align-items: baseline;
    gap: var(--sp-5);
}
.note-kind {
    flex: none;
    /* Fixed width so every kind word starts and ends in the same place and the
       titles line up beside them. */
    width: 104px;
    font: 500 var(--fs-sm)/var(--lh-snug) var(--sans);
    color: var(--accent);
    letter-spacing: 0.01em;
}
.note-title {
    flex: 1;
    min-width: 0;
    font: 500 var(--fs-base)/var(--lh-snug) var(--sans);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-when {
    flex: none;
    font: 400 var(--fs-sm)/var(--lh-snug) var(--sans);
    color: var(--text-4);
}

.note-summary {
    display: block;
    margin-top: var(--sp-1);
    /* The kind column's width plus the head's gap, so this lines up under the
       title. */
    padding-left: calc(104px + var(--sp-5));
    font: 400 var(--fs-md)/var(--lh-base) var(--sans);
    color: var(--text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-meta {
    display: flex;
    gap: var(--sp-5);
    margin-top: var(--sp-2);
    padding-left: calc(104px + var(--sp-5));
    font: 400 var(--fs-sm)/var(--lh-snug) var(--sans);
    color: var(--text-4);
}
.note-outcome { color: var(--text-3); }
/* How an ask ended, where the ending is the news: denied by a rule you did not
   see, or denied because nothing was open to ask. */
.note-outcome[data-outcome="deny"],
.note-outcome[data-outcome="auto-denied"],
.note-outcome[data-outcome="abandoned"] { color: var(--yellow); }

.note-row { --accent: var(--blue); }
.note-row[data-type="plan"] { --accent: var(--purple); }
.note-row[data-type="question"] { --accent: var(--peach); }
.note-row[data-type="finished"] { --accent: var(--green); }
.note-row[data-type="failed"] { --accent: var(--red); }
.note-row[data-type="stalled"] { --accent: var(--yellow); }
.note-row[data-type="agent-done"] { --accent: var(--text-4); }
.note-row[data-type="peer-message"] { --accent: var(--peach); }
.note-row[data-type="handoff"] { --accent: var(--purple); }

/* Dealt with: the badge is not counting this any more, and the row should not
   look like it is either. The same two moves the quiet rows get below — the fill
   goes and the edge dims — because it is the same statement, that this one is not
   asking for anything. The title keeps its weight, which is what still separates
   a handled interruption from something that was never one.

   Read rather than unread is what changes, deliberately. A log you have already
   been through is the normal case, so the marked state has to be the exception or
   every row is marked and none of them read as marked. */
.note-row[data-loud="true"][data-unread="false"] { background: transparent; }
.note-row[data-loud="true"][data-unread="false"]::before { opacity: 0.4; }

/* Nothing ever interrupted you for these, so they do not get to shout here
   either. They are in the list to answer "what has been going on", which is a
   question you ask by reading rather than by glancing. */
.note-row[data-loud="false"] { background: transparent; }
.note-row[data-loud="false"]::before { opacity: 0.4; }
.note-row[data-loud="false"] .note-title { color: var(--text-2); font-weight: 400; }
.note-row[data-loud="false"] .note-kind { color: var(--text-4); }
.note-row[data-loud="false"] .note-main:hover { background: var(--s2); }

@media (max-width: 700px) {
    .note-kind { width: auto; }
    .note-summary, .note-meta { padding-left: 0; }
}

/* ── delete confirm ──────────────────────────────────────────────────── */

.modal.danger { width: min(500px, 100%); }
.modal.danger .modal-body { padding-bottom: var(--sp-2); }

/* What is about to go, named — the whole reason this is a dialog and not a
   confirm(): a title and a turn count are enough to catch the wrong row. */
.del-what {
    font: 500 var(--fs-base)/var(--lh-base) var(--sans);
    color: var(--text);
    padding: var(--sp-6) var(--sp-7) var(--sp-2);
    background: var(--bg);
    border-radius: var(--r) var(--r) 0 0;
}
.del-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
    padding: 0 var(--sp-7) var(--sp-6);
    background: var(--bg);
    border-radius: 0 0 var(--r) var(--r);
    font: 400 var(--fs-sm)/var(--lh-base) var(--sans);
    color: var(--text-3);
}
.del-meta .sep { opacity: 0.7; }
.del-warn {
    margin: var(--sp-7) 0 var(--sp-2);
    font-size: var(--fs-md);
    line-height: var(--lh-prose);
    /* Read, not shouted: the button beside it is the red thing. */
    color: var(--text-2);
}

/* ── restart ─────────────────────────────────────────────────────────── */

.restart-lede {
    margin: 0 0 var(--sp-6);
    font: 400 var(--fs-base)/var(--lh-prose) var(--sans);
    color: var(--text-2);
}
.restart-problems {
    margin: 0 0 var(--sp-2);
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
}
.restart-problems > li {
    padding: var(--sp-6) var(--sp-7);
    background: var(--bg);
    border-radius: var(--r);
}
.restart-why {
    font: 400 var(--fs-base)/var(--lh-base) var(--sans);
    color: var(--text);
}
/* Machine output — git's stderr — so its line breaks are kept and it scrolls
   sideways on its own rather than widening the dialog. */
.restart-why.raw {
    display: block;
    white-space: pre-wrap;
    overflow-x: auto;
    font: 400 var(--fs-sm)/var(--lh-prose) var(--mono);
    color: var(--text-2);
}
/* Paths, so mono — and they are the part being pointed at, hence the indent
   rather than another card. Scrolls sideways on its own: a long path must not be
   allowed to widen the dialog. */
.restart-files {
    margin: var(--sp-4) 0 0;
    padding: 0 0 0 var(--sp-1);
    list-style: none;
    overflow-x: auto;
    font: 400 var(--fs-sm)/var(--lh-prose) var(--mono);
    color: var(--text-3);
}
.restart-files > li { white-space: pre; }
.restart-more { font-family: var(--sans); font-style: italic; }

/* ── toast ───────────────────────────────────────────────────────────── */

/* Tonal, like every other surface in the app, rather than the light inverse
   card it used to be. That card was the only light thing on screen, so a "Copied"
   arrived louder than a permission prompt. The kind is now an accent edge down
   the left — the idiom every other row with a state uses — and the text stays
   --text on all four, so a failure is no harder to read than a success. Info
   has no edge: it is not a state, only news. */
.toasts {
    position: fixed;
    bottom: var(--sp-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--sp-4);
    max-width: 480px;
}
.toast {
    --toast-edge: transparent;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-8);
    background: var(--s4);
    color: var(--text);
    border-radius: var(--r-sm);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    box-shadow: inset var(--edge-w) 0 0 var(--toast-edge), var(--shadow-pop);
}
.toast[data-kind="error"] { --toast-edge: var(--red); }
.toast[data-kind="ok"] { --toast-edge: var(--green); }
.toast[data-kind="warn"] { --toast-edge: var(--yellow); }

.toast-text { flex: 1; min-width: 0; padding-block: var(--sp-1); }

.toast-action {
    flex: none;
    height: 32px;
    padding: 0 var(--sp-6);
    border-radius: var(--pill);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    color: var(--blue);
    white-space: nowrap;
    transition: background var(--t-fast) var(--ease);
}
.toast-action:hover { background: var(--s5); }

.toast-close {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: var(--fs-sm);
    color: var(--text-3);
    transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.toast-close:hover { color: var(--text); background: var(--s5); }

/* ── Publish to GitHub (web/github/publish.js) ───────────────────────────── */

.gh-status, .gh-problem {
    margin-bottom: var(--sp-8);
    padding: var(--sp-5) var(--sp-7);
    border-radius: var(--r);
    background: var(--bg);
    font: 400 var(--fs-md)/var(--lh-base) var(--sans);
    color: var(--text-2);
}
.gh-status code, .gh-problem code { font-size: var(--fs-sm); }
.gh-status.ok { color: var(--green); }
.gh-status a, .gh-problem a { color: var(--blue); }
.gh-problem { color: var(--yellow); }
.gh-wait { padding: var(--sp-9) 0; color: var(--text-4); font-size: var(--fs-md); }

/* Owner / name on one line, the way GitHub writes it. */
.gh-row { display: flex; align-items: center; gap: var(--sp-5); }
.gh-row.wrap { flex-wrap: wrap; gap: var(--sp-5) var(--sp-8); }
.gh-owner { flex: none; }
.gh-name { flex: 1; min-width: 0; }
.gh-row.top { align-items: flex-start; }
.gh-slash { padding-top: 30px; color: var(--text-4); font-size: var(--fs-xl); }
.gh-owner .gh-select { padding: var(--sp-6); }
#gh-name-note[data-kind="bad"] { color: var(--yellow); }
#gh-name-note[data-kind="ok"] { color: var(--green); }
.field input.prose { font-family: var(--sans); font-size: var(--fs-md); }

.gh-select {
    background: var(--bg);
    border-radius: var(--r);
    padding: var(--sp-4) var(--sp-6);
    font: 400 var(--fs-md)/var(--lh-tight) var(--sans);
    color: var(--text);
    cursor: pointer;
    max-width: 260px;
}
.gh-select:disabled { opacity: 0.5; cursor: default; }
.gh-pick { display: inline-flex; align-items: center; gap: var(--sp-4); }
.gh-inline-label { font-size: var(--fs-md); color: var(--text-3); }
.gh-hint { color: var(--text-4); font-size: var(--fs-sm); }

.gh-radios { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.gh-radio {
    flex: 1 1 150px;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-5) var(--sp-6);
    border-radius: var(--r);
    background: var(--bg);
    cursor: pointer;
    font-size: var(--fs-md);
    color: var(--text-2);
}
.gh-radio input { accent-color: var(--blue); margin-top: var(--sp-1); }
.gh-radio b { display: block; font-weight: 500; color: var(--text); }
.gh-radio[data-disabled="true"] { opacity: 0.45; cursor: default; }
.gh-radio:has(input:checked) { box-shadow: inset 0 0 0 2px var(--blue); }

.field label.check + label.check, .field .gh-row + label.check,
.field input.gh-indent + label.check { margin-top: var(--sp-4); }
.field input.gh-short { width: 160px; padding: var(--sp-3) var(--sp-6); }
/* 26px is the checkbox and its gap, so the field sits under the label's text. */
.field input.gh-indent { margin: var(--sp-4) 0 0 26px; width: calc(100% - 26px); padding: var(--sp-4) var(--sp-6); }

.gh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-4) var(--sp-7); }
.gh-grid + .gh-row { margin-top: var(--sp-6); }
.field .gh-grid label.check { margin-top: 0; }

.gh-more { margin-bottom: var(--sp-6); }
.gh-more > summary {
    cursor: pointer;
    margin-bottom: var(--sp-6);
    font: 500 var(--fs-md)/var(--lh-none) var(--sans);
    color: var(--text-3);
}
.gh-more > summary:hover { color: var(--text); }

.gh-steps { list-style: none; margin: 0 0 var(--sp-6); padding: 0; }
.gh-steps li {
    display: flex;
    align-items: baseline;
    gap: var(--sp-5);
    padding: var(--sp-3) var(--sp-1);
    font-size: var(--fs-md);
    color: var(--text-2);
}
.gh-mark { width: 14px; flex: none; text-align: center; }
.gh-steps li[data-state="ok"] .gh-mark { color: var(--green); }
.gh-steps li[data-state="failed"] .gh-mark,
.gh-steps li[data-state="failed"] .gh-detail { color: var(--red); }
.gh-steps li[data-state="skipped"] { color: var(--text-4); }
.gh-detail { color: var(--text-4); font-size: var(--fs-sm); min-width: 0; overflow-wrap: anywhere; }
.gh-foot-note { font-size: var(--fs-sm); color: var(--text-4); }

/* The two ways into it from Start-a-session. */
.link-btn { color: var(--blue); font: inherit; padding: 0; margin-left: var(--sp-2); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn[hidden] { display: none; }
.mkdir-gh { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; cursor: pointer; }
.mkdir-gh[hidden] { display: none; }
.mkdir-gh input { accent-color: var(--blue); }


/* Start-a-session's worktree row: a name and a base on one line under the box. */
.wt-fields { display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-4) 0 0 26px; }
.wt-fields[hidden] { display: none; }
.field .wt-fields input[type="text"] { padding: var(--sp-3) var(--sp-6); }
.field .wt-fields #new-wt-name { flex: 2; }
.field .wt-fields #new-wt-base { flex: 1; min-width: 0; }
.wt-from { font-size: var(--fs-sm); color: var(--text-4); }
#new-wt-note { margin-left: 26px; overflow-wrap: anywhere; }
#new-wt-note.warn { color: var(--yellow); }
/* The project's worktree setup command (bridge/worktree-prep.js): one line,
   clipped, the whole command in the tooltip. */
#new-wt-setup-row { margin: var(--sp-3) 0 0 26px; min-width: 0; }
#new-wt-setup-label { display: flex; align-items: baseline; gap: var(--sp-3); min-width: 0; font-size: var(--fs-sm); }
#new-wt-setup-label code {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 400 var(--fs-xs)/var(--lh-tight) var(--mono);
    color: var(--text-2);
}
#new-wt-setup-label .why { flex: none; color: var(--text-4); }
#new-wt-setup-label > span:first-child { flex: none; white-space: nowrap; }

/* The image preview. The dialog is the picture and nothing else, sized to it
   and capped at the window, so everything around it is scrim and closes it.
   The bar floats over the top right, on the scrim rather than in a header,
   because a header would take height the picture wants. */
/* 56px: the bar's height over the picture, so the two never overlap. */
.img-scrim { background: var(--scrim-image); padding: 56px var(--sp-9) var(--sp-9); }
.img-modal {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    background: none;
    border-radius: var(--r-sm);
}
.img-view {
    display: block;
    max-width: calc(100vw - 2 * var(--sp-9));
    max-height: calc(100vh - 80px);
    object-fit: contain;
}
.img-bar {
    position: absolute;
    top: var(--sp-5); left: var(--sp-9); right: var(--sp-7);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.img-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 400 var(--fs-sm)/var(--lh-none) var(--mono);
    color: var(--text-3);
}
.img-bar .icon-btn { color: var(--text-2); font-size: 15px; }
.img-bar .icon-btn.done { color: var(--green); }

/* ── Clone from GitHub (web/github/clone.js) ─────────────────────────────── */

.modal.gc { width: min(640px, 100%); }
.gc-list {
    margin-top: var(--sp-4);
    max-height: 240px;
    overflow-y: auto;
    border-radius: var(--r);
    background: var(--bg);
}
.gc-repo {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    width: 100%;
    padding: var(--sp-4) var(--sp-6);
    text-align: left;
    color: var(--text-2);
    font: 400 var(--fs-md)/var(--lh-base) var(--sans);
}
.gc-repo:hover { background: var(--s3); }
.gc-repo[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--blue); background: var(--s2); }
.gc-repo-top { display: flex; align-items: baseline; gap: var(--sp-4); min-width: 0; }
.gc-repo-name { color: var(--text); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-vis {
    flex: none;
    padding: 0 var(--sp-3);
    border-radius: var(--pill);
    background: var(--s3);
    font-size: var(--fs-sm);
    color: var(--text-3);
}
.gc-vis[data-vis="private"], .gc-vis[data-vis="internal"] { color: var(--yellow); }
.gc-when { margin-left: auto; flex: none; font-size: var(--fs-sm); color: var(--text-4); }
.gc-repo-desc { font-size: var(--fs-sm); color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-msg { padding: var(--sp-5) var(--sp-6); font-size: var(--fs-sm); color: var(--text-3); }
.gc-msg.bad { color: var(--yellow); }
.gc-more { display: block; margin: var(--sp-4) auto; }
.gc-slash { padding-top: 0; }
.gh-row > input.gc-name { flex: 0 1 200px; }
.gh-row > input#gc-parent { flex: 1; min-width: 0; }
.gc-use { margin: 0 var(--sp-4) 0 0; }
#gc-input-note[data-kind="bad"], #gc-dest-note[data-kind="bad"] { color: var(--yellow); }
#gc-input-note[data-kind="ok"], #gc-dest-note[data-kind="ok"] { color: var(--green); }
.field label.check[hidden] { display: none; }
