/* Career Passport portal (VU-1463): the VerifyU portal's look (blue gradient
   sidebar, white top bar with a breadcrumb, cards with a soft shadow), built
   with this portal's own CSS so the CSP stays 'self'. */

:root {
  --brand: #4e73df;
  --brand-dark: #224abe;
  --brand-ink: #ffffff;
  --brand-soft: #eef2fd;
  --ink: #3a3b45;
  --heading: #2e3140;
  --muted: #6e707e;
  --line: #e3e6f0;
  --bg: #f8f9fc;
  --card: #ffffff;
  --ok: #13855c;
  --ok-bg: #e3f7ef;
  --bad: #c0392b;
  --bad-bg: #fdeceb;
  --warn-bg: #fff6dc;
  --warn: #7a5b00;
  --radius: 8px;
  --shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.12);
  --sidebar: 248px;
  --topbar: 64px;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--brand-dark); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(78, 115, 223, 0.45); outline-offset: 2px; }

/* --- The shell: sidebar, top bar, content --- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 1000;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--brand) 10%, var(--brand-dark) 100%); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.brand-icon { width: 34px; height: 34px; }
.brand strong { display: block; font-size: 17px; letter-spacing: 0.2px; }
.brand small { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; margin: 2px 12px; padding: 10px 14px; border-radius: 6px;
  color: rgba(255, 255, 255, 0.82); text-decoration: none; font-weight: 600; font-size: 14px;
}
.side-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.side-nav a.active { color: #fff; background: rgba(255, 255, 255, 0.18); }
.side-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.side-heading { margin: 4px 26px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-group a { font-weight: 600; }
.side-user { padding: 14px 16px 16px; border-top: 1px solid rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.06); }
.side-user .who { display: flex; gap: 10px; align-items: center; min-width: 0; margin-bottom: 10px; }
.side-user .who > span:last-child { min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.2); font-weight: 800; flex: none; }
.side-user .email { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.side-user form { margin: 0; }
.side-logout {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 6px; background: transparent; color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
}
.side-logout:hover { background: rgba(255, 255, 255, 0.12); }

.topbar {
  position: fixed; top: 0; right: 0; left: var(--sidebar); height: var(--topbar); z-index: 900;
  display: flex; align-items: center; gap: 16px; padding: 0 28px; background: #fff; box-shadow: var(--shadow);
}
.menu-btn { display: none; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px; color: var(--ink); cursor: pointer; }
.menu-btn .icon { width: 20px; height: 20px; display: block; }
.crumbs { flex: 1; min-width: 0; }
.crumbs ol { display: flex; align-items: center; flex-wrap: nowrap; gap: 0; margin: 0; padding: 0; list-style: none; font-size: 14px; overflow: hidden; }
.crumbs li { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.crumbs li + li::before { content: "/"; color: #b7b9cc; margin: 0 10px; }
.crumbs a { color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--brand-dark); }
.crumbs [aria-current] { color: var(--heading); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.env { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); text-transform: uppercase; letter-spacing: 0.05em; }

.content { margin-left: var(--sidebar); padding: calc(var(--topbar) + 28px) 32px 48px; max-width: calc(var(--sidebar) + 1280px); }
.content.bare { margin: 0 auto; padding: 32px 24px; max-width: 960px; }
.scrim { position: fixed; inset: 0; background: rgba(20, 24, 40, 0.45); z-index: 950; }

/* --- Page header --- */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin: 0 0 24px; }
.page-title { display: flex; gap: 16px; align-items: center; min-width: 0; }
.page-title > div { min-width: 0; }
.page-logo { width: 52px; height: 52px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; }
.page-logo.blank { display: grid; place-items: center; color: var(--brand); }
.page-logo.blank .icon { width: 26px; height: 26px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: var(--muted); text-decoration: none; }
.eyebrow a::before { content: "‹ "; }
.eyebrow a:hover { color: var(--brand-dark); }
h1 { font-size: 26px; line-height: 1.25; margin: 2px 0 0; color: var(--heading); font-weight: 800; overflow-wrap: anywhere; }
.lede { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Cards --- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px 24px; margin-bottom: 24px; min-width: 0; }
.content .panel > h2:first-child {
  margin: -20px -24px 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: #f8f9fc;
  border-radius: var(--radius) var(--radius) 0 0; font-size: 15px; font-weight: 800; color: var(--brand-dark); letter-spacing: 0.01em;
}
.panel h2 { font-size: 18px; margin: 0 0 4px; color: var(--heading); }
.panel .hint, .hint { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.panel.narrow { max-width: 560px; }

/* --- Forms --- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > .field { flex: 1 1 220px; min-width: 0; }
.field { margin-bottom: 16px; }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--heading); }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="date"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d1d3e2; border-radius: 6px; font: inherit; font-size: 14px; background: #fff; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #bac8f3; box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.22); }
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
textarea.prose { min-height: 84px; font-family: inherit; font-size: 14px; }
input[type="color"] { width: 48px; height: 38px; border: 1px solid #d1d3e2; border-radius: 6px; padding: 2px; background: #fff; }
input[type="file"] { font: inherit; font-size: 14px; max-width: 100%; }
.colour { display: flex; gap: 8px; align-items: center; }
.colour input[type="text"] { width: 120px; }
small.help { color: var(--muted); display: block; margin-top: 4px; font-size: 13px; }
.field.checkbox label { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.field.checkbox input { width: auto; margin-top: 4px; }
.form-actions, .modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
form.inline input, form.inline select { width: auto; min-width: 0; }
fieldset { min-width: 0; }
button[disabled], input[disabled], select[disabled] { opacity: 0.55; cursor: not-allowed; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px !important; letter-spacing: 0.02em; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-size: 14px; font-weight: 700; line-height: 1.4; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #2e59d9; border-color: #2653d4; }
.btn .icon { width: 16px; height: 16px; }
.btn.secondary { background: #fff; color: var(--brand-dark); border-color: #c9d3f0; }
.btn.secondary:hover { background: var(--brand-soft); }
.btn.danger { background: #e74a3b; border-color: #e74a3b; }
.btn.danger:hover { background: #d52a1a; border-color: #d52a1a; }
.btn.danger-outline { background: #fff; color: var(--bad); border-color: #f2c4bf; }
.btn.danger-outline:hover { background: var(--bad-bg); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.link { background: none; border: none; color: var(--muted); padding: 0; font-weight: 400; }

/* --- Notices and badges --- */
.notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; border: 1px solid transparent; }
.notice.success { background: var(--ok-bg); color: var(--ok); border-color: #bfe9d7; }
.notice.error { background: var(--bad-bg); color: var(--bad); border-color: #f6c9c4; }
.notice ul { margin: 4px 0 0; padding-left: 20px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.badge.off { background: #eceef4; color: var(--muted); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.approver { background: #e7f5ec; color: #1e6b3a; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font-size: 13px; background: #f1f3f9; padding: 1px 5px; border-radius: 4px; }

/* --- Tables and data grids --- */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 6px; max-height: max(420px, calc(100vh - 220px)); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
th { font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; background: #f8f9fc; white-space: nowrap; }
table.grid thead th { position: sticky; top: 0; z-index: 1; }
table.grid tbody tr:hover td { background: #fafbfe; }
td img.logo { height: 28px; max-width: 80px; object-fit: contain; vertical-align: middle; }
.col-logo { width: 72px; }
.col-date, .nowrap { white-space: nowrap; }
.col-email { min-width: 210px; }
.col-sf { min-width: 0; }
td.col-date { white-space: normal; min-width: 104px; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.col-reason { min-width: 180px; }
.col-credential { min-width: 200px; }
.col-status { min-width: 160px; }
.cell-strong { display: block; font-weight: 700; color: var(--heading); overflow-wrap: anywhere; }
.cell-sub { display: block; font-size: 13px; color: var(--muted); white-space: normal; }
.cell-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.cell-form input[type="text"] { width: 21ch; min-width: 0; flex: 0 1 auto; padding: 6px 8px; }
.cell-form .btn { flex: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
th .sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
th .sort:focus-visible { outline: 3px solid rgba(78, 115, 223, 0.45); outline-offset: 2px; border-radius: 3px; }
th .sort-arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #c1c4d6; opacity: 0.8; }
th[aria-sort="ascending"] .sort-arrow { border-top: none; border-bottom: 5px solid var(--brand); }
th[aria-sort="descending"] .sort-arrow { border-top-color: var(--brand); }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--brand-dark); }
.grid-none td { text-align: center; color: var(--muted); padding: 20px; }
.grid-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.grid-search { position: relative; flex: 1 1 280px; max-width: 420px; margin: 0; font-weight: 400; }
.grid-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #9a9cad; }
.grid-search input { padding-left: 36px; }
.grid-count { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.grid-sort { display: none !important; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.grid-sort select { width: auto; padding: 7px 10px; }
.grid-foot { margin: 14px 0 0; }

/* --- Dialog --- */
dialog.modal { border: none; border-radius: 10px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(20, 24, 40, 0.3); }
dialog.modal::backdrop { background: rgba(20, 24, 40, 0.5); }
dialog.modal form { padding: 22px 24px 20px; }
dialog.modal h2 { margin: 0 0 6px; font-size: 18px; color: var(--heading); overflow-wrap: anywhere; }

/* --- Employers' tabbed people pages (VU-1144, VU-1151) --- */
.person { border-top: 1px solid var(--line); padding: 16px 0; }
.person:first-of-type { border-top: none; }
.person-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.decide { align-items: flex-start; }
.decision { flex: 1 1 300px; min-width: 0; }
table.staff td form.inline select { width: auto; }

/* --- The employee card preview (front), drawn from the branding fields --- */
.card-preview {
  width: 340px; max-width: 100%; aspect-ratio: 1.586; border-radius: 14px; padding: 18px; color: #fff; position: relative;
  overflow: hidden; box-shadow: 0 8px 24px rgba(20, 33, 61, 0.18);
  background: linear-gradient(135deg, var(--card-primary, #1747a6), var(--card-secondary, #0b1f4d));
}
.card-preview .wm { position: absolute; right: -10px; bottom: -10px; width: 60%; opacity: 0.18; }
.card-preview .logo { height: 32px; max-width: 140px; object-fit: contain; background: rgba(255,255,255,0.9); border-radius: 6px; padding: 3px 6px; }
.card-preview .name { position: absolute; left: 18px; bottom: 44px; font-size: 18px; font-weight: 600; }
.card-preview .role { position: absolute; left: 18px; bottom: 22px; font-size: 13px; opacity: 0.85; }
.card-preview .confirmed { position: absolute; right: 18px; top: 22px; font-size: 11px; opacity: 0.85; }

/* --- Achievements --- */
.achievement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
/* --- Achievements' tabs and the Salesforce tab (VU-1478) --- */
.tabs { display: flex; gap: 4px; margin: -8px 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--heading); }
.tabs a[aria-current="page"] { color: var(--brand-dark); border-bottom-color: var(--brand); }
.sf-achievements td:last-child { text-align: right; }
details.advanced > summary { cursor: pointer; font-weight: 700; color: var(--heading); }
details.advanced[open] > summary { margin-bottom: 12px; }
.rule-badge { display: flex; gap: 12px; align-items: center; min-width: 240px; }
.rule-badge > span:last-child { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.rule-badge-art { flex: 0 0 56px; width: 56px; }
.rule-badge-art img, .rule-badge-art .placeholder { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #f3f5fa; }
.rule-badge-art .placeholder { display: grid; place-items: center; font-size: 24px; color: var(--muted); }
.rule-badge-art [hidden] { display: none; }
.rule-badges-again { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.achievement-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.achievement-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.achievement-card strong { color: var(--heading); overflow-wrap: anywhere; }
.achievement-card img, .badge-art img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #f3f5fa; }
.achievement-card .placeholder, .badge-art .placeholder { display: grid; place-items: center; aspect-ratio: 1; font-size: 48px; color: var(--muted); background: #f3f5fa; border-radius: 8px; }
.achievement-card.archived { opacity: 0.6; }
.achievement-head { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.achievement-head .badge-art { width: 180px; }
.row-actions.wrap { flex-wrap: wrap; justify-content: flex-start; margin-top: 8px; }

/* The template gallery and live 3D preview (VU-1463) */
.template-picker { border: none; padding: 0; margin: 0 0 16px; }
.template-picker > legend { font-weight: 700; font-size: 14px; color: var(--heading); padding: 0; margin-bottom: 4px; }
.template-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px; align-items: start; }
.template-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.template-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 12px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; font-weight: 400; transition: border-color 0.15s, box-shadow 0.15s;
}
.template-card:hover { border-color: #c9d3f0; }
.template-card input { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.template-card:has(input:checked), .template-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.18); }
.template-card:has(input:focus-visible) { outline: 3px solid rgba(78, 115, 223, 0.45); outline-offset: 2px; }
.template-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 8px; background: linear-gradient(160deg, #f3f6fe, #e6ecfb); margin-bottom: 4px; }
.template-thumb.none { color: #b7b9cc; }
.template-thumb.none .icon { width: 36px; height: 36px; }
.template-art { width: 64%; height: auto; }
.template-name { font-weight: 800; color: var(--heading); font-size: 14px; }
.template-blurb { font-size: 12px; color: var(--muted); line-height: 1.4; }
.template-preview { position: sticky; top: calc(var(--topbar) + 16px); border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fbfcff; }
.preview-title { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.preview-stage { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1d2650, #0b1020); margin-bottom: 10px; }
.preview-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.preview-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 14px; }
.template-preview .hint { margin: 0; font-size: 13px; }
fieldset.template-inputs { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px 0; margin: 0 0 16px; background: #fff; }
fieldset.template-inputs > legend { font-weight: 700; font-size: 14px; padding: 0 6px; color: var(--heading); }

/* --- Sign-in and the join page (no shell) --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); }
.login .panel { width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(10, 20, 60, 0.35); border: none; }
.login img { height: 36px; margin-bottom: 12px; }
.login.join .panel { max-width: 480px; }
.join-signin { margin-top: 12px; }
.join-employer { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.join-employer .logo { height: 56px; width: 56px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; margin: 0; }
.join-employer h1 { margin: 0; font-size: 22px; }
.join-employer .lede { margin: 2px 0; }

/* --- Narrow screens: the sidebar folds behind the menu button --- */
@media (max-width: 1100px) {
  .template-layout { grid-template-columns: minmax(0, 1fr); }
  .template-preview { position: static; max-width: 420px; }
}
@media (max-width: 900px) {
  .js .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: none; }
  .js body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.3); }
  .js .menu-btn { display: inline-flex; }
  .js .topbar { left: 0; padding: 0 16px; }
  .js .content { margin-left: 0; padding: calc(var(--topbar) + 20px) 16px 40px; }
  /* Without script: the sidebar sits above the page instead. */
  html:not(.js) .sidebar { position: static; width: auto; }
  html:not(.js) .topbar { position: static; }
  html:not(.js) .content { margin-left: 0; padding: 20px 16px 40px; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .panel { padding: 16px 16px 20px; }
  .content .panel > h2:first-child { margin: -16px -16px 14px; padding: 12px 16px; }
  .page-logo { width: 44px; height: 44px; }
  .achievement-head { grid-template-columns: 1fr; }
  .crumbs li:not(:last-child):not(:nth-last-child(2)) { display: none; }
  .crumbs li:nth-last-child(2)::before { display: none; }
  .table-wrap { max-height: none; }
  .env { display: none; }
  .template-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-search { max-width: none; }
}

/* A stacking grid (the employees) becomes one labelled card per row when its
   card is too narrow for the columns: on phones, and beside the sidebar on
   small laptops. */
.panel:has(table.stack) { container: card / inline-size; }
@container card (max-width: 860px) {
  .table-wrap { border: none; overflow: visible; max-height: none; }
  table.stack thead { display: none; }
  .grid-sort:not([hidden]) { display: flex !important; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; padding: 4px 0; background: #fff; }
  table.stack tbody tr:hover td { background: transparent; }
  table.stack td { border: none; padding: 6px 14px; min-width: 0; text-align: left; white-space: normal; }
  table.stack td[data-label]:not(.col-email)::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  table.stack td.col-actions[data-label]::before { display: none; }
  table.stack td:empty { display: none; }
  table.stack .row-actions { justify-content: flex-start; padding: 4px 0 6px; }
  table.stack .cell-form input[type="text"] { flex: 1 1 auto; width: auto; }
  table.stack .grid-none td { text-align: center; }
}

/* --- employee Edit page: their achievements (VU-1477) --- */
.held-list { list-style: none; margin: 8px 0 0; padding: 0; }
.held { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.held:first-child { border-top: 0; }
.held-art { flex: 0 0 48px; width: 48px; }
.held-art img, .held-art .placeholder { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #f3f5fa; }
.held-art .placeholder { display: grid; place-items: center; font-size: 20px; color: var(--muted); }
.held-body { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.held-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.held-revoke summary { list-style: none; cursor: pointer; }
.held-revoke summary::-webkit-details-marker { display: none; }
.held-revoke[open] form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.held-revoke input[name=reason] { min-width: 200px; flex: 1 1 200px; }
.award-one { margin-bottom: 16px; }

