/* 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)}

/* career / chart pages (TPO, Internship, Training & Career, ...) */
html[data-theme=dark] .exp-stats>div{background:#16222f;border-left-color:#7fb0e0}
html[data-theme=dark] .exp-stats strong,html[data-theme=dark] .exp-section h2,html[data-theme=dark] .visual-intro h2,html[data-theme=dark] .chart-heading h3,html[data-theme=dark] .bar-measure b,html[data-theme=dark] .donut-legend strong,html[data-theme=dark] .community-timeline strong,html[data-theme=dark] .tc-list,html[data-theme=dark] .chart-calculations summary{color:#e6eef6}
html[data-theme=dark] .exp-stats span,html[data-theme=dark] .exp-note,html[data-theme=dark] .chart-heading>p,html[data-theme=dark] .chart-legend>span,html[data-theme=dark] .chart-note,html[data-theme=dark] .chart-source,html[data-theme=dark] .visual-intro>p:last-child,html[data-theme=dark] .donut-legend li,html[data-theme=dark] .records-empty,html[data-theme=dark] .records-controls span,html[data-theme=dark] .tc-hint,html[data-theme=dark] .student-art figcaption,html[data-theme=dark] .newsletter-grid p{color:#a9b8c7}
html[data-theme=dark] .exp-note{background:#16222f;border-left-color:#4c7ca9}
html[data-theme=dark] .exp-section,html[data-theme=dark] .visual-overview{border-bottom-color:#2a3c4e}
html[data-theme=dark] .exp-eyebrow,html[data-theme=dark] .community-timeline time{color:#7fb0e0}
html[data-theme=dark] .exp-hero .exp-eyebrow{color:#a4c0da}
html[data-theme=dark] .exp-jump a{background:#1b2d3e;color:#e6eef6}
html[data-theme=dark] .chart-card,html[data-theme=dark] .chart-calculations,html[data-theme=dark] .student-art,html[data-theme=dark] .newsletter-grid article{background:#16222f;border-color:#2a3c4e;box-shadow:none}
html[data-theme=dark] .bar-row{border-bottom-color:#22364a}
html[data-theme=dark] .bar-row>strong{color:#c8d6e4}
html[data-theme=dark] .bar-track{background:#22364a}
html[data-theme=dark] .bar-missing,html[data-theme=dark] .bar-axis,html[data-theme=dark] .community-timeline small{color:#8fa3b6}
html[data-theme=dark] .chart-note{border-top-color:#2a3c4e}
html[data-theme=dark] .donut-total{fill:#e6eef6}
html[data-theme=dark] .donut-unit{fill:#a9b8c7}
html[data-theme=dark] .community-timeline{border-left-color:#2a3c4e}
html[data-theme=dark] .timeline-dot{border-color:#16222f}
html[data-theme=dark] .records-scroll{border-color:#2a3c4e}
html[data-theme=dark] .records-scroll th{background:#1b2d3e;color:#e6eef6}
html[data-theme=dark] .records-scroll td,html[data-theme=dark] .tc-table tbody th[scope=row]{border-top-color:#2a3c4e}
html[data-theme=dark] .records-scroll tbody tr:nth-child(even){background:#131f2b}
html[data-theme=dark] .tc-table caption{background:#1b2d3e;color:#e6eef6;border-bottom-color:#2a3c4e}
html[data-theme=dark] .tc-table th[scope=row]{color:#e6eef6}
html[data-theme=dark] .tc-table tfoot th,html[data-theme=dark] .tc-table tfoot td,html[data-theme=dark] .tc-table tfoot th[scope=row]{background:#1b2d3e;color:#e6eef6;border-top-color:#7fb0e0}
html[data-theme=dark] .tc-badge{background:#4a3410;color:#fde7b0}
html[data-theme=dark] .exp-columns article,html[data-theme=dark] .achievement-feature>img,html[data-theme=dark] .newsletter-grid img{background:#16222f}
