.lesson-timer-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lesson-timer-stages { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.lesson-timer-stage-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #dce5eb;
    border-radius: 6px;
    background: #fff;
}
.lesson-timer-stage-num { min-width: 22px; color: #71808c; font-weight: 600; }
.lesson-timer-stage-field-name { flex: 1 1 200px; min-width: 160px; }
.lesson-timer-stage-name {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #c4d1d9;
    border-radius: 4px;
    font-size: 14px;
}
.lesson-timer-stage-field-time { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.lesson-timer-stage-min-label,
.lesson-timer-stage-sec-label { color: #71808c; font-size: 13px; font-weight: normal; margin: 0; }
.lesson-timer-stage-min,
.lesson-timer-stage-sec {
    width: 64px;
    padding: 7px 8px;
    border: 1px solid #c4d1d9;
    border-radius: 4px;
    font-size: 14px;
}
.lesson-timer-stage-buttons { display: flex; gap: 4px; flex: 0 0 auto; margin-left: auto; }
.lesson-timer-stage-buttons button {
    width: 30px;
    height: 30px;
    line-height: 1;
    border: 1px solid #c4d1d9;
    border-radius: 4px;
    background: #fff;
    color: #465461;
    cursor: pointer;
}
.lesson-timer-stage-buttons button:disabled { opacity: .35; cursor: not-allowed; }
.lesson-timer-stage-del { color: #b42318; }

input[aria-invalid="true"],
.lesson-timer-stage-name[aria-invalid="true"] { border-color: #b42318; outline-color: #b42318; }

.lesson-timer-stage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.lesson-timer-secondary { background: #fff; color: #247da8; border: 1px solid #3c9ac7; }
.lesson-timer-danger { background: #fff; color: #b42318; border: 1px solid #d98a80; }

.lesson-timer-target-field { max-width: 360px; }
.lesson-timer-sum { margin: 6px 0 0; color: #465461; font-size: 13px; }
.lesson-timer-error { min-height: 18px; margin: 10px 0 0; color: #b42318; }

/* ---------- Run panel ---------- */

.lesson-timer-run {
    margin-top: 8px;
    padding: 20px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #f5f8fa;
}
.lesson-timer-status { min-height: 20px; margin: 0 0 14px; color: #247da8; font-weight: 600; }
.lesson-timer-display { text-align: center; padding: 10px 0 18px; }
.lesson-timer-current-label { margin: 0; color: #71808c; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.lesson-timer-current-name { margin: 4px 0 10px; color: #233445; font-size: 26px; word-break: break-word; }
.lesson-timer-time {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-size: 64px;
    line-height: 1.05;
    font-weight: 700;
    color: #16323f;
}
.lesson-timer-next { margin: 10px 0 0; color: #465461; }

.lesson-timer-progressbar {
    height: 10px;
    border-radius: 5px;
    background: #dce5eb;
    overflow: hidden;
    margin: 12px auto 0;
    max-width: 520px;
}
.lesson-timer-progressbar-fill {
    height: 100%;
    width: 0%;
    background: #3c9ac7;
    transition: width .2s linear;
}
.lesson-timer-overall { margin-top: 8px; text-align: center; }
.lesson-timer-overall-label { display: block; margin-bottom: 6px; color: #465461; font-size: 14px; }
.lesson-timer-overall-progress .lesson-timer-progressbar-fill { background: #2f8f5b; }

.lesson-timer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 18px;
    justify-content: center;
}
.lesson-timer-controls button:disabled { opacity: .5; cursor: not-allowed; }
.lesson-timer-sound-toggle { display: flex; align-items: center; gap: 6px; color: #233445; font-weight: normal; }
.lesson-timer-sound-toggle input { margin: 0; }

/* ---------- Projector mode ---------- */

body.lesson-timer-projector-active { overflow: hidden; }
.lesson-timer-run.lesson-timer-projector {
    position: fixed;
    inset: 0;
    z-index: 2000;
    margin: 0;
    border-radius: 0;
    border: 0;
    background: #0b1a24;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}
.lesson-timer-run.lesson-timer-projector .lesson-timer-status { color: #8fd0ec; text-align: center; }
.lesson-timer-run.lesson-timer-projector .lesson-timer-current-label { color: #8aa4b3; }
.lesson-timer-run.lesson-timer-projector .lesson-timer-current-name { color: #fff; font-size: clamp(28px, 6vw, 64px); }
.lesson-timer-run.lesson-timer-projector .lesson-timer-time { color: #fff; font-size: clamp(64px, 18vw, 220px); }
.lesson-timer-run.lesson-timer-projector .lesson-timer-next { color: #cfe3ec; font-size: clamp(16px, 2.4vw, 24px); }
.lesson-timer-run.lesson-timer-projector .lesson-timer-overall-label { color: #cfe3ec; }
.lesson-timer-run.lesson-timer-projector .lesson-timer-controls .front-tools-button,
.lesson-timer-run.lesson-timer-projector .lesson-timer-sound-toggle { color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .lesson-timer-progressbar-fill { transition: none; }
}

@media (max-width: 700px) {
    .lesson-timer-stage-row { flex-direction: column; align-items: stretch; }
    .lesson-timer-stage-field-name { flex: 0 0 auto; width: 100%; }
    .lesson-timer-stage-buttons { margin-left: 0; justify-content: flex-end; }
    .lesson-timer-time { font-size: 46px; }
    .lesson-timer-controls { justify-content: stretch; }
    .lesson-timer-controls > * { flex: 1 1 auto; }
}

@media (max-width: 400px) {
    .lesson-timer-time { font-size: 36px; }
    .lesson-timer-current-name { font-size: 20px; }
}

@media print {
    .lesson-timer-setup,
    .lesson-timer-run,
    .lesson-timer-explanation { display: none !important; }
}
