/* ============================================================================
   59-task-window.css - the ONE task window.

   The detail card, the create form, the draft editor and the AI / assistant confirm used to be
   three different windows (a 760px card, a 560px card and a card that grew to 88vh). They now
   all render Components/Shared/TaskWindow.razor (the shell) around Components/Shared/TaskFields.razor
   (the fields), so this file is the only place their size and layout are written.

   The owner's rule, which is what the shell is for: a window never changes height while it is
   used. The card is a FIXED height measured against the viewport, the head and the footer are
   pinned, and only .tw-body between them scrolls. Adding a subtask, switching a draft, an error
   line or a slow load cannot resize it. DetailModalHeightTests holds the rule.

   v0.30.3.0 adds the second half of that rule, which was missing: the body may be the scroller,
   but it should not have to be. The card now takes 820px of a tall screen instead of 720, the
   fields grid is handed the body's height rather than its own, and the checklist is the one
   elastic part of the main column, so "New subtask" is in view the moment the window opens.

   v0.32.1.4, owner: "a little more compact". 820 -> 740px tall, padding 24 -> 20px, and the detail
   window 1080 -> 960px wide with its side-by-side threshold 1000 -> 880px so the columns stay.

   v0.30.3.2 finishes the job on the other column, which was where the pixels actually were. The
   side column is compacted rather than scrolled: 288px wide at the full-size card, a tighter
   caption rhythm, a share picker that wraps, a one-line "Created", recurrence presets at their
   compact size and a plan editor whose durations fit two rows. Measured on /studio at 1024x768 it
   goes 934 to 735 on a detail card, 700 to 519 on the create form, 902 to 644 on the draft editor
   and 650 to 504 on the AI confirm. The create form and the AI confirm fit outright now, with
   room to spare. The detail card does NOT: nine fields, the weather under the deadline and the
   delete foot still need about 110px more than a 624px body, so it keeps the outer scroller,
   which is what the outer scroller is for.

   dvh with vh first as the fallback: on a phone the address bar makes 100vh taller than the visible
   area, which would put the pinned footer below the fold.
   ============================================================================ */

.tw-card {
    width: min(760px, 94vw);
    min-width: 0;
    max-width: none;
    height: min(740px, calc(100vh - 32px));
    height: min(740px, calc(100dvh - 32px));
    padding: 20px;
    overflow: hidden;
}

.tw-head { flex: 0 0 auto; gap: 10px; }
.tw-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.tw-head > .chip { flex: 0 0 auto; }

/* The scroller. The focus ring is drawn OUTSIDE the box (19-a11y.css) and this container clips,
   so the padding with a matching negative margin gives the ring its 4px without moving the
   content. The gutter is reserved so no line shifts sideways when the scrollbar appears. */
.tw-body {
    flex: 1 1 auto;
    min-height: 0;
    padding-inline: 4px;
    margin-inline: -4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    container-type: inline-size;
}
/* A flex column squeezes its children by default; the sections keep their own height and the body
   scrolls instead. */
.tw-body > * { flex: 0 0 auto; }
/* AI / voice: the prompt section drinks whatever height the fixed card has left, so the compact
   routes have no dead zone under the hint - the box you type into is what grows. */
.tw-body > .create-prompt { flex: 1 1 auto; min-height: 0; }

.tw-error { flex: 0 0 auto; }
.tw-foot { flex: 0 0 auto; }

/* /studio mounts the shell in a cell: in flow, not covering the page. */
.tw-backdrop.tw-static {
    position: static;
    inset: auto;
    display: block;
    background: none;
    z-index: auto;
}
/* In a cell the card yields to the cell's width, so a 375px cell shows the phone layout. */
.tw-static .tw-card { margin-inline: auto; max-width: 100%; }

/* ---- the fields -------------------------------------------------------------------------
   One column on a phone; from a 640px body, the main column plus a 240px side column. The body is
   the container, so the switch follows the card and not the viewport. */
.tw-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}
.tw-main,
.tw-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
/* A field keeps its own height. The one that may be squeezed is named below, so the slack always
   comes out of the same place and no other field can be the one that loses a row. */
