/* ═══════════════════════════════════════════════════════════════════════════
   ems-staff.css — wave 2 of the Pathways-quality redesign: the MENTOR and ADMIN
   screens (coach.js, mentor-toolbox.js, mentor-profile.js, admin.js,
   admin-program.js, trimetrix.js). Rules: DESIGN.md. Loaded after
   ems-design.css, so it may lean on every --ems-* token and recipe there.

   Target: Pathways' coach desk and admin home. Scorecards one shape (icon plate
   + number + one-line name), clean list rows with faces, the person record as a
   wide pop-up with tabs, filled attention banners instead of coloured stripes,
   charts in the navy token palette, tables that read cleanly (and stack on a
   phone), and nothing that flashes.

   Everything new here is prefixed .ems-s-*. Anything another area could use is
   listed as a promotion candidate in the wave-2 report.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Small layout helpers ─────────────────────────────────────────────── */
/* A card's header row: the title on the left, a quiet figure or tag right. */
.ems-s-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; }
.card .ems-s-head h2, .card .ems-s-head h3 { margin: 0; }
.ems-s-meta { font: 500 13px/1.4 var(--ems-font-ui); color: var(--ems-mute-2); }
.ems-s-h-sub { margin-left: 4px; font: 500 13px/1.3 var(--ems-font-ui); color: var(--ems-mute-2); letter-spacing: 0; }
.ems-s-lede { margin: 0 0 12px; }
.ems-s-foot { margin: 12px 0 0; }
.ems-s-gap { margin-top: 14px; }
.ems-s-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ems-line); }
.ems-s-kicker { display: block; margin: 0 0 6px; font: 600 11.5px/1.2 var(--ems-font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ems-mute-2); }
.ems-s-label { display: block; margin: 0 0 8px; font: 600 13px/1.3 var(--ems-font-ui); color: var(--ems-ink-2); }
.ems-s-center { text-align: center; }
.ems-s-center .btn-row { justify-content: center; }
.ems-s-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ems-s-ctl select { width: auto; max-width: 100%; }
.ems-s-sel { max-width: 300px; }
.ems-s-row-end { align-items: end; }
.card .grid2 > label.field.ems-s-tight, label.field.ems-s-tight { margin: 0; }
.ems-s-pre { margin: 0; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.6; }
/* A spinner on a light surface (the default one is white, for buttons). */
.spinner.is-dark { border-color: var(--ems-line-2); border-top-color: var(--ems-navy-500); }
/* Status words after a save. */
.ems-s-ok { color: var(--ems-good); font-family: var(--ems-font-ui); font-weight: 600; }
input.is-bad, input.is-bad:hover, input.is-bad:focus { border-color: var(--ems-red-500); }
input.is-bad:focus { box-shadow: 0 0 0 4px rgba(190, 30, 45, .14); }

/* ── 2. Scorecards: icon plate + number + one-line name ─────────────────────
   One shape on every staff screen (Pathways dash.css). A <button> version is a
   filter that glides the list under it; a <div> version only reports. Inside a
   surface they become soft tiles with no plate (rule 3). */
.ems-s-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin: 0 0 18px; }
.ems-s-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: center; align-content: center;
  min-height: 80px; padding: 14px 16px; margin: 0; text-align: left;
  background: #fff; border: 0; border-radius: var(--ems-r-lg); box-shadow: var(--ems-lift);
  font: inherit; color: inherit;
}
.ems-s-card-ic { grid-row: 1 / span 2; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease); }
.ems-s-card-ic .ic { width: 20px; height: 20px; }
.ems-s-card-n { font: 800 26px/1 var(--ems-font-display); letter-spacing: -.02em; color: var(--ems-navy-500); font-variant-numeric: tabular-nums; }
.ems-s-card-l { min-width: 0; font: 500 13.5px/1.25 var(--ems-font-ui); color: var(--ems-ink-2); }
.ems-s-card:not(:has(.ems-s-card-ic)) { grid-template-columns: minmax(0, 1fr); }
button.ems-s-card { cursor: pointer; transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease); }
button.ems-s-card:hover { transform: translateY(-2px); box-shadow: var(--ems-lift-hover); }
button.ems-s-card:active { transform: translateY(0) scale(.985); transition-duration: 60ms; }
button.ems-s-card:focus-visible { outline: none; box-shadow: var(--ems-focus), var(--ems-lift); }
.ems-s-card.is-on { box-shadow: 0 0 0 2px var(--ems-navy-500), var(--ems-lift); }
.ems-s-card.is-on .ems-s-card-ic { background: var(--ems-navy-500); color: #fff; }
/* Red = waiting on you. The number turns red and a dot says so. */
.ems-s-card.is-hot .ems-s-card-n { color: var(--ems-red-500); }
.ems-s-card.is-hot .ems-s-card-ic { background: var(--ems-red-50); color: var(--ems-red-500); }
.ems-s-card.is-hot.is-on .ems-s-card-ic { background: var(--ems-red-500); color: #fff; }
.ems-s-card.is-hot::after { content: ""; position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--ems-red-500); box-shadow: 0 0 0 4px rgba(190, 30, 45, .14); }
.card .ems-s-card, .ems-s-rec .card .ems-s-card { background: var(--ems-soft); box-shadow: none; min-height: 76px; }
.card .ems-s-cards { margin-bottom: 14px; }
.card .ems-s-cards:last-child { margin-bottom: 0; }

/* ── 3. Faces ──────────────────────────────────────────────────────────────
   Initials in a navy circle. In demo mode demo-mode.js paints the sample
   person's face over it (it looks for [class*="-av"] with the name nearby). */
.ems-s-av {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--ems-navy-400), var(--ems-navy-700)); background-size: cover; background-position: center;
  color: #fff; font: 600 15px/1 var(--ems-font-ui); letter-spacing: .02em; text-transform: uppercase;
  box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(22, 32, 99, .18);
}
.ems-s-av.is-sm { width: 32px; height: 32px; font-size: 12px; }
.ems-s-av.is-lg { width: 76px; height: 76px; font-size: 24px; box-shadow: 0 0 0 3px #fff, 0 6px 18px -6px rgba(22, 32, 99, .45); }
.ems-s-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ems-s-who > span:last-child { min-width: 0; }

/* ── 4. People rows (the caseload) ─────────────────────────────────────── */
.ems-s-people { display: flex; flex-direction: column; gap: 8px; }
.ems-s-person {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; margin: 0; padding: 12px 14px 12px 12px;
  text-align: left; border: 0; border-radius: var(--ems-r-md); background: var(--ems-soft); color: inherit; font: inherit; cursor: pointer;
  transition: background-color var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease);
}
.ems-s-person:hover { background: #fff; box-shadow: var(--ems-lift-hover); transform: translateY(-1px); }
.ems-s-person:active { transform: translateY(0) scale(.995); }
.ems-s-person:focus-visible { outline: none; box-shadow: var(--ems-focus); }
/* Waiting on you: a red edge on the left (rule 2: red = needs you). */
.ems-s-person.is-hot { box-shadow: inset 3px 0 0 var(--ems-red-500); }
.ems-s-person.is-hot:hover { box-shadow: inset 3px 0 0 var(--ems-red-500), var(--ems-lift-hover); }
.ems-s-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ems-s-person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 600 15px/1.3 var(--ems-font-ui); color: var(--ems-navy-800); }
.ems-s-person-name b { font-weight: 600; }
.ems-s-person-sub { font: 500 13.5px/1.35 var(--ems-font-ui); color: var(--ems-ink-2); }
.ems-s-person-meta { font-size: 12.5px; line-height: 1.4; color: var(--ems-mute-2); overflow-wrap: anywhere; }
.ems-s-person-side { flex: none; text-align: right; font: 500 12.5px/1.5 var(--ems-font-ui); color: var(--ems-mute); }
.ems-s-chev { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ems-faint); transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease); }
.ems-s-chev .ic { width: 16px; height: 16px; }
.ems-s-person:hover .ems-s-chev { background: var(--ems-navy-50); color: var(--ems-navy-500); transform: translateX(2px); }

