:root {
  color-scheme: light;
  --ink: #172033;
  --ink-soft: #5f6878;
  --navy: #14284a;
  --navy-deep: #0c1b35;
  --blue: #245ba8;
  --blue-soft: #e8f0fb;
  --bordeaux: #7d2948;
  --bordeaux-soft: #f6e9ee;
  --green: #21705d;
  --green-soft: #e4f4ef;
  --amber: #a96716;
  --amber-soft: #fff2db;
  --danger: #a53636;
  --danger-soft: #fdecec;
  --line: #dfe4ec;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --shadow: 0 18px 46px rgba(20, 40, 74, 0.10);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--bordeaux);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.muted { color: var(--ink-soft); }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.08fr) minmax(420px, 0.92fr); }
.login-brand {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(36px, 6vw, 80px);
  color: white;
  background:
    radial-gradient(circle at 85% 18%, rgba(125, 41, 72, 0.82), transparent 32%),
    linear-gradient(145deg, var(--navy-deep), var(--navy) 58%, #253f6b);
}
.login-brand::after {
  position: absolute;
  right: -120px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02);
  content: "";
}
.login-statement { position: relative; z-index: 1; max-width: 720px; }
.login-statement .eyebrow { color: #e6b6c8; }
.login-statement h1 { max-width: 680px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.login-statement p:last-child { max-width: 610px; margin: 28px 0 0; color: rgba(255,255,255,.76); font-size: 1.05rem; line-height: 1.7; }
.login-version { z-index: 1; margin: 0; color: rgba(255,255,255,.56); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.login-panel { display: grid; min-height: 100vh; place-items: center; padding: 32px; background: #f8f9fb; }
.login-card { display: grid; width: min(440px, 100%); gap: 22px; padding: clamp(28px, 4vw, 48px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; font-weight: 500; }
.login-card p { margin: 8px 0 0; line-height: 1.55; }

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup > span:last-child { display: grid; }
.brand-lockup strong { font-size: .94rem; letter-spacing: .08em; }
.brand-lockup small { margin-top: 2px; opacity: .64; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid currentColor; border-radius: 10px; font-family: Georgia, serif; font-size: 1.35rem; }
.brand-lockup--large .brand-mark { width: 50px; height: 50px; }

label { display: grid; gap: 7px; color: #364053; font-size: .84rem; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid #ccd3de;
  border-radius: 9px;
  outline: none;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
  transition: border-color .16s, box-shadow .16s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,91,168,.12); }
.form-error { padding: 10px 12px; border-radius: 8px; color: var(--danger); background: var(--danger-soft); font-size: .84rem; }
.security-note { color: var(--ink-soft); font-size: .74rem; text-align: center; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 9px 15px; font-size: .82rem; font-weight: 800; text-decoration: none; transition: transform .14s, background .14s, border-color .14s; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: white; background: var(--navy); }
.button--primary:hover { background: #1d3762; }
.button--secondary { color: var(--navy); border-color: #c9d4e5; background: white; }
.button--danger { color: var(--danger); border-color: #e8baba; background: white; }
.button--wide { width: 100%; }
.button--small { min-height: 32px; padding: 6px 10px; font-size: .74rem; }
.text-button { border: 0; padding: 0; color: #bbc7da; background: none; font-size: .75rem; text-align: left; }
.text-button:hover { color: white; }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 1.15rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; color: white; background: var(--navy-deep); }
.sidebar-head { display: grid; gap: 18px; padding: 28px 24px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.core-badge { justify-self: start; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 8px; color: #b9c8de; font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.main-nav { display: grid; gap: 3px; padding: 18px 14px; overflow-y: auto; }
.nav-item { display: grid; grid-template-columns: 30px 1fr; align-items: center; border: 0; border-radius: 9px; padding: 11px 12px; color: #bac5d7; background: transparent; font-size: .79rem; font-weight: 700; text-align: left; }
.nav-item span { color: #6f809c; font-size: .62rem; letter-spacing: .08em; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.is-active { color: white; background: linear-gradient(90deg, rgba(125,41,72,.62), rgba(125,41,72,.28)); }
.nav-item.is-active span { color: #efbfd0; }
.sidebar-foot { margin-top: auto; padding: 20px 24px 25px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-chip > span:last-child { display: grid; min-width: 0; }
.user-chip strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { margin-top: 2px; color: #8897af; font-size: .66rem; }
.avatar { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: white; background: var(--bordeaux); font-size: .7rem; font-weight: 800; }

.workspace { min-width: 0; }
.topbar { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 24px; padding: 20px clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); }
.topbar h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.55rem, 2.5vw, 2.1rem); font-weight: 500; letter-spacing: -.02em; }
.topbar-meta { display: flex; align-items: center; gap: 18px; color: var(--ink-soft); font-size: .73rem; }
.workspace-picker { display: flex; grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 8px; }
.workspace-picker select { min-width: 145px; padding: 7px 30px 7px 9px; font-size: .75rem; }
.status-dot { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: white; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #2a9a72; box-shadow: 0 0 0 4px rgba(42,154,114,.12); }
.page-content { max-width: 1600px; margin: 0 auto; padding: clamp(24px, 4vw, 52px); outline: none; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 500; }
.page-head p { max-width: 720px; margin: 7px 0 0; color: var(--ink-soft); font-size: .86rem; line-height: 1.55; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 22px; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); box-shadow: 0 8px 24px rgba(20,40,74,.04); }
.metric-card::before { position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--blue); content: ""; }
.metric-card:nth-child(2)::before, .metric-card:nth-child(5)::before { background: var(--bordeaux); }
.metric-card:nth-child(3)::before, .metric-card:nth-child(6)::before { background: var(--green); }
.metric-label { color: var(--ink-soft); font-size: .71rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.metric-value { display: block; margin-top: 12px; font-family: Georgia, serif; font-size: 2.25rem; line-height: 1; }
.metric-note { display: block; margin-top: 10px; color: #7a8391; font-size: .7rem; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 8px 24px rgba(20,40,74,.035); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: .88rem; }
.panel-body { padding: 18px; }
.panel-spaced { margin-top: 18px; }

.data-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.search-box { position: relative; width: min(380px, 100%); }
.search-box input { padding-left: 34px; background: white; }
.search-box::before { position: absolute; top: 10px; left: 12px; color: #8791a1; content: "⌕"; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { padding: 11px 14px; color: #697386; background: #f7f8fa; font-size: .66rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 13px 14px; border-top: 1px solid #e9edf2; vertical-align: middle; }
tbody tr:hover { background: #fafbfc; }
.cell-title { display: grid; gap: 3px; }
.cell-title strong { color: var(--ink); font-size: .8rem; }
.cell-title small { color: #7e8796; font-size: .69rem; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: .65rem; font-weight: 800; white-space: nowrap; }
.badge--green { color: var(--green); background: var(--green-soft); }
.badge--blue { color: var(--blue); background: var(--blue-soft); }
.badge--bordeaux { color: var(--bordeaux); background: var(--bordeaux-soft); }
.badge--amber { color: var(--amber); background: var(--amber-soft); }
.badge--gray { color: #636d7c; background: #edf0f4; }
.badge--red { color: var(--danger); background: var(--danger-soft); }

.empty-state { display: grid; min-height: 230px; place-items: center; padding: 34px; color: var(--ink-soft); text-align: center; }
.empty-state > div { max-width: 440px; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.empty-state p { margin: 0; font-size: .82rem; line-height: 1.55; }
.loading-state { display: flex; min-height: 280px; align-items: center; justify-content: center; gap: 10px; color: var(--ink-soft); font-size: .82rem; }
.spinner { width: 17px; height: 17px; border: 2px solid #d5dbe5; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 13px 1fr; gap: 10px; padding-bottom: 15px; }
.timeline-item::before { position: absolute; top: 12px; bottom: -2px; left: 4px; width: 1px; background: var(--line); content: ""; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { z-index: 1; width: 9px; height: 9px; margin-top: 3px; border: 2px solid white; border-radius: 50%; background: var(--bordeaux); box-shadow: 0 0 0 1px var(--bordeaux); }
.timeline-copy { display: grid; gap: 3px; }
.timeline-copy strong { font-size: .75rem; }
.timeline-copy small { color: var(--ink-soft); font-size: .65rem; }

.tabs { display: flex; gap: 5px; margin-bottom: 16px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 10px 13px; color: var(--ink-soft); background: transparent; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.tab.is-active { color: var(--bordeaux); border-bottom-color: var(--bordeaux); }

.dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 36px); border: 0; border-radius: 16px; padding: 0; color: var(--ink); box-shadow: 0 30px 90px rgba(6,16,35,.34); }
.dialog::backdrop { background: rgba(8,20,40,.62); backdrop-filter: blur(2px); }
.dialog-shell { margin: 0; }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 22px; border-bottom: 1px solid var(--line); background: white; }
.dialog-head h2 { margin: 0; font-family: Georgia, serif; font-size: 1.4rem; font-weight: 500; }
.dialog-content { max-height: calc(100vh - 130px); overflow-y: auto; padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.form-grid legend { padding: 0 6px; color: #364053; font-size: .78rem; font-weight: 800; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; grid-column: 1 / -1; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.detail-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fafbfc; }
.detail-card small { display: block; color: var(--ink-soft); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.detail-card strong { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.section-title { margin: 24px 0 10px; font-size: .83rem; }

.note-card { margin-bottom: 18px; border: 1px solid #cad8ec; border-left: 4px solid var(--blue); border-radius: 11px; padding: 16px 18px; background: #f7faff; }
.note-card--strong { border-left-color: var(--bordeaux); background: #fffafd; }
.note-card strong { display: block; font-family: Georgia, serif; font-size: 1.05rem; font-weight: 600; }
.note-card p { margin: 7px 0; color: var(--ink-soft); font-size: .79rem; line-height: 1.55; }
.note-card small { color: #707b8c; font-size: .67rem; }
.note-card a { color: var(--blue); font-size: .75rem; font-weight: 700; }
.form-section { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: #fafbfc; }
.section-row { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.section-row p { margin: 5px 0 0; font-size: .72rem; line-height: 1.45; }
.repeatable-list { display: grid; gap: 10px; margin-top: 12px; }
.repeatable-row { display: grid; align-items: end; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; }
.repeatable-row--grade { grid-template-columns: minmax(130px, 1.4fr) repeat(3, minmax(92px, .7fr)) minmax(120px, .8fr) auto; }
.repeatable-row--course { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
.repeatable-row label { font-size: .69rem; }
.check-label { display: flex; align-items: center; gap: 8px; line-height: 1.35; }
.check-label input { width: 16px; height: 16px; flex: 0 0 auto; padding: 0; }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fafbfc; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice-grid .check-label { align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: white; font-size: .72rem; }
.choice-grid .check-label span { display: grid; gap: 3px; }
.choice-grid .check-label small { color: var(--ink-soft); font-weight: 500; }

.toast-region { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; width: min(370px, calc(100vw - 40px)); gap: 8px; }
.toast { border-left: 4px solid var(--green); border-radius: 10px; padding: 13px 15px; color: white; background: #1d2d42; box-shadow: var(--shadow); font-size: .78rem; animation: toast-in .2s ease-out; }
.toast.is-error { border-left-color: #f17676; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.mobile-only { display: none; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.portal-card { display: grid; gap: 13px; min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: white; box-shadow: 0 8px 24px rgba(20,40,74,.05); }
.portal-card__head, .portal-card__foot, .unit-title, .unit-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.portal-card p { margin: 0; color: var(--ink-soft); font-size: .78rem; line-height: 1.5; }
.portal-card__foot { align-items: end; margin-top: auto; padding-top: 3px; color: var(--ink-soft); font-size: .72rem; }
.course-code { color: var(--bordeaux); font-size: .7rem; font-weight: 900; letter-spacing: .08em; }
.portal-progress { display: grid; gap: 7px; }
.portal-progress > div { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: .7rem; }
.portal-progress progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; }
.portal-progress progress::-webkit-progress-bar { background: #e7ebf1; }
.portal-progress progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), var(--bordeaux)); }
.portal-progress progress::-moz-progress-bar { background: var(--blue); }
.portal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.portal-stats span { display: grid; gap: 3px; border-radius: 9px; padding: 10px; color: var(--ink-soft); background: #f6f8fb; font-size: .65rem; }
.portal-stats strong { color: var(--ink); font-size: 1rem; }
.course-summary { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(130px, 1fr)); gap: 12px; margin-bottom: 22px; }
.course-summary > div { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: white; }
.course-summary > div > span { color: var(--ink-soft); font-size: .7rem; font-weight: 700; }
.course-summary > div > strong { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.unit-list { display: grid; gap: 14px; }
.unit-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 17px; background: white; }
.unit-card.is-locked { background: #f7f8fa; }
.unit-sequence { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-weight: 800; }
.unit-card.is-locked .unit-sequence { color: #7d8796; background: #e1e5eb; }
.unit-copy { min-width: 0; }
.unit-title span { color: var(--bordeaux); font-size: .63rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.unit-title h3 { margin: 3px 0 0; font-size: 1rem; }
.unit-copy > p { margin: 9px 0; color: var(--ink-soft); font-size: .77rem; line-height: 1.5; }
.unit-actions { margin-top: 12px; }
.assignment-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, .35fr); gap: 14px; margin-top: 13px; border-left: 3px solid var(--bordeaux); border-radius: 8px; padding: 13px; background: var(--bordeaux-soft); }
.assignment-card p { margin: 5px 0; font-size: .72rem; line-height: 1.5; }
.assignment-card small { color: var(--ink-soft); font-size: .66rem; }
.assignment-card__result { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px; font-size: .72rem; text-align: right; }
.assignment-card__result p { max-width: 300px; margin: 0; }
@media (max-width: 1020px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; }
  .login-panel { min-height: 58vh; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; width: 260px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(8,20,40,.24); }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-only { display: grid; }
  .topbar { justify-content: flex-start; }
  .topbar-meta { margin-left: auto; }
}
@media (max-width: 760px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .portal-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-metrics .metric-card { min-height: 104px; padding: 14px 12px; }
  .portal-metrics .metric-value { font-size: 1.6rem; }
  .course-summary { grid-template-columns: 1fr 1fr; }
  .course-summary > div:first-child { grid-column: 1 / -1; }
  .assignment-card { grid-template-columns: 1fr; }
  .assignment-card__result { align-items: flex-start; text-align: left; }
  .workspace-picker { margin-left: auto; }
  .topbar { min-height: 78px; padding: 14px 18px; }
  .topbar-meta > span:first-child { display: none; }
  .page-content { padding: 22px 16px 38px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .repeatable-row--grade, .repeatable-row--course, .toggle-grid, .choice-grid { grid-template-columns: 1fr; }
  .section-row { align-items: stretch; flex-direction: column; }
  .login-brand { padding: 30px 24px; }
  .login-statement h1 { font-size: 2.7rem; }
  .login-panel { padding: 20px; }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .status-dot { display: none; }
  .workspace-picker { font-size: 0; }
  .workspace-picker select { min-width: 112px; max-width: 132px; font-size: .72rem; }
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-card__foot { align-items: stretch; flex-direction: column; }
  .portal-card__foot .button { width: 100%; }
  .portal-stats { grid-template-columns: 1fr; }
  .course-summary { grid-template-columns: 1fr; }
  .course-summary > div:first-child { grid-column: auto; }
  .unit-card { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; padding: 13px; }
  .unit-sequence { width: 30px; height: 30px; }
  .unit-title { align-items: flex-start; }
}

/* Admissions: bounded forms and readable records on narrow screens. */
.admission-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
.admission-filters label { display: grid; gap: .4rem; flex: 1 1 180px; }
.admission-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: 1rem 0; }
.admission-pager > div { display: flex; gap: .5rem; }
.admission-summary { display: grid; gap: 1rem; }
.admission-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.admission-history { padding-left: 1.2rem; }
.admission-history li { margin-bottom: 1rem; overflow-wrap: anywhere; }
.admission-history li > span { display: block; margin-top: .3rem; }
.admission-programs article { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.admission-template-row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: .75rem 0; }
.admission-template-row > label:first-child { flex: 1 1 200px; }
.admission-template-row input[type=checkbox] { width: auto; }
@media (max-width: 600px) { .admission-filters > button { width: 100%; } .admission-template-row > label:first-child { flex-basis: 100%; } }

.finance-search { display:flex; flex-wrap:wrap; gap:1rem; align-items:end; margin:1rem 0; }
.finance-search label { display:grid; gap:.4rem; flex:1 1 200px; }
.finance-pagination { display:flex; justify-content:space-between; flex-wrap:wrap; gap:1rem; padding:1rem; }
.finance-pagination > div { display:flex; gap:.5rem; }
.finance-charge { padding:1rem 0; border-bottom:1px solid var(--line); }
.finance-charge > header { display:flex; flex-wrap:wrap; gap:1rem; justify-content:space-between; }
.finance-description, .finance-receipt dd { overflow-wrap:anywhere; white-space:pre-wrap; }
.finance-installment { display:flex; flex-wrap:wrap; gap:.75rem; align-items:end; padding:.75rem 0; }
.finance-installment > label { flex:1 1 160px; }
.finance-receipt dt { font-weight:700; margin-top:.8rem; }
.finance-receipt dd { margin:.2rem 0; }
@media print {
  body:has(.finance-receipt) #app-shell, body:has(.finance-receipt) #login-view, body:has(.finance-receipt) #toast-region { display:none !important; }
  body:has(.finance-receipt) dialog[open] { display:block !important; position:static; width:100%; max-width:none; max-height:none; border:0; box-shadow:none; }
  body:has(.finance-receipt) dialog button { display:none !important; }
}

.notice-body { white-space: pre-wrap; overflow-wrap: anywhere; }
[data-notice-count]:not(:empty) { border-radius: 1rem; padding: .1rem .5rem; background: #852846; color: white; margin-left: auto; }

#student-language-picker:not([hidden]) { display:flex; align-items:center; gap:.75rem; padding:1rem 2rem 0; }
#student-language-picker select { width:auto; min-width:10rem; }
[data-curriculum-courses] { max-height:20rem; overflow:auto; }
[data-curriculum-courses] label { display:flex; align-items:center; gap:.5rem; padding:.4rem; }
[data-curriculum-courses] input { width:auto; }

.optional-result-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 50vh; overflow: auto; }

/* Task-oriented administration. Native text reflows in all supported languages. */
.nav-item .task-icon { width: 21px; height: 21px; color: #bccbdd; }
.nav-item .nav-label { color: inherit; font-size: .85rem; letter-spacing: 0; line-height: 1.45; overflow-wrap: anywhere; }
.nav-item.is-active .task-icon { color: #f3d5df; }
.nav-children { margin: 0 0 8px 20px; padding-left: 9px; border-left: 1px solid #425069; }
.nav-children .nav-item { width: 100%; display: block; padding: 9px 10px; }
.nav-children .nav-label { font-size: .76rem; font-weight: 500; }
.task-icon { width: 34px; height: 34px; flex: 0 0 auto; }
.topbar-meta { flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; }
#student-language-picker { display: flex; align-items: center; gap: 8px; font-size: .75rem; }
#student-language-picker select { width: auto; min-width: 110px; padding: 7px 9px; }
.admin-home, .admin-area, .admin-help { --task-gold: #94702b; }
.admin-welcome { margin-bottom: 26px; }
.admin-welcome h2 { margin: 0; color: var(--navy-deep); font-family: Georgia, serif; font-size: clamp(1.9rem,3.3vw,3rem); font-weight: 500; letter-spacing: -.03em; }
.admin-welcome p { color: var(--ink-soft); font-size: 1rem; line-height: 1.6; margin: 10px 0 0; }
.start-guide { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-bottom: 26px; padding: 22px; border: 1px solid #e7dcc4; border-radius: 15px; background: #f8f5ee; }
.start-guide > div { flex: 1 1 170px; }
.start-guide h3 { margin: 0 0 8px; font: 1.5rem Georgia, serif; color: var(--navy-deep); }
.start-guide p { margin: 0; max-width: 260px; color: #785719; font-size: .84rem; line-height: 1.5; }
.start-guide ol { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); flex: 4 1 570px; list-style: none; padding: 0; margin: 0; gap: 12px; }
.start-guide li { min-width: 0; }
.start-guide li button { display: flex; align-items: center; width: 100%; height: 100%; gap: 9px; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: var(--navy-deep); text-align: left; font-size: .82rem; line-height: 1.5; }
.start-guide li button:hover:not(:disabled) { background: #efe5d0; }
.start-guide li small { display: block; color: var(--ink-soft); }
.step-number { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: #eee1c6; color: #705019; font: 1.4rem Georgia,serif; }
.guide-toggle { border: 1px solid #c6cbd2; border-radius: 999px; padding: 8px 12px; background: transparent; color: #4c5565; font-size: .76rem; }
.guide-restore { margin-bottom: 20px; }
.task-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.task-card { display: flex; flex-direction: column; min-width: 0; padding: 25px; border: 1px solid #e8e9eb; border-radius: 15px; background: white; box-shadow: 0 8px 26px #14284a06; }
.task-card h3 { display: flex; align-items: center; gap: 14px; margin: 0 0 24px; color: var(--task-gold); }
.task-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 1; border: 0; background: transparent; padding: 0; color: var(--navy-deep); font: 1.55rem Georgia,serif; text-align: left; overflow-wrap: anywhere; }
.task-title > span { color: var(--task-gold); }
.task-links { display: grid; gap: 8px; margin-bottom: 23px; }
.task-link { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 0; padding: 6px 0; color: #245ba8; background: transparent; font-size: .89rem; line-height: 1.5; text-align: left; }
.task-link:hover { text-decoration: underline; }
.task-primary { justify-content: space-between; margin-top: auto; min-height: 46px; background: var(--bordeaux); color: white; font-size: .87rem; font-weight: 600; text-align: left; }
.task-primary:hover { background: #68203b; }
.admin-footnote { margin: 32px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink-soft); text-align: center; font-size: .84rem; }
.admin-area > .button { margin-bottom: 25px; }
.admin-area .task-card { max-width: 760px; }
.admin-context { margin-bottom: 25px; }
.admin-context nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 18px; }
.task-guidance { background: #f8f5ee; padding: 22px; border: 1px solid #e7dcc4; border-radius: 12px; }
.task-guidance h2 { margin: 0; font: 1.5rem Georgia,serif; }
.task-guidance p { max-width: 850px; line-height: 1.65; }
.help-steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.help-steps p { line-height: 1.7; }
.assignment-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
button:disabled { cursor: not-allowed; opacity: .6; }
button:focus-visible { outline: 3px solid #b89347; outline-offset: 3px; }
@media (max-width: 1250px) { .task-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .topbar { flex-wrap: wrap; } }
@media (max-width: 700px) { .task-grid, .help-steps { grid-template-columns: minmax(0, 1fr); } .start-guide ol { grid-template-columns: repeat(2,minmax(0,1fr)); flex-basis: 100%; } .topbar-meta { justify-content: flex-start; } .task-card { padding: 22px; } }
@media (max-width: 480px) { .start-guide { padding: 18px; } .start-guide ol { grid-template-columns: minmax(0, 1fr); } .task-title { font-size: 1.4rem; } }

@media (max-width: 1020px) {
  .sidebar:not(.is-open) { visibility: hidden; }
  .sidebar.is-open { visibility: visible; }
}
