/* Existing workspace, refined in place: quiet navigation and readable academic data. */
.container, .header-container { padding-inline: var(--space-8); }
.header-container { padding-block: var(--space-4); }
.brand-logo { width: 44px; height: 44px; border-radius: 12px; }
.brand-logo svg { width: 32px; height: 32px; }
.app-title { font-size: 23px; font-weight: 700; letter-spacing: -.5px; }
.badge-eyebrow { font-size: var(--text-xs); }
.selector-label { font-size: var(--text-xs); }
.header-right-actions { align-items: end; gap: var(--space-5); }
.main-content { grid-template-columns: 232px minmax(0, 1fr); gap: var(--space-8); padding-top: var(--space-6); }
.workspace-body { min-width: 0; }
.workspace-sidebar { padding: 14px 10px 12px; border-radius: var(--radius-surface); box-shadow: var(--shadow-panel); }
.sidebar-caption { font-size: var(--text-xs); font-weight: 600; padding: 0 10px; }
.workspace-selectors { padding: 0 10px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--nav-line); margin-bottom: 12px; }
.workspace-selectors .selector-label { color: var(--nav-muted); font-size: 11px; }
.workspace-selectors .modern-select { width: 100%; min-width: 0; max-width: 100% !important; font-size: 12px; padding: 10px 8px; }
.workspace-selectors .select-container { min-width: 0; }
.nav-tabs { gap: 4px; }
.tab-btn { padding: 9px 10px; gap: 10px; border-radius: var(--radius-control); min-height: 48px; }
.tab-label { font-size: var(--text-sm); font-weight: 600; }
.tab-label small { font-size: var(--text-xs); font-weight: 400; line-height: 1.35; margin-top: 2px; }
.tab-icon { width: 22px; height: 22px; border: 0; background: transparent; flex-shrink: 0; }
.tab-icon svg { display: block; width: 20px; height: 20px; }
.sidebar-note { margin-top: 14px; padding: 14px 10px 0; font-size: var(--text-xs); }
.sidebar-note p { font-size: var(--text-sm); font-weight: 500; }
.sidebar-note small { font-size: var(--text-xs); line-height: 1.6; }
body[data-auth-state="workspace"] .sidebar-note { display: none; }
.sidebar-bottom { margin-top: 14px; padding-inline: 10px; padding-top: 12px; font-size: var(--text-sm); }
.sidebar-bottom span { font-size: var(--text-xs); }
.sub-header-content { font-size: var(--text-xs); padding-block: var(--space-2); }
.source-notice { padding: 12px 16px; font-size: var(--text-xs); line-height: 1.8; margin-bottom: var(--space-6); border-radius: var(--radius-control); border: 1px solid var(--border-subtle); border-left: 2px solid var(--accent-amber); align-items: start; }
.transcript-refresh-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; padding: 18px 20px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-card); }
.transcript-refresh-bar > div:first-child { min-width: 0; }
.transcript-refresh-bar h2 { font-size: 14px; margin: 0 0 6px; }
.transcript-refresh-bar p { color: var(--text-muted); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.transcript-refresh-bar #portal-refresh-time { font-size: 11px; margin-top: 4px; }
.transcript-refresh-bar.is-due { border-color: var(--border-focus); background: var(--info-bg); }
.transcript-refresh-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.transcript-refresh-actions [hidden] { display: none !important; }
@media (max-width: 640px) {
  .transcript-refresh-bar { align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
  .transcript-refresh-actions .portal-button { flex: 1; }
}
/* One compact page header across the five academic workspace tabs. */
.workspace-page-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 20px; min-height: 52px; margin: 0 0 12px; padding: 0; border: 0; }
.workspace-page-intro { min-width: 0; }
.workspace-page-header h2 { font-size: clamp(22px, 2vw, 26px); letter-spacing: -.4px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--text-main); }
.workspace-page-intro > p { color: var(--text-muted); font-size: var(--text-sm); line-height: 1.5; margin: 4px 0 0; max-width: 65ch; overflow-wrap: anywhere; }
.workspace-page-header > button { min-height: 44px; margin: 0; padding: 10px 14px; font-size: var(--text-sm); font-weight: 600; line-height: 1.5; border-radius: var(--radius-control); white-space: nowrap; }
:root:not([data-theme="dark"]) :is(.workspace-page-intro > p, #analytics-status) { color: #454a58; }
@media (max-width: 650px) {
  .workspace-page-header { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .workspace-page-header > button { justify-self: start; }
}
.page-context { font-size: var(--text-xs); font-weight: 500; color: var(--text-muted); margin: 0 0 6px; }
#tab-dashboard .kpi-grid { margin: 20px 0 24px; border-radius: 12px; padding: 20px 0; }
#tab-dashboard .kpi-card { padding: 0 22px; }
#tab-dashboard .kpi-title { font-size: 11px; }
#tab-dashboard .kpi-value { font-size: 32px; line-height: 1.4; margin: 8px 0; }
#tab-dashboard .kpi-sub { font-size: 10px; }
.dashboard-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.workspace-surface { border: 1px solid var(--border-subtle); border-radius: var(--radius-surface); background: var(--bg-card); padding: var(--space-6); box-shadow: var(--shadow-panel); }
.section-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.section-title h3, .profile-transcript-heading h3 { font-size: var(--text-section); font-weight: 600; letter-spacing: -.2px; }
.subtle-tag { background: var(--soft-surface); color: var(--text-muted); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 4px 8px; font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
.dashboard-program { margin-top: 18px; color: var(--text-muted); font-size: 12px; }
.credit-progress-value { display: flex; align-items: baseline; gap: 8px; margin: 14px 0; }
.credit-progress-value strong { font-size: 44px; line-height: 1.2; font-weight: 600; letter-spacing: -1.5px; }
.credit-progress-value span { color: var(--text-muted); font-size: 13px; }
#dashboard-progress { width: 100%; height: 10px; border: 0; border-radius: 5px; overflow: hidden; background: var(--border-subtle); accent-color: var(--accent-primary); }
#dashboard-progress::-webkit-progress-bar { background: var(--border-subtle); border-radius: 5px; }
#dashboard-progress::-webkit-progress-value { background: var(--action-gradient); border-radius: 5px; }
.muted-copy { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.8; margin-top: var(--space-2); max-width: 70ch; }
.dashboard-terms { margin: 18px 0; border-top: 1px solid var(--border-subtle); }
.dashboard-term-row { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; font-size: 11px; border-bottom: 1px solid var(--border-subtle); }
.dashboard-term-row strong { white-space: nowrap; font-weight: 500; color: var(--text-muted); }
.dashboard-empty { color: var(--text-muted); font-size: 12px; line-height: 1.9; padding: 20px 0; }
.text-action { font: inherit; font-size: var(--text-sm); font-weight: 500; color: var(--accent-primary); background: transparent; border: 0; padding: 10px 4px; min-height: 40px; cursor: pointer; }
.text-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.primary-action { color: #fff; background: var(--action-gradient); border-color: transparent; font-size: var(--text-sm); font-weight: 500; }
.dashboard-course { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); font-size: 12px; }
.dashboard-course strong { font-weight: 500; display: block; line-height: 1.6; }
.dashboard-course-code { display: block; font-size: 10px; margin-bottom: 3px; color: var(--text-muted); }
.dashboard-course-credits { flex-shrink: 0; font-size: 11px; color: var(--text-muted); }
.dashboard-next .primary-action { margin-top: 20px; width: 100%; }
.dashboard-guide { grid-column: 1 / -1; display: flex; align-items: center; gap: 20px; background: var(--soft-surface); }
.dashboard-guide h3 { font-size: 15px; }
.dashboard-guide p { color: var(--text-muted); font-size: 12px; margin-top: 6px; max-width: 65ch; line-height: 1.8; }
.dashboard-guide .portal-button { margin-left: auto; white-space: nowrap; font-size: 11px; }
.guide-symbol, .profile-emblem { display: grid; place-items: center; color: var(--accent-primary); background: var(--selected-surface); width: 52px; height: 52px; flex-shrink: 0; border-radius: 12px; font-size: 30px; }
/* The profile is now a full tab panel; no modal or nested vertical scrolling. */
#portal-dialog { width: 100%; max-height: none; padding: 0; border: 0; border-radius: 0; background: transparent; }
#portal-status { min-height: 1.5em; }
.profile-login-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.profile-welcome { padding: var(--space-8); background: var(--selected-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-surface); }
.profile-welcome h3 { font-size: 28px; margin-top: var(--space-6); max-width: 17ch; letter-spacing: -.4px; font-weight: 700; }
.profile-welcome p, .profile-welcome li { font-size: var(--text-base); line-height: 1.9; color: var(--text-muted); }
.profile-welcome p { margin-top: 16px; max-width: 40ch; }
.profile-welcome ul { padding-left: 18px; margin-top: 24px; }
.profile-welcome li { margin: 8px 0; }
#portal-login { width: 100%; max-width: none; margin: 0; padding: 28px; }
#portal-login > p { font-size: var(--text-base); line-height: 1.9; color: var(--text-muted); }
#portal-login label { font-size: var(--text-sm); font-weight: 500; }
#portal-login input { font-size: 16px; padding: 11px 12px; min-height: 46px; }
#portal-reauth { margin-bottom: 20px; }
#portal-reauth p { font-size: 13px; line-height: 1.8; color: var(--text-muted); }
#portal-reauth label { display: block; margin: 16px 0 8px; font-size: 12px; font-weight: 600; }
#portal-reauth input { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: 14px; padding: 11px; border: 1px solid var(--border-medium); border-radius: 8px; background: var(--bg-input); color: var(--text-main); }
#portal-reauth-account { color: var(--text-muted); }
.portal-password-row { gap: 8px; }
.portal-password-row input { flex-basis: 150px; }
.portal-button { font-size: var(--text-sm); font-weight: 500; min-height: 42px; transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease; }
.portal-button:hover:enabled { background: var(--hover-surface); border-color: var(--accent-primary); }
.portal-button:active:enabled { background: var(--selected-surface); }
.portal-button:disabled { cursor: not-allowed; }
.primary-action:hover:enabled, #portal-submit:hover:enabled { background: var(--action-hover); color: #fff; }
.portal-delete { color: var(--accent-rose); border-color: var(--accent-rose); }
.portal-delete:hover:enabled { background: var(--danger-bg); border-color: var(--accent-rose); }
#portal-submit { width: 100%; color: #fff; background: var(--action-gradient); border: 0; }
.profile-overview { padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-surface); box-shadow: var(--shadow-panel); }
.profile-identity-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.profile-account { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.profile-account > span { color: var(--text-muted); font-size: var(--text-xs); }
#portal-identity { font-size: 16px; letter-spacing: -.2px; margin: 0; overflow-wrap: anywhere; }
#portal-updated { color: var(--text-muted); font-size: var(--text-xs); margin-left: auto; }
.profile-facts { display: grid; grid-template-columns: 1.2fr 2fr .5fr 1fr 1.3fr; grid-template-areas: "name program cohort credits gpa"; padding-top: 12px; gap: 12px 18px; }
.profile-facts > div { display: grid; grid-template-rows: 1fr auto; gap: 4px; min-width: 0; }
.profile-fact-name { grid-area: name; }
.profile-fact-program { grid-area: program; }
.profile-fact-cohort { grid-area: cohort; }
.profile-fact-credits { grid-area: credits; }
.profile-fact-gpa { grid-area: gpa; }
.profile-facts span { display: block; color: var(--text-muted); font-size: var(--text-xs); line-height: 1.5; }
.profile-facts strong { font-size: var(--text-base); font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
:is(.profile-fact-credits, .profile-fact-gpa) strong { color: var(--accent-primary); font-size: 18px; font-variant-numeric: tabular-nums; }
.profile-transcript-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; }
.profile-transcript-heading p { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }
.profile-source-details { margin-top: 14px; color: var(--text-muted); font-size: var(--text-xs); }
.profile-source-details > summary { cursor: pointer; padding-block: 6px; }
#portal-summary { padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-control); font-size: var(--text-sm); line-height: 1.9; white-space: pre-wrap; margin: 8px 0 0; }
.profile-table-tools { display: grid; grid-template-columns: 1fr minmax(200px, .6fr); gap: 14px; margin: 12px 0; }
.profile-table-tools label { min-width: 0; display: grid; gap: var(--space-2); font-size: var(--text-xs); color: var(--text-muted); }
.profile-table-tools input, .profile-table-tools select { width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-medium); border-radius: var(--radius-control); background: var(--bg-input); color: var(--text-main); font: inherit; font-size: var(--text-sm); }
.portal-grade-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; color: var(--text-main); font-size: var(--text-sm); }
.portal-grade-filter .portal-button { padding: 7px 10px; }
#portal-dialog .portal-table-scroll { max-height: none; background: var(--bg-card); overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow-panel); }
#portal-table { font-size: var(--text-sm); }
#portal-table th, #portal-table td { padding: 11px 14px; border-inline: 0; }
#portal-table thead th { font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border-medium); }
#portal-table tbody tr:not(.portal-term):hover { background: var(--hover-surface); }
#portal-table thead th:nth-child(n+3) { text-align: right; }
#portal-table tbody tr:not(.portal-term) td:first-child { width: 106px; white-space: nowrap; font-size: var(--text-sm); color: var(--text-muted); }
#portal-table td:nth-child(2) { min-width: 260px; line-height: 1.75; }
#portal-table td:nth-child(n+3), #portal-table thead th:nth-child(n+3) { width: 80px; white-space: nowrap; }
#portal-table .portal-term td, #portal-table .portal-term th { font-size: var(--text-xs); padding-block: 12px; color: var(--text-muted); }
#portal-unparsed { margin-top: 16px; color: var(--text-muted); font-size: var(--text-sm); }
.portal-actions { padding: 20px 0; border-top: 1px solid var(--border-subtle); }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; }
input:not([type="checkbox"]):focus, select:focus { border-color: var(--border-focus); }
input::placeholder, textarea::placeholder { color: var(--text-dim); opacity: 1; }
@media (max-width: 1100px) {
  .profile-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "name program program" "cohort credits gpa"; }
  .main-content { grid-template-columns: 210px minmax(0, 1fr); gap: var(--space-6); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-guide { flex-wrap: wrap; }
  .profile-login-layout { grid-template-columns: 1fr; }
  .profile-welcome h3 { max-width: none; }
  .profile-welcome ul { display: flex; gap: 24px; flex-wrap: wrap; }
}
@media (max-width: 800px) {
  .main-content { display: block; padding-top: 16px; }
  .workspace-sidebar { position: static; padding: 12px; margin-bottom: 24px; }
  .workspace-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 0 12px; margin-bottom: 12px; }
  .workspace-selectors > div { min-width: 0; }
  .sidebar-caption, .sidebar-bottom, .sidebar-note { display: none; }
  .nav-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .tab-btn { flex: 0 0 auto; width: auto; min-width: 145px; }
  .tab-label { font-size: var(--text-sm); }
  .tab-label small { font-size: var(--text-xs); }
  .header-right-actions { gap: 12px; flex-wrap: wrap; }
  .profile-welcome { padding: 24px; }
}
@media (max-width: 520px) {
  .container, .header-container { padding-inline: 16px; }
  .header-container { flex-wrap: wrap; gap: 16px; }
  .header-right-actions { width: 100%; justify-content: space-between; align-items: end; flex-wrap: nowrap; }
  .header-right-actions .program-selector-wrapper { min-width: 110px; flex: 0; }
  .header-right-actions .appearance-control { width: auto; display: grid; gap: var(--space-1); }
  .header-right-actions .theme-switcher { min-width: 0; }
  .header-right-actions .theme-switcher button { min-height: 40px; min-width: 44px; padding-inline: 10px; }
  .nav-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); overflow: visible; padding-bottom: 0; }
  .tab-btn { width: 100%; min-width: 0; justify-content: start; min-height: 48px; }
  .tab-label { min-width: 0; white-space: normal; text-align: left; }
  .workspace-selectors .program-selector-wrapper:nth-child(2) { order: 0; flex-basis: auto; }
  #portal-open { order: 3; width: 100%; }
  .workspace-surface { padding: 20px; }
  .dashboard-guide { align-items: start; gap: 14px; }
  .dashboard-guide .portal-button { margin-left: 0; width: 100%; }
  #tab-dashboard .kpi-grid { grid-template-columns: 1fr 1fr; padding: 0; }
  #tab-dashboard .kpi-card { padding: 18px; }
  #tab-dashboard .kpi-title { font-size: 10px; }
  .profile-overview { padding: 12px 14px; }
  .profile-identity-strip { gap: 8px 12px; }
  .profile-account { flex: 1 1 140px; }
  #portal-updated { flex-basis: 100%; order: 1; margin-left: 0; }
  .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "name cohort" "program program" "credits gpa"; gap: 12px; }
  .profile-table-tools { grid-template-columns: 1fr; gap: 12px; }
  #portal-login { padding: 20px; }
  .profile-transcript-heading { flex-wrap: wrap; }
  .portal-actions { gap: 10px; }
  .portal-actions .portal-button { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { .tab-panel { animation: none; } }
.academic-readiness { margin: var(--space-5) 0; padding: var(--space-6); line-height: 1.8; font-size: var(--text-base); color: var(--text-muted); }
.academic-readiness ul { padding-left: 22px; margin-top: 12px; }
.sidebar-profile { display: grid; gap: 10px; padding: 0 10px 12px; margin-bottom: 10px; border-bottom: 1px solid var(--nav-line); }
.sidebar-profile span { display: block; color: var(--nav-muted); font-size: var(--text-xs); margin-bottom: 2px; }
.sidebar-profile strong { display: block; color: var(--text-main); font-size: var(--text-sm); font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.app-footer { font-size: var(--text-xs); padding: var(--space-6) 0 var(--space-8); line-height: 1.8; }

/* A short desktop viewport must not trap the lower navigation below the page. */
@media (min-width: 801px) {
  .workspace-sidebar {
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
  }
}
