.editor { overflow: hidden; container-type: inline-size; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; padding: 12px 18px; }
.editor-caption { min-width: 0; overflow-wrap: anywhere; }
.editor-caption h2 { font-size: 21px; }
.editor-caption p, .editor-hint { color: var(--muted); font-size: 13px; line-height: 1.35; }
.editor-caption p { font-variant-numeric: tabular-nums; }
.preview-button { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 7px; padding: 7px 12px; min-height: 36px; border: 1px solid #b6c7bd; border-radius: 7px; background: #fff; color: var(--accent); font-size: 14px; font-weight: 600; }
.preview-button .icon { width: 16px; height: 16px; }
.preview-button:hover:enabled { background: #f1f7f2; border-color: var(--accent); }
.preview-button:disabled { opacity: .5; }
#week-navigation { display: flex; align-items: end; flex-wrap: wrap; gap: 7px; padding: 0 16px 12px; }
#week-navigation label { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
#week-navigation label:last-of-type { margin-left: 8px; }
#week-navigation select, #week-navigation button { height: 34px; border: 1px solid #b6c7bd; border-radius: 6px; color: var(--ink); background: #fff; }
#week-navigation select { width: 100%; min-width: 0; padding: 0 6px; font: inherit; font-size: 14px; }
#week-navigation select:focus-visible { outline: 3px solid #358875; outline-offset: 2px; }
#week-navigation button { width: 34px; color: var(--accent); font: 22px/1 Georgia, serif; }
#week-navigation #cancel-move { width: auto; padding: 0 9px; font: inherit; font-size: 14px; }
/* Сохраняем высоту панели, когда перенос начинается под указателем. */
#week-navigation #cancel-move[hidden] { display: block !important; visibility: hidden; }
#week-navigation button:hover:enabled { background: #f1f7f2; border-color: var(--accent); }
#week-navigation button:disabled { opacity: .4; }
@container (max-width: 560px) {
  #week-navigation { display: grid; grid-template-columns: 34px repeat(2, minmax(0, 1fr)) 34px; padding-inline: 12px; }
  #week-navigation label:first-of-type { grid-column: 2 / 4; }
  #week-navigation label:last-of-type { grid-column: 1 / 3; margin: 0; }
  #week-navigation #cancel-move { grid-column: 3 / 5; justify-self: end; }
}
.stage { min-width: 0; border-block: 1px solid var(--line); }
.placeholder { padding: 36px 16px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.sheet { width: 100%; overflow: auto; max-height: clamp(280px, 60vh, 700px); isolation: isolate; scroll-padding: 42px 4px 4px 95px; scrollbar-gutter: stable; }
.editor-table { table-layout: fixed; width: 100%; border-spacing: 0; font-variant-numeric: tabular-nums; }
.time-column { width: 92px; }
.editor-table th, .editor-table td { border-right: 1px solid #dfe6df; border-bottom: 1px solid #e3e9e2; }
.editor-table tr > :last-child { border-right: 0; }
.editor-table thead th { position: sticky; top: 0; z-index: 2; height: 39px; padding: 6px; background: #f6f8f5; color: #244f40; font-size: 15px; }
.week-parity { display: inline-block; margin-left: 5px; color: #566d5f; font-size: 12px; font-weight: normal; }
.editor-table .editor-axis { position: sticky; left: 0; z-index: 1; }
.editor-table thead .editor-axis { z-index: 3; }
.editor-day th { text-align: center; background: #e8efe8; color: #345144; font-weight: 600; font-size: 13px; padding: 5px 2px; }
.editor-day .editor-axis { font-size: 12px; }
.editor-time { padding: 2px 3px; background: #f7f9f6; color: #455c4e; font-size: 12px; font-weight: normal; }
.editor-time span { margin-left: 3px; color: #617368; }
.editor-time span::before { content: '–'; }
.editor-table td { height: 30px; padding: 1px 2px; background: white; }
.editor-table td:nth-child(odd) { background: #fafcfa; }
.editor-slot { display: block; width: 100%; height: 100%; min-height: 26px; padding: 3px 5px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); font-size: 13px; line-height: 1.2; overflow-wrap: anywhere; }
.editor-slot:focus-visible { outline-offset: -2px; }
.editor-slot.is-free { cursor: default; }
.editor-table td.has-lab-tail { position: relative; }
.editor-slot.lab-tail { position: absolute; inset-inline: 2px; bottom: 1px; width: auto; height: auto; min-height: 0; padding: 0; border-top: 1px dashed #779b81; opacity: .72; }
.editor-slot.is-lesson { background-color: color-mix(in srgb, var(--lesson-color), white 78%); border-left: 3px solid color-mix(in srgb, var(--lesson-color), #485448 24%); }
.editor-slot[data-lesson-id] { cursor: grab; touch-action: none; }
.editor-slot[data-lesson-id]:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.editor-slot.is-conflict { color: #883b2e; background: repeating-linear-gradient(-45deg,#f8e4df 0 6px,#fcefea 6px 12px); border-left: 3px solid #b4614a; font-weight: bold; }
.editor-slot:not(.is-free):not([data-lesson-id]) { cursor: default; }
.is-selecting .editor-slot.is-free:not(.is-unavailable) { background: #e7f4e9; cursor: pointer; }
.is-selecting .editor-slot.is-unavailable { cursor: not-allowed; }
.is-selecting .editor-slot[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.is-selecting .editor-slot.is-free:not(.is-unavailable):hover, .editor-slot.is-free.is-target:not(.is-unavailable) { background: #c3e6ce; box-shadow: inset 0 0 0 2px var(--accent); }
.is-selecting .editor-slot.is-target:not(.is-free):not([aria-pressed="true"]), .editor-slot.is-target.is-unavailable { box-shadow: inset 0 0 0 2px #a74331; }
.drag-lesson { position: fixed; z-index: 10; pointer-events: none; padding: 6px 9px; max-width: min(250px, 75vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; border: 1px solid var(--accent); background: #f7fff9; color: var(--ink); box-shadow: 0 2px 8px #1d382730; font-size: 13px; }
.editor-hint { margin: 8px 16px 0; }
.diagnostics { padding: 12px 16px 14px; }
.diagnostics label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; }
.diagnostics textarea { display: block; width: 100%; resize: vertical; min-height: 46px; max-height: 220px; padding: 7px 9px; background: #f7f9f6; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; line-height: 1.3; }
.diagnostics textarea[data-has-issues="true"] { border-color: #c9a795; background: #fcf4ed; color: #753b2a; }
@media (max-width: 680px) {
  .editor-head { min-height: 60px; padding: 8px 12px; }
  .editor-caption h2 { font-size: 18px; }
  .editor-hint { margin-inline: 12px; }
  .diagnostics { padding: 10px 12px 12px; }
  .sheet { max-height: min(54vh, 460px); }
}
