/* Subjects, rooms and timetables (5A.2) — navy glass, neon subject colours, phone-friendly day lists. */
.tt-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 8px var(--sc); vertical-align: middle; flex: none; }

/* weekly grid */
.tt-gridwrap { margin: 4px 0; }
.tt-grid { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; min-width: 640px; }
.tt-grid th { padding: 8px 6px; border-radius: 10px; background: rgba(47, 139, 255, .22); color: #dfe9ff; font: 700 13.5px var(--font-d); letter-spacing: .3px; text-transform: uppercase; }
.tt-grid th.today { background: linear-gradient(135deg, #1f6bff, #19d3ff); color: #fff; box-shadow: 0 0 14px rgba(25, 211, 255, .6); }
.tt-grid .tt-time { width: 78px; text-align: left; vertical-align: top; padding: 6px; color: #fff; }
.tt-grid td.tt-time b { display: block; font-size: 14px; }
.tt-grid td.tt-time small, .tt-grid td.tt-time span { display: block; color: #93a7da; font-size: 11.5px; }
.tt-break td:not(.tt-time) { text-align: center; padding: 6px; border-radius: 10px; color: #ffd36b; font-weight: 700; font-size: 13px; letter-spacing: .4px;
  background: repeating-linear-gradient(45deg, rgba(255, 194, 26, .12) 0 10px, rgba(255, 194, 26, .05) 10px 20px); border: 1px dashed rgba(255, 194, 26, .4); }
.tt-break.lunch td:not(.tt-time) { color: #7dffb0; background: repeating-linear-gradient(45deg, rgba(24, 201, 100, .14) 0 10px, rgba(24, 201, 100, .05) 10px 20px); border-color: rgba(60, 220, 130, .45); }
.tb-cell { vertical-align: top; height: 62px; padding: 3px; border-radius: 10px; background: rgba(6, 13, 43, .45); border: 1px solid rgba(120, 160, 255, .2); position: relative; transition: background .2s, border-color .2s; }
.tt-grid.edit .tb-cell { cursor: pointer; }
.tt-grid.edit .tb-cell.empty:hover, .tb-cell.over { border-color: var(--cyan); background: rgba(25, 211, 255, .14); box-shadow: inset 0 0 18px rgba(25, 211, 255, .25); }
.tb-plus { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(160, 200, 255, .35); font-size: 15px; }
.tb-cell:hover .tb-plus { color: var(--cyan); }
.tb-les { position: relative; display: grid; gap: 1px; padding: 6px 8px; border-radius: 9px; min-width: 0; color: #fff; font-size: 12.5px; line-height: 1.25;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 55%, #0b1850), color-mix(in srgb, var(--sc) 25%, #0b1850)); border: 1px solid color-mix(in srgb, var(--sc) 70%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--sc) 35%, transparent); animation: ttIn .35s ease; }
@keyframes ttIn { from { opacity: 0; transform: scale(.94); } }
.tt-grid.edit .tb-les { cursor: grab; }
.tb-les b { font: 800 13.5px var(--font-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-les span, .tb-les small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-les small { color: #d6e2ff; font-size: 11.5px; }
.tb-les.bad { border: 2px solid var(--red); box-shadow: 0 0 16px rgba(255, 54, 81, .7); animation: ttPulse 1.6s infinite; }
@keyframes ttPulse { 50% { box-shadow: 0 0 4px rgba(255, 54, 81, .4); } }
.tb-les.subbed { outline: 2px dashed var(--gold); outline-offset: -2px; }
.tb-les.dragging { opacity: .4; }
.tb-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; font-size: 11px; }
.tb-les:hover .tb-x, .tb-les:focus-within .tb-x { opacity: 1; }
.tb-x:hover { background: var(--red); }

/* day lists */
.tt-agenda { display: none; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tt-agenda.only { display: grid; }
.tt-day { padding: 10px; border-radius: 14px; background: rgba(6, 13, 43, .45); border: 1px solid rgba(120, 160, 255, .25); min-width: 0; }
.tt-day.today { border-color: var(--cyan); box-shadow: 0 0 18px rgba(25, 211, 255, .3); }
.tt-day h4 { margin: 0 0 8px; color: #fff; font: 800 16px var(--font-d); display: flex; gap: 6px; align-items: center; }
.tt-item { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; margin-bottom: 6px; background: color-mix(in srgb, var(--sc) 18%, rgba(6, 13, 43, .6)); border-left: 4px solid var(--sc); min-width: 0; }
.tt-item b { display: block; color: #fff; font-size: 14px; }
.tt-item small { color: #a9bbea; font-size: 12px; }
.tt-item > div { min-width: 0; }
.tt-item.subbed { outline: 2px dashed var(--gold); outline-offset: -2px; }
.tt-subnote { display: block; color: #ffd36b !important; font-weight: 700; }
.tt-when { font: 800 14px var(--font-d); color: #fff; min-width: 46px; }
.tt-when small { display: block; font: 500 11px var(--font); color: #93a7da; }
.tt-sum { color: #a9bbea; margin-bottom: 8px; font-size: 13.5px; }

/* exams & calendar */
.tt-exams { display: grid; gap: 8px; }
.tt-exam { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(6, 13, 43, .5); border-left: 4px solid var(--sc); }
.tt-exam b { color: #fff; display: block; }
.tt-exam small { color: #a9bbea; }
.tt-exam-d { width: 44px; text-align: center; border-radius: 10px; padding: 4px 0; background: linear-gradient(135deg, #ff8a1f, #ff3fa4); color: #fff; flex: none; }
.tt-exam-d b { font-size: 11px; text-transform: uppercase; }
.tt-exam-d span { display: block; font: 800 19px var(--font-d); }
.tt-cal li.past { opacity: .5; }
.tt-cal li.term > i { background: var(--purple); }
.tt-cal li.exam > i { background: var(--orange); }
.tt-cal li.event > i { background: var(--green); }

/* subjects */
.tt-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tt-subj { display: grid; gap: 6px; padding: 14px; border-radius: 16px; background: linear-gradient(150deg, color-mix(in srgb, var(--sc) 24%, transparent), rgba(6, 13, 43, .7)); border: 1px solid color-mix(in srgb, var(--sc) 55%, transparent); min-width: 0; transition: transform .2s, box-shadow .2s; }
.tt-subj:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--sc) 35%, transparent); }
.tt-subj.off { opacity: .5; }
.tt-subj-h { display: flex; gap: 10px; align-items: center; }
.tt-subj-h .tt-dot { width: 16px; height: 16px; }
.tt-subj-h b { display: block; color: #fff; font: 800 18px var(--font-d); }
.tt-subj-h small { color: #c6d6ff; }
.tt-subj p { margin: 0; color: #c6d6ff; font-size: 13px; }
.tt-lv { display: flex; flex-wrap: wrap; gap: 4px; }
.tt-lvpick { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tt-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.tt-colors input { display: none; }
.tt-colors span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--sc); cursor: pointer; border: 3px solid transparent; }
.tt-colors input:checked + span { border-color: #fff; box-shadow: 0 0 0 2px var(--sc), 0 0 12px var(--sc); }
.tt-cs select, .tt-cs input[type=number], .tt-addcs select, .tt-addcs input[type=number], .tt-av-row select, .tt-av-row input, .tt-subform select, .tt-subform input, .tt-exform select, .tt-exform input {
  padding: 7px 9px; border-radius: 9px; border: 1px solid rgba(120, 160, 255, .4); background: rgba(6, 13, 43, .6); color: #fff; font: inherit; font-size: 13.5px; min-width: 0; color-scheme: dark; }
.tt-cs input[type=number] { width: 70px; }
.tt-addcs, .tt-av-row, .tt-subform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.tt-addcs .check { color: #dfe9ff; }
.tt-av-row { margin-top: 6px; }
.tt-av-row .a-n { flex: 1; min-width: 140px; }
.tt-subform { margin: 0; }
.tt-exform { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.tt-exform label { display: grid; gap: 4px; color: #a9bbea; font-size: 12.5px; font-weight: 600; }
.tt-badrow td { background: rgba(255, 54, 81, .16) !important; }

/* timetable lists & builder */
.tt-tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tt-tcard { display: grid; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(6, 13, 43, .5); border: 1px solid rgba(120, 160, 255, .3); min-width: 0; }
.tt-tcard.none { border-style: dashed; }
.tt-tcard .sc-class-h b { color: #fff; }
.tt-tmeta { display: flex; gap: 5px; flex-wrap: wrap; }
.tt-bells { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: #dfe9ff; max-height: 220px; overflow: auto; }
.tt-bells li { display: flex; gap: 8px; padding: 3px 7px; border-radius: 7px; background: rgba(47, 139, 255, .14); }
.tt-bells li span { color: #9fdcff; font-weight: 700; min-width: 92px; }
.tt-bells li.break, .tt-bells li.assembly { background: rgba(255, 194, 26, .14); }
.tt-bells li.lunch { background: rgba(24, 201, 100, .16); }
.tb-top { margin-bottom: 12px; }
.tb-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 12px; align-items: start; }
.tb-pal { position: sticky; top: 86px; display: grid; gap: 7px; max-height: calc(100vh - 100px); overflow: auto; }
.tb-pal h4 { margin: 0; color: #fff; display: flex; gap: 8px; align-items: center; }
.tb-pal h4 i { color: var(--cyan); }
.tb-pal p { font-size: 12.5px; margin: 0 0 4px; }
.tb-pal select { width: 100%; padding: 7px 9px; border-radius: 9px; border: 1px solid rgba(120, 160, 255, .4); background: rgba(6, 13, 43, .6); color: #fff; font: inherit; font-size: 13px; }
.tb-pal .lbl { color: #a9bbea; font-size: 12.5px; font-weight: 600; }
.tb-subj { position: relative; display: grid; padding: 8px 46px 8px 10px; border-radius: 11px; cursor: grab; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 45%, #0b1850), rgba(6, 13, 43, .7)); border: 1px solid color-mix(in srgb, var(--sc) 65%, transparent); transition: transform .2s, box-shadow .2s; }
.tb-subj:hover { transform: translateX(3px); box-shadow: 0 0 16px color-mix(in srgb, var(--sc) 45%, transparent); }
.tb-subj b { font-size: 14px; }
.tb-subj small { color: #c6d6ff; font-size: 11.5px; }
.tb-left { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 800 13px var(--font-d); padding: 3px 7px; border-radius: 8px; background: rgba(0, 0, 0, .3); }
.tb-left.done { background: var(--green); }
.tb-left.over { background: var(--red); }
.tb-main { min-width: 0; padding: 10px; }
.tb-issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.tb-issues li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; }
.tb-issues li.error { background: rgba(255, 54, 81, .16); border: 1px solid rgba(255, 90, 110, .55); color: #ffd3da; }
.tb-issues li.warn { background: rgba(255, 194, 26, .1); border: 1px solid rgba(255, 194, 26, .4); color: #ffe7a6; }
.tb-issues li i { margin-top: 2px; }
.modal.tt-pv-modal { max-width: 1180px; width: calc(100vw - 32px); }
.tt-preview { background: radial-gradient(ellipse at top, #13256e, #060d2b 70%); border-radius: 14px; padding: 10px; max-height: 70vh; overflow: auto; }

/* bell schedule editor (light modal) */
.tt-days { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.tt-gen { margin: 8px 0 12px; padding: 10px 12px; border-radius: 12px; background: #f4f7ff; border: 1px solid #dbe3f4; }
.tt-gen summary { cursor: pointer; font-weight: 700; color: var(--purple); }
.tt-genrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; align-items: end; margin-top: 10px; }
.tt-genrow label { display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tt-genrow input, .tt-prow input, .tt-prow select { padding: 7px 9px; border-radius: 9px; border: 1px solid #c8d4ee; font: inherit; font-size: 14px; min-width: 0; }
.tt-prows { display: grid; gap: 6px; margin-bottom: 8px; }
.tt-prow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; }

@media (max-width: 860px) {
  .tb-body { grid-template-columns: minmax(0, 1fr); }
  .tb-pal { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tb-pal h4, .tb-pal p, .tb-pal .lbl, .tb-pal select, .tb-pal > a { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  /* Read-only timetables become day lists on phones; the builder keeps a scrollable grid. */
  .tt-gridwrap:has(+ .tt-agenda) { display: none; }
  .tt-agenda { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tt-prow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tt-prow .p-n { grid-column: 1 / -1; }
  .tt-cs select { max-width: 150px; }
}
@media print { .tb-x, .tb-plus { display: none; } }
