#panel-temporary-scores { --temp-border: #d4dfe8; }
#panel-temporary-scores .temp-tool-frame { min-width: 0; border: 1px solid var(--temp-border); border-radius: 6px; background: #fff; }
#panel-temporary-scores [hidden] { display: none !important; }
#panel-temporary-scores .admin-status-line:empty { display: none; }
#panel-temporary-scores h2 { margin-bottom: 0.55rem; }
#panel-temporary-scores h3 { margin: 0; font-size: 1rem; }
#panel-temporary-scores p { line-height: 1.65; }
#panel-temporary-scores label { display: grid; gap: 0.4rem; min-width: 0; color: #334155; font-size: 0.85rem; }
#panel-temporary-scores input, #panel-temporary-scores select {
    min-width: 0; width: 100%; min-height: 2.5rem; padding: 0.5rem 0.65rem;
    border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #111827; font: inherit;
}
#panel-temporary-scores input:focus-visible, #panel-temporary-scores select:focus-visible {
    outline: 2px solid #0f766e; outline-offset: 2px;
}
.temp-heading, .temp-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.temp-heading { margin-bottom: 0.75rem; }
.temp-heading p { margin: 0.25rem 0 0; }
.temp-isolation-badge { color: #92400e; border: 1px solid #e9c990; background: #fffbeb; border-radius: 5px; padding: 0.3rem 0.6rem; font-size: 0.82rem; }
.temp-record-toolbar { display: grid; grid-template-columns: minmax(0, calc(32rem + 10ch)) auto; justify-content: start; gap: 0.4rem 0.85rem; align-items: end; margin: 0.8rem 0; padding: 0.8rem 0.85rem; }
.temp-record-caption { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 1.25em; min-width: 0; }
.temp-record-caption label { flex: 0 0 auto; white-space: nowrap; }
#panel-temporary-scores .temp-record-caption label { font-size: 1rem; }
#tempScoreStatus { flex: 1; min-width: 0; margin: 0; font-size: 0.85rem; line-height: 1.5; overflow-wrap: anywhere; }
.temp-record-actions { display: flex; align-items: center; gap: 0.5rem; }
#tempScoreRefresh { width: 5rem; }
#panel-temporary-scores .temp-delete-btn { color: #9f2424; border-color: #e4caca; background: #fff; }
.temp-import-dialog { width: min(46rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); max-height: calc(100dvh - 2rem); box-sizing: border-box; margin: auto; padding: 1.25rem; overflow-y: auto; border: 1px solid #cbd5e1; border-radius: 8px; color: #1f2937; background: #fff; }
.temp-import-dialog::backdrop { background: rgb(15 23 42 / 40%); }
.temp-import-dialog .temp-section-heading { margin-bottom: 0; }
.temp-upload-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding-top: 1rem; }
.temp-upload-title, .temp-upload-guide, #tempScoreUploadStatus { grid-column: 1 / -1; }
.temp-upload-guide { padding: 0.6rem 0; border-top: 1px solid var(--temp-border); border-bottom: 1px solid var(--temp-border); }
.temp-upload-guide summary { cursor: pointer; color: #475569; font-size: 0.84rem; }
.temp-upload-guide[open] summary { margin-bottom: 0.5rem; }
.temp-upload-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; grid-column: 1 / -1; }
.temp-file-hint { grid-column: 1 / -1; margin: 0; }
.temp-section { padding: 0.65rem 0 1.2rem; }
.temp-section-heading { margin-bottom: 0.65rem; }
.temp-source-toolbar { margin-bottom: 0.8rem; padding: 0.6rem 0.85rem; }
.temp-source-actions { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
#panel-temporary-scores .temp-source-actions button { display: inline-flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; padding: 0.15rem 0; border: 0; border-radius: 3px; color: #475569; background: transparent; box-shadow: none; font-size: 0.83rem; line-height: 1.5; text-align: left; cursor: pointer; }
#panel-temporary-scores .temp-source-actions button::before { content: '\25B8'; flex: 0 0 0.6rem; }
#panel-temporary-scores .temp-source-actions button[aria-expanded="true"]::before { content: '\25BE'; }
#panel-temporary-scores .temp-source-actions button:is(:hover, :focus, :active) { text-decoration: none; }
#panel-temporary-scores .temp-source-actions button:focus-visible { outline: 2px solid #0f766e; outline-offset: 3px; }
#panel-temporary-scores .temp-source-actions .temp-warnings { color: #92400e; }
.temp-source-time { margin-left: auto; min-width: 0; color: #536579; font-size: 0.82rem; }
.temp-source-panel { padding-top: 0.65rem; border-top: 1px solid var(--temp-border); margin-top: 0.5rem; }
.temp-result-sources { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.35rem 0.9rem; margin: 0.75rem 0 0.5rem; font-size: 0.84rem; line-height: 1.6; }
.temp-result-sources dt { color: #475569; }
.temp-result-sources dd { min-width: 0; margin: 0; color: #334155; overflow-wrap: anywhere; }
.temp-settings-disclosure { margin: 0.5rem 0 0.75rem; border: 1px solid var(--temp-border); border-radius: 6px; background: #f8fafb; }
.temp-shared-settings-notice { margin: 0.4rem 0; color: #92400e; font-size: 0.82rem; overflow-wrap: anywhere; }
.temp-settings-disclosure > summary { cursor: pointer; padding: 0.75rem 0.85rem; color: #263b48; font-size: 0.85rem; }
#tempScoreSettingsHeading { font-weight: 600; }
#tempScoreSettingsSummary { margin-left: 0.75rem; color: #526372; font-size: 0.82rem; overflow-wrap: anywhere; }
.temp-settings-body { padding: 0 0.85rem 0.65rem; }
.temp-settings-body p { margin: 0.6rem 0 0; }
.temp-settings-disclosure > .admin-status-line { display: block; margin: 0; padding: 0 0.85rem 0.75rem; }
.temp-history-list { display: grid; gap: 0.45rem; margin: 0.65rem 0; padding-left: 1.35rem; }
.temp-history-list > li { padding: 0.55rem 0.7rem; border: 1px solid var(--temp-border); border-radius: 5px; background: #fff; overflow-wrap: anywhere; }
.temp-history-list > li strong { color: #263b48; font-size: 0.84rem; }
.temp-history-list > li p { margin: 0.3rem 0 0; color: #475569; font-size: 0.82rem; }
.temp-settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(6rem, 0.7fr) minmax(6rem, 0.7fr); gap: 0.8rem; }
.temp-warnings { color: #92400e; margin: 0; font-size: 0.85rem; overflow-wrap: anywhere; }
.temp-source-panel ul { padding-left: 1.25rem; }
.temp-warnings li { margin: 0.4rem 0; }
.temp-statistics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0.5rem 0 0.75rem; overflow: hidden; }
.temp-statistics > div { display: grid; gap: 0.25rem; min-width: 0; padding: 0.7rem 0.85rem; }
.temp-statistics > div + div { border-left: 1px solid var(--temp-border); }
.temp-statistics span { color: #536579; font-size: 0.8rem; }
.temp-statistics strong { color: #263b48; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.temp-statistics .is-attention strong { color: #9a4b0a; }
.temp-statistics .is-average { background: #f0f8f6; }
.temp-statistics .is-average strong { color: #0c665c; }
.temp-filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem 1.4rem; padding: 0.75rem 0.85rem; }
.temp-filter-form > label, .temp-filter-form > fieldset { flex: 0 1 auto; width: var(--temp-filter-width, 8.5rem); max-width: calc((100% - 1.4rem) / 2); }
.temp-filter-id { --temp-filter-width: 8rem; }
.temp-filter-name { --temp-filter-width: 7rem; }
.temp-filter-chapter { --temp-filter-width: 5.5rem; }
.temp-filter-sort { --temp-filter-width: 9.25rem; }
.temp-filter-form > .temp-filter-range { max-width: 100%; }
.temp-filter-form > .temp-filter-sort { max-width: 100%; }
#panel-temporary-scores .temp-filter-form label { gap: 0.25rem; }
#panel-temporary-scores .temp-filter-form input, #panel-temporary-scores .temp-filter-form select { min-height: 2.25rem; padding: 0.4rem 0.55rem; }
#panel-temporary-scores .temp-range-inputs input { padding-inline: 0.35rem; }
.temp-filter-range { min-width: 0; margin: 0; padding: 0; border: 0; color: #334155; font-size: 0.85rem; }
.temp-filter-range legend { padding: 0; margin-bottom: 0.25rem; }
.temp-range-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.35rem; }
.temp-range-inputs span { color: #64748b; }
.temp-filter-actions { display: flex; align-items: end; justify-content: flex-end; }
#tempScoreReset { min-height: 2.25rem; }
#tempScoreTable { width: 100%; min-width: 960px; table-layout: fixed; }
#tempScoreTable th, #tempScoreTable td { padding: 0.7rem 0.55rem; vertical-align: middle; overflow-wrap: anywhere; font-size: 0.84rem; }
#tempScoreTable th { background: #f1f5f9; color: #334155; text-align: left; }
#tempScoreTable th:nth-child(1) { width: 14%; }
#tempScoreTable th:nth-child(2) { width: 10%; }
#tempScoreTable th:nth-child(3) { width: 22%; }
#tempScoreTable th:nth-child(4) { width: 11%; }
#tempScoreTable th:nth-child(5) { width: 7.5%; }
#tempScoreTable th:nth-child(6), #tempScoreTable th:nth-child(7) { width: 8.5%; }
#tempScoreTable th:nth-child(8) { width: 11.5%; }
#tempScoreTable th:nth-child(9) { width: 7%; }
#tempScoreTable th:nth-child(8), #tempScoreTable td:nth-child(8) { padding-left: 1.35rem; }
#tempScoreTable .temp-number { font-variant-numeric: tabular-nums; text-align: right; }
.temp-warning-text { color: #92400e; }
.temp-error-text { color: #b91c1c; }
.temp-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; font-size: 0.85rem; }
#panel-temporary-scores .temp-pagination label { display: flex; align-items: center; }
#panel-temporary-scores .temp-pagination select { width: auto; }
.temp-detail-dialog { width: min(62rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 1.2rem; border: 1px solid #cbd5e1; border-radius: 8px; color: #111827; background: #fff; }
.temp-detail-dialog::backdrop { background: rgb(15 23 42 / 40%); }
.temp-detail-dialog p { overflow-wrap: anywhere; }
.temp-detail-chapter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.45rem 1rem; padding: 0.85rem 0; border-top: 1px solid #e2e8f0; }
.temp-detail-chapter strong { overflow-wrap: anywhere; }
.temp-detail-chapter p { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; color: #475569; }
.temp-detail-chapter p.temp-error-text { color: #b91c1c; }
.temp-detail-trace { margin: 0.65rem 0; padding: 0.75rem; border: 1px solid #d4dfe8; border-radius: 6px; background: #f8fafb; }
.temp-detail-trace > strong { display: block; color: #263b48; font-size: 0.9rem; }
.temp-detail-trace > p { margin: 0.35rem 0; color: #536579; font-size: 0.82rem; }
.temp-detail-trace-cell { grid-column: 1 / -1; min-width: 0; padding: 0.65rem 0; border-top: 1px solid #e2e8f0; }
.temp-detail-trace-cell > strong { display: block; color: #334155; font-size: 0.84rem; }
.temp-detail-trace-cell > p { margin: 0.25rem 0; color: #475569; font-size: 0.82rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.temp-detail-trace-cell ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.temp-detail-trace-cell li { margin: 0.2rem 0; font-size: 0.82rem; overflow-wrap: anywhere; }
.temp-trace-accepted { color: #116149; }
.temp-trace-final { color: #116149 !important; font-weight: 600; }
@media (max-width: 1100px) {
    .temp-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .temp-settings-grid > label:nth-child(3) { grid-column: 1 / -1; }
    .temp-settings-grid > .temp-settings-weight { grid-row: 3; }
}
@media (max-width: 600px) {
    .temp-source-actions { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0; align-items: center; }
    .temp-source-time { grid-column: 1 / -1; margin-left: 0; }
    .temp-record-toolbar { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
    .temp-record-actions { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr); gap: 0.4rem; }
    .temp-record-actions > button { padding-inline: 0.5rem; min-width: 0; }
    #tempScoreRefresh { width: 100%; }
    .temp-upload-form { grid-template-columns: minmax(0, 1fr); }
    .temp-settings-grid > label:nth-child(-n+2) { grid-column: 1 / -1; }
    .temp-settings-grid > .temp-settings-weight { grid-row: auto; }
    #tempScoreSettingsSummary { display: block; margin: 0.35rem 0 0; }
    .temp-statistics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .temp-statistics > div { padding: 0.6rem 0.7rem; }
    .temp-statistics > div + div { border-left: 0; }
    .temp-statistics > div:nth-child(even) { border-left: 1px solid var(--temp-border); }
    .temp-statistics > div:nth-child(n+3) { border-top: 1px solid var(--temp-border); }
    .temp-statistics .is-average { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
    #panel-temporary-scores button, #panel-temporary-scores .secondary-link-btn { min-height: 44px; }
    .temp-detail-dialog, .temp-import-dialog { padding: 0.8rem; }
}
