/* iPhone-style theme switch */
.theme-switch{position:relative;flex:none;width:52px;height:28px;border-radius:999px;border:0;padding:0;cursor:pointer;background:#9fb3c8;transition:background .3s;box-shadow:inset 0 1px 3px rgba(0,0,0,.25)}
.theme-switch:focus-visible{outline:2px solid #fff;outline-offset:2px}
.theme-knob{position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.35);display:grid;place-items:center;transition:transform .3s cubic-bezier(.3,1.4,.5,1)}
.theme-knob .material-symbols-outlined{grid-area:1/1;font-size:16px;transition:opacity .25s,transform .35s}
.theme-sun{color:#f59e0b}
.theme-moon{color:#3b5b8a;opacity:0;transform:rotate(-90deg) scale(.5)}
html[data-theme=dark] .theme-switch{background:#34c759}
html[data-theme=dark] .theme-knob{transform:translateX(24px)}
html[data-theme=dark] .theme-sun{opacity:0;transform:rotate(90deg) scale(.5)}
html[data-theme=dark] .theme-moon{opacity:1;transform:none}

/* Dark theme */
html[data-theme=dark]{color-scheme:dark}
html[data-theme=dark] body,html[data-theme=dark] .bg-surface{background-color:#0f1923}
html[data-theme=dark] .bg-surface\/95{background-color:rgba(15,25,35,.95)}
html[data-theme=dark] .bg-surface-slate,html[data-theme=dark] .bg-surface-container-low{background-color:#14212e}
html[data-theme=dark] .bg-surface-container,html[data-theme=dark] .group-hover\:bg-surface-container:hover,html[data-theme=dark] .hover\:bg-surface-container-low:hover{background-color:#1b2d3e}
html[data-theme=dark] .bg-surface-container-high{background-color:#233a50}
html[data-theme=dark] .bg-surface-container-lowest{background-color:#16222f}
html[data-theme=dark] .bg-primary-container{background-color:#0b141d}
html[data-theme=dark] .text-on-surface{color:#e6eef6}
html[data-theme=dark] .text-on-surface-variant,html[data-theme=dark] .bg-on-surface-variant{color:#a9b8c7}
html[data-theme=dark] .text-secondary,html[data-theme=dark] .text-tech-blue,html[data-theme=dark] .text-primary-container{color:#7fb0e0}
html[data-theme=dark] .border-border-slate{border-color:#2a3c4e}
html[data-theme=dark] .hover\:text-on-surface:hover{color:#fff}
html[data-theme=dark] .shadow-sm,html[data-theme=dark] .shadow-md,html[data-theme=dark] .shadow-lg{--tw-shadow-color:rgba(0,0,0,.5)}

/* hand-written components */
html[data-theme=dark] .student-links p,html[data-theme=dark] [class*=muted],html[data-theme=dark] small{color:#a9b8c7}
html[data-theme=dark] .quick-link-grid a,html[data-theme=dark] .card,html[data-theme=dark] .tool-card,html[data-theme=dark] .notice-tools,html[data-theme=dark] dialog{background:#16222f;color:#e6eef6;border-color:#2a3c4e}
html[data-theme=dark] .quick-link-grid a:hover{background:#1f3347}
html[data-theme=dark] .student-links h2,html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] h4{color:#e6eef6}
html[data-theme=dark] header h1,html[data-theme=dark] .bg-primary-container h1,html[data-theme=dark] .bg-primary-container h2,html[data-theme=dark] .bg-primary-container h3{color:inherit}
html[data-theme=dark] table{color:#e6eef6}
html[data-theme=dark] th{background:#1b2d3e;color:#e6eef6}
html[data-theme=dark] td{border-color:#2a3c4e}
html[data-theme=dark] tbody tr:nth-child(even){background:#131f2b}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0f1923;color:#e6eef6;border-color:#38506a}
html[data-theme=dark] .opportunity-nav{background:#14212e}
html[data-theme=dark] .opportunity-nav a{background:#1b2d3e;color:#e6eef6}
html[data-theme=dark] img:not([src$=".svg"]){filter:brightness(.9)}
