  :root {
    --navy: #1B4591;
    --accent: #237CE5;
    --page-bg: #F4F5F7;
    --surface: #FFFFFF;
    --border: #D9DADC;
    --border-strong: #C7CAD1;
    --text: #1A1A1A;
    --text-secondary: #5A5E67;
    --text-muted: #8A8E97;
    --danger: #A32D2D;
    --danger-bg: #FCEBEB;
    --success: #27500A;
    --success-bg: #EAF3DE;
    --radius: 12px;
    --radius-pill: 30px;
  }
  * { box-sizing: border-box; }
  /* No padding on the global body: these screens are Kentico pages inside the site layout, so
     body padding would push the site header/footer in (a 16px left gap, footer not full width).
     The dashboard spacing lives on .uni-auth / .uni-dash, exactly as the student dashboard keeps
     its padding on .sd-root. */
  body { margin:0; font-family:'Poppins', Arial, sans-serif; background:var(--page-bg); color:var(--text); }
  .wrap { max-width:640px; margin:0 auto; }
  .wrap.wide { max-width:960px; }
  h1 { font-size:20px; font-weight:600; margin:0 0 4px; }
  .sub { font-size:13px; color:var(--text-secondary); margin:0 0 24px; }
  .card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px; margin-bottom:16px; }
  .section-title { font-size:13px; font-weight:600; color:var(--navy); text-transform:uppercase; letter-spacing:0.03em; margin:0 0 16px; }
  label.fl { display:block; font-size:13px; color:var(--text-secondary); margin-bottom:5px; font-weight:500; }
  .req { color:var(--danger); }
  /* `input[type=text]` only matches an EXPLICIT type attribute, so an <input> with no type (which
     still behaves as text) and the newer url/tel/search fields were left with the raw browser
     control. `input:not([type])` plus the extra types styles every text-like field, current and
     future, so a field added without a type attribute is no longer silently unstyled. */
  input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number],
  input[type=date], input[type=url], input[type=tel], input[type=search], select, textarea {
    width:100%; font-family:inherit; font-size:14px; padding:9px 12px; border:1px solid var(--border);
    border-radius:var(--radius); background:#fff; color:var(--text); margin-bottom:14px;
  }
  /* Native <select> clips a long value UNDER the browser's own arrow and never ellipsises, so a
     value like "Full scholarship" or "Other / equivalent" comes out cut off whenever the control
     is narrow. Draw our own caret (as the student dashboard already does), reserve room for it on
     the right, and let the value truncate with an ellipsis instead of disappearing under the arrow. */
  select {
    appearance:none; -webkit-appearance:none; -moz-appearance:none;
    padding-right:34px; text-overflow:ellipsis;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7079' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 12px center;
  }
  select::-ms-expand { display:none; }
  input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 2px rgba(35,124,229,0.15); }
  textarea { resize:vertical; min-height:60px; }
  .hint { font-size:11px; color:var(--text-muted); margin-top:-10px; margin-bottom:14px; }
  /* The -10px pull above assumes the hint sits under an input (14px bottom margin). In the
     repeat sections (e.g. Deadlines) it instead follows the "+ Add another" button, which has no
     bottom margin, so the hint rode up over the button. The hidden .field-err between them gives
     no height, so target the hint after it and restore a normal gap below the button. */
  .field-err + .hint { margin-top:4px; }
  .chip-row { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
  .chip { font-size:12px; padding:6px 12px; border-radius:999px; border:1px solid var(--border-strong); color:var(--text-secondary); cursor:pointer; user-select:none; background:#fff; }
  .chip.on { background:#E6EEFB; color:var(--accent); border-color:var(--accent); font-weight:500; }
  .chip.sub { font-size:11px; padding:5px 10px; }
  .subfield-group { background:var(--page-bg); border-radius:var(--radius); padding:10px 12px; margin-bottom:12px; }
  .subfield-group .glabel { font-size:11px; color:var(--text-muted); margin-bottom:6px; }
  .row2 { display:flex; gap:12px; }
  .row2 > div { flex:1; }
  button { font-family:inherit; cursor:pointer; }
  .btn-primary { width:100%; background:var(--accent); color:#fff; border:none; border-radius:var(--radius-pill); padding:13px; font-size:15px; font-weight:600; }
  .btn-primary:hover { filter:brightness(0.95); }
  .btn-primary:disabled { opacity:0.6; cursor:default; }
  .btn-secondary { background:#fff; color:var(--text-secondary); border:1px solid var(--border-strong); border-radius:var(--radius-pill); padding:8px 16px; font-size:13px; font-weight:500; }
  .btn-text { background:none; border:none; color:var(--accent); font-size:13px; font-weight:500; padding:0; }
  .repeat-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; flex-wrap:wrap; }
  .repeat-row input, .repeat-row select { margin-bottom:0; min-width:0; }
  /* The English-test name is the widest option here ("Other / equivalent"); give it room to grow
     and a floor so it never shrinks small enough to clip, wrapping its score field below instead. */
  .repeat-row select.eng-test { flex:1 1 180px; min-width:170px; }
  .repeat-row .eng-score { flex:1 1 110px; min-width:90px; }
  .repeat-remove { border:none; background:transparent; color:var(--danger); font-size:18px; padding:0 6px; flex-shrink:0; }
  .err-box { display:none; background:var(--danger-bg); color:var(--danger); font-size:13px; padding:10px 14px; border-radius:var(--radius); margin-bottom:14px; }
  .success-box { display:none; background:var(--success-bg); color:var(--success); font-size:14px; padding:16px; border-radius:var(--radius); text-align:center; }
  .success-msg { display:none; background:var(--success-bg); color:var(--success); font-size:13px; padding:10px 14px; border-radius:var(--radius); margin-bottom:14px; }
  .field-err { color:var(--danger); font-size:11px; margin-top:-10px; margin-bottom:10px; display:none; }
  /* Marks the one box a validation message is talking about, so "add a scholarship value" points
     at the row it means instead of leaving the provider to hunt for it. */
  input.is-invalid, select.is-invalid, textarea.is-invalid { border-color:var(--danger); background:var(--danger-bg); }
  input.is-invalid:focus, select.is-invalid:focus, textarea.is-invalid:focus { background:#fff; }
  .hidden { display:none !important; }

  /* ---------- ASEANGEMS branding ---------- */
  .brand-topbar { display:flex; align-items:center; gap:10px; margin-bottom:20px; }
  .brand-mark { width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg, var(--navy), var(--accent)); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; letter-spacing:-0.02em; flex-shrink:0; }
  .brand-wordmark { font-size:16px; font-weight:700; color:var(--navy); letter-spacing:0.01em; }
  .brand-wordmark span { color:var(--accent); }

  /* ---------- Auth (sign in / register wizard) ---------- */
  .auth-toggle { display:flex; gap:8px; margin-bottom:20px; }
  .auth-toggle button { flex:1; padding:10px; border-radius:var(--radius-pill); border:1px solid var(--border-strong); background:#fff; color:var(--text-secondary); font-size:13px; font-weight:500; }
  .auth-toggle button.on { background:var(--navy); color:#fff; border-color:var(--navy); }
  .wizard-steps { display:flex; align-items:center; gap:6px; margin-bottom:20px; }
  .wizard-step { flex:1; height:4px; border-radius:2px; background:var(--border); }
  .wizard-step.done, .wizard-step.current { background:var(--accent); }
  .wizard-step-label { font-size:12px; color:var(--text-muted); margin-bottom:16px; font-weight:500; }
  .upload-box { border:1.5px dashed var(--border-strong); border-radius:var(--radius); padding:16px; text-align:center; margin-bottom:14px; cursor:pointer; background:var(--page-bg); }
  .upload-box:hover { border-color:var(--accent); }
  .upload-box img { max-width:100%; max-height:100px; border-radius:8px; display:block; margin:0 auto 8px; }
  .upload-box .upload-label { font-size:12px; color:var(--text-secondary); font-weight:500; }
  .upload-box .upload-hint { font-size:11px; color:var(--text-muted); margin-top:2px; }
  .upload-box.uploading { opacity:0.6; }

  /* ---------- Dashboard ---------- */
  .wrap.dashboard-wide { max-width:1440px; }
  .dash-header { display:flex; align-items:center; gap:16px; margin-bottom:20px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 20px; box-shadow:0 1px 2px rgba(16,24,40,0.04); }
  .dash-logo { width:48px; height:48px; border-radius:10px; object-fit:cover; background:var(--page-bg); border:1px solid var(--border); flex-shrink:0; }
  .dash-title { font-size:16px; font-weight:600; }
  .dash-sub { font-size:12px; color:var(--text-secondary); }
  .dash-actions { display:flex; gap:8px; margin-left:auto; flex-shrink:0; }
  .pane-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
  .pane-toolbar h2 { font-size:19px; font-weight:600; margin:0; color:var(--text); }
  .dash-search-wrap { flex:1; max-width:360px; min-width:220px; position:relative; }
  .dash-search-wrap input { width:100%; margin-bottom:0; padding:9px 14px 9px 34px; background:var(--surface); border:1px solid var(--border); font-size:13px; }
  .dash-search-wrap::before { content:''; position:absolute; left:12px; top:50%; width:12px; height:12px; margin-top:-7px; border:2px solid var(--text-muted); border-radius:50%; box-sizing:border-box; }
  .dash-search-wrap::after { content:''; position:absolute; left:20px; top:50%; width:6px; height:2px; margin-top:3px; background:var(--text-muted); transform:rotate(45deg); }
  .dash-shell { display:flex; gap:20px; align-items:flex-start; }
  .dash-sidebar { width:220px; flex-shrink:0; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:10px; position:sticky; top:16px; }
  .dash-nav-item { display:flex; align-items:center; gap:8px; padding:11px 12px; border-radius:8px; font-size:14px; color:var(--text-secondary); cursor:pointer; margin-bottom:2px; font-weight:500; }
  .dash-nav-item:hover { background:var(--page-bg); }
  .dash-nav-item.active { background:#E6EEFB; color:var(--accent); }
  .dash-nav-item.disabled { cursor:not-allowed; color:var(--text-muted); opacity:0.55; }
  .dash-nav-item.disabled:hover { background:none; }
  .soon-badge { margin-left:auto; font-size:10px; font-weight:600; background:var(--page-bg); color:var(--text-muted); padding:3px 8px; border-radius:999px; letter-spacing:0.02em; }
  .nav-badge { margin-left:auto; font-size:11px; font-weight:700; background:var(--danger); color:#fff; padding:2px 7px; border-radius:999px; min-width:18px; text-align:center; }
  .dash-main { flex:1; min-width:0; }
  .stat-row { display:flex; gap:12px; margin-bottom:20px; }
  .stat-card { flex:1; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
  .stat-value { font-size:24px; font-weight:700; color:var(--navy); }
  .stat-label { font-size:12px; color:var(--text-secondary); margin-top:2px; }
  .reports-placeholder { text-align:center; padding:56px 24px; }
  .reports-placeholder .section-title { justify-content:center; }
  .badge { display:inline-block; font-size:11px; font-weight:500; padding:3px 9px; border-radius:999px; background:var(--success-bg); color:var(--success); }
  .badge.pending { background:#FDF3D9; color:#8A6D1D; }
  .badge.rejected, .badge.expired { background:var(--danger-bg); color:var(--danger); }
  .badge.contacted { background:#E6EEFB; color:var(--accent); }
  .badge.closing-soon { background:#FDF3D9; color:#8A6D1D; }
  .badge.neutral { background:var(--page-bg); color:var(--text-muted); }
  .empty-state { text-align:center; padding:32px 16px; color:var(--text-secondary); font-size:13px; }
  .back-link { display:inline-block; font-size:13px; color:var(--accent); margin-bottom:14px; cursor:pointer; text-decoration:none; }
  .back-link:hover { text-decoration:underline; }

  /* ---------- Scholarship listings (card-based, professional layout) ---------- */
  .list-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
  .list-controls-left { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .list-controls-left label { font-size:12px; color:var(--text-secondary); font-weight:500; }
  .list-controls-left select { width:auto; margin-bottom:0; font-size:13px; padding:7px 10px; }
  .list-result-count { font-size:12px; color:var(--text-muted); }
  .btn-add { background:var(--accent); color:#fff; border-color:var(--accent); }
  .btn-add:hover { filter:brightness(0.95); }
  .scholarship-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; margin-bottom:10px; transition:box-shadow 0.15s, border-color 0.15s; }
  .scholarship-card:hover { box-shadow:0 2px 10px rgba(16,24,40,0.06); border-color:var(--border-strong); }
  .scholarship-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .scholarship-card-badges { display:flex; align-items:center; gap:6px; flex-wrap:wrap; flex-shrink:0; }
  .scholarship-card-bottom { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; flex-wrap:wrap; }
  .scholarship-name { font-size:15px; font-weight:600; }
  .scholarship-meta { font-size:12px; color:var(--text-muted); margin-top:3px; }
  .scholarship-card-actions { display:flex; align-items:center; gap:8px; position:relative; }
  .kebab-btn { background:#fff; border:1px solid var(--border-strong); border-radius:var(--radius-pill); width:32px; height:32px; display:flex; align-items:center; justify-content:center; font-size:16px; font-weight:700; color:var(--text-secondary); line-height:1; letter-spacing:1px; padding:0; }
  .kebab-btn:hover { background:var(--page-bg); }
  .kebab-menu { display:none; position:absolute; right:0; top:calc(100% + 6px); background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 6px 20px rgba(16,24,40,0.14); min-width:170px; z-index:20; padding:6px; }
  .kebab-menu.open { display:block; }
  .kebab-menu button { display:block; width:100%; text-align:left; background:none; border:none; padding:9px 10px; font-size:13px; color:var(--text); border-radius:6px; font-family:inherit; }
  .kebab-menu button:hover { background:var(--page-bg); }
  .kebab-menu button.danger { color:var(--danger); }
  .pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin-top:16px; }
  .pagination button { background:#fff; border:1px solid var(--border-strong); border-radius:var(--radius-pill); padding:7px 16px; font-size:13px; color:var(--text-secondary); }
  .pagination button:disabled { opacity:0.4; cursor:default; }
  .pagination .page-info { font-size:12px; color:var(--text-muted); }
  .applications-link { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:500; color:var(--text-secondary); background:var(--page-bg); border:1px solid var(--border); padding:5px 11px 5px 12px; border-radius:999px; cursor:pointer; margin-top:8px; }
  .applications-link:hover { background:#E6EEFB; border-color:var(--accent); color:var(--accent); }
  .applications-link .pending-count { color:#8A6D1D; font-weight:700; }
  .applications-link:hover .pending-count { color:var(--accent); }
  .applications-link .arrow { font-size:13px; }

  /* ---------- Applications ---------- */
  .application-group { margin-bottom:8px; }
  .application-group-header { display:flex; align-items:center; gap:8px; padding:10px 4px; border-bottom:2px solid var(--border-strong); margin-bottom:4px; }
  .application-group-title { font-size:13px; font-weight:600; color:var(--navy); }
  .application-group-count { font-size:11px; color:var(--text-muted); background:var(--page-bg); padding:2px 9px; border-radius:999px; }
  .application-row { padding:14px 0; border-bottom:1px solid var(--border); }
  .application-row:last-child { border-bottom:none; }
  .application-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  /* The candidate's name is the row's title on the applications pane - it carries the scan, so
     it outweighs the scholarship line under it. */
  .applicant-name { font-size:15px; font-weight:700; color:var(--navy); line-height:1.3; }
  .applicant-meta { font-size:12px; color:var(--text-muted); margin-top:2px; }
  .application-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .contact-panel, .details-panel { display:none; margin-top:12px; padding:12px; background:var(--page-bg); border-radius:var(--radius); }
  .contact-panel.open, .details-panel.open { display:block; }
  .contact-panel textarea { min-height:80px; }
  .contact-history { font-size:11px; color:var(--text-muted); margin-top:8px; }
  .detail-row { display:flex; gap:6px; font-size:13px; margin-bottom:6px; }
  .detail-row .detail-label { color:var(--text-muted); min-width:110px; flex-shrink:0; }
  .detail-row .detail-value { color:var(--text); font-weight:500; }
  .document-chip { display:inline-flex; align-items:center; gap:5px; font-size:12px; background:var(--surface); border:1px solid var(--border-strong); padding:4px 10px; border-radius:999px; margin:2px 4px 2px 0; }
  .document-chip.missing { background:var(--danger-bg); border-color:var(--danger); color:var(--danger); }
  .missing-docs-note { font-size:12px; color:var(--danger); margin-top:4px; }
  .eligibility-badge { display:inline-flex; align-items:center; gap:4px; font-size:11px; font-weight:600; padding:3px 9px; border-radius:999px; }
  .eligibility-badge.eligible { background:var(--success-bg); color:var(--success); }
  .eligibility-badge.ineligible { background:var(--danger-bg); color:var(--danger); }
  .eligibility-reasons { font-size:12px; color:var(--danger); margin-top:4px; }
  .eligibility-breakdown { margin-top:12px; }
  .eligibility-check-row { display:flex; align-items:center; gap:8px; font-size:13px; margin-bottom:6px; }
  .eligibility-check-row .check-icon { width:16px; height:16px; border-radius:50%; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:#fff; }
  .eligibility-check-row .check-icon.pass { background:var(--success); }
  .eligibility-check-row .check-icon.fail { background:var(--danger); }
  .applications-toolbar { display:flex; align-items:center; gap:16px; margin-bottom:12px; flex-wrap:wrap; }
  .applications-toolbar .field-group { display:flex; align-items:center; gap:8px; }
  .applications-toolbar label { font-size:12px; color:var(--text-secondary); }
  .applications-toolbar select { width:auto; margin-bottom:0; font-size:13px; padding:6px 10px; }
  .bulk-action-bar { display:none; align-items:center; gap:10px; background:#E6EEFB; border:1px solid var(--accent); border-radius:var(--radius); padding:10px 14px; margin-bottom:12px; font-size:13px; }
  .bulk-action-bar.visible { display:flex; }
  .bulk-action-bar .bulk-count { font-weight:600; color:var(--navy); margin-right:auto; }
  .application-select { margin-top:2px; flex-shrink:0; }
  .application-top-inner { display:flex; align-items:flex-start; gap:10px; }
  .application-group-header { cursor:pointer; user-select:none; }
  .group-toggle-arrow { font-size:11px; color:var(--text-muted); transition:transform 0.15s; }
  .group-toggle-arrow.collapsed { transform:rotate(-90deg); }
  .application-group.collapsed .application-row { display:none; }
  .internal-note-panel { margin-top:12px; padding:12px; background:#FFFBEA; border:1px solid #EAD98C; border-radius:var(--radius); }
  .internal-note-panel label { font-weight:600; }
  .internal-note-panel .hint { margin-bottom:8px; }
  .contact-history-item { font-size:11px; color:var(--text-muted); margin-top:6px; padding-top:6px; border-top:1px solid var(--border); }
  .contact-history-item:first-of-type { border-top:none; padding-top:0; }

  /* ---------- Applications: overview / workspace / comparison table ---------- */
  .badge.shortlisted { background:#F0E9FB; color:#6B3FA0; }
  .workspace-header { background:var(--page-bg); border-radius:var(--radius); padding:14px 16px; margin-bottom:16px; }
  .workspace-header-top { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .workspace-title { font-size:16px; font-weight:600; }
  .workspace-meta-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:8px; }
  .slot-badge { font-size:11px; font-weight:600; padding:3px 10px; border-radius:999px; background:var(--surface); border:1px solid var(--border-strong); color:var(--text-secondary); }
  .slot-badge.slot-full { background:var(--danger-bg); color:var(--danger); border-color:var(--danger); }
  .overview-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 4px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
  .overview-row:last-child { border-bottom:none; }
  .overview-row-left { min-width:0; }
  .overview-row-name { font-size:14px; font-weight:600; }
  .overview-row-meta { font-size:12px; color:var(--text-muted); margin-top:3px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
  .urgent-chip { font-size:11px; font-weight:700; padding:3px 10px; border-radius:999px; background:var(--danger-bg); color:var(--danger); }
  .urgent-chip.mild { background:#FDF3D9; color:#8A6D1D; }
  .urgent-chip.calm { background:var(--page-bg); color:var(--text-muted); }
  .applicant-score-row { display:flex; gap:14px; flex-wrap:wrap; margin-top:4px; }
  .applicant-score { font-size:12px; color:var(--text-secondary); }
  .applicant-score .score-label { color:var(--text-muted); margin-right:3px; }
  .docs-summary { font-size:12px; font-weight:600; color:var(--success); }
  .docs-summary.incomplete { color:var(--danger); }
  .app-row-actions { display:flex; align-items:center; gap:8px; position:relative; flex-wrap:wrap; }
  .note-attribution { font-size:11px; color:var(--text-muted); margin-top:6px; font-style:italic; }
  .bulk-message-panel { display:none; margin-bottom:14px; padding:14px; background:var(--page-bg); border-radius:var(--radius); }
  .bulk-message-panel.open { display:block; }

  /* ---------- Toast ---------- */
  .toast { position:fixed; top:16px; right:16px; background:var(--navy); color:#fff; padding:12px 18px; border-radius:var(--radius); font-size:13px; font-weight:500; box-shadow:0 4px 16px rgba(0,0,0,0.18); z-index:999; max-width:320px; }
  .toast.hidden { display:none; }

  @media (max-width:640px) {
    .dash-shell { flex-direction:column; }
    .dash-sidebar { width:100%; display:flex; gap:8px; position:static; }
    .dash-nav-item { flex:1; justify-content:center; }
    .soon-badge, .nav-badge { margin-left:6px; }
    .stat-row { flex-direction:column; }
    .dash-header { flex-wrap:wrap; }
    .pane-toolbar { flex-direction:column; align-items:stretch; }
    .dash-search-wrap { max-width:100%; }
    .list-controls { flex-direction:column; align-items:stretch; }
    .list-controls-left { justify-content:space-between; }
    .btn-add { width:100%; }
  }

  /* ---------- Scholarship form: preset pickers (nationalities, fields) ---------- */
  .nationality-picker { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: linear-gradient(180deg, #fbfcff 0%, #ffffff 100%); margin-bottom: 14px; }
  .nationality-picker-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
  .nationality-label { font-size: 14px; font-weight: 600; color: var(--text); }
  .nationality-helper { font-size: 12px; line-height: 1.5; color: var(--text-muted); margin-top: 2px; }
  .nationality-clear { flex-shrink: 0; border: 0; background: transparent; color: var(--accent); padding: 2px 0; font: inherit; font-size: 12px; font-weight: 600; }
  .nationality-clear:hover { color: var(--navy); text-decoration: underline; }
  .nationality-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .nationality-preset { position: relative; display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 12px 36px 12px 13px; text-align: left; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
  .nationality-preset:hover { border-color: var(--accent); background: #f8fbff; }
  .nationality-preset.on { border-color: var(--accent); background: #eef5ff; box-shadow: 0 0 0 2px rgba(35, 124, 229, 0.12); }
  .preset-icon { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; background: #e6eefb; color: var(--navy); font-size: 14px; font-weight: 700; }
  .nationality-preset.on .preset-icon { background: var(--accent); color: #fff; }
  .preset-copy { display: flex; flex-direction: column; gap: 2px; }
  .preset-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
  .preset-meta { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
  .preset-check { position: absolute; top: 50%; right: 13px; width: 18px; height: 18px; margin-top: -9px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; color: transparent; font-size: 11px; font-weight: 700; }
  .nationality-preset.on .preset-check { border-color: var(--accent); background: var(--accent); color: #fff; }
  .nationality-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 11px; color: var(--text-muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
  .nationality-divider::before, .nationality-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
  .nationality-picker.has-preset .nationality-specific { display: none; }
  .nationality-specific-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
  .nationality-countries { margin-bottom: 0; gap: 7px; }
  .nationality-countries .chip { font-size: 12px; padding: 7px 11px; }
  .nationality-countries .chip:hover { border-color: var(--accent); color: var(--accent); }
  .nationality-countries .chip:focus-visible, .nationality-preset:focus-visible, .nationality-clear:focus-visible { outline: 3px solid rgba(35, 124, 229, 0.22); outline-offset: 2px; }
  .nationality-presets.single { grid-template-columns: 1fr; }
  .fields-specific { transition: opacity 160ms ease; }
  .nationality-picker.is-open-all .fields-specific { opacity: 0.45; }
  .fields-specific .chip:disabled { cursor: not-allowed; }
  .fields-specific .chip:disabled:hover { border-color: var(--border-strong); color: var(--text-secondary); }
  .fields-locked-note { display: none; margin: 0 0 10px; padding: 8px 11px; border: 1px solid #cfe0f7; border-radius: 9px; background: #eef5ff; color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
  .nationality-picker.is-open-all .fields-locked-note { display: block; }
  .fields-subfields { margin-top: 12px; }
  .fields-subfields:empty { display: none; }
  .fields-subfields .subfield-group { margin-bottom: 8px; }
  .fields-subfields .chip-row { margin-bottom: 0; }
  .nationality-picker.is-open-all .fields-subfields { display: none; }

  /* ---------- Scholarship form: eligibility & award steps ---------- */
  .ea-step { margin-top: 18px; }
  .ea-step:first-of-type { margin-top: 0; }
  .ea-step-label { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 13px; font-weight: 600; color: var(--text); }
  .ea-step-num { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; }
  .ea-step-help { margin: -4px 0 10px 28px; font-size: 11px; line-height: 1.45; color: var(--text-muted); }
  .nationality-presets.triple { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .nationality-preset.compact { min-height: 0; padding: 10px 28px 10px 11px; gap: 0; }
  .nationality-preset.compact .preset-title { font-size: 12px; }
  .nationality-preset.compact .preset-check { right: 9px; width: 15px; height: 15px; margin-top: -7.5px; font-size: 9px; }
  .ea-panel { margin-left: 28px; }
  .ea-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
  .ea-row input, .ea-row select { margin-bottom: 0; min-width: 0; }
  .ea-row .ea-grow { flex: 1 1 0; }
  .ea-panel > .ea-scale-input { display: block; width: 100%; margin: 0 0 14px; }
  .ea-row .ea-tier-type { flex: 0 0 168px; }
  .ea-tier-head { display: flex; gap: 8px; margin: 0 0 5px; padding-right: 30px; font-size: 11px; color: var(--text-muted); }
  .ea-tier-head span:first-child { flex: 1 1 0; }
  .ea-tier-head span:nth-child(2) { flex: 0 0 18px; }
  .ea-tier-head span:nth-child(3) { flex: 0 0 168px; }
  .ea-tier-head span:last-child { flex: 1 1 0; }
  .ea-arrow { flex: 0 0 18px; text-align: center; font-size: 12px; color: var(--text-muted); }
  .ea-unit { position: relative; flex: 1 1 0; min-width: 0; }
  .ea-unit input { padding-right: 44px; }
  .ea-unit::after { content: attr(data-unit); position: absolute; top: 50%; right: 11px; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: var(--text-muted); pointer-events: none; }
  .ea-unit.is-empty { visibility: hidden; }
  .ea-sublabel { display: block; margin: 12px 0 5px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
  .ea-sublabel .opt { font-weight: 400; color: var(--text-muted); }
  .ea-panel .hint { margin-top: 5px; }
  .ea-panel > input, .ea-panel > select, .ea-panel .ea-unit input { margin-bottom: 0; }
  .ea-add { margin-top: 2px; padding: 6px 13px; font-size: 12px; }
  .ea-merit-note { margin: 0 0 0 28px; padding: 9px 11px; border: 1px dashed var(--border-strong); border-radius: 9px; color: var(--text-secondary); font-size: 12px; line-height: 1.45; }

  /* ---------- Applications: stage stepper + confirm dialog ---------- */
  .sa-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .sa-actions { display: flex; align-items: center; gap: 8px; }
  .sa-stepper { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .sa-stepper-label { width: 100%; font-size: 11px; color: var(--text-muted); }
  .sa-stage { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 12px; cursor: pointer; transition: border-color 140ms ease, color 140ms ease, background 140ms ease; }
  .sa-stage .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
  .sa-stage:hover:not(.current) { border-color: var(--accent); color: var(--accent); }
  .sa-stage.reject:hover:not(.current) { border-color: var(--danger); color: var(--danger); }
  .sa-stage.current { border-color: var(--accent); background: #eef5ff; color: var(--accent); font-weight: 600; cursor: default; }
  .sa-stage.current .dot { background: var(--accent); }
  .sa-stage.reject.current { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
  .sa-stage.reject.current .dot { background: var(--danger); }
  .sa-stage:focus-visible { outline: 3px solid rgba(35, 124, 229, 0.22); outline-offset: 2px; }
  .sa-detail-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .sa-detail-cols .detail-value { min-width: 0; overflow-wrap: anywhere; }
  .sa-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(16, 24, 40, 0.45); }
  .sa-dialog { width: 100%; max-width: 420px; padding: 20px; border-radius: 14px; background: var(--surface); box-shadow: 0 20px 50px rgba(16, 24, 40, 0.25); }
  .sa-dialog-applicant { margin: -2px 0 12px; font-size: 12px; color: var(--text-muted); }
  .sa-dialog h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
  .sa-dialog p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
  .sa-change { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }
  .sa-buttons { display: flex; justify-content: flex-end; gap: 8px; }
  .sa-confirm { border: 0; border-radius: var(--radius-pill); padding: 8px 16px; background: var(--accent); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
  .sa-confirm.danger { background: var(--danger); }
  .sa-confirm:focus-visible, .sa-dialog .btn-secondary:focus-visible { outline: 3px solid rgba(35, 124, 229, 0.25); outline-offset: 2px; }
  @media (max-width:640px) {
  .sa-detail-cols { grid-template-columns: 1fr; }
  .nationality-picker-header { flex-direction: column; gap: 8px; }
  .nationality-presets { grid-template-columns: 1fr; }
  .nationality-presets.triple { grid-template-columns: 1fr; }
  .ea-panel, .ea-step-help, .ea-merit-note { margin-left: 0; }
  .ea-row { flex-wrap: wrap; }
  .ea-row .ea-tier-type { flex: 1 1 100%; }
  .ea-tier-head { display: none; }
  }

  /* ---------------------------------------------------------------- provider forms
     Layout helpers for the mobility add/edit form. Inputs themselves are already styled
     globally above; these only arrange them and carry the notices. */

  .form-row { margin-bottom: 16px; }
  .form-row label { display:block; font-size:13px; color:var(--text-secondary); margin-bottom:5px; font-weight:500; }
  .form-row input, .form-row select, .form-row textarea { width:100%; }

  .form-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:0 18px; }
  .form-grid2 > .form-row { min-width:0; }

  .field-hint { font-size:12px; color:var(--text-muted); margin-top:5px; }

  .form-actions {
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin:4px 0 32px;
  }

  .form-actions .field-hint { margin-top:0; }

  /* Validation summary above the form. */
  .form-error {
    background:var(--danger-bg);
    border:1px solid var(--danger);
    color:var(--danger);
    border-radius:8px;
    padding:12px 16px;
    margin-bottom:18px;
    font-size:13px;
  }

  .form-error strong { display:block; margin-bottom:6px; }
  .form-error ul { margin:0; padding-left:18px; }

  /* Confirmation after a save / publish / delete, carried in TempData. */
  .form-notice {
    background:#E8F4EC;
    border:1px solid #BFE0CB;
    color:#1E6B3A;
    border-radius:8px;
    padding:11px 16px;
    margin-bottom:18px;
    font-size:13px;
    font-weight:500;
  }

  @media (max-width: 760px) {
    .form-grid2 { grid-template-columns:1fr; }
  }

  /* ---------------------------------------------------------------- applicant review
     The prototype's applicant review screen: the application in full, the requirement beside
     each answer, the university's private notes, and the decision bar. */

  .ar-grid { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:16px; align-items:start; }
  .ar-col-main { min-width:0; }

  .ar-card { margin-bottom:16px; }
  .ar-help { font-size:12.5px; color:var(--text-muted); margin:-4px 0 12px; }

  .ar-status-line { font-size:13px; color:var(--text-secondary); margin:0 0 14px; }
  .ar-status-line strong { color:var(--text); }

  /* Applicant details, two per row. */
  .ar-dl { display:grid; grid-template-columns:1fr 1fr; gap:12px 18px; }
  .ar-dl-item { min-width:0; }
  .ar-dt { font-size:11.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.3px; }
  .ar-dd { font-size:14px; color:var(--text); overflow-wrap:anywhere; }

  .rv-muted { color:var(--text-muted); }
  .rv-text { font-size:14px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }

  /* Requirement | what the student submitted. */
  .cl3 { display:grid; grid-template-columns:1fr 1fr 150px; gap:12px; }
  .cl-head { font-size:11.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.3px; padding:0 0 6px; border-bottom:1px solid var(--border); }
  .cl-row { padding:12px 0; border-bottom:1px solid var(--border); font-size:14px; }
  .cl-row:last-child { border-bottom:none; }
  .cl-label { font-weight:600; color:var(--text); }
  .cl-required { font-size:12.5px; color:var(--text-muted); }
  /* Shown on narrow screens, where the column headers are hidden. */
  .cl-mlabel { display:none; font-size:11.5px; color:var(--text-muted); }

  .sys { display:inline-block; margin-left:8px; padding:1px 8px; border-radius:999px; font-size:11.5px; font-weight:600; white-space:nowrap; }
  .sys-ok { background:#E8F4EC; color:#1E6B3A; }
  .sys-bad { background:var(--danger-bg); color:var(--danger); }

  .ar-docs { display:flex; flex-wrap:wrap; gap:8px; }

  /* Decision bar, pinned under the application. */
  .ar-decision { position:sticky; bottom:0; z-index:5; }
  .ar-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
  .ar-decided { font-size:14px; color:var(--text-secondary); }

  .btn-secondary.danger-text { color:var(--danger); border-color:var(--danger); }
  .btn-secondary.danger-text:hover { background:var(--danger-bg); }

  /* One panel per decision, opened in place rather than as a modal. */
  .ar-panel { margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
  .ar-panel[hidden] { display:none; }
  .ar-panel p { font-size:13px; color:var(--text-secondary); margin:0 0 10px; }
  .ar-panel textarea { width:100%; }

  @media (max-width: 1000px) {
    .ar-grid { grid-template-columns:1fr; }
  }

  @media (max-width: 760px) {
    .ar-dl { grid-template-columns:1fr; }
    .cl3 { grid-template-columns:1fr; }
    .cl-head { display:none; }
    .cl-mlabel { display:block; }
    .ar-decision { position:static; }
  }

  /* ---------------------------------------------------------------- inbox + conversation */

  .inbox-row {
    display:flex; gap:16px; align-items:flex-start; justify-content:space-between;
    padding:14px 4px; border-bottom:1px solid var(--border);
    text-decoration:none; color:inherit;
  }
  .inbox-row:last-child { border-bottom:none; }
  .inbox-row:hover { background:#F7F9FC; }
  /* A thread with unread replies is the whole point of the pane, so it is marked on the row. */
  .inbox-row.unread { background:#F4F9FF; }
  .inbox-row.unread .inbox-name { font-weight:700; }

  .inbox-main { min-width:0; }
  .inbox-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .inbox-name { font-size:14.5px; font-weight:600; color:var(--text); }
  .unread-badge { background:var(--accent); color:#fff; border-color:var(--accent); }
  .inbox-sch { font-size:12.5px; color:var(--text-muted); margin:1px 0 4px; }
  .inbox-preview { font-size:13px; color:var(--text-secondary); overflow-wrap:anywhere; }
  .inbox-who { font-weight:600; color:var(--text-muted); margin-right:4px; }
  .inbox-meta { flex:0 0 auto; text-align:right; font-size:12px; color:var(--text-muted); white-space:nowrap; }
  .inbox-count { margin-top:2px; }

  /* The thread on the applicant review screen. */
  .msg-thread { display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }

  .msg { padding:10px 14px; border-radius:10px; border:1px solid var(--border); max-width:85%; }
  /* Ours on the right, theirs on the left - the usual reading of a conversation. */
  .msg.from-us { align-self:flex-end; background:#EAF2FD; border-color:#BFD7F6; }
  .msg.from-them { align-self:flex-start; background:#fff; }

  .msg-head { display:flex; gap:10px; justify-content:space-between; align-items:baseline; margin-bottom:3px; }
  .msg-who { font-size:12.5px; font-weight:700; color:var(--text); }
  .msg-when { font-size:11.5px; color:var(--text-muted); white-space:nowrap; }
  .msg-subject { font-size:12.5px; font-weight:600; color:var(--text-secondary); margin-bottom:3px; }
  .msg-body { font-size:14px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }

  .msg-form { border-top:1px solid var(--border); padding-top:14px; }
  .msg-form textarea { width:100%; margin-bottom:10px; }

  @media (max-width: 760px) {
    .inbox-row { flex-direction:column; gap:6px; }
    .inbox-meta { text-align:left; }
    .msg { max-width:100%; }
  }

  /* ---------------------------------------------------------------- university profile */

  .profile-preview {
    border:1px solid var(--border); border-radius:8px; background:#F7F9FC;
    padding:10px; margin-bottom:10px; display:flex; align-items:center; justify-content:center;
  }
  .profile-preview img { max-width:100%; display:block; }
  .profile-preview.logo img { max-height:70px; }
  .profile-preview.cover img { max-height:120px; width:100%; object-fit:cover; border-radius:4px; }
  .profile-preview.empty { font-size:12.5px; color:var(--text-muted); min-height:70px; }

  /* The readonly identity fields are visibly not editable. */
  .form-row input[readonly] { background:#F4F5F7; color:var(--text-secondary); cursor:not-allowed; }

  /* ---------------------------------------------------------------- team */

  .team-row {
    display:flex; gap:16px; align-items:center; justify-content:space-between;
    padding:12px 4px; border-bottom:1px solid var(--border);
  }
  .team-row:last-child { border-bottom:none; }

  .team-main { min-width:0; }
  .team-name { font-size:14.5px; font-weight:600; color:var(--text); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .team-id { font-size:12.5px; color:var(--text-muted); overflow-wrap:anywhere; }

  .team-state { flex:0 0 auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

  @media (max-width: 760px) {
    .team-row { flex-direction:column; align-items:flex-start; gap:8px; }
    .team-state { justify-content:flex-start; }
  }

  /* ---------------------------------------------------------------- university sign-in
     The prototype's two-column auth screen (#authView). Values are the prototype's own, and
     everything is scoped under .uni-auth so it cannot reach the dashboard panes that share
     this stylesheet. */

  /* The site header is position:fixed and this page has no banner to clear it, so the screen
     carries the offset itself - same arrangement as the student dashboard. */
  .uni-auth { padding:104px clamp(16px,4vw,48px) 60px; }

  /* ...except on the University/Team portals, which now use _PortalLayout: there is no site
     fixed-header to clear, and the layout's Bootstrap .container handles the width and gutters, so
     drop the top offset the screens added for the header (.uni-auth / .uni-dash / .uni-app). */
  body.portal-chrome .uni-auth,
  body.portal-chrome .uni-dash,
  body.portal-chrome .uni-app { padding-top:0; }

  .uni-auth-portal {
    font-size:12.5px; font-weight:600; letter-spacing:.4px; text-transform:uppercase;
    color:var(--accent); margin-bottom:4px;
  }

  .auth-grid {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(420px,600px);
    gap:clamp(32px,6vw,96px);
    align-items:start;
    max-width:1280px;
    margin:clamp(8px,4vh,48px) auto 0;
  }

  .auth-intro { position:sticky; top:24px; }
  .auth-intro h1 { font-size:clamp(28px,2.6vw,38px); text-align:left; margin:0 0 14px; color:var(--navy); }
  .auth-intro .sub { text-align:left; max-width:none; margin:0 0 28px; font-size:16px; color:var(--text-secondary); }

  .uni-auth .auth-steps { list-style:none; margin:0; padding:0; display:grid; gap:18px; counter-reset:step; }
  .uni-auth .auth-steps li { display:flex; gap:14px; align-items:flex-start; counter-increment:step; }
  .uni-auth .auth-steps li::before {
    content:counter(step); flex:0 0 32px; height:32px; border-radius:50%;
    background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; font-weight:700;
  }
  .uni-auth .auth-steps strong { display:block; color:var(--navy); font-size:15px; }
  .uni-auth .auth-steps span { display:block; color:var(--text-secondary); font-size:14px; margin-top:2px; }

  .auth-points { list-style:none; margin:0; padding:0; display:grid; gap:14px; }
  .auth-points li { display:flex; gap:12px; align-items:flex-start; color:var(--text-secondary); font-size:15px; }
  /* The prototype's tick bullet. */
  .auth-points li::before {
    content:'\2713';
    flex:0 0 28px; height:28px; border-radius:50%;
    background:var(--accent-soft); color:var(--accent);
    display:flex; align-items:center; justify-content:center;
    font-size:14px; font-weight:700;
  }
  .auth-points strong { display:block; color:var(--navy); font-size:15px; }

  .auth-main .auth-toggle { max-width:none; margin:0 0 18px; }
  .auth-main .card { max-width:none; margin:0; }

  /* Segmented control, not two separate buttons. */
  .uni-auth .auth-toggle {
    display:flex; gap:8px;
    background:#E7E9ED; padding:4px; border-radius:999px;
  }
  .uni-auth .auth-toggle button,
  .uni-auth .auth-toggle .auth-toggle-link {
    flex:1; border:none; background:transparent;
    color:var(--text-secondary); font-weight:600; font-size:14px;
    min-height:42px; border-radius:999px;
    display:flex; align-items:center; justify-content:center;
    text-align:center; text-decoration:none; cursor:pointer; padding:0 12px;
  }
  .uni-auth .auth-toggle button.on {
    background:#fff; color:var(--navy); box-shadow:0 1px 3px rgba(16,24,40,0.12);
  }

  .uni-remember { display:flex; align-items:center; gap:8px; margin-bottom:14px; font-weight:400; }
  .uni-remember input { width:auto; margin:0; }

  .auth-foot { text-align:center; margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }
  .uni-auth-note { text-align:center; margin:14px 0 0; }

  @media (max-width: 1199px) {
    .uni-auth { padding-top:88px; }
  }

  @media (max-width: 900px) {
    .auth-grid { grid-template-columns:1fr; gap:20px; margin-top:0; }
    .auth-intro { position:static; }
    .auth-intro .sub { margin-bottom:0; }
    /* The point list is supporting copy, so it gives way to the form on a phone. */
    .auth-points, .uni-auth .auth-steps { display:none; }
  }

  /* Two-up form grid on the partner application, as in the prototype. */
  .pr-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
  .pr-grid > div { min-width:0; }
  .pr-grid .full { grid-column:1 / -1; }
  .pr-grid input, .pr-grid select { width:100%; }

  .uni-pane-title { font-size:20px; font-weight:700; color:var(--navy); margin:0 0 6px; }

  @media (max-width: 640px) {
    .pr-grid { grid-template-columns:1fr; }
  }

  /* ---------------------------------------------------------------- dashboard on a Kentico page
     The converted panes render inside the site layout, whose header is position:fixed. There is
     no banner to clear it, so the dashboard carries the offset itself - the same arrangement the
     student dashboard uses. */
  .uni-dash { padding:104px clamp(16px,3vw,32px) 60px; }

  @media (max-width: 1199px) {
    .uni-dash { padding-top:88px; }
  }

  @media (max-width: 640px) {
    .uni-dash { padding-left:14px; padding-right:14px; }
  }

  /* ===== Portal dashboard top bar + underline nav (matches the molypm prototype v5.1) =====
     One bar: the ASEANGEMS logo on the left, the account identity + bell + actions on the right.
     Rendered by the University/Team dashboard sections (the _Layout brand bar is auth-only). */
  .portal-topbar { display:flex; align-items:center; gap:12px; background:#fff; border:1px solid var(--border); border-top:none; border-radius:0 0 12px 12px; box-shadow:0 2px 10px rgba(16,24,40,.06); padding:10px 20px; margin:0 0 28px; }
  .portal-topbar .pt-logo { height:52px; width:auto; display:block; padding:0; max-width:none; }
  .portal-topbar .pt-spacer { flex:1; }
  .portal-topbar .pt-user { display:flex; align-items:center; gap:12px; min-width:0; }
  .portal-topbar .pt-inst-logo { height:38px; width:auto; max-width:132px; border-radius:6px; object-fit:contain; background:#fff; flex-shrink:0; border:1px solid var(--border); }
  .portal-topbar .pt-text { text-align:right; min-width:0; }
  .portal-topbar .pt-name { font-weight:700; font-size:14px; color:var(--navy); line-height:1.25; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .portal-topbar .pt-sub { font-size:12.5px; color:var(--text-muted); line-height:1.25; }
  .portal-topbar .pt-actions { display:flex; align-items:center; gap:8px; margin-left:4px; }
  .portal-topbar form { margin:0; }
  .portal-topbar .bell-btn { position:relative; background:#fff; border:1px solid var(--border); color:var(--navy); width:38px; height:38px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; padding:0; flex-shrink:0; text-decoration:none; }
  .portal-topbar .bell-btn:hover { background:var(--accent-soft); }
  .portal-topbar .bell-count { position:absolute; top:-5px; right:-5px; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:var(--danger); color:#fff; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; border:2px solid #fff; box-sizing:content-box; line-height:1; }
  .portal-topbar .edit-profile-link { font-weight:600; color:var(--accent); text-decoration:none; font-size:14px; padding:8px 6px; }

  /* Nav as flat underline tabs, not boxed sidebar items. */
  .appnav .dash-tabs { display:flex; gap:4px; border-bottom:1px solid var(--border-strong); margin:0 0 14px; overflow-x:auto; scrollbar-width:none; align-items:flex-end; }
  .appnav .dash-tabs::-webkit-scrollbar { display:none; }
  .appnav .dash-tabs .dash-nav-item { border-radius:0; padding:12px 18px; margin:0 0 -1px; border-bottom:3px solid transparent; background:none; font-size:15px; font-weight:600; color:var(--text-secondary); white-space:nowrap; flex:none; }
  .appnav .dash-tabs .dash-nav-item:hover { background:none; color:var(--accent); }
  .appnav .dash-tabs .dash-nav-item.active { background:none; color:var(--accent); border-bottom-color:var(--accent); }
  .appnav .dash-tabs .nav-badge { margin-left:0; }

  .uni-app .portal-topbar .btn-secondary {
    min-height:38px; padding:8px 16px; white-space:nowrap;
  }
  @media (max-width:760px) {
    .uni-app .portal-topbar .btn-secondary { min-height:36px; padding:7px 14px; font-size:13px; }
    .portal-topbar .pt-text, .portal-topbar .pt-inst-logo { display:none; }
    .portal-topbar .pt-logo { height:38px; }
    .uni-app .portal-topbar .edit-profile-link { font-size:13px; padding:6px 4px; white-space:nowrap; }
  }

  @media (max-width:640px) {
    .portal-topbar { margin-bottom:20px; }
  }

  @media (max-width:380px) {
    .portal-topbar { gap:4px; }
    .portal-topbar .pt-actions { gap:4px; margin-left:0; }
  }
  @media (max-width:360px) {
    .portal-topbar { padding-inline:8px; }
  }

  /* Dashboard bell and message list */
  .pt-bell { display:inline-flex; }
  .portal-notif {
    position:fixed; inset:5vh 0 auto; margin:0 auto; padding:0; width:min(680px,calc(100% - 32px));
    max-width:none; max-height:90dvh; border:0; border-radius:12px; background:#fff;
    color:var(--text); text-align:left; box-shadow:0 20px 50px rgba(16,24,40,.3);
  }
  .portal-notif[open] { display:flex; flex-direction:column; }
  .portal-notif::backdrop { background:rgba(16,24,40,.5); }
  body:has(.portal-notif[open]) { overflow:hidden; }
  .portal-notif .pn-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 22px; border-bottom:1px solid var(--border); }
  .portal-notif .pn-head h3 { margin:0; font-size:18px; color:var(--navy); }
  .portal-notif .pn-close { border:0; padding:0 4px; background:none; color:var(--text-muted); font-size:26px; line-height:1; }
  .portal-notif .pn-list { overflow:auto; max-height:min(62vh,520px); }
  .portal-notif .pn-item { display:flex; gap:12px; align-items:baseline; padding:14px 22px; border-bottom:1px solid var(--border); font-size:15px; font-weight:700; color:var(--text); text-decoration:none; }
  .portal-notif .pn-item:hover { background:#F7F9FC; }
  .portal-notif .pn-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); flex:none; }
  .portal-notif .pn-empty { padding:24px; color:var(--text-muted); text-align:center; }
  .portal-notif .pn-foot { display:flex; justify-content:flex-end; padding:14px 22px; border-top:1px solid var(--border); background:#FAFAFB; }
  @media (max-width:640px) {
    .portal-notif { inset:0; width:100%; height:100dvh; max-height:none; border-radius:0; }
    .portal-notif .pn-list { max-height:none; }
    .portal-notif .pn-item { padding:12px 16px; }
  }


  /* ===== Fonts: Poppins for body, Montserrat for headings - the prototype's stack ===== */
  .uni-app, .uni-auth, .portal-topbar { font-family:'Poppins', Arial, sans-serif; }
  .uni-app h1, .uni-app h2, .uni-auth h1, .uni-auth h2,
  .uni-app .pane-head h2, .uni-app .rv-title, .uni-app .dash-title,
  .uni-app .stat-value, .uni-app .viz-title { font-family:'Montserrat','Poppins',sans-serif; }

  /* ===== Prototype v5 clean-theme type scale (weights + sizes). The base rules in this file came
     from an early prototype; these bring login + dashboard to the final v5 design. ===== */
  .uni-app h1, .uni-auth h1 { font-weight:800; font-size:28px; line-height:1.2; }
  .uni-app .sub, .uni-auth .sub { font-size:15px; line-height:1.55; }
  .uni-app label.fl, .uni-auth label.fl { font-size:14px; font-weight:600; color:var(--text); margin-bottom:6px; }
  /* Explicit [type=] selectors (specificity 0,0,2,1) - NOT :not() stacking, which climbs to
     (0,0,4,1) and clobbers component overrides like the search bar's own left padding (the
     magnifying-glass icon room). At this specificity a later component rule still wins. */
  .uni-app input[type=text], .uni-app input[type=email], .uni-app input[type=password],
  .uni-app input[type=number], .uni-app input[type=date], .uni-app input[type=tel],
  .uni-app input[type=url], .uni-app input[type=search], .uni-app select, .uni-app textarea,
  .uni-auth input[type=text], .uni-auth input[type=email], .uni-auth input[type=password],
  .uni-auth input[type=number], .uni-auth input[type=date], .uni-auth input[type=tel],
  .uni-auth input[type=url], .uni-auth input[type=search], .uni-auth select, .uni-auth textarea { font-size:15px; padding:11px 14px; min-height:46px; }
  .uni-app textarea, .uni-auth textarea { min-height:90px; }
  /* Re-assert the search bar's icon padding AFTER the type scale so the magnifying glass never
     overlaps the placeholder, whichever file loads last. */
  .uni-app .dash-search-wrap input, .uni-auth .dash-search-wrap input { padding:11px 14px 11px 38px; }
  .uni-app .btn-primary, .uni-auth .btn-primary { font-size:16px; font-weight:600; padding:14px; min-height:50px; }
  .uni-app .btn-secondary, .uni-auth .btn-secondary { font-size:14px; font-weight:600; padding:10px 18px; min-height:42px; }
  .uni-app .btn-text, .uni-auth .btn-text { font-size:14px; font-weight:600; }
  .uni-app .chip, .uni-auth .chip { font-size:14px; padding:8px 14px; }
  .uni-app .hint, .uni-auth .hint { font-size:13px; }
  .uni-app .section-title { font-size:14px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--navy); }
  .uni-app .dash-title { font-size:20px; font-weight:800; }
  .uni-app .pane-head h2 { font-size:26px; font-weight:800; }
  .uni-app .rv-title { font-size:24px; font-weight:800; }
  .uni-app .stat-value { font-size:30px; font-weight:800; }
  .uni-app .stat-label { font-size:14px; font-weight:500; color:var(--text-secondary); }
  .uni-app .scholarship-name { font-size:17px; font-weight:700; color:var(--navy); }
  .uni-app .scholarship-meta { font-size:14px; color:var(--text-secondary); }

  /* Shared Team and University authentication typography. */
  .uni-auth [data-auth-intro] h1 {
    font-size:clamp(1.75rem, 1.25rem + 1vw, 2.125rem);
    line-height:1.2;
  }
  .uni-auth [data-auth-intro] :is(.sub, li, strong) {
    font-size:1rem;
    line-height:1.5;
  }
  .uni-auth .auth-toggle button,
  .uni-auth [data-auth-panel="signin"] label.fl {
    font-size:0.9375rem;
    line-height:1.4;
  }
  .uni-auth .auth-main [data-auth-panel="signin"] :is(input[type=email], input[type=password], .btn-primary) {
    font-size:1rem;
    line-height:1.4;
  }
  .uni-auth [data-auth-panel="signin"] :is(.hint, .btn-text) {
    font-size:0.875rem;
    line-height:1.5;
  }

  /* Keep the intro below the brand bar on both authentication tabs. */
  .uni-auth:has([data-auth-tabs]) > .auth-grid {
    margin-top:clamp(28px, 4vh, 48px);
  }
  @media (max-width:900px) {
    .uni-auth:has([data-auth-tabs]) > .auth-grid { margin-top:28px; }
  }
  @media (max-width:640px) {
    .uni-auth:has([data-auth-tabs]) > .auth-grid { margin-top:20px; }
  }

  body.portal-chrome:has(.uni-auth [data-auth-tabs]) {
    --navy:#1B3A6B;
    --accent:#1A66CC;
    --accent-soft:#EAF2FD;
    --page-bg:#F3F4F6;
    --border:#E3E5E9;
    --border-strong:#C9CDD4;
    --text:#1F2328;
    --text-secondary:#4A4F57;
    --text-muted:#6B7079;
    --danger:#B42318;
    --login-gutter:clamp(16px, 2.5vw, 44px);
    background:var(--page-bg);

    & .page-wrapper > nav.navbar {
      width:calc(100% - 2 * var(--login-gutter));
      max-width:1920px;
      margin-inline:auto;
      padding:10px 20px;
      border:1px solid var(--border);
      border-top:0;
      border-radius:0 0 12px 12px;
      box-shadow:0 2px 10px rgba(16,24,40,.06);
    }
    & nav.navbar .container-xxl, & .container-xxl:has(> .uni-auth) {
      max-width:none;
      padding-inline:0;
    }
    & nav.navbar img { display:block; padding:0; }
    & .uni-auth .auth-grid { max-width:1280px; margin-inline:auto; }
    & .auth-toggle button { padding:10px; }
    & [data-auth-panel] .card {
      padding:24px;
      border:1px solid var(--border);
      box-shadow:0 1px 2px rgba(16,24,40,.05);
    }
    & [data-auth-panel="signin"] :is(input[type=email], input[type=password]) {
      margin-bottom:16px;
      border-color:var(--border-strong);
      border-radius:10px;
    }
    & [data-auth-panel="signin"] .btn-primary { border-radius:999px; }
    @media (max-width:760px) { --portal-logo-height:38px; }
    @media (max-width:640px) {
      & [data-auth-panel] .card { padding:18px; }
    }
  }
