:root {
  --site-header-height: 116px;
  --site-header-padding-x: 16px;
  --site-logo-height: 100px;
  --site-font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --navy: #023e8a;
  --blue: #0077b6;
  --teal: #0e95b5;
  --sky: #90e0ef;
  --orange: #e6993b;
  --ink: #203441;
  --muted: #61727d;
  --line: #d8e8ee;
  --surface: #f4fafc;
  --surface-subtle: #f8fcfd;
  --brand-soft: #eaf7fa;
  --control-border: #b9ced8;
  --white: #ffffff;
  --danger: #b42318;
  --success: #08785a;
  --warning: #a15c00;
  --success-surface: #e6f7ef;
  --success-text: #12633f;
  --warning-surface: #fff4d8;
  --warning-text: #7a4b00;
  --danger-surface: #fbe9e9;
  --danger-text: #8d2929;
  --info-surface: #e7f0ff;
  --info-text: #234f91;
  --shadow: 0 16px 40px rgba(2, 62, 138, 0.1);
}

/* Case status and shared feedback colours */
.student-status-summary {
  display: grid;
  gap: 0.7rem;
  min-width: 170px;
}
.student-status-summary > span {
  display: grid;
  gap: 0.3rem;
}
.student-status-summary small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-pill.case-active {
  color: var(--success-text);
  background: var(--success-surface);
}
.status-pill.case-on_hold {
  color: var(--warning-text);
  background: var(--warning-surface);
}
.status-pill.case-withdrawn {
  color: var(--danger-text);
  background: var(--danger-surface);
}
.status-pill.case-completed {
  color: var(--info-text);
  background: var(--info-surface);
}
.case-status-notice {
  border: 1px solid #e4bd65;
  border-left: 5px solid #c37a00;
  border-radius: 12px;
  background: #fff8e8;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
}
.student-status-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.student-status-form label {
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.25rem;
  text-align: left;
}
.student-status-form select {
  min-width: 150px;
}
.login-field-group {
  display: contents;
}
.login-field-group[hidden] {
  display: none;
}

/* Foundations */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--site-font-family);
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
  font-family: var(--site-font-family);
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}

.portal-logo-link {
  display: inline-flex;
}
.portal-logo {
  width: auto;
  height: var(--site-logo-height);
  object-fit: contain;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.text-link {
  color: var(--navy);
  font-weight: 700;
}

/* Authentication */
.portal-login-page {
  min-height: 100vh;
}
.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
}
.login-brand-panel {
  display: flex;
  min-height: 100%;
  padding: 46px clamp(32px, 7vw, 100px);
  flex-direction: column;
  justify-content: space-between;
  color: var(--white);
  background: linear-gradient(145deg, var(--navy), var(--teal));
}
.login-brand-panel .portal-logo {
  padding: 7px 12px;
  border-radius: 12px;
  background: var(--white);
}
.login-brand-panel .eyebrow {
  color: #bff4ff;
}
.login-brand-panel h1 {
  max-width: 670px;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.login-intro {
  max-width: 590px;
  margin: 24px 0 0;
  color: #e6faff;
  font-size: 1.15rem;
}
.login-form-panel {
  display: grid;
  padding: 40px;
  place-items: center;
  background: var(--white);
}
.login-card {
  width: min(100%, 470px);
}
.login-card h2 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 2rem;
}
.login-help {
  margin: 24px 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}
.login-progress-preview {
  display: flex;
  align-items: center;
  max-width: 420px;
}
.preview-dot {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}
.preview-dot.complete {
  border-color: #ffd48c;
  background: var(--orange);
}
.preview-dot.active {
  border-color: var(--white);
  background: var(--sky);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12);
}
.preview-line {
  width: 140px;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
}
.preview-line.complete {
  background: #ffd48c;
}

.portal-form {
  display: grid;
  gap: 11px;
  margin-top: 26px;
}
.portal-form label {
  color: var(--ink);
  font-weight: 700;
}
.portal-form .remember-email {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.2rem 0 0.4rem;
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
}
.portal-form .remember-email input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--teal);
}
.portal-form input,
.portal-form textarea,
.portal-form select,
.requirement-control input,
.requirement-control textarea,
.requirement-control select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
}
.portal-form textarea,
.requirement-control textarea {
  min-height: 100px;
  resize: vertical;
}
.portal-form input:focus,
.portal-form textarea:focus,
.portal-form select:focus,
.requirement-control input:focus,
.requirement-control textarea:focus,
.requirement-control select:focus {
  outline: 3px solid rgba(14, 149, 181, 0.18);
  border-color: var(--teal);
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 8px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  outline: none;
  background: var(--brand-soft);
}

.password-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .eye-closed,
.password-toggle.showing .eye-open {
  display: none;
}

.password-toggle.showing .eye-closed {
  display: block;
}

.portal-button {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 17px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: 0.18s ease;
}
.portal-button:hover {
  transform: translateY(-1px);
}
.portal-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}
.portal-button.primary {
  color: var(--white);
  background: var(--navy);
}
.portal-button.primary:hover {
  background: var(--blue);
}
.portal-button.secondary {
  color: var(--navy);
  border-color: var(--navy);
  background: var(--white);
}
.portal-button.ghost {
  color: var(--navy);
  border-color: var(--line);
  background: var(--white);
}
.portal-button.danger {
  color: var(--danger);
  border-color: #f0b8b2;
  background: #fff7f6;
}
.portal-button.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.88rem;
}
.portal-button.full {
  width: 100%;
  margin-top: 8px;
}

.form-message {
  margin: 4px 0;
  padding: 10px 12px;
  border-radius: 8px;
}
.form-message.error {
  color: var(--danger);
  background: #fff0ee;
}

/* Shared portal navigation */
.portal-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: var(--site-header-height);
  padding: 8px var(--site-header-padding-x);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}
.portal-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 6px;
}
.portal-nav[hidden] {
  display: none;
}
.portal-nav a {
  padding: 10px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}
.portal-nav a:hover,
.portal-nav a.active {
  color: var(--navy);
  background: var(--brand-soft);
}
@media (max-width: 1350px) {
  .portal-topbar {
    flex-wrap: wrap;
  }
  .portal-nav {
    order: 3;
    width: 100%;
    height: auto;
    overflow-x: auto;
    justify-content: center;
  }
  .portal-nav a {
    white-space: nowrap;
  }
}

.settings-page {
  max-width: 1180px;
}
.settings-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.settings-intro h1,
.settings-card h2 {
  margin: 0;
}
.settings-intro p,
.settings-card p {
  color: var(--muted);
}
.settings-owner-badge {
  padding: 10px 14px;
  border: 1px solid #b8dce6;
  border-radius: 999px;
  color: var(--navy);
  background: var(--brand-soft);
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}
.settings-layout {
  display: grid;
  gap: 18px;
}
.settings-card {
  padding: 24px;
  scroll-margin-top: calc(var(--site-header-height) + 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(2, 62, 138, 0.06);
}
.settings-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.settings-card-heading > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-weight: 800;
}
.settings-card-heading p {
  margin: 5px 0 0;
}
.settings-grid,
.colour-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.settings-grid label,
.colour-grid label,
.file-picker {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 750;
}
.settings-grid input,
.settings-grid textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #b8ced7;
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font: inherit;
}
.settings-wide {
  grid-column: 1 / -1;
}
.colour-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.colour-grid input[type="color"] {
  width: 100%;
  height: 54px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}
