:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #15213a;
  --cell-ink: #2d3748;
  --muted: #61708a;
  --line: #dbe3ef;
  --blue: #144f8c;
  --blue-2: #0c3f78;
  --blue-hover: #2269aa;
  --blue-soft: #e7f1fb;
  --holiday-blue: #9fcdf7;
  --yellow: #f5c542;
  --yellow-2: #e3aa17;
  --cream: #fff8df;
  --green: #0f5f3f;
  --green-soft: #dff3ea;
  --past-grey: #edf0f3;
  --weekend-grey: #e2e6eb;
  --red: #b42318;
  --shadow: 0 8px 22px rgba(15, 45, 90, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: radial-gradient(circle at top left, rgba(245,197,66,.28), transparent 32rem), linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%); }
a { color: var(--blue); font-weight: 700; }
.site-header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; padding: 1.25rem; border-bottom: 4px solid var(--yellow); background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: white; }
.site-header h1 { margin: 0.1rem 0; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.site-header .muted { color: rgba(255,255,255,.82); }
.site-header nav { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.site-header a { color: var(--ink); background: var(--yellow); padding: .6rem .8rem; border-radius: 999px; text-decoration: none; }
.site-header a:hover { background: #ffd95b; }
.eyebrow { margin: 0; color: var(--yellow); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.75rem; }
.admin-shell, .layout, .public-shell { max-width: 1380px; margin: 0 auto; padding: 1rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem; padding: 1rem; box-shadow: var(--shadow); }
.inset-card { background: #fbfdff; box-shadow: none; margin: 1rem 0; }
.login-card { max-width: 560px; margin: 2rem auto; }
.section-heading, .admin-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small-help { font-size: .92rem; }
.hidden { display: none !important; }
.tab-nav, .subtab-nav { display: flex; gap: .55rem; overflow-x: auto; padding: .75rem 0; }
.tab-nav button, .subtab-nav button { white-space: nowrap; background: var(--blue-soft); color: var(--blue-2); border: 1px solid #c6d9ef; }
.tab-nav button:hover, .subtab-nav button:hover { background: #d4e8fa; color: var(--blue-2); }
.tab-nav button.active, .subtab-nav button.active { background: var(--yellow); color: var(--ink); border-color: var(--yellow-2); }
.tab-nav button.active:hover, .subtab-nav button.active:hover { background: #ffd95b; color: var(--ink); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.wide-card { margin-left: calc(50% - 50vw + 1rem); margin-right: calc(50% - 50vw + 1rem); }
.list { display: grid; gap: 0.75rem; }
.item { border: 1px solid var(--line); border-radius: 0.9rem; padding: 0.9rem; background: #fffefa; }
.item h3 { margin: 0 0 0.25rem; }
.item p { margin: 0.2rem 0; }
.badge { display: inline-block; padding: 0.16rem 0.5rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue-2); font-size: 0.78rem; font-weight: 800; }
.badge.yellow { background: var(--cream); color: #7a5200; }
.form { display: grid; gap: 0.85rem; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.compact-form { align-items: end; }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 0.3rem; font-weight: 700; }
.inline-label { display: flex; align-items: center; gap: .5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; }
.fieldset { border: 1px solid var(--line); border-radius: .8rem; padding: .85rem; }
.fieldset legend { font-weight: 800; color: var(--blue-2); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; }
.check-card, .filter-chip { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--line); border-radius: .7rem; padding: .55rem; background: white; font-weight: 650; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; border: 1px solid #bdcbe0; border-radius: 0.58rem; padding: 0.62rem; background: white; color: var(--ink); }
textarea { resize: vertical; }
button { border: 0; border-radius: 0.65rem; padding: 0.66rem 0.95rem; background: var(--blue); color: white; font-weight: 800; cursor: pointer; }
button:hover { background: var(--blue-hover); color: white; }
button.secondary { background: #eef2f7; color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { background: #e1e8f1; color: var(--ink); }
button.danger { background: var(--red); }
button.danger:hover { background: #cf3529; }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.selection-summary { margin: .75rem 0; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.selection-summary button { padding: .35rem .55rem; font-size: .9rem; }
.calendar-key { display: flex; gap: 1rem; flex-wrap: wrap; margin: .75rem 0 1rem; font-weight: 700; color: var(--cell-ink); }
.key-swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: .25rem; border: 1px solid var(--line); vertical-align: -.15rem; margin-right: .3rem; }
.key-swatch.school_holiday { background: var(--holiday-blue); border-color: #9bc8ed; }
.key-swatch.admin_day { background: var(--green); border-color: var(--green); }
.key-swatch.inset_day { background: var(--yellow); border-color: var(--yellow-2); }
.key-swatch.today { background: var(--yellow); border-color: var(--yellow-2); }
.key-swatch.past { background: var(--past-grey); border-color: #cdd3db; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 1rem; }
.month-card h3 { margin-top: 0; color: var(--blue-2); }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .22rem; }
.day-name, .day-cell { text-align: center; min-height: 2rem; padding: .3rem; border-radius: .4rem; font-size: .85rem; }
.day-name { font-weight: 800; color: var(--muted); }
.day-cell { border: 1px solid var(--line); background: white; color: var(--cell-ink); cursor: pointer; }
.day-cell:hover { background: #f2f7fc; color: var(--cell-ink); }
.day-cell.empty { visibility: hidden; cursor: default; }
.day-cell.weekend { opacity: .45; }
.day-cell.selected { outline: 3px solid var(--yellow); background: var(--cream); color: var(--cell-ink); }
.day-cell.has-status { color: var(--cell-ink); }
.day-cell.school_holiday { background: var(--holiday-blue); border-color: #9bc8ed; }
.day-cell.inset_day { background: var(--yellow); border-color: var(--yellow-2); color: var(--ink); }
.day-cell.admin_day { background: var(--green); border-color: var(--green); color: white; }
.day-cell.past-date { background: var(--past-grey); color: #6b7280; }
.day-cell.today-date { background: var(--yellow); color: var(--ink); border-color: var(--yellow-2); font-weight: 900; }
.calendar-jumpbar { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: .8rem 0; }
.calendar-jumpbar button { padding: .4rem .58rem; font-size: .88rem; }
.table-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: 1rem; background: white; scroll-behavior: smooth; }
.data-table { width: max-content; min-width: 100%; border-collapse: collapse; background: white; table-layout: fixed; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: .45rem; vertical-align: top; color: var(--cell-ink); }
.data-table th { position: sticky; top: 0; background: var(--blue); color: white; z-index: 1; }
.data-table .date-col { min-width: 155px; width: 155px; background: #f9fbfd; position: sticky; left: 0; z-index: 2; }
.data-table th.date-col { background: var(--blue-2); color: white; z-index: 3; }
.data-table .master-col { min-width: 170px; width: 170px; }
.data-table .school-col, .data-table .ks-col, .data-table .class-col { min-width: 220px; width: 220px; }
.data-table tr.past-row td { background-color: var(--past-grey); color: #6b7280; }
.data-table tr.today-row td { background-color: #fff6cf; }
.data-table tr.weekend-row td { background-color: var(--weekend-grey); color: #6b7280; }
.data-table tr.school_holiday-row td { background-color: var(--holiday-blue); }
.data-table tr.inset_day-row td { background-color: #fff1ba; }
.data-table tr.admin_day-row td { background-color: #e2f2ea; }
.data-table tr.weekend-row .editable-cell { cursor: not-allowed; background-color: var(--weekend-grey); }
.editable-cell { cursor: text; background: #fffdf4; }
.editable-cell:hover { background: var(--cream); }
.readonly-cell { background: #f8fafc; color: #4a5568; }
.inline-editor { display: grid; gap: .4rem; }
.inline-editor textarea { min-height: 4.5rem; padding: .45rem; }
.inline-editor .save-mini { padding: .4rem .55rem; justify-self: start; }
.routine-editor { display: grid; gap: .75rem; margin: 1rem 0; }
.routine-class-card { border: 1px solid var(--line); border-radius: .9rem; padding: .85rem; background: #fbfdff; }
.weekday-routine-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: .5rem; }
.meal-grid { display: grid; gap: .5rem; }
.meal-row { display: grid; grid-template-columns: 110px repeat(3, minmax(0, 1fr)); gap: .5rem; align-items: center; }
.mobile-column-picker { display: none; }
.public-controls { display: grid; gap: .75rem; margin-bottom: 1rem; }
.public-filter-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.public-table { width: 100%; border-collapse: collapse; background: white; border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow); }
.public-table th, .public-table td { border: 1px solid var(--line); padding: .75rem; vertical-align: top; }
.public-table th { background: var(--blue); color: white; text-align: left; }
.public-table .day-public-col { width: 150px; font-weight: 900; }
.public-table .meal-public-col { width: 260px; }
.public-week-heading { margin: 1.2rem 0 .5rem; color: var(--blue-2); }
.event-line { margin: 0 0 .55rem; }
.add-calendar-button { margin-top: .5rem; padding: .38rem .55rem; font-size: .86rem; }
.site-footer { padding: 1rem; text-align: center; color: var(--muted); }
@media (max-width: 820px) {
  .site-header, .section-heading, .admin-topline { flex-direction: column; align-items: stretch; }
  .layout, .two-column, .grid-form { grid-template-columns: 1fr; }
  .weekday-routine-grid, .meal-row { grid-template-columns: 1fr; }
  .wide-card { margin-left: 0; margin-right: 0; }
  .master-action-box { position: fixed; left: .5rem; right: .5rem; bottom: .5rem; z-index: 50; background: white; border: 2px solid var(--yellow); border-radius: 1rem; padding: .75rem; box-shadow: 0 10px 30px rgba(0,0,0,.22); grid-template-columns: 1fr; max-height: 46vh; overflow: auto; }
  #tab-master-calendar { padding-bottom: 17rem; }
  .responsive-calendar .optional-col { display: none; }
  .responsive-calendar .optional-col.mobile-visible { display: table-cell; }
  .mobile-column-picker.active { display: flex; position: fixed; left: .5rem; right: .5rem; bottom: .5rem; z-index: 60; gap: .4rem; overflow-x: auto; background: white; border: 2px solid var(--yellow); border-radius: 1rem; padding: .6rem; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
  .mobile-column-picker button { white-space: nowrap; padding: .45rem .6rem; }
  .mobile-column-picker button.active { background: var(--yellow); color: var(--ink); }
  #tab-school-calendars, #tab-class-calendars { padding-bottom: 5rem; }
  .public-table, .public-table thead, .public-table tbody, .public-table tr, .public-table th, .public-table td { display: block; width: 100%; }
  .public-table thead { display: none; }
  .public-table tr { border: 1px solid var(--line); margin-bottom: .75rem; border-radius: .85rem; overflow: hidden; background: white; }
  .public-table td::before { display: block; font-weight: 900; color: var(--blue-2); margin-bottom: .2rem; }
  .public-table td:nth-child(1)::before { content: "Day"; }
  .public-table td:nth-child(2)::before { content: "Events"; }
  .public-table td:nth-child(3)::before { content: "Meal"; }
}


/* v5 amendments */
.filter-button {
  border: 2px solid var(--yellow);
  background: white;
  color: var(--blue-2);
  border-radius: 999px;
  padding: .55rem .85rem;
}
.filter-button:hover { background: #f5f9ff; color: var(--blue-2); }
.filter-button.selected,
.filter-button[data-selected="true"] {
  background: var(--blue);
  color: white;
}
.filter-button.selected:hover,
.filter-button[data-selected="true"]:hover {
  background: var(--blue-hover);
  color: white;
}
.public-filter-panel { display: grid; gap: .75rem; }
.public-ks-groups { display: grid; gap: .75rem; }
.public-ks-group { border: 1px solid var(--line); border-radius: .9rem; padding: .75rem; background: #fbfdff; }
.public-ks-group h3 { margin: 0 0 .5rem; color: var(--blue-2); }
.public-class-buttons { display: flex; gap: .45rem; flex-wrap: wrap; }
.public-day-title { font-weight: 900; color: var(--blue-2); }
.public-table tr.public-closure-row.school_holiday-row td { background: var(--holiday-blue); }
.public-table tr.public-closure-row.inset_day-row td { background: #fff1ba; }
.public-table tr.public-closure-row.admin_day-row td { background: #e2f2ea; }
.structure-card > .section-heading { align-items: flex-start; }
.structure-class-row { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.master-action-box { bottom: .85rem; }
#masterHolidayNameLabel.hidden { display: none !important; }
@media (max-width: 820px) {
  .master-action-box { bottom: 1.1rem; }
  .public-filter-panel { gap: .6rem; }
  .public-ks-group { padding: .65rem; }
  .public-class-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .public-table tr { box-shadow: var(--shadow); }
  .public-table td { padding: .85rem; }
  .public-table .day-public-col { background: var(--blue-soft); width: 100%; }
  .public-table td:nth-child(1)::before { content: ""; display: none; }
  .public-table td:nth-child(2)::before { content: "Events"; }
  .public-table td:nth-child(3)::before { content: "Meal"; }
}


/* v6 label, layout and date fixes */
.day-cell.today-date {
  background: white;
  color: var(--ink);
  border: 3px solid #b8860b;
  font-weight: 950;
}
.day-cell.today-date.school_holiday { background: var(--holiday-blue); }
.day-cell.today-date.inset_day { background: var(--yellow); }
.day-cell.today-date.admin_day { background: var(--green); color: white; }

.public-filter-panel {
  display: flex;
  align-items: stretch;
  gap: .65rem;
  overflow-x: auto;
  padding-bottom: .35rem;
}
.public-ks-groups {
  display: flex;
  flex: 1 0 auto;
  gap: .65rem;
  align-items: stretch;
}
.public-ks-group {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}
.public-ks-group h3 {
  margin: 0;
  font-size: .92rem;
}
.public-class-buttons {
  display: flex;
  gap: .45rem;
  flex-wrap: nowrap;
}
.filter-button {
  flex: 0 0 auto;
}
.filter-button input,
.filter-button .visible-checkbox {
  display: none !important;
}

.user-class-permissions.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .public-filter-panel {
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .public-ks-group {
    align-items: flex-start;
    flex-direction: column;
  }
  .public-class-buttons {
    display: flex;
    flex-wrap: nowrap;
  }
  .public-table tr {
    width: 100%;
  }
  .public-table .day-public-col {
    display: block;
    width: 100%;
    background: var(--blue-soft);
    padding: 1rem;
  }
  .public-day-title {
    font-size: 1.15rem;
  }
}


/* v7 sticky headers, logos, compact selectors, and weekly messages */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  align-items: center;
  transition: padding .18s ease, box-shadow .18s ease, border-width .18s ease;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.site-logo {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
  transition: width .18s ease, height .18s ease;
}
.site-logo-wordless { width: 72px; height: 72px; }
.site-logo-full { width: 104px; height: 104px; }
body.header-compact .site-header {
  padding: .35rem .8rem;
  border-bottom-width: 3px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
body.header-compact .site-header h1 { font-size: clamp(1.05rem, 2.4vw, 1.35rem); margin: 0; }
body.header-compact .site-header .eyebrow,
body.header-compact .site-header .muted { display: none; }
body.header-compact .site-logo-wordless { width: 42px; height: 42px; }
body.header-compact .site-logo-full { width: 54px; height: 54px; }
.tab-nav {
  position: sticky;
  top: 98px;
  z-index: 90;
  background: rgba(246,248,251,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  margin: 0 -.25rem .75rem;
  padding: .65rem .25rem;
}
body.header-compact .tab-nav { top: 55px; }
.tab-collapse-button { display: none; }

.public-filter-panel {
  display: flex;
  align-items: stretch;
  gap: .45rem;
  overflow-x: auto;
  padding: .15rem .15rem .45rem;
}
.public-ks-groups {
  display: flex;
  flex: 1 0 auto;
  gap: .45rem;
  align-items: stretch;
}
.public-ks-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: .25rem;
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .28rem .35rem .35rem;
  background: #fbfdff;
}
.public-ks-group h3 {
  margin: 0;
  font-size: .74rem;
  line-height: 1.05;
  color: var(--blue-2);
  font-weight: 850;
}
.public-class-buttons {
  display: flex;
  gap: .28rem;
  flex-wrap: nowrap;
}
.filter-button {
  border: 2px solid var(--yellow);
  background: white;
  color: var(--blue-2);
  border-radius: 999px;
  padding: .34rem .52rem;
  min-height: 2.35rem;
  font-size: .92rem;
  line-height: 1.05;
  flex: 0 0 auto;
}
.filter-button.selected,
.filter-button[data-selected="true"] {
  background: var(--blue);
  color: white;
}
#showSchoolEventsInput { align-self: flex-end; }

.week-message-row td {
  background: #f4f9ff !important;
  border-top: 3px solid var(--yellow);
}
.week-message-title {
  color: var(--blue-2);
  font-weight: 950;
  line-height: 1.15;
}
.teacher-message-cell {
  background: #fffaf0 !important;
}
.teacher-message-cell::after {
  content: "Teacher message";
  display: block;
  margin-top: .3rem;
  font-size: .74rem;
  color: var(--muted);
  font-weight: 800;
}
.public-week-messages {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: .5rem 0 .75rem;
}
.public-week-message-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--yellow);
  border-radius: .8rem;
  background: #fffdf5;
  padding: .65rem .75rem;
}
.public-week-message-card h3 {
  margin: 0 0 .25rem;
  color: var(--blue-2);
  font-size: .95rem;
}
.public-week-message-card p { margin: 0; }

@media (max-width: 820px) {
  .site-header { flex-direction: row; align-items: center; }
  .site-header nav { margin-left: auto; }
  .site-logo-wordless { width: 54px; height: 54px; }
  .site-logo-full { width: 72px; height: 72px; }
  body.header-compact .site-logo-wordless { width: 38px; height: 38px; }
  body.header-compact .site-logo-full { width: 46px; height: 46px; }
  .tab-collapse-button { display: inline-flex; }
  .tab-nav { top: 79px; margin: .35rem 0 .65rem; }
  body.header-compact .tab-nav { top: 50px; }
  body.tabs-collapsed .tab-nav { display: none; }
  .public-filter-panel { gap: .34rem; }
  .public-ks-group { padding: .3rem; border: 1px solid #cbd8e8; }
  .public-ks-group h3 { display: none; }
  .public-class-buttons { gap: .26rem; }
  .filter-button { padding: .34rem .45rem; min-height: 2.3rem; font-size: .88rem; }
  .public-table tr { width: 100%; }
  .public-table .day-public-col {
    display: block;
    width: 100%;
    background: var(--blue-soft);
    padding: .9rem 1rem;
  }
  .public-day-title { font-size: 1.08rem; }
}


/* v8 public polish, meal payments, and stable header */
.public-status:empty { display: none; }
.public-week-heading {
  text-align: center;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  margin: 1.35rem 0 .55rem;
}
.site-logo-small.hidden-logo { display: none; }
body.header-compact .public-header .site-logo-large { display: none; }
body.header-compact .public-header .site-logo-small { display: block; }
.public-header .site-logo-full { width: 150px; height: 96px; }
body.header-compact .public-header .site-logo-wordless { width: 42px; height: 42px; }
.site-header { transition: box-shadow .12s ease, border-width .12s ease; }
.safeguarding-warning {
  color: var(--red);
  font-weight: 950;
  font-size: 1.05rem;
  line-height: 1.25;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
  background: #fff5f4;
  border: 2px solid #ffd0cc;
  border-radius: .8rem;
  padding: .7rem .85rem;
}
.meal-payment-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: start;
  margin: .75rem 0 1rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: #fbfdff;
}
.meal-payment-box h3 { margin: 0 0 .25rem; }
.meal-payment-edit { grid-column: 1 / -1; display: grid; gap: .65rem; }
.meal-menu-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
}
.meal-menu-actions {
  display: grid;
  gap: .45rem;
  min-width: 7.5rem;
}
.meal-menu-actions button { width: 100%; }
.meal-payment-public-link {
  color: white;
  text-decoration: underline;
  font-size: .88rem;
}
.public-week-message-card h3 { font-size: 1rem; }

@media (max-width: 820px) {
  .public-header .site-logo-full { width: 118px; height: 74px; }
  body.header-compact .public-header .site-logo-wordless { width: 38px; height: 38px; }
  .public-table .meal-public-col {
    display: block;
    width: 100% !important;
  }
  .public-table td:nth-child(3)::before { content: "Meal"; }
  .meal-menu-card { grid-template-columns: 1fr; }
  .meal-menu-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meal-payment-box { grid-template-columns: 1fr; }
}


/* v9 public event grouping */
.public-ks-groups {
  width: 100%;
}
.filter-button.selected,
.filter-button[data-selected="true"] {
  background: var(--blue);
  color: white;
}
.filter-button.selected:hover,
.filter-button[data-selected="true"]:hover {
  background: var(--blue-hover);
  color: white;
}
.public-class-event-block {
  margin: .45rem 0 .65rem;
  padding: .5rem .6rem;
  border-left: 4px solid var(--yellow);
  background: #fbfdff;
  border-radius: .45rem;
}
.public-class-event-title {
  display: block;
  color: var(--blue-2);
  font-size: 1rem;
  margin-bottom: .2rem;
}
.event-label {
  font-weight: 850;
  color: var(--ink);
}
@media (max-width: 820px) {
  .public-filter-panel {
    display: block;
  }
  .public-ks-groups {
    display: flex;
    overflow-x: auto;
    gap: .35rem;
    padding-bottom: .35rem;
  }
  .public-class-event-block {
    margin: .55rem 0;
  }
}


/* v10 public/menu fixes */
.site-header,
.site-logo,
.site-header * {
  transition: none !important;
}
.public-filter-panel {
  display: block;
}
.public-ks-groups {
  display: flex !important;
  flex-wrap: nowrap;
  gap: .45rem;
  overflow-x: auto;
  width: 100%;
  padding-bottom: .3rem;
}
.public-ks-group {
  flex: 0 0 auto;
}
.public-class-buttons {
  display: flex !important;
  flex-wrap: nowrap;
}
.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.holiday-skip-box {
  margin: 1rem 0;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--blue), var(--blue-hover));
  color: white;
  text-align: center;
  box-shadow: var(--shadow);
}
.holiday-skip-box h2 {
  margin: 0 0 .45rem;
  color: white;
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.holiday-skip-box p {
  margin: .2rem 0;
  font-weight: 800;
}
@media (max-width: 820px) {
  .public-ks-groups {
    display: flex !important;
    flex-wrap: nowrap;
  }
  .public-class-buttons {
    flex-wrap: nowrap;
  }
}

/* v11 warning placement, mobile menu, weather, and emphasis tweaks */
.admin-shell {
  max-width: none;
}
.admin-shell > .card,
.admin-shell > #loginPanel,
.admin-shell > #adminApp > .card:not(.wide-card),
.admin-shell > #adminApp > .tab-panel:not(.wide-card) {
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
}
.tab-nav {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(1rem, calc(50vw - 690px));
  padding-right: max(1rem, calc(50vw - 690px));
  width: auto;
}
.global-safeguarding-warning {
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  border-radius: 0 !important;
  width: auto;
  text-align: center;
}
.warning-short { display: none; }
.mobile-tab-select { display: none; }
.tab-collapse-button { display: none !important; }
.public-week-message-card {
  border-left-width: 8px;
  border-top: 2px solid var(--yellow);
  box-shadow: 0 6px 18px rgba(15, 45, 90, 0.08);
}
.public-week-message-card h3 {
  font-size: clamp(1.18rem, 3vw, 1.55rem) !important;
  line-height: 1.12;
  font-weight: 950;
  color: var(--blue-2);
}
.public-week-message-card p {
  font-size: 1.05rem;
  font-weight: 650;
}
.holiday-skip-box .holiday-date-text {
  display: inline-block;
  margin: .35rem auto;
  padding: .45rem .7rem;
  border: 3px solid #ffdddd;
  border-radius: .65rem;
  background: rgba(255,255,255,.12);
  color: white;
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  font-weight: 950;
}
.weather-toggle-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-top: .45rem;
}
.weather-filter-button {
  min-width: 7rem;
}
.weather-bbc-link {
  font-weight: 850;
  color: var(--blue-2);
}
.public-table .weather-public-col {
  width: 210px;
  max-width: 230px;
}
.weather-day-list {
  display: grid;
  gap: .28rem;
  font-size: .92rem;
  line-height: 1.18;
}
.weather-icon {
  display: inline-block;
  min-width: 1.4rem;
  text-align: center;
}
.weather-bbc-link.in-header {
  color: white;
  text-decoration: underline;
  font-size: .82rem;
}

@media (max-width: 820px) {
  .mobile-tab-select {
    display: inline-block;
    max-width: 12.5rem;
    min-height: 2.45rem;
    border: 2px solid var(--yellow);
    background: white;
    color: var(--blue-2);
    font-weight: 850;
  }
  .tab-nav {
    display: none !important;
  }
  .warning-full { display: none; }
  .warning-short { display: inline; }
  .global-safeguarding-warning {
    font-size: .98rem;
    padding: .55rem .7rem;
  }
  .public-table.weather-enabled td:nth-child(3)::before { content: "Weather"; }
  .public-table.weather-enabled td:nth-child(4)::before { content: "Meal"; }
  .public-table.weather-enabled .weather-public-col,
  .public-table.weather-enabled .meal-public-col {
    display: block;
    width: 100% !important;
    max-width: none;
  }
  .weather-day-list {
    grid-template-columns: 1fr;
  }
  .weather-toggle-row {
    gap: .45rem;
  }
}

/* v12 weather, selection persistence, admin warning/menu fixes */
.public-table .weather-public-col {
  width: 135px !important;
  max-width: 145px !important;
  min-width: 120px;
}
.compact-weather-list {
  gap: .38rem;
  font-size: .78rem;
  line-height: 1.08;
}
.weather-slot {
  display: grid;
  gap: .12rem;
  padding-bottom: .24rem;
  border-bottom: 1px solid rgba(219,227,239,.75);
}
.weather-slot:last-child { border-bottom: 0; padding-bottom: 0; }
.weather-slot-label {
  display: block;
  font-weight: 900;
  color: var(--blue-2);
  font-size: .72rem;
}
.weather-slot-icons {
  display: flex;
  gap: .28rem;
  align-items: center;
  white-space: nowrap;
}
.public-week-message-card {
  text-align: center;
}
.public-week-message-card h3 {
  text-align: center;
  font-size: clamp(1rem, 2.2vw, 1.25rem) !important;
  margin-bottom: .35rem;
}
.public-week-message-card p {
  text-align: center;
  font-size: clamp(1rem, 2.2vw, 1.25rem) !important;
  font-weight: 850;
  color: var(--blue-2);
}
.holiday-skip-box .holiday-date-text {
  border-color: #ffb7b7;
  border-width: 4px;
  font-size: clamp(1.18rem, 2.8vw, 1.6rem);
}
.global-safeguarding-warning:not(.hidden) {
  display: block !important;
}
.mobile-tab-select:empty::before {
  content: "Menu";
}
@media (max-width: 820px) {
  .public-table.weather-enabled .weather-public-col {
    max-width: none !important;
  }
  .compact-weather-list {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .5rem;
  }
  .weather-slot {
    border: 1px solid var(--line);
    border-radius: .55rem;
    padding: .45rem;
    background: #fbfdff;
  }
}


/* v13 closure notices and always-small stable header */
.site-header,
.site-header * {
  transition: none !important;
}
.site-header {
  padding: .35rem .8rem !important;
  border-bottom-width: 3px !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.18) !important;
  min-height: 56px;
}
.site-header h1 {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem) !important;
  margin: 0 !important;
}
.site-header .eyebrow,
.site-header .muted {
  display: none !important;
}
.site-logo-wordless {
  width: 42px !important;
  height: 42px !important;
}
.site-logo-full,
.public-header .site-logo-large {
  display: none !important;
}
.public-header .site-logo-small {
  display: block !important;
}
.tab-nav {
  top: 55px !important;
}
.mobile-tab-select {
  display: none !important;
}
@media (max-width: 820px) {
  .tab-nav {
    display: flex !important;
    overflow-x: auto;
  }
}
.upcoming-closure-notice {
  margin: 0 0 1rem;
  padding: .9rem 1rem;
  border: 3px solid #fff;
  outline: 3px solid #d92d20;
  border-radius: .9rem;
  background: #d92d20;
  color: #fff;
  text-align: center;
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(217,45,32,.22);
}
.upcoming-closure-notice strong,
.upcoming-closure-notice span {
  display: block;
}
.upcoming-closure-notice span {
  margin-top: .25rem;
}
.public-closure-row .event-line strong {
  font-size: 1.08rem;
}


/* v14 weather, closure notices, and fixed safeguarding warning */
.global-safeguarding-warning:not(.hidden) {
  display: block !important;
  position: sticky;
  top: 112px;
  z-index: 89;
  margin-top: 0 !important;
  margin-bottom: .75rem !important;
  box-shadow: 0 8px 24px rgba(180,35,24,.2);
}
.public-table .weather-public-col {
  width: 165px !important;
  max-width: 180px !important;
  min-width: 150px !important;
}
.weather-mini-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: .78rem;
  background: transparent;
  border: 1px solid rgba(20,79,140,.22);
  border-radius: .55rem;
  overflow: hidden;
}
.weather-mini-table th,
.weather-mini-table td {
  border-bottom: 1px solid rgba(20,79,140,.14);
  padding: .24rem .18rem;
  vertical-align: middle;
  background: rgba(255,255,255,.28);
}
.weather-mini-table tr:last-child th,
.weather-mini-table tr:last-child td { border-bottom: 0; }
.weather-mini-table th {
  width: 42%;
  text-align: left;
  font-style: italic;
  font-weight: 950;
  color: var(--blue-2);
}
.weather-icon-cell {
  width: 20%;
  text-align: center;
  font-size: 1.28rem;
  line-height: 1;
}
.weather-temp-cell {
  width: 17%;
  text-align: center;
  font-weight: 900;
  white-space: nowrap;
}
.weather-rain-cell {
  width: 28%;
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
  font-size: .72rem;
}
.public-closure-row .event-line strong {
  font-size: 1.12rem;
  color: var(--ink);
}
@media (max-width: 820px) {
  .global-safeguarding-warning:not(.hidden) {
    top: 108px;
    z-index: 89;
  }
  .public-table.weather-enabled .weather-public-col {
    width: 100% !important;
    max-width: none !important;
  }
  .weather-mini-table {
    font-size: .86rem;
  }
  .weather-icon-cell { font-size: 1.45rem; }
}


/* v15 layout, weather, urgent information and admin refinements */
.tab-nav,
.subtab-nav {
  background: transparent !important;
}

.public-table .weather-public-col {
  width: 330px !important;
  max-width: 360px !important;
  min-width: 300px !important;
}
.weather-mini-table {
  font-size: 1rem !important;
  border: 1px solid rgba(20,79,140,.28);
  background: transparent;
}
.weather-mini-table th,
.weather-mini-table td {
  padding: .35rem .3rem !important;
}
.weather-mini-table th {
  width: 34% !important;
  font-size: 1rem !important;
}
.weather-icon-cell {
  font-size: 1.7rem !important;
}
.weather-rain-cell,
.weather-temp-cell {
  font-size: 1rem !important;
}

.upcoming-closure-notice {
  background: white !important;
  color: #111827 !important;
  border: 4px solid #991b1b !important;
  outline: none !important;
  box-shadow: 0 8px 20px rgba(153,27,27,.15) !important;
}
.upcoming-closure-notice strong {
  color: #7f1d1d !important;
}

.public-week-message-card h3 {
  font-weight: 500 !important;
}
.public-week-message-card p {
  font-weight: 500 !important;
  font-style: italic;
  color: var(--blue-2);
}

.urgent-info-output {
  display: grid;
  gap: .6rem;
  margin-bottom: 1rem;
}
.urgent-info-banner {
  border: 3px solid #991b1b;
  background: #fff1f1;
  color: #111827;
  border-radius: .9rem;
  padding: .8rem 1rem;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-weight: 900;
  text-align: center;
}
.urgent-admin-card h3 {
  max-width: 62rem;
}

.global-safeguarding-warning:not(.hidden) {
  position: sticky !important;
  top: 108px !important;
  z-index: 95 !important;
  width: auto !important;
}

.responsive-calendar[data-calendar="class"] th[data-col-key="holidays"],
.responsive-calendar[data-calendar="class"] th[data-col-key="school_events"],
.responsive-calendar[data-calendar="class"] th[data-col-key="ks_events"],
.responsive-calendar[data-calendar="class"] th[data-col-key="meal"] {
  background: #557396 !important;
}
.wide-card {
  padding-left: 1.75rem !important;
  padding-right: 1.75rem !important;
}
.wide-card .table-wrap {
  margin-left: .65rem;
  margin-right: .65rem;
  max-height: 78vh;
}
.data-table th {
  top: 0 !important;
}

@media (max-width: 820px) {
  .public-table,
  .public-table thead,
  .public-table tbody,
  .public-table tr,
  .public-table th,
  .public-table td {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  .public-table thead { display: none !important; }
  .public-table tr {
    margin-bottom: .9rem !important;
    border: 1px solid var(--line) !important;
    border-radius: .95rem !important;
    overflow: hidden !important;
    background: white !important;
  }
  .public-table td {
    padding: .85rem !important;
  }
  .public-table td::before {
    display: block !important;
    font-weight: 900 !important;
    color: var(--blue-2) !important;
    margin-bottom: .25rem !important;
  }
  .public-table .day-public-col::before { display: none !important; content: "" !important; }
  .public-table .day-public-col {
    background: var(--blue-soft) !important;
    text-align: center;
  }
  .public-table td.event-public-col::before { content: "Events" !important; }
  .public-table.weather-enabled td.weather-public-col::before { content: "Weather" !important; }
  .public-table td.meal-public-col::before { content: "Meal" !important; }
  .weather-mini-table {
    font-size: 1rem !important;
    width: 100% !important;
  }
  .weather-mini-table tr {
    display: grid !important;
    grid-template-columns: minmax(7rem, 1.15fr) 2.8rem 4rem minmax(6.5rem, 1fr) !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .weather-mini-table th,
  .weather-mini-table td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  .weather-mini-table th::before,
  .weather-mini-table td::before { content: none !important; display: none !important; }
  .wide-card {
    padding-left: .8rem !important;
    padding-right: .8rem !important;
  }
  .wide-card .table-wrap {
    margin-left: .15rem;
    margin-right: .15rem;
  }
}


/* v16 urgent/weather/public refinements */
.datetime-action-label {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto;
  gap: .55rem;
  align-items: end;
}
.datetime-action-label label { margin: 0; }
.datetime-action-label button { min-height: 2.65rem; }

.upcoming-closure-notice {
  background: #fff !important;
  border: 3px solid #7f1d1d !important;
  color: #7f1d1d !important;
  box-shadow: none !important;
  font-weight: 400 !important;
}
.upcoming-closure-notice strong,
.upcoming-closure-notice span {
  color: #7f1d1d !important;
  font-weight: 400 !important;
}

.public-week-message-card h3 {
  font-weight: 400 !important;
  text-align: center !important;
}
.public-week-message-card p {
  font-weight: 400 !important;
  font-style: italic !important;
  text-align: center !important;
}

.public-table .weather-public-col {
  width: 330px !important;
  max-width: 380px !important;
  min-width: 300px !important;
}
.weather-string-list {
  display: grid;
  gap: .65rem;
  color: #9ca3af;
  font-size: clamp(1.65rem, 3.6vw, 2.6rem);
  line-height: 1.08;
  font-weight: 400 !important;
}
.weather-string-slot {
  border-bottom: 1px solid rgba(156,163,175,.22);
  padding-bottom: .42rem;
}
.weather-string-slot:last-child { border-bottom: 0; padding-bottom: 0; }
.weather-string-label,
.weather-string-line {
  color: #9ca3af;
  font-weight: 400 !important;
}
.weather-string-label {
  font-size: .45em;
  text-transform: none;
}
.weather-string-line {
  white-space: normal;
}

.global-safeguarding-warning:not(.hidden) {
  display: block !important;
  position: sticky !important;
  top: 112px !important;
  z-index: 300 !important;
  margin: .2rem calc(50% - 50vw) .75rem !important;
  border-radius: 0 !important;
  width: auto !important;
}

@media (max-width: 820px) {
  .datetime-action-label { grid-template-columns: 1fr; }
  .public-table.weather-enabled .weather-public-col {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  .weather-string-list {
    font-size: clamp(1.35rem, 7vw, 2.2rem);
  }
  .global-safeguarding-warning:not(.hidden) {
    top: 104px !important;
  }
}


/* v17 public font and weather readability fixes */
.public-table th {
  font-size: 1.12rem !important;
}
.public-table td {
  font-size: 1.04rem !important;
}
.public-table .day-public-col {
  font-size: 1.08rem !important;
}
.public-day-title {
  font-size: 1.34rem !important;
  line-height: 1.1;
}
.event-public-col .event-line {
  font-size: 1.08rem !important;
  line-height: 1.35;
}
.public-table .weather-public-col {
  width: 330px !important;
  max-width: 390px !important;
  min-width: 300px !important;
}
.weather-string-list {
  font-size: 1.02rem !important;
  line-height: 1.28 !important;
  color: #374151 !important;
  gap: .55rem !important;
}
.weather-string-slot {
  padding-bottom: .38rem !important;
}
.weather-string-label {
  font-size: .96rem !important;
  color: #6b7280 !important;
  font-weight: 650 !important;
}
.weather-string-line {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  color: #374151 !important;
  font-size: 1.02rem !important;
  line-height: 1.15 !important;
}
.weather-emoji {
  display: inline-block;
  font-size: clamp(1.65rem, 3.6vw, 2.6rem) !important;
  line-height: 1 !important;
  vertical-align: middle;
}
.weather-detail {
  font-size: 1.02rem !important;
  color: #374151 !important;
  line-height: 1.2 !important;
}

@media (max-width: 820px) {
  .public-table th { font-size: 1.08rem !important; }
  .public-table td { font-size: 1.03rem !important; }
  .public-day-title { font-size: 1.28rem !important; }
  .event-public-col .event-line { font-size: 1.05rem !important; }
  .weather-string-list { font-size: 1.02rem !important; }
  .weather-string-line { font-size: 1.02rem !important; }
  .weather-detail { font-size: 1.02rem !important; }
  .weather-emoji { font-size: clamp(1.7rem, 8vw, 2.45rem) !important; }
}


/* v18 public mobile-first table sizing, centering and weather link refinement */
.public-table th {
  text-align: center !important;
  font-size: clamp(1.28rem, 4.8vw, 1.42rem) !important;
  line-height: 1.15 !important;
}
.public-table td {
  font-size: clamp(1.12rem, 4.1vw, 1.22rem) !important;
  line-height: 1.38 !important;
}
.public-table .day-public-col,
.public-day-title {
  text-align: center !important;
  font-size: clamp(1.38rem, 5.4vw, 1.62rem) !important;
  line-height: 1.12 !important;
}
.public-table .event-public-col,
.public-table .weather-public-col {
  text-align: center !important;
}
.public-table .meal-public-col {
  text-align: left !important;
}
.public-table .event-public-col .event-line,
.public-class-event-block,
.public-class-event-title,
.event-label {
  font-size: clamp(1.13rem, 4.2vw, 1.24rem) !important;
  line-height: 1.42 !important;
}
.public-class-event-title {
  text-align: center !important;
}
.public-table .weather-public-col {
  width: 235px !important;
  min-width: 210px !important;
  max-width: 260px !important;
}
.weather-bbc-link,
.weather-bbc-link.in-header {
  font-size: .9rem !important;
  display: inline-block;
  margin-top: .25rem;
}
.weather-string-list {
  text-align: center !important;
}
.weather-string-label {
  text-align: center !important;
}
.weather-string-line {
  justify-content: center !important;
}
.weather-detail {
  font-size: 1rem !important;
}
.weather-emoji {
  font-size: clamp(1.65rem, 7vw, 2.35rem) !important;
}
@media (max-width: 820px) {
  .public-table td::before {
    text-align: center !important;
    font-size: clamp(1.18rem, 4.7vw, 1.35rem) !important;
  }
  .public-table .day-public-col,
  .public-day-title {
    font-size: clamp(1.45rem, 6vw, 1.8rem) !important;
  }
  .public-table .event-public-col,
  .public-table .weather-public-col {
    text-align: center !important;
  }
  .public-table .meal-public-col {
    text-align: left !important;
  }
  .public-table .weather-public-col {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}


/* V22 compact permissions and class function tools */
.checkbox-grid .check-card {
  padding: 0.35rem 0.45rem;
  min-height: 0;
  gap: 0.35rem;
}
.checkbox-grid .check-card input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}
.checkbox-grid .check-card:has(input:checked) {
  background: #dceeff;
  border-color: #1765a8;
  color: #103d68;
}
.urgent-past-block {
  border: 1px solid rgba(23,101,168,0.18);
  border-radius: 0.85rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.75);
}
.compact-list .item { padding: 0.55rem 0.7rem; }
.inline-controls { display:flex; gap:0.5rem; align-items:end; flex-wrap:wrap; }
.calendar-bottom-actions { margin-top: 0.75rem; justify-content:center; }
.structure-grid {
  display:grid;
  grid-template-columns: minmax(180px,1fr) minmax(210px,auto) auto;
  gap:0.75rem;
  align-items:center;
}
.structure-ks-grid { margin-bottom:0.75rem; }
.structure-functions {
  display:flex;
  gap:0.35rem;
  align-items:center;
  flex-wrap:wrap;
  justify-content:center;
}
.function-check {
  display:inline-flex;
  align-items:center;
  gap:0.25rem;
  padding:0.25rem 0.45rem;
  border:1px solid rgba(23,101,168,0.25);
  border-radius:999px;
  background:#fff;
  font-size:0.82rem;
}
.function-check:has(input:checked) { background:#dceeff; border-color:#1765a8; }
.function-check input { width:0.95rem; height:0.95rem; }
.tiny-label { font-size:0.75rem; width:100%; text-align:center; }
.function-col { width:7.5rem; min-width:7.5rem; max-width:8.5rem; text-align:center; background:#f8fbff; }
th.function-col { font-size:0.8rem; line-height:1.1; }
.function-week-cell { vertical-align:middle; }
.function-mini-button { padding:0.3rem 0.5rem; font-size:0.82rem; }
.function-count { display:block; margin-top:0.25rem; font-size:0.75rem; color:#4f6478; }
.modal-backdrop {
  position:fixed; inset:0; z-index:3000; background:rgba(8,25,43,0.45);
  display:flex; align-items:center; justify-content:center; padding:1rem;
}
.modal-backdrop.hidden { display:none; }
.modal-panel {
  width:min(900px, 96vw); max-height:92vh; overflow:auto;
  background:#fff; border-radius:1rem; box-shadow:0 22px 80px rgba(0,0,0,.28); padding:1rem;
}
.modal-heading { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; border-bottom:1px solid #dde8f4; padding-bottom:0.75rem; margin-bottom:0.75rem; }
.spelling-grid-list { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:0.45rem; }
.spelling-grid-input { padding:0.55rem; border:1px solid #bdd0e2; border-radius:0.45rem; font-size:1rem; }
.phonics-choice-grid { display:flex; flex-wrap:wrap; gap:0.45rem; }
.phonics-choice { background:#fff; color:#103d68; border:1px solid #b6d0ea; }
.phonics-choice.selected { background:#1765a8; color:#fff; border-color:#1765a8; }
.phonics-library-item { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
@media (max-width: 760px) {
  .structure-grid { grid-template-columns: 1fr; }
  .structure-functions { justify-content:flex-start; }
  .tiny-label { text-align:left; }
  .spelling-grid-list { grid-template-columns:1fr; }
  .modal-panel { width:98vw; padding:0.75rem; }
}


/* v23 loading/error feedback */
.loading-panel,
.error-panel {
  margin: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 2px solid rgba(23, 101, 168, 0.25);
  background: rgba(255, 255, 255, 0.92);
}
.loading-panel strong {
  color: var(--blue, #1765a8);
  font-size: 1.15rem;
}
.error-panel {
  border-color: rgba(150, 0, 0, 0.35);
}
.error-panel strong {
  color: #7f1d1d;
}
.loading-note {
  padding: 0.8rem 1rem;
}


/* v24 class-function modal fixes */
.copy-week-panel {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 2px solid rgba(23, 101, 168, 0.22);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
}
.copy-week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.45rem;
}
.copy-week-grid button {
  text-align: center;
}
.class-function-modal .modal-heading {
  align-items: flex-start;
}


/* v25 stability/cleanup */
.checkbox-grid .check-card {
  padding: 0.35rem 0.45rem;
  gap: 0.35rem;
}
.checkbox-grid .check-card input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
}
.checkbox-grid .check-card:has(input:checked),
.function-check:has(input:checked) {
  background: rgba(23, 101, 168, 0.13);
  border-color: rgba(23, 101, 168, 0.55);
}
.loading-note {
  padding: 0.75rem 0.9rem;
}
.hidden {
  display: none !important;
}


/* v26 class/meal/admin tweaks */
.site-header {
  position: relative;
}
.admin-banner-year {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 900px) {
  .admin-banner-year {
    position: static;
    transform: none;
    order: 2;
    width: 100%;
    font-size: 1.15rem;
    text-align: left;
  }
  .site-header {
    flex-wrap: wrap;
  }
}
.responsive-calendar[data-calendar="class"] th {
  top: 155px !important;
}
@media (max-width: 820px) {
  .responsive-calendar[data-calendar="class"] th {
    top: 0 !important;
  }
}
.function-col {
  min-width: 105px;
  width: 105px;
}
.meal-allocation-toggle-row {
  margin-bottom: .75rem;
}


/* v27 phase-based phonics */
.phonics-admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.4fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.card-lite {
  background: rgba(255,255,255,0.82);
  border: 2px solid rgba(23,101,168,0.14);
  border-radius: 16px;
  padding: 1rem;
}
.phase-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}
.phase-select-button,
.phonics-choice,
.phonic-edit-button {
  border: 2px solid rgba(23,101,168,0.32);
  background: #fff;
  border-radius: 999px;
  padding: .45rem .7rem;
  cursor: pointer;
}
.phase-select-button.selected,
.phonics-choice.selected,
.phonic-edit-button.selected {
  background: var(--blue, #1765a8);
  color: #fff;
  border-color: var(--blue, #1765a8);
}
.phonics-edit-list,
.phase-item {
  display: grid;
  gap: .5rem;
}
.phonic-group,
.phonic-picker-group {
  margin: .75rem 0;
  padding: .65rem;
  border: 1px solid rgba(23,101,168,0.14);
  border-radius: 14px;
  background: rgba(255,255,255,0.65);
}
.phonic-group h4,
.phonic-picker-group h3 {
  margin: 0 0 .45rem;
  color: var(--blue, #1765a8);
}
.phase-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.phase-item input {
  width: 100%;
}
.phonics-picker-tools {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 1fr);
  gap: .75rem;
  margin-bottom: .85rem;
}
.phonic-picker-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
@media (max-width: 980px) {
  .phonics-admin-grid {
    grid-template-columns: 1fr;
  }
  .phonics-picker-tools {
    grid-template-columns: 1fr;
  }
}


/* v28 Class Events repair */
.responsive-calendar[data-calendar="class"] th {
  top: 0 !important;
}

.routine-save-actions {
  justify-content: center !important;
  margin-top: 0.85rem !important;
  padding-top: 0.45rem;
}
.routine-save-actions button {
  min-width: min(280px, 100%);
}

@media (max-width: 820px) {
  body.calendar-warning-visible {
    padding-bottom: 4.25rem;
  }
  .global-safeguarding-warning:not(.hidden) {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 1200 !important;
    padding: 0.55rem 0.75rem !important;
    box-shadow: 0 -5px 18px rgba(180,35,24,.2) !important;
  }
}


/* v29 Class/Public/Admin navigation tweaks */
.site-header {
  position: sticky !important;
  top: 0;
  z-index: 1300;
}
.admin-body .tab-nav {
  position: sticky;
  top: 55px;
  z-index: 1200;
}

/* Smaller date column with full dd/mm/yyyy date */
.data-table .date-col {
  min-width: 112px !important;
  width: 112px !important;
  max-width: 112px;
}
.week-message-title {
  font-size: .9rem;
  line-height: 1.15;
}

/* Class/Event function buttons now live inside the weekly row cells */
.function-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-top: .45rem;
}
.function-inline-chip {
  display: inline-flex;
  gap: .25rem;
  align-items: center;
  padding: .2rem .25rem;
  border: 1px solid rgba(23,101,168,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}
.teacher-message-click {
  min-height: 1.8rem;
  cursor: pointer;
}
.teacher-message-click:hover {
  outline: 2px solid rgba(23,101,168,.22);
  border-radius: .5rem;
}

/* Saved phonics buttons in edit list should have black text, not white */
.phonic-edit-button,
.phonic-edit-button.selected {
  color: #111 !important;
}
.phonic-edit-button.selected {
  background: var(--yellow) !important;
  border-color: var(--yellow-2) !important;
}

/* Mobile admin nav: current page + dropdown */
.mobile-tab-header {
  display: none;
}
@media (max-width: 820px) {
  .admin-body .site-header {
    position: sticky !important;
    top: 0;
    z-index: 1500;
  }
  .admin-body .tab-nav {
    display: none !important;
  }
  .mobile-tab-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: center;
    position: sticky;
    top: 54px;
    z-index: 1400;
    background: rgba(255,255,255,.96);
    border: 2px solid rgba(23,101,168,.18);
    border-radius: 14px;
    padding: .55rem;
    margin: .45rem .35rem .7rem;
    box-shadow: 0 6px 18px rgba(0,0,0,.10);
  }
  .mobile-tab-current {
    display: grid;
    gap: .05rem;
  }
  .mobile-tab-current strong {
    color: var(--blue-2);
    font-size: 1.08rem;
  }
  .mobile-tab-menu {
    grid-column: 1 / -1;
    display: grid;
    gap: .35rem;
    background: var(--blue-soft);
    border: 2px solid #c6d9ef;
    border-radius: 12px;
    padding: .5rem;
  }
  .mobile-tab-menu button {
    background: var(--blue-soft);
    color: var(--blue-2);
    border: 1px solid #c6d9ef;
    text-align: left;
    justify-content: flex-start;
  }
  .mobile-tab-menu button.active {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow-2);
  }

  /* Raise the column picker above the fixed warning. */
  .mobile-column-picker.active {
    bottom: 3.8rem !important;
    z-index: 1250 !important;
  }
  body.calendar-warning-visible {
    padding-bottom: 8.25rem;
  }
  #tab-school-calendars,
  #tab-class-calendars {
    padding-bottom: 9rem;
  }
}


/* v30: tighter event date column, mobile picker scroll, public resources */
.data-table .date-col {
  min-width: 92px !important;
  width: 92px !important;
  max-width: 92px !important;
  white-space: nowrap;
}
.data-table th.date-col,
.data-table td.date-col {
  padding-left: .32rem !important;
  padding-right: .32rem !important;
}
.week-message-title {
  font-size: .8rem !important;
  line-height: 1.1;
}
.teacher-message-cell {
  text-align: center;
}
.teacher-message-cell-inner {
  display: grid;
  gap: .38rem;
  align-content: start;
  justify-items: center;
  text-align: center;
  min-height: 100%;
}
.teacher-message-heading {
  color: var(--blue-2);
  font-weight: 900;
}
.teacher-message-click {
  width: 100%;
  text-align: center;
}
.teacher-message-cell .function-inline-row {
  justify-content: center;
  margin-top: .25rem;
}
@media (max-width: 820px) {
  .mobile-column-picker.active {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .mobile-column-picker button {
    flex: 0 0 auto;
  }
}

/* Public spellings/phonics resource cards */
.public-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .65rem;
  margin: .75rem 0 1rem;
}
.public-resource-card {
  background: var(--blue-soft);
  color: var(--blue-2);
  border: 2px solid rgba(20,79,140,.22);
  border-radius: 1rem;
  padding: .85rem 1rem;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(15,45,90,.08);
}
.public-resource-card:hover {
  background: #d9ebfb;
  color: var(--blue-2);
}
.public-resource-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(8, 20, 40, .55);
  padding: min(3vw, 1.25rem);
  display: grid;
  place-items: center;
}
.public-resource-modal.hidden {
  display: none !important;
}
.public-resource-panel {
  width: min(980px, 96vw);
  height: min(820px, 94vh);
  background: #fffdf6;
  border: 4px solid var(--blue);
  border-radius: 1.25rem;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  font-family: "Comic Sans MS", "Comic Neue", "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}
.public-resource-panel.fallback-fullscreen {
  position: fixed;
  inset: .5rem;
  width: auto;
  height: auto;
  z-index: 3050;
}
.public-resource-panel-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  padding: .75rem 1rem;
  background: var(--blue);
  color: white;
}
.public-resource-panel-header h2 {
  margin: 0;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
}
.public-resource-header-actions {
  display: flex;
  gap: .45rem;
  align-items: center;
}
.public-resource-header-actions button:last-child {
  font-size: 1.4rem;
  line-height: 1;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
}
.public-resource-controls {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: .7rem;
  border-bottom: 1px solid var(--line);
  background: #fff8df;
}
.public-resource-body {
  overflow: auto;
  padding: 1rem;
}
.public-phonics-list,
.public-spellings-list {
  display: grid;
  gap: 1rem;
}
.public-phonic-card {
  display: grid;
  justify-items: center;
  gap: .55rem;
  padding: 1rem;
  border: 3px solid rgba(20,79,140,.18);
  border-radius: 1.1rem;
  background: white;
}
.public-phonic-card.playing,
.public-spelling-word.playing {
  outline: 5px solid var(--yellow);
  background: #fff8df;
}
.public-phonic-image-button {
  background: white;
  color: var(--blue-2);
  border: 3px solid var(--blue-soft);
  border-radius: 1rem;
  padding: .5rem;
  width: min(360px, 82vw);
  min-height: 210px;
  display: grid;
  place-items: center;
}
.public-phonic-image-button:hover {
  background: #f8fbff;
  color: var(--blue-2);
}
.public-phonic-image-button img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: .7rem;
}
.public-phonic-placeholder {
  font-size: clamp(3rem, 16vw, 8rem);
  color: var(--blue-2);
}
.public-phonic-card h3 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 4.5rem);
  color: var(--blue-2);
}
.public-spelling-help {
  text-align: center;
  color: var(--muted);
  margin-bottom: .85rem;
}
.public-spellings-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.public-spelling-word {
  background: white;
  color: var(--blue-2);
  border: 3px solid var(--blue-soft);
  border-radius: 1rem;
  padding: 1rem;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
}
.public-spelling-word:hover {
  background: #f8fbff;
  color: var(--blue-2);
}
body.public-resource-open {
  overflow: hidden;
}
@media (max-width: 640px) {
  .public-resource-panel-header {
    align-items: flex-start;
  }
  .public-resource-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .public-resource-controls button {
    flex: 1 1 44%;
  }
}


/* v31 Manage Classes and phonics/spelling reading refinements */
.phase-select-button {
  color: #111 !important;
}
.phase-select-button.selected {
  color: #111 !important;
  background: var(--yellow) !important;
  border-color: var(--yellow-2) !important;
}
.phonic-edit-preview {
  display: grid;
  gap: .65rem;
  justify-items: center;
  padding: .65rem;
  border: 1px solid rgba(23,101,168,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.7);
}
.phonic-edit-image-preview {
  width: 100%;
  max-width: 260px;
  max-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(23,101,168,.15);
}
.phonic-edit-image-preview img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}
.phonic-preview-placeholder {
  padding: 1rem;
  color: var(--muted);
}
.spelling-reading-section {
  margin-top: 1rem;
}
.spelling-reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .85rem;
}
.spelling-reading-grid fieldset {
  border: 2px solid rgba(23,101,168,.18);
  border-radius: 14px;
  padding: .85rem;
  background: rgba(255,255,255,.65);
}
.spelling-reading-grid legend {
  font-weight: 900;
  color: var(--blue-2);
}
.spelling-reading-actions {
  margin-top: .85rem;
}
.spelling-reading-sample {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid rgba(23,101,168,.18);
  border-radius: 14px;
  padding: .85rem;
  max-height: 240px;
  overflow: auto;
}

/* v31 public audio controls */
.public-audio-warning {
  flex: 1 1 100%;
  margin: 0 0 .35rem;
  text-align: center;
  color: #7a4a00;
  font-weight: 700;
}
.public-resource-modal.public-playback-running .public-resource-controls button:not([data-public-stop="true"]):not([data-public-pause="true"]),
.public-resource-modal.public-playback-running .public-resource-body button {
  opacity: .45;
  cursor: not-allowed;
}
.stop-flicker {
  animation: stopFlicker 0.28s ease-in-out 0s 4 alternate;
}
@keyframes stopFlicker {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(176, 36, 24, 0); }
  to { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(176, 36, 24, .25); }
}


/* v32 future school events */
.future-school-events-section {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(255,255,255,0.78);
  border: 2px solid rgba(23,101,168,.18);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(15,45,90,.08);
}
.future-school-events-section h2 {
  margin-top: 0;
  color: var(--blue-2);
  text-align: center;
}
.future-school-events-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
}
.future-school-events-table th,
.future-school-events-table td {
  border: 1px solid rgba(23,101,168,.16);
  padding: .65rem .75rem;
  vertical-align: top;
}
.future-school-events-table th {
  background: var(--blue-soft);
  color: var(--blue-2);
  text-align: left;
}
.future-event-date {
  width: 9.5rem;
  white-space: nowrap;
  font-weight: 800;
}
.future-event-type {
  width: 7.5rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .future-school-events-table,
  .future-school-events-table thead,
  .future-school-events-table tbody,
  .future-school-events-table tr,
  .future-school-events-table th,
  .future-school-events-table td {
    display: block;
  }
  .future-school-events-table thead {
    display: none;
  }
  .future-school-events-table tr {
    border: 1px solid rgba(23,101,168,.16);
    margin-bottom: .6rem;
    border-radius: 12px;
    overflow: hidden;
  }
  .future-school-events-table td {
    border: 0;
  }
  .future-event-date,
  .future-event-type {
    width: auto;
  }
}


/* v33 public class PIN and future event month loading */
.routine-class-heading {
  display: grid;
  grid-template-columns: 1fr minmax(170px, 220px);
  gap: .75rem;
  align-items: end;
}
.class-pin-label {
  font-weight: 800;
}
.class-pin-label input {
  margin-top: .2rem;
  width: 100%;
  text-align: center;
  letter-spacing: .12em;
}
.class-pin-help {
  margin-top: .15rem;
}
.filter-button.remembered-locked {
  background: #f7fbff;
  color: var(--blue-2);
  border-style: dashed;
}
.class-pin-modal {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8,20,40,.52);
}
.class-pin-modal.hidden {
  display: none !important;
}
.class-pin-panel {
  width: min(520px, 94vw);
  max-height: min(720px, 90vh);
  overflow: auto;
  background: #fffdf6;
  border: 4px solid var(--blue);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 20px 70px rgba(0,0,0,.35);
}
.class-pin-panel h2 {
  margin-top: 0;
  color: var(--blue-2);
  text-align: center;
}
.class-pin-rows {
  display: grid;
  gap: .75rem;
}
.class-pin-row {
  display: grid;
  gap: .3rem;
  font-weight: 900;
}
.class-pin-row input {
  font-size: 1.2rem;
  padding: .65rem;
  border-radius: 12px;
  border: 2px solid rgba(23,101,168,.25);
  text-align: center;
  letter-spacing: .16em;
}
.pin-validation-message {
  min-height: 1.1rem;
  color: #9b1c1c;
  font-size: .9rem;
  font-weight: 700;
}
.class-pin-actions {
  justify-content: center;
  margin-top: 1rem;
}
.future-school-events-actions {
  display: flex;
  justify-content: center;
  margin-top: .85rem;
}
@media (max-width: 720px) {
  .routine-class-heading {
    grid-template-columns: 1fr;
  }
}


/* v34 no remembered class unlocks + year calendar page */
.filter-button.remembered-locked {
  background: #f7fbff;
  color: var(--blue-2);
  border-style: dashed;
}
.year-calendar-container {
  margin-top: 1rem;
}
.year-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1rem;
}
.year-month-card {
  background: rgba(255,255,255,.86);
  border: 2px solid rgba(23,101,168,.18);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15,45,90,.08);
}
.year-month-card h3 {
  margin: 0;
  padding: .75rem 1rem;
  color: var(--blue-2);
  background: var(--blue-soft);
  text-align: center;
}
.year-month-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.year-month-table th,
.year-month-table td {
  border: 1px solid rgba(23,101,168,.14);
  text-align: center;
  vertical-align: top;
}
.year-month-table th {
  font-size: .78rem;
  padding: .35rem .15rem;
  color: var(--blue-2);
  background: #f6fbff;
}
.year-month-table td {
  height: 4.6rem;
  padding: .28rem .18rem;
  font-size: .82rem;
  background: white;
}
.year-month-table td strong {
  display: block;
  font-size: .95rem;
  margin-bottom: .12rem;
}
.year-month-table td span {
  display: block;
  font-size: .7rem;
  line-height: 1.05;
}
.year-month-table .holiday-day {
  background: #fff4c8;
}
.year-month-table .closed-day {
  background: #ffe2df;
}
.year-month-table .out-of-year,
.year-month-table .year-empty {
  background: #f3f5f8;
  color: #9aa4b2;
}
.year-school-events-list {
  margin-top: 1.25rem;
}
@media (max-width: 640px) {
  .year-calendar-grid {
    grid-template-columns: 1fr;
  }
  .year-month-table td {
    height: 4.2rem;
    font-size: .76rem;
  }
  .year-month-table td span {
    font-size: .62rem;
  }
}


/* v35 public loading/year-calendar fixes */
.public-controls,
.public-controls .section-heading,
.public-controls .section-heading > div,
.public-controls .public-ks-group,
.public-controls .weather-toggle-row,
.public-controls .view-year-calendar-row {
  text-align: center;
  justify-content: center;
}
.public-controls .section-heading {
  flex-direction: column;
}
.public-controls .public-class-buttons,
.public-controls .weather-toggle-row,
.view-year-calendar-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.button-link.view-year-calendar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue-2);
  border: 2px solid rgba(20,79,140,.22);
  border-radius: 999px;
  padding: .65rem 1rem;
  font-weight: 900;
  text-decoration: none;
}
.button-link.view-year-calendar-button:hover {
  background: #d9ebfb;
  color: var(--blue-2);
}

.year-month-card {
  box-shadow: none !important;
}
.year-month-table .school_holiday-day {
  background: var(--holiday-blue) !important;
}
.year-month-table .inset_day-day {
  background: #fff1ba !important;
}
.year-month-table .admin_day-day {
  background: #e2f2ea !important;
}
.year-month-table .weekend-day {
  background: var(--weekend-grey);
  color: #6b7280;
}
.year-month-table .out-of-year {
  background: #f3f5f8 !important;
  color: #9aa4b2 !important;
}


/* v36 spelling set controls and year calendar list updates */
.spelling-set-check {
  gap: .28rem;
}
.spelling-name-edit {
  border: 0 !important;
  background: transparent !important;
  color: var(--blue-2) !important;
  padding: .05rem .15rem !important;
  min-width: auto !important;
  font-size: .95rem;
  box-shadow: none !important;
}
.spelling-name-edit:hover {
  background: rgba(23,101,168,.08) !important;
}
.year-month-table td span {
  display: none !important;
}
.year-month-table td.school_holiday-day strong,
.year-month-table td.inset_day-day strong,
.year-month-table td.admin_day-day strong {
  font-weight: 900;
}
.future-school-events-table td:nth-child(4),
.future-school-events-table th:nth-child(4) {
  white-space: nowrap;
}


/* v37 Year Calendar two-column bottom lists */
.year-calendar-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
.year-calendar-bottom-card {
  margin-top: 0 !important;
  align-self: start;
}
.year-calendar-list-table .future-event-date {
  width: 8.5rem;
}
@media (max-width: 900px) {
  .year-calendar-bottom-grid {
    grid-template-columns: 1fr;
  }
}


/* v38 year calendar, published years, public advance events and phonics extras */
.compact-key-stage-form { gap: .45rem !important; }
.compact-key-stage-form h3 { margin-bottom: .2rem !important; }
.compact-key-stage-form label { margin-top: 0 !important; }
.publish-years-card { margin: .9rem 0 1rem; }
.published-year-list { display:flex; flex-wrap:wrap; gap:.55rem; }
.published-year-check { display:inline-flex; align-items:center; gap:.4rem; padding:.45rem .65rem; border:1px solid rgba(23,101,168,.2); border-radius:999px; background:#fff; font-weight:800; }
.published-year-check em { color:var(--muted); font-style:normal; font-weight:600; font-size:.85rem; }
.advance-star-button { border:2px solid rgba(23,101,168,.22) !important; background:#fff !important; color:var(--blue-2) !important; border-radius:999px !important; padding:.1rem .35rem !important; line-height:1; min-width:auto !important; box-shadow:none !important; font-size:1.1rem; }
.advance-star-button.selected { background:var(--yellow) !important; border-color:var(--yellow-2) !important; color:var(--ink) !important; }
.class-day-cell-content { display:grid; gap:.35rem; justify-items:center; }
.public-advance-events { display:grid; gap:.55rem; margin:.7rem 0 1rem; text-align:center; }
.public-advance-events h3 { margin:0; color:var(--blue-2); }
.public-advance-event-card { display:flex; justify-content:space-between; gap:.75rem; align-items:center; background:#fff; border:2px solid rgba(23,101,168,.16); border-radius:1rem; padding:.75rem; }
.public-advance-event-card p { margin:.35rem 0 0; }
.phonics-extra-actions,.phonics-extra-fields { display:grid; gap:.55rem; margin-top:.75rem; }
.phonics-extra-actions { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); }
.public-phonics-extra-list { display:grid; gap:.65rem; margin-top:1rem; }
.public-phonics-extra-list article { background:#fff; border:2px solid rgba(23,101,168,.16); border-radius:1rem; padding:.8rem; text-align:center; }
.phonics-sub-buttons { display:flex; gap:.5rem; flex-wrap:wrap; justify-content:center; margin-bottom:.85rem; }
.phonics-sub-panel { background:#fff; border:2px solid rgba(23,101,168,.16); border-radius:1rem; padding:.85rem; margin-bottom:.85rem; }
.year-calendar-body .hero-card,.year-calendar-body .hero-card h2,.year-calendar-body .hero-card p,.year-month-card h3,.year-month-table,.year-calendar-bottom-card h2 { text-align:center; }
.year-month-table td { height:2.35rem !important; padding:.12rem .08rem !important; }
.year-month-table td strong { margin-bottom:0 !important; }
.year-month-table td span { display:none !important; }
.year-calendar-buttons { display:flex; flex-wrap:wrap; gap:.45rem; justify-content:center; margin:.75rem 0; }
.year-calendar-key { display:flex; flex-wrap:wrap; gap:.75rem; justify-content:center; align-items:center; margin:.5rem 0 1rem; font-weight:800; }
.year-calendar-key span { display:inline-flex; align-items:center; gap:.3rem; }
.year-calendar-key .key-swatch { width:1rem; height:1rem; display:inline-block; border:1px solid rgba(0,0,0,.18); border-radius:.25rem; }
.weekend-swatch { background:var(--weekend-grey); }
@media (max-width:640px) { .public-advance-event-card { flex-direction:column; } }


/* v39 future class events, phonics sub-panels, Year Calendar centring */
.future-to-be-aware {
  margin: .8rem 0 1rem;
}
.future-to-be-aware h2 {
  margin: 0 0 .5rem;
  color: var(--blue-2);
  text-align: center;
}
.phonics-sub-buttons button.selected,
.phonics-sub-buttons button[aria-pressed="true"] {
  background: var(--yellow) !important;
  color: #111 !important;
  border-color: var(--yellow-2) !important;
}
.phonics-sub-panel.hidden,
.phonics-setup-panel.hidden {
  display: none !important;
}
.year-calendar-body .hero-card,
.year-calendar-body .hero-card h2,
.year-calendar-body .hero-card p,
#yearCalendarStatus,
.year-calendar-buttons,
.year-calendar-key {
  text-align: center !important;
}
.year-calendar-body .hero-card {
  align-items: center;
}
.year-calendar-buttons {
  justify-content: center !important;
}
.year-month-table td {
  height: 1.9rem !important;
  padding: .08rem .05rem !important;
}
.year-month-table td strong {
  font-size: .86rem !important;
  line-height: 1 !important;
}
.year-month-table th {
  padding: .22rem .05rem !important;
  font-size: .7rem !important;
}


/* v40 parent-event stars, phonics PDF, form tidy-ups */
.future-to-be-aware .public-advance-event-card strong {
  font-size: 1rem;
}
.tidy-key-stage-form {
  align-content: start;
  gap: .45rem !important;
}
.tidy-key-stage-form h3 {
  margin-bottom: .15rem !important;
}
.tidy-key-stage-form label {
  margin-top: 0 !important;
}
.same-size-add-button {
  min-height: 2.55rem;
}
#keyStageNameInput {
  min-height: 2.55rem;
}
.year-calendar-body .hero-card,
.year-calendar-body .hero-card h2,
.year-calendar-body .hero-card p,
.year-calendar-buttons,
.year-calendar-key,
#yearCalendarStatus {
  text-align: center !important;
}
.year-calendar-buttons,
.year-calendar-key {
  justify-content: center !important;
}
.year-month-table td {
  height: 1.75rem !important;
  padding: .06rem .04rem !important;
}
.year-month-table td strong {
  font-size: .82rem !important;
  line-height: 1 !important;
}


/* v41 Public/Bank holiday day type */
.public_bank_holiday-day,
.year-month-table .public_bank_holiday-day,
.master-calendar-table .public_bank_holiday-day,
.data-table .public_bank_holiday-day {
  background: #4b5563 !important;
  color: #ffffff !important;
}
.public_bank_holiday-day strong,
.year-month-table .public_bank_holiday-day strong {
  color: #ffffff !important;
}
.status-key .public_bank_holiday-day,
.calendar-key .public_bank_holiday-day,
.year-calendar-key .public_bank_holiday-day {
  background: #4b5563 !important;
  color: #ffffff !important;
}


/* v42 Manage Calendar Public/Bank holiday dropdown/key */
.key-swatch.public_bank_holiday,
.day-cell.public_bank_holiday,
.master-calendar-table .public_bank_holiday,
.public_bank_holiday-row td {
  background: #4b5563 !important;
  color: #ffffff !important;
  border-color: #374151 !important;
}
.day-cell.today-date.public_bank_holiday {
  background: #4b5563 !important;
  color: #ffffff !important;
  outline-color: var(--yellow-2);
}


/* v47 event list generator and compact routines */
.heading-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.routine-editor {
  gap: .45rem !important;
  margin: .55rem 0 .75rem !important;
}
.routine-class-card {
  padding: .55rem !important;
  border-radius: .65rem !important;
}
.routine-class-heading {
  grid-template-columns: 1fr minmax(135px, 180px) !important;
  gap: .45rem !important;
  align-items: center !important;
}
.routine-class-heading h3 {
  margin: 0 !important;
  font-size: 1rem !important;
}
.class-pin-label {
  font-size: .82rem !important;
}
.class-pin-label input {
  padding: .32rem .42rem !important;
  min-height: 2rem !important;
}
.compact-pin-help {
  margin: .2rem 0 .35rem !important;
  font-size: .78rem !important;
}
.weekday-routine-grid {
  gap: .35rem !important;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) !important;
}
.weekday-routine-grid label {
  font-size: .78rem !important;
  gap: .18rem !important;
}
.weekday-routine-grid textarea {
  min-height: 2.25rem !important;
  padding: .32rem .4rem !important;
  font-size: .88rem !important;
}
.routine-save-actions {
  margin-top: .45rem !important;
  padding-top: .15rem !important;
}
.routine-save-actions button {
  min-width: min(220px, 100%) !important;
  padding: .45rem .7rem !important;
}
@media (max-width: 820px) {
  .heading-actions {
    justify-content: stretch;
  }
  .heading-actions button {
    flex: 1 1 auto;
  }
  .weekday-routine-grid {
    grid-template-columns: 1fr !important;
  }
}


/* v48: restore Class Events routine editor to fuller size after v47 compact trial */
.routine-editor {
  gap: .8rem !important;
  margin: .9rem 0 1.1rem !important;
}
.routine-class-card {
  padding: .9rem !important;
  border-radius: .9rem !important;
}
.routine-class-heading {
  grid-template-columns: 1fr minmax(170px, 240px) !important;
  gap: .75rem !important;
  align-items: start !important;
}
.routine-class-heading h3 {
  margin: 0 0 .25rem !important;
  font-size: 1.1rem !important;
}
.class-pin-label {
  font-size: .9rem !important;
}
.class-pin-label input {
  padding: .55rem .65rem !important;
  min-height: 2.55rem !important;
}
.class-pin-help {
  margin: .45rem 0 .7rem !important;
  font-size: .88rem !important;
}
.weekday-routine-grid {
  gap: .65rem !important;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) !important;
}
.weekday-routine-grid label {
  font-size: .9rem !important;
  gap: .28rem !important;
}
.weekday-routine-grid textarea {
  min-height: 4.25rem !important;
  padding: .55rem .65rem !important;
  font-size: .95rem !important;
}
.routine-save-actions {
  margin-top: .8rem !important;
  padding-top: .35rem !important;
}
.routine-save-actions button {
  min-width: min(300px, 100%) !important;
  padding: .65rem 1rem !important;
}
@media (max-width: 820px) {
  .weekday-routine-grid {
    grid-template-columns: 1fr !important;
  }
}


/* v49: safer child-friendly fallback and no cursive fallback */
.public-resource-viewer,
.public-resource-viewer *,
.spelling-reader,
.spelling-reader *,
.phonics-viewer,
.phonics-viewer *,
.public-spellings-modal,
.public-phonics-modal {
  font-family: "Comic Sans MS", "Comic Neue", "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif !important;
}


/* v49: hide old public fullscreen controls if cached markup remains */
.public-resource-fullscreen,
.fullscreen-public-button,
button[title="Full screen"],
button[aria-label="Full screen"] {
  display: none !important;
}


/* v50 information/useful links */
.information-section {
  border: 1px solid #d9e6f2;
  border-radius: 1rem;
  padding: 1rem;
  margin: 1rem 0;
  background: #fbfdff;
}
.useful-links-editor-grid {
  align-items: stretch;
}
.useful-link-preview-panel {
  border: 1px dashed #b8c7d8;
  border-radius: .9rem;
  padding: .85rem;
  background: #fff;
}
.useful-admin-preview-card,
.useful-public-link-card {
  display: grid;
  gap: .35rem;
  border: 1px solid #d9e6f2;
  border-radius: .9rem;
  padding: .85rem;
  background: #fff;
  text-decoration: none;
}
.useful-admin-preview-card h4,
.useful-public-link-card strong {
  margin: 0;
  color: #1765a8;
}
.useful-admin-preview-card a {
  word-break: break-word;
}
.useful-admin-link-item,
.useful-category-item {
  align-items: start;
}
.useful-admin-link-content {
  min-width: 0;
}
.useful-public-category {
  margin: 1rem 0 1.3rem;
}
.useful-public-category h3 {
  color: #1765a8;
  border-bottom: 2px solid #f2c94c;
  padding-bottom: .35rem;
}
.useful-public-link-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.useful-public-link-card:hover,
.useful-public-link-card:focus {
  border-color: #1765a8;
  box-shadow: 0 4px 12px rgba(23,101,168,.14);
}
.view-useful-links-button {
  margin-left: .45rem;
}
.inline-calendar-button {
  display: inline-flex;
  margin-left: .45rem;
  padding: .25rem .5rem;
  font-size: .78rem;
  vertical-align: middle;
}
.meal-row textarea,
#mealOverrideMainInput {
  width: 100%;
  resize: vertical;
}
@media (max-width: 640px) {
  .view-useful-links-button {
    margin-left: 0;
    margin-top: .45rem;
  }
  .inline-calendar-button {
    margin-left: 0;
    margin-top: .25rem;
  }
}


/* v51 useful links and public button polish */
.view-year-calendar-row {
  flex-direction: column;
  gap: .45rem !important;
}
.button-link.view-useful-links-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-soft);
  color: var(--blue-2);
  border: 2px solid rgba(20,79,140,.22);
  border-radius: 999px;
  padding: .65rem 1rem;
  font-weight: 900;
  text-decoration: none;
  margin-left: 0 !important;
}
.button-link.view-useful-links-button:hover {
  background: #d9ebfb;
  color: var(--blue-2);
}
.useful-links-page .site-header {
  min-height: 96px;
  max-height: 112px;
  overflow: hidden;
}
.useful-links-page .site-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.useful-admin-preview-card h4 a {
  color: var(--blue-2);
  text-decoration: none;
}
.useful-admin-link-item,
.useful-category-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center !important;
}
.useful-admin-link-item .form-actions,
.useful-category-item .form-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: .35rem;
}
.useful-admin-link-item .form-actions button,
.useful-category-item .form-actions button {
  min-width: 2.2rem;
  padding: .4rem .55rem;
}
.urgent-past-block {
  margin-top: 1rem;
}

/* v51 public resource cards */
.public-resource-grid {
  gap: .85rem !important;
}
.public-resource-card {
  min-height: 4.3rem;
  padding: 1rem 1.15rem !important;
  border-width: 2px !important;
}
.public-resource-card span {
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 950;
  line-height: 1.2;
}

/* v51 phonics reading and recording */
.phonics-reading-settings {
  margin-top: 1rem;
}
.phonics-reading-settings-form {
  gap: .65rem;
}
.record-sound-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.record-sound-row .muted {
  flex: 1 1 220px;
}
@media (max-width: 720px) {
  .useful-admin-link-item,
  .useful-category-item {
    grid-template-columns: 1fr;
  }
  .useful-admin-link-item .form-actions,
  .useful-category-item .form-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}


/* v52 year calendar and manage calendar polish */
.year-calendar-body .site-header,
.year-calendar-body .header-brand,
.year-calendar-body .header-brand > div {
  text-align: center;
  justify-content: center;
}
.year-calendar-body .site-header {
  align-items: center;
}
.year-calendar-body .site-header nav {
  justify-content: center;
}
.year-calendar-body .hero-card,
.year-calendar-body .hero-card h2,
.year-calendar-body .hero-card p,
#yearCalendarStatus {
  text-align: center !important;
}
.day-cell.school_holiday,
.data-table tr.school_holiday-row td,
.year-month-table .school_holiday-day,
.key-swatch.school_holiday {
  background: var(--holiday-blue) !important;
  border-color: #5ba7e8 !important;
}
.year-month-table td.today-calendar-date {
  position: relative;
}
.year-month-table td.today-calendar-date strong {
  position: relative;
  z-index: 1;
}
.year-month-table td.today-calendar-date::after {
  content: "";
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  border: 3px solid #d92d20;
  border-radius: 999px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.today-ring-swatch {
  background: white;
  border: 3px solid #d92d20 !important;
  border-radius: 999px !important;
}
.year-calendar-list-table tr.past-list-date td {
  color: #8a94a3;
  background: #eef1f4;
}
.year-calendar-list-table tr.past-list-date .muted {
  color: #8a94a3;
}
.year-calendar-bottom-grid-expanded {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

/* v52 PIN modal text adjustment */
.class-pin-panel h2 {
  margin-bottom: .65rem;
}
.class-pin-row input {
  inputmode: text;
}

/* v52 usage dashboard */
.usage-date-form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: end;
  margin: 1rem 0;
}
.usage-date-form label {
  min-width: 180px;
}
.usage-charts-grid {
  display: grid;
  gap: 1rem;
}
.usage-chart-card {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  background: #fff;
}
.usage-chart-heading {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}
.usage-chart-heading h3 {
  margin: 0;
  color: var(--blue-2);
}
.usage-chart-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 1rem;
  align-items: start;
}
.usage-line-svg {
  width: 100%;
  min-height: 180px;
}
.usage-axis {
  stroke: #b9c7d8;
  stroke-width: 1.5;
}
.usage-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
}
.usage-point {
  fill: var(--yellow);
  stroke: var(--blue-2);
  stroke-width: 1.5;
}
.usage-axis-label {
  fill: var(--muted);
  font-size: 10px;
}
.usage-axis-label-end {
  text-anchor: end;
}
.usage-axis-label-y {
  text-anchor: end;
}
.usage-hour-bars {
  display: grid;
  gap: .25rem;
}
.usage-hour-bar-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0,1fr) 2.2rem;
  gap: .45rem;
  align-items: center;
  font-size: .82rem;
}
.usage-hour-bar-track {
  height: .6rem;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}
.usage-hour-bar-track i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}
.usage-targets {
  margin-top: .75rem;
}
.usage-targets ul {
  margin: .5rem 0 0;
  padding: 0;
  display: grid;
  gap: .25rem;
}
.usage-targets li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid #edf1f5;
  padding-bottom: .2rem;
}
@media (max-width: 860px) {
  .usage-chart-pair {
    grid-template-columns: 1fr;
  }
}