.tw-main > *,
.tw-side > * { flex: 0 0 auto; }
.tw-main > .tw-field[data-field="subtasks"] { flex: 0 1 auto; min-height: 0; }
.tw-side {
    padding-top: 14px;
    border-top: 1px solid var(--chronos-outline);
}
@container (min-width: 640px) {
    .tw-fields {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 20px;
    }
    /* v0.30.3.0, owner complaint ("окно с созданием задачи не должно требовать скроллбара"):
       side by side the fields are ONE grid row, so the grid can be handed the height the head,
       the intro line and the footer leave instead of taking its own, and min-height: 0 lets it be
       squeezed to exactly that. A main column that knows its room can give the slack back: the
       checklist shrinks into its own scroll rather than pushing "New subtask" past the fold.

       Stacked, this rule must NOT apply. Two auto rows in a grid shorter than their content share
       the room out evenly instead of keeping their content height, which squeezed the steps to
       their floor and lapped the main column over the side one. A phone card scrolls, as it did
       before; this is the desktop promise only. */
    .tw-body > .tw-fields { flex: 1 1 auto; min-height: 0; }
    /* The main column is the one that may be SQUEEZED into its row (the checklist takes it). The
       side column is not given min-height: 0, so its automatic minimum size is its own content:
       when it holds more than the row it is clamped back up and overflows into the body's
       scroller, which is what the detail card has always done. When it holds less, align-items:
       stretch still stretches it to the row, which is why its rule runs the full height of the
       body - and why .tw-field-danger's margin-top: auto would hang the delete foot at the bottom
       of a column that fits. No mode does both today (only the two detail cards carry the foot and
       both still overflow); the next wave that compacts the detail card has to look at it. */
    .tw-main { min-height: 0; }
    /* v0.30.3.2, owner ask ("компактить"): nine fields mean nine caption lines, nine inner gaps
       and eight column gaps, which was 280px of the 934 this column needed - rhythm, not control.
       Side by side the column is the scarce axis, so it runs tighter than the stacked phone
       layout, which keeps the 14 / 6 / 1.5 of the base rules above. */
    .tw-side {
        padding-top: 0;
        border-top: none;
        padding-inline-start: 16px;
        border-inline-start: 1px solid var(--chronos-outline);
        gap: 8px;
    }
    .tw-side > .tw-field { gap: 4px; }
    .tw-side .tw-cap { line-height: 1.15; }
    /* v0.30.3.3: the delete foot FOLLOWS the fields here instead of being pushed to the bottom by
       margin-top: auto. That push was written (v0.19.13.0) for a column that always overflowed, so
       "the bottom" and "under the last field" were the same place. Now that the column fits, they
       are not: the auto margin would leave the foot adrift at the end of a stretched box with a
       void above it. Stacked on a phone the column is content-height, so the margin never did
       anything there and the base rule can keep it. */
    .tw-side > .tw-field-danger {
        margin-top: 0;
        padding-top: 8px;
    }
    .tw-side .detail-delete { padding-block: 5px; }
    /* The label field is a chip holder, not a text input: 34px fits its chips with room and hands
       the column back 8px. The 40px floor stays everywhere else, phones included. */
    .tw-side .lp-field { min-height: 34px; }
}

/* At the FULL-SIZE card the side column is 288px, not 240. Nothing in it is redesigned: the extra
   48px is simply enough for the plan's duration chips, the label chips and the recurrence presets
   to lose a row each, which is most of what the column was overflowing by.

   Its own step at 700px rather than a wider number in the block above: 700 is the body's inline
   size when the card is at its full 760 (the card less its padding and the scrollbar gutter), so a
   card already narrowed by 94vw keeps the 240px column. That matters because the description
   toolbar wraps to two rows below 385px of main column, and 760 - 80 - 288 leaves it 392. A flat
   288 would have wrapped the toolbar on every viewport from 750 to 801, an iPad in portrait among
   them. The selector is (0,2,0) so it beats the 240 above it on weight, not on order. */
@container (min-width: 700px) {
    .tw-body > .tw-fields { grid-template-columns: minmax(0, 1fr) 288px; }
}

/* One wrapper, one caption style. */
.tw-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
/* The caption line. A caption is one short word, so the rest of the line is free for the field's
   own short reading (TaskField's Meta slot): the progress beside "Status", the forecast beside
   "Deadline". The row reserves the taller of the two so a reading that appears mid-use - the work
   pill the moment a task is started - cannot grow the window under the reader. */
.tw-cap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
/* The reservation belongs to the READING, not to the row: put it on the row and every caption in
   the column pays for a line only two fields have anything to put on. It is the work pill's own
   height, so a task started mid-read moves nothing. */
.tw-cap-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 20px;
    min-width: 0;
    font-size: var(--text-sm);
}
.tw-cap {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--chronos-fg-muted);
}

/* A label and a date are one line's worth of information, and "Создана" was spending two on it.
   The field keeps its wrapper and its caption style; only the axis changes, so nothing else in the
   column has to know. The hook is TaskField.razor, which writes data-field from its Name. */
