/* School timetable generator. Complements styles.css and maram-tools-kit.css. */
.tt-hero-visual { display: flex; flex-direction: column; gap: 18px; }
.tt-mini { position: relative; z-index: 1; margin-top: 8px; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.tt-mini-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.tt-mini-head b { color: var(--ink); font-size: 1.05rem; }
.tt-mini-head span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.tt-mini-grid { display: grid; grid-template-columns: 38px repeat(3, 1fr) 10px repeat(2, 1fr); gap: 6px; }
.tt-mini-grid i { font-style: normal; font-size: .72rem; font-weight: 850; color: var(--muted); align-self: center; }
.tt-mini-grid s { text-decoration: none; padding: 9px 4px; border-radius: 9px; font-size: .72rem; font-weight: 800; text-align: center; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-mini-grid em { background: repeating-linear-gradient(180deg, #06111f 0 6px, #0b1f3a 6px 12px); border-radius: 4px; }
.tt-mini .c1 { background: #e0efff; } .tt-mini .c2 { background: #fde7d9; } .tt-mini .c3 { background: #dcf5e8; } .tt-mini .c4 { background: #efe4ff; } .tt-mini .c5 { background: #fff3c4; } .tt-mini .c6 { background: #ffe0ea; } .tt-mini .c7 { background: #d8f3f8; } .tt-mini .c8 { background: #e6f4d7; } .tt-mini .c9 { background: #fbe3f6; }
.tt-mini-card { position: relative; z-index: 1; align-self: flex-end; padding: 16px 18px; border-radius: 16px; background: rgba(6,17,31,.72); border: 1px solid rgba(255,255,255,.16); color: #fff; }
.tt-mini-card strong { display: block; } .tt-mini-card span { color: rgba(255,255,255,.7); font-size: .86rem; }

.tt-days { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 16px 0 16px; }
.tt-days legend { font-size: .84rem; font-weight: 850; color: #334155; margin-bottom: 8px; padding: 0; }
.tt-days label { cursor: pointer; }
.tt-days input { position: absolute; opacity: 0; pointer-events: none; }
.tt-days span { display: inline-flex; min-width: 62px; justify-content: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft); font-weight: 800; color: var(--muted); transition: all .15s ease; }
.tt-days input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(10,102,194,.22); }
.tt-days input:focus-visible + span { box-shadow: 0 0 0 4px rgba(10,102,194,.25); }
.tt-subhead { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 10px; }
.tt-subhead strong { color: #334155; font-size: .9rem; }
.tt-rows { display: grid; gap: 10px; }
.tt-row { display: grid; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--soft); }
.tt-row-breaks { grid-template-columns: minmax(0,1.4fr) 140px 120px 40px; }
.tt-row-subjects { grid-template-columns: minmax(0,1.2fr) 130px minmax(0,1.3fr) 40px; }
.tt-row-teachers { grid-template-columns: minmax(0,1fr) minmax(0,1.3fr) minmax(0,1.1fr) 96px 40px; }
.tt-cell { display: grid; gap: 5px; min-width: 0; }
.tt-cell span { font-size: .74rem; font-weight: 800; color: var(--muted); }
.tt-cell input { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px 11px; color: var(--text); min-width: 0; }
.tt-cell input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,102,194,.12); }
.tt-del { width: 40px; height: 42px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.tt-del:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.tt-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: -4px; font-size: .86rem; font-weight: 700; color: var(--muted); }
.tt-quick input { width: 64px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-left: 4px; }
.tt-quick input[type="text"] { width: 90px; }
.tt-load { margin: 0; font-size: .86rem; font-weight: 700; color: var(--muted); }
.tt-load.is-bad { color: #b91c1c; }
.tt-gen-row { margin-top: 26px; }

.tt-result { margin-top: 28px; }
.tt-result-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 14px; }
.tt-result-head h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin-top: 10px; }
.tt-sub { margin-top: 6px; font-weight: 650; }
.tt-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 850; letter-spacing: .04em; }
.tt-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tt-status.is-good { background: #dcfce7; color: #15803d; }
.tt-status.is-warn { background: #fef3c7; color: #a16207; }
.tt-status.is-bad { background: #fee2e2; color: #b91c1c; }
.tt-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tt-who { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 850; color: #334155; }
.tt-who select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-weight: 750; min-width: 150px; }
.tt-edit-hint { margin: 0 0 12px; font-size: .88rem; padding: 10px 14px; border-radius: 12px; background: #f0f7ff; color: #1e3a5f; }
.tt-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 860px; table-layout: fixed; }
.tt-table th, .tt-table td { padding: 5px; border-bottom: 1px solid var(--border); text-align: center; vertical-align: middle; }
.tt-table thead th { background: var(--soft); padding: 10px 4px; font-size: .78rem; color: var(--muted); font-weight: 800; }
.tt-table thead th b { display: block; color: var(--ink); font-size: .92rem; }
.tt-table thead th small { display: block; font-weight: 650; font-size: .72rem; }
.tt-table .tt-dayh { width: 112px; text-align: left; padding-left: 14px; }
.tt-table .tt-day { text-align: left; padding-left: 14px; color: var(--ink); font-weight: 850; font-size: .9rem; position: sticky; left: 0; background: #fff; z-index: 1; }
.tt-day-short { display: none; }
.tt-table tr:last-child th, .tt-table tr:last-child td { border-bottom: 0; }
.tt-brk-h { width: 34px; }
.tt-brk-h span { display: none; }
.tt-brk { width: 34px; background: linear-gradient(180deg, var(--ink), var(--deep)); border-bottom: 0 !important; }
.tt-brk span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.tt-slot { display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 62px; padding: 8px 6px; border: 0; border-radius: 12px; background: transparent; font: inherit; cursor: default; color: var(--ink); }
button.tt-slot { cursor: grab; }
.tt-lesson .tt-slot { background: var(--c); box-shadow: inset 4px 0 0 var(--k); }
.tt-slot b { font-size: .84rem; font-weight: 850; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.tt-slot small { margin-top: 3px; font-size: .72rem; font-weight: 700; color: var(--k, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-free .tt-slot { border: 1.5px dashed var(--border); color: #94a3b8; font-weight: 700; font-size: .8rem; }
.tt-none { color: #cbd5e1; background: repeating-linear-gradient(45deg, #f8fafc 0 6px, #f1f5f9 6px 12px); }
td.is-selected .tt-slot { outline: 3px solid var(--blue); outline-offset: 1px; box-shadow: 0 0 0 6px rgba(10,102,194,.15); }
td.is-dragging .tt-slot { opacity: .45; }
td.is-over .tt-slot { outline: 3px dashed var(--cyan); outline-offset: 1px; }
button.tt-slot:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.tt-meta { margin-top: 12px; font-size: .88rem; font-weight: 650; }
.tt-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tt-legend span { padding: 5px 10px; border-radius: 999px; background: var(--c); color: var(--k); font-size: .76rem; font-weight: 800; }
.tt-export { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tt-export strong { color: var(--ink); margin-right: 6px; }
.tt-export-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  .tt-row-teachers { grid-template-columns: 1fr 1fr; }
  .tt-row-teachers .tt-del { grid-column: 2; justify-self: end; }
}
@media (max-width: 720px) {
  .tt-row-breaks, .tt-row-subjects { grid-template-columns: 1fr 1fr; }
  .tt-row-breaks .tt-cell-label, .tt-row-subjects .tt-cell-name, .tt-row-subjects .tt-cell-classes { grid-column: 1 / -1; }
  .tt-row .tt-del { grid-column: 2; justify-self: end; }
  .tt-row-teachers .tt-cell-name, .tt-row-teachers .tt-cell-subjects, .tt-row-teachers .tt-cell-classes { grid-column: 1 / -1; }
  .tt-day-grid { grid-template-columns: 1fr 1fr !important; }
  .tt-table { min-width: 940px; }
  .tt-slot b { font-size: .74rem; letter-spacing: -.01em; }
  .tt-table .tt-dayh, .tt-table .tt-day { width: 52px; padding-left: 8px; }
  .tt-day-full { display: none; } .tt-day-short { display: inline; }
  .tt-controls { width: 100%; }
  .tt-who { flex: 1; } .tt-who select { flex: 1; min-width: 0; }
  .tt-export-btns .btn { flex: 1 1 45%; }
}
@media print {
  body * { visibility: hidden !important; }
  .tt-print-area, .tt-print-area *, #tt-title, #tt-sub { visibility: visible !important; }
  .tt-print-area { position: absolute; left: 0; top: 30mm; width: 100%; border: 0; overflow: visible; }
  #tt-title { position: absolute; left: 0; top: 0; font-size: 20pt; }
  #tt-sub { position: absolute; left: 0; top: 12mm; }
  .tt-table { min-width: 0; }
  .tt-day { position: static; }
  @page { size: A4 landscape; margin: 10mm; }
}