.logo-settings {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  gap: 24px;
}
.logo-preview-wrap {
  display: grid;
  min-height: 130px;
  padding: 18px;
  place-items: center;
  border: 1px dashed #9bbecb;
  border-radius: 12px;
  background: #f7fbfc;
}
.logo-preview-wrap img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}
.file-picker input {
  font-weight: 500;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.settings-save-bar {
  position: sticky;
  z-index: 30;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.settings-save-bar p {
  margin: 0 auto 0 0;
  color: var(--success);
  font-weight: 750;
}
.settings-save-bar p.error {
  color: var(--danger);
}
@media (max-width: 760px) {
  .settings-intro,
  .logo-settings {
    display: grid;
  }
  .settings-owner-badge {
    white-space: normal;
  }
  .settings-grid,
  .colour-grid {
    grid-template-columns: 1fr;
  }
  .settings-wide {
    grid-column: auto;
  }
}
.topbar-actions,
.user-chip {
  display: flex;
  align-items: center;
  gap: 13px;
}
.user-chip {
  min-width: 175px;
}
.user-chip small {
  display: block;
  color: var(--muted);
  text-transform: capitalize;
}
.user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--teal);
  font-weight: 800;
}
/* Shared page structure and student workflow */
.portal-main {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 70px;
}
.loading-state,
.empty-state {
  padding: 70px 24px;
  color: var(--muted);
  text-align: center;
}
.page-heading {
  display: flex;
  margin-bottom: 28px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.page-heading h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}
.page-heading p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
}
.student-welcome {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}
.student-photo-control {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 6px;
}
.student-dashboard-photo {
  display: grid;
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 4px solid var(--white);
  border-radius: 22px;
  color: var(--white);
  background: linear-gradient(145deg, var(--navy), var(--teal));
  box-shadow: 0 8px 24px rgba(2, 62, 138, 0.2);
  font-size: 1.35rem;
  font-weight: 850;
}
.student-dashboard-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.change-photo-button {
  padding: 3px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--navy);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}
.change-photo-button:hover,
.change-photo-button:focus-visible {
  outline: none;
  background: #e3f5f8;
  text-decoration: underline;
}
.change-photo-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.credential-banner {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid #f0cd92;
  border-left: 6px solid var(--orange);
  border-radius: 18px;
  background: #fff8ec;
  box-shadow: 0 12px 30px rgba(135, 79, 8, 0.09);
}

.credential-banner-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.credential-banner-heading h2 {
  margin: 0;
  color: var(--navy);
}

.credential-banner-heading p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
}

.credential-details {
  display: grid;
  margin-top: 18px;
  grid-template-columns: minmax(190px, 1fr) minmax(230px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.credential-details > div > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.credential-details strong {
  display: block;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #e8cfaa;
  border-radius: 10px;
  background: var(--white);
  overflow-wrap: anywhere;
}

.credential-password input {
  border-color: #e8cfaa;
}

.student-layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.phase-sidebar {
  position: sticky;
  top: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.phase-nav-button {
  display: grid;
  width: 100%;
  padding: 13px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.phase-nav-button + .phase-nav-button {
  margin-top: 5px;
}
.phase-nav-button:hover,
.phase-nav-button.selected {
  background: var(--brand-soft);
}
.phase-nav-button.locked {
  color: #89979f;
  cursor: not-allowed;
}
.phase-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  font-weight: 800;
}
.phase-nav-button.active .phase-index,
.phase-nav-button.submitted .phase-index {
  color: var(--white);
  border-color: var(--teal);
  background: var(--teal);
}
.phase-nav-button.approved .phase-index {
  color: var(--white);
  border-color: var(--success);
  background: var(--success);
}
.phase-nav-title {
  display: block;
  font-size: 0.93rem;
  font-weight: 750;
  line-height: 1.25;
}
.phase-nav-status {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: capitalize;
}

.phase-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.phase-panel-header {
  scroll-margin-top: calc(var(--site-header-height) + 24px);
  padding: 26px 28px;
  color: var(--white);
  background: linear-gradient(125deg, var(--navy), var(--teal));
}
.phase-panel-header h2 {
  margin: 4px 0 7px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}
.phase-panel-header p {
  margin: 0;
  color: #dff9ff;
}
.progress-track {
  height: 9px;
  margin-top: 19px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.24);
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffd48c;
}
.phase-deadline-banner {
  display: grid;
  padding: 14px 22px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #e8bc68;
  color: #4f3500;
  background: #fff2ce;
}
.phase-deadline-banner.overdue {
  border-bottom-color: #db8e86;
  color: #721c16;
  background: #ffe4e1;
}
.phase-deadline-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #b36b00;
  font-size: 1rem;
  font-weight: 900;
}
.phase-deadline-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phase-deadline-banner.overdue .phase-deadline-icon {
  background: #b33229;
}
.phase-deadline-banner small,
.phase-deadline-banner strong {
  display: block;
}
.phase-deadline-banner small {
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.phase-deadline-banner strong {
  font-size: 1rem;
}
.phase-deadline-zone {
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.requirements-list {
  display: grid;
  padding: 20px 28px 26px;
  gap: 12px;
  background: #f8fbfc;
}
.requirement-card {
  display: grid;
  padding: 18px;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 5px 16px rgba(2, 62, 138, 0.045);
}
.requirement-icon {
  display: grid;
  width: 50px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--navy);
  background: var(--brand-soft);
  font-weight: 850;
}
.requirement-card.approved .requirement-icon {
  color: var(--white);
  background: var(--success);
}
.requirement-card.changes_requested .requirement-icon {
  color: var(--white);
  background: var(--warning);
}
.requirement-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}
.requirement-heading h3 {
  margin: 3px 0 3px;
  font-size: 1.05rem;
}
.requirement-meta {
  color: var(--muted);
  font-size: 0.85rem;
}
.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 99px;
  color: var(--navy);
  background: var(--brand-soft);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}
