/* Model performance scorecard (applications/performance.php) */

#photo.perf-page {
    background: var(--color-surface-alt);
    padding: 28px 20px 48px;
}

.perf {
    --ink: #0b0b0b;
    --ink-2: #52514e;
    --ink-muted: #898781;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --surface: #fcfcfb;
    --s-overall: #0b0b0b;
    --s-level: #2a78d6;
    --s-rank: #eb6834;
    --s-dyn: #1baf7a;
    --up: #006300;
    --down: #d03b3b;
    width: min(1180px, 100%);
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink);
}

.perf h1 {
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    line-height: 1.2;
}

.perf h2 {
    margin: 0 0 2px;
    font-size: 1.12rem;
}

.perf-head {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.perf-lead {
    margin: 0;
    max-width: 64ch;
    color: var(--ink-2);
}

.perf-filters {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.perf-filters label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--ink-2);
}

.perf-filters select {
    min-width: 210px;
    padding: 7px 10px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.perf-status {
    margin: 30px 0;
    color: var(--ink-2);
}

.perf-note {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--ink-2);
}

.perf-sub {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--ink-2);
    max-width: 90ch;
}

.perf-card {
    margin: 0 0 16px;
    padding: 18px 20px 20px;
    background: var(--surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

/* headline tiles */
.perf-tiles {
    display: grid;
    grid-template-columns: 1.3fr repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.perf-tile {
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    min-width: 0;
}

.perf-tile-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--ink-2);
}

.perf-tile-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.perf-tile--main .perf-tile-value {
    font-size: 2.7rem;
}

.perf-tile-value small {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--ink-muted);
}

.perf-tile-foot {
    font-size: 12.5px;
    color: var(--ink-2);
    min-height: 1.4em;
}

.perf-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

.perf-delta--up { color: var(--up); font-weight: 600; }
.perf-delta--down { color: var(--down); font-weight: 600; }
.perf-delta--flat { color: var(--ink-muted); }

/* history chart */
.perf-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--ink-2);
    margin-bottom: 4px;
}

.perf-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.perf-chart {
    position: relative;
}

.perf-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.perf-chart text {
    font-family: inherit;
    font-size: 11.5px;
    fill: var(--ink-muted);
}

.perf-chart .perf-xlab--on {
    fill: var(--ink);
    font-weight: 600;
}

.perf-tip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    min-width: 170px;
    padding: 8px 10px;
    font-size: 12.5px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(20, 25, 40, 0.16);
}

.perf-tip strong {
    display: block;
    margin-bottom: 4px;
}

.perf-tip div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.perf-tip div b {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* matrix */
.perf-scale {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--ink-muted);
}

.perf-scale-bar {
    display: flex;
    width: 180px;
    height: 10px;
    border-radius: 3px;
    overflow: hidden;
}

.perf-scale-bar i {
    flex: 1;
}

.perf-tablewrap {
    overflow-x: auto;
}

.perf-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    table-layout: fixed;
    min-width: 560px;
}

.perf-matrix th {
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    padding: 4px 8px;
    color: var(--ink);
}

.perf-matrix thead th {
    text-align: center;
    color: var(--ink-2);
}

.perf-matrix th.perf-group {
    padding-top: 14px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.perf-matrix th[scope="row"] {
    width: 150px;
    font-weight: 400;
}

.perf-matrix td {
    padding: 0;
    height: 58px;
}

.perf-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 58px;
    padding: 4px 6px;
    font: inherit;
    line-height: 1.2;
    color: var(--ink);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.perf-cell:hover,
.perf-cell:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 1px;
}

.perf-cell[aria-pressed="true"] {
    outline: 3px solid var(--ink);
    outline-offset: 1px;
}

.perf-cell--dark {
    color: #fff;
}

.perf-cell-skill {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.perf-cell-sub {
    font-size: 11.5px;
    white-space: nowrap;
}

.perf-cell-empty {
    display: block;
    text-align: center;
    color: var(--axis);
}

/* detail */
.perf-detail-head {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.perf-detail-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.4fr);
    gap: 24px;
    margin: 12px 0 16px;
}

.perf-bars {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px 10px;
    align-items: center;
    font-size: 13px;
}

.perf-bar {
    height: 12px;
    background: #eeede8;
    border-radius: 0 4px 4px 0;
    overflow: hidden;
}

.perf-bar i {
    display: block;
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.perf-bars b {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.perf-sites {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.perf-sites th,
.perf-sites td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--grid);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.perf-sites th {
    font-weight: 600;
    color: var(--ink-2);
    border-bottom-color: var(--axis);
}

.perf-sites th:first-child,
.perf-sites td:first-child {
    text-align: left;
}

.perf-ratio {
    display: inline-block;
    width: 90px;
    height: 10px;
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
    background: linear-gradient(var(--axis), var(--axis)) center / 1px 100% no-repeat;
}

.perf-ratio i {
    position: absolute;
    top: 1px;
    height: 8px;
    background: var(--s-level);
    border-radius: 2px;
}

.perf-method summary {
    cursor: pointer;
    font-weight: 600;
}

.perf-method p,
.perf-method ul {
    font-size: 13.5px;
    color: var(--ink-2);
    max-width: 95ch;
}

.perf-close {
    padding: 5px 12px;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
}

@media (max-width: 860px) {
    .perf-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .perf-tile--main {
        grid-column: 1 / -1;
    }

    .perf-detail-grid {
        grid-template-columns: 1fr;
    }
}
