/* Timetables view for everyone (Owen, 11 September 2026, revised the same night): three tiles with their own
   dropdowns, Day / Week / Month, and a week grid that fills the screen without scrolling wherever it can.
   Every box is one click target. */
#main:has(.ttv){padding-top:12px;padding-bottom:12px}
.ttv{display:flex;flex-direction:column;min-height:calc(100dvh - var(--ttv-top,var(--header-height,132px)) - 12px);margin:0}
.ttv>.breadcrumb,#main:has(.ttv)>.breadcrumb{display:none}
/* An app screen, not a document: no credit line or suggestion box under the grid, so a laptop shows the whole week. */
body:has(.ttv) .footnote,#main:has(.ttv) .feedback-invitation{display:none}
/* Tiles on the left; Day / Week / Month, the dates and the tools share the row when the screen is wide enough,
   and drop to a second line beneath the tiles when it is not. */
.ttv-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:0 0 8px}
.ttv-bar{flex:1 1 620px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;min-width:0}
.ttv-picks{display:grid;grid-template-columns:repeat(3,minmax(165px,205px));gap:8px;flex:0 1 auto;min-width:0}
.ttv-tile{display:flex;flex-direction:column;gap:1px;padding:5px 12px 5px;border:1px solid #cfdbd5;border-radius:12px;background:#fff;color:#243129;min-width:0;cursor:pointer;text-align:left}
.ttv-tile:hover{border-color:#9db3ab;background:#f4f8f5}
.ttv-tile.is-current{background:#244f35;border-color:#244f35;color:#fff}
.ttv-tile.is-current:hover{background:#1b3f2a}
.ttv-tile-label{border:0;background:transparent;padding:0;margin:0;font:inherit;font-size:10.5px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:inherit;opacity:.8;cursor:pointer;text-align:left;min-height:0;line-height:1.3}
.ttv-tile-select{width:100%;max-width:100%;min-height:0;font:inherit;font-size:16px;font-weight:700;letter-spacing:-.01em;line-height:1.3;color:inherit;border:0;border-radius:0;padding:1px 24px 1px 0;appearance:none;-webkit-appearance:none;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23356b46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 2px center/18px}
.ttv-tile.is-current .ttv-tile-select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.ttv-tile-select option,.ttv-tile-select optgroup{color:#243129;font-weight:400;font-size:14px}
.ttv-tile-sub{font-size:11px;line-height:1.3;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ttv-tile.is-current .ttv-tile-sub{color:#d5e3d9}
.ttv-scale{display:inline-flex;border:1px solid #cfdbd5;border-radius:999px;overflow:hidden;background:#fff}
.ttv-scale button{border:0;border-radius:0;background:transparent;padding:7px 16px;font:inherit;font-size:13px;color:#3b5548;cursor:pointer;min-height:0}
.ttv-scale button+button{border-left:1px solid #e3ebe6}
.ttv-scale button[aria-pressed=true]{background:#e1edfb;color:#164c91;font-weight:700}
.ttv-nav{display:flex;align-items:center;gap:6px;justify-content:center}
.ttv-nav strong{font-size:15px;color:#233c36;text-align:center}
.ttv-nav .reg-step{min-height:0}
.ttv-tools{display:flex;align-items:center;gap:8px;justify-self:end}
.ttv-tools button,.ttv-builder{min-height:34px;padding:6px 14px;border:1px solid #cfdbd5;border-radius:8px;background:#fff;font:inherit;font-size:13px;color:#243129;text-decoration:none;display:inline-flex;align-items:center}
.ttv-tools button.primary{background:#244f35;border-color:#244f35;color:#fff}
/* The grid fills what is left of the screen; if a week needs more, the page grows rather than a box scrolling. */
.ttv-print{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;border:0!important;padding:0!important;background:transparent!important}
.ttv-print .tt-print-head,.ttv-print .tt-print-foot{display:none}
.ttv .table-scroll{flex:1 1 auto;border-radius:10px;border:1px solid #c9d6cf;margin:0;overflow-x:auto;overflow-y:hidden;max-height:none;background:#fff}
@media(min-width:900px){.ttv .table-scroll{overflow:visible}}
.ttv .table-scroll>table>thead>tr>th{position:static}
.ttv .tt-grid{width:100%;min-width:0;height:100%;border-collapse:collapse}
.ttv-week .tt-grid,.ttv-month .tt-grid{min-width:760px}
.ttv .tt-grid thead th{padding:5px 8px;font-size:12px;line-height:1.3}
.ttv .tt-grid thead th strong{font-size:12.5px}
.ttv .tt-grid thead th small{font-weight:400;font-size:11px;opacity:.85;margin-left:6px}
.ttv .tt-grid thead th.is-today{background:#356b46;box-shadow:inset 0 -4px 0 #bd9b4a}
.ttv .tt-grid td.is-today{background:#f6faf7}
.ttv .tt-grid .tt-time{width:118px;padding:3px 9px;font-size:11.5px;line-height:1.3}
.ttv .tt-grid .tt-time small{font-size:10.5px;margin-top:1px}
.ttv .tt-grid .tt-time em{display:block;font-style:normal;font-size:9.5px;letter-spacing:.06em;text-transform:uppercase;color:#7c8b82;margin-top:1px}
.ttv .tt-grid tr.is-now .tt-time{background:#e1edfb;color:#164c91}
.ttv .tt-grid tr.is-now .tt-time small{color:#3374bb}
.ttv .tt-grid tr.tt-band{height:22px}
.ttv .tt-grid .tt-band td{padding:2px 8px;font-size:9.5px;letter-spacing:.5px}
.ttv .tt-grid .tt-band .tt-time{padding:2px 9px;font-size:11px;white-space:nowrap}
.ttv .tt-grid .tt-band .tt-time small{display:inline;margin:0 0 0 5px}
.ttv .tt-grid tbody td{padding:1px 2px;height:1px}
.ttv-cell{display:flex;flex-direction:column;gap:2px;height:100%;min-height:100%}
/* Cards: one click target each, filling the cell, two lines of text. */
.ttv .tt-slot,.ttv .tt-register,.ttv .tt-duty,.ttv .tt-meeting,.ttv .club-booking{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;min-height:0;padding:2px 8px;line-height:1.15;text-decoration:none;color:#243129;border-radius:4px;box-sizing:border-box}
.ttv .tt-slot strong{font-size:12px;line-height:1.15}
.ttv .tt-slot small{display:block;font-size:10px;margin-top:1px;color:#586d65;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ttv .tt-slot.filled{border-left:4px solid var(--lesson-accent,#5d8668);background:var(--lesson-bg,#eef4ef)}
.ttv a.tt-slot:hover,.ttv a.tt-register:hover,.ttv a.tt-duty:hover,.ttv a.tt-meeting:hover,.ttv a.club-booking:hover,.ttv .ttv-event:hover{filter:brightness(.94);cursor:pointer}
.ttv .ttv-event{width:100%;text-align:left;font:inherit;cursor:pointer;background:#fff7e6;border-left-color:#d99a2b;color:#233c36;border-top:0;border-right:0;border-bottom:0}
.ttv .ttv-event small{color:#7a5a12}
.ttv .tt-slot.empty{background:transparent}
.ttv .ttv-free .tt-empty{color:#8aa093;font-size:11px}
/* A teacher's empty teaching period reads PPA in its own soft gold, centred, so it never looks like a blank cell;
   the Class and Room views keep empty cells blank. */
.ttv .tt-slot.ttv-ppa{background:#fdf3d1;border-left:4px solid #d9b24a;align-items:center;justify-content:center;text-align:center}
.ttv .ttv-ppa .tt-empty{color:#7a5a12;font-size:11.5px;font-weight:700;letter-spacing:.08em;text-align:center}
.ttv-chip-ppa{--lesson-bg:#fdf3d1;--lesson-accent:#d9b24a;color:#7a5a12;text-align:center}
.ttv-chip-ppa span{color:#a07a1e}
.ttv-bandmark{display:block;padding:4px 8px;font-size:9.5px;letter-spacing:.5px;text-transform:uppercase;color:#8a998f}
.ttv .tt-register{font-size:12px;font-weight:700;color:#1f4a66;background:#e6f1fa;border-left:4px solid #699ec2}
.ttv .tt-register small{display:block;font-weight:400;font-size:10.5px;color:#3b6a8a;margin-top:1px}
.ttv .tt-duty{font-size:11px}
.ttv .tt-duty strong,.ttv .tt-duty small{display:block;line-height:1.2}
/* In the period table a duty shows when it starts and ends (it may sit inside Lunch or Break); in the hourly
   grid its position says that already. */
.ttv .tt-duty>small:first-child{font-weight:700;color:inherit;opacity:.85}
.ttv .ttv-block-wrap .tt-duty>small:first-child{display:none}
.ttv .tt-meeting{border-left-width:4px}
.ttv .tt-meeting strong,.ttv .tt-meeting small{display:block;font-size:11px;line-height:1.25}
.ttv .club-booking strong,.ttv .club-booking small{display:block;line-height:1.25}
.ttv .eca-empty-note{background:#f3f6f4;color:#5c6f66;border-left:4px solid #b9c7bf}
.ttv .ttv-nothing{padding:34px 18px;text-align:center;color:var(--muted)}
.ttv-day .tt-slot{padding:8px 14px}.ttv-day .tt-slot strong{font-size:15px}.ttv-day .tt-slot small{font-size:12px;white-space:normal}
/* One subject palette, shared with the Management builder (subject-colours.js). */
.ttv .subject-c1{--lesson-bg:#e7eef8;--lesson-accent:#456a9a}
.ttv .subject-c2{--lesson-bg:#ebe8f4;--lesson-accent:#665a9b}
.ttv .subject-c3{--lesson-bg:#e3f0e8;--lesson-accent:#387a55}
.ttv .subject-c4{--lesson-bg:#f7f0dd;--lesson-accent:#96762e}
.ttv .subject-c5{--lesson-bg:#dff0ef;--lesson-accent:#337878}
.ttv .subject-c6{--lesson-bg:#f8e8eb;--lesson-accent:#a04f64}
.ttv .subject-c7{--lesson-bg:#f0e4f1;--lesson-accent:#79508b}
.ttv .subject-c8{--lesson-bg:#faebdf;--lesson-accent:#a75f34}
.ttv .subject-c9{--lesson-bg:#f8f3d9;--lesson-accent:#8b761b}
.ttv .subject-c10{--lesson-bg:#ebeaf0;--lesson-accent:#67657c}
.ttv .subject-c11{--lesson-bg:#f1f3f2;--lesson-accent:#6d7a76}
.ttv .subject-c12{--lesson-bg:#f3f0ea;--lesson-accent:#81725e}
/* Hourly grid for whole-school specialists: hours 08:00-17:00 down the side, five day columns, every block drawn
   at its real times on a five-minute grid (108 rows), so a 09:50-10:40 lesson straddles the 10:00 line. */
.ttv-hours{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;border:1px solid #c9d6cf;border-radius:10px;overflow:hidden;background:#fff}
.ttv-hours-head,.ttv-hours-body{display:grid;grid-template-columns:118px repeat(var(--ttv-days,5),minmax(0,1fr))}
.ttv-hours-1{--ttv-days:1}
.ttv-hours-head>*{background:#244f35;color:#fff;font-weight:700;font-size:12.5px;line-height:1.3;padding:5px 8px;text-align:center;border-left:1px solid #42644d}
.ttv-hours-head>.ttv-hours-corner{text-align:left;border-left:0;font-size:12px}
.ttv-hours-head>.is-today{background:#356b46;box-shadow:inset 0 -4px 0 #bd9b4a}
.ttv-hours-head small{font-weight:400;font-size:11px;opacity:.85;margin-left:6px}
.ttv-hours-body{flex:1 1 auto;min-height:540px}
.ttv-hour-col,.ttv-day-col{position:relative;min-height:0;border-left:1px solid #d3ddd7;background-image:linear-gradient(to bottom,#dfe7e2 1px,transparent 1px);background-size:100% calc(100% / 9)}
.ttv-hour-col{border-left:0;background-color:#e8eef2}
.ttv-hour{position:absolute;left:0;right:0;padding:3px 9px;font-size:11.5px;font-weight:700;color:#355467}
.ttv-day-col.is-today{background-color:#f6faf7}
.ttv-block-wrap{position:absolute;left:2px;right:2px;display:flex;flex-direction:column;min-height:0;overflow:hidden;z-index:1;border-radius:4px;box-sizing:border-box;padding:1px 0}
.ttv-block-wrap>*{flex:1 1 auto;min-height:0;overflow:hidden}
/* Text fits the block: in full height the detail line may wrap to two lines (narrow side-by-side lessons); at
   ttv-fit-3 there is no room for the CLUB label; at ttv-fit-2 two lines only; at ttv-fit-1 (or is-short before
   the sizes are measured) everything sits on one line. */
.ttv .ttv-block-wrap strong{display:block;overflow:hidden}
.ttv .ttv-block-wrap small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;overflow:hidden;text-overflow:ellipsis;line-height:1.15}
.ttv .ttv-block-wrap .club-booking strong{font-size:12.5px}
.ttv .ttv-block-wrap .club-kind{font-size:9.5px;letter-spacing:.08em}
.ttv .ttv-fit-3 .club-kind{display:none}
.ttv .ttv-fit-2 small{display:block;white-space:nowrap;-webkit-line-clamp:unset}
.ttv .ttv-fit-2 .club-kind,.ttv .ttv-fit-2 small:nth-of-type(n+2){display:none}
.ttv .ttv-fit-1>*,.ttv .is-short>*{flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;padding:0 6px}
.ttv .ttv-fit-1 strong,.ttv .is-short strong{font-size:10.5px;white-space:nowrap;flex:0 0 auto}
.ttv .ttv-fit-1 small,.ttv .is-short small{display:block;font-size:10px;margin:0;white-space:nowrap;-webkit-line-clamp:unset;min-width:0;flex:1 1 auto}
.ttv .ttv-fit-1 .club-kind,.ttv .ttv-fit-1 small:nth-of-type(n+2),.ttv .is-short .club-kind,.ttv .is-short small:nth-of-type(n+2){display:none}
.ttv .ttv-fit-1 .tt-slot.ttv-ppa,.ttv .is-short .tt-slot.ttv-ppa{justify-content:center}
.ttv .ttv-fit-1 .tt-slot.ttv-ppa small,.ttv .is-short .tt-slot.ttv-ppa small{flex:0 0 auto}
.ttv-block-ppa{z-index:0}
.ttv-block-ppa .tt-slot.ttv-ppa{border-left-width:3px}
.ttv-block-ppa .tt-slot small{display:block;font-size:10px;color:#a07a1e;margin-top:1px;text-align:center}
.ttv-now{position:absolute;left:0;right:0;border-top:2px solid #c0532c;z-index:2;pointer-events:none;margin:0}
.ttv-hourly .tt-print-foot{display:none}
/* Month: five weekday columns, one card per school day, the day number opens that day. */
.ttv-month .tt-grid{height:auto}
.ttv-month .tt-grid tbody td{padding:0;vertical-align:top;height:auto}
.ttv-mday{min-height:96px;padding:6px 8px}
.ttv-mday.is-outside{opacity:.45}
.ttv-mdate{border:0;background:transparent;font:inherit;font-weight:700;font-size:13px;padding:2px 8px;border-radius:999px;cursor:pointer;color:#243129;min-height:0}
.ttv-mdate:hover{background:#e8eef2}
.ttv-mday.is-today .ttv-mdate{background:#244f35;color:#fff}
.ttv-chips{display:flex;flex-direction:column;gap:2px;margin-top:4px}
.ttv-chip{display:block;width:100%;padding:2px 6px 2px 8px;border:0;border-left:3px solid var(--lesson-accent,#5d8668);background:var(--lesson-bg,#eef4ef);border-radius:4px;font:inherit;font-size:11px;line-height:1.3;color:#233c36;text-decoration:none;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:0}
a.ttv-chip:hover,button.ttv-chip:hover{filter:brightness(.95);cursor:pointer}
.ttv-chip span{color:#586d65;margin-right:5px;font-variant-numeric:tabular-nums}
.ttv-chip-duty{--lesson-bg:#404845;--lesson-accent:#202725;color:#fff}
.ttv-chip-duty span{color:#d9dedb}
.ttv-chip-meeting{--lesson-bg:#e1edfb;--lesson-accent:#164c91}
.ttv-chip-event{--lesson-bg:#fff7e6;--lesson-accent:#d99a2b}
.ttv-chip-club{--lesson-bg:#eef3f1;--lesson-accent:#2b6540}
@media(max-width:1100px){.ttv-picks{grid-template-columns:repeat(3,minmax(0,1fr));width:100%}}
@media(max-width:760px){.ttv-bar{grid-template-columns:1fr;justify-items:start}.ttv-tools{justify-self:start}}
@media(max-width:650px){.ttv-nav strong{font-size:13px}.ttv .tt-grid .tt-time{width:84px}.ttv-tile-select{font-size:14px}}
@media print{.ttv-top{display:none!important}.ttv-print .tt-print-head{display:flex}.ttv .table-scroll{border:0}.ttv .tt-grid{height:auto}}
