/* =========================================================================
   results.css — the Results page (results.html). Loaded after styles.css and
   result-pages.css; uses their custom properties (dark theme).
   ========================================================================= */

.rs-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ---- verdict ---- */
.rs-verdict { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-size: 1.05rem; color: var(--text-secondary); }
.rs-pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.85rem; border-radius: 999px; border: 1px solid currentColor; font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.rs-pill::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; }
.rs-verdict.rs-ok .rs-pill { color: var(--success-color); }
.rs-verdict.rs-warn .rs-pill { color: var(--warning-color); }
.rs-verdict.rs-bad .rs-pill { color: var(--danger-color); }
.rs-run { margin-top: 0.4rem; color: var(--text-muted); font-size: 0.8rem; }

/* ---- tabs ---- */
.rs-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--card-border); margin-bottom: 1.5rem; overflow-x: auto; }
.rs-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); padding: 0.6rem 1rem; font-weight: 500; white-space: nowrap; }
.rs-tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--primary-color); }
.rs-page[hidden] { display: none; }

/* ---- cards ---- */
.rs-card > h3 { margin-bottom: 0.35rem; }
.rs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rs-card-head h3 { font-size: 1.15rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.rs-note { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 1rem; }
.rs-muted { color: var(--text-muted); }
.rs-scroll { overflow-x: auto; }

/* ---- KPIs ---- */
.rs-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.rs-kpi { background: var(--ps-surface, rgba(45, 50, 70, 0.95)); border: 1px solid color-mix(in srgb, var(--ps-accent, rgb(99, 102, 241)) 35%, transparent); border-radius: 16px; padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.25rem; }
.rs-kpi-label { color: var(--text-muted); font-size: 0.85rem; display: block; }
.rs-kpi-value { font-size: 2rem; font-weight: 600; line-height: 1.15; color: var(--text-primary); font-variant-numeric: tabular-nums; display: block; }
.rs-kpi-value small { font-size: 0.95rem; font-weight: 400; color: var(--text-muted); }
.rs-kpi-note { color: var(--text-muted); font-size: 0.8rem; }
.rs-kpi.rs-bad { border-color: color-mix(in srgb, var(--ps-danger, rgb(239, 68, 68)) 60%, transparent); }
.rs-kpi.rs-bad .rs-kpi-value { color: var(--danger-color); }

/* ---- checks ---- */
.rs-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.rs-checks li { display: grid; grid-template-columns: 0.6rem 1fr; gap: 0.7rem; align-items: baseline; }
.rs-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: currentColor; }
.rs-checks .rs-bad { color: var(--danger-color); }
.rs-checks .rs-warn { color: var(--warning-color); }
.rs-checks .rs-info { color: var(--text-muted); }
.rs-checks .rs-ok { color: var(--success-color); }
.rs-check-title { color: var(--text-primary); font-weight: 600; }
.rs-check-detail { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.15rem; }