.tw-side > .tw-field[data-field="created"] {
    flex-direction: row;
    align-items: baseline;
    column-gap: 6px;
}

/* The danger foot of the side column: pushed to the bottom with margin-top:auto so it stays at the
   foot however many fields render above it, and separated by a rule so it reads as a different
   KIND of control rather than one more field (v0.19.13.0). */
.tw-field-danger {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--chronos-outline);
}

.tw-title-input { font-weight: 600; }
/* Fixed footprint: no drag-resize inside a window that never changes size. */
.tw-field .md-textarea { resize: none; }
.tw-field .dtf { max-width: 100%; }

/* ---- the checklist ----------------------------------------------------------------------
   A bounded scroll region so a long list never pushes the add row below it out of place.

   v0.30.3.0: the ceiling used to be a flat 180px, which is both too little on a tall window and
   too much on a short one - on a short one the column overflowed and the OUTER scroller took the
   add row with it. The list is now the elastic part of its column: flex: 0 1 auto with min-height
   0 means it never grows past its own rows, and when the column is short it is the one thing that
   gives, down to a floor of two rows. The caption and the add row are pinned either side of it,
   so "New subtask" is in view the moment the window opens, however many steps there are. */
.tw-steps-scroll {
    flex: 0 1 auto;
    min-height: 76px;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-inline-end: 4px;
}
.tw-field[data-field="subtasks"] > .tw-cap-row,
.tw-field[data-field="subtasks"] > .subtask-add-row { flex: 0 0 auto; }
.subtask-edit-input { flex: 1; min-width: 0; }
.subtask-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--chronos-fg-muted);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}
.subtask-del:hover { background: var(--chronos-hover-bg); color: var(--chronos-red); }
.subtask-del .material-icons { font-size: 16px; line-height: 1; }

/* ---- several drafts in one confirm: a block each, divided --------------------------------- */
.tw-draft + .tw-draft {
    padding-top: 16px;
    border-top: 1px solid var(--chronos-outline);
}

/* ---- the detail window: a property bar and two panes -----------------------------------------
   Owner, looking at the three-column card on a 1707x1067 screen: "много пустого и важное сжато".
   Three columns left the description empty under one line, the history anchored to the bottom of a
   tall void, and nine fields squeezed into a 250px strip. It is now one card of two parts.

   The PROPERTY BAR sits right under the title: the status as a segmented control with the progress
   as a thin bar beside it, then ONE chip per property (priority, deadline, plan, repeat, labels,
   share), each showing its current value; an empty property is a muted "Add ..." chip. A chip that
   edits opens a panel that floats over what is below (never pushes it), the way the label tray and
   the date panel always have.

   Under the bar, two panes that each scroll on their own inside the card's fixed height: DETAILS
   (description, steps, files, links) and HISTORY (the composer on top, the feed newest first right
   under it). From an 880px body they sit side by side, about 58 / 42. Below that the same two are
   TABS under the bar, so a phone shows one pane at a time and the window never scrolls as a whole
   into a different shape. Only the DETAIL window grows, to 960px: the create form, the draft
   editor and the AI confirm keep their 760px, which is also the edge the pet's suggestion card is
   pinned to (42-pet-suggest.css). DetailModalHeightTests holds the fixed card.

   Hosts of a panel are position: static below 640px, so a panel hangs from the BAR and spans it
   instead of overflowing a 375px card from wherever its chip happens to sit. */
.tw-backdrop[data-task-window="view"] .tw-card { width: min(960px, 96vw); }
.tw-backdrop[data-task-window="view"] .tw-title { flex: 0 1 auto; }
.tw-author {
    flex: 0 1 auto;
    min-width: 0;
    margin-inline-end: auto;
    font-size: var(--text-sm);
}
.tw-author .friend-avatar { width: 24px; height: 24px; font-size: 12px; }

.tw-body > .tw-fields.tw-view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tw-view > .tw-bar,
.tw-view > .tw-tabs { flex: 0 0 auto; }

/* ---- the bar ---- */
.tw-bar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--chronos-outline);
}
.tw-prop {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}
.tw-prop-status {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 10px;
}
.tw-prop-status .tw-seg { flex: 0 0 auto; min-width: 260px; }
.tw-prop-status .tw-seg-btn { padding: 6px 12px; }
.tw-prog {
    flex: 1 1 80px;
    min-width: 40px;
    block-size: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: color-mix(in srgb, var(--chronos-violet) 14%, transparent);
}
.tw-prog-fill {
    display: block;
    block-size: 100%;
    border-radius: 3px;
    background: var(--chronos-violet);
    transition: inline-size 0.25s ease;
}
.tw-prog-num { flex: 0 0 auto; font-size: var(--text-sm); white-space: nowrap; }

