/* cards.css — part 5 of 6 of the app stylesheet.
   Holds: card rows and pills, small buttons, tags, the card-detail modal, comment
   history, create-card, toasts.

   ORDER MATTERS. These files were cut out of a single app.css at line boundaries with the
   sequence preserved, so concatenating them in the order index.html links them reproduces the
   original byte for byte — which is what makes the cascade provably unchanged. Equal-specificity
   rules still resolve by source order, so reordering the <link> tags can change rendering.

   The names describe what ended up in each part, not a design: the original file interleaved
   the top bar, layout and per-feature rules, and moving rules to where they belong is a separate
   pass that this split exists to make possible. Palette is in theme.css, linked first. */
    /* The card itself is `.ui-card--raised` (7.488.0); this is only the space between cards on the board. */
    .card { margin-bottom: 16px; }
    .card .top { display: flex; justify-content: space-between; gap: 12px; }
    /* A flex row (7.488.0), so the rename button stays beside the title when the title wraps: at 390 it fell onto a
       line of its own. The title shrinks and wraps inside its own box; the button and an environment badge do not.
       The 4px gap is the space the inline layout put between them. */
    .card .title { font-weight: 600; display: flex; align-items: baseline; gap: 4px; }
    .card .title > .title-link { min-width: 0; }
    .card .title > :not(.title-link) { flex: none; }
    /* The trail is `.ui-crumbs` (7.488.0); this is only its space over the board card's title. */
    .crumbs { margin-bottom: 3px; }
    /* The crumb's menu is a `.ui-menu` (7.423.0); this is only where it sits and what it sits above. */
    .crumb-menu { position: absolute; z-index: var(--z-crumb); }
    /* `.pill` is retired (7.518.0): its last caller, a detection row on a promoted card, is `.ui-pill`. */
    /* The app's original default button (3.20.1), at zero specificity since 7.457.0. It still applies to every button
       wherever nothing else sets a property, which is what the classless ones and many classed ones rely on (weight,
       radius, padding). At (0,0,1) for the rest and (0,1,1) for `:hover`, it used to outrank a one-class rule's
       background on hover, so any button whose own `:hover` set only a color or border showed this accent-press fill:
       nine of them, the header's bell and gear among them, at 1.00-1.32:1 in the light theme. */
    :where(button) {
      background: var(--accent); color: white; border: 0; border-radius: 8px;
      padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer;
    }
    :where(button:hover) { background: var(--accent-press); }
    :where(button:disabled) { opacity: .5; cursor: default; }
    .result {
      margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--ok);
      background: var(--panel-2); border-radius: 6px; font-size: 14px; display: none;
    }
    .result.show { display: block; }
    /* The scope pills' `button.scope` rule went in 7.473.0. It had not drawn a pill since the rail arrived: every
       property it set lost to the rail's own item rule. The rail's buttons are `.ui-nav__item`, and `.scope` is the
       hook the router and the gating sweeps find them by. */
    /* `.btn-sm` is retired (7.512.0): its last fifteen callers are `.ui-btn`, whose geometry it was. */
    /* card head-right + active pill */
    .headl { min-width: 0; }
    .head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; white-space: nowrap; }
    .card-menu { position: relative; }
    /* The card's ⋮ menu is a `.ui-menu` (7.423.0) and its button a `.ui-icon-btn` (7.488.0); this is only where the
       menu opens and what it sits above: 6px under the 36px button. */
    .card-menu > .ui-menu { position: absolute; right: 0; top: 42px; z-index: var(--z-menu); }

    /* Header text column: breadcrumb over title. min-width lets long titles ellipsize instead of
       pushing the close button out of the header. */
    .cd-head-text { min-width: 0; flex: 1; }
    /* The rename button is `ui-btn ui-btn--ghost ui-btn--sm ui-btn--icon` (7.488.0): 24x24, the WCAG 2.5.8 floor, reached
       with the box. `cd-rename` is its hook and carries no rule. */
    .cd-title-input { font-family: 'Quicksand', system-ui, sans-serif; font-size: 16px;
      font-weight: 600; color: var(--text); background: var(--panel-2);
      border: 1px solid var(--accent); border-radius: 7px; padding: 3px 7px; width: min(38ch, 60vw); }
    /* Same as input.hours: the ring was removed with no replacement, and this field looks like
       static text until it has focus — the state being hidden was the only thing marking it editable. */
    .cd-title-input:focus { outline: none; border-color: var(--accent); }
    /* In the card detail the field takes the dialog title's type (7.444.0), so renaming does not change its size;
       on a board card it keeps the rule above. */
    #cd-title .cd-title-input { font-family: inherit; font-size: inherit; font-weight: inherit; }
    .cd-crumbs { margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* An added environment's board section heads with a `.ui-section-head` (7.515.0), and its error is a `.ui-status`. */
    /* No fill of its own (7.494.0): the textarea default's `--panel-2`, which the board's Work notes box already has,
       so a card has one textarea fill. It was the white `--panel`. */
    .cd-note { min-height: 60px; padding: 6px 8px; border: 1px solid var(--ui-field-line); border-radius: 6px;
      font: inherit; resize: vertical; color: var(--text); }
    .cd-note::placeholder { color: var(--muted); }
    /* Which contract the hours bill to, above the controls that submit them (7.136.0). It sits on its
       own row rather than inside .cd-log-controls because it is the one field somebody reads before
       typing, and wrapping it in with the buttons puts it wherever the line happens to break. */
    /* The row is a `.ui-field` since 7.623.0, label above, so it carries no layout of its own here. */
    /* Its look is base.css's field default, the same as the Date input under it; only the width is its own. */
    .cd-contract { min-width: 0; max-width: 460px; }
    /* The two-contracts warning is a `.ui-callout--warn` and the remember box a `.ui-field--inline`, and the board
       row's own margin went with them: since 7.576.0 the log's tight stack spaces the row, as in the card dialog. */


    /* The toasts are `.ui-toast` in components.css since 7.459.0. This keyframe stays here: the busy
       indicator below animates with it. */
    @keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

    /* --- "Working on it" (7.12.0) --- */
    /* Bottom CENTER, not bottom-right: the toasts live on the right, and a spinner stacking under an
       integration's error would hide the thing worth reading. Center also reads as "the app is busy" rather
       than "here is another notification". */
    /* Named `.busy-bar`, not `.busy`. This is a page-level singleton, and a bare single-word class in a
       global stylesheet collides with any component that uses the same word as a modifier — which is
       exactly what happened: the calendar tags an event with its show-as status, and every "busy" event
       was pulled out of its row and pinned down here by these rules. Siblings below already read
       `busy-msg` / `busy-wheel`; this one was the odd one out.

       Centered with `margin-inline: auto` between a left/right 0, NOT with `translateX(-50%)`. The
       shared `toastin` keyframe ends on `transform: none`, so a centering transform is silently wiped
       the moment the entry animation completes and the popover sits off to one side. Measured in a
       browser: it landed left of center with every string test still passing. */
    /* On `--z-toast` with the toasts, above every dialog: a wait that starts while a dialog is open (an edit in the
       card that re-reads the Tickets list behind it) ran hidden under a stacked one on the modal rung. */
    .busy-bar { position: fixed; left: 0; right: 0; bottom: 18px;
      width: fit-content; margin-inline: auto;
      display: flex; align-items: center; gap: 10px; z-index: var(--z-toast);
      background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
      padding: 9px 16px 9px 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.28);
      font-size: 13px; color: var(--text); animation: toastin .18s ease-out;
      /* Never intercepts a click: it sits over the screen someone may be trying to use, and a wait
         indicator that swallows a button press would be worse than no indicator. */
      pointer-events: none; }
    .busy-bar[hidden] { display: none; }    /* the recurring §10 gotcha: `hidden` needs the reassert */
    .busy-msg { white-space: nowrap; }
    .busy-wheel { width: 14px; height: 14px; flex: none; border-radius: 50%;
      border: 2px solid color-mix(in srgb, var(--text) 22%, transparent);
      border-top-color: var(--brand-bright); animation: busyspin .7s linear infinite; }
    @keyframes busyspin { to { transform: rotate(360deg); } }
    /* A spinning wheel is exactly what "reduce motion" is about, so it becomes a pulse instead of
       vanishing: the message alone with a static ring reads as a stalled indicator. */
    @media (prefers-reduced-motion: reduce) {
      .busy-wheel { animation: busypulse 1.4s ease-in-out infinite; border-top-color: var(--brand-bright); }
      .busy-bar { animation: none; }
      @keyframes busypulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
    }
    /* The new-version bar (7.507.0): `--accent` under `--on-accent` text in both themes. It was `--brand` under white,
       and dark `--brand` is a light lavender meant for text, so the bar measured 2.06:1 in dark and its Reload button
       (`--brand-deep` on white) 1.57:1. Reload is a `.ui-btn--sm` and the dismiss a `.ui-icon-btn`; the bar inverts them,
       because a component's own colors are drawn for the page, and on an accent bar its accent text, line and focus
       ring all vanish. The hover rule matches `.ui-btn`'s own weight, or its translucent wash would win and the text
       with it; it underlines rather than fading, since the old .92 fade put the dark Reload at 4.29:1. */
    .update-banner { position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-top); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 14px; background: var(--accent); color: var(--on-accent); font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
    .update-banner[hidden] { display: none; }   /* class rule sets display:flex, which beats the UA [hidden] rule — re-assert it here so `hidden` actually hides */
    .update-banner > .ui-btn { background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }
    .update-banner > .ui-btn:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--on-accent); text-decoration: underline; }
    .update-banner > .ui-icon-btn { position: absolute; right: 12px; color: var(--on-accent); border-color: transparent;
      font-size: 20px; line-height: 1; }
    .update-banner > .ui-icon-btn:hover { color: var(--on-accent); border-color: var(--on-accent); }
    .update-banner > :focus-visible { outline-color: var(--on-accent); }
