  :root {
    --teal: #234857;
    --teal-dark: #1a3742;
    --bright-orange: #F18544;
    --burnt-orange: #D85427;
    --warm-gold: #F2C082;
    --mid-gray: #6D6E71;
    --ink: #21282b;
    --paper: #f5f6f6;
    --card: #ffffff;
    --line: #dfe3e4;
    --font-sans: "Work Sans", system-ui, -apple-system, sans-serif;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--ink);
    background: var(--paper);
    background-image: var(--hub-bg-layer, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.45;
  }
  body.modal-open { overflow: hidden; }
  h1, h2, h3 { font-family: var(--font-sans); font-weight: 900; margin: 0 0 .4em; line-height: 1.15; }
  a { color: var(--burnt-orange); }
  button { font-family: var(--font-sans); cursor: pointer; }

  /* Layout */
  .topbar {
    background: var(--teal); color: #fff;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px;
  }
  .topbar .brand { font-weight: 900; font-size: 18px; letter-spacing: .2px; }
  .topbar .brand small { display: block; font-weight: 500; font-size: 11px; color: var(--warm-gold); letter-spacing: .08em; text-transform: uppercase; }
  .topbar .spacer { flex: 1; }
  .topbar .who { font-size: 13px; color: #cfe0e6; }
  .topbar .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
  .topbar .btn-ghost:hover { background: rgba(255,255,255,.22); }
  .topbar-actions { display: flex; align-items: center; gap: 8px; }

  .tabs { display: flex; gap: 4px; background: var(--teal-dark); padding: 0 12px; flex-wrap: wrap; }
  .tab {
    background: transparent; border: 0; color: #bcd2da;
    padding: 12px 16px; font-weight: 700; font-size: 14px;
    border-bottom: 3px solid transparent;
  }
  .tab:hover { color: #fff; }
  .tab.active { color: #fff; border-bottom-color: var(--bright-orange); }
  .tab .soon { font-size: 10px; color: var(--warm-gold); margin-left: 6px; font-weight: 700; }

  .wrap { max-width: none; margin: 0; padding: 24px 28px 64px; overflow-x: hidden; }
  .panel { display: none; }
  .panel.active { display: block; }

  /* Tab swipe-in: shared slide-in stagger for panels, profile modal, activity pop-out. */
  @keyframes swipeIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  .panel.active > *,
  .modal-back.open .modal > header,
  .modal-back.open .m-profile-hero,
  .modal-back.open .m-mobile-tabs,
  .modal-back.open .m-layout,
  .modal-back.open .m-activity,
  .act-pop-back.open .act-pop > * {
    animation: swipeIn .5s cubic-bezier(.22, .61, .36, 1) both;
  }
  .panel.active > *:nth-child(1),
  .act-pop-back.open .act-pop > *:nth-child(1) { animation-delay: .02s; }
  .panel.active > *:nth-child(2),
  .act-pop-back.open .act-pop > *:nth-child(2) { animation-delay: .09s; }
  .panel.active > *:nth-child(3),
  .act-pop-back.open .act-pop > *:nth-child(3) { animation-delay: .16s; }
  .panel.active > *:nth-child(4),
  .act-pop-back.open .act-pop > *:nth-child(4) { animation-delay: .23s; }
  .panel.active > *:nth-child(5) { animation-delay: .30s; }
  .panel.active > *:nth-child(n+6) { animation-delay: .36s; }
  .modal-back.open .modal > header { animation-delay: .02s; }
  .modal-back.open .m-profile-hero { animation-delay: .06s; }
  .modal-back.open .m-mobile-tabs { animation-delay: .09s; }
  .modal-back.open .m-layout { animation-delay: .13s; }
  .modal-back.open .m-activity { animation-delay: .20s; }
  @media (prefers-reduced-motion: reduce) {
    .panel.active > *,
    .modal-back.open .modal > header,
    .modal-back.open .m-profile-hero,
    .modal-back.open .m-mobile-tabs,
    .modal-back.open .m-layout,
    .modal-back.open .m-activity,
    .act-pop-back.open .act-pop > * { animation: none; }
  }

  /* Buttons */
  .btn {
    border: 0; border-radius: 8px; padding: 9px 14px;
    font-weight: 700; font-size: 14px; color: #fff; background: var(--teal);
  }
  .btn:hover { background: var(--teal-dark); }
  .btn-orange { background: var(--bright-orange); }
  .btn-orange:hover { background: var(--burnt-orange); }
  .btn-ghost { background: #fff; color: var(--teal); border: 1px solid var(--line); }
  .btn-ghost:hover { background: #eef1f1; }
  .btn-danger { background: #fff; color: #b42318; border: 1px solid #e8b4b0; }
  .btn-danger:hover { background: #fdf0ef; border-color: #b42318; }
  .btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

  /* Cards / stats */
  .stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
  .stat {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 16px; border-top: 4px solid var(--bright-orange);
  }
  .stat .num { font-size: 30px; font-weight: 900; color: var(--teal); }
  .stat .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mid-gray); font-weight: 700; }

  .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }

  .dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
  .dash-grid-2 .card { margin-bottom: 0; }
  @media (max-width: 760px) { .dash-grid-2 { grid-template-columns: 1fr; } }
  .dash-team-table-wrap { overflow-x: auto; }
  .dash-team-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .dash-team-table th, .dash-team-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
  .dash-team-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mid-gray); }
  .dash-team-table tbody tr:last-child td { border-bottom: none; }
  .dash-school-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .dash-school-row:last-child { border-bottom: none; }
  .dash-school-rank {
    width: 20px; height: 20px; border-radius: 999px; background: #eef1f1; color: var(--mid-gray);
    font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  }
  .dash-school-name { flex: 1; font-weight: 600; }
  .dash-school-count { font-weight: 700; color: var(--teal); }

  /* Tables */
  table { width: 100%; border-collapse: collapse; }
  th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
  th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mid-gray); }
  tr.row-click:hover { background: #f0f3f3; cursor: pointer; }
  tr.row-click.pipe-row-flag-critical { background: #fff5f4; }
  tr.row-click.pipe-row-flag-critical:hover { background: #ffeae8; }
  tr.row-click.pipe-row-flag-warning { background: #faf7f0; }
  tr.row-click.pipe-row-flag-warning:hover { background: #f5f0e4; }

  /* Dynamic pipeline columns (Excel-style add / sort / filter) */
  th.col-h { cursor: pointer; user-select: none; white-space: nowrap; }
  th.col-h:hover { color: var(--teal); }
  .col-h-label { display: inline-flex; align-items: center; gap: 4px; }
  .sort-ind { color: var(--bright-orange); font-size: 10px; }
  .sort-ind i { font-style: normal; font-size: 9px; background: var(--bright-orange); color: #fff; border-radius: 8px; padding: 0 4px; margin-left: 2px; vertical-align: top; }
  .sort-clear { cursor: pointer; margin-left: 3px; font-style: normal; font-weight: 700; font-size: 12px; color: var(--mid-gray); }
  .sort-clear:hover { color: var(--burnt-orange); }
  .col-x { margin-left: 6px; color: var(--mid-gray); font-weight: 700; cursor: pointer; }
  .col-x:hover { color: var(--burnt-orange); }
  .cell-ellip { display: inline-block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

  /* Settings gear popout */
  .gear { font-size: 15px; line-height: 1; }
  .settings-pop {
    position: absolute; top: calc(100% + 6px); right: 0; width: 320px; max-height: 72vh; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,.18); z-index: 100; display: none;
  }
  .settings-pop.open { display: block; }
  #pipe-toolbar.settings-open,
  .card.settings-open,
  #pipe-toolbar:has(.settings-pop.open),
  .card:has(.settings-pop.open) {
    position: relative;
    z-index: 45;
  }
  .sp-head { display: flex; align-items: center; background: var(--teal); color: #fff; padding: 10px 14px; border-radius: 12px 12px 0 0; font-weight: 700; font-size: 14px; position: sticky; top: 0; }
  .sp-head .x { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 20px; line-height: 1; }
  .sp-body { padding: 14px; }
  .sp-section { margin-bottom: 16px; }
  .sp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mid-gray); font-weight: 700; margin-bottom: 8px; }
  .sp-col { display: flex; align-items: center; gap: 8px; padding: 3px 2px; font-size: 13px; cursor: pointer; border-radius: 6px; }
  .sp-col:hover { background: #f0f3f3; }
  .sp-col input[type=checkbox] { width: auto; margin: 0; }

  .admin-school-toggle-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
  .admin-school-toggle-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13px;
    cursor: pointer; border-radius: 6px;
  }
  .admin-school-toggle-row:hover { background: #f0f3f3; }
  .admin-school-toggle-row input[type=checkbox] { width: auto; margin: 0; flex-shrink: 0; }
  .admin-school-toggle-name { flex: 1; }
  .admin-school-toggle-row:has(input:not(:checked)) .admin-school-toggle-name { color: var(--mid-gray); text-decoration: line-through; }
  .admin-school-toggle-count { font-size: 11px; font-weight: 700; color: var(--mid-gray); background: #eef1f1; border-radius: 999px; padding: 1px 8px; }
  .sp-filter { margin-bottom: 8px; }
  .sp-filter label { display: block; font-size: 11px; color: var(--mid-gray); font-weight: 700; margin-bottom: 2px; }
  .sp-filter input { font-size: 13px; padding: 6px 8px; }
  #sp-filters .muted, #sp-sorts .muted { font-size: 12px; }

  /* Sort levels (ClickUp-style stacked sort) */
  .sp-sort { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; }
  .sp-sort-n { background: var(--teal); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
  .sp-sort-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sp-sort button { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 11px; padding: 2px 6px; line-height: 1.3; color: var(--ink); }
  .sp-sort button:hover:not(:disabled) { background: #eef1f1; }
  .sp-sort button:disabled { opacity: .4; cursor: default; }
  .sp-sort .sp-sort-x { color: var(--burnt-orange); font-weight: 700; }
  .sp-sort-dir { min-width: 56px; }
  #sp-add-sort { margin-top: 6px; }

  .pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
  /* Stage pill colors come from Admin settings (inline styles); legacy fallbacks below */
  .pill.applied { background: #e7eef1; color: var(--teal); }
  .pill.screening { background: #fdeede; color: var(--burnt-orange); }
  .pill.interview, .pill.discovery { background: #fce7d6; color: var(--burnt-orange); }
  .pill.references { background: #f3e6c9; color: #8a6420; }
  .pill.offer { background: var(--warm-gold); color: #5c3d12; }
  .pill.hired, .pill.active { background: #d8efe2; color: #1d6b4a; }
  .pill.onboarding { background: #d8efe2; color: #1d6b4a; }
  .pill.rejected, .pill.withdrawn { background: #eceeee; color: var(--mid-gray); }

  select, input[type=text], input[type=email], input[type=password], textarea {
    font-family: var(--font-sans); font-size: 14px; padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff;
  }
  label.fld { display: block; font-size: 12px; font-weight: 700; color: var(--mid-gray); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 4px; }

  .muted { color: var(--mid-gray); }
  .empty { text-align: center; color: var(--mid-gray); padding: 40px 10px; }

  /* Discovery Calls — service picker + detail view */
  .disc-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .disc-picker-grid > * { min-width: 0; max-width: 100%; }
  .disc-pick {
    display: block; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; box-sizing: border-box;
    text-align: left;
    background: var(--card); border: 2px solid var(--line); border-radius: 12px;
    padding: 18px 20px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
    font-family: inherit; color: inherit;
  }
  .disc-pick:hover { border-color: var(--bright-orange); box-shadow: 0 4px 16px rgba(35,72,87,.1); }
  .disc-pick:focus-visible { outline: 2px solid var(--bright-orange); outline-offset: 2px; }
  .disc-pick-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; min-width: 0; }
  .disc-pick-title {
    font-weight: 900; font-size: 16px; color: var(--teal); margin: 0;
    flex: 1; min-width: 0; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .disc-pick-hint {
    font-size: 12px; color: var(--mid-gray); margin: 0; line-height: 1.4;
    display: block; width: 100%; max-width: 100%; box-sizing: border-box;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .disc-pick .disc-count { flex-shrink: 0; }
  .disc-pick-empty { opacity: .72; }
  .disc-pick-awaiting { border-left: 4px solid var(--warm-gold); }
  .disc-pick-other { border-left: 4px solid var(--mid-gray); }
  .disc-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; min-width: 0; }
  .disc-detail-head h3 { margin: 0; flex: 1; min-width: 0; font-size: 18px; color: var(--teal); display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
  .disc-detail-head .disc-detail-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .disc-count {
    font-weight: 700; font-size: 12px; color: var(--teal); background: #e8f0f3;
    border-radius: 999px; padding: 2px 9px; min-width: 1.5em; text-align: center;
  }
  .disc-pick-mine { border-color: var(--bright-orange); background: #fff8f3; }
  .disc-pick-mine:hover { border-color: var(--burnt-orange); }
  .disc-pick-mine .disc-pick-title { color: var(--burnt-orange); }
  .disc-unmatch-group { margin-top: 14px; }
  .disc-unmatch-group:first-of-type { margin-top: 0; }
  .disc-unmatch-group h4 { margin: 0 0 8px; font-size: 13px; color: var(--teal); font-weight: 700; }
  tr.disc-unmatched-row { background: #fff8f3; }
  tr.disc-unmatched-row:hover { background: #fff3ea; }
  tr.disc-unmatched-row td:first-child { border-left: 3px solid var(--burnt-orange); }
  .disc-link-sel { max-width: 180px; font-size: 12px; padding: 4px 6px; vertical-align: middle; }
  .disc-staff-group { margin-top: 18px; }
  .disc-staff-group:first-of-type { margin-top: 0; }
  .disc-staff-group h4 { margin: 0 0 10px; font-size: 14px; color: var(--teal); font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .disc-section-title { margin: 0 0 12px; font-size: 15px; color: var(--teal); font-weight: 800; }

  /* Discovery calendar (Outlook-style week / month) */
  .disc-cal-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .disc-cal-title { font-weight: 700; font-size: 14px; color: var(--teal); min-width: 160px; text-align: center; }
  .disc-cal-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: auto; }
  .disc-cal-mode .btn { border-radius: 0; border: 0; margin: 0; }
  .disc-cal-week { border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: #fff; }
  .disc-cal-days-h { display: grid; grid-template-columns: 52px repeat(7, minmax(72px, 1fr)); border-bottom: 1px solid var(--line); background: #f8fafb; min-width: 640px; }
  .disc-cal-corner { display: none; }
  .disc-cal-day-h { text-align: center; padding: 8px 4px; border-left: 1px solid var(--line); }
  .disc-cal-day-h.disc-cal-today { background: #fff8f3; }
  .disc-cal-dow { display: block; font-size: 11px; color: var(--mid-gray); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .disc-cal-dom { display: block; font-size: 18px; font-weight: 900; color: var(--teal); line-height: 1.1; }
  .disc-cal-body { display: grid; grid-template-columns: 52px 1fr; min-width: 640px; }
  .disc-cal-hours { border-right: 1px solid var(--line); background: #f8fafb; }
  .disc-cal-hour-lbl { font-size: 10px; color: var(--mid-gray); text-align: right; padding: 0 6px; border-bottom: 1px solid #eef1f1; box-sizing: border-box; line-height: 1; transform: translateY(-6px); }
  .disc-cal-cols { display: grid; grid-template-columns: repeat(7, minmax(72px, 1fr)); }
  .disc-cal-day-col { border-left: 1px solid var(--line); min-width: 0; background: #fff; }
  .disc-cal-day-col.disc-cal-today-col { background: #fffcfa; }
  .disc-cal-allday { padding: 3px; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 2px; background: #fafbfc; }
  .disc-cal-col-inner { position: relative; }
  .disc-cal-hour-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #eef1f1; pointer-events: none; z-index: 0; }
  .disc-cal-event {
    position: absolute; left: 3px; right: 3px; border: 0; border-radius: 5px; padding: 3px 6px;
    text-align: left; cursor: pointer; overflow: hidden; font-family: inherit; font-size: 11px;
    line-height: 1.25; z-index: 1; box-sizing: border-box; box-shadow: 0 1px 2px rgba(35,72,87,.08);
  }
  .disc-cal-event:hover { filter: brightness(0.98); box-shadow: 0 3px 10px rgba(35,72,87,.14); z-index: 2; }
  .disc-cal-event.disc-cal-cancelled { opacity: .55; text-decoration: line-through; }
  .disc-cal-ev-time { display: block; font-weight: 700; font-size: 10px; opacity: .9; }
  .disc-cal-ev-title { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .disc-cal-ev-sub { display: block; font-size: 10px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .disc-cal-month-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
  .disc-cal-month-h { display: grid; grid-template-columns: repeat(7, 1fr); background: #f8fafb; border-bottom: 1px solid var(--line); }
  .disc-cal-month-h span { text-align: center; font-size: 11px; font-weight: 700; color: var(--mid-gray); padding: 8px 4px; text-transform: uppercase; letter-spacing: .04em; }
  .disc-cal-month { display: grid; grid-template-columns: repeat(7, 1fr); }
  .disc-cal-mcell { min-height: 92px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); padding: 5px; font-size: 11px; min-width: 0; }
  .disc-cal-mcell:nth-child(7n+1) { border-left: 0; }
  .disc-cal-mcell.other-month { background: #fafafa; }
  .disc-cal-mcell.disc-cal-today { background: #fff8f3; }
  .disc-cal-mnum { font-weight: 800; font-size: 12px; color: var(--teal); margin-bottom: 4px; }
  .disc-cal-mev {
    display: block; width: 100%; border: 0; border-radius: 4px; padding: 2px 5px; margin-bottom: 2px;
    font-size: 10px; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-family: inherit; line-height: 1.3; box-shadow: 0 1px 2px rgba(35,72,87,.06);
  }
  .disc-cal-mev:hover { filter: brightness(0.98); box-shadow: 0 2px 6px rgba(35,72,87,.12); }
  .disc-cal-more { font-size: 10px; color: var(--mid-gray); padding: 0 4px; }
  .disc-cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 11px; color: var(--mid-gray); }
  .disc-cal-leg-item { display: inline-flex; align-items: center; gap: 5px; }
  .disc-cal-leg-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

  /* Admin settings modal */
  .admin-svc-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
  .admin-svc-row input { font-size: 13px; padding: 7px 9px; }
  .admin-stage-row {
    display: grid; grid-template-columns: minmax(120px, 1fr) auto auto auto; gap: 10px;
    align-items: center; margin-bottom: 10px; padding: 8px 10px; background: #f6f9fa; border-radius: 8px;
  }
  .admin-stage-label { font-size: 13px; font-weight: 700; color: var(--ink); }
  .admin-stage-color { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--mid-gray); font-weight: 700; }
  .admin-stage-color input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: #fff; }
  .admin-stage-preview { justify-self: end; }
  .admin-draft-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
  .admin-draft-row input { font-size: 13px; padding: 7px 9px; flex: 1; }
  .admin-email-tpl-row { border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 10px 36px 10px 12px; margin-bottom: 10px; position: relative; }
  .admin-email-tpl-row input, .admin-email-tpl-row textarea { width: 100%; margin-bottom: 8px; font-size: 13px; padding: 7px 9px; box-sizing: border-box; font-family: inherit; }
  .admin-email-tpl-row textarea { resize: vertical; min-height: 88px; }

  .admin-prep-section { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: #f6f9fa; }
  .admin-prep-section-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
  .admin-prep-section-head .adm-prep-heading { flex: 1; font-size: 13px; padding: 7px 9px; font-weight: 700; }
  .admin-prep-body { width: 100%; box-sizing: border-box; font-size: 13px; padding: 7px 9px; font-family: inherit; resize: vertical; margin-bottom: 8px; }
  .admin-prep-links { display: flex; flex-direction: column; gap: 6px; }
  .admin-prep-link-row { display: flex; gap: 8px; align-items: center; }
  .admin-prep-link-row input { font-size: 13px; padding: 7px 9px; }
  .admin-prep-link-row .adm-prep-link-label { flex: 0 0 40%; }
  .admin-prep-link-row .adm-prep-link-url { flex: 1; }
  .admin-email-tpl-row .adm-tpl-del { position: absolute; top: 8px; right: 6px; }
  .admin-merge-fields { font-size: 12px; color: var(--mid-gray); line-height: 1.55; margin: 6px 0 10px; }
  .admin-merge-fields code { font-size: 11px; background: #eee; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
  .adm-tpl-picker { margin: 8px 0 12px; padding: 10px 12px; background: #f6f3ee; border-radius: 8px; }
  .adm-tpl-picker-label { font-size: 12px; color: var(--mid-gray); margin-bottom: 8px; line-height: 1.45; }
  .adm-tpl-picker-target { font-size: 12px; font-weight: 600; color: var(--teal, #2a6b6b); margin-bottom: 8px; min-height: 1.2em; }
  .adm-merge-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; padding: 2px 0; }
  .adm-merge-chip { font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line, #ddd); background: #fff; cursor: pointer; color: var(--teal, #2a6b6b); font-family: inherit; line-height: 1.2; }
  .adm-merge-chip:hover { background: #fff; border-color: var(--burnt-orange, #c45a25); color: var(--burnt-orange, #c45a25); }
  .adm-merge-chip-ans { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sms-thread { max-height: 240px; overflow-y: auto; margin: 8px 0; padding: 4px 0; }
  .sms-bubble { padding: 8px 11px; border-radius: 10px; margin: 6px 0; font-size: 13px; line-height: 1.45; max-width: 92%; word-break: break-word; }
  .sms-out { background: #dce8e8; margin-left: auto; text-align: right; }
  .sms-in { background: #f6f3ee; margin-right: auto; }
  .sms-meta { font-size: 11px; color: var(--mid-gray); margin-top: 2px; }
  .pipe-batch-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; width: 100%; padding: 10px 12px; background: #f6f3ee; border-radius: 8px; margin-bottom: 12px; box-sizing: border-box; }
  .pipe-toolbar-filters, .pipe-toolbar-actions { display: contents; }
  .pipe-toolbar-spacer { flex: 1; min-width: 8px; }
  .pipe-cards { display: flex; flex-direction: column; gap: 10px; }
  .pipe-card {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  }
  .pipe-card:active { background: #f8fafa; }
  .pipe-card.pipe-row-flag-critical { background: #fff5f4; border-color: #f0d4d2; }
  .pipe-card.pipe-row-flag-critical:active { background: #ffeae8; }
  .pipe-card.pipe-row-flag-warning { background: #faf7f0; border-color: #e8dfc8; }
  .pipe-card.pipe-row-flag-warning:active { background: #f5f0e4; }
  .pipe-card-sel { padding-top: 16px; flex-shrink: 0; }
  .pipe-card-sel input { width: 20px; height: 20px; cursor: pointer; }
  .pipe-card-body { flex: 1; min-width: 0; }
  .pipe-card-name { font-size: 17px; font-weight: 800; color: var(--teal); line-height: 1.25; }
  .pipe-card-email { font-size: 15px; color: var(--mid-gray); margin-top: 4px; word-break: break-word; }
  .pipe-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
  .pipe-card-line { font-size: 14px; color: var(--ink); margin-top: 6px; line-height: 1.4; word-break: break-word; }
  .pipe-card-line .k { color: var(--mid-gray); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; }
  .pipe-subtabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .pipe-subtab { font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--mid-gray); font-family: inherit; }
  .pipe-subtab.active { background: var(--teal); color: #fff; border-color: var(--teal); }
  .mail-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
  .mail-filter-row, .mail-read-row, .mail-toolbar-actions { display: contents; }
  .mail-filter { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--mid-gray); font-family: inherit; }
  .mail-filter.active { background: var(--teal); color: #fff; border-color: var(--teal); }
  .mail-table td { vertical-align: top; }
  .mail-preview { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .mail-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; display: inline-block; }
  .mail-badge.email { background: #e8f0f3; color: var(--teal); }
  .mail-badge.sms { background: #eef6ee; color: #2d6a3e; }
  .mail-badge.failed { background: #fdecea; color: #9e2b26; }
  .mail-unmatched { color: var(--mid-gray); font-style: italic; font-size: 12px; }
  .pipe-subtab-badge { display: none; background: var(--burnt-orange); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
  .mail-row.mail-unread { background: #f3f8f9; }
  .mail-row.mail-unread td { font-weight: 700; }
  .mail-row.mail-unread .mail-preview { font-weight: 700; color: var(--ink); }
  .mail-read-toggle { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; font-family: inherit; }
  .mail-read-toggle.unread { color: var(--teal); }
  .mail-read-toggle.read { color: #c5cfd2; }
  .mail-read-filter { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--mid-gray); font-family: inherit; }
  .mail-read-filter.active { background: #fdf6eb; color: #8a5a12; border-color: #e8d5a8; }
  .mail-cards { display: flex; flex-direction: column; gap: 10px; }
  .mail-card {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px; cursor: pointer;
  }
  .mail-card.mail-unread { border-left: 4px solid var(--burnt-orange); background: #f3f8f9; }
  .mail-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .mail-card-time { flex: 1; font-size: 12px; color: var(--mid-gray); min-width: 0; }
  .mail-card-applicant { font-size: 16px; font-weight: 800; color: var(--teal); margin-bottom: 4px; line-height: 1.25; }
  .mail-card-contact { font-size: 13px; color: var(--ink); margin-bottom: 8px; word-break: break-word; }
  .mail-card-subj { font-weight: 800; font-size: 14px; margin-bottom: 4px; line-height: 1.35; color: var(--ink); }
  .mail-card-preview { font-size: 14px; line-height: 1.45; color: var(--ink); word-break: break-word; }
  .mail-card.mail-unread .mail-card-preview { font-weight: 700; }
  .mail-card-by { font-size: 12px; margin-top: 8px; }

  /* Two-pane email-client Inbox */
  .mail-client {
    display: grid; grid-template-columns: 168px 340px 1fr;
    border: 1px solid var(--line); border-radius: 10px; background: #fff;
    min-height: 560px; overflow: hidden;
  }
  .mail-client-folders {
    border-right: 1px solid var(--line); padding: 12px 8px; background: #fafbfb;
    display: flex; flex-direction: column; gap: 2px;
  }
  .mail-folder-btn {
    text-align: left; border: 0; background: none; cursor: pointer; font-family: inherit;
    font-size: 13px; font-weight: 700; color: var(--ink); padding: 9px 10px; border-radius: 7px;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
  }
  .mail-folder-btn:hover { background: #eef2f3; }
  .mail-folder-btn.active { background: var(--teal); color: #fff; }
  .mail-folder-btn.drag-over { background: var(--bright-orange); color: #fff; outline: 2px dashed #fff; outline-offset: -3px; }
  .mail-folder-count { font-size: 11px; font-weight: 800; color: var(--mid-gray); }
  .mail-folder-btn.active .mail-folder-count { color: rgba(255,255,255,.85); }
  .mail-folder-add-row { margin-top: 4px; }
  .mail-folder-add-row input { width: 100%; font-size: 12px; padding: 6px 8px; }
  .mail-folder-divider { border-top: 1px solid var(--line); margin: 6px 4px; }
  .mail-folder-btn-trash { color: var(--mid-gray); }
  .mail-folder-btn-trash.active { background: #6a7478; color: #fff; }
  .mail-folder-btn-trash.drag-over { background: #9e2b26; color: #fff; outline: 2px dashed #fff; outline-offset: -3px; }
  .mail-client-list {
    border-right: 1px solid var(--line); overflow-y: auto; max-height: 640px;
  }
  .mail-list-row {
    display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
    font-family: inherit; padding: 10px 14px; border-bottom: 1px solid var(--line);
  }
  .mail-list-row:hover { background: #f6f9fa; }
  .mail-list-row.selected { background: #e8f0f3; }
  .mail-list-row.dragging { opacity: .4; }
  .mail-select-hint { font-size: 12px; color: var(--mid-gray); padding: 4px 14px 10px; }
  .mail-list-row.mail-unread .mail-list-name, .mail-list-row.mail-unread .mail-list-snippet { font-weight: 800; color: var(--ink); }
  .mail-list-row-top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
  .mail-list-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bright-orange); flex-shrink: 0; }
  .mail-list-row:not(.mail-unread) .mail-list-dot { visibility: hidden; }
  .mail-list-name { font-size: 13px; font-weight: 700; color: var(--teal); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mail-list-time { font-size: 11px; color: var(--mid-gray); flex-shrink: 0; }
  .mail-list-subj { font-size: 12px; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mail-list-snippet { font-size: 12px; color: var(--mid-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mail-client-detail { padding: 18px 22px; overflow-y: auto; max-height: 640px; }
  .mail-detail-empty { padding: 60px 0; text-align: center; }
  .mail-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 14px; }
  .mail-detail-title { font-size: 16px; font-weight: 800; color: var(--teal); margin-bottom: 4px; }
  .mail-detail-meta { font-size: 12px; color: var(--mid-gray); }
  .mail-detail-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
  .mail-detail-subj { font-size: 15px; font-weight: 800; margin-bottom: 10px; color: var(--ink); }
  .mail-detail-body { font-size: 14px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; word-break: break-word; margin-bottom: 22px; }
  .mail-reply-box { border-top: 1px solid var(--line); padding-top: 16px; }
  .mail-reply-label { font-size: 12px; font-weight: 800; color: var(--mid-gray); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
  .mail-reply-subject { width: 100%; margin-bottom: 8px; }
  .mail-format-toolbar { display: flex; gap: 4px; margin-bottom: 6px; }
  .mail-format-btn {
    border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 30px; height: 28px;
    cursor: pointer; font-size: 13px; font-weight: 800; color: var(--ink); font-family: inherit;
  }
  .mail-format-btn:hover { background: #eef2f3; }
  .mail-reply-editor {
    border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 100px;
    font-size: 14px; line-height: 1.5; font-family: inherit; overflow-y: auto;
  }
  .mail-reply-editor:empty:before { content: attr(data-placeholder); color: var(--mid-gray); }
  .mail-reply-actions { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
  #mail-folders-list { display: flex; flex-direction: column; gap: 2px; }
  @media (max-width: 900px) {
    .mail-client { grid-template-columns: 1fr; }
    .mail-client-folders { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    #mail-folders-list { flex-direction: row; }
    .mail-client-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 320px; }
  }

  /* Dashboard recent activity feed -- narrow left-hand column of simple rows */
  .dash-activity-panel { max-width: 460px; }
  .dash-activity-select {
    font-size: 12px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
    background: #fff; color: var(--ink); font-family: inherit;
  }
  .dash-act-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 2px;
    border-top: 1px solid var(--line); cursor: pointer;
  }
  .dash-act-row:first-child { border-top: none; }
  .dash-act-row:hover { background: #f6f9fa; }
  .dash-act-name {
    flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--teal);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .dash-act-time { font-size: 11px; color: var(--mid-gray); white-space: nowrap; flex-shrink: 0; }
  .dash-act-badge {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    padding: 2px 7px; border-radius: 4px; flex-shrink: 0;
  }
  .dash-act-badge.interest { background: #e8f0f3; color: #234857; }
  .dash-act-badge.full { background: #fff0e6; color: #9e4a1f; }
  .dash-act-badge.reference { background: #eef8f2; color: #1e6b3a; }
  .dash-act-badge.email { background: #eef4f6; color: #2a6b6b; }
  .dash-act-badge.sms { background: #f5f0fa; color: #6b3fa0; }
  .dash-act-badge.note { background: #fdf6e3; color: #8a6d1f; }
  .dash-act-badge.offer { background: #b9e4cb; color: #155c3c; }
  .pipe-sel-cell, .pipe-sel-h { width: 36px; min-width: 36px; text-align: center; vertical-align: middle; }
  .pipe-sel-cell input, .pipe-sel-h input { cursor: pointer; }
  .admin-meta { font-size: 12px; color: var(--mid-gray); margin-top: 4px; }
  .admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
  .admin-team-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .admin-team-row:last-child { border-bottom: 0; }
  .admin-team-meta { min-width: 0; overflow: hidden; }
  .admin-team-meta .email { font-size: 13px; font-weight: 700; color: var(--teal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-team-meta .name { font-size: 12px; color: var(--mid-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-team-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  .admin-team-add .full { grid-column: 1 / -1; }
  .admin-trash-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .admin-trash-row:last-child { border-bottom: 0; }
  .admin-trash-meta { min-width: 0; overflow: hidden; }
  .admin-trash-meta .name { font-size: 13px; font-weight: 700; color: var(--teal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-trash-meta .sub { font-size: 12px; color: var(--mid-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-trash-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .modal-trash-zone { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
  .modal-test-zone { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
  .admin-trash-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
  .test-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #fdecea; color: #9e2b26; margin-left: 8px; vertical-align: middle; }
  .returner-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: #e8f2f0; color: #12464e; margin-left: 8px; vertical-align: middle; }
  .staff-avatar { border-radius: 999px; object-fit: cover; flex-shrink: 0; background: #e8f0f3; display: block; transition: box-shadow .15s; }
  .staff-avatar-wrap {
    border: 0; padding: 0; margin: 0; background: none; cursor: zoom-in;
    display: inline-flex; border-radius: 999px; line-height: 0; vertical-align: middle;
  }
  .staff-avatar-wrap:hover .staff-avatar { box-shadow: 0 0 0 3px var(--bright-orange); }
  .staff-avatar-fallback {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
    background: var(--teal); color: #fff; font-weight: 700; flex-shrink: 0;
  }
  .staff-with { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
  .staff-with > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .disc-pick-with-avatar { display: flex; gap: 16px; align-items: center; text-align: left; overflow: hidden; min-width: 0; max-width: 100%; width: 100%; }
  .disc-pick-with-avatar .disc-pick-body { flex: 1 1 0%; min-width: 0; max-width: 100%; overflow: hidden; }
  .disc-pick-with-avatar .staff-avatar-wrap,
  .disc-pick-with-avatar .staff-avatar-fallback { flex-shrink: 0; }
  .disc-pick-with-emblem { display: flex; gap: 16px; align-items: center; text-align: left; overflow: hidden; min-width: 0; max-width: 100%; width: 100%; }
  .disc-pick-with-emblem .disc-pick-body { flex: 1 1 0%; min-width: 0; max-width: 100%; overflow: hidden; }
  .team-emblem {
    object-fit: contain; object-position: center; flex-shrink: 0; display: block;
    background: transparent; border-radius: 0; width: auto; height: auto;
  }
  .team-emblem-wrap {
    display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
    line-height: 0; cursor: pointer; border-radius: 0;
  }
  .team-emblem-wrap:hover .team-emblem { outline: 3px solid var(--bright-orange); outline-offset: 2px; }
  .team-emblem-fallback {
    display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
    font-weight: 800; color: #fff; flex-shrink: 0;
  }
  .disc-staff-group h4 .team-emblem-wrap,
  .disc-staff-group h4 .team-emblem,
  .disc-staff-group h4 .team-emblem-fallback { flex-shrink: 0; }
  .admin-team-logo-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line);
  }
  .admin-team-logo-row:last-child { border-bottom: 0; }
  .admin-team-logo-meta { flex: 1; min-width: 0; }
  .admin-team-logo-meta .name { font-weight: 700; font-size: 14px; color: var(--teal); }
  .admin-team-logo-meta .key { font-size: 12px; color: var(--mid-gray); margin-top: 2px; }
  .admin-favicon-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
  }
  .admin-favicon-placeholder {
    width: 32px; height: 32px; border-radius: 6px; border: 1px dashed var(--line);
    display: inline-flex; align-items: center; justify-content: center; font-size: 9px; color: var(--mid-gray);
    text-align: center; line-height: 1.1; flex-shrink: 0;
  }
  .admin-favicon-meta { flex: 1; min-width: 0; }
  .admin-favicon-meta .name { font-weight: 700; font-size: 14px; color: var(--teal); }
  .admin-favicon-meta .key { font-size: 12px; color: var(--mid-gray); margin-top: 2px; line-height: 1.45; }

  /* Staff photo lightbox */
  .photo-back { position: fixed; inset: 0; background: rgba(20,30,34,.78); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 230; }
  .photo-back.open { display: flex; }
  .photo-pop { position: relative; max-width: min(560px, 94vw); width: 100%; text-align: center; }
  .photo-pop img { width: 100%; max-height: min(72vh, 640px); object-fit: contain; border-radius: 14px; background: #fff; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
  .photo-pop-cap { margin-top: 12px; color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
  .photo-pop .x {
    position: absolute; top: -12px; right: -12px; width: 36px; height: 36px; border-radius: 999px;
    border: 0; background: #fff; color: var(--teal); font-size: 22px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
  }
  .photo-pop .x:hover { background: var(--bright-orange); color: #fff; }

  /* Login + setup screens */
  .gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--teal); padding: 20px; }
  .gate .box { background: #fff; border-radius: 16px; padding: 30px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
  .gate h1 { color: var(--teal); font-size: 22px; }
  .gate p.sub { color: var(--mid-gray); font-size: 13px; margin-top: -4px; }
  .gate .err { color: var(--burnt-orange); font-size: 13px; font-weight: 700; min-height: 18px; margin-top: 8px; }
  .gate .full { width: 100%; margin-top: 16px; }

  /* Modal — candidate profile (fullscreen when open) */
  .modal-back { position: fixed; inset: 0; background: rgba(20,30,34,.55); display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto; z-index: 100; }
  .modal-back.open { display: flex; }
  #modal-back.open { padding: 0; align-items: stretch; background: var(--paper); overflow: hidden; }
  #admin-back.open {
    padding: 0; align-items: stretch; background: var(--paper); overflow: hidden;
  }
  #admin-back.open .modal.admin-modal {
    max-width: 100%; width: 100%; min-height: 100vh; max-height: 100vh;
    border-radius: 0; display: flex; flex-direction: column; overflow: hidden;
  }
  #admin-back.open .admin-head { flex-shrink: 0; position: relative; z-index: 80; }
  #admin-back.open .admin-body {
    flex: 1; min-height: 0; overflow: hidden; padding: 0;
    display: flex; flex-direction: column;
  }
  .admin-head-sub { font-size: 12px; font-weight: 500; opacity: .88; margin-top: 3px; line-height: 1.4; }
  .admin-head .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: transparent; }
  .admin-head .btn-ghost:hover { background: rgba(255,255,255,.12); }
  .admin-shell { flex: 1; min-height: 0; display: flex; overflow: hidden; }
  .admin-nav {
    width: 220px; flex-shrink: 0; border-right: 1px solid var(--line);
    padding: 16px 12px; overflow-y: auto; background: #f6f9fa;
  }
  .admin-nav-btn {
    display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 4px;
    border: 0; background: transparent; border-radius: 8px; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 700; color: var(--mid-gray);
  }
  .admin-nav-btn:hover { background: #eef4f6; color: var(--ink); }
  .admin-nav-btn.active { background: #fff; color: var(--teal); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
  .admin-panels { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 26px; -webkit-overflow-scrolling: touch; }
  .admin-panel { display: none; max-width: 980px; }
  .admin-panel.active { display: block; }
  .admin-panel-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 4px; line-height: 1.25; }
  .admin-panel-desc { font-size: 13px; color: var(--mid-gray); margin: 0 0 18px; line-height: 1.5; }
  .admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-bottom: 16px; }
  .admin-grid-2 .admin-card-wide { grid-column: 1 / -1; }
  .admin-card {
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px;
  }
  .admin-card-title { font-size: 13px; font-weight: 800; color: var(--ink); margin: 0 0 10px; }
  .admin-card .fld:first-child { margin-top: 0; }
  .admin-scroll-panel { max-height: min(520px, 55vh); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .admin-actions { display: none; }
  .modal { background: #fff; border-radius: 14px; width: 100%; max-width: 720px; padding: 0; overflow: hidden; }
  .modal.modal-wide { max-width: min(1120px, 96vw); }
  #modal-back.open .modal.modal-wide {
    max-width: 100%; width: 100%; min-height: 100vh; max-height: 100vh;
    border-radius: 0; display: flex; flex-direction: column; overflow: visible;
  }
  #modal-back.open .modal header { flex-shrink: 0; position: relative; z-index: 80; overflow: visible; }
  #modal-back.open #m-body {
    flex: 1; min-height: 0; display: flex; flex-direction: row;
    overflow: hidden; padding: 0; align-items: stretch;
  }
  #modal-back.open .m-profile-pane {
    flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  }
  #modal-back.open .m-layout {
    flex: 1; min-height: 0; max-height: none; margin: 0;
    flex-direction: column; overflow-y: auto;
  }
  #modal-back.open .m-main,
  #modal-back.open .m-workspace,
  #modal-back.open .m-activity { max-height: none; min-height: 0; }
  #modal-back.open .m-activity {
    width: min(420px, 36vw); flex-shrink: 0; align-self: stretch;
    border-left: 1px solid var(--line);
  }
  .modal header { background: var(--teal); color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; overflow: visible; }
  .modal header .m-head-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
  .modal header .m-head-main #m-name { font-size: inherit; line-height: 1.2; }
  .modal header .m-head-identity { min-width: 0; }
  .modal header .m-head-sub { font-size: 12px; font-weight: 500; opacity: .9; margin-top: 3px; line-height: 1.4; }
  .modal header .m-head-sub a { color: #fff; }
  .modal header .m-head-stage { display: none; }
  .m-stage-picker { position: relative; display: inline-flex; flex-shrink: 0; align-self: center; }
  .m-stage-pill-btn {
    background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: 999px;
    display: inline-flex; align-items: center; line-height: normal;
  }
  .m-stage-pill { display: inline-block; line-height: normal; vertical-align: middle; }
  .m-stage-pill-btn:hover .pill { box-shadow: 0 0 0 2px rgba(255,255,255,.45); }
  .m-stage-pill-btn:focus-visible .pill { outline: 2px solid #fff; outline-offset: 2px; }
  .m-stage-menu {
    display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 200;
    min-width: 210px; max-height: min(320px, 50vh); overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.22); padding: 6px;
  }
  .m-stage-picker.open { z-index: 201; }
  .m-stage-picker.open .m-stage-menu { display: block; }
  .m-stage-opt {
    display: flex; align-items: center; width: 100%; text-align: left; border: 0; background: transparent;
    padding: 7px 8px; border-radius: 8px; cursor: pointer; font-family: inherit;
  }
  .m-stage-opt:hover { background: #f0f3f3; }
  .m-stage-opt.active { background: #eef4f6; }
  .m-stage-opt .pill { pointer-events: none; }
  .modal header .m-stage-pill .pill {
    text-transform: none; font-size: 12px; padding: 4px 11px; line-height: 1.35;
    display: inline-block; vertical-align: middle;
  }
  .modal header .spacer { flex: 1; }
  .modal header .x { background: transparent; border: 0; color: #fff; font-size: 22px; line-height: 1; }
  .modal .body { padding: 20px; }

  /* Full-screen profile hero: pipeline + glance cards */
  .m-profile-pane {
    flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  }
  .m-profile-hero { background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
  .m-pipeline-track { padding: 14px 20px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .m-pipeline-steps { display: flex; align-items: flex-start; min-width: 0; width: 100%; }
  .m-pipeline-step {
    flex: 1; min-width: 54px; text-align: center; position: relative; padding: 0 2px;
  }
  .m-pipeline-step-group { min-width: 72px; }
  .m-pipeline-step::after {
    content: ""; position: absolute; top: 13px; left: calc(50% + 14px); right: calc(-50% + 14px);
    height: 3px; background: var(--line); z-index: 0;
  }
  .m-pipeline-step:last-child::after { display: none; }
  .m-pipeline-step.done::after { background: var(--teal); }
  .m-pipeline-dot {
    width: 26px; height: 26px; border-radius: 999px; border: 2px solid var(--line); background: #fff;
    margin: 0 auto 5px; position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: var(--mid-gray);
  }
  .m-pipeline-step.done .m-pipeline-dot { background: var(--teal); border-color: var(--teal); color: #fff; }
  .m-pipeline-step.current .m-pipeline-dot {
    background: var(--bright-orange); border-color: var(--bright-orange); color: #fff;
    box-shadow: 0 0 0 3px rgba(241, 133, 68, .28);
  }
  .m-pipeline-step.current .m-pipeline-label { color: var(--ink); font-weight: 800; }
  .m-pipeline-step.future .m-pipeline-dot { background: #f6f9fa; }
  .m-pipeline-label { font-size: 9px; font-weight: 700; color: var(--mid-gray); line-height: 1.25; }
  .m-pipeline-substeps { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; align-items: stretch; }
  .m-pipeline-sub {
    font-size: 8px; font-weight: 700; color: var(--mid-gray); line-height: 1.2;
    padding: 2px 3px; border-radius: 4px;
  }
  .m-pipeline-sub.done { color: var(--teal); }
  .m-pipeline-sub.current { color: var(--ink); background: rgba(241, 133, 68, .14); font-weight: 800; }
  .m-pipeline-terminal {
    padding: 0 20px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 12px; color: var(--mid-gray);
  }
  .m-glance {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px; padding: 10px 20px 16px;
  }
  .m-glance-card {
    background: #f6f9fa; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 12px; min-height: 64px;
  }
  .m-glance-card .g-label {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: var(--mid-gray); margin-bottom: 4px;
  }
  .m-glance-card .g-val { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.35; word-break: break-word; }
  .m-glance-card .g-sub { font-size: 11px; color: var(--mid-gray); margin-top: 3px; line-height: 1.35; }
  .m-glance-card.accent { border-color: #c5d8de; background: #eef4f6; }
  .m-glance-card.ok { border-color: #b8dcc8; background: #eef8f2; }
  .m-glance-card.pending { border-color: var(--warm-gold); background: #faf7f0; }

  .m-layout { display: flex; gap: 0; align-items: stretch; min-height: 420px; margin: -20px; }
  .m-main { flex: 1; min-width: 0; padding: 20px; overflow-y: auto; max-height: min(78vh, 820px); }
  .m-workspace {
    flex: 1; min-width: 0; padding: 20px 22px; overflow-y: auto;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    background: #fff;
  }
  /* On desktop the two panes stack into one continuous scrolling column
     (see #modal-back.open .m-layout above) instead of sitting side by side
     as a narrow sidebar next to a wide pane -- the profile/contact/reference
     sections read top-to-bottom straight into Interview grading and Call
     notes. Mobile is unaffected: .m-layout is display:none there (see the
     max-width: 640px block) in favor of the tab/mobile-sheet system, so
     these rules never apply on a phone. */
  #modal-back.open .m-main {
    flex: 0 0 auto; width: 100%; max-width: none; min-width: 0;
    overflow: visible; max-height: none;
  }
  /* .m-workspace (Interview grading + Call notes) now renders inline inside
     .m-main, at the point in the reading order the sections belong -- not as
     its own bordered/padded pane. */
  #modal-back.open .m-workspace {
    flex: 0 0 auto; max-height: none; overflow: visible;
    border-left: none; border-right: none; padding: 0; background: none;
  }
  .m-workspace-panel { margin-bottom: 20px; }
  .m-workspace-panel:last-child { margin-bottom: 0; }
  .m-workspace-head {
    font-weight: 800; font-size: 15px; color: var(--teal);
    margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  }
  .m-workspace .m-interview-notes {
    border: 1px solid var(--line); border-radius: 10px; padding: 14px;
    margin-bottom: 0; background: #f6f9fa;
  }
  .m-workspace .m-interview-notes textarea { min-height: 140px; }
  .m-sect-toggle { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .m-sect-chevron { font-size: 10px; color: var(--mid-gray); transition: transform .15s ease; flex-shrink: 0; }
  .m-sect-collapsed .m-sect-chevron { transform: rotate(-90deg); }
  .m-info-panel.m-sect-collapsed > *:not(.m-sect-toggle),
  .m-ref-panel.m-sect-collapsed > *:not(.m-sect-toggle),
  .m-workspace-panel.m-sect-collapsed > *:not(.m-sect-toggle) { display: none; }
  .m-activity { width: 360px; flex-shrink: 0; border-left: 1px solid var(--line); background: #f8f9f9; display: flex; flex-direction: column; max-height: min(78vh, 820px); }
  .m-act-head { padding: 14px 16px 10px; font-weight: 800; font-size: 14px; color: var(--teal); border-bottom: 1px solid var(--line); background: #fff; flex-shrink: 0; }
  .m-act-filters { display: flex; gap: 6px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex-shrink: 0; }
  .m-act-filter { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--mid-gray); font-family: inherit; }
  .m-act-filter.active { background: var(--teal); color: #fff; border-color: var(--teal); }
  .m-act-timeline { flex: 1; overflow-y: auto; padding: 12px; min-height: 120px; }
  .m-act-item { margin-bottom: 12px; font-size: 13px; line-height: 1.45; }
  .m-act-item-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
  .m-act-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; }
  .m-act-badge.email { background: #e8f0f3; color: var(--teal); }
  .m-act-badge.sms { background: #eef6ee; color: #2d6a3e; }
  .m-act-badge.note { background: #faf7f0; color: #8a6a12; }
  .m-act-badge.stage { background: #f0eef8; color: #4a4580; }
  .m-act-badge.failed { background: #fdecea; color: #9e2b26; }
  .m-act-badge.ref { background: #eef4f6; color: #234857; text-transform: none; letter-spacing: 0; font-size: 10px; }
  .m-act-time { font-size: 11px; color: var(--mid-gray); }
  .m-act-body { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-word; }
  .m-act-item.inbound .m-act-body { border-left: 3px solid var(--warm-gold); }
  .m-act-item.outbound .m-act-body { border-left: 3px solid var(--teal); }
  .m-act-subj { font-weight: 700; font-size: 12px; margin-bottom: 4px; color: var(--ink); }
  .m-act-meta { font-size: 11px; color: var(--mid-gray); margin-top: 4px; }
  .m-act-compose { border-top: 1px solid var(--line); background: #fff; padding: 12px; }
  .m-act-compose-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
  .m-act-tab { flex: 1; font-size: 12px; font-weight: 700; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: #f6f9fa; cursor: pointer; font-family: inherit; color: var(--mid-gray); }
  .m-act-tab.active { background: var(--teal); color: #fff; border-color: var(--teal); }
  .m-act-tab:disabled { opacity: .45; cursor: not-allowed; }
  .m-act-compose-pane input, .m-act-compose-pane select, .m-act-compose-pane textarea { width: 100%; box-sizing: border-box; font-size: 13px; margin-bottom: 8px; font-family: inherit; }
  .m-act-compose-pane textarea { resize: vertical; min-height: 72px; }
  .m-act-note-toggle { font-size: 12px; color: var(--teal); font-weight: 700; background: none; border: 0; cursor: pointer; padding: 0; margin-top: 8px; font-family: inherit; }
  .m-act-note-box { margin-top: 8px; display: none; }
  .m-act-note-box.open { display: block; }
  .m-mobile-tabs { display: none; }
  .m-act-compose-wrap { flex-shrink: 0; border-top: 1px solid var(--line); background: #fff; }
  .m-act-compose-wrap > summary {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 16px; font-weight: 800; font-size: 13px; color: var(--teal);
    cursor: pointer; list-style: none; user-select: none;
  }
  .m-act-compose-wrap > summary::-webkit-details-marker { display: none; }
  .m-act-compose-wrap > summary::before {
    content: "+"; display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 6px; background: #e8f0f3;
    font-size: 15px; font-weight: 800; line-height: 1; flex-shrink: 0;
  }
  .m-act-compose-wrap[open] > summary { display: none; }
  .m-act-compose-wrap[open] .m-act-compose { padding: 12px 16px 14px; border-top: 0; }
  .m-act-compose-close {
    display: block; width: 100%; margin-bottom: 10px; font-size: 12px; font-weight: 700;
    color: var(--mid-gray); background: #f6f9fa; border: 1px solid var(--line); border-radius: 8px;
    padding: 7px 10px; cursor: pointer; font-family: inherit;
  }
  .m-act-compose-close:hover { color: var(--teal); border-color: var(--teal); }
  .m-act-compose-hint { font-size: 11px; margin-top: 10px; line-height: 1.4; color: var(--mid-gray); }
  .m-act-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .m-act-pop-btn {
    font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 6px;
    border: 1px solid var(--line); background: #fff; color: var(--teal); cursor: pointer; font-family: inherit;
    flex-shrink: 0;
  }
  .m-act-pop-btn:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

  /* Activity log pop-out (larger read view) */
  .act-pop-back {
    position: fixed; inset: 0; background: rgba(20,30,34,.62); display: none;
    align-items: center; justify-content: center; padding: 24px; z-index: 210;
  }
  .act-pop-back.open { display: flex; }
  .act-pop {
    background: #f8f9f9; border-radius: 14px; width: min(980px, 98vw);
    max-height: min(94vh, 980px); display: flex; flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden;
  }
  .act-pop-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 16px 18px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0;
  }
  .act-pop-title { font-weight: 800; font-size: 18px; color: var(--teal); line-height: 1.2; }
  .act-pop-sub { font-size: 13px; color: var(--mid-gray); margin-top: 4px; }
  .act-pop-close {
    background: transparent; border: 0; color: var(--mid-gray); font-size: 26px;
    line-height: 1; cursor: pointer; padding: 0 2px; flex-shrink: 0;
  }
  .act-pop-close:hover { color: var(--teal); }
  .act-pop-back .m-act-filters { flex-shrink: 0; }
  .act-pop-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .act-pop-timeline { flex: 1; overflow-y: auto; padding: 18px 22px; min-height: 320px; }
  .act-pop-compose {
    flex-shrink: 0; border-top: 1px solid var(--line); background: #fff;
    max-height: 46%; overflow-y: auto; padding: 0 22px 18px;
  }
  .act-pop-compose .m-act-compose { padding-top: 14px; }
  .act-pop-compose .m-act-compose-pane textarea { min-height: 96px; }
  .act-pop-back .m-act-item { font-size: 14px; margin-bottom: 14px; }
  .act-pop-back .m-act-body { padding: 12px 14px; font-size: 14px; line-height: 1.55; }
  .act-pop-back .m-act-subj { font-size: 14px; }
  .act-pop-back .m-act-time { font-size: 12px; }
  .act-pop-back .m-act-badge { font-size: 11px; padding: 3px 8px; }
  .kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14px; margin-bottom: 14px; }
  .kv .k { color: var(--mid-gray); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  .note { border-left: 3px solid var(--warm-gold); padding: 6px 10px; margin: 8px 0; background: #faf7f0; border-radius: 0 8px 8px 0; }
  .note .meta { font-size: 11px; color: var(--mid-gray); }
  .hist { font-size: 12px; color: var(--mid-gray); margin: 4px 0; }

  /* Modal collapsible sections */
  .m-sect { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
  .m-sect > summary {
    cursor: pointer; font-weight: 800; font-size: 14px; color: var(--teal);
    padding: 12px 14px; list-style: none; display: flex; align-items: center; gap: 8px;
  }
  .m-sect > summary::-webkit-details-marker { display: none; }
  .m-sect > summary::before { content: "\25B6"; font-size: 10px; color: var(--mid-gray); transition: transform .15s; }
  .m-sect[open] > summary::before { transform: rotate(90deg); }
  .m-sect-body { padding: 0 14px 14px; border-top: 1px solid var(--line); }
  .m-sect-body .kv { margin-top: 12px; margin-bottom: 0; }
  .m-info-panel {
    border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px;
    background: #fff; padding: 14px; overflow: hidden; min-width: 0;
  }
  .m-info-head {
    font-weight: 800; font-size: 14px; color: var(--teal);
    margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  }
  .m-info-panel .kv {
    margin: 0;
    grid-template-columns: minmax(68px, 82px) minmax(0, 1fr);
    gap: 6px 10px;
  }
  .m-info-panel .kv .k { font-size: 11px; line-height: 1.3; }
  .m-info-panel .kv > div:not(.k) {
    min-width: 0; word-break: break-word; overflow-wrap: anywhere; line-height: 1.4;
  }
  .m-info-panel .kv a { word-break: break-all; }
  .m-info-disc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); min-width: 0; }
  .m-info-disc .kv { grid-template-columns: minmax(68px, 82px) minmax(0, 1fr); }
  .m-info-subhead {
    font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--mid-gray); margin: 0 0 8px;
  }
  .m-app-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
  .m-app-full-block { display: flex; flex-direction: column; gap: 0; }
  .m-app-invite-wrap { padding: 0 2px 2px; }
  .m-app-view-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit;
  }
  .m-app-view-btn:hover:not(:disabled) { border-color: var(--teal); background: #f6f9fa; }
  .m-app-view-btn:disabled { opacity: .55; cursor: not-allowed; }
  .m-app-view-label { font-weight: 800; font-size: 14px; color: var(--teal); }
  .m-app-view-meta { font-size: 12px; font-weight: 500; text-align: right; flex-shrink: 0; }
  .app-pop-back {
    position: fixed; inset: 0; background: rgba(20,30,34,.62); display: none;
    align-items: center; justify-content: center; padding: 24px; z-index: 220;
  }
  .app-pop-back.open { display: flex; }
  .app-pop { max-width: min(920px, 98vw); }
  .app-pop-body {
    flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 22px; background: #fff;
  }
  .app-answers-table { width: 100%; border-collapse: collapse; }
  .app-answers-table tr { border-bottom: 1px solid #eef1f1; }
  .app-answers-table tr:last-child { border-bottom: 0; }
  .app-answers-table td { vertical-align: top; padding: 12px 0; line-height: 1.45; }
  .app-answers-table td.app-q {
    width: 42%; padding-right: 18px; color: var(--mid-gray); font-size: 13px;
    word-break: break-word; overflow-wrap: anywhere;
  }
  .app-answers-table td.app-a { font-size: 14px; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
  .app-pop-pretty {
    padding: 12px; background: #f6f9fa; border-radius: 8px; white-space: pre-wrap;
    font-size: 13px; line-height: 1.55;
  }
  .app-flags-banner {
    background: #fdecea; border: 1px solid #e8b4b0; border-radius: 10px;
    padding: 12px 14px; margin-bottom: 14px; color: #7a1f1a; line-height: 1.45;
  }
  .app-flags-banner strong { display: block; font-size: 14px; margin-bottom: 4px; color: #9e2b26; }
  .app-answers-table tr.app-flag-row { background: #fff5f4; }
  .app-answers-table tr.app-flag-row td.app-q { color: #9e2b26; font-weight: 700; }
  .app-answers-table tr.app-flag-row td.app-a { color: #9e2b26; font-weight: 800; }
  .app-flags-banner.warning {
    background: #faf7f0; border-color: #d4b86a; color: #5c4a12;
  }
  .app-flags-banner.warning strong { color: #8a6d1a; }
  .app-answers-table tr.app-flag-row-warning { background: #faf7f0; }
  .app-answers-table tr.app-flag-row-warning td.app-q { color: #8a6d1a; font-weight: 700; }
  .app-answers-table tr.app-flag-row-warning td.app-a { color: #8a6d1a; font-weight: 800; }
  .m-app-view-btn.has-red-flags { border-color: #e8b4b0; background: #fff8f7; }
  .m-app-view-btn.has-yellow-flags { border-color: #d4b86a; background: #faf7f0; }
  .m-app-view-meta.has-red-flags { color: #9e2b26; font-weight: 800; }
  .m-app-view-meta.has-yellow-flags { color: #8a6d1a; font-weight: 800; }
  .m-glance-card.alert { border-color: #e8b4b0; background: #fff5f4; }
  .m-glance-card.alert .g-val { color: #9e2b26; }
  .m-glance-card.caution { border-color: #d4b86a; background: #faf7f0; }
  .m-glance-card.caution .g-val { color: #8a6d1a; }
  .m-glance-card-clickable {
    cursor: pointer; position: relative; padding-right: 28px;
    transition: border-color .12s, box-shadow .12s, transform .12s;
  }
  .m-glance-card-clickable::after {
    content: "\203A"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 20px; line-height: 1; color: var(--mid-gray); font-weight: 700;
  }
  .m-glance-card-clickable:hover { border-color: var(--teal); box-shadow: 0 2px 8px rgba(42, 107, 107, .12); }
  .m-glance-card-clickable:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
  .m-mobile-hint {
    display: none; font-size: 12px; line-height: 1.4; padding: 0 14px 10px; text-align: center;
  }
  .mobile-sheet-back { z-index: 200; }
  .mobile-sheet-back .act-pop { max-height: min(94vh, 920px); }
  .mobile-sheet-body {
    flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 22px;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-sheet-body .m-main,
  .mobile-sheet-body .m-workspace {
    padding: 0; border: 0; max-height: none; overflow: visible; min-width: 0;
  }
  .mobile-sheet-body .m-workspace-panel { margin-bottom: 18px; }
  .mobile-glance-detail { font-size: 16px; font-weight: 700; line-height: 1.45; margin-bottom: 8px; }
  .mobile-glance-detail-sub { font-size: 13px; color: var(--mid-gray); line-height: 1.45; margin-bottom: 14px; }
  .app-sub-picker {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin-bottom: 14px; padding: 10px 12px; background: #f6f9fa; border-radius: 8px;
  }
  .app-sub-picker-label { font-size: 13px; font-weight: 700; color: var(--ink); }
  .app-sub-picker-select { font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
  .app-sub-picker-meta { font-size: 12px; }
  .admin-app-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
  .admin-app-filters select, .admin-app-filters input[type="search"] { font-size: 13px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
  .admin-app-filters label { font-size: 12px; font-weight: 700; color: var(--mid-gray); display: flex; align-items: center; gap: 6px; }
  .admin-app-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .admin-app-row:last-child { border-bottom: 0; }
  .admin-app-meta { min-width: 0; overflow: hidden; }
  .admin-app-meta .name { font-size: 13px; font-weight: 700; color: var(--teal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-app-meta .sub { font-size: 12px; color: var(--mid-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-app-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .admin-app-badge { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
  .admin-app-badge.interest { background: #e8f0f3; color: #234857; }
  .admin-app-badge.full { background: #fff0e6; color: #9e4a1f; }
  .admin-app-badge.dupe { background: #fff5f4; color: #9e2b26; }
  .admin-app-badge.flags { background: #fdecea; color: #9e2b26; }

  .submissions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  @media (max-width: 900px) {
    .submissions-grid { grid-template-columns: 1fr; }
  }

  /* Interest Forms / Applications tabs: full-width row list (unlike the
     narrow Admin modal's .admin-app-row, these tabs have the whole page to
     work with, so name/email/date each get a real column instead of one
     wide "meta" block trailed by a huge gap before the action buttons). */
  .sub-row { display: grid; grid-template-columns: 2fr 2fr 170px; gap: 16px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
  .sub-row:last-child { border-bottom: 0; }
  .sub-row:hover { background: #f0f3f3; }
  .sub-row-head { cursor: default; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--mid-gray); padding: 0 6px 8px; border-bottom: 1px solid var(--line); }
  .sub-row-head:hover { background: none; }
  .sub-row-name { font-size: 14px; font-weight: 700; color: var(--teal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sub-row-email { font-size: 13px; color: var(--mid-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sub-row-date { font-size: 13px; color: var(--mid-gray); text-align: right; white-space: nowrap; }
  @media (max-width: 640px) {
    .sub-row { grid-template-columns: 1fr; gap: 2px; }
    .sub-row-head { display: none; }
    .sub-row-date { text-align: left; }
  }
  .m-grade-open-row { margin: 4px 0 12px; }
  .m-interview-notes {
    border: 1px solid var(--line); border-radius: 10px; padding: 14px;
    margin-bottom: 10px; background: #fff;
  }
  .m-interview-notes .fld { margin-top: 0; }
  .m-interview-notes textarea { min-height: 88px; resize: vertical; font-size: 14px; line-height: 1.45; }

  /* Interview grading */
  .grade-trait-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1f1; font-size: 13px; }
  .grade-trait-row:last-of-type { border-bottom: 0; }
  .grade-trait-label { line-height: 1.4; font-weight: 800; color: var(--teal); }
  .grade-trait-label .dbl { color: var(--burnt-orange); font-weight: 800; font-size: 11px; }
  .grade-trait-wt { font-size: 11px; color: var(--mid-gray); min-width: 2.5em; text-align: right; }
  .grade-trait-row select { font-size: 13px; padding: 5px 8px; min-width: 72px; }
  .grade-result-top { margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); min-height: 0; }
  .grade-result-top:empty { display: none; margin: 0; padding: 0; border: 0; }
  .grade-result-top .overall { font-size: 22px; font-weight: 900; color: var(--teal); line-height: 1.1; }
  .grade-on-file-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
  .grade-on-file-row .draft-grade-line { flex: 1; min-width: 0; }
  .grade-on-file-row .grade-delete-btn { flex-shrink: 0; font-size: 11px; padding: 4px 8px; }
  .grade-preview { background: #f6f9fa; border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 13px; line-height: 1.5; }
  .grade-preview:empty { display: none; margin: 0; padding: 0; }
  .grade-preview .overall { font-size: 22px; font-weight: 900; color: var(--teal); line-height: 1.1; }
  .grade-tier { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
  .grade-tier.must_hire { background: #e6f4ea; color: #1e6b3a; }
  .grade-tier.good_hire { background: #e8f0f3; color: var(--teal); }
  .grade-tier.average { background: #fdf6eb; color: #8a5a12; }
  .grade-tier.no_hire { background: #fdecea; color: #9e2b26; }
  .grade-tier.serve_team { background: #f0eef8; color: #4a4580; }
  .grade-work { font-size: 12px; color: var(--mid-gray); margin-top: 6px; }
  .grade-rec-block { margin-top: 14px; }
  .grade-nohire-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
  .grade-nohire-block label.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 6px 0; cursor: pointer; }
  .grade-nohire-block label.chk input { margin-top: 3px; }
  .grade-scale-key { font-size: 11px; color: var(--mid-gray); margin-top: 10px; line-height: 1.45; }
  .draft-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
  .draft-board-wrap { margin-bottom: 18px; padding: 16px; }
  .draft-board-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: stretch;
  }
  .draft-board-col {
    background: #fafbfc; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
    display: flex; flex-direction: column; min-height: 200px;
  }
  .draft-board-col-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  }
  .draft-board-col-title { font-size: 15px; font-weight: 800; color: var(--teal); line-height: 1.2; }
  .draft-board-col-count { font-size: 12px; color: var(--mid-gray); margin-top: 2px; }
  .draft-board-col-balance {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
  }
  .draft-balance-stat {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--teal);
    background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
  }
  .draft-balance-label {
    display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
    border-radius: 999px; background: var(--teal); color: #fff; font-size: 10px; font-weight: 800;
  }
  .draft-balance-stat.male .draft-balance-label { background: #89cff0; color: #1a4d6e; }
  .draft-balance-stat.female .draft-balance-label { background: #ffb6c1; color: #8a3d52; }
  .draft-balance-stat.returner .draft-balance-label { background: var(--burnt-orange); color: #fff; }
  .draft-board-col-drop {
    min-height: 36px; border: 2px dashed transparent; border-radius: 8px; margin-bottom: 8px;
    display: flex; align-items: center; justify-content: center; transition: border-color .15s, background .15s;
  }
  .draft-board-col-drop.draft-board-drop-active {
    border-color: var(--bright-orange); background: #fff8f3; cursor: pointer;
  }
  .draft-board-drop-hint { font-size: 12px; font-weight: 700; color: var(--burnt-orange); text-align: center; padding: 6px; }
  .draft-board-col-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .draft-board-pick {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; cursor: pointer; transition: transform .2s, box-shadow .2s;
  }
  .draft-board-pick:hover { border-color: var(--teal); box-shadow: 0 2px 8px rgba(35,72,87,.08); }
  .draft-board-pick-enter { animation: draftPickEnter .55s ease-out; }
  @keyframes draftPickEnter {
    0% { opacity: 0; transform: translateY(24px) scale(.92); }
    60% { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { transform: translateY(0) scale(1); }
  }
  .draft-board-pick-name {
    flex: 1; font-weight: 800; font-size: 14px; color: var(--teal); min-width: 0;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .draft-board-pick-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .draft-pick-tags { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
  .draft-pick-tag {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
    border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1;
  }
  .draft-pick-tag.male { background: #89cff0; color: #1a4d6e; }
  .draft-pick-tag.female { background: #ffb6c1; color: #8a3d52; }
  .draft-board-pick-grade { font-size: 12px; font-weight: 700; flex-shrink: 0; }
  .draft-board-pick-grade .grade-tier { margin-left: 0; font-size: 10px; padding: 2px 8px; white-space: nowrap; }
  .draft-board-undo {
    border: 0; background: transparent; color: var(--mid-gray); font-size: 18px; line-height: 1; cursor: pointer;
    padding: 0 4px; flex-shrink: 0;
  }
  .draft-board-undo:hover { color: var(--burnt-orange); }
  .draft-board-empty { font-size: 13px; color: var(--mid-gray); font-style: italic; padding: 8px 4px; }
  .draft-pool-section { padding: 16px; }
  .draft-pool-group { margin-bottom: 18px; }
  .draft-pool-group:last-child { margin-bottom: 0; }
  .draft-pool-group-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
    font-size: 13px; font-weight: 800; color: var(--teal);
  }
  .draft-pool-group-gender.male { color: #1a4d6e; }
  .draft-pool-group-gender.female { color: #8a3d52; }
  .draft-pool-group-sep { color: var(--mid-gray); font-weight: 600; }
  .draft-pool-group-count { font-size: 12px; font-weight: 600; color: var(--mid-gray); }
  .draft-pool-group-head .grade-tier { margin-left: 0; font-size: 10px; padding: 2px 8px; }
  .draft-board-subsection { margin-bottom: 10px; }
  .draft-board-subsection:last-child { margin-bottom: 0; }
  .draft-board-subhead {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--mid-gray); margin: 0 0 6px; padding: 4px 2px 0;
  }
  .draft-board-subhead .grade-tier { margin-left: 0; font-size: 9px; padding: 2px 7px; text-transform: none; letter-spacing: 0; }
  .draft-pool-title { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--teal); }
  .draft-pool-hint { margin: 0 0 12px; font-size: 13px; color: var(--mid-gray); }
  .draft-pool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
  .draft-pool-card {
    text-align: left; padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff;
    cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
  }
  .draft-pool-card:hover { border-color: var(--teal); box-shadow: 0 4px 14px rgba(35,72,87,.1); }
  .draft-pool-card-selected { border-color: var(--bright-orange); background: #fff8f3; box-shadow: 0 0 0 3px rgba(241,133,68,.25); }
  .draft-pool-name { font-size: 17px; font-weight: 800; color: var(--teal); margin-bottom: 4px; }
  .draft-pool-name.returner,
  .draft-board-pick-name-text.returner { color: var(--burnt-orange); }
  .draft-returner-mark {
    font-size: 0.62em; font-weight: 800; margin-left: 1px; color: var(--burnt-orange);
    vertical-align: super; line-height: 0; text-transform: lowercase;
  }
  .draft-pool-meta { font-size: 12px; color: var(--mid-gray); margin-bottom: 8px; }
  .draft-pool-grade { font-size: 12px; line-height: 1.4; }
  .draft-pool-empty { text-align: center; padding: 28px 16px; font-size: 16px; font-weight: 700; color: var(--teal); }
  .draft-selection-banner {
    display: none; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: #fff8f3;
    border: 1px solid #f5c4a5; font-size: 13px; font-weight: 600; color: var(--burnt-orange);
  }
  .draft-selection-banner.visible { display: block; }
  .draft-fireworks-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 350; display: none; }
  .draft-fireworks-canvas.active { display: block; }
  #panel-drafting.draft-day-mode .wrap { max-width: none; }
  #panel-drafting.draft-day-mode .draft-board-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
  #panel-drafting.draft-day-mode .draft-board-col { min-height: 320px; padding: 16px; }
  #panel-drafting.draft-day-mode .draft-board-col-title { font-size: 22px; }
  #panel-drafting.draft-day-mode .draft-balance-stat { font-size: 15px; padding: 4px 12px; }
  #panel-drafting.draft-day-mode .draft-balance-label { min-width: 22px; height: 22px; font-size: 12px; }
  #panel-drafting.draft-day-mode .draft-board-pick-name { font-size: 18px; }
  #panel-drafting.draft-day-mode .draft-board-pick { padding: 14px 16px; }
  #panel-drafting.draft-day-mode .draft-pool-name { font-size: 22px; }
  #panel-drafting.draft-day-mode .draft-pool-card { padding: 18px 20px; }
  #panel-drafting.draft-day-mode .draft-pool-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
  #panel-drafting.draft-day-mode h2 { font-size: 28px; }
  .draft-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .draft-table td { vertical-align: top; font-size: 13px; }
  .draft-name { font-weight: 800; color: var(--teal); }
  .draft-sub { font-size: 12px; color: var(--mid-gray); margin-top: 2px; }
  .draft-grade { line-height: 1.45; min-width: 140px; }
  .draft-notes { line-height: 1.45; max-width: 320px; white-space: normal; word-break: break-word; color: var(--ink); }
  .draft-to-select { font-size: 13px; padding: 6px 8px; min-width: 150px; max-width: 220px; border-left-width: 4px; border-left-style: solid; border-left-color: transparent; }
  .draft-empty-note { color: var(--mid-gray); font-style: italic; }
  .ref-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
  .ref-slot-cell { min-width: 150px; line-height: 1.45; }
  .ref-slot-name { font-weight: 700; font-size: 13px; color: var(--ink); }
  .ref-slot-meta { font-size: 12px; color: var(--mid-gray); margin-top: 2px; }
  .ref-slot-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .contact-field { line-height: 1.45; }
  .contact-field-compact + .contact-field-compact { margin-top: 6px; }
  .contact-field-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--mid-gray); margin-bottom: 2px; }
  .contact-field-view { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .contact-field-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
  .contact-field-form[hidden] { display: none !important; }
  .contact-field-input { font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; flex: 1 1 160px; font-family: inherit; }
  .contact-field-edit-btn { font-size: 11px; padding: 2px 8px; min-height: 0; }
  .ref-status-pill {
    display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    padding: 3px 8px; border-radius: 999px; margin-top: 4px;
  }
  .ref-status-pill.not_requested { background: #eceeee; color: #6a7478; }
  .ref-status-pill.requested { background: #fdeede; color: #c4652a; }
  .ref-status-pill.received { background: #d8efe2; color: #1d6b4a; }
  .ref-status-pill.declined { background: #f5e0e0; color: #9e2b26; }
  .m-ref-panel { margin-top: 16px; }
  .m-ref-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--mid-gray); margin-bottom: 10px; }
  .m-ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
  .m-ref-card {
    border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbfb;
    display: flex; flex-direction: column; gap: 8px; min-height: 120px;
  }
  .m-ref-card.received { border-color: #b8dcc8; background: #f4fbf7; }
  .m-ref-card.requested { border-color: #f0d4b8; background: #fffaf5; }
  .m-ref-card-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--mid-gray); }
  .m-ref-card-name { font-weight: 800; color: var(--teal); font-size: 14px; line-height: 1.3; }
  .m-ref-card-contact { font-size: 12px; color: var(--mid-gray); line-height: 1.4; word-break: break-word; }
  .m-ref-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

  .toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 700; opacity: 0; transition: opacity .2s; z-index: 400; }
  .toast.show { opacity: 1; }

  /* In-app confirm dialog (replaces browser confirm) */
  .confirm-back { position: fixed; inset: 0; background: rgba(20,30,34,.58); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 300; }
  .confirm-back.open { display: flex; }
  .confirm-dialog {
    background: #fff; border-radius: 14px; width: 100%; max-width: 440px;
    box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden;
    animation: confirm-in .16s ease-out;
  }
  @keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
  .confirm-head { background: var(--teal); color: #fff; padding: 14px 18px; font-weight: 800; font-size: 16px; line-height: 1.3; }
  .confirm-head.danger { background: #9e2b26; }
  .confirm-body { padding: 18px 18px 10px; font-size: 14px; line-height: 1.55; color: var(--ink); }
  .confirm-body p { margin: 0 0 10px; }
  .confirm-body p:last-child { margin-bottom: 0; }
  .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 18px 18px; flex-wrap: wrap; }

  /* Wide tables scroll horizontally instead of overflowing (mobile + many columns) */
  #pipeline-table, #recent-list { overflow-x: visible; -webkit-overflow-scrolling: touch; }
  .pipe-stages-wrap { display: flex; flex-direction: column; gap: 22px; }
  .pipe-stage-section { margin: 0; }
  .pipe-stage-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
  }
  .pipe-stage-count {
    font-size: 12px; font-weight: 700; color: var(--mid-gray); background: #eef1f1;
    border-radius: 999px; padding: 2px 10px; line-height: 1.5;
  }
  .pipe-stage-empty .pipe-stage-head { opacity: 0.72; margin-bottom: 0; }
  .pipe-stage-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0; border: none; background: none;
    cursor: pointer; color: var(--mid-gray); border-radius: 5px; flex-shrink: 0;
  }
  .pipe-stage-toggle:hover { background: #eef1f1; }
  .pipe-stage-chevron { font-size: 12px; line-height: 1; }
  .pipe-stage-collapsed .pipe-stage-head { margin-bottom: 0; }
  .pipe-stage-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pipe-stage-table { table-layout: fixed; width: 100%; }
  .pipe-stage-table td { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #disc-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #disc-table table { table-layout: fixed; }
  #disc-table td:not(.disc-actions) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .settings-pop { width: min(320px, calc(100vw - 28px)); }

  /* Reorder (drag header) + resize (drag right edge) */
  th.col-h { position: relative; }
  th.col-h[draggable="true"] { cursor: grab; }
  th.col-h .col-h-label { display: inline-flex; align-items: center; gap: 4px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; }
  th.col-h.col-dragging { opacity: .45; }
  th.col-h.drop-target { box-shadow: inset 3px 0 0 var(--bright-orange); }
  .col-resize { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; }
  .col-resize:hover { background: var(--bright-orange); opacity: .35; }
  body.col-resizing { cursor: col-resize; }

  /* Mobile-friendly tweaks */
  @media (max-width: 640px) {
    .wrap { padding: 14px 12px 48px; }
    .topbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
    .topbar .brand { font-size: 15px; line-height: 1.25; }
    .topbar .brand small { font-size: 9px; letter-spacing: .06em; }
    .topbar .who { display: none; }
    .topbar-actions { gap: 6px; }
    .topbar-actions .btn-sm { padding: 8px 12px; font-size: 13px; }
    .tabs { padding: 0 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { padding: 12px 14px; font-size: 13px; white-space: nowrap; min-height: 44px; }
    h2 { font-size: 19px; margin-bottom: 10px; }
    .card { padding: 14px 12px; border-radius: 10px; margin-bottom: 12px; }
    th, td { padding: 8px 9px; font-size: 13px; }
    .modal-back { padding: 0; align-items: stretch; overflow: hidden; }
    .modal, .modal.modal-wide {
      max-width: 100%; width: 100%; min-height: 100vh; max-height: 100vh; border-radius: 0;
      display: flex; flex-direction: column; overflow: hidden;
    }
    .modal header { padding: 14px 16px; flex-shrink: 0; }
    .modal header h2 { font-size: 17px; line-height: 1.2; }
    .modal header .m-head-main { width: 100%; }
    .m-stage-menu { min-width: min(240px, 88vw); max-height: min(280px, 42vh); }
    .admin-stage-row { grid-template-columns: 1fr; gap: 8px; }
    .admin-stage-preview { justify-self: start; }
    .admin-shell { flex-direction: column; }
    .admin-nav {
      width: 100%; border-right: 0; border-bottom: 1px solid var(--line);
      display: flex; flex-direction: row; overflow-x: auto; padding: 8px 10px; gap: 6px;
      flex-shrink: 0;
    }
    .admin-nav-btn { white-space: nowrap; width: auto; flex-shrink: 0; margin-bottom: 0; padding: 9px 12px; font-size: 12px; }
    .admin-panels { padding: 16px; }
    .admin-grid-2 { grid-template-columns: 1fr; }
    .admin-scroll-panel { max-height: none; }
    .m-glance { grid-template-columns: repeat(2, 1fr); padding: 10px 14px 8px; gap: 8px; }
    .m-glance-card { min-height: 72px; padding: 11px 28px 11px 12px; }
    .m-glance-card .g-label { font-size: 9px; }
    .m-glance-card .g-val { font-size: 13px; }
    .m-glance-card-clickable::after { right: 8px; font-size: 18px; }
    .m-pipeline-track { padding: 12px 14px 4px; }
    .m-pipeline-label { font-size: 9px; }
    #m-body {
      display: flex; flex-direction: column; flex: 1; min-height: 0;
      overflow: hidden; padding: 0;
    }
    #m-body.m-mobile-compact .m-pipeline-track { display: none; }
    #m-body.m-mobile-compact .m-layout { display: none; }
    #m-body.m-mobile-compact > .m-activity { display: none !important; }
    #m-body.m-mobile-compact .m-profile-pane {
      flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    #m-body.m-mobile-compact .m-mobile-hint { display: block; }
    #m-body.m-pane-profile .m-activity { display: none; }
    #m-body.m-pane-activity .m-profile-pane { display: none; }
    .m-mobile-tabs {
      display: flex; flex-shrink: 0; background: #f6f9fa;
      border-bottom: 1px solid var(--line); padding: 8px 10px; gap: 8px;
    }
    .m-mobile-tab {
      flex: 1; padding: 10px 12px; min-height: 44px; border-radius: 10px;
      border: 1px solid var(--line); background: #fff; font-weight: 700;
      font-size: 14px; font-family: inherit; color: var(--mid-gray); cursor: pointer;
    }
    .m-mobile-tab.active { background: var(--teal); color: #fff; border-color: var(--teal); }
    .m-layout { flex-direction: column; margin: 0; min-height: 0; flex: 1; overflow: hidden; }
    .m-main, .m-workspace, .m-activity {
      flex: 1; min-height: 0; max-height: none; overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .m-main { padding: 14px 16px; max-width: none; min-width: 0; }
    .m-workspace {
      padding: 14px 16px; border-left: 0; border-right: 0;
      border-top: 1px solid var(--line); background: #fff;
    }
    .m-activity {
      width: 100%; border-left: 0; border-top: 0;
      display: flex; flex-direction: column;
    }
    .m-act-head { padding: 12px 16px; font-size: 15px; flex-shrink: 0; }
    .m-act-filters { padding: 10px 12px; gap: 8px; flex-shrink: 0; }
    .m-act-filter { font-size: 13px; padding: 8px 14px; min-height: 36px; }
    .m-act-timeline {
      flex: 1; min-height: 0; overflow-y: auto;
      padding: 12px 16px; -webkit-overflow-scrolling: touch;
    }
    .m-act-item { font-size: 15px; margin-bottom: 16px; }
    .m-act-badge { font-size: 11px; padding: 3px 8px; }
    .m-act-time { font-size: 12px; }
    .m-act-body { padding: 12px 14px; font-size: 15px; line-height: 1.55; }
    .m-act-subj { font-size: 15px; margin-bottom: 6px; }
    .m-act-meta { font-size: 12px; margin-top: 6px; }
    .m-act-compose-wrap { flex-shrink: 0; border-top: 1px solid var(--line); background: #fff; }
    .m-act-compose-wrap > summary {
      display: flex; align-items: center; gap: 8px;
      padding: 14px 16px; font-weight: 800; font-size: 14px; color: var(--teal);
      cursor: pointer; list-style: none; user-select: none; justify-content: flex-start;
    }
    .m-act-compose-wrap > summary::before {
      width: 22px; height: 22px; font-size: 16px;
    }
    .m-act-compose { padding: 0 14px 14px; border-top: 0; }
    .m-act-compose-hint { display: none; }
    .m-act-tab { font-size: 13px; padding: 10px 8px; min-height: 44px; }
    .m-act-compose-pane input, .m-act-compose-pane select, .m-act-compose-pane textarea { font-size: 16px; }
    .m-act-compose-pane textarea { min-height: 88px; }
    .m-act-pop-btn { font-size: 12px; padding: 6px 12px; min-height: 32px; }
    .act-pop-back { padding: 0; align-items: flex-end; }
    .app-pop-back { padding: 0; align-items: flex-end; }
    .app-pop-back .act-pop { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
    .act-pop { width: 100%; max-height: 96vh; border-radius: 16px 16px 0 0; }
    .act-pop-timeline { padding: 14px 16px; min-height: 200px; }
    .act-pop-compose { max-height: 52%; padding: 0 16px 14px; }
    .act-pop-back .m-act-item { font-size: 15px; }
    .act-pop-back .m-act-body { font-size: 15px; padding: 12px 14px; }
    .m-interview-notes textarea { font-size: 16px; min-height: 100px; }
    .mobile-sheet-back { padding: 0; align-items: flex-end; }
    .mobile-sheet-back .act-pop { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
    .mobile-sheet-body { padding: 14px 16px 20px; }
    .mobile-sheet-body .grade-trait-row {
      grid-template-columns: minmax(0, 1fr) minmax(76px, 92px); gap: 8px;
    }
    .mobile-sheet-body .grade-trait-wt { display: none; }
    .mobile-sheet-body .grade-trait-row select { width: 100%; min-height: 44px; font-size: 16px; }
    .mobile-sheet-body .m-ref-grid { grid-template-columns: 1fr; }
    .mobile-sheet-body .m-app-view-btn { min-height: 48px; }
    .modal .body { padding: 16px; }
    .kv { grid-template-columns: 96px 1fr; gap: 4px 10px; font-size: 13px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
    .stat { padding: 13px; }
    .stat .num { font-size: 24px; }
    .stat .lbl { font-size: 11px; }
    .cell-ellip { max-width: 140px; }
    .pipe-subtabs { gap: 6px; margin-bottom: 12px; }
    .pipe-subtab { flex: 1; text-align: center; padding: 10px 10px; font-size: 13px; min-height: 44px; }
    .pipe-subtab-badge { font-size: 11px; padding: 2px 8px; }
    .mail-toolbar, #pipe-toolbar, #pipe-batch-bar {
      flex-direction: column; align-items: stretch; gap: 8px;
    }
    .pipe-toolbar-filters {
      display: flex; flex-direction: column; gap: 8px; width: 100%;
    }
    .pipe-toolbar-spacer { display: none; }
    .pipe-toolbar-actions {
      display: flex; gap: 8px; width: 100%;
    }
    .pipe-toolbar-actions .btn { flex: 1; min-height: 44px; font-size: 14px; }
    .pipe-card { padding: 16px; border-radius: 14px; }
    .pipe-card-name { font-size: 18px; }
    .pipe-card-email { font-size: 16px; }
    .pipe-card-line { font-size: 15px; }
    .pipe-card-sel input { width: 22px; height: 22px; }
    #pipeline-table.pipe-cards-mode { overflow: visible; margin: 0; }
    .draft-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .draft-toolbar input, .draft-toolbar select { max-width: none !important; width: 100%; font-size: 16px; }
    .ref-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .ref-toolbar input, .ref-toolbar select { max-width: none !important; width: 100%; font-size: 16px; }
    .m-ref-card-actions .btn { min-height: 40px; }
    .draft-table-wrap { margin: 0 -4px; }
    .draft-notes { max-width: none; }
    .mail-toolbar input, #pipe-toolbar input, #pipe-toolbar select,
    #pipe-batch-bar select, #disc-search {
      max-width: none !important; width: 100%; font-size: 16px;
    }
    .mail-toolbar .mail-filter, .mail-toolbar .mail-read-filter,
    #pipe-batch-bar .btn, .mail-toolbar .btn {
      min-height: 40px; font-size: 12px; padding: 8px 12px;
    }
    #pipe-toolbar .pipe-toolbar-actions .btn {
      min-height: 44px; font-size: 14px; flex: 1;
    }
    .mail-filter-row, .mail-read-row {
      display: flex; gap: 6px; flex-wrap: wrap; width: 100%;
    }
    .mail-toolbar-actions {
      display: flex; gap: 8px; width: 100%;
    }
    .mail-toolbar-actions .btn { flex: 1; min-height: 40px; }
    .mail-toolbar > span[style*="width:1px"] { display: none; }
    .mail-read-toggle {
      min-width: 44px; min-height: 44px; font-size: 20px;
      display: inline-flex; align-items: center; justify-content: center;
      margin: -10px -8px -10px 0; flex-shrink: 0;
    }
    .mail-card { padding: 16px; }
    .toast {
      left: 12px; right: 12px; transform: none; bottom: 16px;
      border-radius: 12px; font-size: 14px; padding: 12px 16px; text-align: center;
      line-height: 1.35;
    }
    select, input[type=text], input[type=email], input[type=password], textarea { font-size: 16px; }
    .btn { min-height: 44px; padding: 10px 16px; }
    .btn-sm { min-height: 40px; padding: 8px 12px; font-size: 13px; }
    .m-sect > summary { padding: 14px; font-size: 15px; min-height: 44px; }
    #pipeline-table, #recent-list, #disc-table { margin: 0 -4px; }
    .settings-pop.open {
      position: fixed; top: 72px; left: 12px; right: 12px; bottom: 12px;
      width: auto; max-height: none; z-index: 210;
    }
  }