/* v53 usage tab fallback */
#tab-usage .usage-charts-grid:empty::before {
  content: "No usage charts loaded yet.";
  display: block;
  color: var(--muted);
  padding: .75rem 0;
}


/* v54 usage dashboard improvements */
.usage-filter-panel {
  display: grid;
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.usage-filter-group {
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.usage-filter-group legend {
  font-weight: 900;
  color: var(--blue-2);
  padding: 0 .35rem;
}
.usage-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid #d9e4ef;
  border-radius: 999px;
  padding: .35rem .55rem;
  background: #fff;
  font-size: .86rem;
}
.usage-filter-pill input {
  accent-color: var(--blue);
}
.usage-chart-section h4 {
  margin: 0 0 .5rem;
  color: var(--blue-2);
  font-size: 1rem;
}
.usage-summary-widgets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: .6rem;
  margin-top: .65rem;
}
.usage-summary-widget {
  border: 1px solid #d9e4ef;
  border-radius: .8rem;
  padding: .65rem;
  background: #fbfdff;
}
.usage-summary-widget span {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}
.usage-summary-widget strong {
  display: block;
  color: var(--blue-2);
  font-size: 1.35rem;
  margin-top: .15rem;
}
.usage-hour-bars {
  width: 100%;
  max-width: 360px;
}
.usage-hour-bar-row {
  grid-template-columns: 3.2rem minmax(0,1fr) 2.2rem !important;
}
.usage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  margin-bottom: .35rem;
  font-size: .82rem;
}
.usage-legend span {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.usage-legend-swatch {
  width: .85rem;
  height: .18rem;
  border-radius: 999px;
  display: inline-block;
  background: var(--blue);
}
.usage-line-a, .usage-line { stroke: var(--blue); background: var(--blue); }
.usage-line-b { stroke: #f2a900; background: #f2a900; }
.usage-line-c { stroke: #2f855a; background: #2f855a; }
.usage-line-d { stroke: #805ad5; background: #805ad5; }
.usage-line-e { stroke: #d53f8c; background: #d53f8c; }
.usage-line-f { stroke: #dd6b20; background: #dd6b20; }
.usage-line-g { stroke: #2c7a7b; background: #2c7a7b; }
.usage-line-h { stroke: #4a5568; background: #4a5568; }
.usage-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .8rem;
  font-size: .9rem;
}
.usage-breakdown-table th,
.usage-breakdown-table td {
  border-top: 1px solid #e5edf5;
  padding: .45rem .35rem;
  text-align: left;
}
.usage-breakdown-table th:nth-child(2),
.usage-breakdown-table th:nth-child(3),
.usage-breakdown-table td:nth-child(2),
.usage-breakdown-table td:nth-child(3) {
  text-align: right;
}
@media (max-width: 720px) {
  .usage-summary-widgets {
    grid-template-columns: 1fr;
  }
  .usage-hour-bars {
    max-width: none;
  }
}


/* v56 usage filters are inside their respective cards */
#usageFilterPanel:empty {
  display: none;
}
.usage-inline-filter {
  margin: .35rem 0 .85rem;
}
.usage-inline-filter-empty {
  margin: .2rem 0 .75rem;
}

/* v56 calendar number centering */
.day-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}
.year-month-table td {
  text-align: center !important;
  vertical-align: middle !important;
  height: 2.25rem;
  padding: .25rem !important;
}
.year-month-table td strong {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 1.45rem;
  min-height: 1.45rem;
}

/* v56 compact Year Calendar bottom tables */
.year-calendar-bottom-card {
  min-width: 0;
  overflow: hidden;
}
.future-school-events-table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
}
.compact-holiday-table {
  font-size: .82rem;
}
.compact-holiday-table th,
.compact-holiday-table td {
  padding: .38rem .4rem !important;
  overflow-wrap: anywhere;
  word-break: normal;
}
.compact-holiday-table th:first-child,
.compact-holiday-table td:first-child {
  width: 72%;
}
.compact-holiday-table th:nth-child(2),
.compact-holiday-table td:nth-child(2) {
  width: 28%;
  text-align: right;
}
.compact-holiday-table .future-event-date,
.compact-holiday-table .muted {
  font-size: .78rem;
}
.year-calendar-bottom-card h2 {
  font-size: 1.05rem !important;
}
@media (max-width: 980px) {
  .year-calendar-bottom-grid-expanded {
    grid-template-columns: 1fr !important;
  }
}

/* v56 Class Events load note */
.centered-load-note {
  text-align: center !important;
  font-size: 1.08rem !important;
  padding: 1.1rem .8rem !important;
}

/* v56 meal textareas */
.meal-row textarea,
#mealOverrideMainInput,
#mealOverrideSideInput,
#mealOverrideDessertInput {
  width: 100%;
  resize: vertical;
}

/* v56 public meal/weather visual consistency */
.meal-public-text {
  font-size: 1rem !important;
  line-height: 1.35 !important;
}
.meal-payment-mobile-link {
  display: none;
  color: var(--blue-2) !important;
  font-weight: 900;
  margin-bottom: .45rem;
}
@media (max-width: 820px) {
  .meal-payment-mobile-link {
    display: inline-block !important;
  }
  .public-table .meal-public-col::before {
    content: "Meal" !important;
  }
  .public-table .meal-public-col {
    text-align: center !important;
  }
  .meal-public-text {
    display: block;
    font-size: 1.02rem !important;
    line-height: 1.35 !important;
    text-align: center !important;
  }
}


/* v57 usage stacked charts */
.usage-stacked-svg {
  width: 100%;
  min-height: 220px;
}
.usage-fill-a { fill: var(--blue); background: var(--blue); stroke: var(--blue); }
.usage-fill-b { fill: #f2a900; background: #f2a900; stroke: #f2a900; }
.usage-fill-c { fill: #2f855a; background: #2f855a; stroke: #2f855a; }
.usage-fill-d { fill: #805ad5; background: #805ad5; stroke: #805ad5; }
.usage-fill-e { fill: #d53f8c; background: #d53f8c; stroke: #d53f8c; }
.usage-fill-f { fill: #dd6b20; background: #dd6b20; stroke: #dd6b20; }
.usage-fill-g { fill: #2c7a7b; background: #2c7a7b; stroke: #2c7a7b; }
.usage-fill-h { fill: #4a5568; background: #4a5568; stroke: #4a5568; }
.usage-total-label {
  font-size: 10px;
  font-weight: 900;
  fill: var(--blue-2);
  text-anchor: middle;
}
.usage-axis-label-mid {
  text-anchor: middle;
}
.usage-stacked-hour-bars {
  width: 100%;
  max-width: 390px;
  display: grid;
  gap: .25rem;
}
.usage-stacked-track {
  position: relative;
}
.usage-stacked-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
}
.usage-stacked-track i span {
  position: absolute;
  left: -9999px;
}
.usage-admin-login-card {
  border-color: rgba(23,101,168,.28);
  background: #fbfdff;
}

/* v57 upcoming school events */
.upcoming-school-events-card {
  margin: 1rem 0;
}
.upcoming-school-events-list {
  display: grid;
  gap: .6rem;
}
.upcoming-school-event-item {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .8rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: .65rem .75rem;
  background: #fff;
}
.upcoming-school-event-item strong {
  color: var(--blue-2);
}
.upcoming-school-event-item span {
  color: var(--muted);
  font-weight: 800;
}


/* v59: force stacked time-of-day segments to match legend colours */
.usage-stacked-track i.usage-fill-a { background: var(--blue) !important; }
.usage-stacked-track i.usage-fill-b { background: #f2a900 !important; }
.usage-stacked-track i.usage-fill-c { background: #2f855a !important; }
.usage-stacked-track i.usage-fill-d { background: #805ad5 !important; }
.usage-stacked-track i.usage-fill-e { background: #d53f8c !important; }
.usage-stacked-track i.usage-fill-f { background: #dd6b20 !important; }
.usage-stacked-track i.usage-fill-g { background: #2c7a7b !important; }
.usage-stacked-track i.usage-fill-h { background: #4a5568 !important; }


/* v61 weekend school/key stage events */
.weekend-editable-cell {
  background: #fffaf0;
}
.upcoming-school-events-card,
.future-to-be-aware {
  margin: 1rem 0;
}


/* v65 Class Events initial selection and scroll-preserving saves */
.centered-load-note {
  scroll-margin-top: 120px;
}


/* v66 Class Events cell polish */
.teacher-message-cell::after {
  content: none !important;
  display: none !important;
}
.admin-date-cell {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: .12rem;
  text-align: center;
  line-height: 1.05;
  width: 100%;
}
.admin-date-day {
  color: var(--blue-2);
  font-weight: 950;
  font-size: .82rem;
  letter-spacing: .02em;
  text-transform: capitalize;
}
.admin-date-text {
  font-weight: 850;
  font-size: .78rem;
  white-space: normal;
}
.data-table td.date-col {
  text-align: center !important;
  vertical-align: middle !important;
}
.week-message-title .admin-date-cell {
  color: var(--blue-2);
}
.recently-edited-cell {
  outline: 4px solid rgba(242, 201, 76, .95) !important;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 2px rgba(23,101,168,.35), 0 0 0 4px rgba(242,201,76,.22);
  transition: outline-color .25s ease, box-shadow .25s ease;
}


/* v67 Maths function and PDF preview */
.maths-resource-editor { display:grid; gap:1rem; }
.maths-resource-editor input[type="text"], .maths-resource-editor input[type="url"], .maths-resource-editor textarea { width:100%; }
.maths-media-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; align-items:start; }
.maths-current-media { border:1px solid #dbeafe; border-radius:12px; padding:.75rem; background:#f8fbff; display:grid; gap:.4rem; }
.maths-current-media img { max-width:100%; max-height:180px; object-fit:contain; border-radius:10px; background:#fff; }
.maths-record-actions { align-items:center; }
.public-maths-resource { display:grid; gap:1rem; font-size:1.05rem; }
.public-maths-resource h3 { margin:0; color:var(--blue); font-size:1.45rem; }
.public-maths-image { max-width:100%; max-height:55vh; object-fit:contain; border-radius:16px; background:#fff; border:1px solid #dbeafe; }
.button-link { display:inline-block; border-radius:999px; background:var(--blue); color:#fff !important; padding:.65rem 1rem; font-weight:900; text-decoration:none; }
.pdf-preview-modal { position:fixed; inset:0; z-index:5000; background:rgba(15,23,42,.72); padding:1rem; overflow:auto; }
.pdf-preview-modal.hidden { display:none; }
.pdf-preview-panel { background:#fff; border-radius:20px; width:min(98vw, 1380px); max-width:1380px; margin:0 auto; padding:1rem; box-shadow:0 24px 80px rgba(0,0,0,.35); }
.pdf-preview-header { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:1rem; }
.pdf-preview-header h2 { margin:.1rem 0; }
.pdf-a4-preview-shell { width:min(100%, 1040px); aspect-ratio:210/297; margin:0 auto; background:#e5e7eb; border:1px solid #cbd5e1; box-shadow:0 12px 30px rgba(15,23,42,.2); overflow:hidden; }
.pdf-a4-preview-shell iframe { width:100%; height:100%; border:0; background:#fff; }
@media (max-width: 720px) { .pdf-preview-header { flex-direction:column; } }


/* v68 public navigation button colour restore */
.button-link.view-year-calendar-button,
.button-link.view-useful-links-button {
  color: var(--blue-2) !important;
}
.button-link.view-year-calendar-button:hover,
.button-link.view-useful-links-button:hover {
  color: var(--blue-2) !important;
}

/* v68 function label editing */
.function-check .function-name-edit { margin-left: .25rem; }


/* v70 Manage Classes function controls: smaller and lighter */
.structure-functions {
  gap: .18rem !important;
  align-items: center;
}
.structure-functions .tiny-label {
  font-size: .68rem !important;
  margin-bottom: .05rem;
}
.structure-functions .function-check {
  gap: .14rem !important;
  padding: .12rem .24rem !important;
  min-height: 1.35rem !important;
  border-radius: 999px;
  border-color: rgba(23,101,168,.16) !important;
  background: rgba(255,255,255,.82) !important;
  color: var(--blue-2) !important;
  font-size: .7rem !important;
  line-height: 1 !important;
  box-shadow: none !important;
}
.structure-functions .function-check:has(input:checked) {
  background: rgba(220,238,255,.46) !important;
  border-color: rgba(23,101,168,.32) !important;
  color: var(--blue-2) !important;
}
.structure-functions .function-check input {
  width: .72rem !important;
  height: .72rem !important;
  margin: 0 !important;
}
.structure-functions .function-check span {
  white-space: nowrap;
}
.structure-functions .function-check .function-name-edit,
.structure-functions .function-check .function-name-edit.icon-button {
  width: 1rem !important;
  min-width: 1rem !important;
  height: 1rem !important;
  min-height: 1rem !important;
  margin-left: .08rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--blue-2) !important;
  box-shadow: none !important;
  font-size: .64rem !important;
  line-height: 1 !important;
}
.structure-functions .function-check .function-name-edit:hover,
.structure-functions .function-check .function-name-edit.icon-button:hover {
  background: rgba(23,101,168,.08) !important;
}

/* v70 Class Events: keep function summary underneath the button */
.function-inline-chip {
  flex-direction: column !important;
  justify-content: center;
  align-items: center;
  gap: .16rem !important;
  padding: .22rem .32rem !important;
  border-radius: .7rem !important;
}
.function-inline-chip .function-mini-button,
.function-week-cell > .function-mini-button {
  display: block;
  margin: 0 auto;
}
.function-inline-chip .function-count,
.function-week-cell > .function-count {
  display: block !important;
  margin-top: .12rem !important;
  text-align: center;
  line-height: 1.05;
  max-width: 7rem;
}


/* v71 PDF/image export status and public event label formatting */
.pdf-preview-status {
  min-height: 1.25rem;
  margin: .15rem 0 .35rem;
  text-align: right;
  font-weight: 750;
}
.pdf-preview-header button[disabled] {
  opacity: .65;
  cursor: wait;
}
.event-label {
  font-weight: 500 !important;
  color: var(--ink) !important;
}
.event-value {
  font-weight: 900 !important;
  color: var(--ink) !important;
}


/* v72 public event formatting */
.event-line .event-label {
  font-weight: 500 !important;
  font-size: .86rem;
  color: var(--blue-2);
}
.event-line .event-value {
  font-weight: 500 !important;
  font-size: 1.03rem;
  color: var(--blue-2);
  line-height: 1.25;
}
.public-class-event-title {
  font-size: .9rem !important;
}


/* v73 Public event text: labels smaller, event/routine text larger but not bold */
.event-line .event-label,
.event-label {
  font-weight: 500 !important;
  font-size: .86rem !important;
  color: var(--blue-2) !important;
}
.event-line .event-value,
.event-value {
  font-weight: 500 !important;
  font-size: 1.12rem !important;
  color: var(--blue-2) !important;
  line-height: 1.28 !important;
}

/* v73 password setup panels */
.login-secondary-actions {
  display: flex;
  justify-content: center;
  margin-top: .65rem;
}
#setPasswordPanel {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}


/* v74 public header refresh icon */
.public-header-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.public-refresh-icon {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.public-refresh-icon:hover {
  background: rgba(255,255,255,.24);
}
.public-controls .section-heading {
  margin-bottom: 0 !important;
}

/* v74 public buttons side-by-side when there is room */
.view-year-calendar-row {
  flex-direction: row !important;
  gap: .6rem !important;
}
@media (max-width: 520px) {
  .view-year-calendar-row {
    flex-direction: column !important;
  }
}

/* v74 close vertical gap above week headings */
.public-status {
  margin-bottom: .15rem !important;
}
.public-week-heading {
  margin: .45rem 0 .45rem !important;
}

/* v74 small subsection titles */
.public-week-subsection {
  margin: .35rem 0 .7rem;
}
.public-subsection-heading {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(20,79,140,.16);
  border-radius: 999px;
  background: rgba(220,238,255,.55);
  color: var(--blue-2);
  font-size: .86rem;
  font-weight: 800;
  line-height: 1;
  padding: .28rem .6rem;
  margin: 0 0 .45rem;
}
.public-week-messages,
.public-resource-grid {
  margin-top: .15rem;
}

/* v74 event titles/values */
.events-header-blank {
  color: transparent !important;
}
.public-class-event-block {
  margin: 0 0 .55rem;
  padding: .42rem .55rem;
  border-radius: .65rem;
  background: rgba(247,251,255,.82);
  border: 1px solid rgba(20,79,140,.12);
}
.public-class-event-title {
  display: block;
  font-size: .86rem;
  font-weight: 800;
  color: var(--blue-2);
  margin: 0 0 .18rem;
}
.public-event-detail-line {
  margin-top: .12rem;
}
.event-line .event-label,
.event-label {
  font-weight: 500 !important;
  font-size: .84rem !important;
  color: var(--blue-2) !important;
}
.event-line .event-value,
.event-value {
  font-weight: 500 !important;
  font-size: 1.08rem !important;
  color: var(--blue-2) !important;
  line-height: 1.28 !important;
}

/* v74 recording countdown text */
#phonicsRecordingStatus,
#mathsRecordingStatus {
  font-variant-numeric: tabular-nums;
}


/* v75 public subsection headings as centred titles, not pills */
.public-subsection-heading {
  display: block !important;
  width: 100%;
  text-align: center;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: var(--blue-2) !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  padding: 0 !important;
  margin: .2rem 0 .55rem !important;
}

/* v75 week heading + download button */
.public-week-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: .35rem 0 .45rem;
}
.public-week-title-row .public-week-heading {
  margin: 0 !important;
}
.download-week-button {
  border: 1px solid rgba(23,101,168,.24);
  background: rgba(220,238,255,.62);
  color: var(--blue-2);
  border-radius: 999px;
  padding: .42rem .72rem;
  font-size: .82rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}
.download-week-button:hover {
  background: rgba(220,238,255,.92);
}
@media (max-width: 520px) {
  .public-week-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v76 public page spacing, mobile header, weather button and week/PDF polish */
.public-controls {
  gap: .35rem !important;
  margin-bottom: .35rem !important;
  padding-top: .75rem !important;
  padding-bottom: .8rem !important;
}
.public-controls .section-heading {
  margin: 0 !important;
}
.public-controls .section-heading h2 {
  margin: 0 !important;
}
.public-filter-panel,
.public-ks-groups {
  gap: .38rem !important;
}
.public-ks-group {
  padding: .5rem .65rem !important;
}
.public-ks-group h3 {
  margin-bottom: .35rem !important;
}
.weather-toggle-row,
.view-year-calendar-row {
  margin-top: .18rem !important;
  gap: .5rem !important;
}
.weather-filter-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  border-radius: 999px !important;
  background: var(--blue-soft) !important;
  color: var(--blue-2) !important;
  border: 2px solid rgba(20,79,140,.22) !important;
  padding: .65rem 1rem !important;
  font-weight: 900 !important;
  font-size: inherit !important;
  line-height: 1.2 !important;
}
.weather-filter-button[data-selected="true"],
.weather-filter-button.selected {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.public-status {
  margin: 0 !important;
}
.public-week-title-row {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .5rem !important;
  margin: .25rem 0 .35rem !important;
}
.public-week-title-row .public-week-heading {
  white-space: nowrap !important;
  font-size: clamp(1.18rem, 5vw, 1.9rem) !important;
}
.download-week-button {
  flex: 0 0 auto !important;
  padding: .34rem .52rem !important;
  font-size: clamp(.7rem, 2.8vw, .82rem) !important;
}
.public-table th:nth-child(2) {
  text-align: left !important;
}
@media (max-width: 820px) {
  .public-table td:nth-child(2)::before,
  .public-table td.event-public-col::before {
    content: "" !important;
    display: none !important;
  }
}
@media (max-width: 620px) {
  .site-header.public-header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .45rem !important;
    padding: .45rem .6rem !important;
    border-bottom-width: 3px !important;
  }
  .public-header .header-brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    gap: .45rem !important;
  }
  .public-header .site-logo-large {
    display: none !important;
  }
  .public-header .site-logo-small {
    display: block !important;
    width: 38px !important;
    height: 38px !important;
  }
  .public-header h1 {
    font-size: clamp(.95rem, 4.2vw, 1.2rem) !important;
    line-height: 1.08 !important;
    margin: 0 !important;
  }
  .public-header .eyebrow,
  .public-header .muted {
    display: none !important;
  }
  .public-header-actions {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: .35rem !important;
  }
  .public-refresh-icon {
    width: 1.85rem !important;
    height: 1.85rem !important;
    font-size: .98rem !important;
  }
  .site-header.public-header a {
    padding: .42rem .55rem !important;
    font-size: .82rem !important;
  }
  .public-shell {
    padding-top: .55rem !important;
  }
  .public-controls {
    margin-bottom: .15rem !important;
  }
  .public-controls .card,
  .public-controls {
    border-radius: .9rem !important;
  }
}


/* v77 upcoming events under week sections */
.upcoming-events-card {
  margin-top: .75rem !important;
}
.upcoming-events-heading {
  margin-bottom: .45rem !important;
}
.upcoming-events-heading h2 {
  margin: 0 !important;
}
.upcoming-events-scroll {
  max-height: 14rem;
  overflow-y: auto;
  display: grid;
  gap: .45rem;
  padding-right: .25rem;
}
.upcoming-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  border: 1px solid rgba(20,79,140,.18);
  background: rgba(247,251,255,.95);
  border-radius: .75rem;
  padding: .45rem .55rem;
}
.upcoming-event-item strong {
  color: var(--blue-2);
  margin-right: .4rem;
}
.upcoming-event-group {
  display: inline-block;
  font-weight: 800;
  color: var(--blue-2);
  margin-right: .35rem;
}
.upcoming-event-title {
  color: var(--ink);
}
.next-week-availability-note {
  text-align: center;
  margin: .55rem auto .15rem;
  color: var(--blue-2);
  font-weight: 700;
  font-size: .92rem;
}

/* v77 compact week layout */
.public-week-section {
  margin-bottom: .85rem;
}
.public-table th,
.public-table td {
  padding: .48rem .55rem !important;
}
.public-table .day-public-col {
  width: 122px !important;
}
.public-day-title {
  font-size: .95rem !important;
  line-height: 1.08 !important;
}
.public-table .day-public-col .muted {
  font-size: .78rem !important;
}
.public-class-event-block {
  margin-bottom: .36rem !important;
  padding: .28rem .38rem !important;
  border-radius: .52rem !important;
}
.public-class-event-title {
  font-size: .78rem !important;
  margin-bottom: .1rem !important;
}
.public-event-detail-line {
  margin-top: .08rem !important;
}
.event-line .event-label,
.event-label {
  font-size: .78rem !important;
}
.event-line .event-value,
.event-value {
  font-size: .98rem !important;
}
.meal-public-text {
  font-size: .92rem !important;
  line-height: 1.22 !important;
}
.meal-public-text hr {
  margin: .28rem 0 !important;
}
.weather-mini-table th,
.weather-mini-table td {
  padding: .18rem .25rem !important;
  font-size: .82rem !important;
}
.weather-string-slot {
  padding: .16rem 0 !important;
}
.weather-string-label,
.weather-string-line,
.weather-detail {
  font-size: .86rem !important;
}
.weather-emoji {
  font-size: 1.35rem !important;
}

/* v77 mobile compression */
@media (max-width: 820px) {
  .public-table tr {
    margin-bottom: .5rem !important;
    border-radius: .65rem !important;
  }
  .public-table td {
    padding: .42rem .48rem !important;
  }
  .public-table td::before,
  .public-table td.event-public-col::before,
  .public-table td:nth-child(2)::before {
    content: "" !important;
    display: none !important;
  }
  .public-table .day-public-col {
    padding: .36rem .48rem !important;
  }
  .public-day-title {
    font-size: .9rem !important;
  }
  .public-table .day-public-col .muted {
    font-size: .74rem !important;
  }
  .public-week-title-row {
    justify-content: space-between !important;
    gap: .35rem !important;
    margin: .15rem 0 .28rem !important;
  }
  .public-week-title-row .public-week-heading {
    font-size: clamp(1.04rem, 5vw, 1.45rem) !important;
  }
  .download-week-button {
    padding: .28rem .44rem !important;
    font-size: .72rem !important;
  }
  .public-class-event-block {
    padding: .24rem .32rem !important;
  }
  .event-line .event-value,
  .event-value {
    font-size: .94rem !important;
  }
  .meal-public-text {
    font-size: .88rem !important;
  }
  .weather-mini-table th,
  .weather-mini-table td {
    padding: .14rem .2rem !important;
    font-size: .78rem !important;
  }
  .upcoming-events-scroll {
    max-height: 12rem;
  }
  .upcoming-event-item {
    align-items: flex-start;
    flex-direction: column;
    gap: .32rem;
    padding: .42rem .48rem;
  }
  .upcoming-event-item .add-calendar-button {
    align-self: flex-start;
  }
}

/* v77 reduce gap between class selector and week sections */
.public-controls {
  margin-bottom: .08rem !important;
}
.public-status {
  min-height: 0 !important;
}
#publicCalendarOutput {
  margin-top: .2rem !important;
}


/* v78 tidy weekly layout after v77 compression */
.public-table th {
  text-align: center !important;
}
.public-table th:nth-child(2) {
  text-align: center !important;
}
.public-table th,
.public-table td {
  padding: .62rem .7rem !important;
}
.public-table .day-public-col {
  width: 136px !important;
}
.public-day-title {
  font-size: 1rem !important;
  line-height: 1.16 !important;
}
.public-table .day-public-col .muted {
  font-size: .82rem !important;
}
.public-class-event-block {
  margin-bottom: .48rem !important;
  padding: .42rem .55rem !important;
  border-radius: .65rem !important;
}
.public-class-event-title {
  font-size: clamp(1.12rem, 3.5vw, 1.48rem) !important;
  line-height: 1.15 !important;
  font-weight: 850 !important;
  margin-bottom: .25rem !important;
}
.public-event-detail-line {
  margin-top: .15rem !important;
}
.event-line .event-label,
.event-label {
  font-size: .82rem !important;
}
.event-line .event-value,
.event-value {
  font-size: 1.02rem !important;
  line-height: 1.32 !important;
}
.meal-public-text {
  font-size: .96rem !important;
  line-height: 1.3 !important;
}
.weather-mini-table th,
.weather-mini-table td {
  padding: .24rem .32rem !important;
  font-size: .86rem !important;
}

/* v78 mobile: full-width day/date header and a little more breathing room */
@media (max-width: 820px) {
  .public-table tr {
    margin-bottom: .68rem !important;
    border-radius: .8rem !important;
  }
  .public-table td {
    padding: .55rem .6rem !important;
  }
  .public-table .day-public-col {
    width: auto !important;
    display: block !important;
    text-align: center !important;
    background: rgba(220,238,255,.65) !important;
    border-bottom: 1px solid rgba(20,79,140,.16) !important;
    border-radius: .8rem .8rem 0 0 !important;
  }
  .public-day-title {
    font-size: 1.02rem !important;
    letter-spacing: .01em;
  }
  .public-table .day-public-col .muted {
    font-size: .8rem !important;
  }
  .public-class-event-block {
    padding: .38rem .5rem !important;
    margin-bottom: .44rem !important;
  }
  .public-class-event-title {
    font-size: clamp(1.08rem, 5vw, 1.38rem) !important;
    text-align: left !important;
  }
  .event-line .event-value,
  .event-value {
    font-size: 1rem !important;
  }
  .meal-public-text {
    font-size: .94rem !important;
  }
  .weather-mini-table th,
  .weather-mini-table td {
    padding: .2rem .28rem !important;
    font-size: .84rem !important;
  }
}


/* v79 public weekly neatness */
.public-table th:nth-child(2) { text-align: center !important; }
.public-class-event-title { font-size: clamp(1.2rem, 3.8vw, 1.62rem) !important; font-weight: 900 !important; }
@media (max-width: 820px) { .public-table .day-public-col { width: auto !important; display: block !important; } }

/* v79 Manage Users compact list/editor */
.user-search-row { margin: .4rem 0 .75rem; }
.user-search-label { display: block; max-width: 520px; }
.users-summary-list { max-height: 18rem; overflow-y: auto; display: grid; gap: .45rem; padding-right: .25rem; margin-bottom: .9rem; }
.user-summary-button { width: 100%; text-align: left; border: 1px solid rgba(20,79,140,.16); background: #f7fbff; color: var(--ink); border-radius: .8rem; padding: .58rem .7rem; display: grid; gap: .12rem; }
.user-summary-button:hover, .user-summary-button.selected { border-color: var(--blue-2); background: #eaf4fb; }
.user-summary-name { color: var(--blue-2); font-weight: 850; }
.user-summary-meta { color: var(--muted); font-size: .86rem; font-weight: 600; }
.user-editor { margin-top: .75rem; }

/* v79 star visuals */
.advance-star-button { border: 0 !important; background: transparent !important; color: #8aa0b5 !important; font-size: 1.32rem !important; line-height: 1 !important; padding: .1rem .12rem !important; min-width: 1.6rem; box-shadow: none !important; }
.advance-star-button.selected, .advance-star-static.selected { color: #f2c94c !important; text-shadow: 0 0 0 #7b5a00; }
.advance-star-static { color: #8aa0b5; font-size: 1rem; margin-right: .2rem; }
.readonly-event-line { display: flex; align-items: flex-start; gap: .18rem; }

/* v79 Class Events resources/holiday layout */
.date-holiday-inline { margin-top: .18rem; font-size: .76rem; line-height: 1.15; color: var(--blue-2); font-weight: 800; }
.ks-resources-wide-cell { min-width: 13rem; }
.teacher-resources-title { text-align: center; color: var(--blue-2); font-weight: 900; font-size: .9rem; margin-bottom: .35rem; }
.ks-resource-button-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem !important; align-items: stretch; }
.ks-resource-button-grid .function-inline-chip { margin: 0 !important; }
.ks-resource-button-grid .function-mini-button { width: 100%; }
@media (max-width: 820px) { .ks-resource-button-grid { grid-template-columns: 1fr; } }


/* v80 Class Events holiday header is intentionally blank; holiday details live under Date. */
.holidays-header-blank::after {
  content: "" !important;
}

/* v80 week download logo balance */
.emet-logo {
  object-fit: contain;
}


/* v81 inactive account and archived users */
#inactiveAccountPanel {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.manage-users-heading {
  align-items: center;
}
.user-summary-button.archived {
  opacity: .92;
  background: #fffaf0;
}
.meal-override-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.spelling-output-section {
  margin-top: 1rem;
}
.spelling-output-preview {
  border: 1px solid rgba(20,79,140,.18);
  background: #f7fbff;
  border-radius: .8rem;
  padding: .65rem;
  margin-bottom: .75rem;
}
.spelling-output-logo-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.spelling-output-logo-preview img {
  object-fit: contain;
  background: white;
  border: 1px solid rgba(20,79,140,.16);
  border-radius: .5rem;
  padding: .25rem;
}
.spelling-output-columns-list {
  display: grid;
  gap: .5rem;
}
.spelling-output-column-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: end;
}
@media (max-width: 640px) {
  .meal-override-card,
  .spelling-output-column-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}


/* v82 inactive account and public view settings */
.inactive-account-message {
  color: var(--blue-2);
  font-size: 1.08rem;
  font-weight: 900;
}
.public-view-settings-form fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  align-items: end;
}
.public-view-settings-form fieldset label.full,
.public-view-settings-form fieldset textarea {
  grid-column: 1 / -1;
}
.public-view-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}
.public-view-logo-grid > div {
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: .65rem;
  background: #f8fbff;
  display: grid;
  gap: .4rem;
}
.public-view-logo-grid img { object-fit: contain; max-width: 100%; }
body:not(.admin-body) {
  background: var(--public-page-background, #f7fbff);
}
body:not(.admin-body) .site-header.public-header {
  background: linear-gradient(135deg, var(--public-header-blue, var(--blue)), var(--public-header-dark-blue, var(--blue-2)));
  border-bottom-color: var(--public-accent-yellow, var(--yellow));
}
body:not(.admin-body) .card,
body:not(.admin-body) .public-table,
body:not(.admin-body) .public-ks-group {
  background-color: var(--public-card-background, #ffffff);
}
body:not(.admin-body) .site-header.public-header a,
body:not(.admin-body) .public-header-actions a {
  background: var(--public-accent-yellow, var(--yellow));
}

/* v82 compact routine and PIN editor */
.routine-editor-help {
  margin: .4rem 0 .75rem;
  border: 1px solid rgba(20,79,140,.18);
  background: #f7fbff;
  border-radius: .85rem;
  padding: .65rem .8rem;
  color: var(--blue-2);
  line-height: 1.35;
}
.compact-routine-card {
  padding: .65rem !important;
}
.routine-class-inline-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .45rem;
}
.routine-class-inline-header h3 {
  margin: 0;
  min-width: 8rem;
  color: var(--blue-2);
}
.compact-pin-label {
  display: inline-flex !important;
  align-items: center;
  gap: .35rem;
  font-weight: 900;
}
.compact-pin-label input {
  max-width: 7.5rem;
}
.routine-line-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  align-items: stretch;
}
.routine-save-column {
  display: flex;
  align-items: flex-start;
  padding-top: 1.45rem;
}
.routine-save-column button {
  white-space: normal;
  line-height: 1.05;
  padding: .48rem .55rem;
  min-width: 4.5rem;
}
.compact-weekday-routine-grid {
  gap: .45rem !important;
}
.compact-weekday-routine-grid textarea {
  min-height: 3.3rem;
}
@media (max-width: 820px) {
  .routine-line-grid { grid-template-columns: 1fr; }
  .routine-save-column { padding-top: 0; }
  .routine-save-column button { width: 100%; }
}


/* v83 active-account and guidance fixes */
body.inactive-account-mode #adminApp,
body.inactive-account-mode #tabNav,
body.inactive-account-mode #mobileTabHeader,
body.inactive-account-mode #calendarSafetyWarning,
body.inactive-account-mode .tab-panel {
  display: none !important;
}
body.inactive-account-mode #inactiveAccountPanel {
  display: block !important;
}
.public-visibility-help {
  border: 1px solid rgba(20, 79, 140, .22);
  border-left: 5px solid var(--blue-2);
  background: #f2f8ff;
  color: var(--ink);
  border-radius: .8rem;
  padding: .7rem .85rem;
  margin: .7rem 0 .9rem;
  line-height: 1.38;
}
.public-visibility-help strong {
  color: var(--blue-2);
}
.routine-editor-help {
  margin-bottom: .55rem !important;
}
.compact-routine-card {
  padding: .65rem .75rem !important;
  margin-bottom: .65rem !important;
}
.routine-class-inline-header {
  gap: .65rem !important;
  margin-bottom: .45rem !important;
}
.compact-weekday-routine-grid label {
  gap: .2rem !important;
}
.compact-weekday-routine-grid textarea {
  min-height: 3.2rem !important;
  padding: .4rem .45rem !important;
}

/* v84 public page: grouped class chips, unified action buttons, and type scale */
.public-index {
  --public-text-normal: .96rem;
  --public-title-small: .95rem;
  --public-title-large: clamp(1.18rem, 4.5vw, 1.55rem);
}

.public-index .site-header.public-header h1 {
  font-size: clamp(1rem, 2.4vw, 1.35rem) !important;
  line-height: 1.1 !important;
}
.public-index .public-refresh-icon {
  display: none !important;
}

/* Class selection: keep visible, grouped by the live Key Stage names, no horizontal scrolling. */
.public-index .public-filter-panel {
  display: block !important;
  overflow: visible !important;
  padding: 0 !important;
}
.public-index .public-ks-groups {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
  gap: .75rem !important;
  align-items: stretch !important;
}
.public-index .public-ks-group {
  display: block !important;
  flex: initial !important;
  white-space: normal !important;
  padding: .75rem .85rem !important;
  border-radius: .95rem !important;
}
.public-index .public-ks-group h3 {
  display: block !important;
  margin: 0 0 .45rem !important;
  text-align: left !important;
}
.public-index .public-class-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  gap: .45rem !important;
}
.public-index .filter-button[data-class-id] {
  flex: 0 1 auto !important;
  white-space: normal !important;
}

/* One action-button style across the public page, except class chips. */
.public-index .weather-filter-button,
.public-index .button-link,
.public-index .download-week-button,
.public-index .add-calendar-button,
.public-index .public-resource-card,
.public-index .future-school-events-actions button,
.public-index .meal-payment-public-link,
.public-index .public-header-actions a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  border-radius: 999px !important;
  background: var(--blue-soft) !important;
  color: var(--blue-2) !important;
  border: 2px solid rgba(20,79,140,.22) !important;
  padding: .65rem 1rem !important;
  font-size: var(--public-text-normal) !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
.public-index .weather-filter-button:hover,
.public-index .button-link:hover,
.public-index .download-week-button:hover,
.public-index .add-calendar-button:hover,
.public-index .public-resource-card:hover,
.public-index .future-school-events-actions button:hover,
.public-index .meal-payment-public-link:hover,
.public-index .public-header-actions a:hover {
  background: #d9ebfb !important;
  color: var(--blue-2) !important;
}
.public-index .weather-filter-button[data-selected="true"],
.public-index .weather-filter-button.selected {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.public-index .public-resource-card {
  width: 100% !important;
  text-align: center !important;
}
.public-index .inline-calendar-button,
.public-index .add-calendar-button {
  margin-left: 0 !important;
  margin-top: .35rem !important;
}

/* Weather source sits under the weather toggle and points to the actual forecast data source. */
.public-index .weather-toggle-row {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .18rem !important;
  width: auto !important;
  justify-self: center !important;
}
.public-index .weather-source-link {
  color: var(--muted) !important;
  font-size: .82rem !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  text-decoration: underline !important;
}
.public-index .weather-bbc-link.in-header {
  display: none !important;
}

/* Week header: download left, week title right on wide screens; stacked and centred on mobile. */
.public-index .public-week-title-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: .75rem !important;
  margin: .35rem 0 .5rem !important;
}
.public-index .public-week-title-row .download-week-button {
  order: 1 !important;
  flex: 0 0 auto !important;
}
.public-index .public-week-title-row .public-week-heading {
  order: 2 !important;
  flex: 1 1 auto !important;
  text-align: right !important;
  white-space: normal !important;
  margin: 0 !important;
}

.public-index .meal-payment-week-mobile {
  display: none !important;
}
.public-index .meal-payment-week-mobile:empty {
  display: none !important;
}

/* Upcoming Events should be part of the page flow, not a nested scroll panel. */
.public-index .upcoming-events-scroll {
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}

/* Three-level public type scale: big title, small title, normal body text. */
.public-index .public-shell,
.public-index .site-footer,
.public-index .public-table td,
.public-index .public-status,
.public-index .muted,
.public-index .event-value,
.public-index .meal-public-text,
.public-index .weather-string-line,
.public-index .weather-detail,
.public-index .upcoming-event-title,
.public-index .public-week-message-card p,
.public-index .next-week-availability-note,
.public-index .holiday-date-text {
  font-size: var(--public-text-normal) !important;
  line-height: 1.35 !important;
}
.public-index .public-controls .section-heading h2,
.public-index .public-ks-group h3,
.public-index .public-table th,
.public-index .public-day-title,
.public-index .weather-string-label,
.public-index .public-subsection-heading,
.public-index .upcoming-event-group,
.public-index .week-message-card h3,
.public-index .public-week-message-card h3 {
  font-size: var(--public-title-small) !important;
  line-height: 1.2 !important;
  font-weight: 850 !important;
}
.public-index .public-week-heading,
.public-index .upcoming-events-heading h2,
.public-index .public-class-event-title,
.public-index .holiday-skip-box h2,
.public-index .upcoming-closure-notice strong {
  font-size: var(--public-title-large) !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
}
.public-index .public-class-event-title {
  color: var(--blue-2) !important;
  margin-bottom: .22rem !important;
}
.public-index .event-label {
  color: #748196 !important;
  font-size: var(--public-text-normal) !important;
  font-weight: 650 !important;
}
.public-index .event-value {
  color: var(--ink) !important;
  font-weight: 500 !important;
}
.public-index .weather-emoji {
  font-size: 1.25em !important;
}
.public-index .public-table th {
  text-align: center !important;
}

@media (max-width: 820px) {
  .public-index .public-ks-groups {
    grid-template-columns: 1fr !important;
  }
  .public-index .public-ks-group h3 {
    display: block !important;
    text-align: left !important;
  }
  .public-index .public-class-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
  }
  .public-index .meal-payment-week-mobile:not(:empty) {
    display: flex !important;
    justify-content: center !important;
    margin: .2rem 0 .55rem !important;
  }
  .public-index .public-week-title-row {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .35rem !important;
  }
  .public-index .public-week-title-row .public-week-heading {
    order: 1 !important;
    flex: initial !important;
    text-align: center !important;
  }
  .public-index .public-week-title-row .download-week-button {
    order: 2 !important;
  }
  .public-index .public-table .day-public-col {
    text-align: center !important;
  }
  .public-index .upcoming-event-item {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
}


/* v85 public page: mobile class grid, cleaner week header, icons, and safer weather layout */
.public-index .public-week-title-row .public-week-heading {
  order: 1 !important;
  text-align: left !important;
}
.public-index .public-week-title-row .download-week-button {
  order: 2 !important;
}

.public-index .public-resource-card {
  gap: .45rem !important;
}
.public-index .public-resource-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  font-size: 1.15em !important;
  line-height: 1 !important;
}

.public-index .weather-string-list {
  display: grid !important;
  gap: .42rem !important;
}
.public-index .weather-string-slot {
  display: grid !important;
  grid-template-columns: 2.15rem minmax(0, 1fr) !important;
  align-items: center !important;
  gap: .45rem !important;
  min-height: 2.3rem !important;
  padding: .25rem 0 .45rem !important;
}
.public-index .weather-string-slot .weather-emoji {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.15rem !important;
  min-width: 2.15rem !important;
  font-size: 1.72rem !important;
  line-height: 1 !important;
  text-align: center !important;
}
.public-index .weather-string-copy {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-width: 0 !important;
  line-height: 1.18 !important;
}
.public-index .weather-string-label,
.public-index .weather-string-line {
  display: block !important;
  text-align: left !important;
}
.public-index .weather-detail {
  white-space: normal !important;
}

.public-index .public-event-detail-line {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: .28rem .4rem !important;
}
.public-index .event-item {
  display: inline-grid !important;
  grid-template-columns: 1.65rem minmax(0, 1fr) !important;
  align-items: center !important;
  gap: .35rem !important;
  max-width: 100% !important;
}
.public-index .event-kind-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1.65rem !important;
  min-width: 1.65rem !important;
  line-height: 1 !important;
  font-size: 1.1rem !important;
}
.public-index .event-text {
  min-width: 0 !important;
}
.public-index .event-label {
  color: #7f8a9d !important;
}

@media (max-width: 820px) {
  .public-index .public-ks-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .55rem !important;
  }
  .public-index .public-ks-group {
    padding: .58rem !important;
  }
  .public-index .public-ks-group h3 {
    margin-bottom: .38rem !important;
  }
  .public-index .public-class-buttons {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .35rem !important;
  }
  .public-index .filter-button[data-class-id] {
    width: 100% !important;
    justify-content: center !important;
    padding: .52rem .45rem !important;
  }
  .public-index .public-week-title-row .public-week-heading {
    order: 1 !important;
    text-align: center !important;
  }
  .public-index .public-week-title-row .download-week-button {
    order: 2 !important;
  }
}

@media (max-width: 420px) {
  .public-index .public-ks-groups {
    grid-template-columns: 1fr !important;
  }
}

/* v86 public page: custom icon set and proportional responsive type scale */
.public-index {
  --public-text-normal: clamp(0.84rem, 0.76rem + 0.34vw, 1.04rem);
  --public-title-small: clamp(0.93rem, 0.82rem + 0.48vw, 1.18rem);
  --public-title-large: clamp(1.08rem, 0.9rem + 0.9vw, 1.62rem);
  --public-action-text: clamp(0.84rem, 0.76rem + 0.32vw, 1.02rem);
  --public-table-pad-y: clamp(0.38rem, 0.28rem + 0.38vw, 0.68rem);
  --public-table-pad-x: clamp(0.34rem, 0.22rem + 0.42vw, 0.72rem);
  --public-action-icon-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.38rem);
  --public-heading-icon-size: clamp(1.28rem, 1.02rem + 0.78vw, 1.82rem);
  --public-event-icon-size: clamp(1.38rem, 1.08rem + 0.92vw, 2.02rem);
}
.public-index .site-header.public-header h1 {
  font-size: clamp(0.98rem, 0.72rem + 1.05vw, 1.55rem) !important;
}
.public-index .site-header.public-header .eyebrow {
  font-size: clamp(0.64rem, 0.56rem + 0.22vw, 0.76rem) !important;
}
.public-index .public-shell,
.public-index .public-controls,
.public-index .public-table,
.public-index .site-footer {
  font-size: var(--public-text-normal) !important;
}
.public-index .weather-filter-button,
.public-index .button-link,
.public-index .download-week-button,
.public-index .add-calendar-button,
.public-index .public-resource-card,
.public-index .future-school-events-actions button,
.public-index .meal-payment-public-link,
.public-index .public-header-actions a {
  font-size: var(--public-action-text) !important;
  gap: clamp(0.28rem, 0.2rem + 0.25vw, 0.48rem) !important;
}
.public-index .public-table th,
.public-index .public-table td {
  padding: var(--public-table-pad-y) var(--public-table-pad-x) !important;
}
.public-index .public-custom-icon {
  display: inline-block !important;
  flex: 0 0 auto !important;
  object-fit: contain !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}
.public-index .public-button-icon {
  width: var(--public-action-icon-size) !important;
  height: var(--public-action-icon-size) !important;
}
.public-index .download-week-button {
  white-space: nowrap !important;
}
.public-index .public-table-heading-with-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(0.25rem, 0.18rem + 0.25vw, 0.45rem) !important;
  line-height: 1.1 !important;
  vertical-align: middle !important;
}
.public-index .public-heading-icon {
  width: var(--public-heading-icon-size) !important;
  height: var(--public-heading-icon-size) !important;
}
.public-index .event-item {
  grid-template-columns: var(--public-event-icon-size) minmax(0, 1fr) !important;
  gap: clamp(0.28rem, 0.2rem + 0.25vw, 0.44rem) !important;
}
.public-index .event-kind-icon {
  width: var(--public-event-icon-size) !important;
  min-width: var(--public-event-icon-size) !important;
  height: var(--public-event-icon-size) !important;
  min-height: var(--public-event-icon-size) !important;
  align-self: center !important;
}
.public-index .event-kind-icon .public-custom-icon {
  width: 100% !important;
  height: 100% !important;
}
.public-index .event-text {
  display: block !important;
  line-height: 1.25 !important;
}
.public-index .meal-public-text strong {
  font-size: var(--public-text-normal) !important;
}
.public-index .public-resource-icon {
  font-size: var(--public-action-text) !important;
}

@media (max-width: 520px) {
  .public-index {
    --public-text-normal: clamp(0.82rem, 3.55vw, 0.94rem);
    --public-title-small: clamp(0.9rem, 3.85vw, 1.04rem);
    --public-title-large: clamp(1.04rem, 4.8vw, 1.34rem);
    --public-action-text: clamp(0.82rem, 3.55vw, 0.94rem);
    --public-event-icon-size: clamp(1.34rem, 5.9vw, 1.72rem);
    --public-heading-icon-size: clamp(1.24rem, 5.4vw, 1.62rem);
  }
  .public-index .public-week-title-row,
  .public-index .public-resource-card,
  .public-index .button-link,
  .public-index .download-week-button {
    max-width: 100% !important;
  }
}

/* v87 public page: homework icon, stronger responsive type, meal icons, event/calendar alignment, year-calendar print and mobile filters */
.public-index {
  --public-text-normal: clamp(0.9rem, 0.76rem + 0.46vw, 1.18rem);
  --public-title-small: clamp(1rem, 0.84rem + 0.58vw, 1.36rem);
  --public-title-large: clamp(1.18rem, 0.92rem + 1.05vw, 1.92rem);
  --public-action-text: clamp(0.9rem, 0.76rem + 0.46vw, 1.16rem);
  --public-action-icon-size: clamp(1.2rem, 0.95rem + 0.7vw, 1.62rem);
  --public-heading-icon-size: clamp(1.46rem, 1.08rem + 1.05vw, 2.1rem);
  --public-event-icon-size: clamp(1.52rem, 1.08rem + 1.16vw, 2.18rem);
}
.public-index .public-week-heading,
.public-index .public-class-event-title {
  font-size: var(--public-title-large) !important;
}
.public-index .public-table th,
.public-index .weather-string-label,
.public-index .public-subsection-heading,
.public-index .event-text,
.public-index .event-label,
.public-index .event-value,
.public-index .public-event-detail-line {
  font-size: var(--public-title-small) !important;
}
.public-index .public-event-detail-line {
  width: 100% !important;
}
.public-index .public-event-detail-line .event-item {
  flex: 1 1 auto !important;
}
.public-index .public-event-detail-line .add-calendar-button {
  margin-left: auto !important;
}
.public-index .meal-output-icon {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto .32rem !important;
}
.public-index .meal-output-icon .public-custom-icon-meal {
  width: clamp(2.1rem, 1.3rem + 2.25vw, 3.35rem) !important;
  height: clamp(2.1rem, 1.3rem + 2.25vw, 3.35rem) !important;
}
.public-index .public-resource-card .public-custom-icon-homework {
  width: var(--public-action-icon-size) !important;
  height: var(--public-action-icon-size) !important;
}
.public-index .upcoming-event-item {
  gap: .7rem !important;
}
.public-index .upcoming-event-item .add-calendar-button {
  order: 1 !important;
  flex: 0 0 auto !important;
  margin-left: 0 !important;
}
.public-index .upcoming-event-copy {
  order: 2 !important;
  min-width: 0 !important;
}
@media (max-width: 520px) {
  .public-index {
    --public-text-normal: clamp(0.9rem, 3.95vw, 1.08rem);
    --public-title-small: clamp(1rem, 4.3vw, 1.2rem);
    --public-title-large: clamp(1.18rem, 5.25vw, 1.52rem);
    --public-action-text: clamp(0.9rem, 3.95vw, 1.08rem);
    --public-event-icon-size: clamp(1.52rem, 6.2vw, 1.96rem);
    --public-heading-icon-size: clamp(1.42rem, 5.9vw, 1.82rem);
  }
  .public-index .public-event-detail-line .add-calendar-button {
    margin-left: auto !important;
  }
}

.year-calendar-body .year-calendar-download-row {
  display: flex;
  justify-content: center;
  margin: .45rem 0 .75rem;
}
.year-calendar-body .year-calendar-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.year-calendar-body .year-calendar-icon-download {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}
.year-calendar-list-tabs {
  display: none;
  gap: .5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0 .25rem;
}
.year-calendar-list-tabs .filter-button.selected {
  background: var(--yellow) !important;
  color: var(--ink) !important;
  border-color: var(--yellow-2) !important;
}
.year-calendar-list-table tr.past-list-date {
  background: #eef1f4 !important;
  color: #8a94a3 !important;
}
@media (max-width: 900px) {
  .year-calendar-list-tabs {
    display: flex !important;
  }
  .year-calendar-bottom-grid-expanded {
    display: block !important;
  }
  .year-calendar-bottom-grid-expanded [data-year-list-panel] {
    display: none !important;
  }
  .year-calendar-bottom-grid-expanded [data-year-list-panel].active {
    display: block !important;
  }
}
@media (max-width: 640px) {
  .year-calendar-list-table tr.past-list-date {
    background: #eef1f4 !important;
    border-color: rgba(138,148,163,.42) !important;
  }
  .year-calendar-list-table tr.past-list-date td,
  .compact-holiday-table tr.past-list-date td {
    background: transparent !important;
    color: #8a94a3 !important;
    width: 100% !important;
    text-align: left !important;
  }
  .compact-holiday-table th:first-child,
  .compact-holiday-table td:first-child,
  .compact-holiday-table th:nth-child(2),
  .compact-holiday-table td:nth-child(2) {
    width: auto !important;
  }
}


/* v88 public polish: larger class selector type, weather status, larger icons, meal/event layout, portrait year calendar export */
.public-index {
  --public-action-icon-size: 2em;
  --public-heading-icon-size: 2em;
  --public-event-icon-size: 2em;
}
.public-index .public-ks-group h3,
.public-index .filter-button[data-class-id] {
  font-size: var(--public-title-large) !important;
  line-height: 1.12 !important;
}
.public-index .public-ks-group h3 {
  font-weight: 900 !important;
  color: var(--blue-2) !important;
}
.public-index .filter-button[data-class-id] {
  font-weight: 850 !important;
  padding-top: .62rem !important;
  padding-bottom: .62rem !important;
}
.public-index .public-custom-icon {
  width: 2em !important;
  height: 2em !important;
}
.public-index .public-button-icon,
.public-index .public-heading-icon,
.public-index .public-resource-card .public-custom-icon-homework,
.public-index .event-kind-icon .public-custom-icon {
  width: 2em !important;
  height: 2em !important;
}
.public-index .public-table th .public-heading-icon {
  width: 2em !important;
  height: 2em !important;
}
.public-index .meal-public-with-icon {
  display: grid !important;
  grid-template-columns: 2.25em minmax(0, 1fr) !important;
  grid-template-rows: repeat(3, auto) !important;
  gap: .18rem .55rem !important;
  align-items: center !important;
}
.public-index .meal-public-with-icon .meal-output-icon {
  grid-row: 1 / span 3 !important;
  grid-column: 1 !important;
  margin: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.public-index .meal-public-with-icon .meal-output-icon .public-custom-icon-meal {
  width: 2em !important;
  height: 2em !important;
}
.public-index .meal-public-with-icon .meal-line {
  grid-column: 2 !important;
  min-width: 0 !important;
  line-height: 1.22 !important;
}
.public-index .event-item {
  align-items: flex-start !important;
  grid-template-columns: 2em minmax(0, 1fr) !important;
}
.public-index .event-kind-icon {
  align-self: flex-start !important;
  width: 2em !important;
  min-width: 2em !important;
  height: 2em !important;
  min-height: 2em !important;
  margin-top: .02em !important;
}
.public-index .event-item-routine .event-value {
  font-weight: 800 !important;
}
.public-index .upcoming-event-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
}
.public-index .upcoming-event-copy {
  order: 1 !important;
  grid-column: 1 / -1 !important;
}
.public-index .upcoming-event-item .add-calendar-button {
  order: 2 !important;
  grid-column: 2 !important;
  justify-self: end !important;
  align-self: end !important;
  margin-left: auto !important;
  margin-top: .35rem !important;
}
@media (max-width: 640px) {
  .public-index .meal-public-with-icon {
    grid-template-columns: 2.15em minmax(0, 1fr) !important;
  }
}
.public-index .weather-icon,
.public-index .weather-icon-cell {
  font-size: 2em !important;
  line-height: 1 !important;
}

/* v89 spelling print, public visibility and urgent message refinements */
.structure-hidden-public {
  background: #fff8df;
  border-color: #e3aa17;
}
.public-hidden-note {
  margin: .25rem 0 0;
  color: #7a5200;
  font-weight: 850;
  font-size: .9rem;
}
.public-visibility-toggle.is-hidden {
  background: #fff8df;
  color: #7a5200;
  border-color: #e3aa17;
}
.urgent-info-banner {
  display: grid;
  grid-template-columns: minmax(13rem, auto) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  border: 4px solid #b42318;
  background: #fff5f4;
  color: #b42318;
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  text-align: left;
}
.urgent-info-title {
  color: #991b1b;
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.urgent-info-body {
  color: #b42318;
  font-size: clamp(1.9rem, 5.2vw, 2.7rem);
  font-weight: 950;
  line-height: 1.12;
  text-align: center;
}
@media (max-width: 640px) {
  .urgent-info-banner {
    grid-template-columns: 1fr;
    gap: .45rem;
    padding: .9rem;
  }
  .urgent-info-body {
    font-size: clamp(1.65rem, 8vw, 2.25rem);
  }
}


/* v91 spelling bee controls */
.spelling-modal-tools { display:flex; justify-content:flex-end; margin:0 0 .75rem; }
.inline-check { display:inline-flex; align-items:center; gap:.45rem; font-weight:800; color:var(--blue-3); }
.inline-check input { width:1.1rem; height:1.1rem; accent-color:var(--blue-2); }


.public-view-settings-form fieldset label:has(input[type="color"]) {
  align-items: center;
}
.public-view-settings-form input[type="color"] {
  width: 2.4rem;
  height: 2.4rem;
  padding: .12rem;
  border-radius: .45rem;
  border: 1px solid var(--line);
  background: #fff;
}
.public-view-settings-form fieldset {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}


/* v93 Phonics Maze */
.phonics-maze-sounds-section { margin-top: 1rem; }
.phonics-maze-sound-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
}
.phonics-maze-sound-slot {
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #f8fbff;
  padding: .75rem;
  display: grid;
  gap: .5rem;
}
.maze-sound-current { margin: 0; font-size: .88rem; }
.phonics-maze-launch {
  background: linear-gradient(135deg, var(--public-header-blue, #144f8c), var(--public-header-dark-blue, #0c3f78)) !important;
  color: #fff !important;
  border: 2px solid var(--public-accent-yellow, #f5c542) !important;
}
body.phonics-maze-open { overflow: hidden; }
.phonics-maze-overlay {
  position: fixed;
  inset: 0;
  z-index: 7000;
  background: #174f2e;
  color: #fff;
}
.phonics-maze-overlay.hidden { display: none; }
.phonics-maze-stage {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,190,.20), transparent 20%),
    radial-gradient(circle at 85% 80%, rgba(255,215,110,.16), transparent 26%),
    linear-gradient(150deg, #2c7a3e 0%, #1f6736 44%, #15552d 100%);
}
.phonics-maze-trees {
  position: absolute;
  inset: -4rem 0 0 0;
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 1.7;
  letter-spacing: .4rem;
  opacity: .12;
  filter: grayscale(.2);
  pointer-events: none;
  user-select: none;
  transform: rotate(-4deg);
}
.phonics-maze-logo {
  position: absolute;
  top: .8rem;
  right: 5.6rem;
  width: clamp(56px, 9vw, 92px);
  max-height: 92px;
  object-fit: contain;
  z-index: 3;
  background: rgba(255,255,255,.88);
  border-radius: .9rem;
  padding: .25rem;
}
.phonics-maze-exit,
.phonics-maze-mute {
  position: absolute;
  z-index: 4;
  border: 3px solid #f5c542;
  background: #144f8c;
  color: #fff;
  font-weight: 900;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
  cursor: pointer;
}
.phonics-maze-exit { top: .85rem; right: .85rem; padding: .72rem 1.05rem; }
.phonics-maze-mute { bottom: .9rem; right: .9rem; width: 3.4rem; height: 3.4rem; font-size: 1.35rem; }
.phonics-maze-content {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 5.5rem 1rem 4.5rem;
}
.phonics-maze-loading-card,
.phonics-maze-question-card,
.phonics-maze-finish {
  width: min(92vw, 720px);
  background: rgba(255,255,255,.94);
  color: #123b5d;
  border: 4px solid #f5c542;
  border-radius: 2rem;
  padding: clamp(1.1rem, 3vw, 2rem);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.phonics-maze-loading-card h2,
.phonics-maze-question-card h2,
.phonics-maze-finish h2 { margin-top: 0; color: #144f8c; font-size: clamp(2rem, 6vw, 3.5rem); }
.phonics-maze-start,
.phonics-maze-replay {
  border: 3px solid #f5c542;
  background: linear-gradient(135deg, #144f8c, #0c3f78);
  color: #fff;
  border-radius: 999px;
  padding: .85rem 1.45rem;
  font-weight: 900;
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  cursor: pointer;
}
.phonics-maze-progress {
  position: absolute;
  top: 1.05rem;
  left: 1.05rem;
  background: rgba(255,255,255,.92);
  color: #144f8c;
  border: 2px solid #f5c542;
  border-radius: 999px;
  padding: .55rem .95rem;
  font-weight: 900;
}
.phonics-maze-path {
  position: absolute;
  inset: 5rem 8vw 3.8rem 8vw;
  width: 84vw;
  height: calc(100dvh - 9rem);
  pointer-events: none;
  opacity: .92;
}
.phonics-maze-path.short { opacity: .78; }
.phonics-maze-path .maze-border {
  fill: none;
  stroke: #14532d;
  stroke-width: 17;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phonics-maze-path .maze-road {
  fill: none;
  stroke: #e8c77b;
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 7;
}
.phonics-maze-message {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.9);
  color: #174f2e;
  border-radius: 999px;
  padding: .75rem 1.2rem;
  font-weight: 900;
}
.phonics-maze-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: clamp(.8rem, 3vw, 1.4rem);
  margin-top: 1.2rem;
}
.phonics-maze-choice {
  background: #fff;
  border: 4px solid #14532d;
  border-radius: 1.3rem;
  padding: .8rem;
  display: grid;
  gap: .55rem;
  place-items: center;
  min-height: 190px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(18,59,93,.14);
}
.phonics-maze-choice img {
  width: min(38vw, 210px);
  height: min(28vw, 150px);
  object-fit: contain;
}
.phonics-maze-choice strong { font-size: clamp(1.7rem, 6vw, 3.2rem); color: #123b5d; }
.phonics-maze-choice.correct { border-color: #22c55e; background: #ecfdf3; transform: scale(1.02); }
.phonics-maze-choice.incorrect { border-color: #ef4444; animation: maze-wobble .38s ease-in-out; }
.phonics-maze-choice-placeholder { font-size: clamp(2rem, 8vw, 4rem); font-weight: 900; color: #144f8c; }
.phonics-maze-treasure { font-size: clamp(3.2rem, 10vw, 6rem); margin-bottom: .5rem; }
@keyframes maze-wobble {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
@media (max-width: 620px) {
  .phonics-maze-logo { right: 4.9rem; width: 52px; }
  .phonics-maze-choice-grid { grid-template-columns: 1fr 1fr; }
  .phonics-maze-choice { min-height: 150px; padding: .55rem; }
}

/* v94 phonics maze continuous path polish */
.phonics-maze-stage {
  background:
    radial-gradient(circle at 18% 15%, rgba(255,255,190,.18), transparent 22%),
    radial-gradient(circle at 82% 78%, rgba(255,213,111,.14), transparent 28%),
    linear-gradient(150deg, #3a8a45 0%, #26703a 42%, #17582d 100%) !important;
}
.phonics-maze-trees,
.phonics-maze-flowers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  z-index: 0;
}
.phonics-maze-trees span,
.phonics-maze-flowers span {
  position: absolute;
  line-height: 1;
  white-space: nowrap;
}
.phonics-maze-trees span {
  opacity: .18;
  filter: grayscale(.12);
}
.phonics-maze-flowers span {
  opacity: .72;
  filter: saturate(1.05);
}
.phonics-maze-content {
  position: relative !important;
  z-index: 2 !important;
  min-height: 100dvh !important;
  display: block !important;
  padding: 0 !important;
  overflow: hidden !important;
}
.phonics-maze-loading-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.phonics-maze-playfield {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}
.phonics-maze-world {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50dvh - 300px);
  height: calc((var(--maze-sections, 12) + 2) * 430px);
  transform: translateY(var(--maze-offset, 0px));
  transition: transform .9s cubic-bezier(.35, .02, .2, 1);
  z-index: 1;
  pointer-events: none;
}
.maze-section {
  position: relative;
  height: 430px;
}
.maze-road-vertical,
.maze-road-horizontal,
.maze-road-cap {
  position: absolute;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,.16) 0 5px, transparent 6px),
    radial-gradient(circle at 64% 70%, rgba(110,72,30,.16) 0 4px, transparent 5px),
    linear-gradient(180deg, #f2d391 0%, #e5bd6d 100%);
  box-shadow: inset 0 0 18px rgba(102,65,25,.15);
}
.maze-road-vertical {
  left: 50%;
  top: 0;
  width: min(42vw, 340px);
  height: 430px;
  transform: translateX(-50%);
  border-radius: 999px;
}
.maze-road-horizontal {
  left: 50%;
  top: 180px;
  width: min(82vw, 820px);
  height: 170px;
  transform: translateX(-50%);
  border-radius: 999px;
}
.maze-road-cap {
  left: 50%;
  top: 130px;
  width: min(42vw, 340px);
  height: 170px;
  transform: translateX(-50%);
  border-radius: 999px;
}
.maze-t-junction {
  position: absolute;
  left: 0;
  right: 0;
  top: 80px;
  height: 300px;
}
.maze-bushes {
  position: absolute;
  background-image: radial-gradient(circle, #114820 0 8px, transparent 9px), radial-gradient(circle, #1f6b2c 0 7px, transparent 8px), radial-gradient(circle, #2f7a35 0 6px, transparent 7px);
  background-size: 34px 34px, 30px 30px, 26px 26px;
  background-position: 0 0, 13px 12px, 23px 4px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.12));
}
.maze-bushes.left,
.maze-bushes.right {
  top: 0;
  bottom: 0;
  width: 34px;
}
.maze-bushes.left { left: -24px; }
.maze-bushes.right { right: -24px; }
.maze-bushes.top,
.maze-bushes.bottom {
  left: 0;
  right: 0;
  height: 34px;
}
.maze-bushes.top { top: -24px; }
.maze-bushes.bottom { bottom: -24px; }
.buzzy-bee {
  position: absolute;
  z-index: 4;
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: left .42s ease, top .42s ease;
  animation: buzzy-bee-hover 1.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.22));
  pointer-events: none;
}
@keyframes buzzy-bee-hover {
  0%, 100% { margin-top: -5px; }
  50% { margin-top: 9px; }
}
.phonics-maze-choice-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.phonics-maze-choice {
  pointer-events: auto;
  position: absolute;
  top: calc(50dvh - 220px);
  width: min(28vw, 230px) !important;
  min-height: min(28vw, 210px) !important;
  max-height: 245px;
  padding: .55rem !important;
  border-width: 4px !important;
  background: rgba(255,255,255,.96) !important;
  z-index: 6;
}
.phonics-maze-choice.left { left: max(1.3rem, calc(50vw - min(41vw, 410px))); }
.phonics-maze-choice.right { right: max(1.3rem, calc(50vw - min(41vw, 410px))); }
.phonics-maze-choice img {
  width: min(22vw, 170px) !important;
  height: min(16vw, 118px) !important;
}
.phonics-maze-choice strong {
  font-size: clamp(1.35rem, 4.2vw, 2.35rem) !important;
}
.phonics-maze-question-card,
.phonics-maze-prompt-card {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  z-index: 7;
  width: min(92vw, 620px) !important;
  padding: .9rem 1.1rem !important;
  border-radius: 1.4rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
}
.phonics-maze-question-card h2 {
  margin: 0 !important;
  font-size: clamp(1.25rem, 4vw, 2rem) !important;
}
.phonics-maze-replay {
  padding: .65rem 1rem !important;
  font-size: clamp(.95rem, 3vw, 1.18rem) !important;
}
.phonics-maze-progress {
  z-index: 8 !important;
}
.maze-finish-square {
  position: absolute;
  left: 50%;
  top: calc(100% - 285px);
  width: min(46vw, 390px);
  height: min(46vw, 390px);
  transform: translateX(-50%);
  border: 34px dotted #15552d;
  border-radius: 2rem;
  background: #e8c77b;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 24px rgba(102,65,25,.18);
}
.phonics-maze-finish {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
}
.phonics-maze-finish-square {
  width: min(58vw, 430px);
  height: min(42vw, 280px);
  margin: 0 auto .8rem;
  border: 22px dotted #15552d;
  border-radius: 2rem;
  background: #e8c77b;
  display: grid;
  place-items: center;
}
.maze-treasure-pyramid {
  display: grid;
  grid-template-columns: repeat(4, 1.2em);
  justify-content: center;
  align-items: end;
  gap: .05em;
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  line-height: 1;
}
.maze-treasure-pyramid span:nth-child(1) { grid-column: 2 / span 2; }
.maze-treasure-pyramid.big {
  grid-template-columns: repeat(5, 1.1em);
  font-size: clamp(2.5rem, 8vw, 5.2rem);
}
.phonics-maze-finish-actions,
.phonics-maze-finish .form-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: .8rem !important;
  flex-wrap: wrap;
}
.phonics-maze-end-exit {
  border: 3px solid #f5c542 !important;
  border-radius: 999px !important;
  padding: .85rem 1.45rem !important;
  font-weight: 900 !important;
}
.maze-confetti {
  position: absolute;
  top: 24%;
  z-index: 8;
  font-size: clamp(2rem, 7vw, 5rem);
  white-space: nowrap;
  animation: maze-confetti-burst 1.15s ease-out both;
  pointer-events: none;
}
.maze-confetti.left { left: -40vw; }
.maze-confetti.right { right: -40vw; animation-name: maze-confetti-burst-right; }
@keyframes maze-confetti-burst {
  from { transform: translateX(0) rotate(-15deg); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translateX(54vw) rotate(8deg); opacity: .95; }
}
@keyframes maze-confetti-burst-right {
  from { transform: translateX(0) rotate(15deg); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translateX(-54vw) rotate(-8deg); opacity: .95; }
}
@media (max-width: 620px) {
  .phonics-maze-logo { right: 4.9rem; width: 52px; }
  .maze-road-vertical { width: min(58vw, 270px); }
  .maze-road-horizontal { width: min(96vw, 520px); height: 132px; }
  .maze-road-cap { width: min(58vw, 270px); height: 132px; }
  .phonics-maze-choice {
    top: calc(50dvh - 188px);
    width: 42vw !important;
    min-height: 142px !important;
  }
  .phonics-maze-choice.left { left: .5rem; }
  .phonics-maze-choice.right { right: .5rem; }
  .phonics-maze-choice img { width: 30vw !important; height: 90px !important; }
  .phonics-maze-question-card { bottom: .6rem; }
}

/* v95 phonics maze simplified bee format */
.phonics-maze-stage {
  background:
    radial-gradient(circle at 18% 15%, rgba(255,255,190,.16), transparent 22%),
    radial-gradient(circle at 82% 78%, rgba(255,213,111,.12), transparent 28%),
    linear-gradient(150deg, #3a8a45 0%, #26703a 42%, #17582d 100%) !important;
}
.phonics-maze-trees span { opacity: .24 !important; }
.phonics-maze-flowers span { opacity: .82 !important; }
.phonics-maze-content {
  position: relative !important;
  z-index: 2 !important;
  min-height: 100dvh !important;
  display: grid !important;
  place-items: center !important;
  padding: 5.4rem 1rem 4.6rem !important;
}
.phonics-maze-loading-card {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 5;
}
.phonics-maze-playfield {
  position: relative;
  width: min(94vw, 1040px);
  min-height: min(74vh, 760px);
  margin: 0 auto;
  overflow: hidden;
}
#phonicsMazeBee {
  position: absolute;
  z-index: 6;
  font-size: clamp(3rem, 8vw, 5.8rem);
  line-height: 1;
  transform: translate(-50%, -50%);
  transition-property: left, top;
  transition-timing-function: ease-in-out;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.22));
  pointer-events: none;
}
#phonicsMazeBee.hovering { animation: buzzy-bee-hover 1.3s ease-in-out infinite; }
#phonicsMazeBee.maze-bee-loop { animation: buzzy-bee-loop .72s ease-in-out 1, buzzy-bee-hover 1.3s ease-in-out infinite; }
@keyframes buzzy-bee-hover {
  0%, 100% { transform: translate(-50%, -50%) translateY(-5px); }
  50% { transform: translate(-50%, -50%) translateY(7px); }
}
@keyframes buzzy-bee-loop {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  25% { transform: translate(-50%, -50%) translateY(-16px) rotate(10deg) scale(1.08); }
  55% { transform: translate(-50%, -50%) translateY(-30px) rotate(-9deg) scale(1.13); }
  100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
}
.phonics-maze-card-row {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, calc(-50% + 240px));
  width: min(92vw, 760px);
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: clamp(1rem, 3vw, 1.8rem);
  opacity: 0;
  transition: transform .58s ease, opacity .42s ease;
  z-index: 4;
}
.phonics-maze-card-row.entered {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.phonics-maze-card-row.leaving-left {
  opacity: 0;
  transform: translate(calc(-50% - 140px), -50%);
}
.phonics-maze-card-row.leaving-right {
  opacity: 0;
  transform: translate(calc(-50% + 140px), -50%);
}
.phonics-maze-choice-card {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  min-height: 270px;
  display: grid;
  place-items: center;
}
.phonics-maze-choice-card:disabled { cursor: default; }
.phonics-maze-choice-flower {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(6rem, 18vw, 12rem);
  line-height: 1;
  z-index: 0;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.12));
}
.phonics-maze-card-shell {
  position: relative;
  z-index: 1;
  width: min(260px, 90%);
  min-height: 190px;
  background: rgba(255,255,255,.96);
  border: 4px solid #14532d;
  border-radius: 1.45rem;
  padding: .75rem .7rem .85rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .45rem;
  box-shadow: 0 12px 24px rgba(18,59,93,.14);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.phonics-maze-choice-card img {
  width: min(150px, 100%);
  height: 104px;
  object-fit: contain;
}
.phonics-maze-choice-card strong {
  font-size: clamp(1.35rem, 3.8vw, 2.25rem);
  color: #123b5d;
}
.phonics-maze-choice-card.correct .phonics-maze-card-shell {
  border-color: #22c55e;
  background: #ecfdf3;
  transform: scale(1.03);
}
.phonics-maze-choice-card.incorrect .phonics-maze-card-shell {
  border-color: #ef4444;
  animation: maze-wobble .36s ease-in-out 1;
}
.phonics-maze-question-panel {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  z-index: 5;
  width: min(92vw, 560px);
  background: rgba(255,255,255,.95);
  color: #123b5d;
  border: 4px solid #f5c542;
  border-radius: 1.5rem;
  padding: .95rem 1.1rem;
  display: grid;
  justify-items: center;
  gap: .65rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,.18);
}
.phonics-maze-question-panel h2 {
  margin: 0;
  color: #144f8c;
  font-size: clamp(1.35rem, 4vw, 2rem);
}
.phonics-maze-replay {
  padding: .7rem 1rem !important;
  font-size: clamp(1rem, 2.8vw, 1.15rem) !important;
}
.phonics-maze-progress {
  z-index: 7 !important;
}
.phonics-maze-finish-simple {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 720px);
  z-index: 4;
  background: rgba(255,255,255,.95);
  color: #123b5d;
  border: 4px solid #f5c542;
  border-radius: 2rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
}
.phonics-maze-honey {
  font-size: clamp(6rem, 18vw, 10rem);
  line-height: 1;
  margin-bottom: .6rem;
}
.maze-finish-bee {
  z-index: 6;
}
@keyframes maze-wobble {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}
@media (max-width: 700px) {
  .phonics-maze-playfield {
    width: min(96vw, 1040px);
    min-height: min(76vh, 760px);
  }
  .phonics-maze-card-row {
    width: min(96vw, 700px);
    gap: .7rem;
  }
  .phonics-maze-choice-card {
    min-height: 220px;
  }
  .phonics-maze-choice-flower {
    font-size: clamp(5.2rem, 23vw, 9rem);
  }
  .phonics-maze-card-shell {
    width: min(94%, 210px);
    min-height: 165px;
    padding: .55rem .45rem .7rem;
  }
  .phonics-maze-choice-card img {
    width: min(120px, 100%);
    height: 82px;
  }
  .phonics-maze-question-panel {
    bottom: .6rem;
    width: min(94vw, 520px);
  }
}

/* v96 phonics game polish */
.phonics-maze-logo {
  left: .85rem !important;
  right: auto !important;
  top: .85rem !important;
}
.phonics-maze-exit {
  top: .85rem !important;
  right: .85rem !important;
}
.phonics-maze-progress {
  top: 4.55rem !important;
  right: 1rem !important;
  left: auto !important;
  min-width: 4.7rem;
  text-align: center;
}
.phonics-maze-trees span { opacity: .34 !important; }
.phonics-maze-flowers span { opacity: .90 !important; }
.phonics-maze-playfield {
  width: min(95vw, 1080px) !important;
}
.phonics-maze-card-row {
  top: 49% !important;
}
.phonics-maze-card-shell {
  background: #ffffff !important;
}
.phonics-maze-card-shell strong:empty {
  display: none;
}
.phonics-maze-question-panel {
  width: min(94vw, 620px) !important;
  gap: .8rem !important;
}
.phonics-maze-replay {
  font-size: clamp(1.15rem, 3vw, 1.35rem) !important;
  padding: .9rem 1.4rem !important;
  box-shadow: 0 10px 22px rgba(20,79,140,.22);
}
.maze-flower-burst {
  position: absolute;
  z-index: 8;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1;
  transform: translate(-50%, -50%);
  animation: maze-flower-burst .82s ease-out forwards;
  pointer-events: none;
}
@keyframes maze-flower-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--burst-x)), calc(-50% + var(--burst-y))) scale(1.1) rotate(var(--burst-rotate)); }
}
@media (max-width: 700px) {
  .phonics-maze-logo {
    left: .6rem !important;
    width: 52px !important;
  }
  .phonics-maze-progress {
    top: 4.2rem !important;
    right: .7rem !important;
    padding: .45rem .78rem !important;
  }
  .phonics-maze-question-panel {
    width: min(95vw, 580px) !important;
  }
}

/* v97 bulk phonics/spelling manager */
.phonics-sub-buttons {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.phonics-sub-buttons button.selected {
  background: var(--blue-2, #1765a8);
  color: #fff;
  border-color: var(--blue-3, #123b5d);
}
.bulk-manager-card {
  display: grid;
  gap: 1rem;
}
.bulk-manager-heading {
  align-items: flex-start;
  gap: 1rem;
}
.bulk-manager-controls,
.bulk-copy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .75rem;
  align-items: end;
}
.bulk-copy-panel {
  border: 1px solid var(--line, #d6e1ec);
  border-radius: 1rem;
  padding: .8rem 1rem;
  background: #f8fcff;
}
.bulk-copy-panel summary {
  cursor: pointer;
  color: var(--blue-3, #123b5d);
}
.bulk-copy-types {
  grid-column: 1 / -1;
  border: 1px solid var(--line, #d6e1ec);
  border-radius: .85rem;
  padding: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .9rem;
}
.bulk-copy-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 700;
}
.bulk-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 1rem;
  align-items: start;
}
.bulk-week-table-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line, #d6e1ec);
  border-radius: 1rem;
  background: #fff;
}
.bulk-week-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}
.bulk-week-table th,
.bulk-week-table td {
  border-bottom: 1px solid var(--line, #d6e1ec);
  padding: .75rem;
  vertical-align: top;
}
.bulk-week-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--blue-3, #123b5d);
  color: #fff;
}
.bulk-week-table tbody th {
  width: 145px;
  color: var(--blue-3, #123b5d);
  background: #f8fcff;
}
.bulk-week-table tbody th span {
  font-size: .92rem;
  color: #4b6378;
}
.bulk-week-table tbody th em {
  display: inline-block;
  margin-top: .35rem;
  font-style: normal;
  font-size: .85rem;
  color: #8a5a00;
}
.bulk-holiday-week th,
.bulk-holiday-week td {
  background: #fff3cd !important;
}
.bulk-resource-list,
.bulk-add-row {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  align-items: stretch;
}
.bulk-add-row {
  margin-top: .55rem;
}
.bulk-resource-chip,
.bulk-add-chip {
  border-radius: .85rem;
  border: 1px solid var(--line, #d6e1ec);
  background: #fff;
  color: var(--blue-3, #123b5d);
  padding: .55rem .7rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(18, 59, 93, .08);
}
.bulk-resource-chip {
  min-width: 150px;
  max-width: 260px;
}
.bulk-resource-chip span {
  display: block;
  font-weight: 900;
}
.bulk-resource-chip small {
  display: block;
  color: #52687d;
  line-height: 1.25;
  margin-top: .2rem;
}
.bulk-resource-chip.teacher-message {
  border-color: #f5c542;
  background: #fffdf0;
}
.bulk-add-chip {
  background: #eef7ff;
  border-style: dashed;
  font-weight: 800;
}
.bulk-week-table tr:hover td,
.bulk-week-table tr:hover th {
  background: #f1f8ff;
}
.bulk-editor-panel {
  position: sticky;
  top: 1rem;
  max-height: 78vh;
  overflow: auto;
  border: 1px solid var(--line, #d6e1ec);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(18, 59, 93, .09);
}
.bulk-editor-sticky {
  display: grid;
  gap: .8rem;
}
.bulk-editor-body {
  display: grid;
  gap: .85rem;
}
.bulk-editor-body textarea,
.bulk-editor-body input,
.bulk-editor-body select {
  max-width: 100%;
}
.bulk-editor-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.86), #fff 35%);
  padding-top: .75rem;
  margin-top: .25rem;
}
.bulk-editor-panel .spelling-grid-list {
  max-height: 330px;
  overflow: auto;
}
.bulk-editor-panel .phonics-choice-grid {
  max-height: 360px;
  overflow: auto;
}
@media (max-width: 980px) {
  .bulk-manager-layout {
    grid-template-columns: 1fr;
  }
  .bulk-editor-panel {
    position: relative;
    top: 0;
    max-height: none;
  }
  .bulk-week-table-wrap {
    max-height: 60vh;
  }
}

/* v98 bulk manager scroll stability */
.bulk-week-table tr.bulk-drop-target th,
.bulk-week-table tr.bulk-drop-target td {
  background: #e7f4ff !important;
  outline: 2px dashed var(--blue-2, #1765a8);
  outline-offset: -4px;
}
.bulk-week-table tr.bulk-drop-confirmed th,
.bulk-week-table tr.bulk-drop-confirmed td {
  animation: bulk-drop-confirmed-flash 1.1s ease-out;
}
@keyframes bulk-drop-confirmed-flash {
  0% { background: #d8fbe6; }
  100% { background: inherit; }
}

/* v99 bulk manager and spelling/phonics workflow polish */
.phonics-single-select-wrap {
  display: flex;
  align-items: end;
  padding-top: 1.45rem;
}
.phonics-single-select-button {
  border: 2px solid var(--public-accent-yellow, #f5c542);
  background: #144f8c;
  color: #fff;
  border-radius: 999px;
  padding: .62rem 1rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.spelling-bulk-add-tool {
  margin: 0 0 1rem;
  padding: .9rem;
  background: #f8fbff;
  border: 2px solid #dbeafe;
  border-radius: 1rem;
  display: grid;
  gap: .65rem;
}
.spelling-bulk-add-tool label {
  display: grid;
  gap: .35rem;
  font-weight: 800;
}
.spelling-bulk-add-tool textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: .75rem;
  padding: .65rem;
  font: inherit;
  background: #fff;
}
.spelling-bulk-add-tool button {
  justify-self: start;
}
.spelling-grid-input.spelling-added-flash {
  animation: spelling-added-flash 1.05s ease-out;
}
@keyframes spelling-added-flash {
  0% { background: #bbf7d0; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
  100% { background: #fff; box-shadow: none; }
}
.bulk-overwrite-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .46);
  padding: 1rem;
}
.bulk-overwrite-dialog {
  width: min(92vw, 620px);
  background: #fff;
  color: #123b5d;
  border: 4px solid #f5c542;
  border-radius: 1.4rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
  padding: 1.2rem;
}
.bulk-overwrite-dialog h3 {
  margin-top: 0;
  color: #144f8c;
}
.bulk-overwrite-dialog p {
  line-height: 1.45;
}
.bulk-overwrite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
.bulk-overwrite-actions button {
  border: 2px solid #f5c542;
  background: #144f8c;
  color: #fff;
  border-radius: 999px;
  padding: .7rem 1rem;
  font-weight: 800;
  cursor: pointer;
}
.bulk-overwrite-actions button.secondary {
  background: #fff;
  color: #144f8c;
}
@media (max-width: 760px) {
  .phonics-single-select-wrap {
    padding-top: 0;
  }
  .bulk-overwrite-actions {
    justify-content: stretch;
  }
  .bulk-overwrite-actions button {
    flex: 1 1 100%;
  }
}

/* v100 final polish: phonics PDF/game, usage, routines, class controls */
.public-phonic-image-button {
  width: min(230px, 58vw) !important;
  min-height: 115px !important;
  padding: .35rem !important;
}
.public-phonic-image-button img {
  max-height: 125px !important;
  max-width: 100% !important;
}
.public-phonic-card h3 {
  font-size: clamp(6rem, 22vw, 16rem) !important;
  line-height: .86 !important;
  letter-spacing: .02em;
}
.public-phonic-placeholder {
  font-size: clamp(6rem, 22vw, 16rem) !important;
  line-height: .86 !important;
}
.phonics-maze-choice-card,
.phonics-maze-card-shell,
.phonics-maze-card-shell * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  touch-action: manipulation !important;
}
.phonics-maze-card-shell {
  width: min(410px, 96%) !important;
  min-height: 275px !important;
  background: #fff !important;
}
.phonics-maze-choice-card img {
  width: min(300px, 100%) !important;
  height: 208px !important;
  max-height: 208px !important;
}
.phonics-maze-choice-card strong,
.phonics-maze-choice-placeholder {
  font-size: clamp(5rem, 16vw, 13rem) !important;
  line-height: .82 !important;
  font-weight: 900 !important;
  color: #123b5d !important;
}
@media (max-width: 700px) {
  .public-phonic-image-button { width: min(200px, 54vw) !important; min-height: 92px !important; }
  .public-phonic-image-button img { max-height: 96px !important; }
  .public-phonic-card h3 { font-size: clamp(5.5rem, 24vw, 12rem) !important; }
  .phonics-maze-card-shell { min-height: 215px !important; }
  .phonics-maze-choice-card img { width: min(210px, 100%) !important; height: 145px !important; max-height: 145px !important; }
  .phonics-maze-choice-card strong,
  .phonics-maze-choice-placeholder { font-size: clamp(3.8rem, 17vw, 8rem) !important; }
}
.structure-class-row .form-actions button {
  padding: .34rem .5rem !important;
  font-size: .78rem !important;
  min-height: 2rem !important;
}
.structure-functions .function-check {
  min-height: 2rem !important;
  padding: .22rem .38rem !important;
  font-size: .76rem !important;
}
.structure-functions .function-check input {
  width: 1.12rem !important;
  height: 1.12rem !important;
}
.structure-functions .function-check .function-name-edit,
.structure-functions .function-check .function-name-edit.icon-button {
  width: 1.28rem !important;
  min-width: 1.28rem !important;
  height: 1.28rem !important;
  min-height: 1.28rem !important;
}
.compact-weekday-routine-grid textarea {
  text-align: center !important;
}
.compact-weekday-routine-grid textarea.routine-saved {
  background: #fff4c8 !important;
  color: #4a2d05 !important;
  border-color: #e0b74f !important;
  font-weight: 700;
}
.usage-game-clustered,
.usage-game-column-chart {
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  gap: .9rem;
  padding: 1rem .6rem .4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow-x: auto;
}
.usage-game-clustered {
  flex-direction: column;
  align-items: stretch;
  min-height: 260px;
}
.usage-game-cluster-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: .75rem;
  align-items: end;
  min-height: 155px;
}
.usage-game-cluster-row > span {
  font-weight: 800;
  color: var(--blue-2);
  align-self: center;
}
.usage-game-cluster-bars {
  height: 150px;
  display: flex;
  align-items: flex-end;
  gap: .55rem;
  border-bottom: 1px solid var(--line);
}
.usage-game-cluster-bars i,
.usage-game-column i {
  width: 2.2rem;
  min-height: 5px;
  border-radius: .4rem .4rem 0 0;
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  color: #123b5d;
  font-style: normal;
}
.usage-game-cluster-bars i b,
.usage-game-column i b {
  position: absolute;
  top: -.95rem;
  font-size: .78rem;
}
.usage-game-column-chart {
  align-items: flex-end;
}
.usage-game-column {
  width: 95px;
  min-width: 95px;
  height: 220px;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: end;
  gap: .4rem;
}
.usage-game-column span {
  text-align: center;
  font-size: .82rem;
  color: var(--blue-2);
  font-weight: 800;
  line-height: 1.1;
}
.usage-game-column i {
  width: 3rem;
}

/* v101 bug fixes and final adjustments */
.public-phonic-image-button {
  width: min(276px, 70vw) !important;
  min-height: 138px !important;
}
.public-phonic-image-button img {
  max-height: 150px !important;
}
.public-phonic-card h3,
.public-phonic-placeholder {
  font-size: clamp(4.8rem, 17.6vw, 12.8rem) !important;
}
.phonics-maze-card-shell {
  width: min(560px, 98%) !important;
  min-height: 350px !important;
}
.phonics-maze-choice-card img {
  width: min(420px, 100%) !important;
  height: 290px !important;
  max-height: 290px !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
}
.phonics-maze-choice-card strong,
.phonics-maze-choice-placeholder {
  font-size: clamp(8rem, 23vw, 18rem) !important;
  line-height: .78 !important;
}
.phonics-output-settings-form label {
  align-items: center;
}
.phonics-output-settings-form input[type="range"] {
  width: min(280px, 100%);
}
.range-value {
  display: inline-block;
  min-width: 4.5rem;
  margin-left: .5rem;
  font-weight: 800;
  color: var(--blue-2);
}
.class-function-modal.actions-top .modal-actions {
  order: -1;
  border-bottom: 1px solid var(--line);
  border-top: 0;
  padding-bottom: .7rem;
  margin-bottom: .75rem;
}
.class-function-modal.actions-top .class-function-modal-body {
  order: 1;
}
@media (max-width: 700px) {
  .public-phonic-image-button { width: min(240px, 65vw) !important; min-height: 115px !important; }
  .public-phonic-image-button img { max-height: 115px !important; }
  .public-phonic-card h3,
  .public-phonic-placeholder { font-size: clamp(4.4rem, 19.2vw, 9.6rem) !important; }
  .phonics-maze-card-shell { min-height: 275px !important; }
  .phonics-maze-choice-card img { width: min(300px, 100%) !important; height: 205px !important; max-height: 205px !important; }
  .phonics-maze-choice-card strong,
  .phonics-maze-choice-placeholder { font-size: clamp(5.8rem, 24vw, 11rem) !important; }
}

/* v102 phonics PDF live preview controls */
.phonics-pdf-live-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #eef7ff;
  border: 1px solid rgba(20,79,140,.18);
  border-radius: 12px;
  padding: .65rem .85rem;
  margin: .35rem 0 .6rem;
}
.phonics-pdf-live-controls.hidden { display: none !important; }
.phonics-pdf-live-controls label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 800;
  color: #123b5d;
}
.phonics-pdf-live-controls input[type="range"] { width: min(260px, 48vw); }
.phonics-pdf-live-controls p { margin: 0; }
.phonics-game-sounds-panel { margin-top: 1rem; }


/* v103 admin calendar/event timing and layout polish */
.admin-topline {
  padding: .55rem .85rem !important;
  gap: .65rem !important;
}
.admin-topline > div:first-child {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}
.admin-topline h2 { margin: 0 !important; }
.admin-topline #userSummary { margin: 0 !important; }
.tab-nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.calendar-page-table-wrap,
.wide-card .calendar-page-table-wrap {
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}
.calendar-page-table-wrap .data-table th { position: sticky; top: 0; z-index: 5; }
.inline-editor textarea { min-width: 220px; }
.inline-time-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: .35rem;
  margin: .35rem 0;
  padding: .45rem;
  border: 1px dashed var(--line);
  border-radius: .65rem;
  background: #fffdf2;
}
.inline-time-controls.hidden { display: none !important; }
.inline-time-controls input[type="time"] { width: 100%; }
.inline-time-controls .tiny-label { grid-column: 1 / -1; margin: 0; }
.cell-action-stack { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.add-timed-event-button { font-size: .72rem !important; padding: .25rem .4rem !important; }
.calendar-top-actions { justify-content: flex-start; margin: .35rem 0 .55rem; }
.responsive-calendar[data-calendar="class"] .ks-resources-wide-cell,
.responsive-calendar[data-calendar="class"] th[data-col-key="ks_resources"] {
  min-width: 170px !important;
  width: 170px !important;
  max-width: 170px !important;
}
.responsive-calendar[data-calendar="class"] .class-col {
  min-width: 210px;
  width: max(210px, calc((100vw - 680px) / 4));
}
.structure-ks-grid .form-actions button,
.structure-class-row .form-actions button {
  padding: .34rem .5rem !important;
  font-size: .78rem !important;
  min-height: 2rem !important;
}
.pin-required-inline {
  margin-top: .35rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 800;
  color: #123b5d;
}
.pin-required-inline input { width: 1.15rem; height: 1.15rem; }
.routine-grid-with-pin { grid-template-columns: minmax(110px, .75fr) repeat(5, minmax(120px, 1fr)) !important; align-items: end; }
.inline-routine-pin { align-self: stretch; display: flex !important; flex-direction: column; justify-content: end; gap: .25rem; }
.inline-routine-pin input { width: 100%; }
.pin-not-required { color: #64748b; font-size: .85rem; justify-content: center; }
@media (max-width: 980px) {
  .routine-grid-with-pin { grid-template-columns: 1fr !important; }
  .admin-topline > div:first-child { display: block; }
}
/* v103 small Manage Classes alignment */
.structure-class-row .pin-required-inline { float: right; clear: both; }

/* v105 event-card admin calendar UI, help modal, sticky headers and compact wide controls */
.admin-page-help-row {
  display: flex;
  justify-content: center;
  margin: .75rem 0 .35rem;
}
.admin-page-help-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.admin-page-help-card {
  width: min(720px, 96vw);
  max-height: min(760px, 88vh);
  overflow: auto;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .3);
  padding: 1.2rem;
  position: relative;
}
.admin-page-help-close {
  position: absolute;
  top: .6rem;
  right: .6rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  padding: 0;
}
.admin-help-list {
  display: grid;
  gap: .75rem;
}
.admin-help-list section {
  border: 1px solid var(--line);
  background: #f8fbff;
  border-radius: .75rem;
  padding: .75rem;
}
.admin-help-list h3 { margin: 0 0 .25rem; color: var(--blue-2); }
.admin-help-list p { margin: 0; }

.calendar-page-table-wrap {
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}
.calendar-page-table-wrap .data-table th {
  position: sticky;
  top: var(--calendar-sticky-top, 0px) !important;
  z-index: 18 !important;
}
.calendar-page-table-wrap .data-table th.date-col {
  z-index: 22 !important;
}

.admin-event-cell {
  min-width: 230px;
}
.admin-event-card-list {
  display: grid;
  gap: .45rem;
}
.admin-event-card {
  border: 1px solid rgba(20, 79, 140, .28);
  background: #ffffff;
  border-radius: .75rem;
  padding: .45rem;
  box-shadow: 0 2px 8px rgba(15, 45, 90, .08);
}
.admin-event-card.legacy-event-card {
  border-style: dashed;
}
.admin-event-card-time {
  display: inline-block;
  margin-bottom: .3rem;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: #e7f0fb;
  color: var(--blue-2);
  font-weight: 850;
  font-size: .8rem;
}
.admin-event-title-input {
  width: 100%;
  min-height: 3.2rem;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: .55rem;
  padding: .4rem;
  font: inherit;
  background: #fff;
}
.admin-event-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
  margin-top: .35rem;
}
.admin-event-card-actions .save-mini,
.admin-event-card-actions .advance-star-button,
.inline-time-controls .clear-inline-time {
  padding: .25rem .4rem;
  font-size: clamp(.68rem, .78vw, .82rem);
  min-height: 1.75rem;
}
.add-admin-event-button {
  margin-top: .45rem;
  width: 100%;
  padding: .35rem .45rem;
  font-size: .82rem;
}
.admin-event-card.saved-flash {
  animation: eventSavedFlash .9s ease-out;
}
@keyframes eventSavedFlash {
  0% { background: #dcfce7; }
  100% { background: #fff; }
}
.inline-time-controls {
  margin-top: .35rem;
  padding: .4rem;
  border-radius: .65rem;
  border: 1px dashed rgba(20,79,140,.25);
  background: #f8fbff;
}
.inline-time-controls label {
  display: block;
  margin-bottom: .3rem;
  font-size: .82rem;
  font-weight: 750;
}
.inline-time-controls input[type="time"] {
  width: 100%;
  margin-top: .15rem;
}

.wide-card .form-actions button,
.wide-card .inline-controls button,
.wide-card .tab-nav button,
.wide-card .secondary,
.wide-card button {
  min-width: 0;
  white-space: normal;
  line-height: 1.05;
}
@media (min-width: 900px) {
  .wide-card button,
  .tab-panel.wide-card button,
  .card.wide-card button {
    font-size: clamp(.68rem, .72vw, .88rem);
    padding-left: clamp(.28rem, .45vw, .65rem);
    padding-right: clamp(.28rem, .45vw, .65rem);
  }
}
.tab-nav {
  overflow-x: auto;
  scrollbar-width: thin;
}
@media (min-width: 1180px) {
  .tab-nav {
    overflow-x: visible;
  }
}

/* v106: fixed-size phonics PDF preview, collapsed event cards, floating calendar header */
.pdf-a4-preview-shell {
  width: min(100%, 820px) !important;
  height: min(1123px, calc(100vh - 190px)) !important;
  aspect-ratio: auto !important;
  overflow: auto !important;
  display: block !important;
}
.pdf-a4-preview-shell iframe {
  width: 794px !important;
  min-width: 794px !important;
  height: 1123px !important;
  min-height: 1123px !important;
  display: block;
  margin: 0 auto;
}
@media (max-width: 840px) {
  .pdf-a4-preview-shell iframe { margin: 0; }
}

.admin-event-card.collapsed {
  cursor: pointer;
  padding: .38rem .45rem;
}
.admin-event-card.collapsed .admin-event-edit-area {
  display: none;
}
.admin-event-card.editing .admin-event-card-summary {
  display: none;
}
.admin-event-card-summary {
  display: grid;
  gap: .15rem;
}
.admin-event-summary-time,
.admin-event-card-time {
  color: var(--blue-2);
  font-size: .74rem;
  font-weight: 850;
  line-height: 1.05;
}
.admin-event-summary-title {
  color: #14213d;
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.12;
  overflow-wrap: anywhere;
}
.inline-time-controls .clear-inline-time {
  padding: .25rem .4rem;
  font-size: clamp(.68rem, .78vw, .82rem);
  min-height: 1.75rem;
}

/* Remove the previous table-header sticky behaviour; use a floating readable header instead. */
.calendar-page-table-wrap .data-table th {
  position: static !important;
  top: auto !important;
}
.calendar-floating-header {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2500;
  width: min(96vw, 1180px);
  background: rgba(18, 59, 93, .96);
  color: #fff;
  border-radius: 0 0 .85rem .85rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  padding: .35rem .55rem;
  scrollbar-width: thin;
}
.calendar-floating-header.hidden { display: none !important; }
.calendar-floating-header span {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  padding: .18rem .5rem;
  font-size: clamp(.66rem, .82vw, .82rem);
  font-weight: 800;
  white-space: nowrap;
}

/* V107 continuous feedback */
.feedback-build-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,360px);gap:1rem;align-items:start}.feedback-survey-form textarea{resize:vertical}.feedback-preview-card-wrap{position:sticky;top:1rem;border:1px solid rgba(20,79,140,.18);border-radius:18px;background:#f8fbff;padding:1rem}.feedback-target-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.compact-checkbox-grid{max-height:260px;overflow:auto}.feedback-panel.hidden{display:none}.feedback-sub-buttons{margin-bottom:1rem}.feedback-admin-card{border:1px solid rgba(20,79,140,.2);border-radius:18px;background:#fff;padding:1rem;margin:1rem 0;box-shadow:0 8px 20px rgba(12,63,120,.08)}.feedback-admin-card header{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.feedback-admin-card h3{margin:.1rem 0}.feedback-status-pill{border-radius:999px;padding:.25rem .7rem;font-weight:800;text-transform:capitalize;background:#edf4ff;color:#144f8c}.feedback-status-pill.live{background:#e8f8ec;color:#176533}.feedback-status-pill.ended{background:#f3f3f3;color:#555}.feedback-stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;margin:.8rem 0}.feedback-stat-grid div{border:1px solid rgba(20,79,140,.16);border-radius:14px;padding:.7rem;text-align:center;background:#f8fbff}.feedback-stat-grid strong{display:block;font-size:1.7rem;color:#144f8c}.feedback-stat-grid span{font-size:.85rem;color:#52606d}.feedback-admin-toolbar{display:flex;gap:.75rem;flex-wrap:wrap;margin:.8rem 0}.feedback-bars{display:grid;gap:.5rem}.feedback-bar-row{display:grid;grid-template-columns:minmax(90px,180px) 1fr auto;gap:.5rem;align-items:center}.feedback-bar-row div{height:18px;background:#edf4ff;border-radius:999px;overflow:hidden}.feedback-bar-row b{display:block;height:100%;background:#144f8c;border-radius:999px}.feedback-pie-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:.45rem}.feedback-pie-list div{border:1px solid rgba(20,79,140,.14);border-radius:12px;padding:.5rem;display:flex;justify-content:space-between;gap:.4rem}.feedback-card-actions{flex-wrap:wrap}.feedback-colours{grid-template-columns:repeat(3,minmax(0,1fr))}.continuous-feedback-prompt{position:fixed;right:1rem;bottom:1rem;z-index:9999;max-width:min(380px,calc(100vw - 2rem));}.continuous-feedback-prompt.hidden{display:none}.public-feedback-card{--feedback-bg:#144f8c;--feedback-colour:#fff;--feedback-border:#f5c542;position:relative;background:var(--feedback-bg);color:var(--feedback-colour);border:4px solid var(--feedback-border);border-radius:20px;box-shadow:0 18px 44px rgba(0,0,0,.24);padding:1rem}.public-feedback-card.preview{box-shadow:0 8px 24px rgba(0,0,0,.16)}.public-feedback-card h3{margin:.2rem 2rem .9rem 0;font-size:1.1rem;line-height:1.25;color:var(--feedback-colour)}.public-feedback-close{position:absolute;right:.5rem;top:.4rem;border:0!important;background:rgba(255,255,255,.22)!important;color:inherit!important;border-radius:999px;width:30px;height:30px;padding:0!important;font-weight:900}.public-feedback-options,.public-feedback-actions{display:flex;flex-wrap:wrap;gap:.5rem}.public-feedback-options button,.public-feedback-actions button,.public-feedback-word-options label{border:0;border-radius:999px;background:#fff;color:#123b5d;padding:.55rem .8rem;font-weight:800;box-shadow:0 2px 6px rgba(0,0,0,.12);cursor:pointer}.public-feedback-skip{display:block;margin:.8rem auto 0;background:transparent!important;border:0!important;color:inherit!important;text-decoration:underline;font-weight:700}.public-feedback-follow-preview{margin-top:.8rem;background:rgba(255,255,255,.16);border-radius:14px;padding:.6rem}.public-feedback-follow-preview div,.public-feedback-word-options{display:flex;flex-wrap:wrap;gap:.45rem;margin-top:.5rem}.public-feedback-follow-preview span,.public-feedback-word-options span{display:inline-block;background:rgba(255,255,255,.95);color:#123b5d;border-radius:999px;padding:.35rem .6rem;font-weight:700}.public-feedback-word-options input{position:absolute;opacity:0}.public-feedback-word-options label:has(input:checked){outline:3px solid var(--feedback-border);background:#fff8d8}.calendar-floating-header{display:none!important}
@media(max-width:820px){.feedback-build-grid,.feedback-target-grid{grid-template-columns:1fr}.feedback-preview-card-wrap{position:static}.continuous-feedback-prompt{left:.75rem;right:.75rem;bottom:.75rem}.feedback-colours{grid-template-columns:1fr}.feedback-bar-row{grid-template-columns:1fr}.feedback-stat-grid{grid-template-columns:1fr}}

/* V108 continuous feedback polish */
.feedback-guide-box{margin-top:.45rem;border:1px solid rgba(20,79,140,.18);border-radius:14px;background:#f8fbff;padding:.55rem .75rem;max-width:840px}.feedback-guide-box summary{cursor:pointer;font-weight:800;color:#144f8c}.feedback-guide-box p{margin:.45rem 0}.feedback-colour-row{display:flex;align-items:flex-end;gap:.65rem;flex-wrap:nowrap}.feedback-colour-row label{display:flex!important;flex-direction:column;align-items:center;gap:.25rem;min-width:96px;font-size:.8rem;text-align:center}.feedback-colour-row input[type="color"]{appearance:none;-webkit-appearance:none;width:38px;height:38px;border:2px solid rgba(20,79,140,.25);border-radius:8px;padding:0;background:#fff;cursor:pointer}.feedback-colour-row input[type="color"]::-webkit-color-swatch-wrapper{padding:0}.feedback-colour-row input[type="color"]::-webkit-color-swatch{border:0;border-radius:6px}.feedback-follow-fieldset{display:block!important}.feedback-follow-toggle{display:flex!important;align-items:center;justify-content:flex-start;gap:.45rem;margin:.15rem 0 .65rem 0;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;text-align:left}.feedback-follow-toggle input{width:18px;height:18px;flex:0 0 auto}.feedback-follow-toggle span{font-weight:700}.public-feedback-card{overflow:hidden;text-align:center}.public-feedback-context{font-size:.78rem;opacity:.72;margin:.05rem 2rem .4rem;text-align:center;font-weight:700}.public-feedback-card h3{margin:.2rem 1.9rem .9rem;text-align:center}.public-feedback-options,.public-feedback-actions{justify-content:center}.public-feedback-bottom-row{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin:.8rem 0 0}.public-feedback-bottom-row .public-feedback-skip,.public-feedback-bottom-row .public-feedback-info{margin:0;background:transparent!important;border:0!important;color:inherit!important;text-decoration:underline;font-weight:800;padding:.15rem!important;box-shadow:none!important}.public-feedback-info{text-align:left}.public-feedback-skip{text-align:right}.public-feedback-info-text{margin:.75rem 0 0;padding:.65rem;border-radius:12px;background:rgba(255,255,255,.16);text-align:left;font-size:.9rem;line-height:1.35}.public-feedback-info-text.hidden{display:none}.public-feedback-countdown{position:relative;display:block;width:calc(100% + 2rem);margin:.8rem -1rem -1rem;padding:.55rem .7rem!important;border:0!important;border-radius:0 0 15px 15px!important;background:rgba(255,255,255,.2)!important;color:inherit!important;text-align:center;font-size:.78rem;font-weight:800;box-shadow:none!important;overflow:hidden}.public-feedback-countdown span{position:relative;z-index:2}.public-feedback-countdown b{position:absolute;left:0;bottom:0;height:4px;background:var(--feedback-border);width:100%;transition:width .15s linear;opacity:.95}.public-feedback-countdown.stopped{background:rgba(255,255,255,.28)!important}.feedback-image-option{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:.25rem;border-radius:16px!important;min-width:82px;padding:.42rem .5rem!important}.feedback-image-option img{width:54px;height:54px;object-fit:contain;display:block;border-radius:14px;background:#fff}.feedback-image-option span{display:block;font-size:.82rem;line-height:1.05}.public-feedback-follow-preview{text-align:center}.public-feedback-word-options{justify-content:center}.feedback-admin-card.draft{border-style:dashed}.feedback-status-pill.draft{background:#fff8d8;color:#7a5600}
@media(max-width:820px){.feedback-colour-row{flex-wrap:wrap;justify-content:flex-start}.feedback-colour-row label{align-items:flex-start;text-align:left}.feedback-image-option{min-width:72px}.feedback-image-option img{width:46px;height:46px}}

/* V109 continuous feedback response controls */
.feedback-guide-box{margin-bottom:1rem;}
.feedback-guide-box summary{padding:.25rem 0;}
.feedback-sub-buttons{margin-top:1rem;}
.feedback-response-settings{display:block!important;}
.feedback-response-config{margin:.25rem 0 .6rem;}
.feedback-inline-toggles{display:flex;flex-wrap:wrap;gap:.9rem;align-items:center;justify-content:flex-start;}
.feedback-inline-toggles label{display:flex!important;align-items:center;gap:.4rem;border:0!important;background:transparent!important;padding:0!important;box-shadow:none!important;}
.feedback-numeric-settings{display:flex;flex-wrap:wrap;gap:.75rem;align-items:end;}
.feedback-numeric-settings label{min-width:130px;}
.feedback-numeric-settings .tiny-label{flex-basis:100%;margin:.1rem 0 0;}
.feedback-target-all-card{justify-content:flex-start!important;text-align:left;width:max-content;max-width:100%;margin-bottom:.6rem;}
.feedback-target-all-card input{width:20px;height:20px;}
.feedback-colour-row{justify-content:flex-start;}
.feedback-colour-row input[type="color"]{width:42px!important;height:42px!important;border-radius:6px!important;}
.feedback-colour-row label span{white-space:nowrap;}
.public-feedback-numeric{display:grid;gap:.55rem;justify-items:center;max-width:260px;margin:0 auto;}
.public-feedback-numeric input[type="range"]{width:100%;accent-color:var(--feedback-border);}
.public-feedback-slider-value{font-size:1.35rem;font-weight:900;color:var(--feedback-colour);}
.public-feedback-stars{display:grid;gap:.45rem;justify-items:center;margin:.25rem auto;}
.public-feedback-stars .public-feedback-star{font-size:2rem;line-height:1;border:0!important;background:transparent!important;color:var(--feedback-border)!important;box-shadow:none!important;padding:.08rem!important;min-width:34px;}
.public-feedback-stars .public-feedback-star.filled{color:#f5c542!important;text-shadow:0 1px 3px rgba(0,0,0,.2);}
.public-feedback-star-label{font-weight:800;opacity:.95;}
.public-feedback-number-grid{display:grid;grid-template-columns:repeat(5, minmax(42px, 1fr));gap:.45rem;margin:.25rem auto .65rem;max-width:270px;}
.public-feedback-number-option{min-height:42px;display:flex!important;align-items:center;justify-content:center;border-radius:12px!important;font-size:1.1rem;font-weight:900;}
.public-feedback-number-option.selected,
.public-feedback-options button.selected{outline:3px solid var(--feedback-border);background:#fff8d8!important;color:#123b5d!important;}
.public-feedback-thanks{font-size:1.9rem;font-weight:900;text-align:center;padding:1.5rem 2.5rem;color:var(--feedback-colour, #fff);}
.public-feedback-followup-live{margin-top:.75rem;padding:.7rem;border-radius:14px;background:rgba(255,255,255,.14);text-align:center;}
.public-feedback-followup-live h4{margin:.1rem 0 .55rem;color:var(--feedback-colour);}
.public-feedback-actions{justify-content:center;margin:.55rem 0 0;}
.public-feedback-actions button{min-width:110px;}
@media(max-width:820px){.feedback-inline-toggles,.feedback-numeric-settings{display:grid;grid-template-columns:1fr}.public-feedback-number-grid{grid-template-columns:repeat(5, minmax(34px, 1fr));}.public-feedback-number-option{min-height:38px}.public-feedback-stars .public-feedback-star{font-size:1.75rem}}

/* v110 continuous feedback prompt polish */
.continuous-feedback-prompt{
  right:auto!important;
  bottom:auto!important;
  top:1rem!important;
  left:50%!important;
  transform:translateX(-50%)!important;
  max-width:min(520px,calc(100vw - 1.5rem))!important;
  width:auto;
}
.public-feedback-card{padding:1rem 1.05rem!important;}
.public-feedback-options{flex-wrap:nowrap!important;gap:.42rem!important;overflow:visible;align-items:stretch;}
.public-feedback-options button,
.public-feedback-actions button,
.public-feedback-bottom-row .public-feedback-skip,
.public-feedback-bottom-row .public-feedback-info,
.public-feedback-numeric button,
.public-feedback-stars button:not(.public-feedback-star),
.public-feedback-word-options label{
  border:0!important;
  border-radius:999px!important;
  background:#fff!important;
  color:#123b5d!important;
  padding:.55rem .78rem!important;
  font-weight:900!important;
  text-decoration:none!important;
  box-shadow:0 2px 6px rgba(0,0,0,.14)!important;
  cursor:pointer!important;
}
.public-feedback-bottom-row .public-feedback-info,
.public-feedback-bottom-row .public-feedback-skip{min-width:92px;text-align:center;}
.feedback-image-option{min-width:0!important;flex:1 1 0!important;padding:.32rem .34rem!important;border-radius:15px!important;}
.feedback-options-five .feedback-image-option{max-width:86px;}
.feedback-image-option img{width:46px!important;height:46px!important;}
.feedback-options-five .feedback-image-option img{width:38px!important;height:38px!important;}
.feedback-image-option span:empty{display:none!important;}
.feedback-image-option span{font-size:.72rem!important;line-height:1!important;}
.public-feedback-star-row{display:flex;flex-direction:row;gap:.18rem;align-items:center;justify-content:center;}
.public-feedback-stars{display:grid;justify-items:center;gap:.4rem;}
.public-feedback-stars .public-feedback-star{font-size:2rem!important;min-width:34px!important;}
.public-feedback-number-grid{display:grid!important;grid-template-columns:repeat(10, minmax(30px,1fr))!important;max-width:430px!important;gap:.3rem!important;}
.public-feedback-number-option{min-width:30px!important;min-height:38px!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:.2rem!important;}
.public-feedback-word-options{justify-content:center;}
.public-feedback-thanks{min-width:220px;}
.feedback-response-config .muted{margin:.2rem 0;}
@media(max-width:560px){
  .continuous-feedback-prompt{top:.55rem!important;max-width:calc(100vw - .7rem)!important;}
  .public-feedback-options{gap:.25rem!important;}
  .feedback-image-option img{width:38px!important;height:38px!important;}
  .feedback-options-five .feedback-image-option img{width:32px!important;height:32px!important;}
  .feedback-image-option span{font-size:.62rem!important;}
  .public-feedback-number-grid{grid-template-columns:repeat(10, minmax(24px,1fr))!important;gap:.18rem!important;}
  .public-feedback-number-option{min-width:24px!important;min-height:34px!important;font-size:.9rem!important;}
}


/* v113 continuous feedback compact mobile polish */
.feedback-save-notice{margin:.75rem 0 1rem;padding:.85rem 1rem;border-radius:14px;background:#e8f8ec;color:#176533;font-weight:800;border:1px solid rgba(23,101,51,.25);box-shadow:0 6px 18px rgba(23,101,51,.12)}
.feedback-save-notice.hidden{display:none!important}
.feedback-chart-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:.85rem;align-items:stretch;margin:.9rem 0}
.feedback-chart-card{border:1px solid rgba(20,79,140,.15);border-radius:14px;padding:.75rem;background:#fbfdff;margin:0!important}
.feedback-chart-card header{display:flex;align-items:center;justify-content:space-between;gap:.6rem;margin-bottom:.55rem}
.feedback-chart-card h4{margin:0;color:#144f8c}.feedback-chart-card select{max-width:110px}
.feedback-columns{height:190px;display:flex;align-items:end;gap:.45rem;border-left:1px solid rgba(20,79,140,.18);border-bottom:1px solid rgba(20,79,140,.18);padding:.4rem .35rem .1rem;overflow-x:auto}
.feedback-column{min-width:44px;flex:1 1 44px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:.25rem;height:100%;text-align:center}
.feedback-column strong{font-size:.82rem;color:#144f8c}.feedback-column div{height:125px;width:100%;display:flex;align-items:end;justify-content:center;background:#edf4ff;border-radius:8px 8px 0 0;overflow:hidden}.feedback-column b{display:block;width:100%;background:#144f8c;border-radius:8px 8px 0 0}.feedback-column span{font-size:.72rem;line-height:1.05;max-width:76px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.continuous-feedback-prompt{top:2.15rem!important;width:min(930px,calc(100vw - 1rem))!important;max-width:min(930px,calc(100vw - 1rem))!important;z-index:10050!important;}
.public-feedback-card{overflow:visible!important;padding:.85rem .9rem .65rem!important;border-width:3px!important;border-radius:18px!important;text-align:center;animation:feedbackArrivalGlow 1.05s ease-out 1;}
@keyframes feedbackArrivalGlow{0%{box-shadow:0 0 0 0 rgba(245,197,66,.0),0 18px 44px rgba(0,0,0,.24)}18%{box-shadow:0 0 32px 10px color-mix(in srgb, var(--feedback-border) 55%, white 45%),0 18px 44px rgba(0,0,0,.24)}100%{box-shadow:0 18px 44px rgba(0,0,0,.24)}}
.public-feedback-context,.public-feedback-card h3,.public-feedback-options button,.public-feedback-word-options label{font-size:.96rem!important;font-weight:500!important;line-height:1.15!important;}
.public-feedback-context{opacity:.65!important;margin:.05rem 2rem .25rem!important}.public-feedback-card h3{margin:.1rem 2rem .65rem!important;}
.public-feedback-info{position:absolute!important;top:.35rem!important;left:.45rem!important;width:30px!important;height:30px!important;min-width:30px!important;display:flex!important;align-items:center!important;justify-content:center!important;border-radius:999px!important;background:rgba(255,255,255,.16)!important;color:inherit!important;padding:0!important;font-weight:800!important;box-shadow:none!important;text-decoration:none!important;z-index:2;}
.public-feedback-close{right:-.55rem!important;top:-.65rem!important;width:38px!important;height:38px!important;font-size:1.55rem!important;background:#fff!important;color:#123b5d!important;box-shadow:0 3px 12px rgba(0,0,0,.22)!important;z-index:3;}
.public-feedback-options{justify-content:center!important;align-items:center!important;gap:.35rem!important;}
.public-feedback-options button{padding:.45rem .62rem!important;min-height:38px!important;}
.feedback-options-frequency,.feedback-options-safety{flex-wrap:wrap!important;}
.feedback-options-frequency button,.feedback-options-safety button{white-space:normal!important;min-width:90px;max-width:150px;}
.feedback-options-five{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:.28rem!important;max-width:100%;}
.feedback-options-five .feedback-image-option{max-width:none!important;min-width:0!important;padding:.25rem .2rem!important;}
.feedback-options-five .feedback-image-option img{width:34px!important;height:34px!important;}
.feedback-image-option img{width:42px!important;height:42px!important;background:transparent!important;}
.feedback-image-option span{font-size:.68rem!important;font-weight:500!important;line-height:1!important;}
.feedback-image-option span:empty{display:none!important}.feedback-image-option:not(:has(span)){padding:.25rem!important;}
.public-feedback-word-options{display:flex;flex-wrap:wrap;gap:.35rem!important;align-items:center;justify-content:center!important;}
.public-feedback-word-options label{white-space:normal!important;padding:.42rem .58rem!important;max-width:150px;text-align:center;}
.public-feedback-bottom-row{margin:.55rem 0 0!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:.45rem!important;min-height:32px;}
.public-feedback-bottom-row.has-back{justify-content:space-between!important;}
.public-feedback-nav-button,.public-feedback-bottom-row .public-feedback-skip,.public-feedback-bottom-row .public-feedback-info,.public-feedback-actions button,.public-feedback-numeric button,.public-feedback-stars button:not(.public-feedback-star){background:rgba(255,255,255,.72)!important;color:#123b5d!important;border:0!important;border-radius:999px!important;padding:.38rem .66rem!important;min-width:74px!important;min-height:30px!important;font-size:.86rem!important;font-weight:650!important;text-decoration:none!important;box-shadow:0 1px 5px rgba(0,0,0,.12)!important;}
.public-feedback-submit{margin-left:auto!important}.public-feedback-back{margin-right:auto!important}.public-feedback-skip{opacity:.86!important;}
.public-feedback-number-grid{grid-template-columns:repeat(10,minmax(22px,1fr))!important;gap:.2rem!important;max-width:100%!important;margin:.18rem auto .35rem!important;}
.public-feedback-number-option{min-width:22px!important;min-height:30px!important;font-size:.76rem!important;padding:.05rem!important;border-radius:9px!important;display:flex!important;align-items:center!important;justify-content:center!important;}
.public-feedback-stars{gap:.25rem!important}.public-feedback-star-row{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;gap:.1rem!important}.public-feedback-stars .public-feedback-star{font-size:1.75rem!important;min-width:28px!important;padding:0!important}.public-feedback-star-label{font-size:.86rem!important;font-weight:600!important;}
.public-feedback-numeric{gap:.35rem!important;max-width:440px!important}.public-feedback-slider-value{font-size:1.05rem!important;font-weight:650!important;}
.public-feedback-info-text{font-size:.86rem!important;margin:.55rem 0!important;padding:.55rem!important;}
.public-feedback-countdown{font-size:.72rem!important;margin:.55rem -.9rem -.65rem!important;width:calc(100% + 1.8rem)!important;padding:.38rem .5rem!important;}
.public-feedback-thanks{font-size:1.35rem!important;font-weight:750!important;padding:1rem 2.3rem!important;}
.public-feedback-starburst{position:absolute;inset:0;pointer-events:none;z-index:10060;overflow:visible}.public-feedback-starburst span{position:absolute;left:50%;top:50%;color:var(--feedback-border,#f5c542);font-size:1.2rem;animation:feedbackStarPop .85s ease-out forwards;transform:translate(-50%,-50%);text-shadow:0 1px 3px rgba(0,0,0,.25)}.public-feedback-starburst span:nth-child(1){--x:-115px;--y:-50px}.public-feedback-starburst span:nth-child(2){--x:-75px;--y:55px}.public-feedback-starburst span:nth-child(3){--x:-25px;--y:-70px}.public-feedback-starburst span:nth-child(4){--x:30px;--y:65px}.public-feedback-starburst span:nth-child(5){--x:85px;--y:-55px}.public-feedback-starburst span:nth-child(6){--x:120px;--y:35px}.public-feedback-starburst span:nth-child(7){--x:0px;--y:-95px}.public-feedback-starburst span:nth-child(8){--x:0px;--y:90px}@keyframes feedbackStarPop{0%{opacity:1;transform:translate(-50%,-50%) scale(.4)}80%{opacity:.85;transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(1.15)}100%{opacity:0;transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(.8)}}
@media(max-width:560px){.continuous-feedback-prompt{top:1.4rem!important;width:calc(100vw - .5rem)!important;max-width:calc(100vw - .5rem)!important}.public-feedback-card{padding:.75rem .65rem .55rem!important}.public-feedback-card h3{margin:.05rem 1.8rem .45rem!important;font-size:.9rem!important}.public-feedback-context{font-size:.8rem!important}.feedback-options-five .feedback-image-option img{width:28px!important;height:28px!important}.feedback-image-option img{width:34px!important;height:34px!important}.feedback-image-option span{font-size:.58rem!important}.public-feedback-options button{font-size:.82rem!important;padding:.35rem .46rem!important}.public-feedback-number-grid{gap:.12rem!important}.public-feedback-number-option{font-size:.65rem!important;min-height:28px!important;min-width:18px!important}.public-feedback-nav-button{font-size:.78rem!important;min-width:62px!important;padding:.32rem .52rem!important}.feedback-chart-grid{grid-template-columns:1fr}.feedback-columns{height:160px}.feedback-column div{height:100px}}

/* v116 class events, permissions and bulk manager polish */
#tab-class-calendars .section-heading {
  margin-bottom: .35rem;
}
#tab-class-calendars .public-visibility-help {
  margin-top: .25rem;
  margin-bottom: .5rem;
}
.cell-column-watermark {
  position: absolute;
  left: .35rem;
  right: .35rem;
  bottom: .25rem;
  color: rgba(18, 59, 93, .24);
  font-weight: 900;
  font-size: .74rem;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  z-index: 0;
}
.watermark-host {
  position: relative;
  min-height: 2.8rem;
}
.watermark-host > :not(.cell-column-watermark) {
  position: relative;
  z-index: 1;
}
.admin-event-cell-readonly {
  background: #f8fbff !important;
}
.user-school-ks-permissions {
  border-top: 1px solid var(--line, #d6e1ec);
  margin-top: .8rem;
  padding-top: .8rem;
}
.bulk-manager-layout {
  align-items: stretch;
}
.bulk-week-table-wrap {
  max-height: 78vh;
}
.bulk-week-table th,
.bulk-week-table td {
  padding: .45rem .55rem;
}
.bulk-week-table tbody th {
  width: 116px;
}
.bulk-week-table tbody th strong {
  font-size: .88rem;
}
.bulk-week-table tbody th span,
.bulk-week-table tbody th em {
  font-size: .76rem;
  line-height: 1.05;
}
.bulk-resource-list,
.bulk-add-row {
  gap: .35rem;
}
.bulk-add-row {
  margin-top: .35rem;
}
.bulk-resource-chip,
.bulk-add-chip {
  padding: .36rem .48rem;
  border-radius: .62rem;
  font-size: .82rem;
}
.bulk-resource-chip small {
  font-size: .72rem;
  line-height: 1.12;
}
.bulk-editor-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bulk-editor-sticky {
  gap: .45rem;
  min-height: 0;
}
.bulk-editor-sticky h3 {
  margin: 0;
  line-height: 1.1;
}
.bulk-editor-sticky .muted {
  margin: 0;
}
.bulk-editor-body {
  gap: .5rem;
  min-height: 0;
}
.bulk-editor-panel .phonics-picker-tools {
  gap: .45rem;
  margin-bottom: .1rem;
}
.bulk-editor-panel .phonics-choice-grid {
  max-height: min(46vh, 430px);
  overflow: auto;
  padding-right: .2rem;
}
.bulk-editor-panel .spelling-grid-list {
  max-height: min(48vh, 455px);
  overflow: auto;
  padding-right: .2rem;
}
.bulk-editor-panel .phonics-extra-actions,
.bulk-editor-panel .phonics-extra-fields {
  flex-shrink: 0;
}
.bulk-editor-actions {
  flex-shrink: 0;
  padding-top: .5rem;
}
.teacher-message-heading,
.teacher-resources-title {
  font-size: .82rem;
  line-height: 1.05;
}

/* v119 resource/admin refinements */
.admin-branding-card{margin-bottom:1rem}.admin-branding-form{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));align-items:end}.admin-branding-preview-inner{display:flex;align-items:center;gap:.75rem;border:1px solid rgba(20,79,140,.16);border-radius:14px;background:#f8fbff;padding:.65rem}.admin-branding-preview-inner img{width:58px;height:58px;object-fit:contain}.admin-branding-preview-inner span{display:block;color:#52606d;font-size:.85rem}.phonics-output-section{margin-top:1rem}.phonics-output-settings-form textarea{resize:vertical}.phonics-output-colour-row{display:flex;align-items:flex-end;gap:.65rem;flex-wrap:wrap}.phonics-output-colour-row label{display:flex!important;flex-direction:column;align-items:center;gap:.25rem;min-width:94px;font-size:.82rem;text-align:center}.phonics-output-colour-row input[type="color"]{appearance:none;-webkit-appearance:none;width:42px!important;height:42px!important;border:2px solid rgba(20,79,140,.25);border-radius:6px!important;padding:0;background:#fff;cursor:pointer}.phonics-output-colour-row input[type="color"]::-webkit-color-swatch-wrapper{padding:0}.phonics-output-colour-row input[type="color"]::-webkit-color-swatch{border:0;border-radius:4px}.feedback-font-row{display:flex;gap:.75rem;flex-wrap:wrap;margin-top:.75rem}.feedback-font-row label{min-width:150px}.public-feedback-card h3{font-size:var(--feedback-question-font,.96rem)!important}.public-feedback-options button,.public-feedback-word-options label,.public-feedback-actions button,.public-feedback-nav-button{font-size:var(--feedback-answer-font,.96rem)!important}.key-stage-resource-row .ks-resource-row-cell{background:#f5f9ff!important;border:2px solid rgba(20,79,140,.22)!important}.key-stage-resource-row .teacher-resources-title{font-size:.9rem;font-weight:900;color:#144f8c;margin-bottom:.35rem}.key-stage-resource-row .ks-resource-button-grid{justify-content:flex-start;gap:.4rem}.teacher-message-row .date-col{background:#fbfdff;color:#52606d}.teacher-message-cell-inner{display:grid;gap:.35rem}.teacher-message-heading{font-weight:900;color:#144f8c}.teacher-message-click{border-top:1px dashed rgba(20,79,140,.16);padding-top:.35rem;min-height:34px;cursor:pointer}.class-resource-button-grid{gap:.35rem}.inline-editor .teacher-message-heading{margin-bottom:.35rem}.pdf-page{break-inside:avoid}

/* v120 setup resources, class event and usage polish */
.setup-resource-stack {
  display: grid;
  gap: 1rem;
}
.setup-resource-group {
  display: grid;
  gap: .65rem;
  padding: 1rem !important;
}
.setup-resource-group-title {
  margin: 0 0 .15rem;
  color: var(--blue-2);
  font-size: 1.35rem;
}
.setup-resource-accordion {
  border: 1px solid rgba(20,79,140,.18);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.setup-resource-accordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .78rem .95rem;
  font-weight: 900;
  color: var(--blue-2);
  background: linear-gradient(90deg, #f6fbff, #fff);
}
.setup-resource-accordion summary::-webkit-details-marker { display: none; }
.setup-resource-accordion[open] summary { border-bottom: 1px solid rgba(20,79,140,.14); }
.setup-resource-accordion[open] .expand-hint { transform: rotate(180deg); }
.setup-resource-accordion .expand-hint {
  color: #52606d;
  font-size: .82rem;
  font-weight: 700;
  transition: transform .18s ease;
  white-space: nowrap;
}
.setup-resource-content {
  padding: .9rem .95rem 1rem;
  margin: 0 !important;
  box-shadow: none !important;
  border: 0 !important;
  background: #fff !important;
}
.square-colour-swatches input[type="color"],
.phonics-output-colour-row input[type="color"] {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border-radius: 6px !important;
}

.key-stage-resource-row .ks-resource-row-cell {
  background: #f5f9ff !important;
  border: 2px solid rgba(20,79,140,.22) !important;
  padding: .45rem .55rem !important;
}
.key-stage-resource-row .teacher-resources-title {
  font-size: .9rem;
  font-weight: 900;
  color: #144f8c;
  margin-bottom: .3rem;
}
.key-stage-resource-row .ks-resource-button-grid,
.function-inline-row.ks-resource-button-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .35rem !important;
  align-items: center !important;
  justify-content: flex-start !important;
}
.key-stage-resource-row .function-inline-chip,
.ks-resource-button-grid .function-inline-chip {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: .25rem;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}
.key-stage-resource-row .function-mini-button,
.ks-resource-button-grid .function-mini-button {
  width: auto !important;
  min-width: max-content;
  padding: .34rem .55rem !important;
  white-space: nowrap !important;
}
.teacher-message-row .date-col { background: #fbfdff; color: #52606d; }
.teacher-message-cell-inner { display: grid; gap: .35rem; }
.teacher-message-heading { font-weight: 900; color: #144f8c; }
.teacher-message-click { border-top: 1px dashed rgba(20,79,140,.16); padding-top: .35rem; min-height: 34px; cursor: pointer; }
.class-function-modal { position: relative; }
.class-function-close-x {
  position: absolute;
  top: -.72rem;
  right: -.72rem;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #144f8c;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  z-index: 12;
  box-shadow: 0 8px 18px rgba(18,59,93,.25);
}
.class-function-close-confirm {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 13;
  width: min(320px, calc(100% - 2.2rem));
  background: #fff;
  border: 2px solid rgba(20,79,140,.28);
  border-radius: 14px;
  padding: .85rem;
  box-shadow: 0 14px 32px rgba(18,59,93,.22);
}
.class-function-close-confirm strong { color: var(--blue-2); }
.class-function-close-confirm .form-actions { margin-top: .65rem; justify-content: flex-end; }

.phonics-maze-playfield {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  gap: clamp(.45rem, 1.5vh, .9rem) !important;
  align-items: center !important;
  padding: clamp(3.8rem, 7vh, 5.8rem) clamp(.45rem, 2vw, 1.2rem) clamp(.45rem, 1vh, .8rem) !important;
  min-height: 100% !important;
}
.phonics-maze-card-row {
  position: static !important;
  transform: translateY(10px) !important;
  width: min(94vw, 860px) !important;
  max-height: calc(100vh - 250px) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(.45rem, 2vw, 1rem) !important;
  align-self: center !important;
}
.phonics-maze-card-row.entered { transform: none !important; }
.phonics-maze-card-row.leaving-left { transform: translateX(-90px) !important; }
.phonics-maze-card-row.leaving-right { transform: translateX(90px) !important; }
.phonics-maze-choice-card {
  min-height: 0 !important;
  height: min(34vh, 300px) !important;
  max-height: 300px !important;
}
.phonics-maze-card-shell {
  width: min(100%, 360px) !important;
  min-height: 0 !important;
  height: min(31vh, 260px) !important;
  max-height: 260px !important;
  padding: clamp(.35rem, 1.5vw, .65rem) !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  align-items: center !important;
  justify-items: center !important;
}
.phonics-maze-choice-card img {
  width: min(100%, 250px) !important;
  height: auto !important;
  max-height: min(20vh, 165px) !important;
  object-fit: contain !important;
}
.phonics-maze-choice-card strong,
.phonics-maze-choice-placeholder {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  text-align: center !important;
  font-size: clamp(2.5rem, 10vw, 7rem) !important;
  line-height: .86 !important;
}
.phonics-maze-question-panel {
  position: static !important;
  transform: none !important;
  width: min(92vw, 560px) !important;
  margin: 0 auto !important;
  padding: clamp(.45rem, 1.5vh, .85rem) clamp(.65rem, 2vw, 1rem) !important;
  align-self: end !important;
}
.phonics-maze-question-panel h2 { font-size: clamp(1.05rem, 3.5vw, 1.65rem) !important; }
@media (max-width: 560px), (max-height: 620px) {
  .phonics-maze-card-row { max-height: calc(100vh - 210px) !important; }
  .phonics-maze-choice-card { height: min(30vh, 220px) !important; }
  .phonics-maze-card-shell { height: min(28vh, 205px) !important; }
  .phonics-maze-choice-card img { max-height: min(16vh, 112px) !important; }
  .phonics-maze-choice-card strong,
  .phonics-maze-choice-placeholder { font-size: clamp(1.9rem, 11vw, 4.8rem) !important; }
  .phonics-maze-question-panel { padding: .42rem .6rem !important; gap: .35rem !important; }
  .phonics-maze-replay { padding: .5rem .75rem !important; }
}

.usage-chart-pair {
  grid-template-columns: minmax(0, 1fr) minmax(220px, .95fr) !important;
  gap: clamp(.65rem, 1.4vw, 1rem) !important;
  align-items: stretch !important;
}
.usage-chart-section { min-width: 0; overflow: hidden; }
.usage-line-svg,
.usage-stacked-svg {
  width: 100% !important;
  height: auto !important;
  max-height: 260px;
}
.usage-hour-bars,
.usage-stacked-hour-bars {
  max-height: min(430px, 60vh);
  overflow-y: auto;
  padding-right: .15rem;
}
.usage-hour-bar-row {
  grid-template-columns: 3.2rem minmax(80px, 1fr) 2.2rem !important;
  gap: .35rem !important;
  min-height: 1.2rem !important;
  margin-bottom: .14rem !important;
  font-size: .82rem !important;
}
.usage-hour-bar-track { height: .64rem !important; }
.usage-hour-bar-track i { min-height: .64rem !important; }
.usage-game-column-chart,
.usage-game-clustered {
  width: 100% !important;
  min-height: 190px !important;
  max-height: 330px;
  overflow: auto;
  gap: clamp(.35rem, 1vw, .75rem) !important;
}
.usage-game-column {
  width: clamp(52px, 7vw, 95px) !important;
  min-width: clamp(52px, 7vw, 95px) !important;
  height: clamp(150px, 24vw, 220px) !important;
}
.usage-game-column i { width: clamp(1.6rem, 4vw, 3rem) !important; }
.usage-point { fill: var(--blue); stroke: #fff; stroke-width: 2px; }
@media (max-width: 900px) {
  .usage-chart-pair { grid-template-columns: 1fr !important; }
  .usage-hour-bars,
  .usage-stacked-hour-bars { max-height: 300px; }
  .usage-hour-bar-row { min-height: 1.05rem !important; font-size: .76rem !important; }
  .usage-hour-bar-track { height: .52rem !important; }
  .usage-hour-bar-track i { min-height: .52rem !important; }
}

/* v125 admin navigation and calendar polish */
.admin-functions-menu { position: relative; display: inline-flex; }
.admin-functions-menu.hidden { display: none !important; }
.admin-functions-toggle { white-space: nowrap; }
.admin-functions-dropdown { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 80; display: grid; gap: .35rem; min-width: 220px; padding: .55rem; border: 1px solid rgba(20,79,140,.18); border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(18,59,93,.22); }
.admin-functions-dropdown.hidden { display: none !important; }
.admin-functions-dropdown button { width: 100%; text-align: left; justify-content: flex-start; }
.today-label-red { margin-top: .25rem; display: inline-block; color: #d92d20; font-weight: 950; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; }
.key-stage-resource-row .ks-resource-row-cell { border: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; border-right: 1px solid var(--line) !important; outline: 0 !important; box-shadow: none !important; background: #f8fafc !important; }
@media (max-width: 820px) { .admin-functions-menu { width: 100%; } .admin-functions-dropdown { left: 0; right: auto; width: min(92vw, 320px); } }

/* v126 admin/public comms refinements */
.admin-functions-menu { position: relative; display: inline-flex; }
.admin-functions-menu summary { list-style: none; cursor: pointer; }
.admin-functions-menu summary::-webkit-details-marker { display: none; }
.admin-functions-menu:not([open]) .admin-functions-dropdown { display: none !important; }
.admin-functions-menu[open] .admin-functions-dropdown { display: grid !important; }
.key-stage-resource-row .ks-resource-row-cell,
.key-stage-resource-row .function-col,
.key-stage-resource-row td { outline: 0 !important; box-shadow: none !important; border: 1px solid var(--line) !important; }
.admin-event-attachments-box { display: grid; gap: .35rem; border-top: 1px dashed rgba(20,79,140,.18); padding-top: .45rem; margin-top: .4rem; }
.admin-event-attachments-summary { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.event-attachment-chip { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid rgba(20,79,140,.18); background: #f8fbff; border-radius: 999px; padding: .2rem .35rem .2rem .55rem; font-size: .82rem; color: #123b5d; }
.event-attachment-chip button { border: 0; background: transparent; color: #b42318; padding: 0 .2rem; font-weight: 900; cursor: pointer; }
.event-attachment-links { display: inline-flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.event-attachment-links a, .public-event-attachments a { display: inline-block; border: 1px solid rgba(20,79,140,.2); background: #f4f8fc; border-radius: 999px; padding: .12rem .45rem; text-decoration: none; font-size: .82rem; font-weight: 800; color: #144f8c; }
.admin-attachment-modal { position: fixed; inset: 0; z-index: 250; background: rgba(12,31,50,.42); display: grid; place-items: center; padding: 1rem; }
.admin-attachment-modal.hidden { display: none !important; }
.admin-attachment-card { position: relative; width: min(720px, 96vw); max-height: 92vh; overflow: auto; background: #fff; border-radius: 1.2rem; border: 1px solid rgba(20,79,140,.2); box-shadow: 0 20px 60px rgba(0,0,0,.28); padding: 1rem; }
.admin-attachment-close { position: absolute; top: .65rem; right: .65rem; border-radius: 999px; width: 2.1rem; height: 2.1rem; padding: 0; }
.admin-attachment-drop-zone { border: 2px dashed rgba(20,79,140,.32); border-radius: 1rem; background: #f8fbff; padding: 1rem; text-align: center; color: #52606d; font-weight: 800; }
.admin-attachment-drop-zone.drag-over { background: #fff8dc; border-color: var(--yellow-2); color: #123b5d; }
.admin-attachment-existing { display: grid; gap: .4rem; }
.public-day-badge { display: inline-block; margin-bottom: .25rem; font-size: .78rem; font-weight: 950; letter-spacing: .06em; color: #d92d20; text-transform: uppercase; }
.public-today-row .day-public-col { box-shadow: inset 4px 0 0 #d92d20; }
.public-event-attachments { display: inline-flex; flex-wrap: wrap; gap: .35rem; margin-left: .25rem; }
@media (max-width: 820px) { .admin-functions-menu { width: 100%; } .admin-functions-dropdown { left: 0; right: auto; width: min(92vw, 320px); } }

/* v127 fixes: visible admin dropdown and teacher-message presentation */
.admin-body #tabNav.tab-nav {
  overflow: visible !important;
  flex-wrap: wrap;
  position: relative;
  z-index: 5000;
}
.admin-functions-menu {
  position: relative !important;
  display: inline-flex;
  align-items: stretch;
  overflow: visible !important;
}
.admin-functions-menu.hidden { display: none !important; }
.admin-functions-toggle {
  white-space: nowrap;
  background: var(--blue-soft) !important;
  color: var(--blue-2) !important;
  border: 1px solid #c6d9ef !important;
}
.admin-functions-toggle[aria-expanded="true"] {
  background: var(--yellow) !important;
  color: var(--ink) !important;
  border-color: var(--yellow-2) !important;
}
.admin-functions-dropdown {
  z-index: 99999 !important;
  display: grid;
  gap: .35rem;
  min-width: 230px;
  padding: .55rem;
  border: 1px solid rgba(20,79,140,.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18,59,93,.28);
}
.admin-functions-dropdown.hidden { display: none !important; }
.admin-functions-dropdown button { width: 100%; text-align: left; justify-content: flex-start; }
.teacher-message-label {
  display: block;
  text-align: center;
  white-space: normal;
  line-height: 1.08;
  font-weight: 950;
  color: var(--blue-2);
}
.teacher-message-row .date-col {
  text-align: center;
  vertical-align: middle;
}
.teacher-message-click {
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.teacher-message-quoted {
  display: block;
  font-style: italic;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}
@media (max-width: 820px) {
  .admin-body #tabNav.tab-nav { overflow: visible !important; }
  .admin-functions-menu { width: auto; }
  .admin-functions-dropdown { width: min(92vw, 320px); }
}
.admin-functions-menu .admin-functions-dropdown:not(.hidden) { display: grid !important; }

/* v128: admin dropdown portal, inline-editor feedback, week labels and thin-mode wrapping */
.admin-functions-dropdown-portal {
  position: fixed !important;
  z-index: 2147483000 !important;
  display: grid;
  gap: .35rem;
  min-width: 230px;
  max-width: min(92vw, 340px);
  padding: .55rem;
  border: 1px solid rgba(20,79,140,.18);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18,59,93,.32);
}
.admin-functions-dropdown-portal.hidden { display: none !important; }
.admin-functions-dropdown-portal button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
}
.inline-editor-hint {
  font-size: .78rem;
  margin: -.15rem 0 0;
}
.inline-editor-flicker {
  animation: inlineEditorFlickerV128 .55s ease-in-out;
  outline: 3px solid #d92d20 !important;
  outline-offset: -3px;
}
@keyframes inlineEditorFlickerV128 {
  0%, 100% { filter: none; }
  25% { filter: brightness(1.08); }
  50% { filter: brightness(.92); }
  75% { filter: brightness(1.08); }
}
.this-week-label {
  margin-top: .25rem;
  display: inline-block;
  color: var(--blue-2);
  font-weight: 950;
  font-size: .78rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.week-message-title .admin-date-cell { align-items: center; }
@media (max-width: 820px) {
  .mobile-column-picker.active {
    white-space: normal;
    align-items: stretch;
  }
  .mobile-column-picker button {
    white-space: normal !important;
    line-height: 1.1;
    max-width: 9.5rem;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .mobile-tab-menu button,
  .tab-nav button,
  .admin-functions-dropdown-portal button {
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.12;
  }
  .event-card,
  .event-line,
  .public-event-line,
  .admin-event-title,
  .teacher-message-heading,
  .teacher-message-quoted {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* v129 Weekly Letter */
.weekly-letter-panel .sub-tab-row,
.weekly-letter-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0 0 1rem;
}
.weekly-letter-subtabs button.active {
  background: var(--blue, #1765a8);
  color: #fff;
}
.weekly-letter-subpanel.hidden { display: none !important; }
.weekly-letter-controls {
  align-items: end;
  margin-bottom: 1rem;
}
.weekly-letter-generate-actions { align-self: end; }
.weekly-letter-output {
  display: grid;
  gap: 1rem;
}
.weekly-letter-subject-label input {
  font-weight: 700;
}
.weekly-letter-editor-heading,
.compact-heading {
  margin: .2rem 0 0;
}
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .45rem;
  border: 1px solid rgba(20,79,140,.16);
  border-radius: 12px 12px 0 0;
  background: #f8fcff;
}
.rich-toolbar button {
  padding: .35rem .55rem;
  border-radius: 9px;
}
.rich-editor {
  min-height: 130px;
  padding: .85rem;
  border: 1px solid rgba(20,79,140,.22);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  line-height: 1.5;
  overflow: auto;
}
.weekly-letter-body-editor {
  min-height: 420px;
}
.weekly-letter-email-document h3 {
  color: var(--blue, #1765a8);
  margin: 1rem 0 .4rem;
}
.weekly-letter-email-document blockquote {
  border-left: 4px solid var(--yellow, #f2c94c);
  margin: .5rem 0;
  padding: .45rem .8rem;
  background: #fff9dd;
  font-style: italic;
}
.weekly-letter-email-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: .5rem;
  font-size: .95rem;
}
.weekly-letter-email-table th,
.weekly-letter-email-table td {
  border: 1px solid rgba(20,79,140,.22);
  padding: .55rem;
  vertical-align: top;
  text-align: left;
}
.weekly-letter-email-table th {
  background: #eaf5ff;
}
.weekly-letter-email-table ul {
  margin: 0;
  padding-left: 1.1rem;
}
.weekly-letter-attachments-wrap {
  border-top: 1px dashed rgba(20,79,140,.22);
  padding-top: .8rem;
}
.weekly-letter-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.weekly-letter-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: 280px;
  padding: .65rem .75rem;
  border: 1px solid rgba(20,79,140,.18);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(18,59,93,.08);
  cursor: grab;
}
.weekly-letter-attachment-chip:hover {
  border-color: var(--blue, #1765a8);
}
.weekly-letter-attachment-icon {
  font-size: 1.45rem;
}
.weekly-letter-attachment-chip span:last-child {
  display: grid;
  min-width: 0;
}
.weekly-letter-attachment-chip strong,
.weekly-letter-attachment-chip small {
  overflow-wrap: anywhere;
}
.weekly-letter-attachment-chip small {
  color: #5a6b7b;
}
@media (max-width: 760px) {
  .weekly-letter-body-editor { min-height: 300px; }
  .weekly-letter-email-table { font-size: .85rem; }
  .weekly-letter-email-table th,
  .weekly-letter-email-table td { padding: .4rem; }
}


/* v129b: mobile Admin group and comms editor click behaviour */
.mobile-admin-page-group {
  border: 1px solid rgba(20,79,140,.16);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.mobile-admin-page-group summary {
  cursor: pointer;
  list-style: none;
  padding: .72rem .85rem;
  font-weight: 900;
  color: #144f8c;
}
.mobile-admin-page-group summary::-webkit-details-marker { display: none; }
.mobile-admin-page-group summary::after { content: "▾"; float: right; }
.mobile-admin-page-group[open] summary::after { content: "▴"; }
.mobile-admin-page-group > div {
  display: grid;
  gap: .35rem;
  padding: .4rem;
  border-top: 1px solid rgba(20,79,140,.12);
  background: #f8fbff;
}
.admin-event-card-flicker {
  animation: inlineEditorFlicker .65s ease-in-out;
}

/* v131: mobile Change Page positioning and replacement-style Admin menu */
@media (max-width: 820px) {
  .mobile-tab-header {
    top: 82px !important;
    z-index: 1600 !important;
  }
  .mobile-tab-menu {
    max-height: calc(100vh - 150px);
    overflow: auto;
    align-content: start;
  }
  .mobile-tab-menu .mobile-admin-toggle {
    background: var(--blue, #1765a8) !important;
    color: #fff !important;
    border-color: var(--blue-2, #0c3f78) !important;
    font-weight: 900;
  }
}
.weekly-letter-email-document .public-class-event-block {
  border-left: 4px solid rgba(23,101,168,.2);
  padding: .2rem .45rem;
  margin: .25rem 0;
  background: rgba(23,101,168,.045);
  border-radius: .45rem;
}
.weekly-letter-email-document .public-class-event-title { font-weight: 900; color: var(--blue-2, #0c3f78); }
.weekly-letter-email-document .public-event-detail-line { margin-top: .15rem; }
.weekly-letter-email-document .event-kind-icon { margin-right: .2rem; }

/* v134 public view / weekly letter polish */
.hidden { display: none !important; }
.public-view-settings-form { position: relative; z-index: 30; pointer-events: auto; }
.public-view-settings-form input,
.public-view-settings-form select,
.public-view-settings-form textarea,
.public-view-settings-form button { pointer-events: auto; }
.public-view-settings-form input[type="color"] { min-height: 2.7rem; padding: .25rem; cursor: pointer; background: #ffffff; }
.weekly-letter-week-row { display: none !important; }
.weekly-letter-email-table { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; }
.weekly-letter-email-table th,
.weekly-letter-email-table td { border: 1px solid #bdcbe0; padding: .55rem; vertical-align: top; }
.weekly-letter-email-table th { background: #eaf4fb; color: #0c3f78; }
.weekly-letter-email-table td:first-child { width: 8.5rem; }
.public-event-detail-line .event-label { font-weight: 800; }
@media (min-width: 820px) {
  #mobileTabMenu.hidden { display: none !important; }
  #mobileTabMenu { pointer-events: auto; }
}

/* v134: make public letter/attachment downloads match the main public action buttons */
.public-index .public-event-attachments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-left: .35rem;
  vertical-align: middle;
}
.public-index .public-event-attachments a,
.public-index .public-event-attachment-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  border: 2px solid rgba(20,79,140,.24) !important;
  background: #ffffff !important;
  color: #144f8c !important;
  border-radius: 999px !important;
  padding: .45rem .8rem !important;
  min-height: 42px;
  min-width: 112px;
  font-size: .92rem !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(12,63,120,.1);
}
.public-index .public-event-attachments a:hover,
.public-index .public-event-attachment-button:hover {
  background: #eaf4fb !important;
  transform: translateY(-1px);
}
@media (max-width: 560px) {
  .public-index .public-event-attachments { display: flex; margin: .35rem 0 0; }
  .public-index .public-event-attachments a,
  .public-index .public-event-attachment-button { width: 100%; }
}
.public-view-font-field { display: grid !important; gap: .4rem; }
.public-view-font-field button { justify-self: start; min-width: 130px; }
.public-view-font-field select { min-width: min(320px, 100%); background: #fff; }


/* v135: Weekly Letter, public view and admin/menu polish */
.public-event-attachments { display: inline-flex; flex-wrap: wrap; gap: .35rem; vertical-align: middle; }
.public-event-attachment-button.public-action-button,
.public-event-attachment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .55rem .85rem;
  border-radius: 999px;
  border: 1px solid #c6d9ef;
  background: var(--blue-soft, #e8f3fc);
  color: var(--blue-2, #0c3f78);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(12,63,120,.12);
}
.public-event-attachment-button:hover { background: #d4e8fa; color: var(--blue-2, #0c3f78); }
#tab-public-view,
#publicViewSettingsForm,
.public-view-settings-form,
.public-view-settings-form input,
.public-view-settings-form textarea,
.public-view-settings-form select,
.public-view-settings-form button {
  pointer-events: auto !important;
}
#tab-public-view { position: relative; z-index: 2; }
.public-view-font-field { display: grid; gap: .35rem; align-content: start; }
.public-view-font-field select { min-width: min(100%, 320px); }
.admin-functions-dropdown-portal { pointer-events: auto !important; }
.admin-functions-dropdown-portal.hidden { pointer-events: none !important; }
.weekly-letter-generate-actions { align-items: center; gap: .5rem; }
.weekly-letter-generate-actions button.hidden { display: none !important; }
.v135-policy-user-spacing .user-policy-role-permissions .checkbox-grid,
#invitePolicyRoleFieldset .checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: .55rem 1.15rem;
}
.v135-policy-user-spacing .user-policy-role-permissions .check-card,
#invitePolicyRoleFieldset .check-card {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 150px;
}
.v135-policy-user-spacing .user-policy-role-permissions .check-card:has(input[type="checkbox"]),
#invitePolicyRoleFieldset .check-card:has(input[type="checkbox"]) {
  margin-left: .8rem;
}
@media (max-width: 760px) {
  .v135-policy-user-spacing .user-policy-role-permissions .check-card,
  #invitePolicyRoleFieldset .check-card { min-width: 0; }
}


/* v136: unified function sub-menus, zoom controls and urgent colour variables */
.admin-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: .25rem .4rem;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 800;
}
.admin-zoom-controls button {
  min-width: 32px;
  height: 32px;
  padding: 0 .45rem;
  border-radius: 999px;
}
#adminZoomValue { min-width: 3.25rem; text-align: center; font-size: .9rem; }
@media (max-width: 760px) { .admin-zoom-controls { display: none !important; } }

.function-subnav-wrap { margin: .8rem 0 1rem; }
.function-subnav,
.subtab-nav.function-subnav,
.phonics-sub-buttons.function-subnav,
.feedback-sub-buttons.function-subnav,
.weekly-letter-subtabs.function-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  align-items: center;
  overflow: visible !important;
  padding: .6rem;
  border: 1px solid rgba(20,79,140,.14);
  border-radius: 999px;
  background: #f3f8ff;
}
.function-subnav button,
.subtab-nav.function-subnav button,
.phonics-sub-buttons.function-subnav button,
.feedback-sub-buttons.function-subnav button,
.weekly-letter-subtabs.function-subnav button {
  border: 1px solid rgba(20,79,140,.22) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: var(--blue-2) !important;
  box-shadow: 0 2px 7px rgba(18,59,93,.07);
  font-weight: 800;
  white-space: normal !important;
  line-height: 1.15;
  min-height: 42px;
}
.function-subnav button.active,
.function-subnav button.selected,
.function-subnav button[aria-pressed="true"],
.subtab-nav.function-subnav button.active,
.phonics-sub-buttons.function-subnav button.selected,
.feedback-sub-buttons.function-subnav button.selected,
.weekly-letter-subtabs.function-subnav button.active {
  background: var(--yellow) !important;
  color: var(--ink) !important;
  border-color: var(--yellow-2) !important;
}
.function-subnav-mobile { display: none; margin: .75rem 0 1rem; }
.function-subnav-mobile button {
  width: 100%;
  justify-content: space-between;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--blue-2);
}
.function-subnav-mobile-menu {
  display: grid;
  gap: .35rem;
  margin-top: .4rem;
  padding: .5rem;
  border: 1px solid rgba(20,79,140,.15);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(18,59,93,.12);
}
.function-subnav-mobile-menu.hidden { display: none !important; }
.function-subnav-mobile-menu button { width: 100%; text-align: left; justify-content: flex-start; }
@media (max-width: 760px) {
  .function-subnav { display: none !important; }
  .function-subnav-mobile { display: block; }
}
.information-section.hidden { display: none !important; }
.public-view-font-field select { max-width: 100%; }
:root {
  --public-urgent-bg: #fff1f1;
  --public-urgent-text: #8a1e1e;
  --public-urgent-border: #8a1e1e;
  --public-closure-bg: #fff6cf;
  --public-closure-text: #123b5d;
  --public-closure-border: #f3c64e;
}
.urgent-info-banner {
  background: var(--public-urgent-bg, #fff1f1) !important;
  color: var(--public-urgent-text, #8a1e1e) !important;
  border-color: var(--public-urgent-border, #8a1e1e) !important;
}
.upcoming-closure-notice {
  background: var(--public-closure-bg, #fff6cf) !important;
  color: var(--public-closure-text, #123b5d) !important;
  border-color: var(--public-closure-border, #f3c64e) !important;
}

/* v137: more tab-like submenus and tighter admin headers */
.admin-body .site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 950 !important;
}
.admin-body #tabNav.tab-nav {
  position: sticky !important;
  top: var(--admin-header-sticky-height, 82px) !important;
  z-index: 850 !important;
  background: rgba(246,248,251,.97) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(20,79,140,.12);
  margin-top: .25rem;
}
.function-page-heading {
  justify-content: center !important;
  text-align: center !important;
  padding: .15rem 0 .35rem !important;
  margin-bottom: .25rem !important;
}
.function-page-heading > div { max-width: 900px; margin: 0 auto; }
.function-page-heading h2 { margin: .05rem 0 .15rem !important; }
.function-page-heading .muted { margin: 0 !important; }
.function-tabs-style,
.function-subnav,
.subtab-nav.function-subnav,
.phonics-sub-buttons.function-subnav,
.feedback-sub-buttons.function-subnav,
.weekly-letter-subtabs.function-subnav {
  border-radius: 16px 16px 0 0 !important;
  border: 1px solid rgba(20,79,140,.16) !important;
  border-bottom: 3px solid var(--blue) !important;
  background: #eef6ff !important;
  padding: .35rem .45rem 0 !important;
  margin: .35rem 0 .75rem !important;
  gap: .25rem !important;
  justify-content: center !important;
}
.function-tabs-style button,
.function-subnav button,
.subtab-nav.function-subnav button,
.phonics-sub-buttons.function-subnav button,
.feedback-sub-buttons.function-subnav button,
.weekly-letter-subtabs.function-subnav button {
  border-radius: 12px 12px 0 0 !important;
  min-height: 36px !important;
  padding: .55rem .8rem !important;
  box-shadow: none !important;
  margin-bottom: -3px !important;
  border-bottom: 3px solid transparent !important;
}
.function-tabs-style button.active,
.function-tabs-style button.selected,
.function-tabs-style button[aria-pressed="true"],
.function-subnav button.active,
.function-subnav button.selected,
.function-subnav button[aria-pressed="true"],
.subtab-nav.function-subnav button.active,
.phonics-sub-buttons.function-subnav button.selected,
.feedback-sub-buttons.function-subnav button.selected,
.weekly-letter-subtabs.function-subnav button.active {
  background: #fff !important;
  color: var(--blue-2) !important;
  border-color: var(--blue) !important;
  border-bottom-color: #fff !important;
}
.feedback-guide-box { margin: 0 0 .85rem; }
#meal-tab-menus .meal-payment-box { margin-bottom: 1rem; }
.weekly-letter-day-block { border: 1px solid var(--line); border-radius: .9rem; padding: .75rem .9rem; margin: .75rem 0; background: #fff; }
.weekly-letter-day-block h3 { margin: 0 0 .45rem; color: var(--blue-2); }
.weekly-letter-day-block h4 { margin: .65rem 0 .25rem; color: var(--blue); }
.weekly-letter-day-block ul { margin: .25rem 0 .45rem 1.3rem; padding: 0; }
.weekly-letter-meal-list div { margin: .18rem 0; }

/* v138: requested polish for tabs, admin header/branding, weekly email, class/manage pages */
.admin-body .site-header {
  background: var(--admin-header-bg, linear-gradient(135deg, var(--blue), var(--blue-2))) !important;
  color: var(--admin-header-text, #fff) !important;
  border-bottom-color: var(--admin-header-border, var(--yellow)) !important;
}
.admin-body .site-header h1,
.admin-body .site-header .eyebrow,
.admin-body .site-header .muted { color: var(--admin-header-text, #fff) !important; }
.admin-body .site-header nav { margin-left: auto; flex-shrink: 0; }
.admin-banner-year { flex: 1 1 170px; min-width: 145px; max-width: 300px; text-align: center; align-self: center; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .admin-banner-year { order: 3; flex-basis: 100%; max-width: none; } }
#tabNav.tab-nav { top: var(--admin-header-sticky-height, 82px) !important; }
.function-page-heading { justify-content: flex-start !important; text-align: left !important; padding: .1rem 0 .25rem !important; }
.function-page-heading > div { margin: 0 !important; max-width: none !important; }
.function-tabs-style,
.function-subnav,
.subtab-nav.function-subnav,
.phonics-sub-buttons.function-subnav,
.feedback-sub-buttons.function-subnav,
.weekly-letter-subtabs.function-subnav {
  justify-content: flex-start !important;
  padding-top: .25rem !important;
  margin-top: .25rem !important;
}
.weekly-letter-subject-label { margin-bottom: .35rem !important; }
.weekly-letter-include-options { display:flex; flex-wrap:wrap; gap:.55rem .9rem; padding:.45rem .6rem; border:1px solid var(--line); border-radius:.75rem; background:#fbfdff; margin:.35rem 0 .55rem; }
.weekly-letter-attachments-before-body { margin:.45rem 0 .6rem !important; }
.weekly-letter-editor-heading { margin:.2rem 0 .35rem !important; }
.weekly-letter-body-editor { min-height: 145px !important; max-height: 31vh !important; overflow:auto !important; }
.weekly-letter-output { max-height: calc(100vh - var(--admin-header-sticky-height, 82px) - 140px); overflow:auto; padding-right:.25rem; }
.weekly-letter-generate-actions #weeklyLetterGenerateThisButton.hidden-by-v138 { display:none !important; }
.weekly-letter-attachment-chip { text-align:left; }
#tab-classes .two-column.v138-class-add-stack { grid-template-columns: 1fr !important; }
.v138-collapsible-admin-form { border:1px solid var(--line); border-radius:.9rem; background:#fff; padding:.6rem .8rem; }
.v138-collapsible-admin-form > h3 { margin:0; cursor:pointer; display:flex; justify-content:space-between; align-items:center; color:var(--blue-2); }
.v138-collapsible-admin-form.v138-collapsed > label,
.v138-collapsible-admin-form.v138-collapsed > button,
.v138-collapsible-admin-form.v138-collapsed > .form-actions { display:none !important; }
.v138-collapsible-admin-form > h3::after { content:'▾'; font-size:.9rem; }
.v138-collapsible-admin-form.v138-collapsed > h3::after { content:'▸'; }
.admin-branding-form input[type="color"] { min-height: 42px; padding:.25rem; }
.admin-page-help-body-updated li { margin-bottom:.45rem; }
.school-cal-header-actions-v138 { display:flex; flex-wrap:wrap; gap:.5rem; justify-content:flex-end; align-items:end; margin:.35rem 0 .75rem; }


/* v139 tweaks */
.function-subnav button:not(.active),
.sub-tab-row button:not(.active),
.subtab-nav button:not(.active),
.phonics-sub-buttons button:not(.selected),
.policy-editor-tabs button:not(.active) {
  background: #eef3f8;
  color: #51687d;
  border-color: #d4e2ee;
}
.weekly-letter-editor-heading .form-actions { align-items: center; gap: .65rem; flex-wrap: wrap; }
.weekly-letter-editor-heading .weekly-letter-include-options { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; margin:0 .5rem 0 0; }
.weekly-letter-editor-heading .weekly-letter-include-options .checkbox-label { white-space: nowrap; font-size:.92rem; }
.weekly-letter-body-editor { min-height: 220px; max-height: 38vh; overflow:auto; }
.weekly-letter-email-document p { margin: 0 0 .75rem; }
.class-calendar-load-centered { justify-content: center; text-align:center; flex-wrap: wrap; }
#tab-class-calendars .centered-load-note { text-align:center; margin:1.2rem auto; }
.usage-tabs-wrap { display:block; }
.usage-tabs { margin: .8rem 0 1rem; }
.usage-tab-card { margin-top: .75rem; }
@media (min-width: 701px) {
  #tab-class-calendars .section-heading { align-items:center; }
  #tab-class-calendars .inline-controls.class-calendar-load-centered { margin: .75rem auto 0; }
}


/* v140: class calendar empty-state, clearer subtabs, resource permissions, header wrapping */
#tab-class-calendars.class-calendar-empty-mode .section-heading {
  display: grid !important;
  grid-template-columns: 1fr !important;
  justify-items: center !important;
  text-align: center !important;
  gap: .55rem !important;
}
#tab-class-calendars.class-calendar-empty-mode .section-heading > div:first-child { max-width: 760px; }
#tab-class-calendars.class-calendar-empty-mode .inline-controls {
  justify-content: center !important;
  align-items: end !important;
  margin: .15rem auto .25rem !important;
}
#tab-class-calendars:not(.class-calendar-empty-mode) .section-heading .inline-controls {
  margin-left: auto !important;
  justify-content: flex-end !important;
  text-align: left !important;
}
#tab-class-calendars .centered-load-note { margin-top: .25rem !important; }
.function-subnav button:not(.active):not(.selected),
.sub-tab-row button:not(.active):not(.selected),
.subtab-nav button:not(.active):not(.selected),
.phonics-sub-buttons button:not(.selected),
.feedback-sub-buttons button:not(.selected),
.weekly-letter-subtabs button:not(.active) {
  background: #e5e9ef !important;
  color: #51606f !important;
  border-color: #ccd4df !important;
  opacity: 1 !important;
}
.function-subnav button:not(.active):not(.selected):hover,
.sub-tab-row button:not(.active):not(.selected):hover,
.subtab-nav button:not(.active):not(.selected):hover,
.phonics-sub-buttons button:not(.selected):hover,
.feedback-sub-buttons button:not(.selected):hover,
.weekly-letter-subtabs button:not(.active):hover {
  background: #d7dee8 !important;
  color: var(--blue-2, #0c3f78) !important;
}
.resource-subpermission-fieldset,
.user-resource-sub-permissions {
  border: 1px solid #d4deea;
  background: #f7fbff;
  border-radius: .9rem;
  padding: .75rem .9rem;
  margin: .75rem 0;
}
.resource-subpermission-fieldset .checkbox-grid,
.user-resource-sub-permissions .checkbox-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.weekly-letter-attachments-heading-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  flex-wrap:wrap;
  margin:.2rem 0 .5rem;
}
.weekly-letter-attachments-heading-row h4 { margin:0; color:var(--blue-2,#0c3f78); }
.weekly-letter-past-attachments {
  border:1px solid #d7e2ee;
  background:#fbfdff;
  border-radius:.8rem;
  padding:.55rem;
  margin:.55rem 0 .2rem;
  max-height: 230px;
  overflow:auto;
}
.weekly-letter-past-attachments.hidden { display:none !important; }
.weekly-letter-past-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.55rem;
  padding:.45rem .5rem;
  border-bottom:1px solid #edf2f7;
}
.weekly-letter-past-row:last-child { border-bottom:0; }
.weekly-letter-past-row button { white-space:nowrap; }
.admin-banner-year {
  white-space: nowrap !important;
  min-width: max-content;
  flex-shrink: 0;
  font-size: clamp(.82rem, 1vw, .98rem);
}
.admin-body .site-header { gap: .75rem !important; }
.admin-body .site-header nav { flex-wrap: nowrap !important; gap: .45rem !important; }
.admin-body .site-header .header-brand { min-width: 0; }
.admin-body .site-header .header-brand > div { min-width: 0; }
@media (max-width: 920px) {
  .admin-banner-year { white-space: normal !important; min-width: 0; }
  .admin-body .site-header nav { flex-wrap: wrap !important; }
}

/* v141 polish: attachment modal, tab colours, admin header, weekly email, class routine layout */
.admin-attachment-card-v141 { width: min(820px, 96vw); }
.admin-attachment-two-panel { display:grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: .75rem 0 1rem; }
.admin-attachment-two-panel section { border:1px solid var(--line, #d8e3ee); border-radius: 1rem; padding: .85rem; background:#fbfdff; }
.admin-attachment-two-panel h3 { margin:0 0 .6rem; color:var(--blue-2, #0c3f78); }
.admin-attachment-drop-zone-large { min-height: 160px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.45rem; cursor:pointer; }
.button-like { display:inline-flex; align-items:center; justify-content:center; border-radius:999px; padding:.5rem .8rem; cursor:pointer; font-weight:800; border:1px solid rgba(20,79,140,.22); background:#fff; color:var(--blue-2,#0c3f78); }
.button-like.secondary { background:#eef6ff; }
.admin-attachment-link-panel label { display:block; margin:.45rem 0; }
.admin-attachment-link-panel input { width:100%; }
@media (max-width: 760px) { .admin-attachment-two-panel { grid-template-columns:1fr; } }

/* Subtabs: light blue when available, yellow when selected, black text for both. */
.function-subnav button:not(.active):not(.selected),
.sub-tab-row button:not(.active):not(.selected),
.subtab-nav button:not(.active):not(.selected),
.phonics-sub-buttons button:not(.selected),
.feedback-sub-buttons button:not(.selected),
.weekly-letter-subtabs button:not(.active),
.usage-tabs button:not(.active),
.policy-editor-tabs button:not(.active),
.policy-tab-nav button:not(.active) {
  background: #dff0fb !important;
  color: #000 !important;
  border-color: #9fcbe8 !important;
  opacity: 1 !important;
}
.function-subnav button.active,
.function-subnav button.selected,
.function-subnav button[aria-pressed="true"],
.sub-tab-row button.active,
.sub-tab-row button.selected,
.subtab-nav button.active,
.phonics-sub-buttons button.selected,
.feedback-sub-buttons button.selected,
.weekly-letter-subtabs button.active,
.usage-tabs button.active,
.policy-editor-tabs button.active,
.policy-tab-nav button.active {
  background: var(--yellow, #f7c948) !important;
  color: #000 !important;
  border-color: var(--yellow-2, #f0b429) !important;
}

/* Admin header: keep the centre year badge aligned with the left title and right buttons; remove Zoom label via JS. */
.admin-body .site-header { align-items:center !important; }
.admin-body .site-header .header-brand h1 { font-size: clamp(1.15rem, 1.6vw, 1.55rem) !important; }
.admin-body .site-header nav,
.admin-body .site-header nav a,
.admin-body .site-header nav button,
.admin-zoom-controls,
.admin-banner-year {
  font-size: .95rem !important;
  line-height: 1.15 !important;
}
.admin-banner-year { white-space: nowrap !important; flex: 0 0 auto !important; min-width: max-content !important; max-width:none !important; }
.admin-zoom-controls { padding: .22rem .32rem !important; gap:.28rem !important; }
#adminZoomControls > span:first-child:not(#adminZoomValue) { display:none !important; }
#adminZoomValue { min-width: 2.75rem !important; }
@media (max-width: 920px) { .admin-banner-year { min-width:0 !important; white-space:normal !important; } }

/* Class calendar empty mode: keep the controls beneath the guidance text until a calendar is loaded. */
#tab-class-calendars.class-calendar-empty-mode .section-heading { grid-template-columns: 1fr !important; }
#tab-class-calendars.class-calendar-empty-mode .section-heading .inline-controls { order:2; margin:.35rem auto .25rem !important; justify-content:center !important; }
#tab-class-calendars.class-calendar-empty-mode .section-heading > div:first-child { order:1; }
#tab-class-calendars:not(.class-calendar-empty-mode) .section-heading .inline-controls { margin-left:auto !important; }

/* Routine editor tidying. */
.routine-class-inline-header-v141 h3 { display:flex; align-items:center; gap:.45rem; margin:.15rem 0 .5rem; color:var(--blue-2,#0c3f78); }
.routine-help-button { width:1.55rem; height:1.55rem; min-width:1.55rem; padding:0 !important; border-radius:999px; font-weight:900; line-height:1; }
.routine-grid-v141 label { text-align:center; font-weight:800; color:var(--blue-2,#0c3f78); }
.routine-grid-v141 label span { display:block; min-height:1.2rem; margin-bottom:.25rem; }
.routine-grid-v141 textarea { text-align:left; font-weight:500; color:#132b3d; }
.routine-grid-v141 .inline-routine-pin { align-self: end; }
@media (min-width: 900px) { .routine-grid-v141 { align-items:start; } }

/* Governors meetings grouped by governor. */
.policy-meeting-governor-group { border-top:1px solid #e4edf5; padding-top:.45rem; margin-top:.45rem; }
.policy-meeting-governor-group:first-of-type { border-top:0; padding-top:0; }
.policy-meeting-governor-group h5 { margin:.2rem 0 .35rem; color:var(--blue-2,#0c3f78); font-size:.98rem; }
.policy-meeting-copy-card-v141 .policy-meeting-header .muted { margin:.15rem 0 0; }


/* v142: Weekly Email attachment/body and public letters polish */
.weekly-letter-output {
  max-height: none !important;
  overflow: visible !important;
}
.weekly-letter-body-editor {
  max-height: 38vh !important;
  overflow: auto !important;
  background: #fff !important;
}
.weekly-letter-email-document {
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.weekly-letter-attachment-chip-list-v142 {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: stretch;
}
.weekly-letter-attachment-chip-v142 {
  border: 1px solid #b9d6ec !important;
  background: #eef7ff !important;
  color: #0c3f78 !important;
  border-radius: .9rem !important;
  box-shadow: none !important;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.weekly-letter-attachment-chip-v142:hover,
.weekly-letter-attachment-chip-v142:focus {
  background: #dff0ff !important;
  border-color: #7db5dc !important;
  color: #082f5a !important;
  transform: translateY(-1px);
}
.weekly-letter-attachment-pdf .weekly-letter-attachment-icon { color: #0c3f78; }
.weekly-letter-attachments-heading-row { margin-top: .2rem; }
.public-letters-section {
  border: 2px solid var(--yellow, #f5c542);
  background: #fffaf0;
  border-radius: 1rem;
  padding: .75rem .9rem;
  margin: .85rem 0 1rem;
}
.public-letters-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .55rem;
}
.public-letters-heading-row .public-subsection-heading { margin: 0; }
.public-letters-list,
.public-past-letters-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.public-letter-button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  min-height: 2.35rem;
}
.public-letter-button span {
  font-size: .82rem;
  opacity: .78;
  margin-left: .2rem;
}
.public-show-past-letters-button { white-space: nowrap; }
.public-modal.public-past-letters-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(12, 36, 64, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.public-modal.hidden { display: none !important; }
.public-modal-card {
  width: min(720px, 96vw);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border: 2px solid var(--blue, #1765a8);
  border-radius: 1.2rem;
  padding: 1rem;
  box-shadow: 0 16px 45px rgba(0,0,0,.25);
  position: relative;
}
.public-modal-close {
  position: absolute;
  top: .65rem;
  right: .65rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
}
.public-modal-card h2 { margin: 0 2.4rem .9rem 0; color: var(--blue-2, #0c3f78); }
@media (max-width: 700px) {
  .public-letters-heading-row { align-items: stretch; }
  .public-show-past-letters-button,
  .public-letter-button { width: 100%; justify-content: center; }
}


/* v143 public letters/buttons and public view form polish */
.public-letters-section .public-letters-subheading {
  margin: .12rem 0 0;
  font-size: .92rem;
  font-weight: 800;
  color: var(--public-header-dark, #0c3f78);
}
.public-index .public-letter-button.button-link,
.public-index .public-letter-button.public-action-button,
.public-letter-button.button-link,
.public-letter-button.public-action-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .45rem !important;
  border-radius: 999px !important;
  border: 2px solid var(--public-header-dark, #0c3f78) !important;
  background: var(--public-header-blue, #144f8c) !important;
  color: #fff !important;
  box-shadow: 0 3px 0 rgba(0,0,0,.18) !important;
  padding: .62rem .95rem !important;
  min-height: 2.65rem !important;
  line-height: 1.05 !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}
.public-index .public-letter-button.button-link:hover,
.public-index .public-letter-button.public-action-button:hover,
.public-letter-button.button-link:hover,
.public-letter-button.public-action-button:hover {
  background: var(--public-accent-yellow, #f5c542) !important;
  border-color: var(--public-header-dark, #0c3f78) !important;
  color: var(--public-header-dark, #0c3f78) !important;
  transform: translateY(-1px);
}
.public-letter-button .public-letter-main-label { font-size: 1em; opacity: 1; margin-left: 0; }
.public-letter-button .public-letter-date { font-size: .82em; opacity: .92; margin-left: .15rem; }
.public-view-closure-days-field { order: 20; }
.public-view-settings-form fieldset:has(#publicViewUpcomingClosureDaysInput) .muted.full { order: 21; }


/* v144: Always Show controls and public link rows */
.class-public-mode-controls{display:flex;flex-wrap:wrap;gap:.45rem .8rem;align-items:center;margin-top:.45rem}.always-show-inline{border-color:#f5c542!important;background:#fff8d6}.always-show-note{color:#5d4700!important}.always-show-public-class{border-color:#f5c542!important;background:#fff8d6!important;color:#111!important}.always-show-public-badge{display:inline-block;margin-left:.35rem;padding:.08rem .35rem;border-radius:999px;background:#fff;color:#111;border:1px solid rgba(0,0,0,.18);font-size:.72rem;font-weight:700}.event-item-link .public-inline-link{font-weight:700;text-decoration:underline}.event-item-link .event-label{color:inherit;font-weight:800}


/* v145: unified configurable button/background styling */
:root {
  --admin-page-bg: #f5f9ff;
  --admin-card-bg: #ffffff;
  --admin-header-button-bg: #eef2f7;
  --admin-header-button-text: #111827;
  --admin-header-button-border: #d1d5db;
  --admin-tab-bg: #dceffc;
  --admin-tab-text: #111827;
  --admin-tab-border: #b8d4ef;
  --admin-save-bg: #1765a8;
  --admin-save-text: #ffffff;
  --admin-save-border: #0c3f78;
  --admin-function-bg: #1765a8;
  --admin-function-text: #ffffff;
  --admin-function-border: #0c3f78;
  --admin-delete-bg: #d84a3a;
  --admin-delete-text: #ffffff;
  --admin-delete-border: #a32b20;
  --admin-archive-bg: #fff1f1;
  --admin-archive-text: #7f1d1d;
  --admin-archive-border: #f3b7b0;
  --admin-high-menu-bg: #1765a8;
  --admin-high-menu-text: #ffffff;
  --admin-high-menu-border: #0c3f78;
  --admin-attachment-bg: #eef6ff;
  --admin-attachment-text: #123b5d;
  --admin-attachment-border: #b8d4ef;
  --admin-rich-text-bg: #ffffff;
  --admin-rich-text-text: #111827;
  --admin-rich-text-border: #cbd5e1;
  --public-button-bg: #1765a8;
  --public-button-text: #ffffff;
  --public-button-border: #0c3f78;
  --public-secondary-button-bg: #eef6ff;
  --public-secondary-button-text: #123b5d;
  --public-secondary-button-border: #b8d4ef;
  --public-filter-button-bg: #ffffff;
  --public-filter-button-text: #123b5d;
  --public-filter-button-border: #b8d4ef;
  --public-download-button-bg: #f5c542;
  --public-download-button-text: #111827;
  --public-download-button-border: #d09a00;
}
body.admin-body { background: var(--admin-page-bg); }
.admin-body .card, .admin-body .card-lite, .policies-body .card, .policies-body .card-lite { background: var(--admin-card-bg); }
.admin-body button, .policies-body button { background: var(--admin-function-bg); color: var(--admin-function-text); border: 1px solid var(--admin-function-border); }
.admin-body button:hover, .policies-body button:hover { filter: brightness(.96); color: var(--admin-function-text); }
.admin-body .site-header nav a, .admin-body .site-header nav button, .policies-body .site-header nav a, .policies-body .site-header nav button { background: var(--admin-header-button-bg) !important; color: var(--admin-header-button-text) !important; border: 1px solid var(--admin-header-button-border) !important; }
.admin-body .tab-nav > button, .admin-body .tab-nav .admin-functions-toggle, .admin-functions-dropdown button, .policies-body .tab-nav > button { background: var(--admin-high-menu-bg) !important; color: var(--admin-high-menu-text) !important; border: 1px solid var(--admin-high-menu-border) !important; opacity: .82; }
.admin-body .tab-nav > button.active, .admin-body .tab-nav .admin-functions-toggle.active, .admin-functions-dropdown button.active, .policies-body .tab-nav > button.active { opacity: 1; filter: none; }
.admin-body .sub-tab-row button, .admin-body .function-subnav button, .admin-body .subtab-nav button, .policies-body .function-subnav button:not(#policyAdminHomepageButton), .policies-body .policy-editor-tab-button { background: var(--admin-tab-bg) !important; color: var(--admin-tab-text) !important; border: 1px solid var(--admin-tab-border) !important; opacity: .68; }
.admin-body .sub-tab-row button.active, .admin-body .function-subnav button.active, .admin-body .subtab-nav button.active, .policies-body .function-subnav button.active, .policies-body .policy-editor-tab-button.active { background: var(--yellow) !important; color: #111827 !important; border-color: var(--yellow-2) !important; opacity: 1; }
.admin-body button[type="submit"], .admin-body .save-button, .admin-body button.save, .policies-body button[type="submit"], .policies-body .save-button, .policies-body button.save { background: var(--admin-save-bg) !important; color: var(--admin-save-text) !important; border-color: var(--admin-save-border) !important; }
.admin-body button.secondary, .policies-body button.secondary { background: var(--admin-attachment-bg); color: var(--admin-attachment-text); border-color: var(--admin-attachment-border); }
.admin-body button.danger, .admin-body .delete-button, .policies-body button.danger, .policies-body .delete-button { background: var(--admin-delete-bg) !important; color: var(--admin-delete-text) !important; border-color: var(--admin-delete-border) !important; }
.admin-body .small-archive-button, .policies-body .small-archive-button, .policies-body button[onclick*="archivePolicy"], .policies-body button[onclick*="unarchivePolicy"] { background: var(--admin-archive-bg) !important; color: var(--admin-archive-text) !important; border-color: var(--admin-archive-border) !important; }
.admin-body .weekly-letter-attachments-list a, .admin-body .weekly-letter-attachments-list button, .admin-body .attachment-chip, .admin-body .rich-toolbar button, .policies-body .rich-toolbar button, .policies-body .policy-content-actions button.secondary { background: var(--admin-attachment-bg) !important; color: var(--admin-attachment-text) !important; border-color: var(--admin-attachment-border) !important; }
.admin-body .rich-toolbar button, .policies-body .rich-toolbar button { background: var(--admin-rich-text-bg) !important; color: var(--admin-rich-text-text) !important; border-color: var(--admin-rich-text-border) !important; }
.public-body { background: var(--public-page-background); }
.public-body button, .public-body .button-link, .public-action-button { background: var(--public-button-bg) !important; color: var(--public-button-text) !important; border: 1px solid var(--public-button-border) !important; }
.public-body button.secondary, .public-body .public-show-past-letters-button { background: var(--public-secondary-button-bg) !important; color: var(--public-secondary-button-text) !important; border-color: var(--public-secondary-button-border) !important; }
.public-body .filter-button { background: var(--public-filter-button-bg) !important; color: var(--public-filter-button-text) !important; border-color: var(--public-filter-button-border) !important; }
.public-body .filter-button.selected, .public-body .filter-button[data-selected="true"] { background: var(--public-download-button-bg) !important; color: var(--public-download-button-text) !important; border-color: var(--public-download-button-border) !important; }
.public-body .download-week-button, .public-body .public-letter-button { background: var(--public-download-button-bg) !important; color: var(--public-download-button-text) !important; border-color: var(--public-download-button-border) !important; }
.branding-control-grid-v145 { display:grid; gap:.55rem; grid-template-columns: minmax(170px, 1fr) repeat(3, minmax(92px, 120px)) minmax(130px, 180px); align-items:center; }
.branding-control-row-v145 { display:contents; }
.branding-control-row-v145 > strong { align-self:center; }
.branding-control-row-v145 label { display:flex; align-items:center; gap:.35rem; font-size:.88rem; }
.branding-control-row-v145 input[type="color"] { width:2.7rem; height:2.2rem; padding:.08rem; }
.branding-example-v145 { border-radius:.65rem; padding:.55rem .75rem; font-weight:800; text-align:center; border:1px solid currentColor; }
.weekly-letter-loading-v145 { margin:.45rem 0 0; padding:.55rem .75rem; border:1px solid var(--line); border-radius:.75rem; background:#f8fcff; color:#123b5d; font-weight:800; }
.weekly-letter-loading-bar-v145 { height:.55rem; border-radius:999px; background:#dceffc; overflow:hidden; margin-top:.35rem; }
.weekly-letter-loading-bar-v145 span { display:block; height:100%; width:45%; border-radius:999px; background:linear-gradient(90deg, #1765a8, #f5c542); animation: weekly-loading-v145 1s ease-in-out infinite alternate; }
@keyframes weekly-loading-v145 { from { transform:translateX(-70%); } to { transform:translateX(170%); } }
.policy-meeting-rich-section h4 { color:#111827 !important; }
@media (max-width: 860px){ .branding-control-grid-v145 { grid-template-columns: 1fr; } .branding-control-row-v145 { display:grid; grid-template-columns: 1fr; gap:.25rem; padding:.55rem 0; border-top:1px solid var(--line); } }


/* v146: calendar colour variables and bulk CSV UI */
:root {
  --admin-calendar-main-header-bg: var(--blue);
  --admin-calendar-date-header-bg: var(--blue-2);
  --admin-calendar-header-text: #ffffff;
  --admin-calendar-editable-bg: #fffdf4;
  --admin-calendar-editable-hover-bg: var(--cream);
  --admin-calendar-readonly-bg: #f8fafc;
  --admin-calendar-today-bg: #fff6cf;
  --admin-calendar-weekday-text: var(--cell-ink);
  --admin-calendar-row-text: var(--cell-ink);
  --admin-calendar-border: var(--line);
  --admin-calendar-weekend-bg: var(--weekend-grey);
  --admin-calendar-past-bg: var(--past-grey);
}
#tab-school-calendars .data-table th,
#tab-class-calendars .data-table th { background: var(--admin-calendar-main-header-bg) !important; color: var(--admin-calendar-header-text) !important; border-color: var(--admin-calendar-border) !important; }
#tab-school-calendars .data-table th.date-col,
#tab-class-calendars .data-table th.date-col { background: var(--admin-calendar-date-header-bg) !important; color: var(--admin-calendar-header-text) !important; }
#tab-school-calendars .data-table th,
#tab-school-calendars .data-table td,
#tab-class-calendars .data-table th,
#tab-class-calendars .data-table td { border-color: var(--admin-calendar-border) !important; color: var(--admin-calendar-row-text); }
#tab-school-calendars .data-table .date-col,
#tab-class-calendars .data-table .date-col { color: var(--admin-calendar-weekday-text); }
#tab-school-calendars .editable-cell,
#tab-class-calendars .editable-cell { background: var(--admin-calendar-editable-bg) !important; }
#tab-school-calendars .editable-cell:hover,
#tab-class-calendars .editable-cell:hover { background: var(--admin-calendar-editable-hover-bg) !important; }
#tab-school-calendars .readonly-cell,
#tab-class-calendars .readonly-cell,
#tab-school-calendars .data-table td:not(.editable-cell),
#tab-class-calendars .data-table td:not(.editable-cell) { background-color: var(--admin-calendar-readonly-bg); }
#tab-school-calendars .data-table tr.today-row td,
#tab-class-calendars .data-table tr.today-row td { background-color: var(--admin-calendar-today-bg) !important; }
#tab-school-calendars .data-table tr.weekend-row td,
#tab-class-calendars .data-table tr.weekend-row td { background-color: var(--admin-calendar-weekend-bg) !important; }
#tab-school-calendars .data-table tr.past-row td,
#tab-class-calendars .data-table tr.past-row td { background-color: var(--admin-calendar-past-bg) !important; }
.calendar-colour-row-v146 .branding-example-v145 { border: 1px solid var(--admin-calendar-border); }
.bulk-csv-buttons-v146 { display:flex; gap:.5rem; align-items:end; flex-wrap:wrap; }
.bulk-csv-modal-v146 { max-width: min(980px, 94vw); }
.bulk-csv-drop-v146 { margin: .75rem 0; min-height: 7rem; display:grid; place-items:center; text-align:center; cursor:pointer; }
.bulk-csv-drop-v146.drag-over { outline: 3px dashed var(--yellow); background: var(--cream); }
.bulk-csv-separator-v146 { display:flex; gap:1rem; flex-wrap:wrap; margin:.75rem 0; }
.bulk-csv-separator-v146 label { display:flex; flex-direction:row; align-items:center; gap:.4rem; }
.bulk-csv-example-v146 pre { background:#f8fafc; border:1px solid var(--line); border-radius:.7rem; padding:.75rem; overflow:auto; }
.compact-preview-table-v146 { max-height: 34vh; }
.csv-row-warning td { background:#fff1f1 !important; }
.modal-card { width:min(900px,96vw); max-height:92vh; overflow:auto; background:#fff; border-radius:1rem; box-shadow:0 22px 80px rgba(0,0,0,.28); padding:1rem; position:relative; }
.modal-close { position:absolute; right:.8rem; top:.8rem; border-radius:999px; padding:.35rem .65rem; }

/* v147: selected menu/tab colours, consolidated calendar preview and public button hover polish */
:root {
  --admin-selected-high-menu-bg: #f5c542;
  --admin-selected-high-menu-text: #111827;
  --admin-selected-high-menu-border: #d09a00;
  --admin-selected-tab-bg: #f5c542;
  --admin-selected-tab-text: #111827;
  --admin-selected-tab-border: #d09a00;
}
.admin-body .tab-nav > button.active,
.admin-body .tab-nav .admin-functions-toggle.active,
.admin-functions-dropdown button.active,
.policies-body .tab-nav > button.active {
  background: var(--admin-selected-high-menu-bg) !important;
  color: var(--admin-selected-high-menu-text) !important;
  border-color: var(--admin-selected-high-menu-border) !important;
  opacity: 1 !important;
  filter: none !important;
}
.admin-body .sub-tab-row button.active,
.admin-body .function-subnav button.active,
.admin-body .subtab-nav button.active,
.policies-body .function-subnav button.active,
.policies-body .policy-editor-tab-button.active,
.function-subnav button.selected,
.sub-tab-row button.selected,
.subtab-nav button.selected,
.phonics-sub-buttons button.selected,
.feedback-sub-buttons button.selected {
  background: var(--admin-selected-tab-bg) !important;
  color: var(--admin-selected-tab-text) !important;
  border-color: var(--admin-selected-tab-border) !important;
  opacity: 1 !important;
  filter: none !important;
}
.calendar-colour-input-list-v147 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .55rem .75rem;
  margin-top: .65rem;
}
.calendar-colour-input-list-v147 .branding-control-row-v145 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: #fbfdff;
  padding: .55rem .65rem;
}
.calendar-colour-input-list-v147 .branding-control-row-v145 label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.calendar-branding-preview-wrap-v147 {
  margin-top: .9rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: .75rem;
  background: #ffffff;
  overflow-x: auto;
}
.calendar-branding-preview-table-v147 {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: .9rem;
  color: var(--admin-calendar-row-text);
}
.calendar-branding-preview-table-v147 th,
.calendar-branding-preview-table-v147 td {
  border: 2px solid var(--admin-calendar-border);
  padding: .55rem .65rem;
  text-align: center;
}
.calendar-branding-preview-table-v147 .preview-main-header,
.calendar-branding-preview-table-v147 .preview-uneditable-header,
.calendar-branding-preview-table-v147 .preview-editable-header,
.calendar-branding-preview-table-v147 .preview-editable-hover-header {
  background: var(--admin-calendar-main-header-bg);
  color: var(--admin-calendar-header-text);
}
.calendar-branding-preview-table-v147 .preview-date-header {
  background: var(--admin-calendar-date-header-bg);
  color: var(--admin-calendar-header-text);
}
.calendar-branding-preview-table-v147 .preview-date-cell {
  color: var(--admin-calendar-weekday-text);
  font-weight: 800;
}
.calendar-branding-preview-table-v147 .preview-readonly-cell { background: var(--admin-calendar-readonly-bg); }
.calendar-branding-preview-table-v147 .preview-editable-cell { background: var(--admin-calendar-editable-bg); }
.calendar-branding-preview-table-v147 .preview-editable-hover-cell { background: var(--admin-calendar-editable-hover-bg); }
.calendar-branding-preview-table-v147 .preview-row-text-cell { color: var(--admin-calendar-row-text); }
.calendar-branding-preview-table-v147 .preview-today-row td { background-color: var(--admin-calendar-today-bg) !important; }
.calendar-branding-preview-table-v147 .preview-today-row .preview-editable-cell { background: linear-gradient(0deg, var(--admin-calendar-editable-bg), var(--admin-calendar-today-bg)) !important; }
.calendar-branding-preview-table-v147 .preview-today-row .preview-editable-hover-cell { background: linear-gradient(0deg, var(--admin-calendar-editable-hover-bg), var(--admin-calendar-today-bg)) !important; }
.calendar-branding-preview-table-v147 .preview-weekend-row td { background: var(--admin-calendar-weekend-bg); }
.calendar-branding-preview-table-v147 .preview-past-row td { background: var(--admin-calendar-past-bg); }
.public-controls .section-heading,
.public-controls .section-heading > div,
.public-controls .section-heading h2 {
  text-align: center;
  justify-content: center;
}
.public-index .public-ks-group h3 { text-align: center; }
.public-index .public-class-buttons {
  justify-content: center;
  text-align: center;
}
.public-body button:hover,
.public-body .button-link:hover,
.public-action-button:hover,
.public-body .filter-button:hover,
.public-body .download-week-button:hover,
.public-body .public-letter-button:hover {
  background: var(--public-download-button-bg) !important;
  color: var(--public-download-button-text) !important;
  border-color: var(--public-download-button-border) !important;
  filter: brightness(1.06);
}