/* The chip: one property, its value on its face. The same pill for a button that opens a panel,
   the date field's trigger and a read-only value, so the bar reads as one row of one thing. */
.tw-chip,
.tw-prop .dtf-trigger,
.tw-prop .plan-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    max-width: 100%;
    padding: 4px 12px;
    border: 1px solid var(--chronos-outline);
    border-radius: var(--radius-pill);
    background: var(--chronos-chip-bg);
    color: var(--chronos-fg-primary);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
}
.tw-chip .material-icons,
.tw-prop .plan-add .material-icons { flex: none; font-size: 16px; line-height: 1; color: var(--chronos-fg-muted); }
.tw-chip.is-static { cursor: default; }
.tw-chip.is-empty,
.tw-prop .dtf-empty,
.tw-prop .plan-add {
    border-style: dashed;
    background: transparent;
    color: var(--chronos-fg-muted);
    font-weight: 500;
}
.tw-pop.is-open > .tw-chip,
.tw-prop .dtf.open .dtf-trigger { border-color: var(--chronos-violet); }
.tw-chip:disabled { opacity: 0.55; cursor: not-allowed; }
.tw-chip .priority-dot,
.tw-menu-item .priority-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--chip-color, var(--chronos-fg-muted));
}
.tw-chip .friend-avatar { width: 20px; height: 20px; font-size: 10px; }
.tw-avatars { display: inline-flex; padding-inline-start: 6px; }
.tw-avatars .friend-avatar {
    margin-inline-start: -6px;
    box-shadow: 0 0 0 2px var(--chronos-chip-bg);
}
.tw-avatars-more { font-size: var(--text-xs); color: var(--chronos-fg-muted); }

.tw-prop .dtf { width: auto; max-width: 100%; }
.tw-prop .dtf-trigger { display: inline-flex; width: auto; padding-inline-end: 12px; }
.tw-prop .dtf-trigger::after { display: none; }
.tw-prop .dtf-trigger::before {
    content: "event";
    font-family: "Material Icons";
    font-size: 16px;
    line-height: 1;
    color: var(--chronos-fg-muted);
    font-feature-settings: "liga";
}
.tw-prop .dtf-panel { inline-size: 296px; max-inline-size: calc(100vw - 32px); }
.tw-prop .plan-hint { display: none; }
.tw-prop .plan-editor { gap: 0; }

/* The labels: the picker as it is, drawn as a pill in the row. Its tray opens downwards. */
.tw-prop-labels { flex-wrap: nowrap; }
.tw-prop-labels .lp { width: auto; min-width: 0; max-width: 100%; }
.tw-prop-labels .lp-field {
    min-height: 32px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--chronos-chip-bg);
}
.tw-prop-labels .lp-tray { inline-size: 300px; max-inline-size: calc(100vw - 32px); }
.tw-prop-labels .lp.is-open .lp-field { border-color: var(--chronos-violet); }

