/* Shared theme control; the existing light palette remains the default. */
:root{color-scheme:light}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:9px;flex-shrink:0;order:3;padding:8px 10px;border:1px solid var(--line);border-radius:24px;background:#f7f8f3;color:#294458;font-size:11px;font-weight:600;line-height:1.4;min-height:44px;cursor:pointer}
.theme-toggle:hover{border-color:var(--green)}
.theme-toggle-track{display:block;position:relative;width:42px;height:24px;border:1px solid #b5c6bc;border-radius:20px;background:#dce6dd;flex-shrink:0}
.theme-toggle-thumb{display:grid;place-items:center;position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;color:#446450;box-shadow:0 1px 3px #17385f25;transition:transform .18s ease}
.theme-toggle-thumb svg{width:14px;height:14px;grid-area:1/1}
.theme-icon-moon{display:none}
.theme-toggle[aria-checked=true] .theme-toggle-thumb{transform:translateX(17px);background:#d1e7d4;color:#1b3b31}
.theme-toggle[aria-checked=true] .theme-toggle-track{background:#355e4d;border-color:#78a58b}
.theme-toggle[aria-checked=true] .theme-icon-sun{display:none}
.theme-toggle[aria-checked=true] .theme-icon-moon{display:block}
header>.brand{order:0}header>nav{order:1}header>.menu{order:4}
@media(max-width:1200px){header{gap:12px}.theme-toggle-label{display:none}.theme-toggle{padding:7px 8px}}
@media(min-width:951px) and (max-width:1120px){header>.menu{display:block;margin-left:0;background:transparent;color:var(--ink);border:1px solid var(--line);padding:8px 15px;border-radius:4px}header>nav{display:none;position:absolute;left:0;right:0;top:100%;background:#fff;padding:15px 5% 25px;border-bottom:1px solid var(--line);font-size:15px;box-shadow:0 15px 20px #17385f12}header>nav.open{display:grid;grid-template-columns:1fr 1fr}.theme-toggle{margin-left:auto}}
@media(max-width:950px){.theme-toggle{margin-left:auto}header>.menu{margin-left:0}}
@media(prefers-reduced-motion:reduce){.theme-toggle-thumb{transition:none}}
@media print{.theme-toggle{display:none!important}}

/* Kallfü Mapu at night: slate blues, muted forest greens and warm readable text. */
html[data-theme=dark]{color-scheme:dark;--blue:#a9c9f0;--deep:#d1e1f4;--green:#9cc7ac;--gold:#d6cd97;--cream:#111c23;--ink:#e4ebe8;--muted:#adbfbd;--line:#34484d;--night-surface:#192932;--night-raised:#20343c;--night-tint:#21362f;--night-action:#315d8c;--night-action-hover:#3b6b9b;--night-focus:#d9cc8a}
html[data-theme=dark] body{background:var(--cream);color:var(--ink)}
html[data-theme=dark] :is(header,header>nav){background:#14212b;border-color:var(--line)}
html[data-theme=dark] .topbar{background:#162f48;color:#dce7ed}
html[data-theme=dark] .theme-toggle{background:#1e3139;color:#dce7e1;border-color:#42594f}
html[data-theme=dark] .menu{background:#192c35;color:var(--ink)}
html[data-theme=dark] :is(.skip,.resource-links>a,.resource-card,.news-card,.featured-story-lead,.featured-story-small,.school-story-card,.page-sidebar,.intranet-panel,.regulation-item,.document-link,.meeting-card,.school-supply-card,.temario-course-card,.school-schedule-catalog .schedule-course-card,.native-embed .profile-card,.native-embed .feature-card,.native-embed .sello-card,.native-embed .hito-card,.native-embed .meeting-card,.native-embed .temario-card,.simce-notice .simce-day,.contact-channels .contact-channel-card){background:var(--night-surface);border-color:var(--line)}
html[data-theme=dark] :is(.resource-card,.native-embed .feature-card,.native-embed .sello-card,.native-embed .hito-card,.native-embed .temario-card,.temario-course-card,.simce-notice .simce-day,.contact-channels .contact-channel-card){border-top-color:#6e9f84}
html[data-theme=dark] .contact-channels .contact-channel-direction{border-top-color:#7ba5d1}
html[data-theme=dark] :is(.community,.people-search,.native-embed .highlight-box,.native-embed .article-subtitle-quote,.native-embed .temario-note,.simce-notice .simce-guidance,.art-contest-dates,.art-contest-closing,.school-supply-card-art,.contact-channels .contact-writing-guide){background:var(--night-tint);border-color:#38564b}
html[data-theme=dark] :is(.featured-lead-image,.featured-small-image,.school-story-card>img,.school-story-card>a>img){background:#203039;border-color:var(--line)}
html[data-theme=dark] .news-card.news-image--contain>img{background:#203039}
html[data-theme=dark] .news-card img[src="/assets/concurso-arte-kallfu-mongen.png"],html[data-theme=dark] .news-card img[src="/assets/simce-6-2026.svg"]{background:#203039}
html[data-theme=dark] .featured-story-next{border-color:#628775}
html[data-theme=dark] .featured-story-rank{background:#2a3e49;color:#e6ece9;box-shadow:0 3px 9px #0004}
html[data-theme=dark] .featured-story-next .featured-story-rank,html[data-theme=dark] .featured-latest{background:#315945;color:#e5f0e5}
html[data-theme=dark] .featured-latest>span{color:#ded59a}
html[data-theme=dark] .resource-links>a .section-link-icon,html[data-theme=dark] .native-embed .hito-card .calendar-activity-icon{background:#233a33;border-color:#3d5a4b;color:#b8d3e9}
html[data-theme=dark] .resource-links>a:hover .section-link-icon{background:#2a453b;border-color:#6d937c}
html[data-theme=dark] :is(.section-link-icon,.calendar-activity-icon) svg [fill="#e2eee4"]{fill:#345143}
html[data-theme=dark] :is(.section-link-icon,.calendar-activity-icon) svg [fill="#f7f6ee"]{fill:#223a36}
html[data-theme=dark] .resource-links>a:hover,html[data-theme=dark] .page-sidebar a:hover,html[data-theme=dark] .page-sidebar a[aria-current=page]{background:#23392f;color:#c0dfc8}
html[data-theme=dark] .resource-card .number{color:#9db5a3}
html[data-theme=dark] .info-strip{background:#1c364d;color:#e2eaf0}
html[data-theme=dark] .info-item small{color:#b3c8d5}
html[data-theme=dark] .info-item{border-color:#4e657140}
html[data-theme=dark] .photo-note{background:#1d3c56;color:#e5eced;border:1px solid #395c72}
html[data-theme=dark] .photo-note small{color:#bbcfdb}
html[data-theme=dark] .quote{background:#182e42}
html[data-theme=dark] .quote h2{color:#dedbbd}
html[data-theme=dark] footer{background:#101f2c;color:#dce5e9;border-top:1px solid #2b414e}
html[data-theme=dark] .footer-top p{color:#b0c2cf}
html[data-theme=dark] .footer-top a{color:#d6e5ef}
html[data-theme=dark] .footer-bottom{color:#a9becb;border-color:#344852}
html[data-theme=dark] .school-bulletin{background:#1a3045;color:#e4edf3;border-color:#3c5262}
html[data-theme=dark] :is(a,button,summary,input):focus-visible{outline-color:var(--night-focus)}
html[data-theme=dark] .text-link{border-color:#819e9f}
html[data-theme=dark] :is(.button,.migrated-content a.button,.school-schedule-catalog .schedule-course-action a.button,.migrated-content .school-schedule-catalog .schedule-course-action a.button,.meeting-presentations .meeting-card-action){background:var(--night-action);color:#fff;border-color:#567c9f;text-decoration:none}
html[data-theme=dark] :is(.button:hover,.migrated-content a.button:hover,.school-schedule-catalog .schedule-course-action a.button:hover,.migrated-content .school-schedule-catalog .schedule-course-action a.button:hover,.meeting-presentations .meeting-card-action:hover){background:var(--night-action-hover);color:#fff}
html[data-theme=dark] .document-link:hover{background:#284039;color:#c0decf}
html[data-theme=dark] :is(input,select,textarea,.people-search input){background:#13232c;color:var(--ink);border-color:#59716d;caret-color:#d8e9db}
html[data-theme=dark] input::placeholder{color:#9aafad}
html[data-theme=dark] .migrated-content table,html[data-theme=dark] .simce-notice table,html[data-theme=dark] .art-contest-table table{background:#192a33;color:var(--ink)}
html[data-theme=dark] .migrated-content :is(th,td){border-color:#40545a}
html[data-theme=dark] .migrated-content th{background:#23415b;color:#e7eef2}
html[data-theme=dark] .migrated-content tr:nth-child(even){background:#20343d}
html[data-theme=dark] .simce-notice th[scope=row],html[data-theme=dark] .art-contest-table th[scope=row]{background:#253b3e;color:#dfeae3}
html[data-theme=dark] .migrated-content .recreo td,html[data-theme=dark] .migrated-content .porcentaje-badge{background:#294337;color:#c5ddc7}
html[data-theme=dark] .native-embed .card-month{background:#23415b;color:#e5edf3}
html[data-theme=dark] .temarios-jump a{background:var(--night-surface);color:var(--blue);border-color:var(--line)}
html[data-theme=dark] .temarios-jump a:hover{background:var(--night-raised);border-color:#6e9f84}
html[data-theme=dark] .school-schedule-catalog .schedule-course-action{border-color:var(--line)}
html[data-theme=dark] .meeting-card-visual{background:#263b34;border-color:#40584b}
html[data-theme=dark] .meeting-card:nth-child(even) .meeting-card-visual{background:#24384b;border-color:#40576c}
html[data-theme=dark] .careers-card{background:#1a2b32;border-color:var(--line)}
html[data-theme=dark] .careers-art{background:#253b33}
html[data-theme=dark] .careers-note{border-color:#405a4b}
html[data-theme=dark] .careers-orbit{border-color:#6b947350}
html[data-theme=dark] .careers-spark{color:#d6cd97}
html[data-theme=dark] .careers-art p{color:#d1e1dc}
html[data-theme=dark] .contact-channels .contact-notice{background:#393426;border-color:#6d6040;border-left-color:#c7b776}
html[data-theme=dark] .contact-channels .contact-notice-label{color:#dfcf8f}
html[data-theme=dark] .contact-channels .contact-notice h2{color:#ece0b3}
html[data-theme=dark] .contact-channels .contact-notice p{color:#d1c8aa}
html[data-theme=dark] .contact-channels .contact-card-note{background:#2b4036;color:#c0d7c5!important}
html[data-theme=dark] .contact-channels .contact-writing-guide ol{color:#bfd0c4}
html[data-theme=dark] .school-carousel{--carousel-ink:#d5e4eb}
html[data-theme=dark] .school-carousel-intro{color:var(--muted)}
html[data-theme=dark] .school-carousel-count{color:#abc1c7}
html[data-theme=dark] .school-carousel-footer{border-color:var(--line)}
html[data-theme=dark] .school-carousel-photo{border-color:#344954;background:#253841;box-shadow:0 12px 30px #0005}
html[data-theme=dark] .school-carousel-photo[data-carousel-position="0"]{box-shadow:0 18px 38px #0006}
html[data-theme=dark] .school-carousel-controls button{border-color:#63808b}
html[data-theme=dark] .school-carousel-controls button:hover{background:#315269;color:#fff}
html[data-theme=dark] dialog{background:#1b2d36;color:var(--ink);border:1px solid #49616b;box-shadow:0 20px 80px #0007}
html[data-theme=dark] dialog::backdrop{background:#050c12de}
html[data-theme=dark] .dialog-bar{color:#d0e0ed}
html[data-theme=dark] dialog button{background:#315d8c;color:#fff}
/* Photography, posters, PDFs and illustrated course boards retain their original colors. */
@media(max-width:420px){header{gap:8px}.brand img{width:40px;height:44px}.brand strong{font-size:21px}.brand small{font-size:6.5px;letter-spacing:1.4px}.theme-toggle{padding:3px;min-height:40px}header>.menu{font-size:0;padding:8px 11px}header>.menu span{font-size:18px;line-height:1.2}}
html[data-theme=dark] .gallery{background:#15252e}
html[data-theme=dark] :is(.featured-story-lead,.featured-story-small,.school-story-card,.school-supply-card,.meeting-card){box-shadow:0 8px 24px #0002}

html[data-theme="dark"] .hero-photo-frame{border-color:#38515b;background:#38515b;box-shadow:0 0 0 1px #56716e,0 14px 32px #0003}