.status-pill.approved {
  color: #07543f;
  background: #dff7ed;
}
.status-pill.changes_requested {
  color: #7a4300;
  background: #fff0d5;
}
.status-pill.submitted {
  color: #064d62;
  background: #dff6fb;
}
.status-pill.locked {
  color: #66757d;
  background: #edf1f3;
}
.requirement-control {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.contact-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.contact-field-grid label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 750;
}
.contact-field-wide {
  grid-column: 1 / -1;
}
.contact-details-control input {
  min-height: 42px;
  padding: 8px 11px;
}
.submitted-text {
  white-space: pre-line;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checkbox-row input {
  width: 20px;
  min-height: 20px;
  margin-top: 3px;
}
.file-list {
  display: flex;
  margin-top: 10px;
  padding: 0;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.file-list li {
  display: inline-flex;
  overflow: hidden;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.file-list a {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: var(--surface);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}
.file-list li > a {
  border: 0;
  border-radius: 0;
}
.file-remove-button {
  padding: 6px 10px;
  border: 0;
  border-left: 1px solid #efc0bb;
  color: var(--danger);
  background: #fff7f6;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}
.file-remove-button:hover {
  background: #ffe9e6;
}
.feedback {
  margin: 11px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--orange);
  border-radius: 7px;
  color: #70420a;
  background: #fff6e8;
}
.phase-actions {
  display: flex;
  padding: 20px 28px 28px;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}

.phase-review-reminder {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid #9ad9c2;
  border-radius: 14px;
  background: #edf9f4;
  color: #123d32;
}

.phase-review-reminder-icon {
  display: grid;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: #087e67;
  color: #fff;
  font-weight: 800;
}

.phase-review-reminder span:last-child {
  display: grid;
  gap: 0.15rem;
}

.phase-review-reminder small {
  color: #315d52;
  line-height: 1.45;
}

/* Administration, accounts and dashboard */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.7fr);
  gap: 28px;
  align-items: start;
}
.accounts-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(380px, 0.8fr);
  gap: 28px;
  align-items: start;
}
.account-create-column {
  position: sticky;
  top: 118px;
}
.account-workspace-tabs {
  margin-bottom: 1rem;
}
.account-workspace-panel {
  width: 100%;
}
.account-workspace-panel > .admin-panel {
  margin: 0;
}
.account-tab-count {
  display: inline-grid;
  min-width: 1.6rem;
  height: 1.6rem;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
}
.account-list {
  display: grid;
  gap: 10px;
}
.account-row {
  display: grid;
  padding: 15px;
  grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.accounts-layout .account-row {
  padding: 11px;
  grid-template-columns: minmax(0, 1fr) minmax(115px, 0.6fr);
  gap: 8px;
}
.accounts-layout .account-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}
.accounts-layout .account-actions .portal-button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 0.78rem;
}
.account-row:hover {
  border-color: #a9dce6;
  background: var(--surface-subtle);
}
.account-person strong,
.account-person small,
.account-meta small,
.account-meta span {
  display: block;
}
.account-person strong {
  color: var(--navy);
}
.account-person small,
.account-meta small {
  color: var(--muted);
}
.account-meta small {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}
.account-meta span {
  margin-top: 3px;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.account-search {
  display: grid;
  margin-bottom: 14px;
  gap: 5px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 750;
}
.account-search input {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  color: var(--ink);
  background: var(--white);
}
.account-search input:focus {
  outline: 3px solid rgba(14, 149, 181, 0.18);
  border-color: var(--teal);
}
.account-pagination {
  display: flex;
  margin-top: 15px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}
.account-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.password-reveal-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.dashboard-heading {
  align-items: flex-end;
}
.dashboard-page .portal-main {
  width: min(1720px, calc(100% - 28px));
}
.dashboard-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}
.pipeline-summary {
  display: grid;
  margin-bottom: 22px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.pipeline-metric {
  display: grid;
  min-width: 0;
  padding: 18px 16px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(2, 62, 138, 0.06);
  text-decoration: none;
}
.pipeline-metric.metric-link {
  border-color: #abdce6;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pipeline-metric.metric-link:hover {
  border-color: var(--teal);
  background: #f4fcfd;
  transform: translateY(-1px);
}
.pipeline-metric.metric-link:focus-visible {
  outline: 3px solid rgba(8, 123, 152, 0.3);
  outline-offset: 2px;
}
.pipeline-metric.metric-link[aria-pressed="true"] {
  border-color: var(--teal);
  background: #eefbfc;
}
.pipeline-summary strong {
  color: var(--navy);
  font-size: 1.7rem;
  line-height: 1.1;
}
.pipeline-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.pipeline-summary small {
  margin-top: 7px;
  overflow: hidden;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.pipeline-row-overdue {
  background: #fff8f2;
}
.pipeline-row-overdue:hover {
  background: #fff2e8;
}
.pipeline-filters {
  display: grid;
  padding: 12px 14px;
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.pipeline-filters label {
  min-width: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}
.pipeline-filters select,
.pipeline-filters input {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 3px;
  padding: 6px 30px 6px 9px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-size: 0.86rem;
}
.pipeline-filters input {
  padding-right: 9px;
}
.pipeline-search {
  grid-column: span 2;
}
.pipeline-filters .portal-button {
  min-height: 38px;
  align-self: end;
  justify-self: start;
  white-space: nowrap;
}
.pipeline-result-bar {
  padding: 12px 20px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.pipeline-bulk-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.pipeline-bulk-bar span:first-child {
  margin-right: auto;
}
.pipeline-table-wrap {
  overflow-x: auto;
}
.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.pipeline-table th {
  padding: 13px 15px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 0.76rem;
  letter-spacing: 0.035em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.pipeline-table td {
  min-width: 135px;
  padding: 15px;
  vertical-align: top;
  border-top: 1px solid var(--line);
}
.pipeline-table tbody tr {
  cursor: pointer;
}
.pipeline-table tbody tr:hover {
  background: #f5fbfd;
}
.pipeline-table th:first-child,
.pipeline-table td:first-child {
  width: 44px;
  min-width: 44px;
  padding-right: 10px;
  padding-left: 10px;
}
.pipeline-table td small,
.phase-cell {
  display: block;
}

@media (min-width: 1100px) {
  .pipeline-table {
    table-layout: fixed;
  }
  .pipeline-table th {
    padding: 12px 10px;
    white-space: normal;
  }
  .pipeline-table td {
    min-width: 0;
    padding: 13px 10px;
    overflow-wrap: anywhere;
  }
  .pipeline-table th:nth-child(2) {
    width: 15%;
  }
  .pipeline-table th:nth-child(3) {
    width: 8%;
  }
  .pipeline-table th:nth-child(4) {
    width: 12%;
  }
  .pipeline-table th:nth-child(5) {
    width: 19%;
  }
  .pipeline-table th:nth-child(6) {
    width: 13%;
  }
  .pipeline-table th:nth-child(7) {
    width: 10%;
  }
  .pipeline-table th:nth-child(8) {
    width: 9%;
  }
  .pipeline-table th:nth-child(9) {
    width: 8%;
  }
}
.pipeline-table td > small,
.phase-cell small {
  margin-top: 3px;
  color: var(--muted);
}
.student-name-link {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}
.student-name-link:hover {
  color: var(--blue);
  text-decoration: underline;
}
.phase-cell .status-pill {
  margin-top: 7px;
}
.empty-state.compact {
  padding: 36px 20px;
}
.detail-page-toolbar {
  margin-bottom: 16px;
}
.back-link {
  color: var(--navy);
  font-weight: 750;
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}
.profile-hero {
  display: flex;
  padding: 26px 28px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 20px 20px 0 0;
  color: var(--white);
  background: linear-gradient(125deg, #023e8a, #087f9c);
  box-shadow: var(--shadow);
}

.withdrawn-record-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid #d39a45;
  border-radius: 18px;
  background: #fff8e8;
  color: #5d3a07;
}

.withdrawn-record-banner h1,
.withdrawn-record-banner p {
  margin: 0;
}

.withdrawn-record-banner .eyebrow {
  margin-bottom: 0.35rem;
}

.withdrawn-profile {
  border-color: #e0c89d;
  background: #fffdf8;
}
.profile-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 18px;
}
.profile-avatar {
  display: grid;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  color: var(--navy);
  background: #dff7fb;
  font-size: 1.65rem;
  font-weight: 850;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  object-position: center center;
}
.profile-identity .eyebrow {
  color: #bff4ff;
}
.profile-identity h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.1;
}
.profile-identity p:last-child {
  margin: 7px 0 0;
  color: #dff9ff;
  overflow-wrap: anywhere;
}
.profile-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 11px;
}
.profile-hero-actions .status-pill {
  color: #073b4c;
  background: #dff7fb;
}
.profile-hero-actions .portal-button {
  border-color: rgba(255, 255, 255, 0.72);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}
.profile-hero-actions .portal-button:hover {
  background: rgba(255, 255, 255, 0.16);
}
.profile-hero-actions .portal-button.danger {
  border-color: #ffb5ae;
  color: #fff;
  background: #a92b21;
}
.profile-hero-actions .portal-button.danger:hover {
  background: #8f2119;
}
.profile-information {
  display: grid;
  padding: 20px 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: var(--white);
}
.profile-information div {
  min-width: 0;
  padding: 10px 12px;
  border-left: 3px solid #bce8ef;
  background: #f7fbfc;
}
.profile-information small,
.profile-information strong {
  display: block;
}
.profile-information small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.profile-information strong {
  margin-top: 3px;
  font-size: 0.91rem;
  overflow-wrap: anywhere;
}
.profile-workspace {
  display: grid;
  margin-top: 26px;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}
.profile-phase-sidebar {
  position: sticky;
  top: 116px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.profile-progress-summary {
  padding: 17px;
  border-bottom: 1px solid var(--line);
}
.profile-progress-summary > span {
  color: var(--muted);
  font-size: 0.86rem;
}
.profile-progress-summary strong {
  color: var(--navy);
  font-size: 1.15rem;
}
.profile-progress-track {
  height: 7px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2edf1;
}
.profile-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--navy));
}
.profile-phase-sidebar nav {
  display: grid;
  padding: 8px;
}
.profile-phase-link {
  display: grid;
  padding: 10px;
  grid-template-columns: 30px minmax(0, 1fr) 9px;
  align-items: center;
  gap: 9px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.profile-phase-link:hover,
.profile-phase-link.current {
  color: var(--navy);
  background: var(--brand-soft);
}
.profile-phase-number {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--navy);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 850;
}
.profile-phase-link.approved .profile-phase-number {
  border-color: var(--success);
  color: var(--white);
  background: var(--success);
}
.profile-phase-link strong,
.profile-phase-link small {
  display: block;
}
.profile-phase-link strong {
  font-size: 0.84rem;
}
.profile-phase-link small {
  overflow: hidden;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phase-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8b6bd;
}
.profile-phase-link.active .phase-status-dot {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 149, 181, 0.13);
}
.profile-phase-link.submitted .phase-status-dot {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(230, 153, 59, 0.14);
}
.profile-phase-link.approved .phase-status-dot {
  background: var(--success);
}
.profile-phase-content {
  min-width: 0;
}
.section-heading {
  margin-bottom: 15px;
}
.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.55rem;
}
.profile-phase-card {
  scroll-margin-top: 118px;
  background: var(--white);
  box-shadow: 0 7px 22px rgba(2, 62, 138, 0.055);
}
.profile-phase-card summary {
  padding: 17px 19px;
  background: var(--white);
}
.profile-phase-card[open] {
  border-color: #a9dce6;
  box-shadow: 0 12px 28px rgba(2, 62, 138, 0.09);
}
.profile-phase-card[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f2fbfd;
}
.phase-summary-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  color: var(--navy);
}
.phase-summary-title > span:last-child {
  font-weight: 800;
}
.phase-summary-title small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.admin-panel-header {
  display: flex;
  padding: 20px 22px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.admin-panel-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.25rem;
}
.admin-panel-body {
  padding: 20px 22px;
}
.admin-panel-spaced {
  margin-top: 18px;
}
.communication-panel > summary {
  cursor: pointer;
  list-style: none;
}
.communication-panel > summary::-webkit-details-marker {
  display: none;
}
.communication-panel:not([open]) > summary {
  border-bottom: 0;
}
.communication-panel-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.communication-panel[open] .collapse-indicator {
  transform: rotate(180deg);
}
.communication-new {
  background: #fff1c7;
  border-color: #ebc358;
  color: #704d00;
}
.student-logins-panel > summary {
  cursor: pointer;
  list-style: none;
}
.student-logins-panel > summary::-webkit-details-marker {
  display: none;
}
.student-logins-panel > summary .status-pill {
  margin-left: auto;
}
.student-logins-panel > summary::after {
  content: "▾";
  color: var(--teal);
  font-size: 1.1rem;
  transition: transform 0.18s ease;
}
.student-logins-panel[open] > summary::after {
  transform: rotate(180deg);
}
.student-logins-panel:not([open]) > summary {
  border-bottom: 0;
}
.student-list {
  display: grid;
  gap: 10px;
}
.student-list-button {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  text-align: left;
}
.student-list-button:hover,
.student-list-button.selected {
  border-color: var(--teal);
  background: #f0fbfd;
}
.student-list-button strong,
.student-list-button small {
  display: block;
}
.student-list-button small {
  margin-top: 3px;
  color: var(--muted);
}
.student-progress {
  margin-top: 9px;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 750;
}
.admin-student-heading {
  display: flex;
  margin-bottom: 18px;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}
