/* Portal Modern: keep legacy structural rules in a lower cascade layer.
   Modern component rules below always win; this removes the old specificity race. */
@layer portal-legacy;
@import url('/assets/styles/portal/modern-foundation.css?v=202607270003') layer(portal-legacy);

:root {
  --portal-canvas:#f4f6f8;
  --portal-surface:#fff;
  --portal-soft:#f8fafc;
  --portal-ink:#172033;
  --portal-muted:#5f6b7a;
  --portal-line:#dde3ea;
  --portal-field:#dbe3ec;
  --portal-primary:#2563eb;
  --portal-primary-hover:#1d4ed8;
  --portal-primary-soft:#eaf2ff;
  --portal-success:#16803a;
  --portal-warning:#b54708;
  --portal-error:#d92d20;
  --portal-font-body:14px;
  --portal-font-control:14px;
  --portal-font-label:13px;
  --portal-font-meta:12px;
}

body.portal-shell.theme-modern {
  min-width:320px; color:var(--portal-ink); background:var(--portal-canvas); font-size:var(--portal-font-body); line-height:1.55;
  font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;
}
body.portal-shell.theme-modern *, body.portal-shell.theme-modern *::before, body.portal-shell.theme-modern *::after { box-sizing:border-box; }
body.portal-shell.theme-modern a { text-decoration:none; }
/* Portal-wide type scale.  This is the single source of truth for candidate
   pages, replacing the former page-by-page compact values. */
