/* ═══════════════════════════════════════════════════════════════
   Warmup Tool — extracted from style.css in Phase 5.
   All selectors are prefixed with .wu-* and live under page-warmup.
   ═══════════════════════════════════════════════════════════════ */

/* ═══ WARMUP TOOL ═══ */
.wu-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 6px;
}
.wu-file-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wu-file-card.has-file { border-color: var(--green-400, #4ade80); background: rgba(34,197,94,0.04); }
.wu-file-title { font-weight: 600; font-size: .85rem; color: var(--gray-700); display: flex; justify-content: space-between; align-items: center; }
.wu-file-meta  { font-size: .75rem; color: var(--gray-500); }
.wu-file-actions { display: flex; gap: 6px; margin-top: 4px; }
.wu-file-actions button, .wu-file-actions label { font-size: .75rem; padding: 4px 8px; cursor: pointer; }
.wu-thread-check {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1px solid var(--gray-200); border-radius: 6px;
    cursor: pointer; background: var(--gray-50); font-size: .85rem;
}
.wu-thread-check input { margin: 0; }
.wu-profile-pill {
    display: inline-flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; margin: 4px; border-radius: 6px;
    background: var(--gray-50); border-left: 3px solid var(--gray-300);
    font-size: .78rem; min-width: 180px;
}
.wu-profile-pill.started    { border-left-color: #f59e0b; }
.wu-profile-pill.thread_iter,
.wu-profile-pill.thread_start,
.wu-profile-pill.thread_done { border-left-color: #3b82f6; }
.wu-profile-pill.completed  { border-left-color: #10b981; background: rgba(16,185,129,0.05); }
.wu-profile-pill.failed     { border-left-color: #ef4444; background: rgba(239,68,68,0.05); }
.wu-profile-pill .name { font-weight: 600; color: var(--gray-800); }
.wu-profile-pill .msg  { color: var(--gray-500); font-size: .72rem; }

/* ═══ WARMUP — 2-column split (General left, threads right) ═══ */
.wu-split {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.wu-col-left  { min-width: 0; position: sticky; top: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
.wu-col-right { min-width: 0; }
@media (max-width: 1180px) {
    .wu-split { grid-template-columns: 1fr; }
    .wu-col-left { position: static; max-height: none; overflow: visible; }
}

/* Files stack vertically (1-2 columns) inside the narrow left column */
.wu-col-left .wu-files-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}
.wu-col-left #wu-count { width: 100%; }
.wu-col-left textarea#wu-names { width: 100%; box-sizing: border-box; }

/* ═══ WARMUP — block layout (General → threads → files → actions) ═══ */
.wu-block {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
    margin-bottom: 14px;
    overflow: hidden;
    transition: border-color .15s;
}
.wu-block-head {
    padding: 12px 16px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.wu-block-head h3 {
    font-size: .92rem;
    font-weight: 700;
    margin: 0 0 1px 0;
    color: var(--gray-800);
}
.wu-block-head .label-hint { font-size: .72rem; }
.wu-block-body { padding: 14px 16px; }

.wu-subsection { margin-bottom: 16px; }
.wu-subsection:last-child { margin-bottom: 0; }
.wu-subsection-title {
    font-size: .7rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
}

/* Paired Min/Max grid */
.wu-cfg-grid { display: flex; flex-direction: column; gap: 8px; }
.wu-cfg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.wu-cfg-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wu-cfg-cell.wu-cfg-empty { visibility: hidden; }
.wu-cfg-cell label {
    font-size: .68rem;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wu-cfg-cell input {
    padding: 6px 10px;
    font-size: .85rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}
.wu-cfg-cell input:focus {
    outline: none;
    border-color: var(--primary, #ef4444);
    box-shadow: 0 0 0 2px rgba(239,68,68,0.12);
}

/* ── Thread blocks ── */
.wu-thread-block {
    transition: all .15s ease;
}
.wu-thread-block.open {
    border-color: var(--primary, #ef4444);
    box-shadow: 0 1px 3px rgba(239,68,68,0.08);
}
.wu-thread-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    cursor: pointer;
    user-select: none;
    transition: background .12s;
}
.wu-thread-head:hover { background: var(--gray-100); }
.wu-thread-head input[type="checkbox"] {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--primary, #ef4444);
    margin: 0;
    flex: 0 0 auto;
}
.wu-thread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 8px;
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: 5px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .03em;
    transition: all .15s;
}
.wu-thread-block.open .wu-thread-badge {
    background: var(--primary, #ef4444);
    color: #fff;
}
.wu-thread-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.wu-thread-label {
    font-weight: 600;
    color: var(--gray-800);
    font-size: .9rem;
}
.wu-thread-desc {
    font-size: .73rem;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wu-thread-chev {
    color: var(--gray-400);
    transition: transform .2s;
    flex: 0 0 auto;
}
.wu-thread-block.open .wu-thread-chev { transform: rotate(180deg); color: var(--primary, #ef4444); }
.wu-thread-block.open .wu-thread-head {
    background: rgba(239,68,68,0.04);
    border-bottom: 1px solid var(--gray-200);
}

.wu-thread-body { display: none; }
.wu-thread-block.open .wu-thread-body { display: block; }

/* ── Action bar at the bottom ── */
.wu-action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin-top: 4px;
}
.wu-config-saved-flash {
    font-size: .8rem;
    color: var(--green-600, #16a34a);
    font-weight: 600;
}

/* ── Sort-mode segmented control (Random N / Specific Names) ── */
.sort-mode-toggle {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: var(--white);
    height: 40px;
}
.sort-opt {
    display: flex; align-items: center;
    cursor: pointer;
    position: relative;
    flex: 1;
}
.sort-opt input[type="radio"] {
    position: absolute; opacity: 0; width: 0; height: 0;
    pointer-events: none;
}
.sort-opt span {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    padding: 0 16px;
    font-size: .85rem; font-weight: 500;
    color: var(--gray-600);
    transition: var(--transition);
    white-space: nowrap;
    height: 40px;
    border: none;
    user-select: none;
}
.sort-opt + .sort-opt span {
    border-left: 1.5px solid var(--border);
}
.sort-opt input:checked + span {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}
.sort-opt:hover span { background: var(--gray-100); }
.sort-opt input:checked + span:hover { background: var(--primary-hover); }
