.teacher-analysis-workspace {
    --analysis-text: #142641;
    --analysis-muted: #435873;
    --analysis-blue: #2054a6;
    --analysis-line: #d6e1ef;
    display: grid;
    gap: 12px;
    min-width: 0;
    color: var(--analysis-text);
    padding: clamp(12px, 2vw, 20px);
}

.teacher-analysis-toolbar, .teacher-analysis-panel-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    column-gap: 12px;
    row-gap: 8px;
}

.teacher-analysis-workspace h3, .teacher-analysis-panel-title h4,
.teacher-analysis-draft h5, .teacher-analysis-workspace p { margin: 0; }
.teacher-analysis-panel-title h4 { font-size: 1.08rem; }
.teacher-analysis-panel-title > span {
    color: #244c82;
    background: #eaf2fe;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: .8rem;
    font-weight: 650;
}
.teacher-analysis-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.teacher-analysis-workspace .teacher-analysis-switch button,
.teacher-analysis-workspace button.teacher-analysis-secondary {
    border: 1px solid var(--analysis-line);
    background: #fff;
    color: var(--analysis-blue);
    box-shadow: none;
}
.teacher-analysis-workspace .teacher-analysis-switch button[aria-pressed="true"] {
    border-color: #a4bce5;
    background: #eaf2ff;
    color: #143c7a;
    font-weight: 750;
}
.teacher-analysis-workspace button:focus-visible,
.teacher-analysis-workspace summary:focus-visible,
.teacher-analysis-workspace a:focus-visible {
    outline: 2px solid #2054a6;
    outline-offset: 2px;
}
.teacher-analysis-status {
    padding: 12px 15px;
    border: 1px solid var(--analysis-line);
    border-left: 4px solid #456fae;
    border-radius: 9px;
    background: #f4f8fe;
}
.teacher-analysis-status[data-state="paused"] { border-left-color: #a06b24; background: #fff9ef; }
.teacher-analysis-status p,
.teacher-analysis-workspace .teacher-analysis-muted { color: var(--analysis-muted); font-size: .89rem; margin-top: 4px; }
.teacher-analysis-panel, .teacher-analysis-draft {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--analysis-line, #d6e1ef);
    border-radius: 11px;
    background: #fff;
}
.teacher-analysis-draft h4, .teacher-analysis-draft h5 { color: #142641; margin: 0; }
.teacher-analysis-draft > p { margin: 0; }
.teacher-analysis-metrics, .teacher-analysis-feedback-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 10px;
    margin: 0;
}
.teacher-analysis-metric {
    padding: 10px 12px;
    background: #f4f7fb;
    border-radius: 8px;
}
.teacher-analysis-metric dt, .teacher-analysis-metric small { color: var(--analysis-muted); font-size: .82rem; }
.teacher-analysis-metric dd { color: var(--analysis-blue); font-size: 1.16rem; margin: 3px 0 0; font-weight: 750; }
.teacher-analysis-metric small { display: block; margin-top: 2px; font-weight: 500; }
.teacher-analysis-sample { color: var(--analysis-muted); font-size: .88rem; }
.teacher-analysis-expand {
    min-width: 0;
    border-top: 1px solid var(--analysis-line, #d6e1ef);
    padding: 0 2px;
}
.teacher-analysis-expand summary { padding: 7px 0; min-height: 39px; }
.teacher-analysis-expand > p { margin: 4px 0; }
.teacher-analysis-table { overflow-x: auto; }
.teacher-analysis-table table { text-align: left; border-collapse: collapse; width: 100%; }
.teacher-analysis-table th, .teacher-analysis-table td { padding: 5px 7px; border-bottom: 1px solid var(--analysis-line); }
.teacher-analysis-next, .teacher-analysis-form {
    margin: 0;
    border: 1px solid var(--analysis-line);
    padding: 0 12px;
    border-radius: 9px;
}
.teacher-analysis-next[open], .teacher-analysis-form { padding-bottom: 12px; }
.teacher-analysis-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.teacher-analysis-workspace .teacher-analysis-student,
.teacher-analysis-workspace .teacher-analysis-fields label,
.teacher-analysis-workspace .teacher-analysis-form label { display: grid; gap: 5px; align-items: start; margin: 4px 0; min-width: 0; }
.teacher-analysis-student { max-width: 420px; }
.teacher-analysis-workspace .teacher-analysis-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.teacher-analysis-workspace .teacher-analysis-form .teacher-analysis-check { display: flex; align-items: center; gap: 8px; }
.teacher-analysis-workspace .teacher-analysis-check input { width: auto; min-height: 0; margin: 0; }
.teacher-analysis-form textarea, .teacher-analysis-form input:not([type="checkbox"]) { width: 100%; }
.teacher-analysis-form button, .teacher-analysis-saved > button { margin-top: 8px; }
.teacher-analysis-claims, .teacher-analysis-next-draft {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f3f7fd;
}
.teacher-analysis-next-draft { border: 1px solid #d1e2db; background: #f1f8f4; }
.teacher-analysis-next-draft .teacher-analysis-claims { background: transparent; margin-top: 4px; }
.teacher-analysis-claims ul, .teacher-analysis-expand ul { padding-left: 20px; margin: 5px 0; }
.teacher-analysis-claims li + li { margin-top: 6px; }
.teacher-analysis-claims p { margin: 0; }
.teacher-analysis-claims summary { color: #244c82; padding: 4px 0; }
.teacher-analysis-text, .teacher-analysis-warning { white-space: pre-wrap; overflow-wrap: anywhere; }
.teacher-analysis-warning, .teacher-analysis-notice, .teacher-analysis-retry {
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff5e9;
}
.teacher-analysis-notice { background: #eaf6ef; }

@media (max-width: 540px) {
    .teacher-analysis-workspace { padding-inline: 7px; }
    .teacher-analysis-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .teacher-analysis-metric:last-child { grid-column: 1 / -1; }
}
