/* Scoped to the Details surface; data tables never widen the page. */
#details { min-width: 0; }
#details [hidden] { display: none !important; }
.details-summary { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; }
.details-tabs { display: flex; gap: .25rem; padding: .3rem; margin: 1rem 0 1.25rem; background: #f5f5f4; border: 1px solid #e7e5e4; border-radius: .8rem; }
.details-tabs button { flex: 1; min-width: 0; padding: .7rem .4rem; border-radius: .55rem; font-size: .8rem; font-weight: 600; color: #57534e; }
.details-tabs [aria-selected="true"] { background: white; color: #9a3412; box-shadow: 0 1px 4px #00000014; }
#details :focus-visible { outline: 3px solid #c2410c; outline-offset: 3px; }
#details [role="tabpanel"] { min-width: 0; overflow-wrap: anywhere; }
#details [role="tabpanel"] > :first-child { margin-top: 0; }
.details-note { font-size: .8rem; color: #57534e; line-height: 1.65; margin: .5rem 0 1rem; overflow-wrap: anywhere; }
.details-status { font-size: .8rem; color: #9a3412; min-height: 1.3em; }
.details-section { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid #e7e5e4; min-width: 0; }
.details-heading { font-size: .95rem; font-weight: 650; color: #292524; margin: .5rem 0; }
.details-unavailable { padding: .8rem 1rem; background: #fafaf9; border: 1px dashed #d6d3d1; border-radius: .6rem; font-size: .8rem; color: #57534e; }
.details-scroll { max-width: 100%; overflow: auto; overscroll-behavior-x: contain; border: 1px solid #e7e5e4; border-radius: .65rem; margin: .75rem 0; }
.details-table-scroll { max-height: 28rem; }
.details-table-scroll thead th { position: sticky; top: 0; z-index: 1; }
.details-table { border-collapse: collapse; width: 100%; font-size: .75rem; text-align: left; font-variant-numeric: tabular-nums; }
.details-table caption { text-align: left; padding: .7rem; color: #57534e; }
.details-table th { background: #f5f5f4; color: #44403c; font-weight: 600; }
.details-table th, .details-table td { padding: .6rem .7rem; border-bottom: 1px solid #e7e5e4; vertical-align: top; min-width: 4rem; max-width: 18rem; overflow-wrap: anywhere; }
.details-table tr:last-child td { border-bottom: 0; }
.details-table tbody tr:hover { background: #fafaf9; }
.details-heatmap td { text-align: center; min-width: 2.5rem; color: #292524; }
.details-heatmap th { min-width: 2.5rem; }
.details-heatmap tbody th { position: sticky; left: 0; z-index: 1; }
.details-heatmap thead th:first-child { left: 0; z-index: 2; }
.details-button { padding: .4rem .7rem; border: 1px solid #d6d3d1; border-radius: .5rem; color: #9a3412; background: white; font-size: .8rem; font-weight: 500; }
.details-button:hover:not(:disabled) { background: #fff7ed; border-color: #c2410c; }
.details-button:disabled { color: #78716c; cursor: not-allowed; border-style: dashed; }
.details-timeline { display: flex; align-items: stretch; gap: .4rem; padding: .7rem; min-width: 100%; width: max-content; }
.details-segment { flex: 0 0 auto; min-width: 6rem; max-width: 15rem; text-align: left; white-space: normal; }
.details-segment small { display: block; margin-top: .25rem; color: #57534e; }
.details-segment[data-operation="substitution"], .details-segment[data-operation="insertion"] { border-color: #fca5a5; background: #fff7f7; color: #991b1b; }
.details-segment[data-operation="deletion"] { border-style: dashed; }
.details-component { padding: .7rem 0; }
.details-component-label { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; font-weight: 500; }
.details-meter { display: block; width: 100%; height: .55rem; margin-top: .4rem; accent-color: #c2410c; border-radius: 1rem; }
.details-confidence { min-width: 7rem; font-variant-numeric: tabular-nums; }
.details-waveform { width: 100%; height: 150px; background: #fafaf9; border: 1px solid #e7e5e4; border-radius: .65rem; }
.details-quality { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.details-quality > div { padding: .65rem; border-radius: .6rem; background: #f5f5f4; font-size: .8rem; overflow-wrap: anywhere; }
.details-quality dt { color: #57534e; font-size: .7rem; }
.details-quality dd { font-weight: 600; margin-top: .25rem; }
.details-chart { position: relative; height: 260px; margin: .75rem 0; }
.details-chart-scroll { padding: .5rem; }
.details-chart-scroll .details-chart { margin: 0; }
.details-status:empty { display: none; }
.details-traces > div { min-width: 0; }
.details-provenance { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .72rem; padding: .75rem; background: #fafaf9; border-radius: .6rem; }
.details-data summary { cursor: pointer; font-size: .8rem; text-decoration: underline; color: #57534e; }
.details-calculation { margin-top: .5rem; }
.details-calculation .details-note { margin-bottom: .5rem; }
.details-calculation .details-scroll { margin-bottom: .5rem; }
@media (max-width: 480px) {
    .details-tabs button { font-size: .72rem; padding: .65rem .2rem; }
    .details-quality { grid-template-columns: 1fr; }
    .details-table th, .details-table td { padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    #details * { scroll-behavior: auto !important; }
}
