/* ── Projects modal rows ────────────────────────────────────────── */
/* 576px, not the shared 560: its three selects need 568 for one line at their longest labels, plus
   a little for other platforms' fonts (desktop PROJECTS_WIDTH). The height is the shared ceiling,
   whatever the row count, so a filter or a search never resizes the window; the list scrolls. */
#projects-modal-overlay:not(.modal-popover) .app-modal { width: 576px; height: min(82vh, 760px); }
.project-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; border: 1px solid var(--border-main); border-radius: 8px;
    margin-bottom: 8px; cursor: pointer; background: var(--input-bg);
}
.project-row:hover { background: var(--bg-info); }
.project-row.project-active { border-color: var(--text-key); }
/* The open editor's row: "(Current)" in the accent beside the origin badge, no mark of its own. */
.project-current-badge { color: var(--accent); font-weight: 600; }
/* --rest-opacity: where a row's arrival veil lifts to (dust.css), so it lands without a dip. */
.project-row.project-temp { cursor: default; --rest-opacity: 0.92; opacity: var(--rest-opacity); border-style: dashed; }
.project-row.project-selected { border-color: var(--accent); background: var(--bg-info); }
/* pan-y: a finger still scrolls the list while a long-press picks a row up; no selection callout. */
.project-row, .connect-row { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.project-row.project-dragging { opacity: 0.3; }
.project-row:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.project-row.project-drop-before { box-shadow: 0 -4px 0 -1px var(--accent); }
.project-row.project-drop-after { box-shadow: 0 4px 0 -1px var(--accent); }
/* Drag-out drop zones behind the card: top 70% Open here / new tab, bottom 30% red Remove, abutting. */
.project-dropzones { position: absolute; inset: 0; display: none; pointer-events: none; }
.project-dropzones.is-dragging { display: block; }
.project-dropzones .pdz {
    position: absolute; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; padding: 8px;
    /* Each zone has its OWN identity colour via --pdz: grey (here), blue (new tab), red (remove). */
    border: 5px dashed color-mix(in srgb, var(--pdz) 72%, transparent); border-radius: 12px;
    /* Mostly-opaque panel with a slight see-through (≈0.9 alpha of the zone-colour-blended fill). */
    background: color-mix(in srgb, color-mix(in srgb, var(--pdz) 28%, var(--bg-container)) 90%, transparent);
    color: color-mix(in srgb, var(--pdz) 65%, white);
}
/* Labels sit in each zone's outer corner, so the centred card never overlaps them. */
.project-dropzones .pdz-here   { --pdz: #64748b; left: 0;  top: 0; width: calc(50% - 8px); height: 70%; align-items: flex-start; justify-content: flex-start; padding: 26px 0 0 30px; }
.project-dropzones .pdz-newtab { --pdz: #2563eb; right: 0; top: 0; width: calc(50% - 8px); height: 70%; align-items: flex-start; justify-content: flex-end; padding: 26px 30px 0 0; }
.project-dropzones .pdz-remove { --pdz: var(--danger); left: 0; bottom: 0; width: 100%; height: calc(30% - 10px); align-items: flex-end; justify-content: center; padding-bottom: 20px; }
.project-dropzones .pdz-over { background: color-mix(in srgb, color-mix(in srgb, var(--pdz) 48%, var(--bg-container)) 92%, transparent); }
.project-dropzones .pdz-label { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; pointer-events: none; }
.project-dropzones.is-dragging .pdz-label svg { transform-origin: center; animation: dropZonePulse 0.9s ease-in-out infinite; }
/* Phone: each zone shows only as a thin strip past the card, so its label lies in one row along it. */
@media (max-width: 680px) {
    .project-dropzones .pdz-here   { padding: 10px 0 0 16px; }
    .project-dropzones .pdz-newtab { padding: 10px 16px 0 0; }
    .project-dropzones .pdz-remove { padding-bottom: 10px; }
    .project-dropzones .pdz-label  { flex-direction: row; gap: 6px; font-size: 13px; }
}
/* No taller than the Close pill, so the ⋯'s arrival never moves the header. */
.projects-drag-more { margin: 0 auto 0 10px; padding: 3px 9px; line-height: 1; }
.projects-drag-more.is-open { background: var(--accent-2); }
.project-select { flex: 0 0 auto; width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.modal-search-bar { display: flex; align-items: center; gap: 8px; }
.modal-search-bar .modal-search { flex: 1; }
/* The selects' own row, as far under the search bar as above the rows (desktop buildSearchRow). */
.projects-filter-row { padding-top: 4px; padding-bottom: 4px; }
#projects-modal-overlay .settings-body { padding-top: 6px; }
.modal-filter {
    flex: 0 0 auto; padding: 6px 8px; border-radius: 6px;
    /* background-color, not the shorthand: it resets the hover sweep (layout/shimmer.css). */
    background-color: var(--input-bg); color: var(--input-text); border: 1px solid var(--border-main);
}
/* A filter that no longer fits its row goes to the next line rather than past the window's edge. */
.projects-filter-row { flex-wrap: wrap; }
/* The search bar and footer are rows sized for 560px (a 520px content box still holds them). The window's own width decides (container
   `modal`, modalShell.css), so a phone, the 420px popover and a window dragged narrower all wrap:
   the search field and the hint each take a full line. */
@container modal (max-width: 520px) {
    .modal-search-bar { flex-wrap: wrap; }
    .modal-search-bar .modal-search { flex: 1 1 100%; min-width: 0; }
    .modal-search-bar .modal-filter { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    /* An enhanced select's .cs-dd wrap takes the native's flex slot. */
    .modal-search-bar .cs-dd { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .modal-search-bar .cs-dd .accent-dd-trigger { width: 100%; }
    /* The hint takes the whole line, buttons under it: the 110px floor alone never wraps. */
    .settings-footer .footer-hint:not(:empty) { flex: 1 1 100%; text-align: left; }
}
/* Three buttons overrun 420px by a few pixels; the tighter gap keeps them on one row. */
@container modal (max-width: 440px) { .settings-footer { gap: 6px; } }
/* Touch: ≥40px tap targets, as the chat panel's compact buttons. */
@media (hover: none) and (pointer: coarse) {
    .modal-search, .modal-filter { min-height: 40px; }
    .modal-search-bar .cs-dd .accent-dd-trigger { min-height: 40px; }
    .settings-footer button { min-height: 40px; }
}
