/* Gymnasium #3 schedule portal — light theme by default, crest-inspired colours */
:root {
  color-scheme: light;
  --bg: #f4f7f3;
  --bg-soft: #eaf1ed;
  --surface: rgba(255,255,255,.92);
  --surface-solid: #ffffff;
  --surface-raised: #f8fbf8;
  --line: rgba(0,40,96,.12);
  --line-strong: rgba(0,40,96,.24);
  --ink: #172a3b;
  --ink-soft: #345064;
  --muted: #657987;
  --accent: #007b91;
  --accent-2: #28a848;
  --accent-dark: #005d70;
  --green: #218847;
  --red: #c84e45;
  --shadow: 0 20px 55px rgba(0,40,96,.10);
  --radius: 20px;
}
 :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1e;
  --bg-soft: #111a2e;
  --surface: rgba(19, 29, 49, .88);
  --surface-solid: #141f35;
  --surface-raised: #1b2944;
  --line: rgba(157, 177, 216, .17);
  --line-strong: rgba(157, 177, 216, .3);
  --ink: #edf2ff;
  --ink-soft: #c3cde2;
  --muted: #8f9db8;
  --accent: #8b7cff;
  --accent-2: #43c6e8;
  --accent-dark: #7060eb;
  --green: #56d6a0;
  --red: #ff7385;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh; margin: 0; color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 12% 3%, rgba(107, 87, 255, .18), transparent 34rem),
    radial-gradient(ellipse at 91% 18%, rgba(30, 190, 216, .12), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg-soft));
  background-attachment: fixed;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