.admin-student-heading h2 {
  margin: 0;
  color: var(--navy);
}
.student-contact-summary {
  display: flex;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.student-contact-summary span {
  display: grid;
  min-width: 150px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.student-contact-summary small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-phase {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.admin-phase summary {
  display: flex;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  background: var(--surface-subtle);
  font-weight: 800;
}
.admin-phase summary::-webkit-details-marker {
  display: none;
}
.admin-phase-content {
  padding: 4px 18px 18px;
}
.admin-requirement {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.admin-requirement:last-of-type {
  border-bottom: 0;
}
.admin-requirement-title {
  display: flex;
  align-items: center;
  gap: 9px;
}
.subphase-number {
  display: inline-flex;
  min-width: 42px;
  padding: 4px 7px;
  justify-content: center;
  border-radius: 7px;
  color: var(--navy);
  background: var(--brand-soft);
  font-size: 0.76rem;
  font-weight: 900;
}
.admin-review-actions {
  display: flex;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-review-actions input {
  min-width: 220px;
  flex: 1;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
}
.submitted-contact-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.submitted-contact-grid p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.submitted-contact-grid small,
.submitted-contact-grid strong {
  display: block;
}
.submitted-contact-grid small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.submitted-contact-grid strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.requirement-due-form {
  display: flex;
  margin-top: 11px;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}
.requirement-due-form label {
  display: grid;
  min-width: 220px;
  gap: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}
.requirement-due-form input {
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
}
.phase-deadline-editor {
  margin: 12px 0 8px;
  padding: 12px 14px;
  border: 1px solid #e8bc68;
  border-radius: 10px;
  background: #fff7df;
}
.phase-deadline-editor.overdue {
  border-color: #db8e86;
  background: #fff0ee;
}
.phase-deadline-editor label {
  color: #5c430d;
}
.phase-deadline-editor.overdue label {
  color: #721c16;
}
.student-message-panel {
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.student-message-panel > summary {
  display: flex;
  padding: 14px 18px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
.student-message-panel > summary strong,
.student-message-panel > summary small {
  display: block;
}
.student-message-panel > summary small {
  margin-top: 3px;
  color: var(--muted);
}
.student-message-body {
  padding: 0 18px 18px;
}
.conversation-list {
  display: grid;
  margin: 10px 0;
  gap: 8px;
}
.conversation-message {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef6f8;
}
.conversation-message.from-student {
  margin-left: auto;
  background: #e8f7fa;
}
.conversation-message p {
  margin: 4px 0;
  white-space: pre-wrap;
}
.conversation-message small {
  color: var(--muted);
  font-size: 0.73rem;
}
.message-compose {
  display: grid;
  margin-top: 12px;
  gap: 8px;
}
.message-compose label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
}
.message-compose textarea {
  width: 100%;
  min-height: 74px;
  padding: 9px 11px;
  border: 1px solid var(--control-border);
  border-radius: 9px;
  resize: vertical;
}
.message-compose .portal-button {
  justify-self: start;
}
.compact-copy {
  margin: 8px 0;
}
.case-management-grid {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.case-management-panel {
  min-width: 0;
}
.tasks-panel {
  grid-column: 1 / -1;
}
.task-list {
  display: grid;
  gap: 7px;
}
.task-row {
  display: flex;
  padding: 10px 11px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
}
.task-row.overdue {
  border-color: #e7aaa4;
  background: #fff5f4;
}
.task-row span,
.task-row strong,
.task-row small {
  display: block;
}
.task-row small {
  margin-top: 3px;
  color: var(--muted);
}
.task-row input:checked + span strong {
  color: var(--muted);
  text-decoration: line-through;
}
.task-compose {
  display: grid;
  margin-top: 12px;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  align-items: end;
  gap: 8px;
}
.task-compose label {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}
.task-compose input,
.task-compose select {
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
}
.profile-activity-panel {
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.profile-activity-panel > summary {
  display: flex;
  padding: 14px 17px;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--navy);
  font-weight: 800;
  list-style: none;
}
.profile-activity-panel > summary::-webkit-details-marker {
  display: none;
}
.profile-activity-panel > summary::after {
  content: "▾";
  color: var(--teal);
  transition: transform 0.18s ease;
}
.profile-activity-panel[open] > summary::after {
  transform: rotate(180deg);
}
.activity-list {
  display: grid;
  margin: 0;
  padding: 0 17px 17px;
  gap: 8px;
  list-style: none;
}
.activity-list li {
  display: grid;
  padding: 10px 12px;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border-left: 3px solid #bce8ef;
  background: #f7fbfc;
}
.activity-marker {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 149, 181, 0.11);
}
.activity-list strong,
.activity-list p,
.activity-list small {
  overflow-wrap: anywhere;
}
.activity-list p {
  margin: 3px 0;
  color: var(--ink);
  font-size: 0.87rem;
}
.activity-list small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}
.activity-pagination {
  margin: 0;
  padding: 0 17px 17px;
}
.custom-requirement {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
}
.custom-requirement summary {
  padding: 0;
  background: transparent;
  color: var(--navy);
}
.inline-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.portal-dialog {
  width: min(92vw, 500px);
  padding: 28px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(2, 35, 72, 0.28);
}
.portal-dialog::backdrop {
  background: rgba(1, 24, 47, 0.64);
  backdrop-filter: blur(3px);
}
.portal-dialog h2 {
  margin: 0;
  color: var(--navy);
}
.profile-edit-dialog {
  width: min(94vw, 780px);
  max-height: 90vh;
  overflow-y: auto;
}
.profile-edit-dialog .portal-form {
  margin-top: 0;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.dialog-close {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--navy);
  background: var(--white);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}
.dialog-close:hover {
  background: var(--brand-soft);
}
.dialog-actions {
  display: flex;
  margin-top: 8px;
  justify-content: flex-end;
  gap: 9px;
}
.portal-toast {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 17px;
  border-radius: 10px;
  color: var(--white);
  background: var(--ink);
  box-shadow: var(--shadow);
}

/* Forms library and lead management */
.forms-upload-panel {
  margin-bottom: 22px;
}
.forms-upload-panel .admin-panel-header p {
  margin: 3px 0 0;
}
.forms-upload-form {
  display: grid;
  padding: 20px 22px;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) auto;
  align-items: end;
  gap: 14px;
}
.forms-upload-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 750;
}
.forms-upload-form input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--control-border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--white);
}
.forms-upload-form input[type="file"] {
  padding: 7px 9px;
}
.forms-upload-form .form-message {
  grid-column: 1 / -1;
}
.forms-count {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}
.form-library-list {
  display: grid;
  padding: 16px 18px 18px;
  gap: 9px;
}
.form-library-row {
  display: flex;
  min-height: 66px;
  padding: 11px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.form-library-info {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.form-library-info strong {
  color: var(--navy);
}
.form-library-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-library-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}
.lead-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.lead-filters {
  display: grid;
  padding: 14px 18px;
  grid-template-columns: minmax(240px, 1.4fr) minmax(190px, 0.7fr) auto auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.lead-filters label,
.lead-update-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
}
.lead-filters input,
.lead-filters select,
.lead-update-form input,
.lead-update-form select,
.convert-lead-panel input,
.convert-lead-panel select {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: var(--white);
}
.lead-list {
  display: grid;
  padding: 14px 18px;
  gap: 9px;
}
.lead-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.lead-card > summary {
  display: flex;
  padding: 13px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}
.lead-card > summary::-webkit-details-marker {
  display: none;
}
.lead-card > summary strong,
.lead-card > summary small {
  display: block;
}
.lead-card > summary small {
  margin-top: 3px;
  color: var(--muted);
}
.lead-summary-meta {
  display: grid;
  justify-items: end;
}
.lead-card-body {
  padding: 16px;
  border-top: 1px solid var(--line);
  background: #fbfdfe;
}
.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.lead-detail-grid > div {
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
}
.lead-detail-grid small,
.lead-detail-grid strong {
  display: block;
}
.lead-detail-grid small {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}
.lead-message {
  padding: 12px;
  border-radius: 9px;
  background: var(--white);
  white-space: pre-wrap;
}
.lead-oshc-details {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #b9dce9;
  border-radius: 10px;
  background: #f2fbff;
}
.lead-oshc-details h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 1rem;
}
.convert-lead-panel {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}
.convert-lead-panel > summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 800;
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand-panel {
    min-height: 44vh;
    gap: 50px;
  }
  .login-brand-panel h1 {
    font-size: clamp(2.3rem, 9vw, 4.4rem);
  }
  .student-layout,
  .admin-layout,
  .accounts-layout {
    grid-template-columns: 1fr;
  }
  .account-create-column {
    position: static;
  }
  .account-row {
    grid-template-columns: 1fr 1fr;
  }
  .account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .phase-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }
  .phase-nav-button {
    min-width: 210px;
  }
  .credential-details {
    grid-template-columns: 1fr 1fr;
  }
  .credential-details > .portal-button {
    grid-column: 1 / -1;
  }
  .pipeline-filters {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }
  .pipeline-search {
    grid-column: span 2;
  }
  .pipeline-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-information {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-workspace {
    grid-template-columns: 1fr;
  }
  .profile-phase-sidebar {
    position: static;
  }
  .profile-phase-sidebar nav {
    display: flex;
    overflow-x: auto;
  }
  .profile-phase-link {
    min-width: 210px;
  }
  .forms-upload-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .task-compose {
    grid-template-columns: 1fr 1fr;
  }
  .lead-filters {
    grid-template-columns: 1fr 1fr;
  }
  .lead-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .portal-topbar {
    min-height: var(--site-header-height);
    padding: 8px var(--site-header-padding-x);
  }
  .portal-logo {
    height: var(--site-logo-height);
  }
  .user-chip span:not(.user-avatar) {
    display: none;
  }
  .user-chip {
    min-width: auto;
  }
  .portal-nav {
    order: 3;
    width: 100%;
    height: auto;
    justify-content: center;
  }
  .portal-topbar {
    flex-wrap: wrap;
  }
  .portal-main {
    width: min(100% - 24px, 1440px);
    padding-top: 24px;
  }
  .page-heading {
    align-items: start;
    flex-direction: column;
  }
  .dashboard-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .student-welcome {
    align-items: flex-start;
  }
  .student-dashboard-photo {
    width: 68px;
    height: 68px;
    border-radius: 17px;
  }
  .credential-banner-heading {
    flex-direction: column;
  }
  .credential-details {
    grid-template-columns: 1fr;
  }
  .credential-details > .portal-button {
    grid-column: auto;
  }
  .phase-panel-header,
  .requirements-list,
  .phase-actions,
  .admin-panel-body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .phase-deadline-banner {
    padding-left: 16px;
    padding-right: 16px;
    grid-template-columns: auto minmax(0, 1fr);
  }
  .phase-deadline-zone {
    grid-column: 2;
    justify-self: start;
  }
  .requirement-heading {
    flex-direction: column;
  }
  .contact-field-grid {
    grid-template-columns: 1fr;
  }
  .submitted-contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-field-wide {
    grid-column: auto;
  }
  .inline-grid {
    grid-template-columns: 1fr;
  }
  .account-row {
    grid-template-columns: 1fr;
  }
  .account-actions {
    grid-column: auto;
  }
  .account-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
  .profile-hero {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 16px 16px 0 0;
  }
  .profile-hero-actions {
    width: 100%;
    align-items: flex-start;
  }
  .profile-information {
    grid-template-columns: 1fr;
  }
  .profile-identity {
    align-items: flex-start;
  }
  .profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 18px;
  }
  .pipeline-summary,
  .pipeline-filters {
    grid-template-columns: 1fr;
  }
  .pipeline-search {
    grid-column: auto;
  }
  .form-library-row {
    align-items: stretch;
    flex-direction: column;
  }
  .form-library-actions {
    justify-content: flex-end;
  }
  .lead-summary,
  .lead-filters,
  .lead-detail-grid {
    grid-template-columns: 1fr;
  }
  .case-management-grid,
  .task-compose {
    grid-template-columns: 1fr;
  }
  .tasks-panel {
    grid-column: auto;
  }
  .lead-card > summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .lead-summary-meta {
    justify-items: start;
  }
  .login-form-panel {
    padding: 34px 22px;
  }
  .login-brand-panel {
    padding: 30px 24px;
  }
}
/* Education providers */
.provider-hero {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.25rem;
}
.provider-hero h1 {
  margin: 0.2rem 0 0.45rem;
}
.provider-search {
  min-width: min(100%, 360px);
}
.provider-filters {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.provider-filters label {
  min-width: 180px;
}
.application-choice-summary {
  margin: 0.8rem 0;
}
.legacy-answer {
  padding: 0.75rem;
  background: #fff8e8;
  border-radius: 10px;
}
.provider-scope-note {
  display: flex;
  gap: 0.55rem;
  flex-direction: column;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border-left: 5px solid #d59b2d;
  background: #fff8e8;
  border-radius: 12px;
  color: #263f47;
}
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.provider-card {
  background: #fff;
  border: 1px solid #dbe5e8;
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(20, 55, 65, 0.08);
}
.provider-card h2 {
  margin: 0.8rem 0 0.25rem;
  font-size: 1.25rem;
}
.provider-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.provider-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #0d6570;
  color: #fff;
  font-weight: 800;
}
.provider-meta {
  color: #657780;
  margin-top: 0;
}
.provider-website {
  display: inline-flex;
  margin-top: 0.4rem;
  text-decoration: none;
}
.provider-inactive {
  opacity: 0.72;
  border-style: dashed;
}
.provider-edit {
  margin-top: 1rem;
  border-top: 1px solid #e4eaec;
  padding-top: 0.8rem;
}
.provider-edit summary {
  cursor: pointer;
  font-weight: 700;
}
.provider-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.compact-form {
  margin-top: 1rem;
}
.checkbox-line {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
}
.checkbox-line input {
  width: auto !important;
}
.provider-create-panel {
  margin-bottom: 1.25rem;
}
@media (max-width: 760px) {
  .provider-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .provider-search {
    min-width: 0;
  }
  .provider-form-grid {
    grid-template-columns: 1fr;
  }
}
/* Commission management */
.commission-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.25rem;
}
.commission-heading h1 {
  margin: 0.2rem 0 0.4rem;
}
.commission-privacy {
  display: flex;
  flex-direction: column;
  max-width: 310px;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #eaf6f7;
  border: 1px solid #b7dadd;
}
.commission-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.commission-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem;
  background: #fff;
  border: 1px solid #dbe5e8;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(20, 55, 65, 0.06);
}
.commission-metric strong {
  font-size: 1.55rem;
  color: #0b5360;
}
.commission-metric.attention {
  border-top: 4px solid #d59b2d;
}
.commission-metric.risk {
  border-top: 4px solid #be4c45;
}
.commission-metric.success {
  border-top: 4px solid #2f8b67;
}
.commission-panel {
  background: #fff;
  border: 1px solid #dbe5e8;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(20, 55, 65, 0.07);
}
.commission-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid #e5edef;
}
.commission-panel-header h2 {
  margin: 0.15rem 0 0;
}
.commission-collapsible > summary {
  cursor: pointer;
  list-style: none;
}
.commission-collapsible > summary::-webkit-details-marker {
  display: none;
}
.commission-collapsible:not([open]) > summary {
  border-bottom: 0;
}
.commission-panel-header > span {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.collapse-indicator {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: #edf5f6;
  color: #0b5360;
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}
.commission-collapsible[open] .collapse-indicator {
  transform: rotate(180deg);
}
.commission-filters {
  display: flex;
  gap: 0.8rem;
  align-items: end;
  flex-wrap: wrap;
  padding: 1rem 1.2rem;
  background: #f7fafb;
}
.commission-filters label:first-child {
  flex: 1 1 300px;
}
.commission-table-wrap {
  overflow: auto;
}
.commission-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}
.commission-table th {
  padding: 0.8rem 1rem;
  text-align: left;
  background: #edf5f6;
  color: #405b63;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.commission-table td {
  padding: 1rem;
  border-top: 1px solid #e7edef;
  vertical-align: top;
}
.commission-table td strong,
.commission-table td small {
  display: block;
  margin-bottom: 0.25rem;
}
.commission-table td .commission-student-id {
  margin-top: 0.35rem;
}
.commission-validation-error {
  color: #92392f;
  font-weight: 750;
}
.commission-schedule-grid select[aria-invalid="true"] {
  border-color: #c84c42;
  box-shadow: 0 0 0 3px rgba(200, 76, 66, 0.14);
}
.commission-table td .status-pill {
  display: inline-flex;
  margin: 0.25rem 0;
}
.commission-overdue {
  background: #fff5f3;
}
.commission-status-select {
  min-width: 170px;
}
.commission-edit-button {
  display: block;
  margin-top: 0.55rem;
  white-space: nowrap;
}
.commission-edit-row td {
  padding: 0 1rem 1.2rem;
  background: #f7fafb;
}
.commission-edit-form {
  padding: 1rem;
  border: 1px solid #cfdfe2;
  border-radius: 12px;
  background: #fff;
}
.commission-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.commission-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
}
.commission-form-grid label small {
  font-weight: 400;
}
.commission-notes-field {
  grid-column: 1 / -1;
}
.commission-form-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1rem;
}
.commission-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
.agreement-list {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}
.agreement-management {
  padding-bottom: 0.25rem;
}
.agreement-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem 0;
}
.agreement-toolbar p {
  margin: 0;
  color: #60747b;
}
.agreement-management-form {
  margin: 1rem 1.2rem 0;
  padding: 1rem;
  border: 1px solid #cfdfe2;
  border-radius: 12px;
  background: #f7fafb;
}
.agreement-edit-button {
  margin-top: 0.75rem;
}
.agreement-pdf-link {
  display: block;
  margin-top: 0.6rem;
  font-weight: 700;
  color: #0b6573;
  overflow-wrap: anywhere;
}
.agreement-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1.3fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e1e9eb;
  border-radius: 12px;
}
.agreement-card h3 {
  margin: 0.55rem 0 0.15rem;
}
.agreement-card p {
  margin: 0;
  color: #657780;
}
.agreement-card dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0;
}
.agreement-card dt {
  color: #6a7b82;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.agreement-card dd {
  margin: 0.25rem 0 0;
  font-weight: 700;
}
.commission-workflow {
  padding: 1.2rem;
  border-radius: 18px;
  background: #123c47;
  color: #fff;
}
.commission-workflow h2 {
  margin: 0.2rem 0 0.8rem;
}
.commission-workflow li {
  margin: 0.55rem 0;
}
.commission-workflow p:last-child {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.commission-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  margin-bottom: 1rem;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #cfe0e3;
  border-radius: 14px;
  background: #edf5f6;
}
.commission-tab {
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #35545c;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.commission-tab.active {
  background: #0b6573;
  color: #fff;
  box-shadow: 0 5px 15px rgba(11, 101, 115, 0.22);
}
.commission-workspace-panel {
  overflow: hidden;
  border: 1px solid #dbe5e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 55, 65, 0.07);
}
.commission-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem;
  border-bottom: 1px solid #e5edef;
}
.commission-section-heading h2,
.commission-action-panel h3 {
  margin: 0.15rem 0 0.35rem;
}
.commission-section-heading p:last-child,
.commission-action-panel p:last-child {
  margin: 0;
  color: #60747b;
}
.commission-payment-table,
.commission-case-table {
  min-width: 1180px;
}
.commission-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 125px;
}
.commission-action-panel {
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid #bfd7dc;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 55, 65, 0.08);
}
.commission-payment-form-grid,
.commission-schedule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}
.commission-schedule-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.commission-payment-form-grid label,
.commission-schedule-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
}
.commission-schedule-grid small {
  font-weight: 400;
}
.commission-payment-status.overdue {
  background: #fde8e5;
  color: #92392f;
}
.commission-payment-status.partially_paid,
.commission-payment-status.due {
  background: #fff0cf;
  color: #805b12;
}
.commission-payment-status.paid {
  background: #dff3e8;
  color: #23684c;
}
.commission-payment-status.upcoming {
  background: #e6f2f5;
  color: #245e69;
}
@media (max-width: 1050px) {
  .commission-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .commission-split {
    grid-template-columns: 1fr;
  }
  .commission-payment-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .commission-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .commission-heading,
  .agreement-toolbar,
  .commission-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .commission-privacy {
    max-width: none;
  }
  .commission-metrics {
    grid-template-columns: 1fr;
  }
  .agreement-card,
  .agreement-card dl,
  .commission-form-grid,
  .commission-payment-form-grid,
  .commission-schedule-grid {
    grid-template-columns: 1fr;
  }
  .commission-tabs {
    width: 100%;
  }
  .commission-tab {
    flex: 1 0 auto;
  }
}
/* Always expose keyboard focus before the portal application renders. */
.skip-link {
  position: fixed;
  z-index: 10000;
  top: 0.5rem;
  left: 0.5rem;
  transform: translateY(-160%);
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: #002f6c;
  color: #fff;
  font-weight: 700;
}
.skip-link:focus {
  transform: translateY(0);
}

