/* School-inspired visual layer. Layout/registration behavior remains in app.css/app.js. */
:root {
    color-scheme: light;
    --blue: #1f6fd1; --blue-dark: #1557a8; --text: #1b293d; --muted: #586b82;
    --bg: #edf4fc; --surface: #ffffff; --glass: rgb(255 255 255 / .78);
    --soft: #f3f7fd; --hover: #eaf2fc; --border: #d4e1f0; --heading: #1a56a8;
    --shadow: 0 12px 38px rgb(31 74 126 / .07); --focus: #4a8be2;
    --good: #16643b; --good-bg: #e8f6ee; --good-border: #abd4be;
    --bad: #a42736; --bad-bg: #fff0f1; --bad-border: #e6b4bd;
    --danger-button-hover: #f9e1e5;
    --warn: #79560b; --warn-bg: #fff7df; --warn-border: #e4d09a;
    --row-red: var(--bad-bg); --row-green: var(--good-bg);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --blue: #76afff; --blue-dark: #a1c8ff; --text: #e0e9f5; --muted: #a4b5ca;
    --bg: #0c1525; --surface: #152237; --glass: rgb(21 34 55 / .92);
    --soft: #1a2b44; --hover: #213955; --border: #324660; --heading: #9cc5ff;
    --shadow: 0 12px 38px rgb(0 0 0 / .2); --focus: #9bc5ff;
    --good: #91dfb2; --good-bg: #133b30; --good-border: #306653;
    --bad: #ffacb5; --bad-bg: #422631; --bad-border: #78444f;
    --danger-button-hover: #542f3c;
    --warn: #f1cf81; --warn-bg: #3b3321; --warn-border: #75613b;
}
body { background: radial-gradient(ellipse at 20% 0%, #b5d5f5 0, transparent 55%), var(--bg); background-attachment: fixed; color: var(--text); padding-top: 78px; }
[data-theme="dark"] body { background: radial-gradient(ellipse at 20% 0%, #19355b 0, transparent 55%), var(--bg); }
button, input, select, textarea { accent-color: var(--blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button { transition: background-color .15s, box-shadow .15s; }
button:disabled { cursor: not-allowed; }
.top-header { height: 78px; min-height: 78px; padding: 12px 30px; background: var(--glass); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); box-shadow: 0 2px 20px rgb(20 60 110 / .04); gap: 16px; }
.header-brand-block { gap: 4px; min-width: 0; }
.header-brand-block .brand { display: flex; align-items: center; gap: 10px; font-size: 23px; letter-spacing: -.7px; color: var(--heading); }
.brand-mark, .login-emblem { display: inline-grid; place-items: center; background: linear-gradient(145deg,#287edf,#1557a8); color: white; font-weight: 800; box-shadow: 0 6px 18px #1557a826; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 20px; }
.header-brand-block .brand-subtitle { color: var(--muted); margin-left: 42px; font-size: 11px; }
.header-tools { display: flex; align-items: center; gap: 20px; margin-left: auto; min-width: 0; }
.theme-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 24px; min-height: 40px; padding: 8px 14px; flex-shrink: 0; font-weight: 600; transition: none; }
.theme-toggle:hover { background: var(--hover); }
.theme-moon { display: none; } [data-theme="dark"] .theme-sun { display: none; } [data-theme="dark"] .theme-moon { display: block; }
.header-session-actions .student-info { background: transparent; border: 0; color: var(--text); padding: 0; }
.student-info span, .header-session-actions .student-info span { color: var(--muted); }
.account-row { gap: 14px; flex-wrap: nowrap; }
.otp-gear { width: 42px; height: 42px; padding: 0; background: var(--surface); color: var(--heading); border-color: var(--border); border-radius: 12px; }
.account-menu { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.account-menu button { background: var(--surface); color: var(--heading); }
.account-menu button:hover,.account-menu button:focus-visible { background: var(--hover); }
.account-menu .account-logout { color: var(--bad); border-color: var(--border); }
.account-menu .account-logout:hover { background: var(--bad-bg); }
.panel { border-radius: 20px; border: 1px solid var(--border); background: var(--glass); box-shadow: var(--shadow); }
h2,h3,.main-heading,.setting-title,.activity-card-title,.log-toolbar-title,.log-course,.history-entry-head { color: var(--text); }
.semester-name { color: var(--heading); }
.description,.result-info,.empty-table-message,.log-empty,.activity-card-subtitle,.history-time-row,.history-entry-head > span,.result-modal-subtitle,.otp-small-note,.otp-eyebrow,.log-time,.run-fixed-note { color: var(--muted); }
.login-panel { width: min(1200px,100%); margin: 65px auto 40px; }
.login-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 70px; align-items: center; }
.login-intro h1 { color: var(--heading); font-size: clamp(32px,3.6vw,50px); line-height: 1.2; letter-spacing: -1.5px; margin: 22px 0; }
.login-intro h1 span { color: var(--text); }
.intro-eyebrow { font-size: 11px; color: var(--heading); letter-spacing: .12em; font-weight: 750; }
.intro-description { color: var(--muted); font-size: 16px; line-height: 1.8; max-width: 480px; }
.intro-features { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 30px 0; }
.intro-features > div { background: var(--glass); border: 1px solid var(--border); padding: 18px 14px; border-radius: 16px; }
.feature-number { display: block; width: 30px; height: 30px; padding-top: 5px; border-radius: 8px; background: var(--hover); color: var(--heading); font-weight: 700; text-align: center; margin-bottom: 14px; font-size: 12px; }
.intro-features strong { font-size: 13px; }
.intro-features p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 7px 0 0; }
.intro-footnote { color: var(--muted); font-size: 12px; margin-top: 30px; }
.login-card { padding: 36px; border-radius: 24px; background: var(--glass); margin: 0; }
.login-emblem { width: 58px; height: 58px; border-radius: 18px; font-size: 32px; margin: 0 auto 24px; display: grid; }
.login-card h2 { text-align: center; font-size: 24px; letter-spacing: -.5px; margin-bottom: 8px; }
.login-welcome { text-align: center; color: var(--muted); margin: 0 0 28px; }
.login-card .form-group { margin-bottom: 20px; }
.text-input,.select-input,.text-area,.column-filter,.compact-number-input,.compact-select,.priority-input,.otp-dialog input,.otp-dialog select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; }
.compact-number-input { -webkit-text-fill-color: currentColor; }
.text-input:focus,.select-input:focus,.text-area:focus,.compact-number-input:focus,.otp-dialog input:focus,.otp-dialog select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb,var(--focus) 15%,transparent); }
input::placeholder,textarea::placeholder { color: var(--muted); opacity: .9; }
.primary-button,#otp-submit,#otp-save-settings { background: linear-gradient(#1f6fd1,#1557a8); color: white; border-color: #1557a8; box-shadow: 0 4px 10px #1557a81a; }
.primary-button:hover,#otp-submit:hover,#otp-save-settings:hover { background: #154e94; }
.danger-button,.remove-course-button,.add-button.remove-selection-button,.otp-resume-button { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); border-radius: 10px; box-shadow: none; }
.danger-button:hover,.remove-course-button:hover,.add-button.remove-selection-button:hover,.otp-resume-button:hover { color: var(--bad); background: var(--danger-button-hover); border-color: var(--bad); }
.primary-button,.secondary-button,.danger-button,.settings-toggle-button { border-radius: 10px; }
.login-card .primary-button { min-height: 48px; margin-top: 12px; }
.secondary-button,.mini-button,.page-button,.settings-toggle-button,.info-circle-button,.help-circle-button,.close-modal,.otp-dialog button { color: var(--heading); background: var(--soft); border-color: var(--border); }
.secondary-button:hover,.settings-toggle-button:hover { background: var(--hover); }
.dashboard-tabs { top: 86px; background: var(--glass); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.dashboard-tab-button { color: var(--muted); border-color: var(--border); border-radius: 11px; background: transparent; }
.dashboard-tab-button:hover { background: var(--hover); }
.dashboard-tab-button.active { background: linear-gradient(#1f6fd1,#1557a8); color: white; border-color: transparent; box-shadow: 0 4px 12px #1557a825; }
.semester-bar { background: var(--soft); border: 1px solid var(--border); border-radius: 14px; }
.mode-option,.setting-card,.activity-card,.registration-stats,.history-entry,.log-shell,.history-shell,.settings-collapsible,.registration-state,.guide-format-box,.remote-run-note { background: var(--soft); color: var(--text); border-color: var(--border); border-radius: 12px; } .mode-option:has(input:checked) { background: var(--hover); border-color: var(--blue); }
.search-hero { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: none; }
.search-hero input { color: var(--text); background: transparent; }
.table-shell,.course-table-shell,.registered-results-shell { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { color: var(--text); }
th,td { border-color: var(--border); }
thead th,.course-table-shell thead tr:first-child th,.course-table thead .column-filter-row th { background: var(--soft); color: var(--heading); border-color: var(--border); }
.course-table .column-filter { color: var(--text); background: var(--surface); border-color: var(--border); }
tbody tr { background: var(--surface); }
tbody tr:hover,.registered-results-table tbody tr:hover { background: var(--hover); }
.full-course-row { background: var(--bad-bg); } .registered-course-row,.registered-results-table tbody tr { background: var(--good-bg); }
.registered-results-count { color: var(--good); }
.remaining-available { color: var(--text); } .remaining-full { color: var(--bad); }
/* Native options inherit the closed select's red text unless explicitly reset. */
#school-filter-type option,#school-filter-type optgroup { color: var(--text); background: var(--surface); }
#school-filter-type option { font-weight: 400; }
#school-filter-type option.show-all-courses-option,#school-filter-type.show-all-selected { color: var(--bad); font-weight: 800; }
[data-theme="dark"] .history-entry.interrupted { background: var(--soft); color: var(--text); border-color: var(--warn-border); }
.add-button:not(.remove-selection-button) { background: var(--hover); color: var(--heading); border-color: var(--border); border-radius: 7px; }
.registered-delete-button { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
.registered-delete-button:hover:not(:disabled) { color: var(--bad); background: var(--danger-button-hover); border-color: var(--bad); }
.remove-course-button:disabled,.add-button.remove-selection-button:disabled,.danger-button:disabled,.registered-delete-button:disabled {
    color: var(--muted);
    background: var(--soft);
    border-color: var(--border);
}
.added-button,.status-disabled { background: var(--soft); color: var(--muted); border-color: var(--border); }
.modal-box,.otp-dialog { background: var(--surface); color: var(--text); border-radius: 20px; }
.modal-header,#result-modal .modal-header,.otp-dialog-heading { background: var(--soft); color: var(--text); border-color: var(--border); }
.context-help-content { color: var(--text); }
.registration-state.running,.status-slot,.result-modal-icon.success { color: var(--good); background: var(--good-bg); border-color: var(--good-border); }
.result-modal-icon.failure { color: var(--bad); background: var(--bad-bg); }
.attempt-badge { color: var(--heading); background: var(--hover); border-color: var(--border); }
.stale-data-note { color: var(--warn); opacity: 1; }
.status-box { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-border); }
.status-box[data-tone="success"] { color: var(--good); background: var(--good-bg); border-color: var(--good-border); }
.status-box[data-tone="error"] { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
.guide-example { border-color: var(--border); }
.otp-section-blue,.otp-feedback,.otp-notice { background: var(--hover); color: var(--text); border-color: var(--border); }
.otp-section-blue h3 { color: var(--heading); }
.otp-section-green { background: var(--good-bg); border-color: var(--good-border); } .otp-section-green h3 { color: var(--good); }
.otp-section-amber { background: var(--warn-bg); border-color: var(--warn-border); } .otp-section-amber h3 { color: var(--warn); }
.otp-dialog-heading button { color: var(--heading); background: var(--surface); }
.registration-open,.status-registered,.registered-success-badge,.run-stat-success,.history-success-count,.log-level.success,.log-entry.success,.progress-banner.success,.refresh-toast.success,.history-detail-list.success li { color: var(--good); background: var(--good-bg); border-color: var(--good-border); }
.registration-closed,.status-full,.run-stat-failure,.history-failure-count,.log-level.error,.log-entry.error,.progress-banner.error,.refresh-toast.error,.history-detail-list.failure li,.failure-detail-list li,.result-list li,.remove-button { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-border); }
.run-stat-active,.log-level.warning,.log-entry.warning,.log-level.waiting,.log-stop-note,.history-state-badge.interrupted,.history-finish-note,.license-gate-note.warning { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.log-entry.info,.log-entry.waiting,.run-stat-time,.run-stat-base,.progress-banner,.license-gate-note,.log-level.info,.log-level.cancelled,.log-entry.cancelled { color: var(--text); background: var(--soft); border-color: var(--border); }
.license-gate-note.development,.license-gate-note.active { background: var(--soft); color: var(--muted); border-color: var(--border); }
.failure-detail-list strong,.result-list strong,.history-detail-list.failure strong { color: var(--bad); }
.history-detail-list.success strong { color: var(--good); }
.result-list small,.failure-detail-list small,.history-detail-list small,.setting-check-row small,.remote-run-note span { color: var(--muted); }
[data-theme="dark"] .log-ltc { background: var(--hover); color: var(--heading); border-color: var(--border); }
@media (max-width: 900px) {
    .login-layout { gap: 30px; grid-template-columns: 1fr 1fr; }
    .intro-features { grid-template-columns: 1fr; gap: 8px; } .intro-features > div { padding: 10px 14px; }
    .feature-number { float: left; margin: 0 12px 0 0; } .intro-features p { margin: 4px 0 0; }
}
@media (max-width: 760px) {
    :root { --mobile-header-height: 110px; }
    body { padding-top: 78px; }
    body:has(#header-session-actions.visible) { padding-top: 120px; }
    .top-header { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto; min-height: 66px; height: auto; padding: 10px 16px; gap: 8px; }
    .header-brand-block { grid-column: 1; flex-direction: row; align-items: center; width: auto; }
    .header-brand-block .brand { font-size: 20px; } .header-brand-block .brand-subtitle { display: none; }
    .header-tools { display: contents; }
    .theme-toggle { grid-column: 2; grid-row: 1; min-height: 36px; padding: 6px 11px; }
    .header-session-actions.visible { grid-column: 1 / -1; width: 100%; } .header-session-actions .account-row { gap: 8px; justify-content: space-between; width: 100%; }
    .header-session-actions .student-info { max-width: 150px; } .header-session-actions .student-info strong { font-size: 12px; overflow-wrap: anywhere; }
    .header-session-actions .student-info span { font-size: 11px; } .otp-gear { width: 36px; height: 36px; }
    .panel { border-radius: 16px; }
    .login-panel { margin: 20px auto; } .login-layout { grid-template-columns: 1fr; gap: 24px; max-width: 480px; margin: auto; }
    .login-intro h1 { font-size: 32px; margin: 12px 0; } .intro-description { font-size: 14px; line-height: 1.6; margin: 0; }
    .intro-features,.intro-footnote { display: none; } .intro-eyebrow { font-size: 9px; }
    .login-card { padding: 26px 22px; } .login-card h2 { font-size: 22px; }
    .login-emblem { width: 46px; height: 46px; font-size: 26px; margin-bottom: 18px; }
    .dashboard-tabs { top: calc(var(--mobile-header-height) + 4px); } .activity-card-title { font-size: 14px; }
    .otp-dialog-heading { padding: 16px; } .otp-dialog-body { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }

.native-select-label { display: none; }
@media (max-width: 760px) {
    .native-select-wrap {
        position: relative;
        min-width: 0;
        color: var(--text);
    }
    .native-select-wrap .select-input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        opacity: 0;
        z-index: 1;
    }
    .native-select-label {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 9px 34px 9px 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        font-size: 16px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }
    .native-select-wrap::after {
        content: "";
        position: absolute;
        inset-inline-end: 14px;
        top: calc(50% - 5px);
        width: 8px;
        height: 8px;
        border: solid currentColor;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
        pointer-events: none;
    }
    .native-select-wrap:focus-within .native-select-label {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }
    #school-filter-type.show-all-selected + .native-select-label { color: var(--bad); font-weight: 800; }


}

.search-hero .search-icon { color: var(--heading); }
.public-footer { max-width: 1000px; margin: 30px auto; padding: 0 20px 24px; color: var(--muted); text-align: center; line-height: 1.7; font-size: 12px; }
.public-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; }
.public-footer a,.policy-content a,.otp-small-note a { color: var(--heading); text-underline-offset: 3px; }
.policy-content { max-width: 920px; margin: 28px auto; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; line-height: 1.8; }
.policy-content h1 { color: var(--heading); line-height: 1.3; }.policy-content h2 { font-size: 19px; margin-top: 28px; }
.top-header > a { color: var(--heading); text-underline-offset: 3px; }
.top-header > a.brand { text-decoration: none; }
@media(max-width:760px) { .policy-content { margin: 16px 12px; padding: 22px; } }
.otp-success-toast{position:fixed;inset:20px 20px auto auto;margin:0;width:min(440px,calc(100vw - 32px));box-sizing:border-box;padding:18px;gap:12px;align-items:flex-start;border:1px solid #34d399;border-radius:14px;background:#ecfdf5;color:#065f46;box-shadow:0 14px 48px #052e1633;font:15px/1.5 system-ui;z-index:2147483647}
.otp-success-toast:popover-open{display:flex}.otp-success-toast p{margin:4px 0 0;overflow-wrap:anywhere}.otp-success-icon{background:#047857;color:white;border-radius:50%;padding:1px 8px;font-weight:800}.otp-success-toast button{margin-left:auto;background:transparent;color:inherit;border:0;font-size:24px;cursor:pointer;padding:0 4px}
#otp-gmail-disconnect:not(:disabled){background:var(--bad-bg);color:var(--bad);border-color:var(--bad-border)}#otp-gmail-disconnect:not(:disabled):hover{background:var(--danger-button-hover);border-color:var(--bad)}#otp-gmail-connect:disabled,#otp-gmail-disconnect:disabled{background:var(--hover);color:var(--muted);border-color:var(--border);opacity:.55;cursor:not-allowed;box-shadow:none}
.gmail-callback-card{max-width:520px;margin:12vh auto;padding:32px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:20px;text-align:center;font:16px/1.6 system-ui}.gmail-callback-card h1{font-size:24px}.gmail-callback-icon{width:56px;height:56px;line-height:56px;margin:0 auto;border-radius:50%;font-size:32px;font-weight:800}.gmail-callback-icon.success{background:#d1fae5;color:#047857}.gmail-callback-icon.error{background:#fee2e2;color:#b91c1c}.gmail-callback-card a{display:inline-block;padding:10px 18px;border-radius:10px;background:#185ab6;color:white;text-decoration:none}@media(max-width:580px){.gmail-callback-card{margin:8vh 16px;padding:24px}.otp-success-toast{inset:12px 16px auto 16px}}
