:root {
  --ths-ink:#102449; --ths-gold:#f6bd36; --ths-paper:#f8f7f1; --ths-rule:#d3d9d8; --ths-muted:#4e6171;
}
[hidden] {display:none!important}
.school-life, .life-admin {color:var(--ths-ink)}
.school-life button, .life-admin button, .school-life input, .life-admin input, .tv button {font:inherit}
.school-life button, .life-admin button, .tv button {cursor:pointer}
.school-life button:focus-visible,.life-admin :is(input,button,a):focus-visible,.tv :focus-visible {
  outline:3px solid #b86a00;outline-offset:3px;position:relative;z-index:1
}
.life-hero {background:#11284e;color:white;position:relative;border-bottom:5px solid var(--ths-gold)}
.life-hero-in {display:flex;justify-content:space-between;align-items:flex-end;gap:1.5rem;padding-block:2rem 2.5rem}
.hero-back {display:inline-block;color:#f7ce6a;font-size:.92rem;text-decoration:underline;text-underline-offset:.22em}
.life-hero h1,.life-admin h1 {
  margin:.8rem 0 .6rem;font:normal clamp(3.1rem,6vw,5.7rem)/.99 Georgia,serif;letter-spacing:-.045em
}
.life-hero h1 em {font-weight:normal;color:#ffd36b}
.life-hero p {margin:.7rem 0 0;line-height:1.5;color:#e2e9f0;font-size:1.05rem}
.hero-action,.life-primary {
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;background:var(--ths-gold);color:var(--ths-ink);
  border:1px solid transparent;padding:.78rem 1.1rem;font-weight:700!important;text-decoration:none;border-radius:3px
}
.hero-action:hover,.life-primary:hover {background:#ffd46c;color:#102449;text-decoration:none}
.calendar-body,.scoreboard-body {padding-block:2.35rem 3rem}
.cal-toolbar,.cal-controls,.month-controls,.view-options,.button-row,.admin-actions {
  display:flex;align-items:center;gap:.8rem
}
.cal-toolbar {justify-content:space-between;flex-wrap:wrap;gap:1.2rem;margin-bottom:1.35rem}
.cal-heading h2,.results-section h2,.life-admin h2 {
  font:normal clamp(1.85rem,3vw,2.7rem)/1.1 Georgia,serif;letter-spacing:-.035em;margin:0 0 .3rem
}
.cal-heading span,.source-status,.event-when {color:var(--ths-muted)}
.cal-heading span,.source-status {font-size:.94rem;line-height:1.55}
.cal-controls {gap:1rem;flex-wrap:wrap}
.month-controls,.view-options {gap:0;border:1px solid #afb9bf;border-radius:4px;background:white;overflow:hidden}
.cal-controls button {min-height:40px;min-width:42px;padding:.45rem .75rem;background:transparent;border:0;color:var(--ths-ink);font-weight:650}
.cal-controls button+button {border-left:1px solid var(--ths-rule)}
.cal-controls button[aria-pressed=true] {background:#17365e;color:white}
.cal-controls button:hover:not([aria-pressed=true]) {background:#edf0ef}
.cal-controls button:focus-visible {outline-offset:-4px}
.month-controls button:first-child,.month-controls button:last-child {font-size:1.55rem;line-height:1}
.cal-controls button:disabled {opacity:.45}
.calendar-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;border:1px solid var(--ths-rule);background:var(--ths-rule)}
.week-label {padding:.58rem .68rem;background:#ecede8;color:#41536a;font-size:.9rem;font-weight:700}
.calendar-day {
  display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:.25rem;min-height:108px;min-width:0;
  padding:.45rem .5rem .65rem;background:#fff;color:var(--ths-ink);border:0
}
.calendar-day.adjacent {background:#f0f1eb;color:#5f6c77}
.calendar-day:hover {background:#fff8df}
.calendar-day[aria-pressed=true] {box-shadow:inset 0 0 0 2px #a77314}
.day-number {width:1.8rem;height:1.8rem;border-radius:50%;display:grid;place-items:center;font-size:.95rem}
.calendar-day[aria-current=date] .day-number {color:#17253b;background:#f7c651;font-weight:bold}
.day-event,.more-events {font-size:.87rem;line-height:1.25;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}
.day-event {background:#eaf0f2;border-left:3px solid #557692;padding:.16rem .28rem;color:#173854}
.more-events {color:#495970;font-weight:bold}
#day-detail {padding:1.1rem 1.35rem;background:white;border-left:4px solid var(--ths-gold);margin-top:1.2rem}
#day-detail h3,.agenda-group h3 {margin:.1rem 0 .6rem;font:normal 1.45rem Georgia}
.agenda-group {display:grid;grid-template-columns:minmax(135px,.32fr) 1fr;gap:1rem;border-top:1px solid var(--ths-rule);padding:1.1rem .2rem}
.agenda-group:last-child {border-bottom:1px solid var(--ths-rule)}
.agenda-list {list-style:none;margin:0;padding:0}
.agenda-event {display:flex;gap:.2rem;align-items:flex-start;flex-direction:column;padding:.28rem 0}
.agenda-event+.agenda-event {margin-top:.5rem}
.event-when {font-size:.9rem}
.event-title {font-size:1.08rem;line-height:1.35;overflow-wrap:anywhere}
.life-empty,#house-status {margin:1rem 0;line-height:1.6;color:var(--ths-muted)}
.source-status {margin-top:1.15rem}
.scoreboard-hero {border:0}
.house-stripes {height:7px;background:linear-gradient(to right,#db374b 0 25%,#f4c630 25% 50%,#219465 50% 75%,#3178c2 75%)}
.scorecards {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(.7rem,1.75vw,1.4rem)}
.house-card {position:relative;isolation:isolate;overflow:hidden;min-width:0;padding:clamp(.9rem,1.6vw,1.45rem);border-radius:5px;background:var(--house);color:var(--house-text)}
.house-card::after {content:"";position:absolute;z-index:-1;right:9%;top:-2.2rem;width:1.15rem;height:9rem;border-inline:.36rem solid currentColor;transform:rotate(32deg);opacity:.16;pointer-events:none}
.house-card.ayson {--house:#aa2336;--house-text:#fff}
.house-card.malcolm {--house:#f3c333;--house-text:#18294a}
.house-card.reid {--house:#14704e;--house-text:#fff}
.house-card.ross {--house:#225c9d;--house-text:#fff}
.house-card h2 {margin:0;font:normal clamp(1.55rem,2.25vw,2.15rem)/1.12 Georgia;letter-spacing:-.025em}
.score-body {margin-top:clamp(1.2rem,2.8vw,2.25rem)}
.score-total {display:flex;align-items:baseline;gap:.5rem;flex-wrap:wrap;line-height:1.1}
.points-number {max-width:100%;overflow-wrap:anywhere;font:700 clamp(2.8rem,4.3vw,4rem)/1 Arial,sans-serif;letter-spacing:-.055em;font-variant-numeric:tabular-nums}
.score-total small,.place {font-size:.94rem}
.place {display:block;border-top:1px solid currentColor;padding-top:.65rem;margin-top:.85rem}
.results-section {margin:2.35rem 0 1.7rem}
.result-overflow {max-width:100%;overflow:auto;margin-top:1.1rem}
.result-overflow table {border-collapse:collapse;width:100%;font-variant-numeric:tabular-nums}
.result-overflow th,.result-overflow td {padding:.8rem .7rem;border-bottom:1px solid var(--ths-rule);text-align:right}
.result-overflow thead th {background:#e8ecea;color:#243954}
.result-overflow th:first-child,.result-overflow td:nth-child(2),.result-overflow thead th:nth-child(2) {text-align:left}
.result-overflow th[scope=row] {min-width:9rem}
.backlink,.body-link,.admin-actions a,.admin-results a,.button-row a {text-decoration:underline;text-underline-offset:.22em}
.screenreader {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.life-admin {padding-block:2rem 4rem;min-height:55vh}
.life-admin h1 {margin-bottom:1.25rem;font-size:clamp(2.7rem,5vw,4.45rem)}
.admin-columns {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:clamp(1rem,4vw,3.3rem);align-items:start;margin-top:1.6rem}
.admin-panel,.login-form {background:#fff;border:1px solid var(--ths-rule);border-top:4px solid var(--ths-gold);padding:clamp(1rem,2.6vw,2rem)}
.admin-form {display:grid;gap:1.15rem;max-width:46rem}
.login-form {max-width:27rem}
.admin-panel .admin-form {margin-top:1.3rem}
.admin-form label {display:grid;gap:.42rem;font-weight:bold}
.admin-form input {display:block;min-width:0;width:100%;border:1px solid #8e9dad;border-radius:3px;background:white;color:#142746;padding:.67rem}
.admin-form fieldset {margin:0;border:1px solid var(--ths-rule);padding:1rem}
.admin-form legend {font-weight:bold}
.house-inputs {display:grid;grid-template-columns:1fr 1fr;gap:.9rem}
.life-primary {justify-self:start}
.admin-actions {justify-content:space-between;border-bottom:1px solid var(--ths-rule);padding-bottom:1rem}
.text-button {border:0;background:none;color:var(--ths-ink);text-decoration:underline;text-underline-offset:.2em}
.admin-results {list-style:none;padding:0;margin:1rem 0 0}
.admin-results li {display:flex;align-items:center;justify-content:space-between;gap:1rem;border-top:1px solid var(--ths-rule);padding:.72rem 0}
.admin-results li div {min-width:0;overflow-wrap:anywhere}
.admin-results li a {flex-shrink:0}
.admin-results li small {display:block;color:var(--ths-muted);margin-top:.3rem}
.form-message,.form-success {padding:.85rem 1rem;border-left:4px solid #c37e22;background:#fff0cd;line-height:1.5}
.form-success {border-color:#297053;background:#e7f3e9}
.family-links {display:flex;flex-wrap:wrap;align-items:baseline;column-gap:1.4rem}
.family-links .plain {display:inline-flex;align-items:center;min-height:44px;text-underline-offset:.2em}
.visitor-info {display:flex;flex-wrap:wrap;gap:2rem 6rem;padding-block:clamp(2rem,5vw,5rem)}
.visitor-info section {border-left:4px solid var(--ths-gold);padding-left:1.25rem}
.visitor-info h2 {margin:0 0 .55rem;font:normal clamp(1.8rem,3vw,2.8rem)/1.1 Georgia,serif}
.visitor-info p {margin:0;font-size:1.15rem;line-height:1.55}
@media(max-width:900px) {
  .scorecards {grid-template-columns:repeat(2,minmax(0,1fr))}
  .calendar-day {min-height:91px;padding:.3rem}
}
@media(max-width:700px) {
  .life-hero-in {align-items:flex-start;flex-direction:column}
  .admin-columns {grid-template-columns:1fr}
  .cal-toolbar {align-items:flex-start;flex-direction:column}
  .cal-controls {width:100%;justify-content:space-between;gap:.35rem}
  .cal-controls button {padding:.4rem .56rem;min-width:37px}
  .week-label {font-size:.77rem;padding:.4rem .1rem;text-align:center}
  .calendar-day {min-height:3.7rem;align-items:center;padding:.16rem}
  .calendar-day .day-event,.calendar-day .more-events {font-size:0;display:none}
  .calendar-day:has(.day-event):after {content:'';width:.39rem;height:.39rem;border-radius:50%;background:#416489}
  .agenda-group {grid-template-columns:1fr;gap:.2rem}
  .points-number {font-size:2.7rem}
}
@media(max-width:370px) {
  .cal-controls {align-items:flex-start}
  .house-card {padding:.8rem}
}
/* Reception screens use this stylesheet alone, without the public website menu. */
body.tv {margin:0;background:#102548;color:#fff;font:normal 18px/1.35 Arial,sans-serif}
.tv * {box-sizing:border-box}
.tv #tv-stage {min-height:100vh;min-height:100dvh;display:grid;grid-template-rows:auto 1fr auto;border-bottom:clamp(4px,.7vh,9px) solid var(--ths-gold);overflow:hidden}
.tv-bar,.tv-footer,.tv-welcome,.tv-events {margin-inline:clamp(18px,5.6vw,120px)}
.tv-bar,.tv-footer {display:flex;align-items:center;justify-content:space-between;gap:1.4rem}
.tv-bar {padding-block:clamp(14px,3vh,38px);border-bottom:1px solid #51647e}
.tv-school {color:#ffcf65;font-weight:bold;letter-spacing:.025em}
.tv-school,#tv-date {font-size:clamp(.95rem,1.65vw,2.3rem)}
.tv-datetime,.tv-local-time {display:flex;align-items:baseline}
.tv-datetime {gap:clamp(.8rem,2.3vw,3.4rem);justify-content:flex-end;flex-wrap:wrap}
.tv-local-time {gap:.55em;border-left:1px solid #637690;padding-left:clamp(.8rem,2vw,2.6rem);white-space:nowrap}
.tv-local-time span {font-size:clamp(.9rem,1.25vw,1.8rem);color:#ffcf65}
#tv-clock {font:700 clamp(1.5rem,2.6vw,3.8rem)/1.1 Arial,sans-serif;font-variant-numeric:tabular-nums}
.tv-welcome {align-self:center;display:grid;grid-template-columns:1.4fr .65fr;align-items:center;gap:4vw;padding-block:3vh}
.tv-welcome-copy p {color:#ffcf65;margin:0 0 1.4vh;font-size:clamp(1.3rem,2.1vw,3rem);font-weight:650}
.tv-welcome h1 {color:#fff;margin:0;font:normal clamp(3.2rem,min(7.8vw,12vh),11rem)/1 Georgia;letter-spacing:-.048em}
.tv-welcome h1 em {font-weight:normal;color:#ffce65}
.tv-crest img {display:block;width:100%;max-height:50vh;object-fit:contain}
.tv-notice {align-self:center;min-width:0;margin-inline:clamp(18px,5.6vw,120px);padding-block:clamp(.75rem,3vh,3rem)}
.tv-visitors,.tv-website {display:grid;align-items:center;gap:clamp(1.25rem,4vw,6rem)}
.tv-visitors {grid-template-columns:minmax(0,1.75fr) minmax(0,.65fr)}
.tv-visitors h2 {margin:0;color:#ffcf65;font:650 clamp(1.55rem,2.9vw,4rem)/1.15 Arial,sans-serif}
.visitor-instruction {margin:.18em 0 .28em;font:normal clamp(3.1rem,min(7.5vw,12vh),10.5rem)/1.02 Georgia,serif;letter-spacing:-.04em}
.visitor-departure {margin:0;max-width:32ch;font-size:clamp(1.3rem,min(2.6vw,4.7vh),3.6rem);color:#f7d783}
.visitor-crest {width:100%;max-height:44vh;object-fit:contain}
.tv-website {grid-template-columns:minmax(0,.85fr) minmax(0,1.4fr)}
.website-copy h2 {margin:0 0 .28em;font:normal clamp(2.55rem,min(5.2vw,9vh),7rem)/1.02 Georgia,serif;letter-spacing:-.04em}
.website-copy p,.genesis-copy p {font-size:clamp(1.18rem,min(2.05vw,3.8vh),2.85rem);line-height:1.38}
.website-copy p {margin:.5em 0 .85em;max-width:30ch}
.website-copy strong {color:#ffcf65}
.tv-web-address {display:inline-block;font-weight:700;font-size:clamp(1.15rem,min(2.15vw,4.5vh),3rem);color:#ffcf65;text-decoration:underline;text-underline-offset:.2em;overflow-wrap:anywhere}
.homepage-picture {display:block;width:100%;height:auto;max-height:61vh;object-fit:contain;border:2px solid #8193a6;border-radius:3px;background:#f8f7f1}
.genesis-paper {width:min(100%,113vh);margin:auto;padding:clamp(.9rem,2vw,2.5rem);color:#13294b;background:#fbfaf3;box-shadow:0 .6rem 1.5rem #08183240}
.genesis-paper h2 {margin:0;padding:0 0 .5rem;border-bottom:3px double #294366}
.genesis-paper img {width:100%;height:auto;display:block}
.genesis-copy {padding:clamp(.55rem,1.7vh,1.5rem) .25rem 0}
.genesis-copy p {margin:.15em 0 .5em}
.genesis-copy .genesis-headline {margin:0;font:normal clamp(2.2rem,min(4.8vw,7.7vh),6.3rem)/1.1 Georgia,serif;letter-spacing:-.035em}
.genesis-copy .tv-web-address {color:#16395c}
.tv-events {align-self:center;padding-block:2.4vh}
.tv-agenda-heading {display:flex;align-items:baseline;gap:1.5rem;justify-content:space-between;flex-wrap:wrap;padding-bottom:1.3vh;border-bottom:2px solid var(--ths-gold)}
.tv-events h2 {font:normal clamp(2.35rem,min(5.1vw,8vh),7rem)/1.06 Georgia;margin:0;letter-spacing:-.035em}
.tv-agenda-heading p {font-size:clamp(1rem,1.55vw,2rem);color:#ffcf65;margin:0}
.tv-row {display:grid;grid-template-columns:minmax(165px,.42fr) minmax(0,1fr);gap:2vw;align-items:center;border-bottom:1px solid #435673;padding-block:clamp(7px,1.65vh,30px)}
.tv-row:not(:has(.tv-row-date)) {grid-template-columns:1fr}
.tv-row-date {color:#ffdc89;font-size:clamp(.98rem,1.65vw,2.45rem)}
.tv-row-title {font-size:clamp(1.05rem,min(2.6vw,4.3vh),4rem);font-weight:600;line-height:1.18;overflow-wrap:anywhere}
.tv-empty {font-size:clamp(1.2rem,2.4vw,3rem);color:#e5eaf0}
.tv-footer {border-top:1px solid #51647e;color:#d9e1eb;padding-block:1.55vh;font-size:clamp(.85rem,1.1vw,1.55rem)}
.tv-controls {position:fixed;bottom:clamp(1rem,5vh,4rem);right:4vw;display:flex;gap:.3rem;align-items:center;flex-wrap:wrap;padding:.35rem;border:1px solid #526681;border-radius:5px;background:#0b203e;opacity:0;pointer-events:none}
.tv-controls:focus-within,.tv.show-controls .tv-controls {opacity:1;pointer-events:auto}
.tv-controls :is(a,button) {padding:.4rem .62rem;color:white;background:#233f61;border:0;font:600 14px Arial;text-decoration:none;border-radius:3px}
.tv-controls a:hover,.tv-controls button:hover {background:#365776}
@media(max-width:700px) {
 .tv-website {grid-template-columns:1fr;gap:1rem}
 .website-copy p {max-width:none}
 .homepage-picture {width:auto;max-width:100%;max-height:34vh;justify-self:center}
 .tv-visitors {grid-template-columns:minmax(0,1fr) minmax(0,.3fr);gap:.75rem}
 .visitor-instruction {font-size:clamp(2.4rem,9vw,4rem)}
 .tv-welcome {grid-template-columns:1fr .45fr;gap:1vw}
 .tv-welcome h1 {font-size:clamp(2.35rem,8.7vw,4.1rem)}
 .tv-agenda-heading {display:block}
 .tv-agenda-heading p {margin-top:.35rem}
 .tv-bar {align-items:flex-start}
 .tv-datetime {display:grid;justify-items:end;gap:.25rem;text-align:right}
 .tv-local-time {border:0;padding:0}
 .tv-row {grid-template-columns:1fr;gap:.15rem}
 .tv-footer {flex-wrap:wrap}
}