/* Agency settings workspace */
.settings-access {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.settings-access small {
  color: var(--muted);
  text-align: right;
}
.settings-workspace {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}
.settings-section-nav {
  position: sticky;
  top: calc(var(--site-header-height) + 18px);
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}
.settings-section-nav strong {
  padding: 14px 16px;
  color: var(--navy);
  background: color-mix(in srgb, var(--teal) 10%, white);
}
.settings-section-nav a {
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}
.settings-section-nav a:hover,
.settings-section-nav a:focus-visible {
  color: var(--navy);
  background: var(--surface);
}
.settings-card > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.settings-card > summary::-webkit-details-marker {
  display: none;
}
.settings-card:not([open]) .settings-card-heading {
  margin-bottom: 0;
}
.settings-disclosure-icon {
  width: 12px !important;
  height: 12px !important;
  flex: 0 0 12px !important;
  margin: 10px 4px 0 auto;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  border-radius: 0 !important;
  background: transparent !important;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}
.settings-card[open] .settings-disclosure-icon {
  transform: rotate(225deg);
}
.settings-grid label small,
.colour-grid label > small,
.asset-editor > p,
.preview-toolbar small,
.asset-details {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.settings-grid select,
.colour-control input[type="text"],
.colour-control input:not([type="color"]) {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b8ced7;
  border-radius: 9px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.asset-settings-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
}
.asset-editor {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.asset-editor h3,
.asset-editor p {
  margin-top: 0;
}
.asset-preview-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.asset-preview,
.favicon-preview {
  display: grid;
  min-height: 100px;
  padding: 14px;
  place-items: center;
  border: 1px dashed #9bbecb;
  border-radius: 10px;
}
.asset-preview.light,
.favicon-preview {
  background: white;
}
.asset-preview.dark {
  background: #142a3a;
}
.asset-preview img {
  max-width: 100%;
  max-height: 70px;
  object-fit: contain;
}
.favicon-preview {
  width: 110px;
  margin: 14px 0;
}
.favicon-preview img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.colour-control {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
}
.colour-control input[type="color"] {
  height: 48px;
}
.contrast-report {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.contrast-report span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
}
.contrast-report .pass {
  color: var(--success-text);
  background: var(--success-surface);
}
.contrast-report .warning {
  color: var(--warning-text);
  background: var(--warning-surface);
}
.contrast-report small {
  font-size: 0.72rem;
}
.social-settings a {
  width: fit-content;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
}
.social-settings a.disabled {
  pointer-events: none;
  color: var(--muted);
  opacity: 0.65;
}
.settings-preview-panel {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}
.settings-preview-panel[hidden] {
  display: none;
}
.appearance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.preview-toolbar {
  display: flex;
  padding: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.preview-toolbar > div:first-child {
  display: grid;
}
.device-toggle {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface);
}
.device-toggle button {
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}
.device-toggle button.active {
  color: var(--navy);
  background: white;
  box-shadow: 0 2px 6px rgba(2, 62, 138, 0.12);
}
.brand-preview {
  --preview-primary: #0077b6;
  --preview-secondary: #0e95b5;
  --preview-accent: #e6993b;
  overflow: hidden;
  margin: 14px;
  border: 1px solid color-mix(in srgb, var(--preview-primary) 18%, white);
  border-radius: 12px;
  background: color-mix(in srgb, var(--preview-primary) 7%, white);
  transition: width 160ms ease;
}
.brand-preview.mobile {
  width: 220px;
  margin-inline: auto;
}
.brand-preview > header {
  display: flex;
  min-height: 58px;
  padding: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--preview-primary);
  background: white;
  font-size: 0.7rem;
  font-weight: 800;
}
.brand-preview > header img {
  max-width: 105px;
  max-height: 38px;
  object-fit: contain;
}
.brand-preview > main {
  padding: 20px 16px;
}
.brand-preview h2 {
  margin: 8px 0;
  color: var(--preview-primary);
  font-size: 1.25rem;
  line-height: 1.15;
}
.brand-preview p {
  color: var(--ink);
  font-size: 0.75rem;
}
.preview-eyebrow {
  color: var(--preview-secondary);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0;
}
.preview-actions span {
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 0.68rem;
  font-weight: 800;
}
.preview-primary {
  color: white;
  background: var(--preview-primary);
}
.preview-secondary {
  color: #203441;
  background: var(--preview-accent);
}
.preview-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.brand-preview.mobile .preview-cards {
  grid-template-columns: 1fr;
}
.preview-cards article {
  display: grid;
  gap: 2px;
  padding: 9px;
  border-radius: 8px;
  background: white;
  font-size: 0.68rem;
}
.preview-cards small {
  color: var(--muted);
}
.preview-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
}
.preview-note strong {
  color: var(--ink);
}
.settings-save-bar > div:first-child {
  display: grid;
  gap: 3px;
}
.settings-save-bar #settingsStatus {
  font-size: 0.78rem;
}
.settings-dirty #changeState {
  color: var(--warning);
}
@media (max-width: 1180px) {
  .settings-workspace {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .settings-layout {
    grid-column: 2;
  }
}
@media (max-width: 780px) {
  .settings-workspace,
  .asset-settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-section-nav {
    position: static;
    grid-row: auto;
    display: flex;
    overflow-x: auto;
  }
  .settings-section-nav strong {
    display: none;
  }
  .settings-section-nav a {
    flex: 0 0 auto;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .settings-layout {
    grid-column: auto;
  }
  .settings-intro,
  .settings-save-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .settings-access {
    justify-items: start;
  }
  .settings-access small {
    text-align: left;
  }
  .contrast-report {
    grid-template-columns: 1fr;
  }
  .settings-save-bar .button-row {
    width: 100%;
  }
  .settings-save-bar .portal-button {
    flex: 1 1 auto;
  }
}

/* Mobile portal workspace: purpose-built layouts rather than compressed desktop screens. */
@media (max-width: 760px) {
  .portal-topbar {
    min-height: auto;
    padding: 8px 12px 0;
    gap: 8px;
  }
  .portal-logo {
    width: min(190px, 48vw);
    height: auto;
    max-height: 56px;
  }
  .topbar-actions {
    margin-left: auto;
    gap: 6px;
  }
  .user-avatar {
    width: 36px;
    height: 36px;
  }
  .topbar-actions .portal-button {
    min-height: 42px;
    padding-inline: 11px;
  }
  .portal-nav {
    width: calc(100% + 24px);
    margin-inline: -12px;
    padding: 7px 12px 9px;
    justify-content: flex-start;
    gap: 4px;
    border-top: 1px solid var(--line);
    scrollbar-width: thin;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
  }
  .portal-nav a {
    min-height: 42px;
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .portal-main,
  .dashboard-page .portal-main {
    width: calc(100% - 24px);
    padding: 22px 0 52px;
  }
  .page-heading,
  .provider-hero,
  .commission-heading {
    margin-bottom: 20px;
  }
  .page-heading h1,
  .provider-hero h1,
  .commission-heading h1 {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }
  .dashboard-heading-actions,
  .dashboard-heading-actions .portal-button,
  .provider-filters,
  .provider-filters label,
  .commission-filters label,
  .commission-filters label:first-child {
    width: 100%;
    min-width: 0;
  }
  .commission-filters input,
  .commission-filters select {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: 5px;
    padding: 9px 11px;
    border: 1px solid var(--control-border);
    border-radius: 9px;
    color: var(--ink);
    background: var(--white);
  }
  .portal-button.small,
  .commission-status-select,
  .device-toggle button {
    min-height: 44px;
  }
  input,
  select,
  textarea,
  .pipeline-filters input,
  .pipeline-filters select,
  .lead-filters input,
  .lead-filters select {
    font-size: 16px;
  }
  .pipeline-summary,
  .lead-summary,
  .commission-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .pipeline-metric,
  .commission-metric {
    padding: 14px 12px;
  }
  .pipeline-filters,
  .lead-filters {
    padding: 14px;
    grid-template-columns: 1fr;
  }
  .pipeline-search {
    grid-column: auto;
  }
  .pipeline-filters .portal-button,
  .lead-filters .portal-button {
    width: 100%;
    justify-self: stretch;
  }
  .pipeline-result-bar,
  .pipeline-bulk-bar {
    padding: 12px 14px;
  }
  .pipeline-bulk-bar span:first-child {
    width: 100%;
    margin-right: 0;
  }
  .pipeline-bulk-bar .portal-button {
    flex: 1 1 135px;
  }
  .account-pagination {
    width: 100%;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .account-pagination > div {
    width: 100%;
    justify-content: space-between;
  }
  .pipeline-table-wrap,
  .commission-table-wrap {
    overflow: visible;
    padding: 12px;
    background: var(--surface-subtle);
  }
  .pipeline-table,
  .pipeline-table tbody,
  .commission-table,
  .commission-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .pipeline-table thead,
  .commission-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .pipeline-table tbody tr,
  .commission-table tbody tr:not(.commission-edit-row) {
    display: block;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 5px 15px rgba(2, 62, 138, 0.06);
  }
  .pipeline-table tbody tr:last-child,
  .commission-table tbody tr:last-child {
    margin-bottom: 0;
  }
  .pipeline-table td,
  .commission-table td {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 11px 13px;
    grid-template-columns: minmax(96px, 0.55fr) minmax(0, 1fr);
    gap: 12px;
    border-top: 1px solid var(--line);
    overflow-wrap: anywhere;
  }
  .pipeline-table td:first-child,
  .commission-table td:first-child {
    width: 100%;
    min-width: 0;
    border-top: 0;
  }
  .pipeline-table td::before,
  .commission-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.035em;
    line-height: 1.35;
    text-transform: uppercase;
  }
  .pipeline-table .pipeline-select-cell {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
  }
  .pipeline-table .pipeline-select-cell::before {
    content: "Select student";
  }
  .pipeline-table .student-select {
    width: 22px;
    height: 22px;
  }
  .commission-edit-row,
  .commission-edit-row td {
    display: block;
    width: 100%;
  }
  .commission-edit-row {
    margin: -5px 0 12px;
  }
  .commission-edit-row td {
    padding: 0;
    border: 0;
  }
  .commission-edit-row td::before {
    content: none;
  }
  .commission-status-select,
  .commission-edit-button,
  .commission-form-actions .portal-button,
  .agreement-toolbar .portal-button {
    width: 100%;
  }
  .commission-form-actions {
    flex-direction: column;
  }
  .commission-panel-header,
  .admin-panel-header,
  .settings-card-heading {
    padding: 16px;
    align-items: flex-start;
  }
  .commission-panel-header h2,
  .admin-panel-header h2 {
    font-size: 1.12rem;
  }
  .commission-panel-header > span {
    flex: 0 0 auto;
  }
  .agreement-management-form,
  .commission-edit-form {
    margin: 12px;
    padding: 14px;
  }
  .agreement-list,
  .lead-list,
  .form-library-list {
    padding: 12px;
  }
  .agreement-card,
  .agreement-card dl {
    grid-template-columns: 1fr;
  }
  .provider-grid {
    grid-template-columns: 1fr;
  }
  .provider-card {
    padding: 16px;
  }
  .provider-website {
    width: 100%;
  }
  .admin-panel-body,
  .forms-upload-form,
  .lead-card-body {
    padding: 16px;
  }
  .form-library-row,
  .form-library-actions,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .form-library-info span {
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .form-library-actions .portal-button,
  .dialog-actions .portal-button {
    width: 100%;
  }
  .profile-hero {
    padding: 20px 18px;
  }
  .profile-identity {
    min-width: 0;
  }
  .profile-identity h1,
  .profile-identity p {
    overflow-wrap: anywhere;
  }
  .profile-hero-actions,
  .student-status-form,
  .student-status-form label,
  .profile-hero-actions .portal-button {
    width: 100%;
  }
  .profile-hero-actions .portal-button,
  .student-status-form .portal-button {
    justify-content: center;
  }
  .phase-sidebar,
  .profile-phase-sidebar nav,
  .settings-section-nav {
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .phase-nav-button,
  .profile-phase-link,
  .settings-section-nav a {
    scroll-snap-align: start;
  }
  .phase-nav-button,
  .profile-phase-link {
    min-width: min(78vw, 270px);
  }
  .profile-phase-card summary,
  .admin-phase summary {
    align-items: flex-start;
  }
  .profile-phase-card summary .status-pill,
  .admin-phase summary .status-pill {
    flex: 0 0 auto;
  }
  .portal-dialog,
  .profile-edit-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
  }
  .portal-toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
  .settings-card {
    padding: 16px;
  }
  .settings-save-bar {
    bottom: 8px;
    padding: 12px;
  }
  .preview-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .brand-preview.mobile {
    width: min(220px, calc(100% - 28px));
  }
}

@media (max-width: 430px) {
  .pipeline-summary,
  .lead-summary,
  .commission-metrics {
    grid-template-columns: 1fr;
  }
  .student-welcome,
  .profile-identity {
    gap: 12px;
  }
  .student-dashboard-photo {
    width: 58px;
    height: 58px;
  }
  .profile-avatar {
    width: 68px;
    height: 68px;
  }
  .pipeline-table td,
  .commission-table td {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}