/* ---- Management priority badge (7.5.0) ---------------------------------------------------------
   One rule set, four surfaces: the board card, the card modal, the planning/kanban card and the Gantt
   row. The band class comes from the server (`card_priority.band`); nothing here knows where 1-3 ends.

   Every placement below is a FLEX ITEM, never `position: absolute`. That is the lesson of 6.106.1: an
   absolutely positioned child dropped into a flex row that already right-aligns something landed on top
   of it, 12-13px of overlap on every column, and the string-matching frontend tests could not see it. */
.prio-badge {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; border: 2px solid var(--prio-ring);
  /* The edge in the light theme, where the white border sits on a white card. Kept very light so the
     badge reads as a ring rather than a shadowed chip. */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
  font-size: 12px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;   /* a 10 must not be wider than a 9 in a column of badges */
  white-space: nowrap;
}
/* No priority is plain muted text, not a filled circle (7.606.0): a gray "–" disc in the corner of every card
   read as a remove button. It keeps `.prio-badge`, so a repaint after a save still finds it and puts the
   badge in its place, and gives up the fill, the ring and the edge. */
.prio-band-none { background: none; border-color: transparent; box-shadow: none; color: var(--muted);
  font-weight: 400; }
.prio-band-low { background: var(--severity-low); color: var(--severity-low-ink); }
.prio-band-medium { background: var(--severity-medium); color: var(--severity-medium-ink); }
.prio-band-high { background: var(--severity-high); color: var(--severity-high-ink); }

/* Board card: `.head-right` is already the card's top-right column, so the badge is simply its first
   item. On narrow screens layout.css turns that column into a wrapping row and the badge travels with it. */
.head-right .prio-badge { align-self: flex-end; }

/* Card modal: its own slot in the header, before the close button. */
#carddetail-overlay .cd-prio { display: flex; align-items: center; flex: none; }

/* The Priority row inside the details grid — the badge sits beside the control, so the color is visible
   while you are choosing the number. */
.cd-prio-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