.topbar {
  min-height: 78px; padding: 14px clamp(18px, 4vw, 60px); display: flex; align-items: center;
  gap: 25px; justify-content: space-between; border-bottom: 1px solid var(--line);
  background: rgba(9, 15, 30, .45); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
:root[data-theme="light"] .topbar { background: rgba(255,255,255,.68); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 15px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; font-size: 16px; background: linear-gradient(135deg, #8e78ff, #36bfdc); box-shadow: 0 8px 22px rgba(106, 96, 235, .32); }
.nav { display: flex; align-items: center; gap: clamp(10px, 1.8vw, 26px); flex-wrap: wrap; }
.nav a, .nav-admin-link { text-decoration: none; font-size: 12px; color: var(--muted); font-weight: 650; transition: color .18s ease; }
.nav a:hover, .nav-admin-link:hover { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.nav-admin-link { padding: 7px 0; }
.logout-form { margin: 0; }
.nav-button { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-soft); padding: 8px 12px; border-radius: 10px; font-weight: 650; font-size: 12px; cursor: pointer; }
.theme-toggle { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line-strong); color: var(--ink); background: var(--surface); font-size: 16px; cursor: pointer; box-shadow: 0 7px 24px rgba(0,0,0,.1); transition: transform .18s ease, border-color .18s ease; }
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent); }
.container { width: min(1120px, calc(100% - 44px)); margin: 42px auto 70px; min-height: calc(100vh - 200px); }
.footer { width: min(1120px, calc(100% - 44px)); margin: 0 auto; padding: 20px 0 28px; color: var(--muted); font-size: 11px; text-align: center; border-top: 1px solid var(--line); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 0 0 25px; }
.page-heading h1 { margin: 5px 0 7px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.045em; line-height: 1.08; }
.page-heading p { margin: 0; }
.eyebrow { color: var(--accent-2); font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.muted { color: var(--muted) !important; }
.small { font-size: 12px; }
.panel { padding: clamp(19px, 3vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 18px; backdrop-filter: blur(16px); }
.panel h2 { margin: 0 0 17px; font-size: 19px; letter-spacing: -.025em; }
.panel p { line-height: 1.6; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 11px 17px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: var(--surface-raised); font-size: 12px; font-weight: 750; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .16s ease, border-color .16s ease, filter .16s ease; }
.button:hover { transform: translateY(-1px); border-color: var(--accent); }
.button.primary { border: 0; color: #fff; background: linear-gradient(120deg, #7767f4, #419ddf); box-shadow: 0 8px 22px rgba(102, 91, 229, .23); }
.button.primary:hover { filter: brightness(1.08); }
.button.secondary { color: var(--ink-soft); background: var(--surface-raised); }
.button.danger { color: #fff; border: 0; background: linear-gradient(120deg, #d84f72, #ef795f); }
.full-width { width: 100%; margin-top: 15px; }
.messages { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; }
.message { padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-raised); color: var(--ink-soft); font-size: 13px; }
.message.success { border-color: rgba(86,214,160,.28); color: var(--green); }
.message.error { border-color: rgba(255,115,133,.3); color: var(--red); }
.message.warning { border-color: rgba(245,190,90,.3); color: #e8be6d; }
.empty-state { text-align: center; padding: 45px 22px; }
.empty-state strong { font-size: 16px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.empty-icon { width: 46px; height: 46px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 15px; color: var(--accent-2); background: rgba(67,198,232,.1); font-size: 20px; }
/* Landing screen */
.home-page { overflow-x: hidden; }
.home-page .container { width: min(1120px, calc(100% - 48px)); min-height: calc(100vh - 90px); margin: 0 auto; display: flex; align-items: center; }
.landing { width: 100%; padding: 58px 0 82px; }
.landing-title { text-align: center; margin: 0 auto 58px; }
.landing-title h1 { margin: 0; font-size: clamp(43px, 7.5vw, 78px); font-weight: 900; letter-spacing: -.07em; line-height: .98; background: linear-gradient(100deg, #f3f0ff 12%, #a89aff 53%, #6dd8ec 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .landing-title h1 { background-image: linear-gradient(100deg, #293158 12%, #6556ce 53%, #087f9f 95%); }
.landing-subtitle { margin-top: 13px; color: var(--muted); font-size: clamp(13px, 2vw, 17px); font-weight: 650; letter-spacing: .24em; text-transform: uppercase; }
.landing-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1040px; margin: 0 auto; }
.portal-card { position: relative; isolation: isolate; overflow: hidden; min-height: 225px; padding: 29px 28px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(255,255,255,.16); border-radius: 25px; color: #fff; text-decoration: none; box-shadow: 0 22px 48px rgba(0,0,0,.2); transition: transform .2s ease, box-shadow .2s ease; }
.portal-card::before { content: ""; position: absolute; z-index: -1; width: 230px; height: 230px; right: -74px; top: -100px; border-radius: 50%; background: rgba(255,255,255,.14); filter: blur(2px); }
.portal-card::after { content: ""; position: absolute; z-index: -1; width: 150px; height: 150px; right: 25px; bottom: -104px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 22px rgba(255,255,255,.04), 0 0 0 44px rgba(255,255,255,.025); }
.portal-card:hover { transform: translateY(-7px); box-shadow: 0 30px 60px rgba(0,0,0,.28); }
.portal-students { background: linear-gradient(135deg, #002860, #086b9b 68%, #3898b8); }
.portal-teachers { background: linear-gradient(135deg, #167a42, #28a848 65%, #60c0c8); }
.portal-info { background: linear-gradient(135deg, #bc7134, #d68b3c 60%, #e4a54e); }
.portal-number { font-size: 12px; font-weight: 850; letter-spacing: .16em; opacity: .8; }
.portal-label { max-width: 230px; font-size: clamp(23px, 2.7vw, 31px); font-weight: 850; letter-spacing: -.045em; line-height: 1.08; }
.portal-arrow { position: absolute; right: 27px; bottom: 25px; font-size: 27px; opacity: .9; }
.creator-mark { position: fixed; right: 25px; bottom: 19px; color: var(--muted); font-size: 26px; letter-spacing: .04em; }
.creator-mark strong { color: var(--ink-soft); font-weight: 900; }
/* Lists */
.entity-panel { padding: 14px clamp(17px, 2.5vw, 26px) 20px; }
.entity-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 7px 0 17px; border-bottom: 1px solid var(--line); }
.search-field { min-width: min(100%, 370px); display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); color: var(--muted); }
.search-field span { font-size: 20px; }
.search-field input { width: 100%; height: 42px; padding: 0; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 13px; }
.search-field input::placeholder { color: var(--muted); }
.entity-count { color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.entity-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px 13px; padding-top: 15px; }
.entity-row { min-width: 0; min-height: 62px; display: flex; align-items: center; gap: 13px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); text-decoration: none; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.entity-row:hover { transform: translateY(-2px); border-color: rgba(139,124,255,.55); background: rgba(139,124,255,.08); }
.entity-initial { flex: 0 0 39px; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: white; font-size: 12px; font-weight: 850; }
.class-initial { background: linear-gradient(135deg, #7567ed, #9b79e7); }
.teacher-initial { background: linear-gradient(135deg, #168eaf, #4bb9b7); font-size: 17px; }
.entity-name { min-width: 0; flex: 1; font-size: 13px; font-weight: 750; color: var(--ink-soft); overflow-wrap: anywhere; }
.entity-arrow { color: var(--accent-2); font-size: 19px; }
.no-results { padding: 27px 10px; color: var(--muted); text-align: center; font-size: 13px; }
/* Important info */
.info-link-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.info-link-card { min-width: 0; min-height: 112px; display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.info-link-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.info-link-icon { flex: 0 0 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: white; background: linear-gradient(135deg, #7969ef, #37afd2); font-size: 21px; }
.info-link-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.info-link-copy strong { font-size: 15px; }
.info-link-copy small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.info-link-open { color: var(--accent-2); font-size: 11px; font-weight: 800; white-space: nowrap; }
/* Admin forms and lists */
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-stack label { display: flex; flex-direction: column; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.form-stack input, .form-stack select, .form-stack textarea, .panel select, .panel input[type="date"], .panel input[type="file"], .inline-form input, .inline-form select { width: 100%; max-width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--ink); background: var(--surface-raised); }
.form-stack textarea { resize: vertical; }
.form-stack input:focus, .form-stack select:focus, .form-stack textarea:focus, .panel select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,255,.13); }
.form-stack input[type="checkbox"], .checkbox-field input { width: 17px; min-height: 17px; accent-color: var(--accent); }
.form-actions, .managed-link-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.admin-info-layout { display: grid; grid-template-columns: minmax(270px,.8fr) minmax(0,1.2fr); gap: 18px; align-items: start; }
.admin-info-layout .form-panel { position: sticky; top: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin-bottom: 0; }
.managed-link-list { display: flex; flex-direction: column; margin-top: 14px; }
.managed-link-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.managed-link-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.managed-link-copy strong { font-size: 14px; }
.managed-link-copy a { max-width: 100%; overflow-wrap: anywhere; color: var(--accent-2); font-size: 11px; text-decoration: none; }
.managed-link-copy small { color: var(--muted); font-size: 11px; }
.status-chip { width: fit-content; margin-top: 3px; padding: 4px 8px; border-radius: 7px; font-size: 10px; font-weight: 750; }
.status-chip.is-active { color: var(--green); background: rgba(86,214,160,.1); }
.status-chip.is-disabled { color: var(--muted); background: var(--surface-raised); }
.checkbox-field { display: flex !important; flex-direction: row !important; align-items: center; gap: 11px !important; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.checkbox-field input { flex: 0 0 17px; }
.checkbox-field span { display: flex; flex-direction: column; gap: 3px; }
.checkbox-field strong { font-size: 12px; }
.checkbox-field small { color: var(--muted); font-size: 10px; font-weight: 400; }
/* Login and setup */
.auth-wrap { width: min(450px, 100%); margin: 5vh auto; }
.auth-panel { padding: 30px; }
.auth-panel h1 { margin: 8px 0 10px; font-size: 29px; letter-spacing: -.04em; }
.auth-panel .button { width: 100%; }
.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface-raised); font-size: 12px; line-height: 1.55; }
.warning-notice { color: #dfbb72; border-color: rgba(223,187,114,.2); }
.field-error { color: var(--red); font-size: 11px; }
.command-box { white-space: pre-wrap; overflow-wrap: anywhere; padding: 13px; border-radius: 10px; color: var(--ink-soft); background: #080d18; font-size: 12px; }
/* NIKA management */
.inline-form { display: flex; gap: 13px; align-items: end; flex-wrap: wrap; }
.inline-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.field-label { display: block; margin: 12px 0 6px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.status.success { color: var(--green); font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
/* Week schedule */
.week-nav { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 18px; }
.day-panel { margin: 0 0 16px; }
.day-panel h2 { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.lesson-list { display: grid; gap: 8px; }
.lesson-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.lesson-number { flex: 0 0 84px; width: 84px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 4px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #7567ed, #438ed5); text-align: center; }
.lesson-number strong { font-size: 16px; line-height: 1.1; font-weight: 900; }
.lesson-number span { font-size: 9px; line-height: 1.2; font-weight: 750; white-space: nowrap; }
.lesson-content { min-width: 0; flex: 1; }
.lesson-item { padding: 2px 0 9px; }
.lesson-item:last-child { padding-bottom: 0; }
.lesson-item strong { font-size: 13px; }
.lesson-item .muted { font-size: 11px; }
/* Previous project components kept usable if visited by a direct URL */
.stats-grid, .two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.admin-account-list { display: flex; flex-direction: column; margin-top: 18px; }
.admin-account-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.admin-account-main { display: flex; flex-direction: column; gap: 7px; }
.permission-summary { display: flex; gap: 7px; flex-wrap: wrap; }
.permission-summary span { padding: 4px 8px; border-radius: 7px; color: var(--muted); background: var(--surface-raised); font-size: 10px; }
.pill { display: inline-block; padding: 5px 9px; border-radius: 30px; font-size: 10px; font-weight: 800; }
.pill.success { color: var(--green); background: rgba(86,214,160,.12); }
.pill.warning { color: #e3bd67; background: rgba(227,189,103,.12); }
.muted-pill { color: var(--muted); background: var(--surface-raised); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.filter-tabs a { padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 11px; background: var(--surface-raised); }
.filter-tabs a.selected { color: white; background: var(--accent-dark); }
.publish-bar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-raised); }
.proposal-list { display: flex; flex-direction: column; gap: 14px; }
.proposal-card { margin: 0; }
.proposal-top { display: flex; justify-content: space-between; gap: 16px; }
.replacement-flow { display: flex; align-items: center; gap: 20px; padding: 16px 0; }
.replacement-flow>div { display: flex; flex-direction: column; gap: 3px; }
.replacement-flow small { color: var(--muted); font-size: 10px; }
.arrow { color: var(--accent); font-size: 21px; }
.action-row { display: flex; gap: 10px; margin-top: 15px; }
.action-row form { margin: 0; }
.success-text { color: var(--green); font-size: 12px; font-weight: 700; }
.feature-list { padding-left: 20px; color: var(--muted); font-size: 12px; }
.feature-list li { margin: 9px 0; }
@media (max-width: 950px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .public-nav { order: 3; width: 100%; }
  .landing-actions { gap: 12px; }
  .portal-card { min-height: 200px; padding: 23px; }
}
@media (max-width: 700px) {
  .topbar { padding: 13px 17px; gap: 12px; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .nav-admin-link { display: none; }
  .container { width: min(100% - 28px, 600px); margin: 27px auto 45px; }
  .home-page .container { width: calc(100% - 32px); min-height: 100vh; }
  .landing { padding: 80px 0 85px; }
  .landing-title { margin-bottom: 35px; }
  .landing-actions { grid-template-columns: 1fr; max-width: 460px; }
  .portal-card { min-height: 132px; padding: 18px 20px; border-radius: 19px; }
  .portal-label { font-size: 23px; }
  .portal-arrow { right: 20px; bottom: 18px; }
  .entity-list, .info-link-list, .admin-info-layout, .stats-grid, .two-columns { grid-template-columns: 1fr; }
  .admin-info-layout .form-panel { position: static; }
  .managed-link-row { align-items: flex-start; flex-direction: column; }
  .managed-link-actions { width: 100%; }
  .managed-link-actions .button { flex: 1; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 30px; }
  .panel { padding: 18px; border-radius: 16px; }
  .week-nav { flex-wrap: wrap; }
  .week-nav .button { flex: 1; }
  .publish-bar, .toolbar, .proposal-top { align-items: flex-start; flex-direction: column; }
  .action-row { flex-direction: column; }
  .action-row .button { width: 100%; }
  .admin-account-row { align-items: flex-start; flex-direction: column; }
  .admin-account-row .button { width: 100%; }
}


/* Single-day timetable navigation and clearly visible cancellations */
.schedule-back-row { margin: 0 0 18px; }
.schedule-heading { margin-bottom: 18px; }
.day-navigation { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 12px; margin: 0 0 18px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.day-navigation > a:first-child { justify-self: start; }
.day-navigation > a:last-child { justify-self: end; }
.day-navigation-current { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.day-navigation-current strong { color: var(--ink); font-size: 16px; font-weight: 850; white-space: nowrap; }
.day-navigation-current em, .today-chip { padding: 5px 9px; border-radius: 999px; color: #c5ffe9; background: rgba(55, 205, 146, .16); border: 1px solid rgba(55,205,146,.22); font-size: 10px; font-style: normal; font-weight: 850; white-space: nowrap; }
.day-panel-current { border-color: rgba(139,124,255,.26); }
.day-panel h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }
.lesson-row-cancelled { border-color: rgba(255, 94, 117, .45); background: linear-gradient(110deg, rgba(255, 81, 112, .11), rgba(255,255,255,.018)); }
.lesson-item-cancelled { margin: 2px 0 7px; padding: 8px 10px; border-left: 3px solid var(--red); border-radius: 0 9px 9px 0; background: rgba(255, 94, 117, .09); }
.cancelled-badge { display: inline-flex; align-items: center; gap: 5px; margin: 0 8px 6px 0; padding: 5px 8px; border-radius: 7px; color: #fff; background: linear-gradient(120deg, #d83f62, #f06475); font-size: 10px; font-weight: 900; letter-spacing: .045em; }
.lesson-item-cancelled > strong { color: #ffbdc8; text-decoration: line-through; text-decoration-thickness: 1px; }
:root[data-theme="light"] .lesson-item-cancelled > strong { color: #a12d48; }
.lesson-class { color: var(--accent-2); font-weight: 800; }
.day-empty-note { margin: 5px 0 0; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); text-align: center; font-size: 13px; }
@media (max-width: 700px) {
  .creator-mark { right: 15px; bottom: 12px; font-size: 25px; }
  .day-navigation { grid-template-columns: 1fr 1fr; }
  .day-navigation-current { grid-column: 1 / -1; grid-row: 1; padding: 4px 0 8px; }
  .day-navigation > a:first-child { grid-row: 2; }
  .day-navigation > a:last-child { grid-row: 2; }
  .day-navigation .button { width: 100%; padding: 10px 8px; white-space: normal; }
}


/* The public home page opens directly; no intro animation is used. */
/* NIKA permanent/daily publication workflow and Telegram administration */
.schedule-upload-form { display: grid; gap: 12px; margin-top: 18px; }
.schedule-upload-form label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.schedule-version-card { display: grid; gap: 5px; margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-raised); }
.comparison-result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.change-list { display: grid; gap: 9px; margin: 14px 0 18px; }
.change-card { padding: 13px 15px; border: 1px solid var(--line); border-left: 3px solid #d6a34a; border-radius: 12px; background: var(--surface-raised); }
.change-card-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.change-card-heading span { color: var(--muted); font-size: 11px; }
.change-card-subject { margin-top: 7px; color: var(--ink); font-weight: 750; }
.change-card-detail { margin-top: 4px; color: var(--ink-soft); font-size: 12px; }
.status-chip.warning { color: #e6bd69; background: rgba(227,189,103,.12); }
.action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 15px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 10px; margin: 15px 0; }
.stat-card { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-raised); }
.stat-card strong { font-size: 25px; line-height: 1; }
.stat-card span { color: var(--muted); font-size: 11px; }
@media (max-width: 620px) {
  .change-card-heading { display: grid; gap: 4px; }
  .action-row { align-items: stretch; }
  .action-row .button { width: 100%; }
}

/* New lesson entry and public Telegram CTA */
.home-telegram-cta, .telegram-public-cta { display: flex; justify-content: center; margin-top: 18px; }
.page-heading-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-lesson-panel { max-width: 760px; }
.add-lesson-panel .form-stack { gap: 16px; }
.add-lesson-panel label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
@media (max-width: 520px) { .lesson-number { flex-basis: 74px; width: 74px; } .lesson-number span { font-size: 8px; } }

/* Today's free rooms */
.room-period-list { display: grid; gap: 13px; }
.room-period-card { margin: 0; }
.room-period-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 15px; }
.room-period-heading > div { display: flex; align-items: center; gap: 13px; }
.room-period-heading h2 { margin: 0; font-size: 20px; }
.room-period-heading p { margin: 4px 0 0; }
.room-period-index { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #7769e8, #4b69c7); font-size: 20px; font-weight: 900; }
.room-period-count { padding: 7px 11px; border: 1px solid rgba(57,198,146,.23); border-radius: 999px; color: #49cf9c; background: rgba(57,198,146,.09); font-size: 12px; font-weight: 800; white-space: nowrap; }
.room-chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.room-chip { display: inline-flex; min-width: 61px; justify-content: center; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-raised); font-size: 13px; font-weight: 850; font-variant-numeric: tabular-nums; }
.room-no-free { margin: 0; padding: 14px; border-radius: 10px; color: #ffb4bd; background: rgba(220,67,95,.09); font-size: 13px; font-weight: 750; }
.room-data-note { margin: 14px 2px 0; }
@media (max-width: 600px) { .room-period-heading { align-items: flex-start; flex-direction: column; } }

/* School electronic display home page */
body.board-home-screen main.container, body.board-info-screen main.container { width: 100%; max-width: none; margin: 0; padding: 0; }
body.board-home-screen { min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, #273262 0%, #10172f 55%, #080e1e 100%); }
.board-home { display: flex; min-height: 100vh; flex-direction: column; justify-content: center; align-items: center; gap: 36px; padding: 5vh 5vw; color: #f7f8ff; }
.board-home-brand { display: flex; align-items: center; gap: 18px; }
.board-home-mark { display: grid; place-items: center; width: 75px; height: 75px; border: 1px solid rgba(255,255,255,.22); border-radius: 23px; color: white; background: linear-gradient(145deg, #8274f5, #419ec1); font-size: 47px; font-weight: 950; box-shadow: 0 12px 40px rgba(77,107,218,.3); }
.board-home-brand p, .board-home-brand h1, .board-home-brand span { margin: 0; }
.board-home-brand p { color: #aeb9db; font-size: 11px; letter-spacing: .2em; }
.board-home-brand h1 { margin: 3px 0; color: #fff; font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; }
.board-home-brand span { color: #b9c3dd; font-size: 15px; }
.board-home-kicker { margin: 5px 0 -19px; color: #a9b5d8; font-size: 12px; font-weight: 850; letter-spacing: .23em; }
.board-home-menu { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 18px; width: min(1120px, 100%); }
.board-home-menu a { display: flex; min-height: 230px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; padding: 27px; border: 1px solid rgba(255,255,255,.14); border-radius: 24px; color: #fff; background: rgba(255,255,255,.065); text-decoration: none; box-shadow: 0 15px 45px rgba(0,0,0,.15); transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.board-home-menu a:hover, .board-home-menu a:focus-visible { transform: translateY(-5px); border-color: rgba(153,166,255,.55); background: rgba(255,255,255,.11); }
.board-home-menu a > span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; color: #d9d3ff; background: rgba(133,119,255,.2); font-size: 31px; }
.board-home-menu strong { font-size: clamp(19px, 2vw, 25px); }
.board-home-menu small { color: #b5bfd9; font-size: 13px; }
.board-home-menu .board-home-info { border-color: rgba(84,216,175,.28); background: linear-gradient(145deg, rgba(42,173,136,.18), rgba(255,255,255,.055)); }
.board-home-menu .board-home-info > span { color: #a5f1d5; background: rgba(49,193,146,.2); }
.board-home-hint { margin: -8px 0 0; color: #96a4c8; font-size: 12px; text-align: center; }

/* Full-screen information board */
body.board-info-screen { overflow: hidden; background: #05070c; }
.board-info-display { position: relative; width: 100vw; height: 100vh; overflow: hidden; background: #05070c; }
.board-home-button { position: absolute; z-index: 10000; top: 18px; right: 20px; display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; color: #fff; background: rgba(8,13,25,.72); backdrop-filter: blur(12px); font-size: 14px; font-weight: 800; text-decoration: none; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.board-home-button:hover { background: rgba(39,53,89,.9); }
.board-display-split { display: grid; width: 100%; height: 100%; grid-template-columns: 1fr 1fr; background: #05070c; }
.board-display-split > div { display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; border-right: 1px solid rgba(255,255,255,.13); }
.board-display-split > div:last-child { border-right: 0; }
.board-display-split img { display: block; width: 100%; height: 100%; object-fit: contain; }
.board-display-canvas { position: absolute; inset: 0; overflow: hidden; background: #05070c; }
.board-display-canvas img { position: absolute; display: block; object-fit: contain; }
.board-info-empty { display: flex; width: 100%; height: 100%; flex-direction: column; justify-content: center; align-items: center; color: #fff; text-align: center; }
.board-info-empty > span { color: #9f96ff; font-size: 54px; }
.board-info-empty h1 { margin: 12px 0 5px; font-size: clamp(35px, 5vw, 68px); }
.board-info-empty p { color: #b1b9cd; font-size: 18px; }

/* Photo board editor: a 16:9 slide with draggable and resizable images */
.board-admin-panel { overflow: hidden; }
.board-mode-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: 16px; margin-top: 20px; align-items: start; }
.board-mode-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-raised); }
.board-mode-card.is-selected { border-color: rgba(112,100,235,.62); box-shadow: 0 0 0 2px rgba(112,100,235,.09); }
.board-mode-title { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.board-mode-title h3 { margin: 0 0 3px; }
.board-mode-title p { margin: 0; }
.board-mode-number { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; color: #d6d1ff; background: rgba(125,111,238,.15); font-size: 14px; font-weight: 900; }
.board-split-preview { display: grid; grid-template-columns: 1fr 1fr; height: 150px; margin-bottom: 17px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #080b13; }
.board-split-preview > div { display: grid; place-items: center; overflow: hidden; border-right: 1px solid rgba(255,255,255,.15); color: #aeb7d0; font-size: 12px; }
.board-split-preview > div:last-child { border: 0; }
.board-split-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.board-upload-form { margin-top: 0; }
.board-editor-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.board-canvas-editor { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background-color: #0a0d17; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 5% 5%; touch-action: none; }
.board-editor-item { position: absolute; display: block; min-width: 5%; min-height: 5%; overflow: visible; border: 2px solid transparent; cursor: move; touch-action: none; user-select: none; }
.board-editor-item.is-selected { border-color: #8e84ff; box-shadow: 0 0 0 2px rgba(142,132,255,.24); }
.board-editor-item img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; background: rgba(0,0,0,.38); }
.board-editor-label { position: absolute; top: 3px; left: 3px; padding: 3px 6px; border-radius: 5px; color: #fff; background: rgba(0,0,0,.65); font-size: 10px; pointer-events: none; }
.board-resize-handle { position: absolute; right: -8px; bottom: -8px; width: 17px; height: 17px; padding: 0; border: 2px solid #fff; border-radius: 5px; background: #8176f4; cursor: nwse-resize; touch-action: none; }
.board-editor-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; color: #aab3ca; font-size: 13px; text-align: center; }
.board-image-management { display: grid; gap: 7px; margin: 12px 0; }
.board-image-delete { display: flex !important; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 11px !important; }
.board-image-delete span:last-child { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.board-image-delete input { width: auto; }
@media (max-width: 900px) { .board-mode-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .board-home-menu { grid-template-columns: 1fr; max-width: 560px; } .board-home-menu a { min-height: 145px; } .board-home { gap: 25px; } }
@media (max-width: 520px) { .board-home-brand { gap: 11px; } .board-home-mark { width: 57px; height: 57px; border-radius: 17px; font-size: 35px; } .board-home-menu a { padding: 19px; } .board-home-button { top: 10px; right: 10px; padding: 9px 12px; font-size: 12px; } }

.board-mode-select-form { margin: 0 0 13px; }


/* Four square entry points on the public home page */
.landing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(100%, 660px);
  max-width: 660px;
}
.landing-actions .portal-card {
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: clamp(17px, 3vw, 27px);
}
.portal-room-schedule { background: linear-gradient(135deg, #c35b14, #e88018 62%, #f4aa4d); }
.portal-rooms { background: linear-gradient(135deg, #d4c500, #f8e800 65%, #fff27a); color:#002860; }
.portal-rooms .portal-label,.portal-rooms .portal-arrow { color:#002860; }
@media (max-width: 700px) {
  .landing-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; width: 100%; max-width: 520px; }
  .landing-actions .portal-card { min-height: 0; aspect-ratio: 1 / 1; padding: 15px; border-radius: 18px; }
  .landing-actions .portal-label { max-width: 100%; font-size: clamp(16px, 4.2vw, 22px); overflow-wrap: anywhere; }
  .landing-actions .portal-arrow { right: 15px; bottom: 13px; font-size: 22px; }
}


/* Public room timetable selector and occupancy */
.room-picker-panel { margin-bottom: 20px; }
.room-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.room-picker-heading h2 { margin: 0; font-size: 18px; }
.room-picker-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.room-picker-item { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-raised); text-decoration: none; font-size: 13px; font-weight: 850; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.room-picker-item:hover { transform: translateY(-2px); border-color: var(--accent); }
.room-picker-item.selected { border-color: rgba(81,204,157,.65); color: #d8fff0; background: linear-gradient(135deg, #167c68, #23977b); }
.room-selected-heading { margin: 25px 0 13px; }
.room-selected-heading h2 { margin: 0; font-size: 27px; }
.room-selected-heading p { margin: 5px 0 0; }
.room-schedule-period-list { display: grid; gap: 12px; }
.room-schedule-period { margin: 0; }
.room-schedule-period-top { display: flex; align-items: center; gap: 13px; margin-bottom: 13px; }
.room-schedule-period-top h3 { margin: 0; font-size: 18px; }
.room-schedule-period-top p { margin: 4px 0 0; }
.room-schedule-entries { display: grid; gap: 8px; }
.room-schedule-entry { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); }
.room-schedule-entry strong { color: var(--ink); }
.room-schedule-class { color: var(--accent-2); font-weight: 850; }
.room-schedule-free { margin: 0; padding: 12px 14px; border-radius: 10px; color: #49cf9c; background: rgba(57,198,146,.09); font-size: 13px; font-weight: 800; }
.room-picker-hint { margin: 15px 2px; text-align: center; }
@media (max-width: 700px) { .room-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .room-picker-heading { align-items: flex-start; flex-direction: column; } }


/* Room directory administration */
.room-directory-add-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, .7fr) auto; gap: 10px; align-items: end; }
.room-directory-table { width: 100%; border-collapse: collapse; }
.room-directory-table th, .room-directory-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.room-directory-row-form { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0; }
.room-directory-row-form select, .room-directory-row-form input { min-width: 130px; width: auto; }
.room-directory-row-form button { white-space: nowrap; }
.room-directory-inactive { opacity: .58; }

@media (min-width: 701px) {
  .landing-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 660px); max-width: 660px; }
  .landing-actions .portal-card { aspect-ratio: 1 / 1; min-height: 0; }
}
@media (max-width: 760px) { .room-directory-add-form { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .room-picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Two school-level choices before the user enters a room list. */
.room-level-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: min(100%, 900px); margin: 20px auto; }
.room-level-card { position: relative; display: flex; min-height: 190px; flex-direction: column; justify-content: space-between; padding: 24px; border: 1px solid rgba(255,255,255,.15); border-radius: 20px; color: #fff; text-decoration: none; box-shadow: 0 18px 38px rgba(0,0,0,.16); transition: transform .18s ease, box-shadow .18s ease; }
.room-level-card:hover { transform: translateY(-4px); box-shadow: 0 24px 46px rgba(0,0,0,.22); }
.room-level-senior { background: linear-gradient(135deg, #17618f, #2586af); }
.room-level-primary { background: linear-gradient(135deg, #8b5ab0, #b77ac7); }
.room-level-card-title { max-width: 85%; font-size: clamp(21px, 3vw, 29px); font-weight: 900; line-height: 1.12; }
.room-level-card-count { color: rgba(255,255,255,.78); font-size: 13px; font-weight: 650; }
.room-level-card-arrow { position: absolute; right: 22px; bottom: 18px; font-size: 26px; }
.room-picker-back-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 14px; }
@media (max-width: 560px) { .room-level-grid { grid-template-columns: 1fr; gap: 11px; } .room-level-card { min-height: 130px; padding: 19px; } }

/* Global timetable mode switch */
.global-schedule-switch{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:12px auto 0;padding:9px 12px;width:fit-content;max-width:100%;border:1px solid var(--line-strong);border-radius:14px;background:var(--surface);color:var(--muted);font-size:13px}
.global-schedule-switch form{display:flex;gap:6px;flex-wrap:wrap}
.global-schedule-switch button{border:1px solid var(--line-strong);border-radius:9px;padding:8px 12px;background:transparent;color:var(--ink);font:inherit;font-weight:700;cursor:pointer}
.global-schedule-switch button.is-active{background:var(--accent);border-color:var(--accent);color:#fff}
.home-schedule-switch{margin:18px auto 0}

/* Shared admin navigation as tabs rather than a row of unrelated links */
.admin-tabbar{display:flex;gap:6px;align-items:center;overflow-x:auto;white-space:nowrap;padding:9px 16px;margin:0 auto 18px;max-width:1500px;border-bottom:1px solid var(--line-strong);scrollbar-width:thin}
.admin-tabbar a{display:inline-flex;align-items:center;justify-content:center;padding:10px 13px;border:1px solid transparent;border-radius:10px 10px 7px 7px;color:var(--muted);text-decoration:none;font-size:13px;font-weight:750;flex:0 0 auto}
.admin-tabbar a:hover{background:var(--surface);color:var(--ink)}
.admin-tabbar a.is-active{background:var(--surface);border-color:var(--line-strong);border-bottom-color:var(--accent);color:var(--ink);box-shadow:inset 0 -2px 0 var(--accent)}

/* Room inventory selector: two tabs, then all room buttons immediately */
.room-level-tabs{display:flex;gap:9px;margin:0 0 14px;flex-wrap:wrap}
.room-level-tab{display:flex;align-items:center;gap:12px;padding:12px 17px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);color:var(--ink);text-decoration:none;font-weight:750}
.room-level-tab strong{display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 7px;border-radius:8px;background:var(--surface-raised);font-size:13px}
.room-level-tab.is-active{border-color:var(--accent);background:rgba(139,124,255,.16);box-shadow:inset 0 0 0 1px var(--accent)}
.room-picker-grid-expanded{grid-template-columns:repeat(auto-fill,minmax(95px,1fr))}
.room-picker-grid-expanded .room-picker-item{min-height:55px;font-size:15px;font-weight:800}

/* Weekly room occupancy table, modelled on the NIKA week view */
.room-week-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:24px 0 13px}
.room-week-heading h2{margin:0;font-size:clamp(22px,3vw,30px)}
.room-week-navigation{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.room-week-navigation>span{font-weight:750;color:var(--muted);font-variant-numeric:tabular-nums}
.room-week-table-wrap{width:100%;overflow-x:auto;border:1px solid var(--line-strong);border-radius:14px;background:#fff;color:#15241c;box-shadow:var(--shadow,0 8px 24px rgba(0,0,0,.08))}
.room-week-table{width:100%;min-width:930px;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:13px}
.room-week-table th,.room-week-table td{border-right:1px solid #dbe7d8;border-bottom:1px solid #dbe7d8;padding:8px 7px;vertical-align:top}
.room-week-table thead th{background:#bfead5;color:#102d22;text-align:center;font-weight:850;height:58px}
.room-week-table thead th small{display:block;margin-top:4px;font-size:11px;font-weight:600;opacity:.78}
.room-week-table thead th.is-today{outline:2px solid #e74b3c;outline-offset:-2px}
.room-week-table .room-week-period-col{width:104px}
.room-week-table .room-week-period-cell{width:104px;background:#c7efdc;text-align:center;color:#143b2b;vertical-align:middle}
.room-week-period-cell strong,.room-week-period-cell small{display:block}
.room-week-period-cell strong{font-size:13px}
.room-week-period-cell small{margin-top:5px;color:#537363;font-size:10px;font-weight:600}
.room-week-table tbody tr:nth-child(odd) td{background:#f8f9ce}
.room-week-table tbody tr:nth-child(even) td{background:#e8f4c9}
.room-week-table td.is-no-school{background:#f0f2ef!important;color:#a4aaa4;text-align:center;vertical-align:middle}
.room-week-table td.is-holiday{background:#fff4c9!important;text-align:center;vertical-align:middle}
.room-week-table td.is-free{background:#edf6df!important;text-align:center;vertical-align:middle}
.room-week-lesson{padding:4px 3px 6px;margin:0 0 5px;border-bottom:1px solid rgba(44,87,55,.18);line-height:1.22;text-align:center}
.room-week-lesson:last-child{margin-bottom:0;border-bottom:0}
.room-week-lesson strong,.room-week-lesson span,.room-week-lesson small{display:block;overflow-wrap:anywhere}
.room-week-lesson strong{font-size:14px;color:#182a20}
.room-week-lesson span{margin-top:3px;font-size:12px;font-weight:800;color:#1d3829}
.room-week-lesson small{margin-top:3px;color:#607463;font-size:10px;font-style:italic}
.room-week-free{font-size:11px;color:#6b8d6e;font-weight:700}
.room-week-holiday{font-size:11px;color:#8e6e2b;font-weight:750}
.room-week-dash{color:#9aa39c}
.board-canvas-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}

@media(max-width:760px){
  .admin-tabbar{margin-inline:-8px;padding-inline:8px}
  .room-week-heading{align-items:flex-start}
  .room-week-navigation{width:100%;justify-content:space-between}
  .room-week-navigation .button{padding:8px 10px;font-size:12px}
  .room-level-tabs>*{flex:1 1 0;justify-content:center}
}

/* Final NIKA-like weekly timetable refinements */
.room-week-table thead th{font-size:15px}
.room-week-table .room-week-period-cell{background:#bdebd5}
.room-week-lesson strong{font-size:14px;font-weight:850}
.room-week-lesson small{font-size:10px;font-style:italic}
.room-week-lesson span{font-size:13px;font-weight:850}
.room-week-lesson .room-week-group{font-size:10px;font-style:normal}
.room-week-free{display:inline-block;min-height:8px}
.admin-global-schedule-switch{margin:0 auto 16px}


/* School branding and navigation */
.brand{display:inline-flex;align-items:center;gap:10px}
.school-crest{width:38px;height:38px;object-fit:contain;border-radius:50%;background:#fff}
.landing-title{display:flex;align-items:center;justify-content:center;gap:20px;text-align:left}
.landing-crest{width:clamp(70px,9vw,112px);height:clamp(70px,9vw,112px);object-fit:contain;border-radius:50%;background:#fff;box-shadow:0 8px 26px rgba(0,40,96,.14)}
:root[data-theme="light"] .topbar{background:rgba(255,255,255,.84);border-bottom:1px solid rgba(0,40,96,.10)}
.topbar .brand{color:var(--ink);text-decoration:none;font-weight:850}
.topbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.nav-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 13px;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;font-weight:750;text-decoration:none;cursor:pointer}
.nav-button:hover{border-color:var(--accent);background:var(--surface-raised)}
.publication-status{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin:7px auto 0;padding:7px 13px;color:var(--muted);font-size:15px;text-align:center}
.publication-status strong{color:var(--accent-dark);font-weight:800}
.room-category-group{margin:22px 0 26px}
.room-category-group h2{margin:0 0 12px;color:var(--ink);font-size:clamp(19px,2.4vw,25px)}
.room-category-group .room-picker-grid{padding:0}
.room-week-table td.is-unknown{background:#eef0f2!important;color:#777;text-align:center;vertical-align:middle}
:root[data-theme="dark"] .publication-status strong{color:#8de1c0}
@media(max-width:700px){.publication-status{font-size:13px}.landing-title{gap:12px}.landing-crest{width:70px;height:70px}.nav-button{padding:8px 9px;font-size:12px}}

:root[data-theme="light"] body { background: radial-gradient(ellipse at 12% 3%, rgba(40,168,72,.09), transparent 34rem), radial-gradient(ellipse at 91% 18%, rgba(96,192,200,.13), transparent 30rem), linear-gradient(145deg,var(--bg),var(--bg-soft)); }
:root[data-theme="light"] .landing-title h1 { background-image:linear-gradient(100deg,#002860 5%,#007b91 55%,#28a848 95%); }
:root[data-theme="light"] .portal-card { border-color:rgba(0,40,96,.16); box-shadow:0 16px 38px rgba(0,40,96,.16); }

/* Last published schedule timestamp on kiosk layouts */
.board-publication-status{position:fixed;top:12px;right:16px;z-index:1000;max-width:calc(100vw - 32px);padding:8px 13px;border:1px solid rgba(0,40,96,.18);border-radius:999px;background:rgba(255,255,255,.88);color:#002860;font-size:12px;font-weight:700;line-height:1.35;text-align:center;backdrop-filter:blur(12px);box-shadow:0 3px 18px rgba(0,40,96,.10)}
:root[data-theme="dark"] .board-publication-status{border-color:rgba(255,255,255,.18);background:rgba(15,22,38,.86);color:#e7eefc;box-shadow:0 3px 18px rgba(0,0,0,.22)}
@media(max-width:700px){.board-publication-status{top:8px;right:8px;font-size:10px;padding:6px 9px}}


/* Exact legacy palette for the third theme: restore the complete former dark design. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1e;
  --bg-soft: #111a2e;
  --surface: rgba(19, 29, 49, .88);
  --surface-solid: #141f35;
  --surface-raised: #1b2944;
  --line: rgba(157, 177, 216, .17);
  --line-strong: rgba(157, 177, 216, .3);
  --ink: #edf2ff;
  --ink-soft: #c3cde2;
  --muted: #8f9db8;
  --accent: #8b7cff;
  --accent-2: #43c6e8;
  --accent-dark: #7060eb;
  --green: #56d6a0;
  --red: #ff7385;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 12% 3%, rgba(107, 87, 255, .18), transparent 34rem),
    radial-gradient(ellipse at 91% 18%, rgba(30, 190, 216, .12), transparent 30rem),
    linear-gradient(145deg, var(--bg), var(--bg-soft));
  background-attachment: fixed;
}
:root[data-theme="dark"] .topbar {
  background: rgba(9, 15, 30, .45);
  border-bottom-color: var(--line);
}
:root[data-theme="dark"] .landing-title h1 {
  background-image: linear-gradient(100deg, #f3f0ff 12%, #a89aff 53%, #6dd8ec 95%);
}
:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .info-link-icon {
  background: linear-gradient(135deg, #8e78ff, #36bfdc);
}
:root[data-theme="dark"] .button.primary {
  background: linear-gradient(120deg, #7767f4, #419ddf);
  box-shadow: 0 8px 22px rgba(102, 91, 229, .23);
}
:root[data-theme="dark"] .portal-students {
  background: linear-gradient(135deg, #002860, #086b9b 68%, #3898b8);
}
:root[data-theme="dark"] .portal-teachers {
  background: linear-gradient(135deg, #167a42, #28a848 65%, #60c0c8);
}
:root[data-theme="dark"] .portal-info {
  background: linear-gradient(135deg, #bc7134, #d68b3c 60%, #e4a54e);
}
:root[data-theme="dark"] .entity-row:hover {
  border-color: rgba(139, 124, 255, .55);
  background: rgba(139, 124, 255, .08);
}
:root[data-theme="dark"] .class-initial {
  background: linear-gradient(135deg, #7567ed, #9b79e7);
}
:root[data-theme="dark"] .teacher-initial {
  background: linear-gradient(135deg, #168eaf, #4bb9b7);
}
:root[data-theme="dark"] .form-stack input:focus,
:root[data-theme="dark"] .form-stack select:focus,
:root[data-theme="dark"] .form-stack textarea:focus,
:root[data-theme="dark"] .panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, .13);
}
:root[data-theme="dark"] .empty-icon {
  color: var(--accent-2);
  background: rgba(67, 198, 232, .1);
}
:root[data-theme="dark"] .publication-status strong {
  color: #8de1c0;
}
:root[data-theme="dark"] .board-publication-status {
  border-color: rgba(255, 255, 255, .18);
  background: rgba(15, 22, 38, .86);
  color: #e7eefc;
  box-shadow: 0 3px 18px rgba(0, 0, 0, .22);
}

/* Final two-theme and home-page refinements */
:root[data-theme="dark"] .landing-title h1 { background-image: linear-gradient(100deg, #f3f0ff 12%, #a89aff 53%, #6dd8ec 95%); }
:root[data-theme="dark"] .portal-students { background: linear-gradient(135deg, #002860, #086b9b 68%, #3898b8); }
:root[data-theme="dark"] .portal-teachers { background: linear-gradient(135deg, #167a42, #28a848 65%, #60c0c8); }
:root[data-theme="dark"] .portal-info { background: linear-gradient(135deg, #bc7134, #d68b3c 60%, #e4a54e); }
.teacher-initial { color: transparent !important; font-size: 0 !important; }


/* Consistent weekly schedule matrices for class and teacher pages */
.public-week-navigation{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin:0 0 18px;padding:13px;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:var(--shadow)}
.public-week-navigation>a:first-child{justify-self:start}.public-week-navigation>a:last-child{justify-self:end}
.public-week-current{display:flex;flex-direction:column;align-items:center;gap:4px;text-align:center;color:var(--muted);font-size:11px}
.public-week-current strong{color:var(--ink);font-size:15px;font-weight:850;white-space:nowrap}.public-week-current span{color:var(--green);font-weight:800}
.public-week-table-wrap{width:100%;overflow-x:auto;border:1px solid var(--line-strong);border-radius:15px;background:#fff;color:#182033;box-shadow:var(--shadow)}
.public-week-table{width:100%;min-width:900px;border-collapse:separate;border-spacing:0;table-layout:fixed;background:#fff;color:#182033;font-size:12px}
.public-week-table th,.public-week-table td{padding:8px 7px;border-right:1px solid #dce2ed;border-bottom:1px solid #dce2ed;vertical-align:top;overflow-wrap:anywhere}
.public-week-table thead th{height:58px;text-align:center;font-size:13px;font-weight:850;color:#17243b;background:#e6e8ff}
.public-week-table thead th small{display:block;margin-top:4px;font-size:10px;font-weight:650;opacity:.75}
.public-week-table thead th:nth-child(2){background:#dceaff}.public-week-table thead th:nth-child(3){background:#dff4e7}.public-week-table thead th:nth-child(4){background:#fff2ca}.public-week-table thead th:nth-child(5){background:#ffe2d5}.public-week-table thead th:nth-child(6){background:#f1e1ff}.public-week-table thead th:nth-child(7){background:#d9f1f3}
.public-week-table thead th.is-today{outline:3px solid #e05252;outline-offset:-3px}
.public-week-period-heading,.public-week-period-cell{width:64px;text-align:center;vertical-align:middle!important;background:#eeeaff!important;color:#473c8f;font-weight:900}
.public-week-table tbody tr:nth-child(odd) td{background:#fbfcff}.public-week-table tbody tr:nth-child(even) td{background:#f4f7fd}
.public-week-table tbody td.is-holiday{background:#fff2d2!important;text-align:center;vertical-align:middle}
.public-week-table tbody td.is-empty{text-align:center;vertical-align:middle;color:#aab1bf}
.public-week-lesson{margin:0 0 6px;padding:6px 5px;border-radius:8px;border:1px solid rgba(99,87,173,.14);background:#f1efff;line-height:1.25;text-align:center}
.public-week-lesson:last-child{margin-bottom:0}.public-week-lesson strong,.public-week-lesson span,.public-week-lesson small{display:block;overflow-wrap:anywhere}
.public-week-subject{font-size:12px;font-weight:850;color:#30265f}.public-week-class{margin-top:4px;font-size:11px;font-weight:800;color:#205a91}
.public-week-teacher{margin-top:4px;font-size:10px;font-weight:700;color:#365e4a}.public-week-lesson small{margin-top:3px;font-size:9px;color:#667085}
.public-week-empty{font-size:14px;color:#b3bac6}.public-week-holiday{font-size:11px;font-weight:800;color:#94712c}
.public-week-lesson.is-cancelled{border-color:#e6aab3;background:#fff0f2}.public-week-cancelled{margin-bottom:4px;color:#b62946;font-size:9px;font-weight:900;text-transform:uppercase}
/* Names and class labels share the same solid purple, intentionally blank marker. */
.entity-initial,.entity-initial.class-initial,.entity-initial.teacher-initial{flex:0 0 39px;width:39px;height:39px;border-radius:11px;background:#7761c8!important;color:transparent!important;font-size:0!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.13)}
/* In room schedules the reading order is teacher -> subject -> class. */
.room-week-lesson{padding:4px 3px 5px;line-height:1.18;text-align:center}
.room-week-lesson .room-week-teacher{font-size:9px;font-style:normal;font-weight:600;color:#526b5d}
.room-week-lesson .room-week-subject{display:block;margin-top:2px;font-size:10px;font-weight:750;color:#1d3829}
.room-week-lesson .room-week-class{display:block;margin-top:2px;font-size:10px;font-weight:850;color:#182a20}
.room-week-lesson .room-week-group{font-size:9px}
@media(max-width:760px){
  .public-week-navigation{grid-template-columns:1fr 1fr}.public-week-current{grid-column:1/-1;grid-row:1;padding:3px 0 7px}.public-week-navigation>a:first-child{grid-row:2}.public-week-navigation>a:last-child{grid-row:2}.public-week-navigation .button{width:100%;padding:9px 7px;font-size:11px;white-space:normal}
}

/* Retired the global timetable-mode switch and the separate archive selector.
   Keep the school identity and latest publication together in the centre of the header. */
.topbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:16px;justify-content:initial}
.topbar-spacer{min-width:0}
.topbar-center{display:flex;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-align:center}
.topbar-center .brand{justify-content:center}
.topbar-publication-status{margin:0;padding:0;font-size:11px;line-height:1.35;gap:5px}
.topbar-publication-status span{color:var(--muted);font-weight:650}
.topbar-publication-status strong{color:var(--accent-dark);font-size:11px;font-weight:800}
.topbar-actions{justify-self:end;min-width:0}
.global-page-actions{display:grid;grid-template-columns:repeat(2,minmax(170px,220px));justify-content:center;gap:10px;width:fit-content;max-width:100%;margin:12px auto 0;padding:9px 12px;border:1px solid var(--line-strong);border-radius:14px;background:var(--surface);box-shadow:var(--shadow)}
.global-page-actions .nav-button{width:100%;min-height:42px;box-sizing:border-box;padding:9px 13px;text-align:center}
:root[data-theme="light"] .day-navigation-current em,
:root[data-theme="light"] .today-chip{color:#146344;background:rgba(55,205,146,.14);border-color:rgba(24,132,91,.25)}
:root[data-theme="dark"] .day-navigation-current em,
:root[data-theme="dark"] .today-chip{color:#c5ffe9;background:rgba(55,205,146,.16);border-color:rgba(55,205,146,.22)}
.room-search-toolbar{display:flex;align-items:center;justify-content:flex-start;margin:0 0 16px}
.room-search-toolbar .search-field{width:min(100%,520px);min-width:0}
.room-search-toolbar .search-field input{min-width:0}
.room-category-group[hidden],.room-period-card[hidden]{display:none!important}
@media(max-width:700px){
  .topbar{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px 14px}
  .topbar-spacer{display:none}
  .topbar-center{grid-column:1;grid-row:1;width:100%}
  .topbar-actions{grid-column:1;grid-row:2;justify-self:center;justify-content:center;width:100%;margin:0}
  .topbar-actions .nav-admin-link{display:none}
  .topbar-publication-status{font-size:10px}
  .topbar-publication-status strong{font-size:10px}
  .global-page-actions{grid-template-columns:repeat(2,minmax(0,1fr));width:calc(100% - 28px);box-sizing:border-box;padding:8px;margin:10px auto 0;gap:8px}
  .global-page-actions .nav-button{padding:9px 7px;font-size:12px}
}

/* Keep the same shared school header on the landing page and all regular pages.
   The landing page uses the administrator sign-in in the former theme-toggle position. */
.home-page .topbar-actions .home-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-sizing: border-box;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 7px 24px rgba(0,0,0,.08);
}
.home-page .topbar-actions .home-admin-link:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  color: var(--ink);
}
.home-page .container {
  min-height: calc(100vh - 190px);
}
/* Keep the today marker readable in light and dark themes. */
.day-navigation-current em,
.today-chip {
  color: #000 !important;
}
@media (max-width: 700px) {
  .home-page .topbar-actions .home-admin-link {
    display: inline-flex;
  }
  .home-page .container {
    min-height: calc(100svh - 190px);
  }
}


/* Header layout refinement: publication first, centred navigation directly below,
   with theme and administrator controls kept side-by-side. */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  justify-content: initial;
}
.topbar-spacer { min-width: 0; }
.topbar-center {
  display: flex;
  min-width: 0;
  width: min(100%, 470px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
}
.topbar-center .brand { justify-content: center; }
.topbar-publication-status {
  margin: 0;
  padding: 0;
  font-size: 11px;
  line-height: 1.35;
  gap: 5px;
}
.topbar-publication-status span { color: var(--muted); font-weight: 650; }
.topbar-publication-status strong { color: var(--accent-dark); font-size: 11px; font-weight: 800; }
.topbar-center > .global-page-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(155px, 190px));
  justify-content: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 9px auto 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.topbar-center > .global-page-actions .nav-button {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 9px 13px;
  text-align: center;
}
.topbar-actions {
  justify-self: end;
  align-self: center;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar-actions .nav-admin-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  box-sizing: border-box;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 7px 24px rgba(0,0,0,.08);
}
.topbar-actions .nav-admin-link:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  color: var(--ink);
}
.topbar-actions .theme-toggle { flex: 0 0 36px; width: 36px; height: 36px; }
@media (max-width: 700px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px 14px;
  }
  .topbar-spacer { display: none; }
  .topbar-center {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }
  .topbar-actions {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    align-self: center;
    justify-content: center;
    width: 100%;
    margin: 0;
  }
  .topbar-actions .nav-admin-link { display: inline-flex !important; }
  .topbar-publication-status { font-size: 10px; }
  .topbar-publication-status strong { font-size: 10px; }
  .topbar-center > .global-page-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 430px);
    box-sizing: border-box;
    margin: 8px auto 0;
    gap: 8px;
  }
  .topbar-center > .global-page-actions .nav-button {
    min-width: 0;
    padding: 9px 7px;
    font-size: 12px;
  }
}

/* Final reference header layout: centred school identity, publication line,
   centred navigation below it, and theme/admin actions on the right. */
.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  justify-content: initial;
  box-sizing: border-box;
  min-height: 192px;
  padding: 22px clamp(18px, 2vw, 34px) 20px;
  gap: 0;
}
.topbar-spacer { min-width: 0; }
.topbar-center {
  display: flex;
  width: min(100%, 560px);
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.topbar-center .brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -.025em;
  white-space: nowrap;
}
.topbar-center .school-crest {
  display: block;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  object-fit: contain;
}
.topbar-publication-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
}
.topbar-publication-status span { color: var(--muted); font-weight: 650; }
.topbar-publication-status strong {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 850;
}
.topbar-center > .global-page-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 16px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.topbar-center > .global-page-actions .nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  min-width: 132px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.topbar-center > .global-page-actions .nav-home-button {
  width: 176px;
  min-width: 176px;
}
.topbar-actions {
  position: absolute;
  top: 55.5%;
  right: clamp(18px, 2vw, 34px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 16px;
  min-width: 0;
  margin: 0;
  transform: translateY(-50%);
}
.topbar-actions .theme-toggle {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 40px;
  box-sizing: border-box;
  place-items: center;
  border-radius: 13px;
  font-size: 17px;
}
.topbar-actions .nav-admin-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  box-sizing: border-box;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 5px 18px rgba(0,0,0,.07);
}
.topbar-actions .nav-admin-link:hover {
  border-color: var(--accent);
  background: var(--surface-raised);
  color: var(--ink);
}
.topbar-actions .logout-form { margin: 0; }
.topbar-actions .logout-form .nav-button {
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 13px;
  font-size: 14px;
}
:root[data-theme="light"] .topbar {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(0,40,96,.10);
}
@media (max-width: 1000px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 18px 16px;
    gap: 12px;
  }
  .topbar-spacer { display: none; }
  .topbar-center {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    gap: 12px;
  }
  .topbar-actions {
    position: static;
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    justify-content: center;
    width: 100%;
    transform: none;
  }
  .topbar-center > .global-page-actions { gap: 10px; }
}
@media (max-width: 700px) {
  .topbar { padding: 15px 12px; gap: 10px; }
  .topbar-center { gap: 10px; }
  .topbar-center .brand { min-height: 42px; gap: 9px; font-size: 18px; }
  .topbar-center .school-crest { flex-basis: 42px; width: 42px; height: 42px; }
  .topbar-publication-status {
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    line-height: 1.3;
  }
  .topbar-publication-status strong { font-size: 12px; }
  .topbar-center > .global-page-actions {
    display: grid;
    grid-template-columns: minmax(0, 132px) minmax(0, 176px);
    width: min(100%, 326px);
    gap: 8px;
  }
  .topbar-center > .global-page-actions .nav-button,
  .topbar-center > .global-page-actions .nav-home-button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 13px;
  }
  .topbar-actions { gap: 10px; }
  .topbar-actions .theme-toggle { flex-basis: 40px; width: 40px; height: 38px; }
  .topbar-actions .nav-admin-link { min-height: 38px; padding: 8px 12px; font-size: 12px; }
}


/* Seven-day selector for free-room availability. */
.room-day-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: -8px 0 20px;
  padding: 3px 2px 9px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.room-day-selector .button {
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 42px;
  padding: 10px 13px;
}
.room-day-selector .button[aria-current="date"] { font-weight: 850; }
@media (max-width: 700px) {
  .room-day-selector { gap: 6px; margin-top: -5px; }
  .room-day-selector .button { min-width: 78px; min-height: 40px; padding: 9px 10px; font-size: 11px; }
}

/* On phones keep the theme control pinned to the top-right corner. The admin
   link stays in the normal action row so the two controls never collide. */
@media (max-width: 700px) {
  .topbar { position: relative; }
  .topbar-actions {
    position: static;
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
    width: 100%;
    justify-content: center;
    margin: 0;
    transform: none;
  }
  .topbar-actions .theme-toggle {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 5;
  }
  .home-page .topbar-center .brand { display: none; }
}


/* Class/teacher favorites: the colored square is an accessible star toggle. */
.entity-row-favorite {
  gap: 10px;
  padding: 8px 12px;
}
.entity-row-link {
  min-width: 0;
  min-height: 43px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}
.entity-favorite-toggle {
  flex: 0 0 39px;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  text-align: center;
  color: rgba(255,255,255,.96);
  text-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .14s ease, background .14s ease, color .14s ease;
}
.entity-favorite-toggle:hover { transform: scale(1.08); }
.entity-favorite-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.entity-favorite-toggle[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, #d79a25, #f0c24e) !important;
  text-shadow: 0 1px 2px rgba(90,55,0,.35);
}
.entity-row-favorite.is-favorite { border-color: rgba(215,154,37,.62); }
.entity-row-favorite[hidden] { display: none !important; }
.room-day-navigation .day-navigation-current { min-width: 120px; }
@media (max-width: 600px) {
  .room-day-navigation { gap: 8px; }
  .room-day-navigation > .button { min-width: 0; padding: 9px 7px; font-size: 11px; }
  .room-day-navigation .day-navigation-current { min-width: 92px; }
}


/* Favorite controls: highly visible star, clear control, and full-row navigation. */
.entity-toolbar { flex-wrap: wrap; }
.favorite-reset-button { flex: 0 0 auto; min-height: 42px; white-space: nowrap; }
.favorite-reset-button:disabled { opacity: .48; cursor: not-allowed; filter: saturate(.45); }
.entity-row-favorite { position: relative; min-height: 62px; gap: 0; padding: 0; overflow: hidden; }
.entity-row-favorite .entity-row-link { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; min-height: 0; box-sizing: border-box; padding: 8px 14px 8px 62px; display: flex; align-items: center; justify-content: space-between; }
.entity-row-favorite .entity-favorite-toggle { position: relative; z-index: 2; margin: 10px 0 10px 10px; flex: 0 0 42px; width: 42px; min-width: 42px; height: 42px; padding: 0; display: grid; place-items: center; appearance: none; -webkit-appearance: none; border: 2px solid rgba(255,255,255,.98); border-radius: 12px; background: linear-gradient(135deg, #5540b8, #8764df) !important; color: #ffe16b !important; -webkit-text-fill-color: #ffe16b !important; font-family: Arial, sans-serif; font-size: 27px !important; font-weight: 900; line-height: 1; text-align: center; text-shadow: 0 1px 3px rgba(20,10,55,.7); opacity: 1 !important; visibility: visible !important; box-shadow: 0 2px 8px rgba(38,20,92,.25), inset 0 0 0 1px rgba(255,255,255,.16); cursor: pointer; }
.entity-row-favorite .entity-favorite-toggle:hover { transform: scale(1.08); filter: brightness(1.12); }
.entity-row-favorite .entity-favorite-toggle[aria-pressed="true"] { background: linear-gradient(135deg, #c87908, #f0b82e) !important; border-color: #fff3c7; color: #fff !important; -webkit-text-fill-color: #fff !important; text-shadow: 0 1px 2px rgba(90,55,0,.5); box-shadow: 0 0 0 3px rgba(215,154,37,.28), 0 3px 10px rgba(126,78,0,.35); }
.entity-row-favorite.is-favorite { border-color: rgba(215,154,37,.85); background: rgba(215,154,37,.075); }
.entity-row-favorite .entity-row-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 12px; }
.entity-row-favorite .entity-favorite-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  .entity-toolbar { align-items: stretch; gap: 9px; }
  .entity-toolbar .search-field { flex: 1 1 100%; min-width: 0; }
  .favorite-reset-button { width: 100%; }
  .entity-row-favorite .entity-row-link { padding-left: 61px; padding-right: 12px; }
}

/* Final favorites appearance: purple tile stays purple; only the star changes color. */
.entity-row-favorite .entity-favorite-toggle,
.entity-row-favorite .entity-favorite-toggle[aria-pressed="false"] {
  background: linear-gradient(135deg, #5540b8, #8764df) !important;
  border: 2px solid rgba(255,255,255,.98) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  text-shadow: 0 1px 3px rgba(20,10,55,.7) !important;
  box-shadow: 0 2px 8px rgba(38,20,92,.25), inset 0 0 0 1px rgba(255,255,255,.16) !important;
}
.entity-row-favorite .entity-favorite-toggle[aria-pressed="true"] {
  background: linear-gradient(135deg, #5540b8, #8764df) !important;
  border: 2px solid rgba(255,255,255,.98) !important;
  color: #ffdf45 !important;
  -webkit-text-fill-color: #ffdf45 !important;
  text-shadow: 0 1px 3px rgba(20,10,55,.75) !important;
  box-shadow: 0 0 0 2px rgba(255,223,69,.42), 0 2px 8px rgba(38,20,92,.25), inset 0 0 0 1px rgba(255,255,255,.16) !important;
}

/* Keep search and its reset control side by side on desktop and mobile. */
.entity-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.entity-toolbar .search-field {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.favorite-reset-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 42px;
  padding: 9px 12px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .entity-toolbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .entity-toolbar .search-field {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }
  .favorite-reset-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px;
    font-size: 10px;
  }
}


/* Favorites v2: enforce the purple tile independently of theme styles. */
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle] {
  width: 42px !important; min-width: 42px !important; height: 42px !important; flex: 0 0 42px !important;
  display: grid !important; place-items: center !important; margin: 10px 0 10px 10px !important; padding: 0 !important;
  border: 2px solid rgba(255,255,255,.98) !important; border-radius: 12px !important;
  background: #6547c2 !important; background-image: none !important;
  font-family: Arial, sans-serif !important; font-size: 27px !important; font-weight: 900 !important;
  line-height: 1 !important; text-align: center !important; opacity: 1 !important; visibility: visible !important;
}
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle][aria-pressed="false"] {
  color: #fff !important; -webkit-text-fill-color: #fff !important;
}
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle][aria-pressed="true"] {
  background: #6547c2 !important; background-image: none !important; color: #ffdf45 !important; -webkit-text-fill-color: #ffdf45 !important;
}


/* Favorite reset action: purple button with white star and white label. */
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:hover,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:focus-visible,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:active {
  background: #6547c2 !important;
  background-image: none !important;
  border: 1px solid #5236ae !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 2px 7px rgba(60, 39, 130, .24) !important;
}
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button .favorite-reset-star,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button .favorite-reset-label {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:disabled {
  opacity: 1 !important;
  cursor: not-allowed !important;
  filter: none !important;
}
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:not(:disabled) {
  cursor: pointer;
}

/* Hard override for reset favorite control: keep the button purple in every state. */
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:hover,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:focus,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:focus-visible,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:active,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button:disabled {
  background: #6547c2 !important; background-color: #6547c2 !important; background-image: none !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  border: 1px solid #5236ae !important; opacity: 1 !important; filter: none !important;
  box-shadow: 0 2px 7px rgba(60,39,130,.24) !important;
}
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button .favorite-reset-star,
html body main.container .entity-panel .entity-toolbar > button.favorite-reset-button .favorite-reset-label {
  color: #fff !important; -webkit-text-fill-color: #fff !important;
}


/* Homepage-only admin entry: keep it at the bottom of the landing page. */
.home-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 18px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.home-admin-bottom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid #5236ae;
  border-radius: 12px;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #6547c2 !important;
  box-shadow: 0 2px 8px rgba(60, 39, 130, .22);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.home-admin-bottom:hover,
.home-admin-bottom:focus-visible {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #5639b3 !important;
  filter: brightness(1.04);
}

/* Mobile: reserve only the width the reset button needs and let search shrink. */
@media (max-width: 600px) {
  html body main.container .entity-panel .entity-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  html body main.container .entity-panel .entity-toolbar > .search-field {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 6px !important;
  }
  html body main.container .entity-panel .entity-toolbar > .search-field input {
    display: block !important;
    flex: 1 1 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    font-size: 11px !important;
  }
  html body main.container .entity-panel .entity-toolbar > .favorite-reset-button {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 40px !important;
    padding: 7px 8px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }
  html body main.container .entity-panel .entity-toolbar > .favorite-reset-button .favorite-reset-label,
  html body main.container .entity-panel .entity-toolbar > .favorite-reset-button .favorite-reset-star {
    white-space: nowrap !important;
  }
}


/* Mobile toolbar layout fix v3:
   use the same constrained two-column layout at every viewport width. This avoids
   overflow when Safari uses a wider layout viewport or the browser is zoomed. */
html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 44%) !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 16px !important;
  box-sizing: border-box !important;
}

html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field {
  display: flex !important;
  flex: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field input {
  display: block !important;
  flex: 1 1 0 !important;
  width: 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  justify-self: stretch !important;
  flex: none !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 7px 6px !important;
  box-sizing: border-box !important;
  border-radius: 11px !important;
  background: #6547c2 !important;
  background-color: #6547c2 !important;
  background-image: none !important;
  border: 1px solid #5236ae !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: clamp(8.5px, 1.15vw, 11px) !important;
  font-weight: 750 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: 0 2px 7px rgba(60,39,130,.24) !important;
}

html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-star,
html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-label {
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: inherit !important;
  line-height: inherit !important;
  white-space: nowrap !important;
}

html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-label {
  overflow: hidden !important;
  text-overflow: clip !important;
}

html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:disabled,
html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:hover,
html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus,
html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus-visible,
html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:active {
  background: #6547c2 !important;
  background-color: #6547c2 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Keep the reset action compact on narrow phones while preserving the full label. */
@media (max-width: 600px) {
  html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites {
    grid-template-columns: minmax(0, 1fr) minmax(0, 46%) !important;
    gap: 6px !important;
  }
  html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field {
    padding-left: 7px !important;
    padding-right: 7px !important;
    gap: 5px !important;
  }
  html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field input {
    font-size: 11px !important;
  }
  html body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button {
    padding-left: 4px !important;
    padding-right: 4px !important;
    font-size: 9px !important;
  }
}


/* Final compact toolbar override: the search shrinks and the reset button remains inside the panel. */
body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites { display:flex !important; flex-flow:row nowrap !important; align-items:center !important; gap:7px !important; width:100% !important; max-width:100% !important; min-width:0 !important; box-sizing:border-box !important; overflow:hidden !important; }
body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field { display:flex !important; flex:1 1 0% !important; width:0 !important; min-width:0 !important; max-width:none !important; margin:0 !important; padding-left:8px !important; padding-right:8px !important; box-sizing:border-box !important; overflow:hidden !important; }
body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field input { flex:1 1 0% !important; width:0 !important; min-width:0 !important; max-width:100% !important; box-sizing:border-box !important; }
body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button, body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:hover, body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus-visible, body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:active, body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:disabled { display:inline-flex !important; flex:0 1 42% !important; width:42% !important; min-width:0 !important; max-width:180px !important; min-height:40px !important; align-items:center !important; justify-content:center !important; gap:4px !important; margin:0 !important; padding:6px 5px !important; box-sizing:border-box !important; border:1px solid #5236ae !important; border-radius:11px !important; background:#6547c2 !important; background-color:#6547c2 !important; background-image:none !important; color:#fff !important; -webkit-text-fill-color:#fff !important; font-size:clamp(8px,2.6vw,10px) !important; font-weight:750 !important; line-height:1.12 !important; white-space:nowrap !important; overflow:hidden !important; opacity:1 !important; filter:none !important; }
body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-star { flex:0 0 auto !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
body main.container .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-label { flex:0 1 auto !important; min-width:0 !important; color:#fff !important; -webkit-text-fill-color:#fff !important; white-space:nowrap !important; overflow:hidden !important; }


/* FINAL toolbar fix v4: flex tracks shrink correctly instead of adding up to more than 100%. */
body .entity-panel .entity-toolbar.entity-toolbar-favorites { display:flex !important; flex-direction:row !important; flex-wrap:nowrap !important; align-items:center !important; justify-content:flex-start !important; gap:7px !important; width:100% !important; max-width:100% !important; min-width:0 !important; box-sizing:border-box !important; }
body .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field { display:flex !important; flex:1 1 0px !important; width:0 !important; min-width:0 !important; max-width:none !important; margin:0 !important; padding-left:8px !important; padding-right:8px !important; box-sizing:border-box !important; }
body .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field input { display:block !important; flex:1 1 0px !important; width:0 !important; min-width:0 !important; max-width:100% !important; box-sizing:border-box !important; }
body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button, body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:hover, body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus, body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus-visible, body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:active, body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:disabled { display:inline-flex !important; flex:0 1 42% !important; width:42% !important; min-width:0 !important; max-width:42% !important; min-height:40px !important; align-items:center !important; justify-content:center !important; gap:4px !important; margin:0 !important; padding:6px 4px !important; box-sizing:border-box !important; border:1px solid #5236ae !important; border-radius:11px !important; background:#6547c2 !important; background-color:#6547c2 !important; background-image:none !important; color:#fff !important; -webkit-text-fill-color:#fff !important; font-size:clamp(8px,2.6vw,10px) !important; font-weight:750 !important; line-height:1.12 !important; white-space:nowrap !important; overflow:hidden !important; opacity:1 !important; filter:none !important; }
body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-star { flex:0 0 auto !important; color:#fff !important; -webkit-text-fill-color:#fff !important; }
body .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-label { flex:0 1 auto !important; min-width:0 !important; color:#fff !important; -webkit-text-fill-color:#fff !important; white-space:nowrap !important; overflow:hidden !important; }


/* Favorites: duplicates appear in a pinned group while source entries stay in place. */
.favorite-pinned-section {
  padding: 14px 0 16px;
  margin: 0 0 2px;
  border-bottom: 1px solid var(--line);
}
.favorite-pinned-heading {
  margin: 0 0 9px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.favorite-pinned-section[hidden] { display: none !important; }
.favorite-pinned-list { padding-top: 0 !important; }

/* The tile stays purple; only the star turns yellow when pinned. */
.entity-row-favorite .entity-favorite-toggle[aria-pressed="false"] {
  background: #6547c2 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.entity-row-favorite .entity-favorite-toggle[aria-pressed="true"] {
  background: #6547c2 !important;
  color: #ffdf45 !important;
  -webkit-text-fill-color: #ffdf45 !important;
  border-color: #fff !important;
  box-shadow: 0 0 0 2px rgba(255,223,69,.42), 0 2px 8px rgba(38,20,92,.25) !important;
}

/* Long class/teacher names remain on a single line instead of wrapping. */
.entity-row-favorite .entity-row-link .entity-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}


/* Favorite star state: keep the tile purple and tint only the glyph. */
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle],
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle][aria-pressed="false"] {
  background: #6547c2 !important; background-color: #6547c2 !important; background-image: none !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
}
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle][aria-pressed="true"],
html body main.container .entity-panel .entity-list .entity-row.entity-row-favorite > button.entity-favorite-toggle[data-favorite-toggle][data-favorite-state="pinned"] {
  background: #6547c2 !important; background-color: #6547c2 !important; background-image: none !important;
  color: #ffdf45 !important; -webkit-text-fill-color: #ffdf45 !important;
}


/* Unified public class/teacher rows: large readable text and full-tile link target. */
.entity-row.entity-row-favorite {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  min-height: 82px !important;
  padding: 0 !important;
  overflow: hidden !important;
  cursor: pointer !important;
}
.entity-row.entity-row-favorite > .entity-row-link {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 82px !important;
  box-sizing: border-box !important;
  padding: 12px 22px 12px 82px !important;
  text-decoration: none !important;
}
.entity-row.entity-row-favorite > .entity-row-link .entity-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  color: var(--ink) !important;
  font-size: clamp(20px, 2.2vw, 25px) !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}
.entity-row.entity-row-favorite > .entity-row-link .entity-arrow {
  flex: 0 0 auto !important;
  margin-left: 16px !important;
  font-size: 25px !important;
}
.entity-row.entity-row-favorite > .entity-favorite-toggle {
  position: relative !important;
  z-index: 2 !important;
  flex: 0 0 50px !important;
  width: 50px !important;
  min-width: 50px !important;
  height: 50px !important;
  margin: 0 0 0 14px !important;
  cursor: pointer !important;
}
@media (max-width: 700px) {
  .entity-row.entity-row-favorite { min-height: 72px !important; }
  .entity-row.entity-row-favorite > .entity-row-link {
    min-height: 72px !important;
    padding: 9px 14px 9px 75px !important;
  }
  .entity-row.entity-row-favorite > .entity-row-link .entity-name { font-size: 20px !important; }
  .entity-row.entity-row-favorite > .entity-favorite-toggle {
    flex-basis: 46px !important; width: 46px !important; min-width: 46px !important;
    height: 46px !important; margin-left: 12px !important;
  }
}

/* Small administrator entry at the bottom of every normal page. */
.site-admin-entry {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 4px 16px max(20px, env(safe-area-inset-bottom)) !important;
  box-sizing: border-box !important;
}
.site-admin-entry a {
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  opacity: .82 !important;
}
.site-admin-entry a:hover { opacity: 1 !important; }
.favorite-pinned-heading { display: none !important; }

/* Keep the theme toggle at the top-right on phones, including the landing page. */
@media (max-width: 700px) {
  .topbar { position: relative !important; }
  .topbar-actions {
    position: static !important;
    display: block !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: stretch !important;
    width: 100% !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .topbar-actions .theme-toggle {
    position: absolute !important;
    top: 10px !important;
    right: 12px !important;
    z-index: 10 !important;
  }
  .home-page .topbar-center .brand { display: none !important; }
  .home-page .topbar-center .global-page-actions { display: none !important; }
}

/* One cancellation indication only: the badge replaces the duplicated subject label. */
.student-week-subject.is-cancelled { text-decoration: none !important; }
.student-week-subject.is-cancelled small {
  display: inline-block !important;
  padding: 5px 8px !important;
  border-radius: 7px !important;
  background: #d94b68 !important;
  color: #fff !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  text-decoration: none !important;
}


/* Full class/teacher tile activation and larger labels. */
.entity-row.entity-row-favorite[data-row-full-click="true"] {
  cursor: pointer !important;
  touch-action: manipulation;
  min-height: 98px !important;
}
.entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-row-link {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 98px !important;
  z-index: 1 !important;
  box-sizing: border-box !important;
  align-items: center !important;
  padding: 14px 22px 14px 88px !important;
  cursor: pointer !important;
}
.entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-row-link .entity-name {
  font-size: clamp(30px, 3vw, 38px) !important;
  line-height: 1.12 !important;
  font-weight: 850 !important;
}
.entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-row-link .entity-arrow {
  font-size: 30px !important;
  margin-left: 18px !important;
}
.entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-favorite-toggle {
  z-index: 3 !important;
  position: relative !important;
  flex: 0 0 54px !important;
  width: 54px !important;
  min-width: 54px !important;
  height: 54px !important;
  margin-left: 14px !important;
}
.entity-row.entity-row-favorite[data-row-full-click="true"]:active {
  transform: scale(.995);
}
@media (max-width: 700px) {
  .entity-row.entity-row-favorite[data-row-full-click="true"] {
    min-height: 90px !important;
  }
  .entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-row-link {
    min-height: 90px !important;
    padding: 12px 14px 12px 82px !important;
  }
  .entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-row-link .entity-name {
    font-size: 30px !important;
  }
  .entity-row.entity-row-favorite[data-row-full-click="true"] > .entity-favorite-toggle {
    flex-basis: 52px !important;
    width: 52px !important;
    min-width: 52px !important;
    height: 52px !important;
    margin-left: 12px !important;
  }
}


/* Baseline timetable readability, shared search width and aligned actions. */
.baseline-search-toolbar { display:flex; align-items:center; width:100%; margin:0 0 16px; }
.baseline-search-toolbar .search-field,
.room-search-toolbar .search-field { flex:0 0 50%; width:50%; max-width:50%; min-width:0; min-height:54px; box-sizing:border-box; }
.baseline-search-toolbar .search-field input,
.room-search-toolbar .search-field input { min-width:0; height:50px; font-size:19px; font-weight:650; }
.baseline-search-toolbar .search-field input::placeholder,
.room-search-toolbar .search-field input::placeholder { font-size:17px; }
.baseline-no-results { padding:18px 12px; font-size:17px; font-weight:750; }
.weekly-range-label.room-baseline-label { margin:0 0 15px; }
.day-navigation-right-actions { grid-column:3; display:flex; align-items:center; justify-self:end; justify-content:flex-end; gap:9px; min-width:0; }
.schedule-day-navigation .day-navigation-right-actions > .button { white-space:nowrap; }
.entity-panel .entity-toolbar.entity-toolbar-favorites { display:flex !important; flex-flow:row nowrap !important; align-items:center !important; justify-content:space-between !important; gap:14px !important; width:100% !important; min-width:0 !important; }
.entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field { flex:0 0 50% !important; width:50% !important; max-width:50% !important; min-width:0 !important; min-height:54px !important; box-sizing:border-box !important; }
.entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field input { min-width:0 !important; height:50px !important; font-size:18px !important; }
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button,
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:hover,
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus,
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus-visible,
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:active,
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:disabled {
  display:inline-flex !important; flex:0 0 auto !important; width:auto !important; max-width:none !important; min-width:0 !important; min-height:52px !important;
  align-items:center !important; justify-content:center !important; margin:0 !important; padding:12px 20px !important;
  border:0 !important; border-radius:12px !important; background:linear-gradient(120deg,#7767f4,#419ddf) !important; background-image:linear-gradient(120deg,#7767f4,#419ddf) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important; font-size:16px !important; font-weight:800 !important; line-height:1.2 !important; opacity:1 !important; filter:none !important; white-space:nowrap !important;
}
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:disabled { opacity:.72 !important; cursor:not-allowed !important; }
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-star,
.entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button .favorite-reset-label { color:#fff !important; -webkit-text-fill-color:#fff !important; font-size:inherit !important; }
.entity-favorite-toggle[data-favorite-toggle] { cursor:pointer; }
.entity-favorite-toggle[data-favorite-toggle]:hover { transform:scale(1.1); }

/* Make day-table content comfortably readable on desktop and laptop screens. */
.student-week-print-table th, .student-week-print-table td,
.teacher-week-table th, .teacher-week-table td,
.room-week-print-table th, .room-week-print-table td { font-size:16px; }
.student-week-print-table .student-week-period-col,
.student-week-print-table .student-week-period-cell,
.teacher-week-table .week-period-col, .teacher-week-table .week-period-cell,
.room-week-print-table .week-period-col, .room-week-print-table .week-period-cell { font-size:16px; }
.student-week-print-table .student-week-subject strong,
.teacher-week-table .week-print-lesson strong,
.room-week-print-table .week-print-lesson strong { font-size:18px; line-height:1.25; }
.student-week-print-table .baseline-lesson-meta,
.teacher-week-table .baseline-lesson-meta,
.room-week-print-table .baseline-lesson-meta { font-size:15px; line-height:1.3; font-weight:700; }

@media (max-width: 760px) {
  .day-navigation-right-actions { grid-column:2; grid-row:2; display:flex; flex-direction:column; align-items:stretch; width:100%; gap:7px; }
  .day-navigation-right-actions > .button { width:100%; box-sizing:border-box; text-align:center; white-space:normal !important; font-size:13px; padding:10px 7px; }
  .schedule-day-navigation > a:first-child { grid-column:1; grid-row:2; align-self:stretch; }
  .baseline-search-toolbar .search-field, .room-search-toolbar .search-field { flex-basis:50%; width:50%; max-width:50%; }
  .entity-panel .entity-toolbar.entity-toolbar-favorites { gap:8px !important; }
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .search-field { flex-basis:50% !important; width:50% !important; max-width:50% !important; }
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button,
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:hover,
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus,
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:focus-visible,
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:active,
  .entity-panel .entity-toolbar.entity-toolbar-favorites > .favorite-reset-button:disabled { padding:10px 9px !important; min-height:48px !important; font-size:13px !important; white-space:normal !important; }
  .student-week-print-table th, .student-week-print-table td,
  .teacher-week-table th, .teacher-week-table td,
  .room-week-print-table th, .room-week-print-table td { padding:6px 4px; }
}

/* Larger typography for the daily class, teacher and room timetable views. */
.day-panel-current .lesson-number { min-height:64px; }
.day-panel-current .lesson-number strong { font-size:20px; }
.day-panel-current .lesson-number span { font-size:13px; }
.day-panel-current .lesson-content { font-size:17px; line-height:1.45; }
.day-panel-current .lesson-item strong { font-size:18px; line-height:1.35; }
.day-panel-current .lesson-item .muted { font-size:15px; line-height:1.4; }
@media (max-width:760px) {
  .day-panel-current .lesson-number { flex-basis:76px; width:76px; }
  .day-panel-current .lesson-number strong { font-size:19px; }
  .day-panel-current .lesson-number span { font-size:12px; }
  .day-panel-current .lesson-item strong { font-size:17px; }
  .day-panel-current .lesson-item .muted { font-size:14px; }
}
