/* /features/reports/ only: the body of the hero's live instrument (the Reports hub: module chips,
   the report list, the selected report's options, preview and export; js/pages/reports.js).
   The instrument's shell (stage, board header, activity footer) is .site-instrument in
   css/public-site.css. */

/* ---------- Module chips ---------- */
.rpt-chips {
    height: 28px;
    margin-bottom: 12px;
    display: flex;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
    mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.rpt-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    border: 1px solid var(--site-line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--site-text-2);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.rpt-chip:hover { border-color: var(--site-subtle); }
.rpt-chip__count { font-family: var(--site-font-mono); font-size: 10.5px; color: var(--site-subtle); }
.rpt-chip.is-active { background: var(--site-ink-2); border-color: var(--site-ink-2); color: #fff; }
.rpt-chip.is-active .rpt-chip__count { color: rgba(255, 255, 255, .7); }

/* ---------- Body: list + detail ---------- */
.rpt-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; height: 404px; }
.rpt-pane { min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--site-line); border-radius: 10px; background: #fff; }
.rpt-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* The list */
.rpt-search {
    flex: none;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--site-line);
    color: var(--site-subtle);
    cursor: text;
}
.rpt-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: none;
    font: 13px var(--site-font-body);
    color: var(--site-text);
}
.rpt-search input::placeholder { color: var(--site-subtle); }
.rpt-list__scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 10px; scrollbar-width: thin; }
.rpt-group {
    padding: 10px 14px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--site-font-mono);
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--site-subtle);
}
.rpt-group .rpt-dot { width: 7px; height: 7px; }
.rpt-group__count { margin-left: auto; }
.rpt-row {
    margin: 0 6px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .2s ease;
}
.rpt-row:hover { background: #F7F5FC; }
.rpt-row.is-active { background: var(--site-panel); box-shadow: inset 2px 0 0 var(--site-accent); }
.rpt-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--site-text); }
.rpt-row__meta { font-family: var(--site-font-mono); font-size: 10.5px; color: var(--site-subtle); }
.rpt-empty { padding: 24px 16px; font-size: 13px; text-align: center; color: var(--site-subtle); }

/* The detail */
.rpt-detail { padding: 14px 16px 0; gap: 10px; }
.rpt-detail > * { flex: none; transition: opacity .2s ease; }
.rpt-detail.is-swapping > :not(.rpt-preview) { opacity: 0; }
.rpt-detail__top { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rpt-detail__meta { height: 22px; display: flex; align-items: center; gap: 10px; }
.rpt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    background: #F4F2F8;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--site-text-2);
}
.rpt-formats { font-family: var(--site-font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--site-subtle); }
.rpt-detail__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--site-font-display); font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--site-text); }
.rpt-detail__desc { height: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.45; color: var(--site-muted); }
.rpt-params { height: 46px; display: flex; gap: 10px; overflow: hidden; }
.rpt-param { flex: none; display: flex; flex-direction: column; gap: 3px; }
.rpt-param__label { font-size: 11px; color: var(--site-subtle); white-space: nowrap; }
.rpt-param__value { min-width: 116px; max-width: 250px; overflow: hidden; text-overflow: ellipsis; padding: 4px 9px; border: 1px solid var(--site-line); border-radius: 6px; font-size: 12.5px; white-space: nowrap; color: var(--site-text-2); }
.rpt-param__value.is-placeholder { color: var(--site-subtle); }
.rpt-actions { display: flex; gap: 8px; }
.rpt-btn {
    padding: 5px 12px;
    border: 1px solid var(--site-line);
    border-radius: 6px;
    background: #fff;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--site-text);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: transform .12s ease, background-color .2s ease, border-color .2s ease;
}
.rpt-btn:hover { border-color: var(--site-subtle); }
.rpt-btn--primary { border-color: var(--site-accent); background: var(--site-accent); color: #fff; }
.rpt-btn--primary:hover { border-color: var(--site-accent-hover); background: var(--site-accent-hover); }
.rpt-btn.is-pressed { transform: scale(.94); }
.rpt-btn[hidden] { display: none; }
/* Nothing picked yet (also the no-JS state): just the prompt. */
.rpt-detail.is-empty .rpt-detail__meta,
.rpt-detail.is-empty .rpt-params,
.rpt-detail.is-empty .rpt-actions,
.rpt-detail.is-empty .rpt-preview { visibility: hidden; }

/* The preview */
.rpt-preview { flex: 1; min-height: 0; margin: 0 -16px; display: flex; flex-direction: column; border-top: 1px solid var(--site-line); }
.rpt-preview__head {
    flex: none;
    height: 32px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--site-line);
    background: #FAFAFC;
    font-size: 12px;
    font-weight: 600;
    color: var(--site-text);
}
.rpt-preview__count { font-family: var(--site-font-mono); font-size: 10.5px; font-weight: 400; letter-spacing: .04em; color: var(--site-subtle); }
.rpt-preview__body { flex: 1; min-height: 0; overflow: hidden; }
.rpt-preview__note { padding: 18px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--site-subtle); }
.rpt-spinner { width: 14px; height: 14px; border: 2px solid var(--site-line); border-top-color: var(--site-accent); border-radius: 50%; animation: rpt-spin .7s linear infinite; }
@keyframes rpt-spin { to { transform: rotate(360deg); } }

.rpt-table { width: 100%; border-collapse: collapse; }
.rpt-table th {
    padding: 6px 10px;
    background: var(--site-paper);
    font-family: var(--site-font-mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
    color: var(--site-subtle);
}
.rpt-table td { padding: 5px 10px; border-top: 1px solid #ECEAF1; font-size: 12px; line-height: 18px; white-space: nowrap; color: var(--site-text-2); }
.rpt-table th:first-child, .rpt-table td:first-child { padding-left: 16px; }
.rpt-table th:last-child, .rpt-table td:last-child { padding-right: 16px; }
.rpt-table td:first-child { font-weight: 500; color: var(--site-text); }
.rpt-table .rpt-num { text-align: right; }
/* The long-text column(s) take the spare width and truncate. */
.rpt-table .rpt-flex { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* backwards, never both: a transform left on a <tr> stops Chrome hit-testing the row. */
.rpt-table tbody tr.is-new { animation: rpt-row-in .35s ease backwards; }
@keyframes rpt-row-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Narrow: the report on its own, as the hub shows it on a phone ---------- */
@media (max-width: 1100px) {
    .rpt-body { grid-template-columns: 250px minmax(0, 1fr); }
    .rpt-col-x { display: none; }
}
@media (max-width: 760px) {
    .rpt-chips, .rpt-list { display: none; }
    .rpt-body { grid-template-columns: minmax(0, 1fr); height: 446px; }
    .rpt-detail__desc { height: 38px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .rpt-param__value { min-width: 0; }
    .rpt-col-p { display: none; }
    .rpt-actions { gap: 6px; }
    .rpt-btn { padding: 5px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .rpt-detail > *, .rpt-chip, .rpt-row, .rpt-btn { transition: none; }
    .rpt-spinner { animation: none; }
}