/* ── 5. Attention / notice banners (filled, never a stripe) ───────────── */
.ems-s-banner { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 14px; padding: 16px 18px; border-radius: var(--ems-r-lg); background: var(--ems-navy-50); color: var(--ems-ink-2); }
.ems-s-banner-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: #fff; color: var(--ems-navy-500); box-shadow: 0 1px 2px rgba(22, 32, 99, .08), 0 6px 14px -8px rgba(22, 32, 99, .35); }
.ems-s-banner-ic .ic { width: 19px; height: 19px; }
.ems-s-banner-b { flex: 1; min-width: 0; }
.ems-s-banner-t { display: block; font: 700 15px/1.35 var(--ems-font-display); color: var(--ems-navy-800); }
.ems-s-banner-b p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ems-mute); }
.ems-s-banner.is-hot { background: var(--ems-red-50); }
.ems-s-banner.is-hot .ems-s-banner-ic { color: var(--ems-red-500); }
.ems-s-banner.is-hot .ems-s-banner-t { color: var(--ems-red-700); }
.ems-s-banner.is-wait { background: var(--ems-warn-50); }
.ems-s-banner.is-wait .ems-s-banner-ic { color: var(--ems-warn); }
/* A whole card that needs you (open requests): filled, no stripe. */
.card.ems-s-fill-wait { background: var(--ems-warn-50); box-shadow: none; }
.card.ems-s-fill-wait h2 { color: var(--ems-warn); }
.card.ems-s-fill-info { background: var(--ems-navy-50); box-shadow: none; }
.card.ems-s-fill-info p { color: var(--ems-navy-800); }

/* ── 6. The mentor dashboard hero: the ring is a neutral figure, so white on
   navy (red is never spent on a progress number). The seven at-a-glance
   tiles live INSIDE the hero as glass tiles: one block, not two. ─────── */
