/* MKI School unified executive visual identity.
   Shared by ADMIN, VIEWER, CLASS_TEACHER and public class/staff login.
   Role permissions and interactive forms are untouched. */
body {
    --color-background: #f6f7f4;
    --color-surface: #fff;
    --color-text: #172d33;
    --color-ink: #172d33;
    --color-muted: #718185;
    --color-border: #e5eae7;
    --color-soft: #eef5f2;
    --color-link: #127e74;
    --color-brand: #173b40;
    --shadow-card: 0 6px 26px rgba(17, 52, 51, .035);
    background: #f6f7f4;
}
body .portal-sidebar {
    background: linear-gradient(174deg, #172f37, #153638 57%, #102b2d);
    border-color: #ffffff0f;
}
body .portal-brand-mark {
    background: #c8ebda;
    color: #153a37;
    box-shadow: inset 0 1px #ffffffa0, 0 6px 20px #041b1b24;
}
body .portal-side-role {
    background: #ffffff0d;
    border-color: #ffffff1a;
}
body .portal-nav-item.is-active {
    background: #d7ede317;
    border-color: #9bcdbb30;
    box-shadow: inset 3px 0 #83dab7;
}
body .portal-sidebar-foot .portal-status-dot { background: #92dfc0; }
body .portal-header {
    background: #fff;
    border-bottom: 1px solid #e8ece9;
}
body .portal-account-avatar {
    background: #e7f5ef;
    color: #176655;
    border-color: #d8eadf;
}
body .portal-header-title { color: #1a393b; }
body .portal-content { max-width: 1600px; }
body .portal-content .primary { background: #176f67; border-color: #176f67; box-shadow: none; }
body .portal-content .primary:hover { background: #0f5d55; }
body .portal-content .class-card:hover { border-color: #9acbbb; }
body .portal-content .stats strong { color: #146f63; }
body .portal-content .eyebrow { color: #168678; }
body .portal-mobile-nav .portal-nav-item.is-active { color: #136d64; background: #e8f5ef; border-color: #cae8d9; box-shadow: inset 3px 0 #1d9480; }

.executive-hero, .executive-section, .executive-main-grid, .executive-lower-grid, .executive-footer { min-width: 0; }
.executive-hero {
    position: relative; display: flex; min-width: 0; overflow: hidden;
    min-height: 290px; align-items: center; padding: clamp(23px, 3.4vw, 44px);
    border-radius: 23px; isolation: isolate;
    background: linear-gradient(116deg, #183a3d 0%, #185054 58%, #11605a 100%);
    color: #fff; box-shadow: 0 18px 38px #143e3f1e;
}
.executive-hero::before {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; content: "";
    background: radial-gradient(circle at 81% 48%, #83dab82b, transparent 38%),
      repeating-linear-gradient(90deg, transparent 0 74px, #ffffff06 74px 75px);
}
.executive-hero-copy { position: relative; z-index: 2; width: 100%; max-width: 690px; }
.executive-overline {
    display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
    color: #b6d8ce; text-transform: uppercase; letter-spacing: .095em;
    font-size: 10px; font-weight: 750; line-height: 1.7;
}
.executive-pulse { display: inline-block; flex: 0 0 auto; height: 7px; width: 7px; background: #7ce3ae; border-radius: 50%; box-shadow: 0 0 0 4px #7ce3ae2a; }
.executive-overline-divider { color: #85b1a9; }
.portal-content .executive-hero h1 {
    color: #fff; margin: 19px 0 12px;
    font-size: clamp(33px, 4.5vw, 58px); letter-spacing: -.065em; line-height: 1.06;
    font-weight: 780;
}
.portal-content .executive-hero h1 em { font-style: normal; color: #b4e6cd; }
.executive-hero p {
    color: #d8e9e4; margin: 0; font-size: 13px; line-height: 1.8;
    max-width: 530px;
}
.executive-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-top: 24px; }
.executive-cta, .executive-cta-quiet {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 23px;
    min-height: 42px; padding: 10px 16px; border-radius: 10px; text-decoration: none;
    font-size: 12px; font-weight: 800; transition: transform .16s ease, background .16s ease;
}
.executive-cta { background: #e5f4e8; color: #16443b; }
.executive-cta:hover { color: #16443b; background: #fff; transform: translateY(-1px); }
.executive-cta-quiet { color: #e5f4e8; border: 1px solid #ffffff50; }
.executive-cta-quiet:hover { color: #fff; border-color: #fff; background: #ffffff13; }
.executive-hero-orbit {
    width: 270px; height: 270px; flex: 0 0 270px; position: absolute;
    right: 32px; top: 50%; transform: translateY(-50%);
}
.executive-orbit-one, .executive-orbit-two, .executive-orbit-three {
    position: absolute; border: 1px solid #9fdec036; border-radius: 50%; inset: 0;
}
.executive-orbit-two { inset: 34px; border-style: dashed; transform: rotate(-24deg); }
.executive-orbit-three { inset: 70px; background: #c1e7d60e; border-color: #b9ead94f; }
.executive-orbit-one::after { content: ""; position: absolute; width: 12px; height: 12px; background: #c0eacb; border: 4px solid #315b57; border-radius: 100%; top: 37px; right: 39px; }
.executive-orbit-core { position: absolute; inset: 95px 0 auto; text-align: center; color: #d0efdf; font-size: 28px; font-weight: 830; letter-spacing: -.08em; }
.executive-orbit-core small { display: block; font-size: 9px; font-weight: 700; color: #acdbcc; letter-spacing: .3em; }
.executive-section { margin-top: 29px; }
.executive-section-top, .executive-panel-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.executive-kicker { display: block; color: #4c9d89; font-size: 10px; font-weight: 840; letter-spacing: .135em; }
.portal-content .executive-section-top h2, .portal-content .executive-panel h2 { color: #1b363a; margin: 5px 0 0; font-size: 21px; line-height: 1.25; font-weight: 800; letter-spacing: -.04em; }
.executive-updated { color: #819390; font-size: 11px; font-weight: 650; }
.executive-kpis { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 17px; }
.executive-kpi {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    min-width: 0; min-height: 151px; padding: 19px 20px;
    background: #fff; color: #1c3438; text-decoration: none;
    border: 1px solid #e7ece8; border-radius: 16px;
    box-shadow: 0 7px 17px #0c383b08;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.executive-kpi:hover { color: #1c3438; border-color: #a4d2bd; box-shadow: 0 13px 24px #0c383b13; transform: translateY(-2px); }
.executive-kpi-main { background: linear-gradient(120deg, #ecf7f1, #ffffff); border-color: #d7e9db; }
.executive-kpi-positive { border-top: 3px solid #69c3a2; }
.executive-kpi-alert { border-top: 3px solid #e4b36b; }
.executive-kpi-danger { border-top: 3px solid #e19c90; }
.executive-kpi-label { display: flex; justify-content: space-between; gap: 9px; color: #627973; font-size: 12px; font-weight: 750; }
.executive-kpi-arrow { font-size: 15px; color: #83a99a; }
.executive-kpi strong { font-size: clamp(31px,3.5vw,45px); line-height: 1; letter-spacing: -.065em; color: #193b3c; font-weight: 780; font-variant-numeric: tabular-nums; }
.executive-kpi-foot { margin-top: auto; color: #8c9d97; font-size: 11px; line-height: 1.5; }
.executive-kpi-decoration { position: absolute; right: 18px; bottom: 15px; font-size: 45px; opacity: .05; font-weight: 850; }
.executive-main-grid, .executive-lower-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 15px; margin-top: 18px; }
.executive-lower-grid { grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); }
.portal-content .executive-panel {
    min-width: 0; border: 1px solid #e6ece8; border-radius: 18px;
    background: #fff; padding: clamp(17px,2.3vw,24px);
    box-shadow: 0 8px 22px #153b3908;
}
.executive-panel-head { align-items: flex-start; margin-bottom: 21px; }
.executive-panel-head > * { min-width: 0; }
.executive-text-link { color: #117b70; font-size: 11px; font-weight: 780; text-decoration: none; }
.executive-text-link:hover { color: #0e5853; text-decoration: underline; }
.executive-panel-mark { color: #c67669; background: #fdf1ef; padding: 6px 9px; border-radius: 30px; font-size: 10px; font-weight: 750; }
.executive-coverage { padding: 5px 0 15px; border-bottom: 1px solid #e8eeeb; }
.executive-coverage-number { display: flex; flex-wrap: wrap; align-items: baseline; gap: 13px; }
.executive-coverage-number strong { color: #183e3c; font-size: 45px; letter-spacing: -.065em; line-height: 1; font-variant-numeric: tabular-nums; }
.executive-coverage-number strong small { color: #547d6d; font-size: 24px; }
.executive-coverage-number > span { color: #81968e; font-size: 12px; }
.executive-coverage-track { width: 100%; height: 12px; display: flex; gap: 3px; overflow: hidden; border-radius: 20px; margin-top: 19px; background: #e9efec; }
.executive-segment { display: block; flex-basis: 0; min-width: 0; }
.executive-segment-mint, .executive-dot-mint { background: #3ba789; }
.executive-segment-amber, .executive-dot-amber { background: #e2b468; }
.executive-segment-coral, .executive-dot-coral { background: #dc8c85; }
.executive-segment-slate, .executive-dot-slate { background: #91aeb0; }
.executive-segment-lilac, .executive-dot-lilac { background: #9aa6d0; }
.executive-segment-stone, .executive-dot-stone { background: #cecac2; }
.executive-status-list { display: grid; gap: 0; margin-top: 7px; }
.executive-status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #4c6462; padding: 10px 3px; text-decoration: none; font-size: 12px; border-bottom: 1px solid #f1f4f1; }
.executive-status-line:hover { color: #145f57; background: #f8fbf9; }
.executive-status-line:last-child { border: 0; }
.executive-status-line > span { display: flex; gap: 10px; align-items: center; min-width: 0; }
.executive-status-line strong { font-size: 13px; color: #223d40; font-variant-numeric: tabular-nums; }
.executive-status-dot { flex: 0 0 auto; display: block; width: 8px; height: 8px; border-radius: 50%; }
.executive-explainer { padding: 12px; margin: 11px 0 0; background: #f6f8f5; border-radius: 9px; font-size: 11px; color: #667f76; line-height: 1.65; }
.executive-action-list { display: grid; }
.executive-action { display: flex; align-items: center; gap: 10px; padding: 13px 2px; min-width: 0; color: #344f4f; text-decoration: none; border-bottom: 1px solid #eff2ef; }
.executive-action:hover { color: #0e6b5b; background: #fbfdfb; }
.executive-action:last-child { border: 0; }
.executive-action-icon { display: grid; place-items: center; flex: 0 0 35px; height: 35px; border-radius: 10px; background: #e9f2ee; color: #49766c; font-weight: 800; }
.executive-action-icon-red { background: #fff1ee; color: #cd7068; }
.executive-action-icon-orange { background: #fcf2e7; color: #c6883d; }
.executive-action-copy { display: grid; flex: 1 1 auto; gap: 3px; min-width: 0; }
.executive-action-copy strong { font-size: 12px; line-height: 1.3; color: #274044; font-weight: 780; }
.executive-action-copy small { font-size: 10px; color: #8c9f98; line-height: 1.5; }
.executive-action b { font-size: 17px; min-width: 19px; text-align: right; font-variant-numeric: tabular-nums; color: #244442; }
.executive-action > span:last-child { color: #8ba8a1; font-size: 14px; }
.executive-action-static:hover { background: transparent; }
.executive-panel-hint { color: #88988f; font-size: 11px; line-height: 1.65; margin: -8px 0 12px; }
.executive-classes { display: grid; }
.executive-class-row { display: flex; align-items: center; gap: 11px; min-width: 0; color: #344c4b; text-decoration: none; padding: 10px 0; border-bottom: 1px solid #f0f3f0; }
.executive-class-row:hover { color: #11786a; }
.executive-class-row:last-child { border: 0; }
.executive-class-avatar { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; padding: 3px; background: #ecf3ef; border: 1px solid #e0ebe5; border-radius: 11px; color: #337969; font-size: 11px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.executive-class-name { display: grid; gap: 2px; flex: 1; min-width: 0; }
.executive-class-name strong { color: #2d4b48; font-size: 12px; }
.executive-class-name small { color: #94a59d; font-size: 10px; }
.executive-class-risk { color: #9b8980; font-size: 10px; text-align: right; max-width: 145px; }
.executive-class-next { color: #91a89e; }
.executive-grades { display: grid; gap: 15px; margin-top: 19px; }
.executive-grade { display: grid; gap: 7px; }
.executive-grade-label { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: #617b75; font-size: 11px; }
.executive-grade-label strong { color: #264942; font-size: 12px; font-variant-numeric: tabular-nums; }
.executive-grade-track { height: 8px; overflow: hidden; background: #edf3ee; border-radius: 10px; }
.executive-grade-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#298f7c,#80bf9d); }
.executive-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 5px 2px 16px; color: #849792; font-size: 10px; flex-wrap: wrap; }
.executive-footer > span { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.executive-footer-dot { display: inline-block; width: 6px; height: 6px; border-radius: 100%; background: #42ac83; }
.executive-footer a { color: #227d6d; text-decoration: none; font-weight: 800; }
@media (max-width: 1320px) {
    .executive-main-grid, .executive-lower-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .executive-hero-orbit { right: -34px; opacity: .53; }
    .executive-hero-copy { max-width: 580px; }
}
@media (max-width: 1120px) {
    .executive-main-grid, .executive-lower-grid { grid-template-columns: minmax(0,1fr); }
    .executive-hero-orbit { opacity: .22; }
}
@media (max-width: 780px) {
    .executive-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .executive-hero { min-height: 280px; border-radius: 18px; }
    .executive-hero-orbit { right: -90px; }
}
@media (max-width: 480px) {
    .executive-hero { padding: 23px 19px; min-height: 290px; }
    .portal-content .executive-hero h1 { font-size: 38px; }
    .executive-hero p { font-size: 12px; }
    .executive-hero-orbit { display: none; }
    .executive-kpis { gap: 9px; }
    .executive-kpi { padding: 15px 13px; min-height: 138px; }
    .executive-kpi strong { font-size: 32px; }
    .executive-kpi-foot { font-size: 10px; }
    .executive-kpi-label { font-size: 11px; }
    .executive-section { margin-top: 23px; }
    .executive-coverage-number strong { font-size: 39px; }
    .executive-class-risk { max-width: 92px; font-size: 10px; }
    .executive-class-avatar { width: 35px; height: 35px; flex-basis: 35px; font-size: 10px; }
    .executive-class-row { gap: 8px; }
}
@media (max-width: 350px) {
    .executive-kpis { grid-template-columns: minmax(0,1fr); }
    .executive-kpi { min-height: 119px; }
    .executive-overline { font-size: 9px; }
    .executive-hero-actions { align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
    .executive-cta, .executive-cta-quiet, .executive-kpi { transition: none; }
}
/* Preserve the existing MySQL-controlled dark theme, with accessible text. */
html[data-theme="dark"] body {
    --color-background: #111f22;
    --color-surface: #1c3032;
    --color-text: #e8f0ed;
    --color-muted: #b3c4be;
    --color-border: #365053;
    --color-soft: #293d3d;
    --color-link: #95ddba;
    background: #111f22;
}
html[data-theme="dark"] body .portal-header { background: #192e30; border-color: #3b5454; }
html[data-theme="dark"] body .portal-header-title { color: #e8f0ed; }
html[data-theme="dark"] body .executive-kpi,
html[data-theme="dark"] body .executive-panel { background: #1c3032; border-color: #344a4a; color: #e5f1eb; }
html[data-theme="dark"] body .executive-kpi-main { background: #23423c; }
html[data-theme="dark"] body :is(.executive-kpi strong,.executive-kpi-label,
 .executive-kpi-foot,.executive-coverage-number strong,.executive-status-line strong,.executive-status-line,
 .executive-action-copy strong,.executive-action b,.executive-class-name strong,.executive-grade-label strong,
 .executive-section-top h2,.executive-panel h2,.executive-class-row,.executive-grade-label) { color: #e2f1e9; }
html[data-theme="dark"] body .executive-explainer { background: #253c3b; color: #c4d8cd; }
html[data-theme="dark"] body .executive-class-avatar { background: #2b4c43; border-color: #3f675d; color: #c5eddf; }
html[data-theme="dark"] body .executive-action-icon { background: #304b46; color: #b1dfc7; }
html[data-theme="dark"] body .executive-grade-track,
html[data-theme="dark"] body .executive-coverage-track { background: #36504e; }


/* ------------------ System-wide consistency layer --------------------- */
/* Existing purple teacher-header declarations in premium.css have their own
   role selector; these later role overrides deliberately normalize that one
   legacy exception instead of deleting or bypassing teacher functionality. */
body.portal-role-teacher .portal-header,
body.portal-role-viewer .portal-header,
body.portal-guest .portal-header {
    background: #ffffff;
    border-bottom: 1px solid #e8ece9;
    color: #17383a;
}
body.portal-role-teacher .portal-header-title,
body.portal-role-viewer .portal-header-title { color: #1a393b; }
body.portal-role-teacher .portal-header-kicker,
body.portal-role-viewer .portal-header-kicker { color: #6f857f; }
body.portal-role-teacher .portal-mobile-brand,
body.portal-role-viewer .portal-mobile-brand { color: #19433e; }
body.portal-role-teacher .portal-mobile-brand span,
body.portal-role-viewer .portal-mobile-brand span { color: #638279; }
body.portal-role-teacher .portal-account-avatar,
body.portal-role-viewer .portal-account-avatar {
    background: #e7f5ef; border-color: #d8eadf; color: #176655;
}
body.portal-role-teacher .portal-account-name,
body.portal-role-viewer .portal-account-name { color: #1b393a; }
body.portal-role-teacher .portal-logout,
body.portal-role-viewer .portal-logout {
    background: #f2f8f4; border-color: #e0ece5; color: #355e55;
}
body.portal-role-teacher .portal-logout:hover,
body.portal-role-viewer .portal-logout:hover { background: #e7f3eb; color: #115c4c; }

/* An editorial page introduction, adapted to smaller teachers' workspaces
   while keeping the unique administrative executive-dashboard hero. */
body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero,
body.portal-guest .portal-content .public-hero {
    position: relative; isolation: isolate; overflow: hidden; min-width: 0;
    padding: clamp(20px, 3vw, 29px); gap: 14px;
    border: 1px solid #dceae2; border-radius: 18px;
    background: linear-gradient(110deg, #ffffff 3%, #eef8f1 100%);
    box-shadow: 0 6px 23px #133f3d0a;
}
body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero::before,
body.portal-guest .portal-content .public-hero::before {
    position: absolute; z-index: -1; pointer-events: none; content: "";
    right: -38px; top: -82px; height: 240px; width: 240px;
    border: 1px solid #8ac7a92b; border-radius: 50%;
    box-shadow: 0 0 0 33px #8ac7a917, 0 0 0 70px #8ac7a90c;
}
body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero h1,
body.portal-guest .portal-content .public-hero h1 {
    color: #1b393b; font-weight: 800;
    font-size: clamp(27px, 3.1vw, 39px);
    letter-spacing: -.047em; line-height: 1.13;
}
body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero p,
body.portal-guest .portal-content .public-hero p {
    max-width: 720px; color: #617971; font-size: 13px; line-height: 1.6;
}
body .portal-content .eyebrow { color: #218674; }
body .portal-content .panel-head h2,
body .portal-content .panel h2 { color: #1a3a3c; letter-spacing: -.027em; }
body .portal-content .panel { border-color: #e3ebe5; }
body .portal-content .class-card {
    background: #fff; border-color: #e0ebe4; box-shadow: 0 3px 13px #1b56400a;
}
body .portal-content .class-card:hover {
    border-color: #96cab0; background: #f7fcf8;
    box-shadow: 0 10px 21px #1a5e4714;
}
body .portal-content .class-card.is-selected { border-color: #219179; }
body .portal-content .completion { background: #e9f0eb; }
body .portal-content .completion i {
    background: linear-gradient(90deg, #198d78, #8accab); box-shadow: none;
}
body .portal-content .class-card .completion + small { color: #377c69; }
body .portal-content .secondary,
body .portal-content .button.secondary {
    color: #275950; background: #fff; border-color: #d7e8df;
}
body .portal-content .secondary:hover,
body .portal-content .button.secondary:hover {
    color: #126355; border-color: #98c9b5; background: #f3faf5;
    box-shadow: 0 5px 16px #1a5e4714;
}
body .portal-content :is(input, select, textarea) { border-color: #d7e5df; }
body .portal-content :is(input, select, textarea):focus {
    border-color: #218574;
    outline: 3px solid #21857426;
}
body .portal-content .admin-item[open] { border-color: #a6d0b6; background: #fcfefc; }
body .portal-content .stats > div { background: #f8fcf9; border-color: #e4ebe6; }
body .portal-content .stats strong { color: #1c735f; }
body .portal-content .back-link,
body .portal-content .back { color: #167866; }
body .portal-content .announcement { border-left-color: #258f79; background: #f0f8f2; }
body .portal-content .announcement-important { border-left-color: #c88361; background: #fff7ed; }
body .portal-content .teacher-table .row-number { color: #228474; }
body .portal-content .teacher-table tr.new-row {
    background: #f1faf5; border-color: #95cdb2;
}
body .portal-content .teacher-table tr.edited-row {
    background: #fffaf2; border-color: #d9b678;
}
body .portal-content .erp-pill.is-checked { background: #eaf7ef; color: #247452; }
body .portal-content .erp-pill.is-absent { background: #fff3de; color: #92601f; }
body .portal-content .erp-pill.is-problem { background: #fff0e9; color: #a74a37; }
body .portal-content .erp-pill.is-reviewed { background: #f1edfb; color: #67518e; }
body .portal-content .erp-pill.is-unchecked { background: #edf3f2; color: #5f7777; }
body .portal-content .class-directory .admin-item.is-targeted {
    scroll-margin-top: 22px; border-color: #429d82; box-shadow: 0 0 0 3px #429d8220;
}
body .portal-content :is(.auth-card, .login-class-card) {
    border-color: #e0ebe5; border-radius: 20px;
    box-shadow: 0 12px 36px #124b3d12;
}
body.portal-guest .portal-brand-public .portal-brand-label strong { color: #1a393b; }
body.portal-guest .portal-brand-public .portal-brand-label small { color: #718f84; }
body.portal-guest .portal-content .auth-card { margin: clamp(26px, 5vw, 65px) auto; }
body .portal-content .paste-box { border-color: #b6d8c6; background: #f7fcf8; }
body .portal-content .confirm-dialog { border-color: #dce9e2; }

/* Mobile layouts must wrap even with very long field names and status badges. */
body .portal-content .panel,
body .portal-content .data-table tr,
body .portal-content .admin-item,
body .portal-content .class-card { min-width: 0; max-width: 100%; }
body .portal-content :is(.panel-head, .hero, .class-edit, .admin-form, .student-edit) { min-width: 0; }
body .portal-content .panel-head > * { min-width: 0; }
body .portal-content :is(.erp-pill, .badge) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
body .portal-content .teacher-table td { min-width: 0; overflow-wrap: anywhere; }
body .portal-content .teacher-table td :is(input, select, textarea) { max-width: 100%; }
@media (max-width: 630px) {
    body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero,
    body.portal-guest .portal-content .public-hero { padding: 19px 15px; }
    body .portal-content .inline-form > :is(button,a) { width: 100%; }
}
/* Both app themes use the same visual identity in dark mode. */
html[data-theme="dark"] body.portal-role-teacher .portal-header,
html[data-theme="dark"] body.portal-role-viewer .portal-header,
html[data-theme="dark"] body.portal-guest .portal-header {
    background: #192e30; color: #e8f0ed; border-color: #3b5454;
}
html[data-theme="dark"] body.portal-role-teacher .portal-header-title,
html[data-theme="dark"] body.portal-role-viewer .portal-header-title { color: #e8f0ed; }
html[data-theme="dark"] body.portal-role-teacher .portal-header-kicker,
html[data-theme="dark"] body.portal-role-viewer .portal-header-kicker { color: #b6cfc2; }
html[data-theme="dark"] body.portal-role-teacher .portal-mobile-brand,
html[data-theme="dark"] body.portal-role-viewer .portal-mobile-brand { color: #e2f1e9; }
html[data-theme="dark"] body.portal-role-teacher .portal-mobile-brand span,
html[data-theme="dark"] body.portal-role-viewer .portal-mobile-brand span { color: #b7cbc2; }
html[data-theme="dark"] body.portal-role-teacher .portal-account-avatar,
html[data-theme="dark"] body.portal-role-viewer .portal-account-avatar {
    background: #294a42; border-color: #416559; color: #cde9d9;
}
html[data-theme="dark"] body.portal-role-teacher .portal-account-name,
html[data-theme="dark"] body.portal-role-viewer .portal-account-name { color: #e8f0ed; }
html[data-theme="dark"] body.portal-role-teacher .portal-logout,
html[data-theme="dark"] body.portal-role-viewer .portal-logout {
    background: #243f3c; border-color: #3e5952; color: #d1ecdf;
}
html[data-theme="dark"] body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero,
html[data-theme="dark"] body.portal-guest .portal-content .public-hero {
    background: linear-gradient(120deg, #21393a, #264842); border-color: #3e5852;
}
html[data-theme="dark"] body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero h1,
html[data-theme="dark"] body.portal-guest .portal-content .public-hero h1,
html[data-theme="dark"] body .portal-content .panel-head h2,
html[data-theme="dark"] body .portal-content .panel h2 { color: #e1f3e9; }
html[data-theme="dark"] body:is(.portal-role-teacher,.portal-role-viewer) .portal-content .hero p,
html[data-theme="dark"] body.portal-guest .portal-content .public-hero p { color: #bfd2c8; }
html[data-theme="dark"] body .portal-content :is(.class-card, .auth-card, .login-class-card, .stats>div, .admin-item) {
    background: #1c3032; color: #e8f0ed; border-color: #365053;
}
html[data-theme="dark"] body .portal-content .class-card .completion + small { color: #95dbc0; }
html[data-theme="dark"] body .portal-content .secondary,
html[data-theme="dark"] body .portal-content .button.secondary { background: #243e3e; color: #e6f2e9; border-color: #48665c; }
html[data-theme="dark"] body .portal-content .secondary:hover,
html[data-theme="dark"] body .portal-content .button.secondary:hover { background: #2c4c45; color: #fff; }
html[data-theme="dark"] body .portal-content .admin-item[open] { background: #243d3e; border-color: #548577; }
html[data-theme="dark"] body .portal-content .announcement { background: #283e3a; color: #e7f4e9; }
html[data-theme="dark"] body .portal-content .announcement-important { background: #4d3b33; }
html[data-theme="dark"] body .portal-content .paste-box { background: #233b38; border-color: #486c57; }
html[data-theme="dark"] body .portal-content .teacher-table tr.new-row { background: #233b38; }