body.portal-shell.theme-modern :is(.portal-page-sub, .portal-card-sub, .portal-meta, .portal-home-project-copy > p, .portal-ann-detail-meta) { font-size:var(--portal-font-control); line-height:1.55; }
body.portal-shell.theme-modern :is(.portal-form-label, .field > label, .portal-application-meta span, .portal-detail-fields span, .portal-job-meta, .portal-ann-date) { font-size:var(--portal-font-label); line-height:1.5; }
body.portal-shell.theme-modern :is(.portal-review-copy span, .portal-stage-hero span, .portal-flow-info-desc, .portal-flow-info-row, .portal-state-row, .portal-detail-section-head p, .portal-detail-file-copy b, .portal-detail-subject-copy > span, .portal-ann-detail-body) { font-size:var(--portal-font-control); line-height:1.55; }
body.portal-shell.theme-modern :is(.portal-flow-step-name, .portal-selected-row b, .portal-detail-subject-copy b, .portal-detail-file-copy > span, .portal-job-copy b, .portal-job-name b, .account-setting-title) { font-size:var(--portal-font-control); line-height:1.45; }
body.portal-shell.theme-modern :is(.portal-flow-step-time, .portal-selected-row span, .portal-detail-back, .portal-detail-status, .portal-phase-badge, .portal-job-tag, .portal-flow-info-badge) { font-size:var(--portal-font-meta); line-height:1.45; }
body.portal-shell.theme-modern :is(.portal-review-copy strong, .portal-stage-hero strong, .portal-flow-info-title, .portal-state-card h3) { font-size:22px; line-height:1.35; }
body.portal-shell.theme-modern .portal-topbar {
  position:fixed; inset:0 auto 0 0; z-index:80; width:244px; height:100vh;
  background:var(--portal-surface); border-right:1px solid var(--portal-line); box-shadow:none;
}
body.portal-shell.theme-modern .portal-topbar-inner { width:100%; height:100%; padding:0 12px 16px; display:flex; flex-direction:column; align-items:stretch; gap:18px; }
body.portal-shell.theme-modern .portal-brand-wrap { min-height:72px; margin:0 -12px; padding:0 20px; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--portal-line); }
body.portal-shell.theme-modern .portal-brand-mark { width:32px; height:32px; display:grid; place-items:center; flex:0 0 32px; border-radius:4px; background:var(--portal-primary); color:#fff; }
body.portal-shell.theme-modern .portal-brand-mark svg { width:18px; height:18px; }
body.portal-shell.theme-modern .portal-brand { color:var(--portal-ink); font-size:16px; font-weight:700; line-height:1.35; }
body.portal-shell.theme-modern .portal-user { margin-top:2px; color:var(--portal-muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.portal-shell.theme-modern .portal-nav { display:flex; flex-direction:column; gap:4px; padding:0; }
body.portal-shell.theme-modern .portal-nav-link { position:relative; min-height:42px; padding:0 12px; display:flex; align-items:center; gap:10px; border-radius:4px; color:var(--portal-muted); font-size:14px; font-weight:600; transition:color .15s,background .15s; }
body.portal-shell.theme-modern .portal-nav-link svg { width:18px; height:18px; flex:0 0 18px; stroke-width:1.8; }
body.portal-shell.theme-modern .portal-nav-link:hover { color:var(--portal-primary); background:var(--portal-soft); }
body.portal-shell.theme-modern .portal-nav-link.active { color:var(--portal-primary); background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .portal-nav-link.active::before { content:""; position:absolute; left:0; top:11px; bottom:11px; width:3px; border-radius:0 2px 2px 0; background:var(--portal-primary); }
body.portal-shell.theme-modern .portal-topbar .portal-logout, body.portal-shell.theme-modern .portal-topbar #portalLogoutBtn { min-height:36px; margin-top:auto; border:1px solid var(--portal-field); border-radius:4px; color:var(--portal-muted); background:#fff; box-shadow:none; }
body.portal-shell.theme-modern .portal-topbar .portal-logout:hover, body.portal-shell.theme-modern .portal-topbar #portalLogoutBtn:hover { color:var(--portal-error); border-color:#efb9b5; background:#fff7f6; }
body.portal-shell.theme-modern .portal-project-context { position:sticky; top:0; z-index:70; min-height:72px; margin-left:244px; padding:0 32px; gap:10px; background:#fff; border-bottom:1px solid var(--portal-line); backdrop-filter:none; }
body.portal-shell.theme-modern .portal-project-context-label { color:var(--portal-muted); font-size:12px; }
body.portal-shell.theme-modern .portal-project-name { color:var(--portal-ink); font-size:15px; font-weight:650; }
/* The project title belongs on the left.  Keep the signed-in candidate as the
   only account context in the desktop top bar, immediately before logout. */
body.portal-shell.theme-modern .portal-candidate-context { margin-left:auto; display:flex; align-items:center; gap:0; }
body.portal-shell.theme-modern .portal-candidate-context > div:not(:first-child) { display:none; }
body.portal-shell.theme-modern .portal-candidate-context > div { min-width:92px; padding:0 14px; border-left:1px solid var(--portal-line); }
body.portal-shell.theme-modern .portal-candidate-context span { display:block; color:var(--portal-muted); font-size:12px; }
body.portal-shell.theme-modern .portal-candidate-context b { display:block; margin-top:3px; color:var(--portal-ink); font-size:14px; font-weight:650; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.portal-shell.theme-modern .portal-project-context .portal-logout,
body.portal-shell.theme-modern .portal-project-context #portalLogoutBtn { margin:0 0 0 16px; }
body.portal-shell.theme-modern .portal-account-logout-wrap { display:none; }
body.portal-shell.theme-modern .portal-main { max-width:none; margin-left:244px; padding:28px 32px 44px; }
body.portal-shell.theme-modern .portal-page-head { margin-bottom:20px; }
body.portal-shell.theme-modern .portal-page-title { margin:0 0 4px; color:var(--portal-ink); font-size:20px; line-height:1.35; font-weight:700; }
body.portal-shell.theme-modern .portal-page-sub, body.portal-shell.theme-modern .portal-card-sub, body.portal-shell.theme-modern .portal-meta { color:var(--portal-muted); font-size:var(--portal-font-control); line-height:1.55; }

body.portal-shell.theme-modern .portal-card, body.portal-shell.theme-modern .portal-flow, body.portal-shell.theme-modern .portal-job-card, body.portal-shell.theme-modern .portal-project-item, body.portal-shell.theme-modern .account-panel, body.portal-shell.theme-modern .announcement-card {
  border:1px solid var(--portal-line); border-radius:8px; background:var(--portal-surface); box-shadow:0 6px 18px rgba(23,32,51,.08);
}
body.portal-shell.theme-modern .portal-card { padding:20px 24px; }
body.portal-shell.theme-modern .portal-card-title, body.portal-shell.theme-modern .portal-job-card-title, body.portal-shell.theme-modern .portal-ann-title, body.portal-shell.theme-modern .account-setting-title { color:var(--portal-ink); }
body.portal-shell.theme-modern .portal-overview-badge, body.portal-shell.theme-modern .portal-phase-badge, body.portal-shell.theme-modern .portal-job-tag, body.portal-shell.theme-modern .portal-flow-info-badge.done { border-radius:3px; color:var(--portal-primary); background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .portal-overview-grid { gap:12px; }
body.portal-shell.theme-modern .portal-overview-stat { min-height:76px; padding:14px 16px; border:1px solid var(--portal-line); border-radius:6px; background:var(--portal-soft); }
body.portal-shell.theme-modern .portal-overview-stat b { color:var(--portal-ink); font-size:20px; font-variant-numeric:tabular-nums; }
body.portal-shell.theme-modern .portal-overview-stat.is-approved { border-color:#c6e7d0; background:#edf8f0; }
body.portal-shell.theme-modern .portal-overview-stat.is-approved b { color:var(--portal-success); }
body.portal-shell.theme-modern .portal-overview-project, body.portal-shell.theme-modern .portal-job-tip { border:1px solid #d7e4fb; border-radius:6px; background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .portal-project-item { padding:18px; transition:border-color .15s,background .15s; }
body.portal-shell.theme-modern .portal-project-item:hover, body.portal-shell.theme-modern .portal-job-card:hover { border-color:#9fc1f9; background:#fbfdff; box-shadow:0 6px 18px rgba(23,32,51,.08); transform:none; }
body.portal-shell.theme-modern .portal-project-item b { color:var(--portal-ink); }
body.portal-shell.theme-modern .portal-project-item span { color:var(--portal-muted); }

body.portal-shell.theme-modern .btn, body.portal-shell.theme-modern .pay-btn { min-height:40px; padding:8px 16px; border-radius:4px; font-size:var(--portal-font-control); font-weight:650; transition:background .15s,border-color .15s,color .15s,transform .12s; box-shadow:0 1px 2px rgba(23,32,51,.08); }
body.portal-shell.theme-modern .btn-primary, body.portal-shell.theme-modern .btn:not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-ghost) { border-color:var(--portal-primary); background:var(--portal-primary); color:#fff; }
body.portal-shell.theme-modern .btn-primary:hover, body.portal-shell.theme-modern .btn:not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-ghost):hover { border-color:var(--portal-primary-hover); background:var(--portal-primary-hover); }
body.portal-shell.theme-modern .btn-secondary { border:1px solid #d8e0e8; background:#fff; color:var(--portal-ink); }
body.portal-shell.theme-modern .btn-secondary:hover { border-color:#aab7c6; background:var(--portal-soft); color:var(--portal-ink); }
body.portal-shell.theme-modern .btn-ghost { border:1px solid transparent; background:transparent; color:var(--portal-muted); box-shadow:none; }
body.portal-shell.theme-modern .btn-ghost:hover { background:var(--portal-soft); color:var(--portal-ink); }
body.portal-shell.theme-modern .btn-ticket-download { border-radius:4px; background:var(--portal-primary); }
body.portal-shell.theme-modern .btn-ticket-download:hover { background:var(--portal-primary-hover); transform:none; }
body.portal-shell.theme-modern .pay-btn { border-radius:4px; box-shadow:none; }
body.portal-shell.theme-modern .pay-btn-wechat { background:#16803a; } body.portal-shell.theme-modern .pay-btn-wechat:hover { background:#126b30; box-shadow:none; }
body.portal-shell.theme-modern .pay-btn-alipay { background:var(--portal-primary); } body.portal-shell.theme-modern .pay-btn-alipay:hover { background:var(--portal-primary-hover); box-shadow:none; }
body.portal-shell.theme-modern .btn:focus-visible, body.portal-shell.theme-modern a:focus-visible { outline:2px solid var(--portal-primary); outline-offset:2px; }
/* The control border itself is the focus affordance: avoid a second blue ring. */
body.portal-shell.theme-modern input:focus-visible,
body.portal-shell.theme-modern select:focus-visible,
body.portal-shell.theme-modern textarea:focus-visible { outline:0; outline-offset:0; }

body.portal-shell.theme-modern .portal-flow { min-height:400px; border-radius:8px; overflow:hidden; }
body.portal-shell.theme-modern .portal-flow-nav { width:244px; padding:16px 12px; background:var(--portal-soft); border-right:1px solid var(--portal-line); }
body.portal-shell.theme-modern .portal-flow-step { border-radius:4px; }
body.portal-shell.theme-modern .portal-flow-step:hover, body.portal-shell.theme-modern .portal-flow-step.selected { background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .portal-flow-detail { padding:28px 32px; }
body.portal-shell.theme-modern .portal-flow-dot, body.portal-shell.theme-modern .portal-step-dot { border-radius:50%; }
body.portal-shell.theme-modern .portal-flow-dot.done, body.portal-shell.theme-modern .portal-flow-dot.active, body.portal-shell.theme-modern .portal-step-dot.active, body.portal-shell.theme-modern .portal-step-dot.done { background:var(--portal-primary); box-shadow:0 0 0 4px rgba(37,99,235,.14); }
body.portal-shell.theme-modern .portal-flow-step.done:not(:last-child)::after, body.portal-shell.theme-modern .portal-step-line.done, body.portal-shell.theme-modern .portal-progress-bar { background:var(--portal-primary); }
body.portal-shell.theme-modern .portal-flow-info-block { border-color:var(--portal-line); border-radius:6px; background:var(--portal-soft); }

/* The legacy action rail still used its former 192px sidebar offset at this
   breakpoint, which put the selection count behind Modern's 244px navigation. */
body.portal-shell.theme-modern .portal-jobs-page #selectionActions {
  left:244px;
  padding:14px 32px;
  min-height:68px;
  border-top-color:var(--portal-line);
  box-shadow:0 -4px 14px rgba(23,32,51,.05);
}
body.portal-shell.theme-modern .portal-jobs-page #selectionActions .portal-meta { font-size:var(--portal-font-control); }
body.portal-shell.theme-modern .portal-jobs-page #selectionActions #continueApplyBtn { min-height:44px; font-size:var(--portal-font-control); }
/* Keep both application steps aligned to the Modern sidebar at every desktop
   breakpoint, and restore a readable confirmation sheet after legacy compact
   table rules have applied. */
body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions,
body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions {
  left:244px;
  padding:14px 32px;
  border-top-color:var(--portal-line);
}
body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions .btn,
body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions .btn { min-height:44px; font-size:var(--portal-font-control); }
body.portal-shell.theme-modern .portal-apply-shell .portal-info-table th,
body.portal-shell.theme-modern .portal-apply-shell .portal-info-table td { font-size:var(--portal-font-label); }
body.portal-shell.theme-modern .portal-apply-shell .portal-declare-text { font-size:var(--portal-font-label); line-height:1.6; }
body.portal-shell.theme-modern .portal-apply-shell .portal-confirm-subject-list > div { font-size:var(--portal-font-control); }
body.portal-shell.theme-modern .portal-info-table { border:1px solid var(--portal-line); border-radius:3px; }
body.portal-shell.theme-modern .portal-info-table th { color:var(--portal-muted); background:var(--portal-soft); }
/* Account profile records are read as a compact definition list.  Raise both
   labels and values one step without altering the page-wide 14px base scale. */
body.portal-shell.theme-modern .portal-account-page .account-profile-grid dt,
body.portal-shell.theme-modern .portal-account-page .account-profile-grid dd { font-size:14px; }

/* Dashboard steps are a full-width horizontal lifecycle on desktop. The generic
   flow navigation is narrow for side-nav flows, so never let it constrain this dashboard. */
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-nav {
  width:100%;
  display:grid;
  grid-template-columns:repeat(var(--flow-step-count, 5), minmax(0, 1fr));
  box-sizing:border-box;
}
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step {
  min-width:0;
  min-height:92px;
  padding:0 6px 8px;
  overflow-wrap:anywhere;
}
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-name { font-size:13px; line-height:1.4; font-weight:650; }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-time { font-size:12px; line-height:1.45; }
/* Current stage is a compact label group, not an offset full-height blue tile. */
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected,
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] { background:transparent; }
/* Hover is a light affordance only.  It must not create another large blue
   selection tile beside the actual current-stage marker. */
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step:hover { background:transparent; }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step:hover .portal-flow-step-name { color:var(--portal-primary); }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step:hover .portal-flow-dot { box-shadow:0 0 0 4px rgba(37,99,235,.10); }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected .portal-flow-step-text,
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] .portal-flow-step-text {
  margin:8px 0 0;
  padding:5px 8px 6px;
  border-radius:4px;
  background:var(--portal-primary-soft);
}
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected .portal-flow-step-name,
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] .portal-flow-step-name { color:var(--portal-primary); }
/* Result pages consist of independent information blocks.  The legacy wrapper
   was still painted as a white card, which made every grid gap look like an
   empty extra layer. */
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-state-published) {
  min-height:0;
  gap:16px;
  border:0;
  background:transparent;
  box-shadow:none;
  overflow:visible;
}
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-state-published) .portal-flow-info-actions {
  margin-top:16px;
  padding-top:16px;
}

body.portal-shell.theme-modern .portal-form-field { padding:0; border:0; background:transparent; border-radius:0; }
body.portal-shell.theme-modern .portal-form-label, body.portal-shell.theme-modern .field > label { color:var(--portal-ink); font-size:var(--portal-font-label); font-weight:650; }
body.portal-shell.theme-modern .portal-form-input, body.portal-shell.theme-modern .portal-form-select, body.portal-shell.theme-modern .portal-form-textarea, body.portal-shell.theme-modern .field input, body.portal-shell.theme-modern .field select, body.portal-shell.theme-modern .field textarea { min-height:40px; border:1px solid var(--portal-field); border-radius:3px; color:var(--portal-ink); background:#fff; font-size:var(--portal-font-control); }
body.portal-shell.theme-modern .portal-form-input:focus, body.portal-shell.theme-modern .portal-form-select:focus, body.portal-shell.theme-modern .portal-form-textarea:focus { outline:0; border-color:var(--portal-primary); box-shadow:0 0 0 3px rgba(37,99,235,.14); }
body.portal-shell.theme-modern input:focus,
body.portal-shell.theme-modern select:focus,
body.portal-shell.theme-modern textarea:focus {
  outline:0;
  border-color:var(--portal-primary);
  box-shadow:none;
}
body.portal-shell.theme-modern .portal-form-input:disabled, body.portal-shell.theme-modern .portal-form-select:disabled, body.portal-shell.theme-modern .portal-form-textarea:disabled { background:var(--portal-soft); color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-radio-opt, body.portal-shell.theme-modern .portal-checkbox-opt, body.portal-shell.theme-modern .portal-upload-area, body.portal-shell.theme-modern .portal-declare, body.portal-shell.theme-modern .portal-alert, body.portal-shell.theme-modern .portal-banner { border-radius:4px; }
body.portal-shell.theme-modern .portal-radio-opt.selected, body.portal-shell.theme-modern .portal-checkbox-opt.selected { border-color:var(--portal-primary); background:var(--portal-primary-soft); color:var(--portal-primary); }
body.portal-shell.theme-modern .portal-upload-area { border-color:var(--portal-field); background:var(--portal-soft); }
body.portal-shell.theme-modern .portal-upload-area:hover { border-color:var(--portal-primary); background:#f7faff; }
body.portal-shell.theme-modern .portal-alert-info, body.portal-shell.theme-modern .portal-banner { border-color:#bfd5fb; background:var(--portal-primary-soft); color:#174ea6; }
body.portal-shell.theme-modern .portal-alert-warn { border-color:#f3d19d; background:#fff7e9; color:var(--portal-warning); }
body.portal-shell.theme-modern .portal-alert-success { border-color:#c6e7d0; background:#edf8f0; color:var(--portal-success); }
body.portal-shell.theme-modern .portal-remark { border-radius:3px; color:var(--portal-error); background:#fff0ef; border-color:#f0b9b4; }

body.portal-shell.theme-modern .portal-jobs-table { border:1px solid var(--portal-line); border-radius:8px; box-shadow:0 6px 18px rgba(23,32,51,.08); }
body.portal-shell.theme-modern .portal-jobs-table thead { background:var(--portal-soft); }
body.portal-shell.theme-modern .portal-jobs-table th { padding:11px 14px; color:var(--portal-ink); border-bottom-color:var(--portal-line); font-size:var(--portal-font-label); }
body.portal-shell.theme-modern .portal-jobs-table td { padding:11px 14px; color:var(--portal-ink); border-bottom-color:var(--portal-line); }
body.portal-shell.theme-modern .portal-jobs-table tbody tr:hover { background:#f8fbff; }
body.portal-shell.theme-modern .portal-job-card { padding:18px; }
body.portal-shell.theme-modern .portal-job-tag { padding:3px 7px; }
body.portal-shell.theme-modern .portal-jobs-actions .btn, body.portal-shell.theme-modern .portal-job-card-actions .btn { background:transparent; border-color:transparent; color:var(--portal-primary); box-shadow:none; }
body.portal-shell.theme-modern .portal-jobs-actions .btn:hover, body.portal-shell.theme-modern .portal-job-card-actions .btn:hover { background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .portal-jobs-actions .btn-danger { color:var(--portal-error); }

body.portal-shell.theme-modern .confirm-dialog-backdrop, body.portal-shell.theme-modern .portal-upload-overlay { background:rgba(23,32,51,.42); }
body.portal-shell.theme-modern .confirm-dialog-panel, body.portal-shell.theme-modern .portal-upload-dialog { border-radius:8px; border:1px solid var(--portal-line); box-shadow:0 18px 44px rgba(23,32,51,.18); }
body.portal-shell.theme-modern .confirm-dialog-icon { width:36px; height:36px; border-radius:4px; }
body.portal-shell.theme-modern .confirm-dialog-title { color:var(--portal-ink); font-size:17px; }
body.portal-shell.theme-modern .portal-loading { border:1px solid var(--portal-line); border-radius:8px; box-shadow:0 6px 18px rgba(23,32,51,.08); color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-loading::before { border-top-color:var(--portal-primary); }
/* Keep the page shape stable while asynchronous Portal data is requested. */
body.portal-shell.theme-modern .portal-loading:not(.is-error) {
  position:relative;
  min-height:184px;
  overflow:hidden;
  padding:28px 24px;
  border-color:var(--portal-line);
  background:
    linear-gradient(var(--portal-soft) 0 0) 24px 30px / min(38%,240px) 18px no-repeat,
    linear-gradient(var(--portal-soft) 0 0) 24px 64px / min(74%,520px) 12px no-repeat,
    linear-gradient(var(--portal-soft) 0 0) 24px 88px / min(58%,390px) 12px no-repeat,
    linear-gradient(var(--portal-soft) 0 0) 24px 128px / calc(100% - 48px) 1px no-repeat,
    #fff;
  color:transparent;
  font-size:0;
}
body.portal-shell.theme-modern .portal-loading:not(.is-error)::before {
  content:"";
  position:absolute;
  inset:0;
  width:auto;
  height:auto;
  border:0;
  border-radius:0;
  background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.68) 48%,transparent 100%);
  transform:translateX(-100%);
  animation:portal-skeleton-shimmer 1.25s ease-in-out infinite;
}
body.portal-shell.theme-modern .portal-loading:not(.is-error) > * { color:transparent; }
@keyframes portal-skeleton-shimmer { to { transform:translateX(100%); } }
@media (max-width:640px) {
  body.portal-shell.theme-modern .portal-loading:not(.is-error) {
    min-height:160px;
    padding:22px 16px;
    background:
      linear-gradient(var(--portal-soft) 0 0) 16px 24px / 52% 16px no-repeat,
      linear-gradient(var(--portal-soft) 0 0) 16px 54px / 82% 11px no-repeat,
      linear-gradient(var(--portal-soft) 0 0) 16px 76px / 64% 11px no-repeat,
      linear-gradient(var(--portal-soft) 0 0) 16px 112px / calc(100% - 32px) 1px no-repeat,
      #fff;
  }
}
@media (prefers-reduced-motion:reduce) {
  body.portal-shell.theme-modern .portal-loading:not(.is-error)::before { animation:none; }
}
body.portal-shell.theme-modern .portal-page-transition {
  position:fixed;
  inset:0;
  z-index:200;
  display:grid;
  place-items:center;
  background:rgba(244,246,248,.82);
}
body.portal-shell.theme-modern .portal-page-transition[hidden] { display:none; }
body.portal-shell.theme-modern .portal-page-transition-card {
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 18px;
  border:1px solid var(--portal-line);
  border-radius:8px;
  background:#fff;
  box-shadow:0 18px 44px rgba(23,32,51,.18);
  color:var(--portal-muted);
  font-size:var(--portal-font-label);
}
body.portal-shell.theme-modern .portal-page-transition-card::before {
  content:"";
  width:18px;
  height:18px;
  border:2px solid #d7e4fb;
  border-top-color:var(--portal-primary);
  border-radius:50%;
  animation:portal-loading-spin .7s linear infinite;
}

/* Page-level surfaces: keep every Portal journey in the same restrained Modern language. */
body.portal-shell.theme-modern .portal-home-project,
body.portal-shell.theme-modern .portal-subject-panel,
body.portal-shell.theme-modern .portal-ann-list-surface,
body.portal-shell.theme-modern .portal-application-meta,
body.portal-shell.theme-modern .portal-detail-card,
body.portal-shell.theme-modern .portal-security-form-card,
body.portal-shell.theme-modern .portal-profile-edit-card {
  border:1px solid var(--portal-line); border-radius:8px; background:#fff; box-shadow:0 6px 18px rgba(23,32,51,.08);
}
body.portal-shell.theme-modern .portal-home-project,
body.portal-shell.theme-modern .portal-subject-panel,
body.portal-shell.theme-modern .portal-detail-card,
body.portal-shell.theme-modern .portal-security-form-card,
body.portal-shell.theme-modern .portal-profile-edit-card { padding:20px 24px; }
body.portal-shell.theme-modern .portal-home-project { border-color:#d5e3fb; background:#f8fbff; }
body.portal-shell.theme-modern .portal-home-project-title h2,
body.portal-shell.theme-modern .portal-subject-panel h1,
body.portal-shell.theme-modern .portal-detail-section-head h2,
body.portal-shell.theme-modern .portal-ann-detail h1 { color:var(--portal-ink); }
body.portal-shell.theme-modern .portal-home-project-title em,
body.portal-shell.theme-modern .portal-detail-selected-state.is-selected { border-radius:3px; color:var(--portal-primary); background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .portal-subject-eyebrow {
  display:inline-flex;
  width:fit-content;
  align-items:center;
  padding:3px 8px;
  border-radius:3px;
  color:var(--portal-primary);
  background:var(--portal-primary-soft);
  font-size:var(--portal-font-label);
  line-height:1.4;
}
body.portal-shell.theme-modern .portal-selected-summary,
body.portal-shell.theme-modern .portal-selected-list,
body.portal-shell.theme-modern .portal-application-meta { border:1px solid var(--portal-line); border-radius:6px; background:#fff; }
body.portal-shell.theme-modern .portal-selected-summary { padding:16px 18px; }
body.portal-shell.theme-modern .portal-selected-row { border-color:var(--portal-line); }
body.portal-shell.theme-modern .portal-application-meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:hidden; }
body.portal-shell.theme-modern .portal-application-meta > div { padding:14px 16px; }
body.portal-shell.theme-modern .portal-application-meta > div + div { border-left:1px solid var(--portal-line); }
body.portal-shell.theme-modern .portal-application-meta span,
body.portal-shell.theme-modern .portal-detail-section-head p,
body.portal-shell.theme-modern .portal-detail-file-copy > span,
body.portal-shell.theme-modern .portal-detail-subject-copy > span { color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-detail-section-icon,
body.portal-shell.theme-modern .portal-detail-file-icon { border-radius:4px; color:var(--portal-primary); background:var(--portal-primary-soft); }
/* A detail-section header already owns the divider.  Giving its list another
   top border produces an accidental double rule before the first row. */
body.portal-shell.theme-modern .portal-application-detail .portal-detail-list { border-top:0; }
body.portal-shell.theme-modern .portal-attachment-row,
body.portal-shell.theme-modern .portal-detail-subject-row { border-color:var(--portal-line); }
body.portal-shell.theme-modern .portal-detail-bottom { margin-top:16px; }
body.portal-shell.theme-modern .portal-subject-panel-head { border-bottom-color:var(--portal-line); }
body.portal-shell.theme-modern .portal-subject-facts { border-color:var(--portal-line); background:var(--portal-soft); }
body.portal-shell.theme-modern .portal-subject-fact { border-color:var(--portal-line); }
body.portal-shell.theme-modern .portal-detail-back,
body.portal-shell.theme-modern .portal-ann-detail-meta,
body.portal-shell.theme-modern .portal-ann-detail-body { color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-detail-back:hover { color:var(--portal-primary); }

/* Application details are read-heavy.  Do not inherit the legacy compact
   type ramp: section labels and actions need the same readable scale as the
   rest of the Portal interface. */
body.portal-shell.theme-modern .portal-application-detail .portal-detail-section-head h2 { font-size:17px; font-weight:650; }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-section-head p { font-size:var(--portal-font-control); line-height:1.5; }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-fields span { font-size:var(--portal-font-label); }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-file-copy > span { font-size:var(--portal-font-control); font-weight:600; }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-file-copy b { font-size:var(--portal-font-label); }
body.portal-shell.theme-modern .portal-application-detail .portal-attachment-row em { font-size:var(--portal-font-label); font-weight:600; }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-subject-copy b { font-size:var(--portal-font-control); font-weight:600; }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-subject-copy > span { font-size:var(--portal-font-label); }
body.portal-shell.theme-modern .portal-application-detail .portal-detail-subject-row > em { font-size:var(--portal-font-label); font-weight:600; }
body.portal-shell.theme-modern .portal-application-detail .btn { font-size:var(--portal-font-control); }
/* Detail sections use one vertical rhythm.  The inherited per-section margins
   left an oversized empty band between attachments and selected subjects. */
body.portal-shell.theme-modern .portal-application-detail #applicationDetailBody { display:grid; gap:16px; }
body.portal-shell.theme-modern .portal-application-detail #applicationDetailBody > :is(.portal-application-meta, .portal-detail-card, .portal-detail-bottom) { margin:0; }

body.portal-shell.theme-modern .portal-ann-list-surface { overflow:hidden; }
body.portal-shell.theme-modern.portal-announcement-detail-page .portal-ann-detail {
  width:min(900px,100%);
  max-width:900px;
  padding:28px 32px;
  border:1px solid var(--portal-line);
  border-radius:8px;
  background:#fff;
  box-shadow:0 6px 18px rgba(23,32,51,.08);
}
body.portal-shell.theme-modern.portal-announcement-detail-page .portal-ann-detail-body {
  min-height:0;
  padding:24px 0 28px;
  color:var(--portal-ink);
  font-size:15px;
  line-height:1.8;
}
body.portal-shell.theme-modern.portal-announcement-detail-page .portal-ann-detail-actions {
  justify-content:flex-start;
  padding:0;
}
body.portal-shell.theme-modern.portal-announcement-detail-page .portal-ann-detail-actions .btn {
  min-width:0;
  color:var(--portal-ink);
  border-color:#d8e0e8;
}
body.portal-shell.theme-modern .portal-ann-row { min-height:64px; padding:14px 18px; border-bottom:1px solid var(--portal-line); color:var(--portal-ink); background:#fff; }
body.portal-shell.theme-modern .portal-ann-row:hover { background:#f8fbff; }
body.portal-shell.theme-modern .portal-ann-row.is-read { color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-ann-dot { background:var(--portal-primary); }
body.portal-shell.theme-modern .portal-ann-date,
body.portal-shell.theme-modern .portal-ann-arrow { color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-ann-pagination { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
body.portal-shell.theme-modern .portal-ann-pagination button,
body.portal-shell.theme-modern .portal-ann-pagination span { min-height:34px; padding:0 11px; border:1px solid var(--portal-field); border-radius:3px; background:#fff; color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-ann-pagination button:hover { color:var(--portal-primary); border-color:var(--portal-primary); }

body.portal-shell.theme-modern .portal-apply-selection-strip,
body.portal-shell.theme-modern .portal-unified-form-head,
body.portal-shell.theme-modern .portal-current-mobile { border-color:var(--portal-line); background:var(--portal-soft); }
body.portal-shell.theme-modern .portal-step-dot { width:30px; height:30px; font-size:13px; }
body.portal-shell.theme-modern .portal-step-labels { color:var(--portal-muted); }
body.portal-shell.theme-modern .portal-step-labels .active { color:var(--portal-primary); }
body.portal-shell.theme-modern .portal-info-notice,
body.portal-shell.theme-modern .portal-password-footnote { border:1px solid #bfd5fb; border-radius:4px; color:#174ea6; background:var(--portal-primary-soft); }
body.portal-shell.theme-modern .account-setting-row,
body.portal-shell.theme-modern .portal-security-form-card .field,
body.portal-shell.theme-modern .portal-profile-edit-fields .field { border-color:var(--portal-line); }
body.portal-shell.theme-modern .account-setting-value,
body.portal-shell.theme-modern .portal-current-mobile strong { color:var(--portal-ink); }

body.portal-shell.theme-modern.login-body { display:grid; place-items:center; padding:32px 16px; background:var(--portal-canvas); }
body.portal-shell.theme-modern .portal-auth-header { display:none; }
body.portal-shell.theme-modern .portal-auth-main { width:100%; }
body.portal-shell.theme-modern .portal-auth-stack { width:min(400px,100%); margin:0 auto; }
body.portal-shell.theme-modern .portal-auth-aside { display:none; }
body.portal-shell.theme-modern.login-body .portal-auth-stack.portal-auth-split { background:transparent; border:0; box-shadow:none; }
body.portal-shell.theme-modern.login-body .portal-auth-formpane { width:100%; padding:0; background:transparent; }
body.portal-shell.theme-modern.login-body .portal-auth-formpane .login-card { width:100%; padding:36px; border:0; border-radius:4px; background:#fff; box-shadow:0 12px 30px rgba(23,32,51,.12); backdrop-filter:none; }
body.portal-shell.theme-modern .login-card h1 { color:var(--portal-ink); font-size:24px; }
body.portal-shell.theme-modern .login-card p { color:var(--portal-muted); }
body.portal-shell.theme-modern .login-mode-tabs { padding:3px; border-radius:4px; background:var(--portal-soft); }
body.portal-shell.theme-modern .login-mode-tab { border-radius:3px; color:var(--portal-muted); }
body.portal-shell.theme-modern .login-mode-tab.active { color:var(--portal-primary); box-shadow:0 1px 2px rgba(23,32,51,.08); }

@media (max-width:1199px) {
  body.portal-shell.theme-modern .portal-topbar { width:220px; }
  body.portal-shell.theme-modern .portal-project-context, body.portal-shell.theme-modern .portal-main { margin-left:220px; }
  body.portal-shell.theme-modern .portal-main { padding:24px 24px 40px; }
  body.portal-shell.theme-modern .portal-candidate-context > div { min-width:76px; padding:0 9px; }
  body.portal-shell.theme-modern .portal-candidate-context > div:nth-child(n+3) { display:none; }
  body.portal-shell.theme-modern .portal-jobs-page #selectionActions { left:220px; padding-right:24px; padding-left:24px; }
  body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions,
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions { left:220px; padding-right:24px; padding-left:24px; }
}
@media (max-width:767px) {
  body.portal-shell.theme-modern { min-width:0; padding-bottom:calc(72px + env(safe-area-inset-bottom)); overflow-x:hidden; overflow-x:clip; }
  body.portal-shell.theme-modern .portal-topbar { position:static; width:auto; height:64px; border-right:0; border-bottom:1px solid var(--portal-line); }
  body.portal-shell.theme-modern .portal-topbar-inner { height:64px; padding:0 16px; flex-direction:row; gap:10px; }
  /* The structural layer hides the legacy mobile brand; Modern keeps a compact
     product header so the reserved 64px top bar never becomes blank. */
  body.portal-shell.theme-modern .portal-topbar-inner { display:flex; visibility:visible; }
  body.portal-shell.theme-modern .portal-brand-wrap { display:flex; min-width:0; min-height:0; margin:0; padding:0; border:0; }
  body.portal-shell.theme-modern .portal-brand-wrap::after { content:none; display:none; }
  body.portal-shell.theme-modern .portal-brand::after { content:none; display:none; }
  body.portal-shell.theme-modern .portal-brand-mark { width:28px; height:28px; flex-basis:28px; }
  body.portal-shell.theme-modern .portal-brand { font-size:15px; }
  body.portal-shell.theme-modern .portal-user { display:none; }
  body.portal-shell.theme-modern .portal-nav { position:fixed; z-index:100; left:0; right:0; bottom:0; height:64px; padding:5px 6px max(5px,env(safe-area-inset-bottom)); display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:2px; background:#fff; border-top:1px solid var(--portal-line); box-shadow:0 -4px 16px rgba(23,32,51,.07); }
  body.portal-shell.theme-modern .portal-nav-link { min-width:0; min-height:52px; padding:3px 2px; flex-direction:column; justify-content:center; gap:2px; border-radius:4px; font-size:13px; text-align:center; }
  body.portal-shell.theme-modern .portal-nav-link svg { width:17px; height:17px; }
  /* Mobile tab bar follows the familiar mini-program convention: selection is
     communicated by icon/text colour only, without a tile or underline. */
  body.portal-shell.theme-modern .portal-nav-link:hover,
  body.portal-shell.theme-modern .portal-nav-link.active {
    color:var(--portal-primary);
    background:transparent;
  }
  body.portal-shell.theme-modern .portal-nav-link.active::before {
    content:"";
    display:block;
    left:50%;
    top:auto;
    bottom:0;
    width:20px;
    height:3px;
    transform:translateX(-50%);
    border-radius:2px 2px 0 0;
    background:var(--portal-primary);
  }
  body.portal-shell.theme-modern .portal-topbar .portal-logout, body.portal-shell.theme-modern .portal-topbar #portalLogoutBtn { width:44px; min-width:44px; min-height:44px; margin:0 0 0 auto; padding:0; font-size:0; }
  body.portal-shell.theme-modern .portal-topbar .portal-logout svg, body.portal-shell.theme-modern .portal-topbar #portalLogoutBtn svg { width:17px; height:17px; }
  body.portal-shell.theme-modern .portal-topbar #portalLogoutBtn { display:none; }
  body.portal-shell.theme-modern .portal-account-logout-wrap { display:block; margin-top:16px; }
  body.portal-shell.theme-modern .portal-account-logout {
    width:100%;
    min-height:44px;
    color:var(--portal-muted);
    border-color:var(--portal-field);
    background:var(--portal-surface);
  }
  body.portal-shell.theme-modern .portal-account-logout svg { width:16px; height:16px; }
  body.portal-shell.theme-modern .portal-project-context { position:sticky; top:0; min-height:48px; margin-left:0; padding:0 16px; }
  body.portal-shell.theme-modern .portal-project-name { max-width:calc(100vw - 94px); font-size:14px; }
  body.portal-shell.theme-modern .portal-candidate-context { display:none; }
  body.portal-shell.theme-modern .portal-main { margin:0; padding:20px 16px max(108px,calc(92px + env(safe-area-inset-bottom))); }
  body.portal-shell.theme-modern .portal-application-detail #applicationDetailBody { gap:14px; }
  body.portal-shell.theme-modern .portal-page-title { font-size:22px; }
  body.portal-shell.theme-modern .portal-card { padding:18px 16px; }
  body.portal-shell.theme-modern .portal-grid, body.portal-shell.theme-modern .portal-overview-grid { grid-template-columns:1fr; }
  body.portal-shell.theme-modern .portal-home-project,
  body.portal-shell.theme-modern .portal-subject-panel,
  body.portal-shell.theme-modern .portal-detail-card,
  body.portal-shell.theme-modern .portal-security-form-card,
  body.portal-shell.theme-modern .portal-profile-edit-card { padding:18px 16px; }
  body.portal-shell.theme-modern .portal-home-project { display:block; }
  body.portal-shell.theme-modern .portal-home-project .btn,
  body.portal-shell.theme-modern .portal-subject-actions .btn,
  body.portal-shell.theme-modern .portal-detail-bottom .btn,
  body.portal-shell.theme-modern .portal-security-actions .btn,
  body.portal-shell.theme-modern .portal-profile-actions .btn { width:100%; min-height:44px; }
  body.portal-shell.theme-modern .portal-application-meta { grid-template-columns:1fr; }
  body.portal-shell.theme-modern .portal-application-meta > div + div { border-top:1px solid var(--portal-line); border-left:0; }
  body.portal-shell.theme-modern .portal-ann-row { min-height:72px; padding:14px 16px; }
  body.portal-shell.theme-modern .portal-ann-head { min-width:0; }
  body.portal-shell.theme-modern .portal-ann-title { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  body.portal-shell.theme-modern .portal-ann-date { flex:0 0 auto; font-size:var(--portal-font-label); }
  body.portal-shell.theme-modern .announcement-tools { display:grid; grid-template-columns:minmax(0,1fr) 76px; gap:8px; max-width:none; }
  body.portal-shell.theme-modern .announcement-tools #annSearchBtn { display:inline-flex; min-height:44px; padding:0 12px; align-items:center; justify-content:center; }
  body.portal-shell.theme-modern .portal-ann-pagination { justify-content:center; }
  body.portal-shell.theme-modern .portal-ann-pagination button { min-height:44px; }
  body.portal-shell.theme-modern .portal-subject-facts { grid-template-columns:1fr; }
  body.portal-shell.theme-modern .portal-subject-fact { padding:12px 0; }
  body.portal-shell.theme-modern .portal-flow { min-height:0; display:block; }
  /* A process is read as a vertical timeline on phones, never as a horizontally scrolling strip. */
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-nav {
    width:100%; display:grid; grid-template-columns:minmax(0,1fr); gap:0; margin:0; padding:12px 16px;
    overflow:visible; border:0; border-bottom:1px solid var(--portal-line); background:var(--portal-soft); box-shadow:none;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step {
    position:relative; min-width:0; min-height:64px; display:grid; grid-template-columns:28px minmax(0,1fr);
    align-items:start; gap:12px; margin:0; padding:8px 0 12px; text-align:left;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-dot { position:relative; z-index:1; width:28px; height:28px; grid-column:1; grid-row:1; }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-text { min-width:0; margin:0; grid-column:2; grid-row:1; }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-name { font-size:var(--portal-font-control); line-height:28px; }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-time { max-width:none; margin:2px 0 0; font-size:13px; line-height:1.55; }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step:not(:last-child)::after {
    top:36px; right:auto; bottom:-4px; left:13px; width:2px; height:auto;
    border:0; background:var(--portal-line);
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.done:not(:last-child)::after { background:var(--portal-primary); }
  body.portal-shell.theme-modern .portal-flow-detail { padding:22px 16px; }
  /* Keep form controls comfortable for touch and prevent iOS from zooming focused text inputs. */
  body.portal-shell.theme-modern .portal-form-input, body.portal-shell.theme-modern .portal-form-select, body.portal-shell.theme-modern .portal-form-textarea,
  body.portal-shell.theme-modern.login-body .field input { min-height:44px; font-size:16px; }
  body.portal-shell.theme-modern .portal-form-textarea { min-height:112px; }
  body.portal-shell.theme-modern .portal-radio-opt, body.portal-shell.theme-modern .portal-checkbox-opt { min-height:44px; padding:10px 12px; }
  body.portal-shell.theme-modern .portal-upload-area { min-height:88px; padding:16px; }
  body.portal-shell.theme-modern .portal-declare { padding:14px; }
  /* Candidate-facing records become vertical information blocks; no horizontal table scroll on phones. */
  body.portal-shell.theme-modern .portal-jobs-table, body.portal-shell.theme-modern .portal-jobs-table tbody, body.portal-shell.theme-modern .portal-jobs-table tr, body.portal-shell.theme-modern .portal-jobs-table td { display:block; width:100%; }
  body.portal-shell.theme-modern .portal-jobs-table { overflow:visible; border-radius:6px; }
  body.portal-shell.theme-modern .portal-jobs-table thead { display:none; }
  body.portal-shell.theme-modern .portal-jobs-table tr { padding:14px 16px; border-bottom:1px solid var(--portal-line); }
  body.portal-shell.theme-modern .portal-jobs-table tr:last-child { border-bottom:0; }
  body.portal-shell.theme-modern .portal-jobs-table td { min-height:0; padding:5px 0; border:0; white-space:normal; }
  body.portal-shell.theme-modern .portal-jobs-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:3px; color:var(--portal-muted); font-size:var(--portal-font-label); font-weight:600; }
  body.portal-shell.theme-modern .portal-jobs-actions { margin-top:8px; }
  body.portal-shell.theme-modern .portal-jobs-actions .btn { min-height:36px; width:auto; }
  body.portal-shell.theme-modern .portal-actions { gap:12px; }
  body.portal-shell.theme-modern .portal-jobs-page #selectionActions { left:0; padding:10px 16px; min-height:78px; }
  body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions,
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions { left:0; padding:10px 16px; }
  body.portal-shell.theme-modern .portal-actions > .btn-primary { min-height:44px; flex:1 1 220px; }
  body.portal-shell.theme-modern .portal-actions-bar { bottom:calc(64px + env(safe-area-inset-bottom)); padding:10px 16px; }
  body.portal-shell.theme-modern .portal-actions-bar .btn, body.portal-shell.theme-modern .pay-btn { min-height:44px; width:100%; }
  body.portal-shell.theme-modern .portal-info-table, body.portal-shell.theme-modern .portal-info-table tbody, body.portal-shell.theme-modern .portal-info-table tr, body.portal-shell.theme-modern .portal-info-table th, body.portal-shell.theme-modern .portal-info-table td { display:block; width:100%; }
  body.portal-shell.theme-modern .portal-info-table tr { padding:10px 0; border-bottom:1px solid var(--portal-line); }
  body.portal-shell.theme-modern .portal-info-table th, body.portal-shell.theme-modern .portal-info-table td { padding:4px 0; border:0; background:transparent; }
  body.portal-shell.theme-modern .portal-apply-shell .portal-info-table tr { padding-left:10px; }
  body.portal-shell.theme-modern .portal-apply-shell .portal-info-table td { padding-left:0; }
  body.portal-shell.theme-modern.login-body { min-height:100svh; padding:16px; }
  body.portal-shell.theme-modern .portal-login-page > .portal-auth-main, body.portal-shell.theme-modern .portal-register-page > .portal-auth-main { min-height:100svh; padding:24px 16px; display:flex; align-items:center; }
  body.portal-shell.theme-modern .portal-auth-project-name { position:static; margin:0 0 14px; padding:0; color:var(--portal-ink); font-size:16px; line-height:1.5; overflow-wrap:anywhere; }
  body.portal-shell.theme-modern .login-card { padding:28px 24px; border:0; box-shadow:none; }
  body.portal-shell.theme-modern .login-submit { min-height:44px; height:44px; }
  body.portal-shell.theme-modern .confirm-dialog { align-items:flex-end; padding:16px; }
  body.portal-shell.theme-modern .confirm-dialog-panel { width:100%; max-width:520px; max-height:calc(100svh - 32px); overflow:auto; }
  body.portal-shell.theme-modern .confirm-dialog-actions .btn { min-height:44px; }
}
@media (max-width:479px) {
  body.portal-shell.theme-modern .portal-actions .btn, body.portal-shell.theme-modern .portal-project-bar .btn, body.portal-shell.theme-modern .portal-job-card-actions .btn { width:100%; min-height:44px; }
  body.portal-shell.theme-modern .portal-project-select { min-width:0; width:100%; }
  body.portal-shell.theme-modern .portal-banner { padding:12px; }
  body.portal-shell.theme-modern .confirm-dialog { padding:16px; }
  body.portal-shell.theme-modern .confirm-dialog-panel { padding:24px 20px 20px; }
}
@media (prefers-reduced-motion:reduce) { body.portal-shell.theme-modern *, body.portal-shell.theme-modern *::before, body.portal-shell.theme-modern *::after { animation-duration:.01ms; transition-duration:.01ms; scroll-behavior:auto; } }

/* Auth pages must not inherit the Classic template's enlarged, edge-to-edge form rules. */
body.portal-shell.theme-modern.login-body.portal-login-page .portal-auth-stack.portal-auth-split,
body.portal-shell.theme-modern.login-body.portal-register-page .portal-auth-stack.portal-auth-split {
  width:min(420px,calc(100vw - 32px));
  max-width:420px;
  transform:none;
}
body.portal-shell.theme-modern.login-body.portal-register-page .portal-auth-stack.portal-auth-split { max-width:440px; }
body.portal-shell.theme-modern.login-body.portal-login-page .login-card,
body.portal-shell.theme-modern.login-body.portal-register-page .login-card {
  padding:28px 30px;
  border:0;
  border-radius:4px;
  background:#fff;
  box-shadow:0 12px 30px rgba(23,32,51,.12);
}
body.portal-shell.theme-modern.login-body .portal-auth-project-name {
  position:static;
  margin:0 0 12px;
  padding:0;
  color:var(--portal-ink);
  font-size:var(--portal-font-control);
  font-weight:650;
  line-height:1.45;
  text-align:center;
  overflow-wrap:anywhere;
}
body.portal-shell.theme-modern.login-body .login-card h1 {
  margin:0 0 4px;
  color:var(--portal-ink);
  font-size:26px;
  font-weight:700;
  line-height:1.35;
  text-align:center;
}
body.portal-shell.theme-modern.login-body .login-card > p {
  margin:0 0 20px;
  color:var(--portal-muted);
  font-size:var(--portal-font-control);
  line-height:1.55;
  text-align:center;
}
body.portal-shell.theme-modern.login-body .login-card .field {
  margin:0 0 14px;
}
body.portal-shell.theme-modern.login-body .login-card .field label {
  margin-bottom:6px;
  color:var(--portal-ink);
  font-size:var(--portal-font-label);
  font-weight:650;
  line-height:1.4;
}
body.portal-shell.theme-modern.login-body .login-card .field input {
  min-height:44px;
  padding:9px 12px;
  border:1px solid var(--portal-field);
  border-radius:3px;
  color:var(--portal-ink);
  font-size:var(--portal-font-control);
  line-height:22px;
}
body.portal-shell.theme-modern.login-body .login-card .field input::placeholder { color:#8b97a8; }
body.portal-shell.theme-modern.login-body .login-mode-tabs {
  gap:0;
  margin:0 0 18px;
  padding:3px;
  border:1px solid var(--portal-line);
  border-radius:4px;
  background:var(--portal-soft);
}
body.portal-shell.theme-modern.login-body .login-mode-tab {
  min-height:40px;
  padding:7px 10px;
  border-radius:3px;
  font-size:var(--portal-font-control);
  font-weight:650;
}
body.portal-shell.theme-modern.login-body .code-row { gap:8px; }
body.portal-shell.theme-modern.login-body .code-row button { min-width:108px; min-height:44px; padding:0 12px; font-size:var(--portal-font-label); }
body.portal-shell.theme-modern.login-body .portal-login-remember,
body.portal-shell.theme-modern.login-body .portal-auth-agreement {
  gap:8px;
  margin-top:2px;
  color:var(--portal-muted);
  font-size:var(--portal-font-label);
  line-height:1.55;
}
body.portal-shell.theme-modern.login-body .portal-login-remember input,
body.portal-shell.theme-modern.login-body .portal-auth-agreement input { width:16px; height:16px; margin:1px 0 0; }
body.portal-shell.theme-modern.login-body .login-submit {
  min-height:44px;
  height:44px;
  margin-top:18px;
  border-radius:4px;
  font-size:var(--portal-font-control);
  box-shadow:0 1px 2px rgba(23,32,51,.08);
}
body.portal-shell.theme-modern.login-body .portal-auth-register-link,
body.portal-shell.theme-modern.login-body .portal-links { margin-top:16px; font-size:var(--portal-font-label); }
body.portal-shell.theme-modern.login-body .portal-auth-legal { margin-top:14px; color:var(--portal-muted); font-size:var(--portal-font-label); line-height:1.55; }
body.portal-shell.theme-modern.login-body .login-card .field small { margin-top:5px; color:var(--portal-muted); font-size:var(--portal-font-label); line-height:1.45; }
body.portal-shell.theme-modern .portal-form-error,
body.portal-shell.theme-modern .error {
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:8px;
  margin:0 0 14px;
  padding:10px 12px;
  border:1px solid #f0b9b4;
  border-radius:4px;
  background:#fff0ef;
  color:var(--portal-error);
  font-size:var(--portal-font-label);
  font-weight:600;
  line-height:1.5;
}
body.portal-shell.theme-modern .portal-form-error::before,
body.portal-shell.theme-modern .error::before {
  content:'!';
  display:grid;
  place-items:center;
  width:16px;
  height:16px;
  flex:0 0 16px;
  margin-top:2px;
  border-radius:50%;
  background:var(--portal-error);
  color:#fff;
  font-size:11px;
  font-weight:800;
  line-height:1;
}

/* The inherited Classic stylesheet used direct 11–14px declarations on
   individual elements.  A token on the page shell cannot beat those values.
   Normalize Portal content at the final component layer, then explicitly
   reserve the smaller metadata scale only for supporting information. */
body.portal-shell.theme-modern .portal-main :is(p, span, b, strong, a, button, input, select, textarea, label, small, em) {
  font-size:var(--portal-font-control);
}
body.portal-shell.theme-modern .portal-main :is(.portal-flow-step-time, .portal-selected-row span, .portal-detail-back, .portal-detail-status, .portal-phase-badge, .portal-job-tag, .portal-flow-info-badge, .portal-application-meta span, .portal-detail-fields span, .portal-job-meta, .portal-ann-date) {
  font-size:var(--portal-font-label);
}
body.portal-shell.theme-modern .portal-main :is(.portal-page-sub, .portal-card-sub, .portal-meta, .portal-detail-section-head p, .portal-detail-file-copy b, .portal-detail-subject-copy > span) {
  font-size:var(--portal-font-control);
}
/* Information notices are supporting copy.  Keep their icon as a compact
   marker so it does not visually outweigh the message itself. */
body.portal-shell.theme-modern .portal-main .portal-info-notice {
  gap:10px;
}
body.portal-shell.theme-modern .portal-main .portal-info-notice > svg {
  width:14px;
  height:14px;
  flex:0 0 14px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
}
/* Dashboard lifecycle has its own compact hierarchy: it should support the
   page, not compete with its main content.  These rules come after the final
   type normalizer so legacy element selectors cannot enlarge it again. */
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-name { font-size:13px; line-height:1.4; }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-time { font-size:12px; line-height:1.45; }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected,
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] { background:transparent; }
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected .portal-flow-step-text,
body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] .portal-flow-step-text {
  margin:8px 0 0;
  padding:5px 8px 6px;
  border-radius:4px;
  background:var(--portal-primary-soft);
}
@media (max-width:767px) {
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-name { font-size:13px; }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-time { font-size:12px; }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected .portal-flow-step-text,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] .portal-flow-step-text { margin:0; padding:4px 6px; }
}

/* On phones the lifecycle is a compact vertical timeline.  It preserves the
   natural process order without the desktop rail's horizontal crowding. */
@media (max-width:767px) {
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-flow-nav:not([hidden])) {
    display:grid;
    gap:12px;
    overflow:visible;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-nav {
    order:0;
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:0;
    margin:0;
    padding:12px 16px;
    overflow:visible;
    border:1px solid var(--portal-line);
    border-radius:8px;
    background:var(--portal-surface);
    box-shadow:0 6px 18px rgba(23,32,51,.08);
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step {
    position:relative;
    min-height:52px;
    display:grid;
    grid-template-columns:28px minmax(0,1fr);
    align-items:start;
    gap:12px;
    padding:7px 0 9px;
    text-align:left;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-dot {
    position:relative;
    z-index:1;
    width:24px;
    height:24px;
    flex:0 0 24px;
    font-size:12px;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step:not(:last-child)::after {
    top:31px;
    right:auto;
    bottom:-3px;
    left:11px;
    width:2px;
    height:auto;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-text {
    width:100%;
    min-width:0;
    margin:0;
    padding:0;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-name {
    min-height:0;
    font-size:13px;
    line-height:1.45;
    font-weight:650;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step-time {
    display:block;
    margin-top:1px;
    font-size:12px;
    line-height:1.45;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step.selected .portal-flow-step-text,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-step[aria-current="step"] .portal-flow-step-text {
    margin:0;
    padding:3px 8px 4px;
    border-radius:3px;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail {
    order:1;
    display:grid;
    gap:12px;
    padding:0;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-state-published,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-state-card {
    margin:0;
  }
}

/* Keep a locked-subject state as a content-sized status tag.  The mobile
   action row reserves its width for the action button instead of stretching
   the tag across the remaining column. */
@media (max-width:767px) {
  body.portal-shell.theme-modern .portal-subject-detail-page .portal-subject-actions {
    grid-template-columns:max-content auto;
    justify-content:space-between;
  }
  body.portal-shell.theme-modern .portal-subject-detail-page .portal-detail-selected-state {
    width:max-content;
    justify-self:start;
    align-self:center;
  }
  body.portal-shell.theme-modern .portal-subject-detail-page .portal-subject-actions .btn {
    justify-self:end;
  }
}

/* Mobile workflow details are separate cards, not one inherited panel wrapped
   around another.  Keep the ordinary process copy inside one comfortably
   padded surface; published scores and ticket stages already provide their
   own information cards, so remove the redundant parent surface there. */
@media (max-width:767px) {
  /* The fixed bottom navigation already exposes “账号管理”; a second return
     link above a form wastes the first screen on phones. */
  body.portal-shell.theme-modern .portal-account-form-page .portal-page-head {
    display:none;
  }
  /* The application-detail heading is also a desktop-only toolbar.  Its title
     and button are already hidden on phones by the structural sheet, so hide
     the empty shell as well instead of leaving a dead vertical gap. */
  body.portal-shell.theme-modern .portal-application-detail > .portal-detail-heading {
    display:none;
  }
  body.portal-shell.theme-modern .portal-subject-detail-page > .portal-page-head {
    display:none;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail {
    padding:18px 16px;
    border:1px solid var(--portal-line);
    border-radius:8px;
    background:var(--portal-surface);
    box-shadow:0 6px 18px rgba(23,32,51,.08);
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-title,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-block,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-desc,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-actions {
    margin:0;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-title {
    font-size:18px;
    line-height:1.4;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-desc {
    padding:0;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-actions {
    grid-template-columns:1fr;
    padding-top:12px;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow-detail > .portal-flow-info-actions .btn {
    min-height:44px;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-state-published) .portal-flow-detail,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-stage-hero) .portal-flow-detail {
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-state-published) .portal-state-card,
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-stage-hero) .portal-state-card {
    padding:16px;
    border:1px solid var(--portal-line);
    border-radius:8px;
    background:var(--portal-surface);
    box-shadow:0 6px 18px rgba(23,32,51,.08);
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-stage-hero) .portal-stage-hero {
    margin:0;
    padding:18px 16px;
    border:1px solid var(--portal-line);
    border-radius:8px;
    background:var(--portal-surface);
    box-shadow:0 6px 18px rgba(23,32,51,.08);
  }
}
@media (max-width:479px) {
  body.portal-shell.theme-modern.login-body { padding:16px; }
  body.portal-shell.theme-modern.login-body.portal-login-page .portal-auth-stack.portal-auth-split,
  body.portal-shell.theme-modern.login-body.portal-register-page .portal-auth-stack.portal-auth-split { width:100%; }
  body.portal-shell.theme-modern.login-body.portal-login-page .login-card,
  body.portal-shell.theme-modern.login-body.portal-register-page .login-card { padding:24px 20px; }
  body.portal-shell.theme-modern.login-body .code-row { display:grid; grid-template-columns:minmax(0,1fr) 108px; }
}

/* Exam Portal layout corrections.
   The legacy structural sheet intentionally remains isolated in a cascade
   layer, but it still supplies several narrow content caps and fixed-action
   offsets.  Keep the Modern overrides here, scoped to the affected Portal
   routes, so large desktop canvases and the H5 bottom navigation agree. */
@media (min-width:769px) {
  /* A 760–980px cap made routine Portal pages use only a small portion of the
     available workspace beside the navigation rail. */
  body.portal-shell.theme-modern .portal-jobs-list,
  body.portal-shell.theme-modern .portal-jobs-list + .portal-actions,
  body.portal-shell.theme-modern .portal-subject-panel,
  body.portal-shell.theme-modern .portal-subject-facts,
  body.portal-shell.theme-modern .portal-subject-actions,
  body.portal-shell.theme-modern .portal-ann-list-surface,
  body.portal-shell.theme-modern .announcement-tools,
  body.portal-shell.theme-modern .announcement-tabs,
  body.portal-shell.theme-modern .portal-ann-row,
  body.portal-shell.theme-modern .portal-ann-pagination,
  body.portal-shell.theme-modern .portal-ann-detail,
  body.portal-shell.theme-modern .account-panel,
  body.portal-shell.theme-modern .portal-profile-edit-card,
  body.portal-shell.theme-modern .portal-security-form-card,
  body.portal-shell.theme-modern .portal-password-footnote {
    width:100%;
    max-width:none;
  }

  /* The apply shell is also the sidebar-offset main element.  Giving it a
     100% width adds the 244px left margin on top of the viewport width and
     creates a page-level horizontal scrollbar.  Auto width fills only the
     remaining workspace beside the navigation. */
  body.portal-shell.theme-modern .portal-apply-shell {
    width:auto;
    min-width:0;
    max-width:none;
  }

  /* Keep editable account forms comfortably wide without turning labels into
     an overlong single line on ultrawide monitors. */
  body.portal-shell.theme-modern .portal-security-form-card,
  body.portal-shell.theme-modern .portal-password-footnote { margin-left:0; margin-right:0; }

  /* The action rail must begin after the Modern sidebar at every desktop
     width; otherwise its selection status hides below the navigation. */
  body.portal-shell.theme-modern .portal-jobs-page #selectionActions {
    left:244px;
    right:0;
    box-sizing:border-box;
  }

  /* Confirmation rows need a stable value column rather than two compressed
     legacy grids sharing the same narrow card. */
  body.portal-shell.theme-modern .portal-apply-shell #confirmRows {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    column-gap:32px;
  }
  body.portal-shell.theme-modern .portal-apply-shell #confirmRows tr {
    min-width:0;
    grid-template-columns:120px minmax(0,1fr);
    column-gap:16px;
  }
  body.portal-shell.theme-modern .portal-apply-shell #confirmRows th,
  body.portal-shell.theme-modern .portal-apply-shell #confirmRows td {
    min-width:0;
    overflow-wrap:anywhere;
  }

  /* Audit-in-progress is content-sized; a generic 400px workflow panel left
     a conspicuous empty band below the review message. */
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-review-hero),
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow:has(.portal-review-hero) .portal-flow-detail {
    min-height:0;
  }
}

@media (min-width:769px) and (max-width:1199px) {
  body.portal-shell.theme-modern .portal-jobs-page #selectionActions { left:220px; }
}

@media (max-width:767px) {
  /* Restore the card gutter that display-contents table rules remove from the
     application header and identity fields. */
  body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-card {
    padding:18px 16px;
  }
  body.portal-shell.theme-modern .portal-apply-shell .portal-unified-form-head {
    margin:0 -16px 16px;
    padding:0 16px 14px;
  }
  body.portal-shell.theme-modern .portal-apply-shell .portal-info-table {
    margin-left:0;
    margin-right:0;
  }
  /* Bottom actions sit directly above the 64px mobile navigation, including
     the device safe area, instead of inheriting the old 76px separation. */
  body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions,
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions {
    right:0;
    bottom:calc(64px + env(safe-area-inset-bottom));
    padding:10px 16px calc(10px + env(safe-area-inset-bottom));
    box-sizing:border-box;
  }

  /* The not-yet-registered project card should follow its content instead of
     reserving desktop-height whitespace; leave a deliberate button gap. */
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-home-project {
    min-height:0;
    padding:16px;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-home-project .btn {
    margin-top:16px;
  }

  /* Rejected review content is rendered directly into the workflow detail on
     phones, so it needs its own touch-friendly inset. */
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-rejected-hero {
    margin:0;
    padding:18px 16px;
  }
}

/* Public legal documents intentionally keep the Modern template's independent
   visual language, rather than inheriting the login form layout. */
body.portal-shell.theme-modern.portal-legal-page {
  display:block;
  min-height:100vh;
  padding:48px 20px;
  background:var(--portal-canvas);
}
body.portal-shell.theme-modern .portal-legal-main { width:min(760px,100%); margin:0 auto; }
body.portal-shell.theme-modern .portal-legal-card {
  padding:36px 40px 42px;
  border:1px solid var(--portal-line);
  border-radius:10px;
  background:var(--portal-surface);
  box-shadow:0 10px 28px rgba(23,32,51,.08);
}
body.portal-shell.theme-modern .portal-legal-back { display:inline-flex; margin-bottom:28px; color:var(--portal-primary); font-size:14px; font-weight:600; }
body.portal-shell.theme-modern .portal-legal-project { margin:0 0 8px; color:var(--portal-muted); font-size:14px; }
body.portal-shell.theme-modern .portal-legal-card h1 { margin:0; color:var(--portal-ink); font-size:28px; line-height:1.35; }
body.portal-shell.theme-modern .portal-legal-updated { margin:8px 0 32px; color:var(--portal-muted); font-size:13px; }
body.portal-shell.theme-modern .portal-legal-content { color:var(--portal-text); font-size:14px; line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; }
@media (max-width:767px) {
  body.portal-shell.theme-modern.portal-legal-page { padding:24px 16px; }
  body.portal-shell.theme-modern .portal-legal-card { padding:24px 20px 30px; border-radius:8px; }
  body.portal-shell.theme-modern .portal-legal-back { margin-bottom:22px; }
  body.portal-shell.theme-modern .portal-legal-card h1 { font-size:24px; }
  body.portal-shell.theme-modern .portal-legal-updated { margin-bottom:26px; }
}

/* Final Modern adjustments from the application-page review.  Keep these in
   the template stylesheet so the legacy foundation cannot reintroduce its
   fixed action rail or its former compact job-list treatment. */
body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-jobs-list {
  overflow:visible;
  border:0;
  background:#f3f5f8;
  box-shadow:none;
}
body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-card {
  margin:0 0 10px;
}
body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-card:last-child {
  margin-bottom:0;
}

/* A withdrawn application uses the same desktop card sequence as the other
   dashboard states: status first, then the compact lifecycle.  The legacy
   flex rail otherwise combines a full-width nav with the detail panel and
   makes the two-step recovery state overlap or collapse. */
@media (min-width:768px) {
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow[data-application-status="withdrawn"] {
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-auto-rows:max-content;
    align-content:start;
    gap:16px;
    overflow:visible;
    border:0;
    background:transparent;
    box-shadow:none;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow[data-application-status="withdrawn"] > .portal-flow-detail {
    order:1;
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:16px 24px;
    padding:20px 22px;
    border:1px solid var(--portal-line);
    border-radius:8px;
    background:var(--portal-surface);
    box-shadow:0 6px 18px rgba(23,32,51,.08);
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow[data-application-status="withdrawn"] .portal-withdrawn-hero {
    min-width:0;
    margin:0;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow[data-application-status="withdrawn"] .portal-flow-info-actions {
    grid-column:2;
    grid-row:1;
    align-self:center;
    min-width:142px;
    margin:0;
    padding:0;
    border:0;
  }
  body.portal-shell.theme-modern .portal-main:has(#dashboard) .portal-flow[data-application-status="withdrawn"] > .portal-flow-nav {
    order:2;
    width:100%;
    max-width:none;
    margin:0;
    padding:16px 18px 14px;
    border:0;
    border-radius:8px;
    background:var(--portal-surface);
    box-shadow:0 6px 18px rgba(23,32,51,.08);
  }
}

body.portal-shell.theme-modern .portal-apply-shell .portal-unified-form-head {
  margin:0 0 20px;
  padding:16px 14px;
}

/* Desktop confirmation actions belong to the form content, not to the old
   fixed page rail.  A static, full-width row cannot be clipped by the
   sidebar-offset calculation and still keeps the two actions right-aligned. */
@media (min-width:769px) {
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 #confirmRows th,
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 #confirmRows td {
    padding-left:14px;
    padding-right:14px;
  }
  body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions,
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions {
    position:static;
    inset:auto;
    width:100%;
    min-width:0;
    margin:16px 0 0;
    padding:14px 0 0;
    justify-content:flex-end;
    border:0;
    background:transparent;
    box-shadow:none;
    box-sizing:border-box;
  }
  body.portal-shell.theme-modern .portal-apply-shell #applyStep1 > .portal-actions .btn,
  body.portal-shell.theme-modern .portal-apply-shell #applyStep2 > .portal-actions .btn {
    flex:0 0 auto;
    min-width:124px;
  }
}

/* Mobile job rows: reserve a real title column and turn the detail affordance into an icon-sized control so long titles wrap without being covered. */
@media (max-width:768px) {
  body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-card {
    grid-template-columns:20px minmax(0,1fr);
    padding-right:58px;
  }
  body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-name {
    min-width:0;
    align-items:flex-start;
  }
  body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-name b {
    display:block;
    min-width:0;
    flex:1 1 auto;
    overflow-wrap:anywhere;
    word-break:break-word;
    text-wrap:pretty;
  }
  body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-detail {
    right:10px;
    width:38px;
    min-width:38px;
    min-height:38px;
    height:38px;
    padding:0;
    border:1px solid #bfd2ee;
    border-radius:5px;
    background:#f7faff;
    justify-content:center;
  }
  body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-detail span {
    display:none!important;
  }
  body.portal-shell.theme-modern:has(#jobsList) .portal-jobs-page .portal-job-detail svg {
    width:17px;
    height:17px;
  }
}