.ems-s-hero { display: block; padding: 24px 26px; }
.ems-s-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.ems-s-hero .dash-hero-main h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.ems-s-hero .dash-hero-main p { margin: 0; color: rgba(255, 255, 255, .78); }
.ems-s-hero .dash-ring {
  width: 112px; height: 112px;
  background: radial-gradient(closest-side, var(--ems-navy-700) 80%, transparent 81%), conic-gradient(#fff calc(var(--pct, 0) * 1%), rgba(255, 255, 255, .16) 0);
}
.ems-s-hero .dash-ring-num { font-size: 27px; color: #fff; }
.ems-s-hero .dash-ring-lbl { color: rgba(255, 255, 255, .72); font-family: var(--ems-font-ui); font-weight: 600; letter-spacing: .06em; }
.ems-s-glass { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin-top: 20px; }
.ems-s-glass > div {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 5px; min-height: 74px; padding: 12px 14px;
  border-radius: var(--ems-r-md); background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.ems-s-glass b { font: 800 24px/1 var(--ems-font-display); color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ems-s-glass span { font: 500 12.5px/1.25 var(--ems-font-ui); color: rgba(255, 255, 255, .8); }
.ems-s-glass > div.is-hot { background: rgba(190, 30, 45, .34); box-shadow: inset 0 0 0 1px rgba(255, 160, 168, .45); }
.ems-s-glass > div.is-hot::after { content: ""; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #ff8a95; box-shadow: 0 0 0 4px rgba(255, 138, 149, .2); }

/* ── 7. The person record: a wide pop-up with tabs (Pathways coach-record) ─ */
.modal-overlay.ems-s-rec-ov { align-items: center; padding: 3vh 2vw; overflow: hidden; }
.modal.ems-s-rec {
  display: flex; flex-direction: column; width: 94vw; max-width: 1240px; height: 92vh; max-height: 980px;
  background: var(--ems-canvas); overflow: hidden;
}
.ems-s-rec-top { flex: none; background: #fff; box-shadow: 0 1px 0 var(--ems-line), 0 8px 18px -16px rgba(22, 32, 99, .45); position: relative; z-index: 1; }
.ems-s-rec-strip { display: flex; align-items: center; gap: 18px; padding: 20px 24px 14px; }
.ems-s-rec-id { flex: 1; min-width: 0; }
.ems-s-rec-id h2 { margin: 0; font: 800 24px/1.2 var(--ems-font-display); letter-spacing: -.015em; color: var(--ems-navy-800); overflow-wrap: anywhere; }
.ems-s-rec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ems-s-rec-with { margin: 6px 0 0; }
.ems-s-rec-acts { flex: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.ems-s-rec-tabs { margin: 0 24px 14px; }
.ems-s-rec-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 30px; scroll-behavior: smooth; }
.ems-s-rec-body .card:last-child { margin-bottom: 0; }
.ems-s-pane[hidden] { display: none; }
.ems-s-rec-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ems-s-rec-grid > div > .card:last-child { margin-bottom: 0; }
.ems-s-rec-load { padding: 28px; display: grid; gap: 14px; }
.ems-s-rec-x { flex: none; }

/* Record parts */
.ems-s-kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; }
.ems-s-kv { min-width: 0; font-size: 14.5px; color: var(--ems-ink); overflow-wrap: anywhere; }
.ems-s-kv > span { display: block; margin-bottom: 2px; font: 600 11.5px/1.3 var(--ems-font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ems-mute-2); }
.ems-s-journey { margin-top: 16px; padding: 14px 16px; border-radius: var(--ems-r-md); background: var(--ems-navy-50); }
.ems-s-journey .chip-row { margin: 8px 0 0; }
.ems-s-journey .chip-row .chip { background: #fff; }
.ems-s-said { margin-top: 12px; }
.ems-s-said > span { display: block; margin-bottom: 2px; font: 600 11.5px/1.3 var(--ems-font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ems-mute-2); }
.ems-s-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ems-s-acts .ic { width: 16px; height: 16px; }

/* Job-search stages: five soft tiles. */
.ems-s-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ems-s-stage { padding: 10px 8px; border-radius: var(--ems-r-md); background: var(--ems-soft); text-align: center; }
.ems-s-stage b { display: block; font: 800 21px/1.1 var(--ems-font-display); color: var(--ems-navy-500); font-variant-numeric: tabular-nums; }
.ems-s-stage span { display: block; margin-top: 3px; font: 600 10.5px/1.2 var(--ems-font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--ems-mute-2); }
.ems-s-stage.is-zero b { color: var(--ems-navy-200); }
.ems-s-apps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ems-s-apps li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--ems-r-md); background: var(--ems-soft); font-size: 13.5px; }

/* Generic soft list rows with an action on the right (documents, résumés). */
.ems-s-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ems-s-list > .ems-row { justify-content: space-between; flex-wrap: wrap; }
.ems-s-row-main { flex: 1; min-width: 0; }
.ems-s-row-main b { font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }
.ems-s-row-meta { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ems-mute-2); }
.ems-s-row-acts { flex: none; display: flex; gap: 6px; flex-wrap: wrap; }

/* The message thread: chat bubbles in a soft well. */
.ems-s-thread { display: flex; flex-direction: column; gap: 12px; max-height: 360px; overflow-y: auto; padding: 16px; border-radius: var(--ems-r-md); background: var(--ems-soft); overscroll-behavior: contain; }
.ems-s-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 80%; }
.ems-s-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.ems-s-msg-b { padding: 9px 13px; border-radius: 16px 16px 16px 6px; background: #fff; color: var(--ems-ink); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(22, 32, 99, .08); }
.ems-s-msg.is-mine .ems-s-msg-b { border-radius: 16px 16px 6px 16px; background: var(--ems-navy-500); color: #fff; box-shadow: none; }
.ems-s-msg.is-co .ems-s-msg-b { background: var(--ems-navy-400); }
.ems-s-msg-w { margin-top: 4px; font: 500 11.5px/1.3 var(--ems-font-ui); color: var(--ems-mute-2); }
.ems-s-sys { align-self: center; padding: 4px 12px; border-radius: var(--ems-r-pill); background: var(--ems-navy-50); color: var(--ems-navy-700); font: 500 12px/1.4 var(--ems-font-ui); text-align: center; }
.ems-s-compose { display: flex; gap: 8px; margin-top: 10px; }
.ems-s-compose input { flex: 1; min-width: 0; }
.ems-s-nudges { margin-top: 2px; }
.ems-s-nudges button.chip { min-height: 0; padding: 7px 12px; text-align: left; white-space: normal; line-height: 1.35; background: #fff; color: var(--ems-navy-700); box-shadow: inset 0 0 0 1px var(--ems-navy-100); }
.ems-s-nudges button.chip:hover { background: var(--ems-navy-50); box-shadow: inset 0 0 0 1px var(--ems-navy-300); }

/* Notes, sessions, requests: soft rows, no stripes. */
.ems-s-log { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ems-s-log-i { padding: 12px 14px; border-radius: var(--ems-r-md); background: var(--ems-soft); }
.ems-s-log-i b { font: 600 14px/1.35 var(--ems-font-ui); color: var(--ems-navy-800); }
.ems-s-log-t { font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ems-s-log-i b + .ems-s-log-t { margin-top: 4px; }
.ems-s-log-m { margin-top: 6px; font: 500 12px/1.3 var(--ems-font-ui); color: var(--ems-mute-2); }
.ems-s-reqs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ems-s-reqs li { padding: 10px 12px; border-radius: var(--ems-r-md); background: rgba(255, 255, 255, .7); font-size: 14px; }

/* Action items: a tick plate, done = muted + struck. */
.ems-s-todo { display: flex; flex-direction: column; gap: 6px; }
.ems-s-todo-i { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--ems-r-md); background: var(--ems-soft); font-size: 14px; line-height: 1.45; }
.ems-s-tick { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ems-line-2); color: #fff; }
.ems-s-tick .ic { width: 13px; height: 13px; }
.ems-s-todo-i.is-done { color: var(--ems-mute-2); }
.ems-s-todo-i.is-done .ems-s-todo-t { text-decoration: line-through; }
.ems-s-todo-i.is-done .ems-s-tick { background: var(--ems-good); box-shadow: none; }

/* ── 8. Charts in the token palette (admin) ───────────────────────────── */
.ems-s-funnel .adm-funnel-row { display: grid; grid-template-columns: 168px minmax(0, 1fr) 96px; align-items: center; gap: 12px; }
.ems-s-funnel.is-wide .adm-funnel-row { grid-template-columns: 190px minmax(0, 1fr) 118px; }
.ems-s-funnel .adm-funnel-l { width: auto; font-size: 13px; line-height: 1.3; text-align: right; color: var(--ems-ink-2); }
.ems-s-funnel .adm-funnel-bar { height: 16px; background: var(--ems-navy-50); border-radius: var(--ems-r-pill); }
.ems-s-funnel .adm-funnel-bar > div { border-radius: var(--ems-r-pill); min-width: 4px; }
.ems-s-funnel .adm-funnel-bar > div.is-worst { background: linear-gradient(90deg, var(--ems-red-500), var(--ems-red-400)); }
.ems-s-funnel .adm-funnel-n { width: auto; white-space: nowrap; font: 700 13.5px/1.2 var(--ems-font-ui); color: var(--ems-navy-700); font-variant-numeric: tabular-nums; }
.ems-s-funnel .adm-funnel-n small { margin-left: 3px; font-weight: 500; font-size: 12px; color: var(--ems-mute-2); }
/* The goal bar: thicker, with the "where we should be" marker. */
.ems-s-goal { margin: 16px 0 8px; }
.ems-s-goal .adm-funnel-bar.is-goal { position: relative; height: 22px; overflow: visible; }
.ems-s-goal .adm-funnel-bar.is-goal > div:first-child { height: 100%; }
.ems-s-marker { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--ems-navy-900); box-shadow: 0 0 0 2px #fff; }
.ems-s-goal .adm-funnel-n { font: 800 17px/1 var(--ems-font-display); color: var(--ems-navy-700); }
/* Who got placed: one stacked bar + a legend. Categorical, so navy shades
   only (red stays for attention). */
.ems-s-split { display: flex; gap: 2px; height: 12px; border-radius: var(--ems-r-pill); overflow: hidden; background: var(--ems-navy-50); }
.ems-s-split > i, .ems-s-dot { background: var(--ems-navy-500); }
.ems-s-split > i.c0, .ems-s-dot.c0 { background: var(--ems-navy-800); }
.ems-s-split > i.c1, .ems-s-dot.c1 { background: var(--ems-navy-500); }
.ems-s-split > i.c2, .ems-s-dot.c2 { background: var(--ems-navy-300); }
.ems-s-split > i.c3, .ems-s-dot.c3 { background: var(--ems-navy-200); }
.ems-s-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font: 500 13px/1.3 var(--ems-font-ui); color: var(--ems-ink-2); }
.ems-s-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ems-s-legend b { font-weight: 700; color: var(--ems-navy-700); }
.ems-s-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
/* Daily spend: columns that rise from a baseline. */
.ems-s-spark { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0 0; border-bottom: 1px solid var(--ems-line); }
.ems-s-spark > i { flex: 1; min-width: 3px; border-radius: 4px 4px 0 0; background: var(--ems-navy-300); transition: background-color var(--ems-dur-fast) var(--ems-ease); }
.ems-s-spark > i:hover { background: var(--ems-navy-600); }
.ems-s-spark > i.is-peak { background: var(--ems-navy-500); }
.ems-s-axis { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font: 500 12px/1.3 var(--ems-font-ui); color: var(--ems-mute-2); }
.ems-s-twocol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; }
/* Where the numbers came from: a quiet footer strip. */
.card.ems-s-prov { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; background: rgba(255, 255, 255, .62); box-shadow: inset 0 0 0 1px var(--ems-line); }
.card.ems-s-prov .error { flex-basis: 100%; margin: 0; padding: 10px 12px; font-size: 13px; }

/* ── 9. Tables that read cleanly, and stack on a phone ─────────────────── */
.ems-s-table tbody td { vertical-align: middle; }
.ems-s-table tbody td:first-child { white-space: normal; }
.ems-s-table tr.is-off td { color: var(--ems-mute-2); }
.ems-s-table tr.is-off .ems-s-av { filter: grayscale(1); opacity: .6; }
.ems-s-table .ems-s-cell-t { display: block; font: 600 14px/1.3 var(--ems-font-ui); color: var(--ems-navy-800); }
.ems-s-table .ems-s-cell-m { display: block; font-size: 12.5px; font-weight: 400; line-height: 1.4; color: var(--ems-mute-2); overflow-wrap: anywhere; }
.ems-s-table .ems-s-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ems-s-table td.ems-s-td-act { width: 1%; white-space: nowrap; text-align: right; }
.ems-s-nomatch { color: var(--ems-red-600); font: 600 13.5px/1.3 var(--ems-font-ui); }
/* The opened "Manage" row: a navy-50 tray under the member. */
.ems-s-table tr.ems-s-manage td, .ems-s-table tr.ems-s-manage:hover td { background: var(--ems-navy-50); }
.ems-s-table tr.is-open td { background: var(--ems-navy-50); border-bottom-color: transparent; }
.ems-s-tray { padding: 4px 2px; }
.ems-s-tray-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.ems-s-tray-row:last-child { margin-bottom: 0; }
.ems-s-tray-row select { width: auto; min-width: 220px; max-width: 100%; }
.ems-s-tray p { margin: 0 0 10px; }
/* Outbox subject + body. */
.ems-s-mail b { display: block; font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }

/* ── 10. Members & matching, event codes, requests ───────────────────── */
.adm-req { border-top: 0; padding: 12px 14px; margin-top: 8px; border-radius: var(--ems-r-md); background: var(--ems-soft); gap: 10px 14px; }
.adm-req:first-of-type { margin-top: 0; }
.ems-s-req-who { flex: 1; min-width: 220px; display: flex; align-items: flex-start; gap: 12px; }
.ems-s-req-who b { font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }
.ems-s-req-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ems-s-req-acts select { width: auto; min-width: 200px; max-width: 100%; min-height: 34px; padding-top: 6px; padding-bottom: 6px; font-size: 13.5px; }
.ems-s-quote { margin-top: 3px; font-size: 13px; color: var(--ems-mute); }
/* Event codes: each is a soft card with its QR on a white plate. */
.ems-s-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.ems-s-codes .adm-code { display: flex; gap: 16px; align-items: flex-start; margin: 0; padding: 16px; border: 0; border-radius: 14px; background: var(--ems-soft); flex-wrap: nowrap; }
.ems-s-codes .adm-code.expired { opacity: 1; }
.ems-s-codes .adm-code.expired .adm-qr, .ems-s-codes .adm-code.expired .ems-s-code-n { opacity: .5; }
.ems-s-codes .adm-qr { width: 128px; height: 128px; padding: 8px; box-sizing: border-box; border-radius: 12px; background: #fff; box-shadow: var(--ems-lift); }
.ems-s-codes .adm-qr img, .ems-s-codes .adm-qr canvas { width: 112px !important; height: 112px !important; }
.ems-s-code-b { flex: 1; min-width: 0; font-size: 14px; }
.ems-s-code-n { font: 800 22px/1.15 var(--ems-font-display); letter-spacing: .03em; color: var(--ems-navy-700); }
.ems-s-code-ev { margin-top: 2px; font-family: var(--ems-font-ui); }
.ems-s-code-ev b { font-weight: 600; color: var(--ems-navy-800); }
.ems-s-code-url { display: block; margin-top: 6px; padding: 5px 8px; border-radius: 8px; background: #fff; font-size: 12px; color: var(--ems-navy-600); word-break: break-all; }
.ems-s-code-b .ems-s-acts { margin-top: 10px; gap: 6px; }

/* ── 11. Settings, resources, knowledge ─────────────────────────────── */
.ems-s-route .adm-kv { align-items: center; gap: 12px; padding: 8px 0; }
.ems-s-route .adm-kv > span { flex: 1; color: var(--ems-ink); font-size: 14px; }
.ems-s-route select { max-width: 300px; }
.coach-option > span b { font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }
.ems-s-res-h { margin: 18px 0 8px; font: 600 12px/1.2 var(--ems-font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ems-mute-2); }
.ems-s-res-h:first-of-type { margin-top: 6px; }
.ems-s-li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--ems-r-md); background: var(--ems-soft); }
.ems-s-li + .ems-s-li { margin-top: 6px; }
.ems-s-li .ems-s-row-main b { font-size: 14px; }
.ems-s-url { display: block; margin-top: 2px; font-size: 12px; color: var(--ems-mute-2); overflow-wrap: anywhere; }
a.ems-s-rm { flex: none; font: 600 12.5px/1.3 var(--ems-font-ui); color: var(--ems-red-600); text-decoration: none; padding: 4px 8px; border-radius: 8px; transition: background-color var(--ems-dur) var(--ems-ease); }
a.ems-s-rm:hover { background: var(--ems-red-50); color: var(--ems-red-700); text-decoration: none; }
.ems-s-kb { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--ems-r-md); background: var(--ems-soft); }
.ems-s-kb + .ems-s-kb { margin-top: 6px; }
.ems-s-kb.is-off { background: transparent; box-shadow: inset 0 0 0 1px var(--ems-line); }
.ems-s-kb.is-off b { color: var(--ems-mute); }
.ems-s-kb input { margin: 0; }
.ems-s-kb b { display: block; font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }

/* ── 12. Mentor toolbox, mentor profile, TriMetrix ───────────────────── */
.tri-h.is-hot { color: var(--ems-red-600); }
.tri-card:last-child .tri-h { color: var(--ems-red-600); }
.ems-s-do h3 { margin: 0 0 8px; color: var(--ems-good) !important; }
.ems-s-dont h3 { margin: 0 0 8px; color: var(--ems-red-600) !important; }
#tbBlurb { margin: 0 2px 14px; font: 500 14px/1.45 var(--ems-font-ui); color: var(--ems-mute); }
/* The mentor's public card preview: how members see you. */
.ems-s-preview { display: flex; gap: 16px; align-items: flex-start; background: radial-gradient(600px 200px at 100% 0, var(--ems-navy-50), #fff 70%); }
.ems-s-preview-b { flex: 1; min-width: 0; }
.ems-s-preview-n { font: 800 19px/1.25 var(--ems-font-display); color: var(--ems-navy-800); }
.ems-s-preview-t { margin-top: 2px; font: 500 13.5px/1.4 var(--ems-font-ui); color: var(--ems-ink-2); }
.ems-s-preview-s { font-size: 13px; color: var(--ems-mute); }
.ems-s-preview-f { margin-top: 8px; font-size: 13.5px; }
.ems-s-preview-bio { margin: 10px 0 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.ems-s-tips { margin: 12px 0 0; padding: 14px 16px; border-radius: var(--ems-r-md); background: var(--ems-navy-50); }
.ems-s-tips ul { margin: 0; font-size: 13.5px; }
/* TriMetrix: the ~1 minute progress, growth edges, the headline. */
.ems-s-prog-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.ems-s-prog-h b { font: 600 14.5px/1.35 var(--ems-font-ui); color: var(--ems-navy-800); }
.ems-s-prog-h span { font: 600 12.5px var(--ems-font-ui); color: var(--ems-mute-2); font-variant-numeric: tabular-nums; }
.ems-s-prog { height: 10px; border-radius: var(--ems-r-pill); background: var(--ems-navy-100); overflow: hidden; }
.ems-s-prog > div { height: 100%; width: 2%; border-radius: var(--ems-r-pill); background: linear-gradient(90deg, var(--ems-navy-500), var(--ems-navy-400)); transition: width .6s var(--ems-ease); }
.ems-s-edges { display: flex; flex-direction: column; gap: 8px; }
.ems-s-edge { padding: 12px 14px; border-radius: var(--ems-r-md); background: var(--ems-soft); font-size: 14px; line-height: 1.5; }
.ems-s-edge b { font-family: var(--ems-font-ui); font-weight: 600; color: var(--ems-navy-800); }
.ems-s-edge .muted { font-size: 13px; }
.ems-s-read p, .ems-s-read li { font-size: 14.5px; line-height: 1.65; }
.ems-s-read p.pre { white-space: pre-wrap; }
.ems-s-links { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ems-s-links li { padding: 10px 14px; border-radius: var(--ems-r-md); background: var(--ems-soft); }
.ems-s-links a { font-family: var(--ems-font-ui); font-weight: 600; text-decoration: none; }
.ems-s-links a:hover { text-decoration: underline; }
.ems-s-links .muted { display: block; margin-top: 2px; font-size: 13px; }

/* ── 13. Phones ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ems-s-rec-grid, .ems-s-twocol { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ems-s-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ems-s-card { min-height: 72px; padding: 12px; column-gap: 10px; }
  .ems-s-card-ic { width: 34px; height: 34px; border-radius: 10px; }
  .ems-s-card-ic .ic { width: 17px; height: 17px; }
  .ems-s-card-n { font-size: 22px; }
  .ems-s-card-l { font-size: 12.5px; }
  .ems-s-glass { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ems-s-hero { padding: 20px 18px; }
  .ems-s-hero .dash-hero-main { min-width: 0; }
  .ems-s-person { flex-wrap: wrap; gap: 10px 12px; }
  .ems-s-person-main { flex-basis: calc(100% - 100px); }
  .ems-s-person-side { order: 3; flex-basis: 100%; padding-left: 56px; text-align: left; }
  .ems-s-person-side br { display: none; }
  .ems-s-person-side br + * { margin-left: 4px; }
  /* The record fills the phone. */
  .modal-overlay.ems-s-rec-ov { padding: 0; align-items: stretch; }
  .modal.ems-s-rec { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .ems-s-rec-strip { flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px 10px; }
  .ems-s-av.is-lg { width: 56px; height: 56px; font-size: 19px; }
  .ems-s-rec-id h2 { font-size: 20px; }
  .ems-s-rec-acts { order: -1; flex-basis: 100%; justify-content: flex-start; }
  .ems-s-rec-tabs { margin: 0 16px 12px; width: auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ems-s-rec-tabs::-webkit-scrollbar { display: none; }
  .ems-s-rec-tabs button { flex: none; }
  .ems-s-rec-body { padding: 16px 14px 24px; }
  .ems-s-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ems-s-msg { max-width: 90%; }
  /* Funnels: the label sits over its bar. */
  .ems-s-funnel .adm-funnel-row, .ems-s-funnel.is-wide .adm-funnel-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .ems-s-funnel .adm-funnel-l { grid-column: 1 / -1; text-align: left; }
  /* Tables become stacked cards. */
  .ems-s-stack thead { display: none; }
  .ems-s-stack, .ems-s-stack tbody, .ems-s-stack tr, .ems-s-stack td { display: block; width: 100%; }
  .ems-s-stack tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--ems-line); }
  .ems-s-stack tbody tr:last-child { border-bottom: 0; }
  .ems-s-stack tbody td { padding: 3px 0; border: 0; }
  .ems-s-stack tbody td:first-child { padding-bottom: 6px; }
  .ems-s-stack td.ems-s-td-act { width: 100%; text-align: left; padding-top: 8px; }
  .ems-s-stack tr.ems-s-manage { padding-top: 4px; }
  .ems-s-stack tr.is-open { border-bottom: 0; background: var(--ems-navy-50); }
  .ems-s-tray-row select { min-width: 0; flex: 1 1 100%; }
  .ems-s-codes .adm-code { flex-direction: column; align-items: center; text-align: center; }
  .ems-s-codes .ems-s-code-b .ems-s-acts { justify-content: center; }
  .ems-s-req-acts { width: 100%; }
  .ems-s-req-who { min-width: 0; flex-basis: 100%; }
  .ems-s-req-acts select { min-width: 0; width: 100%; flex: 1 1 100%; }
  .ems-s-route .adm-kv { flex-direction: column; align-items: stretch; }
  .ems-s-route select { max-width: none; }
}

/* The admin goal card is the one raised thing on the Program Dashboard. Its
   top bar is red only when the program is behind pace (needs you). */
.ems-next.is-navy::before { background: linear-gradient(90deg, var(--ems-navy-500), var(--ems-navy-400)); }

.ems-s-upper { text-transform: uppercase; }
.card.ems-s-tmhead { margin-bottom: 18px; }
.ems-s-tmhead .ems-s-label { display: inline; }
.ems-s-hero .dash-ring-lbl { font-size: 9.5px; letter-spacing: .05em; }
.ems-s-upper::placeholder { text-transform: none; }

/* Reduced motion: the record simply appears (no 0.001ms "animation" either). */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay.ems-s-rec-ov, .modal-overlay.ems-s-rec-ov .modal.ems-s-rec { animation: none !important; }
}

/* ── Program Dashboard: tabs + "who is behind this number" (11-06) ─────────
   The goal card, then a tab row, then one tab's cards. A number with people
   behind it becomes clickable (.is-click, added by admin.js only once the
   records loaded) and lifts like the Work Hub's tiles; its pop-up is a soft
   row list, newest first, each row opening the member. */
.ems-dash-tabs { margin: 4px 0 18px; }
.ems-dash-mini { margin-bottom: 0; }
.ems-next .ems-dash-mini { margin-top: 16px; }

.ems-s-card.is-click { cursor: pointer; transition: transform var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease); }
.ems-s-card.is-click:hover { transform: translateY(-2px); box-shadow: var(--ems-lift-hover); }
.card .ems-s-card.is-click:hover { background: var(--ems-navy-50); box-shadow: none; }
.ems-s-card.is-click:active { transform: translateY(0) scale(.985); transition-duration: 60ms; }
.ems-s-card.is-click:focus-visible { outline: none; box-shadow: var(--ems-focus), var(--ems-lift); }
.ems-s-funnel .adm-funnel-row.is-click { cursor: pointer; margin: 0 -10px; padding: 5px 10px; border-radius: var(--ems-r-md); transition: background-color var(--ems-dur) var(--ems-ease); }
.ems-s-funnel .adm-funnel-row.is-click:hover { background: var(--ems-navy-50); }
.ems-s-funnel .adm-funnel-row.is-click:hover .adm-funnel-l { color: var(--ems-navy-700); }
.ems-s-funnel .adm-funnel-row.is-click:focus-visible { outline: none; box-shadow: var(--ems-focus); }

.ems-dd-ov .modal { max-width: 640px; }
.ems-dd-sub { margin: 0 0 14px; font: 400 13.5px/1.4 var(--ems-font-ui); color: var(--ems-mute); }
.ems-dd-sub b { color: var(--ems-navy-800); font-weight: 700; }
.ems-dd .ems-dd-row { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; min-height: 0; justify-content: flex-start; }
button.ems-dd-row { cursor: pointer; }
button.ems-dd-row:hover { background: var(--ems-navy-50); }
button.ems-dd-row:active { transform: scale(.995); }
button.ems-dd-row:focus-visible { outline: none; box-shadow: var(--ems-focus); }
.ems-dd-row.is-off { opacity: .78; }
.ems-dd-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ems-dd-main b { font: 600 14.5px/1.3 var(--ems-font-ui); color: var(--ems-navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ems-dd-main .ems-s-cell-m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ems-dd-row .ems-s-tags { flex: none; margin: 0; }
.ems-dd-when { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 84px; font: 400 12px/1.3 var(--ems-font-ui); color: var(--ems-mute); }
.ems-dd-when b { font: 600 13px/1.3 var(--ems-font-ui); color: var(--ems-navy-700); }
.ems-dd-go { flex: none; display: inline-flex; align-items: center; gap: 2px; min-width: 64px; justify-content: flex-end; font: 600 13px/1 var(--ems-font-ui); color: var(--ems-navy-500); }
button.ems-dd-row:hover .ems-dd-go .ic { transform: translateX(2px); }
.ems-dd-go .ic { transition: transform var(--ems-dur) var(--ems-ease); }
@media (max-width: 600px) {
  .ems-dd-row { flex-wrap: wrap; }
  .ems-dd-main { flex-basis: calc(100% - 56px); }
  .ems-dd-row .ems-s-tags { order: 3; }
  .ems-dd-when { order: 4; flex-direction: row; gap: 6px; min-width: 0; margin-left: auto; }
  .ems-dd-go { order: 5; min-width: 0; }
}
/* the mentor a member met at an EMS US event (intake), so staff can link them */
.ems-s-met { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border-radius: 99px; background: #e3f4e8; color: #1a7f37; font: 600 12.5px/1.4 var(--ems-font-ui); }
/* 11-09: no volunteer mentors on the roster -> say so above the requests. */
.ems-s-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff7e6; color: #8a5a00; font: 500 13.5px/1.5 var(--ems-font-ui); }
.ems-s-warn svg { flex: 0 0 auto; margin-top: 3px; }
.ems-s-warn a { color: inherit; font-weight: 700; }
.ems-s-met.is-wait { background: var(--ems-navy-50, #eef1fb); color: var(--ems-navy-800, #1f2a6b); }
/* A match waiting on this mentor's yes (coach.js, Mentor matching = mentor accepts). */
.ems-s-prop { border: 1px solid #dbe5ee; border-radius: 14px; padding: 16px 18px; margin: 0 0 12px; background: linear-gradient(170deg,#f3f8fc 0%,#fff 60%); }
.ems-s-prop h3 { margin: 0 0 4px; font: 700 17px/1.3 var(--ems-font-display); color: #0f172a; }
.ems-s-prop p { margin: 6px 0; font-size: 14px; line-height: 1.5; color: #334155; }
.ems-s-prop-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ems-s-prop textarea { width: 100%; margin-top: 8px; }
.ems-s-met b { font-weight: 700; }

/* Members & Connections: a row is the person; a click opens their record
   (settings-users.js), like the CRM. No Manage button, no tray. */
.ems-s-memtbl tbody tr[data-open] { cursor: pointer; }
.ems-s-memtbl tbody tr[data-open] td { transition: background-color .14s ease; }
.ems-s-memtbl tbody tr[data-open]:hover td { background: #f5f7fc; }
.ems-s-memtbl tbody tr[data-open]:hover .ems-s-cell-t { color: var(--ems-navy-500); }
.ems-s-memtbl tbody tr[data-open]:focus-visible { outline: none; }
.ems-s-memtbl tbody tr[data-open]:focus-visible td { background: #f5f7fc; box-shadow: inset 0 2px 0 rgba(42, 56, 144, .35), inset 0 -2px 0 rgba(42, 56, 144, .35); }
.ems-s-rec-face, .ems-s-rec-name { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; font: inherit; color: inherit; cursor: pointer; }
.ems-s-rec-face { flex: none; border-radius: 50%; }
.ems-s-rec-name { font-weight: 600; color: var(--ems-navy-600); }
.ems-s-rec-name:hover { text-decoration: underline; }
.ems-s-rec-face:focus-visible, .ems-s-rec-name:focus-visible { outline: none; box-shadow: var(--ems-focus); border-radius: 6px; }
/* ── QR & access codes: the Code Library (admin-program.js eventsTab) ──────
   One library like the Reports list, one Create pop-up, one detail view with
   the branded share card on the left and edit + who used it on the right. */
.ecl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 18px; flex-wrap: wrap; margin: 0 0 14px; }
.ecl-head h2 { margin: 0 0 2px; }
.ecl-head .ems-s-meta { margin: 0; }
.ecl-list { display: flex; flex-direction: column; border-top: 1px solid var(--ems-line); }
.ecl-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto 104px 132px 18px; align-items: center; gap: 16px; padding: 12px 10px; border-bottom: 1px solid var(--ems-line); border-radius: 10px; color: inherit; text-decoration: none; transition: background .15s; }
.ecl-row:hover, .ecl-row:focus-visible { background: var(--ems-navy-50); }
.ecl-row.is-quiet .ecl-thumb, .ecl-row.is-quiet .ecl-main b { opacity: .6; }
.ecl-thumb { width: 56px; height: 56px; border-radius: 8px; background: var(--ems-soft); overflow: hidden; display: block; }
.ecl-thumb canvas { width: 56px; height: 56px; display: block; }
.ecl-main { min-width: 0; }
.ecl-main b { display: block; font: 600 15px/1.35 var(--ems-font-ui); color: var(--ems-navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecl-sub { display: block; font-size: 13px; color: var(--ems-mute-2); margin-top: 2px; }
.ecl-st { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 600 12px/1.4 var(--ems-font-ui); background: var(--ems-soft-2); color: var(--ems-mute); white-space: nowrap; }
.ecl-st.is-active { background: #e6f4ea; color: #1d6b35; }
.ecl-st.is-off { background: var(--ems-red-50); color: var(--ems-red-600); }
.ecl-st.is-full { background: #fff4dc; color: #8a5a00; }
.ecl-uses { font-size: 13px; color: var(--ems-mute-2); white-space: nowrap; }
.ecl-uses b { font: 700 18px/1 var(--ems-font-display); color: var(--ems-navy-800); margin-right: 3px; }
.ecl-when { font-size: 13px; color: var(--ems-mute-2); white-space: nowrap; }
.ecl-go { color: var(--ems-mute-2); display: flex; }
.ecl-empty { text-align: center; padding: 36px 16px 22px; }
.ecl-empty-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); }
.ecl-empty h3 { margin: 0 0 6px; }
.ecl-empty p { max-width: 520px; margin: 0 auto 16px; color: var(--ems-mute); }
@media (max-width: 760px) {
  .ecl-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 6px 12px; }
  .ecl-thumb, .ecl-thumb canvas { width: 48px; height: 48px; }
  .ecl-thumb { grid-row: span 2; }
  .ecl-uses { grid-column: 2 / 4; font-size: 12.5px; }
  .ecl-when, .ecl-go { display: none; }
}

/* Create pop-up */
.ecl-new { width: min(620px, calc(100vw - 32px)); }
.ecl-new-b { padding: 16px 22px 20px; }
.ecl-new-b > .muted:first-child { margin-top: 0; }
.ecl-types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ecl-type { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 18px; border-radius: 14px; background: #fff; border: 1px solid var(--ems-line-2); color: var(--ems-ink, #131a2c); font: inherit; cursor: pointer; min-height: 0; white-space: normal; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ecl-type:hover, .ecl-type:focus-visible { border-color: var(--ems-navy-500); box-shadow: 0 8px 22px -12px rgba(22, 32, 99, .45); transform: translateY(-1px); background: #fff; }
.ecl-type b { font: 700 16px/1.3 var(--ems-font-display); color: var(--ems-navy-800); }
.ecl-type span:last-child { font-size: 13.5px; line-height: 1.5; color: var(--ems-mute); }
.ecl-type-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ems-navy-50); color: var(--ems-navy-500); margin-bottom: 4px; }
.ecl-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--ems-soft); margin: 4px 0 6px; }
.ecl-seg button { min-height: 0; padding: 8px 14px; border-radius: 9px; background: transparent; color: var(--ems-mute); box-shadow: none; font-weight: 600; }
.ecl-seg button[aria-checked="true"] { background: #fff; color: var(--ems-navy-800); box-shadow: 0 1px 3px rgba(14, 21, 71, .15); }
.ecl-more { margin: 6px 0 4px; }
.ecl-more summary { cursor: pointer; font: 600 13.5px/1.4 var(--ems-font-ui); color: var(--ems-navy-500); padding: 6px 0; }
.ecl-more .grid2 { margin-top: 8px; }
.ecl-new-acts { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.ecl-new-acts .muted { flex: 1; color: var(--ems-red-600); }
@media (max-width: 560px) { .ecl-types { grid-template-columns: 1fr; } }

/* Detail view */
.ecl-back { display: inline-block; margin: 0 0 10px; font: 600 14px/1.4 var(--ems-font-ui); color: var(--ems-navy-500); text-decoration: none; }
.ecl-back:hover { text-decoration: underline; }
.ecl-dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 18px; flex-wrap: wrap; margin: 0 0 16px; }
.ecl-dh h1 { margin: 0 0 4px; font: 700 26px/1.25 var(--ems-font-display); color: var(--ems-navy-800); overflow-wrap: anywhere; }
.ecl-dh .ecl-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.ecl-detail { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.ecl-right > .card:first-child { margin-top: 0; }
.ecl-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 18px 40px -22px rgba(14, 21, 71, .45), 0 0 0 1px var(--ems-line); border-top: 6px solid var(--ems-red-500); text-align: center; }
.ecl-card-top { padding: 20px 20px 0; }
.ecl-card-top img { height: 64px; width: auto; }
.ecl-card-b { padding: 8px 24px 18px; }
.ecl-card-k { display: block; font: 600 11.5px/1.4 var(--ems-font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--ems-mute-2); margin-top: 6px; }
.ecl-card h3 { margin: 4px 0 4px; font: 700 21px/1.25 var(--ems-font-display); color: var(--ems-navy-900); overflow-wrap: anywhere; }
.ecl-card-d { margin: 0 0 12px; font: 700 15px/1.4 var(--ems-font-ui); color: var(--ems-red-500); }
.ecl-card-qr { width: 200px; height: 200px; margin: 6px auto 12px; padding: 10px; background: #fff; box-shadow: 0 0 0 8px var(--ems-navy-50); border-radius: 6px; box-sizing: content-box; }
.ecl-card-qr canvas { width: 200px; height: 200px; display: block; }
.ecl-card-i { margin: 14px 0 6px; font-size: 14px; color: var(--ems-ink, #131a2c); }
.ecl-card-l { display: block; font: 600 13px/1.4 var(--ems-font-ui); color: var(--ems-navy-500); overflow-wrap: anywhere; }
.ecl-card-c { margin: 8px 0 0; font-size: 13px; letter-spacing: .12em; color: var(--ems-mute); }
.ecl-card-foot { background: var(--ems-navy-800); color: #fff; padding: 10px; font: 600 12.5px/1.4 var(--ems-font-ui); }
.ecl-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ecl-share button { display: inline-flex; align-items: center; gap: 6px; }
.ecl-share .primary { flex: 1 0 100%; justify-content: center; }
.ecl-share .ghost { flex: 1 1 calc(50% - 4px); justify-content: center; }
.ecl-share-note { margin: 10px 2px 0; }
.ecl-span { grid-column: 1 / -1; }
.ecl-ro { margin: 6px 0 0; font-size: 14px; color: var(--ems-mute); }
.ecl-ro b { color: var(--ems-navy-800); letter-spacing: .06em; }
.ecl-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ecl-save[hidden] { display: none; }
.ecl-link { background: none; border: 0; padding: 0; min-height: 0; box-shadow: none; font: 600 13px/1.4 var(--ems-font-ui); color: var(--ems-navy-500); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.ecl-link:hover { text-decoration: underline; background: none; }
.ecl-link.is-danger { color: var(--ems-red-600); }
.ecl-uselist { list-style: none; margin: 0; padding: 0; }
.ecl-uselist li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ems-line); }
.ecl-uselist .ems-s-av { width: 36px; height: 36px; font-size: 12.5px; }
.ecl-u-m { min-width: 0; }
.ecl-u-m b { display: block; font: 600 14px/1.35 var(--ems-font-ui); color: var(--ems-navy-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecl-u-m .ecl-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecl-u-how { font: 600 12px/1.4 var(--ems-font-ui); padding: 3px 9px; border-radius: 999px; background: var(--ems-navy-50); color: var(--ems-navy-700); white-space: nowrap; }
.ecl-u-how.is-signup { background: #e6f4ea; color: #1d6b35; }
.ecl-u-at { font-size: 13px; color: var(--ems-mute-2); white-space: nowrap; }
.ecl-del { margin: 4px 2px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 980px) { .ecl-detail { grid-template-columns: 1fr; } .ecl-left { max-width: 420px; width: 100%; margin: 0 auto; } }
@media (max-width: 520px) { .ecl-uselist li { grid-template-columns: 36px minmax(0, 1fr) auto; } .ecl-u-at { display: none; } }

/* The pop-up a signed-in person sees after scanning an event QR (app.js). */
.ems-scan { width: min(420px, calc(100vw - 32px)); padding: 28px 26px 24px; text-align: center; }
.ems-scan h2 { margin: 12px 0 6px; font: 700 21px/1.3 var(--ems-font-display); }
.ems-scan p { margin: 0 0 20px; color: var(--ems-mute); line-height: 1.55; }
.ems-scan .primary { min-width: 140px; }
.ems-scan-ic { width: 60px; height: 60px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; }
.ems-scan-ic.ok { background: #e6f4ea; color: #1d6b35; }
.ems-scan-ic.no { background: var(--ems-red-50); color: var(--ems-red-600); }
/* A read-only fact in the Details grid wears the same label as the inputs beside it. */
#view .ecl-right div.field > span:first-child, .ecl-dlg .ecl-right div.field > span:first-child, .set-dlg #nFields div.field > span:first-child { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--ems-ink-2); }
/* The library and detail on the admin kit (admin-kit.js, ems-admin.css). */
.ecl-hint { display: block; margin: 6px 0 0; font: 400 13px/1.5 var(--ems-font-body); color: var(--ems-mute-2); }
.ecl-h2 { margin: 0 0 14px; font: 800 18px/1.3 var(--ems-font-display); color: var(--set-ink, var(--ems-navy-800)); }
.ecl-who-h { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 10px; }
.ecl-who-h .ecl-h2 { margin: 0; }
.ecl-right > .set-card + .set-card { margin-top: 16px; }
.ecl-right > .set-card:first-child { margin-top: 0; }
.ecl-share .set-btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
.ecl-share .set-btn.is-primary { flex-basis: 100%; }
.ecl-save .set-err { flex: 1; margin: 0; }
.set-dlg #nFields .ecl-seg { margin-top: 2px; }
/* 11-15 later: the library is Settings › QR & access codes; a code opens in a
   wide pop-up over any page (Settings or the Events & Attendance dashboard). */
button.ecl-row { width: 100%; text-align: left; font: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--ems-line); min-height: 0; box-shadow: none; cursor: pointer; white-space: normal; }
button.ecl-row:hover, button.ecl-row:focus-visible { background: var(--ems-navy-50); }
.modal-overlay .modal.set-dlg.ecl-dlg { width: min(1060px, calc(100vw - 32px)); max-width: calc(100vw - 32px); }
.ecl-dlg .set-dlg-foot:empty { display: none; }
.ecl-dlg .set-dlg-titles h2 { overflow-wrap: anywhere; }
.ecl-dlg .set-dlg-titles .ecl-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 0; }
.ecl-dlg .ecl-detail { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
@media (max-width: 900px) { .ecl-dlg .ecl-detail { grid-template-columns: 1fr; } }
.ecl-status { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ems-line); font-size: 13.5px; color: var(--ems-mute); }
/* Events & Attendance: the By event table opens a code. */
.ev-by { margin-top: 18px; }
.ev-tbl tbody tr[data-code] { cursor: pointer; }
.ev-tbl tbody tr[data-code]:hover td, .ev-tbl tbody tr[data-code]:focus-visible td { background: #f5f7fc; }
.ev-tbl tbody tr[data-code]:focus-visible { outline: none; }

/* QR codes (11-15): the plain QR beside the card, the Download row, who made it. */
.ecl-viewsw { margin: 0 0 12px; }
.ecl-plain { background: #fff; border-radius: 18px; box-shadow: 0 18px 40px -22px rgba(14, 21, 71, .45), 0 0 0 1px var(--ems-line); padding: 26px 20px 18px; text-align: center; }
.ecl-plain[hidden], .ecl-card[hidden] { display: none; }
.ecl-plain-qr { width: 240px; height: 240px; margin: 0 auto 10px; }
.ecl-plain-qr canvas { width: 240px; height: 240px; display: block; image-rendering: pixelated; }
.ecl-dl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ecl-dl-k { flex: 1 0 100%; font: 600 12px/1.4 var(--ems-font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ems-mute-2); }
.ecl-dl .set-btn { flex: 1 1 calc(50% - 4px); justify-content: center; display: inline-flex; align-items: center; gap: 6px; }
.ecl-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--ems-line); }
.ecl-facts div { min-width: 0; }
.ecl-facts dt { font: 600 12px/1.4 var(--ems-font-ui); color: var(--ems-mute-2); }
.ecl-facts dd { margin: 2px 0 0; font-size: 14px; color: var(--ems-navy-800); overflow-wrap: anywhere; }
.ecl-facts dd b { letter-spacing: .06em; }
@media (max-width: 560px) { .ecl-facts { grid-template-columns: 1fr; } }
/* The pop-up's button skin outranks .ecl-seg; keep the switch a switch. */
.ecl-seg:not(#_) { background: var(--ems-soft-2, #eef0f6); }
.ecl-seg:not(#_) button { border: 0; background: transparent; box-shadow: none; color: var(--ems-mute); }
.ecl-seg:not(#_) button[aria-checked="true"] { background: #fff; color: var(--ems-navy-800); box-shadow: 0 1px 3px rgba(14, 21, 71, .18); }
/* Who scanned it (11-15): the funnel, and the people to follow up. */
.ecl-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 10px; }
.ecl-funnel div { background: var(--ems-navy-50); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.ecl-funnel b { display: block; font: 700 24px/1.1 var(--ems-font-display); color: var(--ems-navy-800); }
.ecl-funnel span { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--ems-mute); }
.ecl-h3 { margin: 16px 0 4px; font: 700 15px/1.3 var(--ems-font-display); color: var(--ems-navy-800); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ecl-follow li { grid-template-columns: 40px minmax(0, 1fr) auto; }
.ecl-f-acts { display: flex; gap: 6px; }
.ecl-f-acts .set-btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; padding: 6px 10px; min-height: 0; font-size: 13px; }
@media (max-width: 560px) {
  .ecl-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ecl-follow li { grid-template-columns: 36px minmax(0, 1fr); }
  .ecl-f-acts { grid-column: 2; }
}
