/* Revision timetable maker */
.tt-hero { padding-bottom: 90px; }
.tt-section { padding-top: 50px; }
.tt-layout { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
.tt-side { display: grid; gap: 18px; position: sticky; top: 72px; }
.tt-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; box-shadow: var(--shadow-sm); }
.tt-h { font-size: 20px; margin-bottom: 8px; }
.tt-hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.tt-subjects { list-style: none; display: grid; gap: 8px; }
.tt-subjects li { display: flex; align-items: center; gap: 6px; }
.tt-chip { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--c); color: #fff; font-weight: 700; font-size: 14px; cursor: grab; touch-action: none; user-select: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); transition: transform .25s var(--ease), box-shadow .25s; text-align: left; }
.tt-chip::before { content: ""; width: 10px; height: 14px; flex-shrink: 0; opacity: .7; background: radial-gradient(circle, #fff 1.2px, transparent 1.6px) 0 0 / 5px 5px; }
.tt-chip:hover { transform: translateX(3px); }
.tt-chip[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--cream-2), 0 0 0 6px var(--c); transform: translateX(3px); }
.tt-del { width: 32px; height: 32px; border-radius: 10px; color: var(--muted); font-size: 18px; line-height: 1; transition: background .2s, color .2s; }
.tt-del:hover { background: #f6e3e1; color: #9b3427; }
.tt-add { display: flex; gap: 8px; margin-top: 14px; }
.tt-add input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); font: 600 14px Montserrat; color: var(--navy); }
.tt-add input:focus { outline: none; border-color: var(--gold); }
.tt-totals { list-style: none; display: grid; gap: 10px; }
.tt-totals li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; font-weight: 700; }
.tt-totals .bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--cream); overflow: hidden; }
.tt-totals .bar i { display: block; height: 100%; background: var(--c); border-radius: 4px; transition: width .5s var(--ease); }
.tt-total-line { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.tt-total-line b { color: var(--navy); }
.tt-settings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tt-settings label { display: grid; gap: 4px; font: 700 11px/1 Montserrat; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tt-settings select { padding: 8px 6px; border-radius: 10px; border: 1.5px solid var(--line); font: 600 13px Montserrat; color: var(--navy); background: #fff; }
.tt-check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; font-weight: 600; }
.tt-check input { width: 18px; height: 18px; accent-color: var(--navy); }

.tt-main { min-width: 0; }
.tt-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tt-title { font: 700 clamp(24px, 3vw, 34px)/1.2 Poppins, Montserrat, sans-serif; color: var(--navy); border: 0; background: transparent; border-bottom: 2px dashed transparent; padding: 2px 0; min-width: 0; flex: 1; }
.tt-title:hover, .tt-title:focus { outline: none; border-bottom-color: var(--gold); }
.tt-actions { display: flex; gap: 8px; }
.tt-actions .btn-ghost { color: var(--navy); }
.tt-brush { min-height: 22px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.tt-brush b { color: var(--navy); }
.tt-scroll { overflow-x: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.tt-grid { display: grid; min-width: 640px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tt-grid .hd { position: sticky; top: 0; z-index: 1; padding: 12px 6px; background: var(--navy); color: var(--cream); font: 700 12.5px/1 Montserrat; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.tt-grid .hd.today { background: var(--gold); color: var(--navy); }
.tt-grid .tm { padding: 6px 10px; font: 700 12px/1 Montserrat; color: var(--muted); border-top: 1px solid var(--line); background: var(--cream-2); display: flex; align-items: flex-start; justify-content: flex-end; }
.tt-cell { position: relative; min-height: 46px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); padding: 4px; transition: background .2s; }
.tt-cell:hover { background: rgba(201,162,39,.08); }
.tt-cell.over { background: rgba(201,162,39,.22); box-shadow: inset 0 0 0 2px var(--gold); }
.tt-block { height: 100%; min-height: 36px; border-radius: 9px; background: var(--c); color: #fff; font-weight: 700; font-size: 12.5px; line-height: 1.2; padding: 8px 9px; display: flex; align-items: center; cursor: grab; touch-action: none; user-select: none; animation: pop .35s var(--ease); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); overflow: hidden; word-break: break-word; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.tt-tip { margin-top: 22px; text-align: center; font-size: 15px; font-weight: 600; line-height: 1.75; color: var(--muted); }
.tt-tip span { display: block; text-wrap: balance; }

.tt-ghost { position: fixed; z-index: 200; left: 0; top: 0; pointer-events: none; padding: 10px 16px; border-radius: 12px; background: var(--c); color: #fff; font: 700 14px Montserrat; box-shadow: 0 20px 40px -12px rgba(0,0,0,.45); transform: translate(-50%, -50%) rotate(-4deg) scale(1.05); }
body.tt-dragging, body.tt-dragging * { cursor: grabbing !important; }

@media (max-width: 1000px) {
  /* subjects first, then the grid, then hours and settings */
  .tt-layout { display: flex; flex-direction: column; gap: 18px; }
  .tt-side { display: contents; }
  .tt-side .tt-box:nth-child(1) { order: 1; }
  .tt-main { order: 2; }
  .tt-side .tt-box:nth-child(2) { order: 3; }
  .tt-side .tt-box:nth-child(3) { order: 4; }
  .tt-subjects { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tt-chip { padding: 9px 12px; font-size: 13.5px; }
}
@media (max-width: 640px) {
  .tt-side { grid-template-columns: 1fr; }
  .tt-title { flex-basis: 100%; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .site-header, .menubar, .wa-float, .progress, .cursor-glow, .page-hero, .tt-side, .tt-actions, .tt-brush, .tt-tip, .site-footer { display: none !important; }
  .tt-section { padding: 0 !important; }
  .tt-layout { display: block; }
  .tt-scroll { overflow: visible; box-shadow: none; }
  .tt-grid { min-width: 0; }
  .tt-grid .hd, .tt-block { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tt-cell { min-height: 30px; }
}

/* school hours: greyed out until the student unlocks a slot */
.tt-settings .wide { grid-column: 1 / -1; margin-top: 4px; }
.tt-cell.locked { display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: #a3adb6; background: repeating-linear-gradient(-45deg, #eceef0 0 8px, #e3e6e9 8px 16px); font: 700 11px/1 Montserrat; letter-spacing: .08em; text-transform: uppercase; }
.tt-cell.locked svg { width: 15px; height: 15px; }
.tt-cell.locked span { display: none; }
.tt-cell.locked:hover { background: repeating-linear-gradient(-45deg, #e3e6e9 0 8px, #d9dde1 8px 16px); color: var(--navy); }
.tt-cell.locked:hover span { display: inline; }
.tt-relock { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: #a3adb6; opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.tt-relock svg { width: 13px; height: 13px; }
.tt-cell:hover .tt-relock, .tt-relock:focus-visible { opacity: 1; }
.tt-relock:hover { background: #eceef0; color: var(--navy); }
@media (hover: none) { .tt-relock { opacity: .7; } }
@media print { .tt-cell.locked { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .tt-cell.locked svg, .tt-relock { display: none; } }

/* gold arrow from the word "Settings" in the note to the Settings box */
.tt-layout { position: relative; }
.tt-settings-link { color: var(--navy); font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tt-arrow { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; color: var(--gold); z-index: 2; }
.tt-arrow path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 7; }
.tt-arrow marker path { stroke-dasharray: none; }
#settings-box { transition: box-shadow .4s, border-color .4s; }
#settings-box.flash { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201,162,39,.35), var(--shadow-sm); }
@media (max-width: 1000px) { .tt-arrow { display: none; } }
@media print { .tt-arrow { display: none; } }