/* ---- the panel of a chip ---- */
.tw-pop-panel {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    z-index: 30;
    min-inline-size: 220px;
    max-inline-size: min(340px, calc(100vw - 32px));
    padding: 10px;
    background: var(--chronos-card-bg);
    border: 1px solid var(--chronos-outline);
    border-radius: var(--radius-card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
html[data-theme="dark"] .tw-pop-panel { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.tw-pop-dismiss {
    position: absolute;
    inset-inline-start: -9999px;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
}
.tw-menu { display: flex; flex-direction: column; gap: 2px; min-inline-size: 160px; }
.tw-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 4px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: var(--text-sm);
    text-align: start;
    cursor: pointer;
}
.tw-menu-item:hover:not(:disabled) { background: var(--chronos-hover-bg); }
.tw-menu-item.selected { font-weight: 700; background: color-mix(in srgb, var(--chip-color) 14%, transparent); }
/* Chips near the end of the row hang their panel from the right edge, so it stays inside the card. */
@container (min-width: 640px) {
    .tw-bar > .tw-pop:nth-last-child(-n + 2) > .tw-pop-panel,
    .tw-bar > .tw-prop-labels .lp-tray {
        inset-inline-start: auto;
        inset-inline-end: 0;
    }
    .tw-bar > .tw-prop-labels .lp-tray { inset-inline-end: 0; }
}
@container (max-width: 639px) {
    .tw-bar .tw-prop,
    .tw-bar .dtf,
    .tw-bar .lp,
    .tw-bar .plan-durations { position: static; }
    .tw-bar .tw-pop-panel,
    .tw-bar .dtf-panel,
    .tw-bar .lp-tray {
        inset-inline: 0;
        inline-size: auto;
        max-inline-size: none;
    }
    .tw-prop-status { flex-wrap: wrap; }
    .tw-prop-status .tw-seg { flex: 1 1 100%; min-width: 0; }
    .tw-prog { flex: 1 1 60%; }
    .tw-chip,
    .tw-prop .dtf-trigger,
    .tw-prop .plan-add { min-height: 36px; }
}

/* ---- tabs (below an 880px body) ---- */
.tw-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--chronos-outline);
    border-radius: 10px;
    overflow: hidden;
    background: var(--chronos-chip-bg);
}
.tw-tab {
    min-height: 36px;
    padding: 4px 8px;
    border: 0;
    border-inline-start: 1px solid var(--chronos-outline);
    border-radius: 0;
    background: transparent;
    color: var(--chronos-fg-muted);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
}
.tw-tab:first-child { border-inline-start: 0; }
.tw-tab.is-on { background: var(--chronos-violet); color: #fff; }

/* ---- the panes ---- */
.tw-cols {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 16px;
}
.tw-pane {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-inline-end: 4px;
}
.tw-pane > * { flex: 0 0 auto; }
.tw-pane > .tw-field[data-field="subtasks"] { flex: 0 0 auto; }
.tw-view[data-tab="details"] > .tw-cols > .tw-feed,
.tw-view[data-tab="history"] > .tw-cols > .tw-main { display: none; }
.tw-feed-cap { display: none; }

/* A section with nothing in it is one line: the description's "no description" and an empty
   step list take no more than their caption and a row. */
.tw-main .detail-desc { margin: 0; }
.tw-tail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding-top: 10px;
    margin-top: auto;
    border-top: 1px solid var(--chronos-outline);
    font-size: var(--text-sm);
}
.tw-created { display: inline-flex; align-items: baseline; gap: 6px; }
.tw-tail .detail-delete { padding-block: 5px; }

/* The history pane does not scroll as a whole: its feed does, under the composer. */
.tw-feed { overflow: hidden; padding-inline-end: 0; gap: 8px; }
.tw-feed > .tl { flex: 1 1 auto; min-height: 0; }

@container (min-width: 880px) {
    .tw-view > .tw-tabs { display: none; }
    .tw-cols {
        grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
        gap: 20px;
    }
    .tw-view[data-tab] > .tw-cols > .tw-main,
    .tw-view[data-tab] > .tw-cols > .tw-feed { display: flex; }
    .tw-feed {
        padding-inline-start: 20px;
        border-inline-start: 1px solid var(--chronos-outline);
    }
    .tw-feed-cap { display: block; }
}

/* The copy button: icon and word on a desktop head, the icon alone on a phone, where the head also
   holds the title and the close button. */
.tw-dup { display: inline-flex; align-items: center; gap: 4px; }
.tw-main-chip { display: inline-flex; align-items: center; gap: 4px; }

/* The pencil: edit mode on and off. It stays a square icon button on every width and says it is on
   with the same violet rim an open property chip wears, so the head never changes size. */
.tw-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 32px;
    padding-inline: 0;
}
.tw-edit.is-on {
    border-color: var(--chronos-violet);
    background: color-mix(in srgb, var(--chronos-violet) 14%, var(--chronos-chip-bg));
}

/* One quiet line where a pane has nothing yet (no steps, no files, no links) instead of an empty block. */
.tw-quiet { margin: 0; font-size: var(--text-sm); color: var(--chronos-fg-muted); }

/* The detail head on a phone: two lines, the title with the close button, then the author and the
   action icons. Before v0.32.1.0 all of it shared one row, the chips took the width, the title was
   squeezed to 1px and broke into one letter per line, and the head ate 357px of a 780px card.
   order moves the close button up next to the title without touching the markup every mode shares. */
@media (max-width: 640px) {
    .tw-backdrop[data-task-window="view"] .tw-head { flex-wrap: wrap; row-gap: 8px; }
    .tw-backdrop[data-task-window="view"] .tw-title { flex: 1 1 calc(100% - 48px); }
    .tw-backdrop[data-task-window="view"] .tw-head > .modal-close { order: 1; }
    .tw-backdrop[data-task-window="view"] .tw-head > :not(.tw-title):not(.modal-close) { order: 2; }
    .tw-backdrop[data-task-window="view"] .tw-head > .tw-main-chip { margin-inline-start: auto; }
}
@media (max-width: 520px) {
    .tw-dup-label,
    .tw-main-label { display: none; }
    .tw-main-chip,
    .tw-dup { justify-content: center; inline-size: 32px; padding-inline: 0; }
}