/* ---- plan grid ---- */
.rs-colour { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.rs-colour select { width: auto; min-width: 10rem; }
.rs-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.9rem; font-size: 0.8rem; color: var(--text-muted); }
.rs-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; }
.rs-grid { display: grid; gap: 4px; min-width: 36rem; font-size: 0.82rem; }
.rs-day { color: var(--text-primary); font-weight: 600; padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--card-border); white-space: nowrap; }
.rs-colhead { color: var(--text-muted); padding: 0.2rem 0.4rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rs-right { text-align: right; }
.rs-who { display: flex; align-items: center; font-weight: 600; color: var(--text-primary); padding-right: 0.5rem; white-space: nowrap; }
.rs-cell { display: flex; flex-direction: column; gap: 3px; min-height: 2.9rem; }
.rs-cell.rs-free { border: 1px dashed var(--ps-border-strong, rgba(255, 255, 255, 0.14)); border-radius: 8px; }
.rs-total { display: flex; align-items: center; justify-content: flex-end; padding-left: 0.6rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-bad-text { color: var(--danger-color); }
.rs-chip { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0.35rem 0.55rem; border-radius: 8px; min-height: 2.9rem;
    background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); cursor: default; overflow: hidden; }
.rs-chip b { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-chip span { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-chip.rs-misfit { outline: 2px solid var(--danger-color); outline-offset: -2px; }
.rs-seq { display: inline-block; min-width: 1.2rem; font-size: 0.7rem; color: var(--text-muted); }
.rs-seqrow { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-seqrow .rs-chip { flex: 0 0 auto; min-width: 7rem; flex-direction: row; align-items: center; gap: 0.4rem; min-height: 2.2rem; }

/* timeline mode */
.rs-timeline .rs-lane { position: relative; min-height: 2.9rem; background: var(--ps-surface-raised, rgba(255, 255, 255, 0.03)); border-radius: 8px; }
.rs-timeline .rs-bar { position: absolute; top: 0; bottom: 0; padding: 0 1px; }
.rs-timeline .rs-bar .rs-chip { height: 100%; min-height: 0; padding: 0.25rem 0.4rem; }
.rs-axis { position: relative; height: 1.4rem; color: var(--text-muted); font-size: 0.72rem; }
.rs-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.rs-axis span:first-child { transform: none; }
.rs-axis span:last-child { transform: translateX(-100%); }

/* ---- workload ---- */
.rs-wls { display: flex; flex-direction: column; gap: 0.6rem; }
.rs-wl { display: grid; grid-template-columns: minmax(5rem, 9rem) 1fr; gap: 0.75rem; align-items: center; font-size: 0.85rem; }
.rs-wl-name { color: var(--text-primary); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-wl-track { position: relative; height: 1.4rem; }
.rs-wl-fill { position: absolute; inset: 0 auto 0 0; border-radius: 0 6px 6px 0; background: var(--primary-color); }
.rs-wl-even { position: absolute; top: -4px; bottom: -4px; border-left: 1px dashed var(--text-muted); }
.rs-wl-label { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 0.5rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- score + rules ---- */
.rs-scorebox { display: flex; flex-wrap: wrap; gap: 2rem; margin: 0.5rem 0 1rem; }
.rs-scorebox code { font-size: 1.4rem; color: var(--text-primary); }
.rs-prose { color: var(--text-secondary); line-height: 1.6; max-width: 52rem; margin: 0; }
.rs-tag { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid currentColor; font-size: 0.78rem; white-space: nowrap; }
.rs-tag.rs-ok { color: var(--success-color); }
.rs-tag.rs-bad { color: var(--danger-color); }
.rs-tag.rs-info { color: var(--text-muted); }
/* solid backing so the sticky header hides rows scrolling under it */
.rs-table thead { background: var(--ps-surface-raised, rgb(45, 50, 70)); }
.rs-table thead th { white-space: nowrap; }
.rs-table thead th:has(> button) { padding: 0; }
.rs-table th button { background: none; border: 0; color: inherit; font: inherit; font-weight: 600; padding: 0.6rem 0.75rem; width: 100%; text-align: left; }
.rs-table td code { font-size: 0.75rem; margin-left: 0.25rem; }
.rs-search, .rs-search:focus { max-width: 22rem; margin-bottom: 0.75rem; background: var(--ps-surface-raised, rgba(255, 255, 255, 0.05)); color: var(--text-primary); border-color: var(--card-border); }
.rs-search::placeholder { color: var(--text-muted); }
.rs-tablebox { max-height: 34rem; overflow: auto; }
.rs-tablebox thead { position: sticky; top: 0; z-index: 1; }
@media (max-width: 720px) { .rs-hide-narrow { display: none; } body { padding: 1rem; } }
.rs-fix { display: inline-block; margin-top: 0.3rem; font-size: 0.85rem; font-weight: 600; color: var(--primary-color); text-decoration: none; }
.rs-fix:hover { text-decoration: underline; }

/* ---- Plan calendar (js/plan-calendar.js): the whole planning period, week by week ---------------- */
.pc-head { margin-bottom: 0.6rem; }
.pc-controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: flex-end; margin-bottom: 0.5rem; }
.pc-ctl { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.78rem; color: var(--text-muted); min-width: 9rem; }
.pc-ctl select { min-width: 9rem; }
.pc-weeknav { display: flex; align-items: flex-end; gap: 0.3rem; }
.pc-weeknav .pc-ctl select { min-width: 17rem; }
.pc-weeknav button { padding: 0.25rem 0.7rem; font-size: 1.1rem; line-height: 1; }
.pc-period { margin: 0.2rem 0; font-size: 0.85rem; color: var(--text-secondary, var(--text-muted)); }
.pc-closedlist { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.pc-closedlist span { display: inline-block; margin: 0 0.4rem 0.2rem 0; padding: 0.05rem 0.45rem; border-radius: 6px; background: var(--ps-surface-raised, rgba(148, 163, 184, 0.15)); }
.pc-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.78rem; color: var(--text-muted); margin: 0.3rem 0; }
.pc-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }
.pc-scroll { overflow: auto; max-height: 75vh; }
.pc-grid { display: grid; gap: 0.3em; min-width: 40rem; }
.pc-corner { position: sticky; top: 0; z-index: 2; background: var(--card-bg, #1e2030); font-weight: 600; color: var(--text-muted); padding: 0.3em; }
.pc-dayhead { position: sticky; top: 0; z-index: 2; background: var(--card-bg, #1e2030); font-weight: 600; color: var(--text-primary);
              padding: 0.3em 0.4em; border-bottom: 1px solid var(--card-border); white-space: nowrap; }
.pc-dayhead span { display: block; font-weight: 400; font-size: 0.85em; color: var(--warning-color, #f59e0b); }
.pc-dayhead.pc-out span { color: var(--text-muted); }
.pc-who, .pc-tod { display: flex; align-items: flex-start; font-weight: 600; color: var(--text-primary); padding: 0.4em 0.6em 0 0; white-space: nowrap; }
.pc-count { display: flex; align-items: flex-start; justify-content: flex-end; color: var(--text-muted); padding: 0.4em 0 0 0.5em; }
.pc-cell { display: flex; flex-direction: column; gap: 0.25em; min-height: 3.2em; }
.pc-cell.pc-free { border: 1px dashed var(--ps-border-strong, rgba(255, 255, 255, 0.12)); border-radius: 0.6em; }
.pc-cell.pc-closed { border-radius: 0.6em; background: repeating-linear-gradient(45deg, rgba(148, 163, 184, 0.08) 0 6px, transparent 6px 12px); }
.pc-chip { border-left: 0.3em solid var(--ps-accent, #6366f1); border-radius: 0.45em; padding: 0.3em 0.55em; }
.pc-chip-name { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-chip-sub { font-size: 0.88em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-time { color: var(--text-muted); font-weight: 500; }
.pc-zoom { display: flex; align-items: flex-end; gap: 0.2rem; }
.pc-zoom button { padding: 0.25rem 0.55rem; }
.pc-zoom .pc-zoom-level { min-width: 3.6rem; font-variant-numeric: tabular-nums; }
.pc-compact .pc-chip-sub { display: none; }            /* zoomed out: one line per item */
