/* CORE 3.2 people workstream: combobox, role colours and the role editor, reporting lines, org chart lines for
   several managers, and the HR home, record and time-off pages. Tokens from app.css only; light and dark. */

/* ================================================================ combobox (the list belongs to its text box) */
.cbx { position: relative; min-width: 0; width: 100%; }
.cbx > .cbx-input { padding-right: 38px; }
.cbx-select > .cbx-input { cursor: text; text-overflow: ellipsis; }
.cbx-native { display: none !important; }
.cbx-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 34px; display: grid; place-items: center;
  border: 0; border-radius: 0 9px 9px 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.cbx-toggle::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.cbx.open .cbx-toggle::before { transform: translateY(2px) rotate(225deg); }
.cbx-toggle:hover { color: var(--text); }
.cbx.open > .cbx-input { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring);
  border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cbx.open.up > .cbx-input { border-radius: 0 0 10px 10px; }
.cbx-list { position: absolute; left: 0; right: 0; top: calc(100% - 1px); z-index: 60; margin: 0; padding: 4px;
  list-style: none; max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--text); border: 1px solid var(--focus-ring);
  box-shadow: 0 0 0 1px var(--focus-ring), var(--shadow-2); border-radius: 0 0 10px 10px; clip-path: inset(0 -4px -40px -4px); }
.cbx.up .cbx-list { top: auto; bottom: calc(100% - 1px); border-radius: 10px 10px 0 0; clip-path: inset(-40px -4px 0 -4px); }
.cbx-list[hidden] { display: none; }
.cbx-list::before { content: ""; display: block; height: 1px; margin: -4px 8px 4px; background: var(--border); }
.cbx.up .cbx-list::before { display: none; }
.cbx-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label tick" "hint tick";
  align-items: center; column-gap: 8px; min-height: 36px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  font-size: 14px; line-height: 1.35; }
.cbx-option .cbx-label { grid-area: label; min-width: 0; overflow-wrap: anywhere; }
.cbx-option .cbx-hint { grid-area: hint; color: var(--muted); font-size: 12.5px; font-weight: 400; overflow-wrap: anywhere; }
.cbx-option .cbx-tick { grid-area: tick; }
.cbx-option mark { background: transparent; color: inherit; font-weight: 700; text-decoration: underline;
  text-decoration-color: var(--accent); text-underline-offset: 3px; }
.cbx-option:hover { background: var(--surface-2); }
.cbx-option.active { background: var(--accent-soft); color: var(--text); outline: 1px solid var(--accent); outline-offset: -1px; }
.cbx-option.is-current { font-weight: 600; }
.cbx-tick { flex: none; width: 10px; height: 6px; border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text);
  transform: rotate(-45deg) translateY(-2px); }
.cbx-option[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.cbx-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cbx-empty { padding: 10px; color: var(--muted); font-size: 13.5px; }
@media (forced-colors: active) { .cbx-option.active { outline: 2px solid Highlight; } }

/* ================================================================ reporting lines on the profile (tidy rows) */
.pm-list { list-style: none; margin: 0; padding: 0; }
.pm-row { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); }
.pm-row:first-child { border-top: 0; }
.pm-row.is-open { background: var(--surface-2); }
.pm-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who edit" "tags edit";
  align-items: center; gap: 6px var(--s3); min-height: 44px; }
.pm-head .pp-person { grid-area: who; min-width: 0; }
.pm-tags { grid-area: tags; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 48px; }
.pm-head .pm-edit { grid-area: edit; }
.pm-panel legend { padding: 0; }
.pm-tags .pc-handles { margin-top: 0; }
.pm-edit { flex: none; }
.pm-panel { margin-top: var(--s3); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); display: grid; gap: var(--s4); }
.pm-panel-foot { margin: 0 var(--s5) var(--s5); }
.pm-panel-title { font-size: 14px; margin: 0; }
.pm-panel > p { margin: 0; }
.pm-form { margin: 0; }
.pm-checks { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.pm-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.pm-split .reason-line { margin: 0; }
.pm-dotted { padding: var(--s3) var(--s5) 0; border-top: 1px solid var(--border); }
.pm-dotted .divider-label { margin: 0 0 var(--s2); }
.pm-dotted-list { list-style: none; margin: 0; padding: 0 0 var(--s3); display: grid; gap: 6px; font-size: 14px; }
.pm-dotted-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pm-remove { padding: 0; border-top: 1px solid var(--border); }
.pm-rm-row { display: flex; align-items: center; gap: var(--s3); width: 100%; padding-top: var(--s2); font-size: 14px; }
.pm-actions { display: flex; flex-wrap: wrap; gap: var(--s2); padding: var(--s4) var(--s5); border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.pm-actions:has(+ .pm-panel) { border-radius: 0; margin-bottom: var(--s4); }
.pm-actions .btn { gap: 6px; }
.pm-actions .btn.is-on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
@media (max-width: 600px) {
  .pm-row { padding: var(--s3) var(--s4); }
  .pm-actions { padding: var(--s3) var(--s4); }
  .pm-actions .btn { flex: 1 1 100%; justify-content: flex-start; }
  .pm-panel-foot { margin: 0 var(--s4) var(--s4); }
  .pm-tags { padding-left: 0; }
}

/* ================================================================ org chart: several managers */
.oc-canvas { position: relative; }
.oc-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.oc-line { fill: none; stroke: var(--accent); stroke-width: 1.8; opacity: .7; }
.oc-line-end { fill: var(--accent); opacity: .85; }
.oc-line.hl { stroke-width: 2.4; opacity: 1; }
.oc-lines-on .oc-card, .oc-lines-on .oc-branch > summary { z-index: 1; }
.oc-line-key { display: inline-block; flex: none; width: 16px; border-top: 1.5px solid var(--border-strong); vertical-align: middle; }
.oc-line-key.extra { border-top: 2px solid var(--accent); }
.oc-legend-line.extra { border-top: 2px solid var(--accent); }
.oc-mgrs { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; }
.oc-mgrs-k { display: block; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.oc-mgrs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.oc-mgrs li { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); }
.oc-mgr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-mgr-tag { margin-left: auto; flex: none; font: 600 10.5px/1 var(--font); padding: 3px 6px; border-radius: 5px;
  background: var(--surface-3); color: var(--text-2); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-mgrs li.primary .oc-mgr-tag { background: var(--accent-soft); color: var(--accent-text); }
.oc-card.linked { border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); box-shadow: none; }
.oc-linked-note { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); font-size: 11.5px; color: var(--text-2); }
.oc-linked-note > span { display: flex; align-items: center; gap: 6px; }
.oc-jump { font-weight: 600; font-size: 11.5px; min-height: 24px; display: inline-flex; align-items: center; }
.oc-children > .oc-node.oc-sec::after { border-left: 2px solid var(--accent); }
.oc-card.oc-hl { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.oc-tools .btn[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); }

/* ================================================================ role colours: one chip everywhere */
.role-chip { --role-c: var(--muted); display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 8px;
  border-radius: 999px; font: 600 12.5px/1 var(--font); color: var(--text); white-space: nowrap; max-width: 100%;
  background: color-mix(in srgb, var(--role-c) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--role-c) 38%, var(--border)); }
.role-chip::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--role-c); }
.role-chip.big { height: 30px; padding: 0 12px 0 10px; font-size: 14px; }
.role-chip.no-colour::before { background: repeating-linear-gradient(45deg, var(--surface-3) 0 2px, var(--border-strong) 2px 4px); }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
:root[data-theme="dark"] .role-chip { background: color-mix(in srgb, var(--role-c) 26%, var(--surface)); border-color: color-mix(in srgb, var(--role-c) 55%, var(--border)); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .role-chip { background: color-mix(in srgb, var(--role-c) 26%, var(--surface)); border-color: color-mix(in srgb, var(--role-c) 55%, var(--border)); } }
:root[data-theme="dark"] .role-chip::before { box-shadow: 0 0 0 1.5px color-mix(in srgb, #fff 55%, var(--role-c)); }

/* colour picker in the role builder */
.rb-colours { display: grid; gap: var(--s2); }
.rb-colours legend { display: inline-flex; align-items: center; gap: 6px; float: left; width: 100%; padding: 0; margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.rb-colours legend + .hint { margin-top: -2px; }
.rc-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rb-swatch > span:not(.sr-only) { width: 30px; height: 30px; }
.rb-swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.rc-custom { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--control-border);
  border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.rc-custom input { margin: 0; accent-color: var(--accent); }
.rc-custom:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.rc-colour-input { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--control-border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.rc-preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border); }

/* ================================================================ role builder: permission groups */
.rb-cats { display: grid; gap: var(--s4); }
.rb-cat { position: relative; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  min-width: 0; overflow: hidden; }
.rb-cat-legend { float: left; width: 100%; display: flex; align-items: center; gap: var(--s2); margin: 0; padding: var(--s3) var(--s4);
  padding-right: 230px; min-height: 52px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rb-cat-legend + * { clear: both; }
.rb-cat-name { font: 600 11.5px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.rb-cat-legend .rb-cat-count { font: 600 12px/1 var(--font); padding: 4px 8px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2); letter-spacing: 0; text-transform: none; }
.rb-cat-head { position: absolute; top: 9px; right: var(--s3); }
.rb-cat-tools { display: inline-flex; margin: 0; border: 1px solid var(--control-border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.rb-tool { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border: 0; background: transparent;
  font: 600 12.5px/1 var(--font); color: var(--text-2); cursor: pointer; }
.rb-tool + .rb-tool { border-left: 1px solid var(--border-strong); }
.rb-tool:hover { background: var(--accent-soft); color: var(--accent-text); }
.rb-tool:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.rb-cat > .rb-perm { display: flex; margin: 0; padding: 10px var(--s4); border-top: 1px solid var(--border); }
.rb-cat > .rb-cat-legend + .rb-cat-head + .rb-perm { border-top: 0; }
.rb-cat > .rb-perm:hover { background: var(--surface-2); }
.rb-cat > .rb-perm:has(input:checked) { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
@media (max-width: 600px) {
  .rb-cat-legend { padding-right: var(--s4); }
  .rb-cat-head { position: static; padding: var(--s2) var(--s4) 0; }
  .rb-cat-tools { width: 100%; }
  .rb-tool { flex: 1 1 50%; justify-content: center; }
}

/* the sticky save bar: always visible, says how many changes wait */
.rb-savebar { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s2) var(--s4);
  bottom: var(--s3) !important; padding: var(--s3) var(--s4) !important; border-radius: var(--r-lg) !important;
  box-shadow: 0 10px 30px -10px rgba(23, 19, 42, .35) !important; }
.rb-savebar.has-changes { border-color: var(--accent) !important; }
.rb-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); min-width: 0; }
.rb-pending-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex: none; }
.has-changes .rb-pending-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rb-pending-count { font-weight: 600; }
.rb-pending-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-text); min-height: 24px; display: inline-flex; align-items: center; }
.rb-pending-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 4px; max-height: 180px; overflow-y: auto; font-size: 13px; }
.rb-pending-list li { display: flex; align-items: center; gap: 6px; }
.rb-pend-sign { width: 14px; font-weight: 700; text-align: center; }
.rb-pending-list .add .rb-pend-sign { color: var(--good); }
.rb-pending-list .remove .rb-pend-sign { color: var(--danger); }
.rb-save-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; }
.rb-save-actions [hidden] { display: none; }
.rb-save-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) {
  .rb-savebar { grid-template-columns: minmax(0, 1fr); bottom: calc(var(--tabbar-h, 0px) + var(--s2)) !important; }
  .rb-save-actions { justify-content: stretch; }
  .rb-save-actions .btn { flex: 1 1 auto; }
}

/* approve changes: the summary */
.rb-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.rb-sum li { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border); }
.rb-sum-n { font-weight: 700; }
.rb-sum .add { background: var(--good-soft); color: var(--good); border-color: transparent; }
.rb-sum .remove { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.rb-sum .sensitive { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.rb-sum .owner { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.rb-diff { list-style: none !important; padding: 0 !important; gap: 0 !important; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.rb-diff li { display: flex; align-items: center; gap: var(--s2); padding: 8px var(--s3); border-top: 1px solid var(--border); }
.rb-diff li:first-child { border-top: 0; }
.rb-diff li::marker { content: none !important; }
.rb-diff-sign { width: 16px; font-weight: 700; text-align: center; flex: none; }
.rb-diff.add .rb-diff-sign { color: var(--good); }
.rb-diff.remove .rb-diff-sign { color: var(--danger); }
.rb-diff li.is-sensitive { background: var(--warn-soft); }
.rb-who { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3); border-radius: var(--r-sm); background: var(--surface-2); }
.rb-who p { margin: 0; }
.rb-who .icon { flex: none; margin-top: 2px; color: var(--accent-text); }

/* ================================================================ HR home dashboard */
.hr-attn .card-head .status { margin-left: auto; }
.hr-attn-kinds { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--s3) var(--s5); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.hr-kind { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.hr-kind strong { color: var(--text); }
.hr-kind.none { opacity: .7; }
.hr-kind .icon { color: var(--accent-text); }
.hr-due { list-style: none; margin: 0; padding: 0; }
.hr-due-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  padding: 10px var(--s5); border-top: 1px solid var(--border); }
.hr-due > .hr-due-row:first-child { border-top: 0; }
.hr-date { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); line-height: 1; }
.hr-date-d { font: 700 16px/1 var(--font); }
.hr-date-m { font: 600 10px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: -6px; }
.hr-due-row.overdue .hr-date { background: var(--danger-soft); border-color: transparent; }
.hr-due-row.overdue .hr-date-d { color: var(--danger); }
.hr-due-link { display: flex; align-items: center; gap: var(--s3); min-width: 0; color: var(--text); }
.hr-due-link:hover { text-decoration: none; }
.hr-due-link:hover .title { color: var(--accent-text); }
.hr-due-more > summary { padding: 10px var(--s5); border-top: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-text); }
.hr-due-more .hr-due > .hr-due-row:first-child { border-top: 1px solid var(--border); }

.hr-chart-legend { display: flex; gap: var(--s4); font-size: 12.5px; color: var(--text-2); }
.hr-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hr-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hr-key.join, .hr-bar.join { background: var(--accent); }
.hr-key.leave, .hr-bar.leave { background: var(--neutral); }
.hr-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; height: 180px; padding-bottom: 20px; position: relative; }
.hr-col { position: relative; display: grid; grid-template-rows: 1fr 1fr; align-items: stretch; border-radius: 6px; }
.hr-col:hover { background: var(--surface-2); }
.hr-up, .hr-down { display: flex; flex-direction: column; align-items: center; min-height: 0; }
.hr-up { justify-content: flex-end; border-bottom: 1px solid var(--border-strong); }
.hr-down { justify-content: flex-start; }
.hr-bar { width: min(16px, 60%); min-height: 0; }
.hr-bar.join { border-radius: 4px 4px 0 0; }
.hr-bar.leave { border-radius: 0 0 4px 4px; }
.hr-n { font: 600 11px/1.4 var(--font); color: var(--text-2); }
.hr-month { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.hr-table-view > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-text); min-height: 24px; }
.hr-table-view .table-wrap { margin-top: var(--s2); }
.hr-soon { gap: var(--s4); }
.hr-mini { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 6px; }
.hr-mini li { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.hr-mini a { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); font-weight: 500; }

.hr-life-all > summary { cursor: pointer; list-style: none; }
.hr-life-all > summary::-webkit-details-marker { display: none; }
.hr-life-all:not([open]) > summary { border-bottom: 0; }
.hr-life-all > .card-body { padding-top: var(--s4); }
.hr-life-all .hr-life-grid { margin: 0; }

.hr-board-row { display: grid !important; grid-template-columns: minmax(0, 1fr) 72px; align-items: center; gap: var(--s3); }
.hr-progress { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hr-progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.hr-ins-figs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: 0; }
.hr-ins-figs > div { padding: var(--s3); border-radius: var(--r-sm); background: var(--surface-2); }
.hr-ins-figs dt { font-size: 12px; color: var(--muted); }
.hr-ins-figs dd { margin: 2px 0 0; font: 700 20px/1.2 var(--font-display); }
.hr-bars { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 6px; }
.hr-bars li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 24px; align-items: center; gap: var(--s2); font-size: 12.5px; }
.hr-bars-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hr-bars-t { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hr-bars-t > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.hr-bars-n { text-align: right; font-weight: 600; }
.hr-mix { gap: var(--s4); }
.hr-mix-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.hr-mix-list li { display: flex; justify-content: space-between; gap: var(--s2); }
@media (max-width: 600px) {
  .hr-due-row { grid-template-columns: 40px minmax(0, 1fr); padding: 10px var(--s4); }
  .hr-due-row > .status { grid-column: 2; justify-self: start; }
  .hr-attn-kinds { padding: var(--s3) var(--s4); }
  .hr-chart { height: 150px; }
  .hr-month { font-size: 10px; }
}
.hr-due-link .hr-row-text .title { font-weight: 600; }
.hr-due-sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ================================================================ team time off */
.to-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.to-month { display: flex; align-items: center; gap: var(--s2); }
.to-month-name { font-size: 18px; margin: 0 var(--s2); min-width: 150px; text-align: center; }
.to-filter { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.to-filter .input, .to-filter .cbx { width: 220px; max-width: 100%; }
.to-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-bottom: var(--s3); font-size: 12.5px; color: var(--text-2); }
.to-legend span { display: inline-flex; align-items: center; gap: 6px; }
.to-key { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--border); }
.to-key.leave, .to-cell.leave { background: var(--accent); }
.to-key.other, .to-cell.other { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.to-key.pending, .to-cell.pending { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, transparent) 0 3px, transparent 3px 6px); }
.to-key.sick, .to-cell.sick { background: var(--warn); }
.to-key.off { background: var(--surface-3); }
.to-card { overflow: hidden; }
.to-scroll { overflow-x: auto; position: relative; }   /* keeps the sr-only labels in cells inside the scroller */
.to-scroll:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.to-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.to-grid th, .to-grid td { border-bottom: 1px solid var(--border); padding: 0; }
.to-who { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 6px var(--s3) !important;
  min-width: 190px; max-width: 220px; border-right: 1px solid var(--border); font-weight: 400; }
.to-who a { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; min-width: 0; }
.to-who a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-team { display: block; font-size: 11px; color: var(--muted); padding-left: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.to-day { min-width: 26px; text-align: center; padding: 6px 0 !important; font-weight: 600; color: var(--text-2); }
.to-dow, .to-dn { display: block; line-height: 1.2; }
.to-dow { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.to-day.today .to-dn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
.to-cell { height: 40px; min-width: 26px; border-left: 1px solid color-mix(in srgb, var(--border) 60%, transparent); background-clip: padding-box; }
.to-cell.off:not(.leave):not(.other):not(.sick):not(.pending) { background: var(--surface-2); }
.to-cell.today { box-shadow: inset 2px 0 0 var(--accent-text), inset -2px 0 0 var(--accent-text); }
.to-count { height: 30px; text-align: center; font-weight: 600; color: var(--text-2); }
.to-count.busy { color: var(--warn); }
.to-sum { text-align: center; min-width: 44px; font-weight: 600; padding: 0 6px !important; }
.to-grid tbody tr:hover .to-who, .to-grid tbody tr:hover td:not(.leave):not(.other):not(.sick):not(.pending) { background: var(--surface-2); }
.to-grid tfoot th, .to-grid tfoot td { border-bottom: 0; background: var(--surface-2); }
@media (max-width: 600px) { .to-who { min-width: 140px; } .to-team { display: none; } .to-month-name { min-width: 0; font-size: 16px; } }

/* ================================================================ HR record */
.hr-rec-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s6); margin-bottom: var(--s4); padding: var(--s3) var(--s4);
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.hr-rec-who { display: flex; align-items: center; gap: var(--s3); color: var(--text); min-width: 0; }
.hr-rec-who:hover { text-decoration: none; }
.hr-rec-who > span { display: flex; flex-direction: column; }
.hr-rec-name { font-weight: 600; }
.hr-rec-sub { font-size: 12.5px; color: var(--accent-text); }
.hr-rec-facts { flex: 1 1 420px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2) var(--s4); margin: 0; }
.hr-rec-facts dt { font-size: 12px; color: var(--muted); }
.hr-rec-facts dd { margin: 2px 0 0; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.hr-contracts { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: 6px; }
.hr-contracts a { display: flex; align-items: center; gap: var(--s2); padding: 8px var(--s3); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); }
.hr-contracts a:hover { border-color: var(--accent); text-decoration: none; }
.hr-contracts .grow { display: flex; flex-direction: column; min-width: 0; }
.hr-contracts .title { font-weight: 600; }
.hr-contact-more { position: relative; padding-right: 44px; }
.hr-contact-rm { position: absolute; top: 6px; right: 6px; }
/* one tidy menu instead of loose links with uneven gaps */
.hr-menu { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.hr-menu-item > summary, details.hr-menu-item > summary { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3);
  cursor: pointer; list-style: none; font-weight: 600; color: var(--accent-text); }
.hr-menu-item > summary::-webkit-details-marker { display: none; }
.hr-menu-item > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.hr-menu-item[open] > summary::after { transform: rotate(225deg); }
.hr-menu > .hr-menu-item + .hr-menu-item { border-top: 1px solid var(--border); }
.hr-menu-item[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.hr-menu-item > form { padding: var(--s3); }
.card-body > details.hr-menu-item, .stack > details.hr-menu-item { border: 1px solid var(--border); border-radius: var(--r); }
.hr-pad { margin: 0 var(--s5) var(--s5); border: 1px solid var(--border); border-radius: var(--r); }
.hr-doc-exp > summary { cursor: pointer; font-size: 12.5px; color: var(--accent-text); margin-top: 4px; min-height: 24px; display: inline-flex; align-items: center; }
.hr-doc-exp .reason-line { margin-top: 6px; max-width: 320px; }
.hr-assets .hr-asset-back > summary { list-style: none; }
.hr-assets .hr-asset-back[open] { flex-basis: 100%; }
.hr-assets li { flex-wrap: wrap; }
.hr-asset-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.hr-asset-returned .hr-asset-icon { background: var(--surface-3); color: var(--muted); }
.hr-asset-returned .title { color: var(--text-2); }
.hr-big { font: 700 28px/1.1 var(--font-display); margin: 0; }
.hr-leave-bar { display: flex; height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; gap: 2px; }
.hr-leave-bar span { display: block; height: 100%; }
.hr-leave-bar .taken, .hr-key.taken { background: var(--accent); }
.hr-leave-bar .booked, .hr-key.booked { background: color-mix(in srgb, var(--accent) 50%, var(--surface)); }
.hr-leave-bar .pending, .hr-key.pending { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, transparent) 0 3px, transparent 3px 6px); border: 1px solid var(--border); }
.hr-leave-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: 0; }
.hr-leave-figs dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.hr-leave-figs dd { margin: 2px 0 0; font: 700 20px/1.2 var(--font-display); }
@media (max-width: 600px) { .hr-leave-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hr-timeline { list-style: none; margin: 0; padding: var(--s4) var(--s5) var(--s5); position: relative; }
.hr-timeline::before { content: ""; position: absolute; left: calc(var(--s5) + 15px); top: var(--s5); bottom: var(--s5); border-left: 2px solid var(--border); }
.hr-tl-year { position: relative; margin: var(--s3) 0 var(--s2); }
.hr-tl-year span { position: relative; display: inline-block; padding: 3px 10px; margin-left: 0; border-radius: 999px; background: var(--surface-3);
  font: 700 12px/1.3 var(--font); color: var(--text-2); }
.hr-tl-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--s3); padding: 8px 0; }
.hr-tl-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-2); }
.hr-tl-item.kind-start .hr-tl-dot, .hr-tl-item.kind-pay .hr-tl-dot { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.hr-tl-item.kind-absence .hr-tl-dot { border-color: var(--warn); color: var(--warn); }
.hr-tl-item.future .hr-tl-dot { border-style: dashed; }
.hr-tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s3); padding-top: 5px; }
.hr-tl-date { font-size: 12.5px; color: var(--muted); }
.hr-tl-detail { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }

/* ================================================================ even spacing in People and HR (3.2)
   Lists of facts and benefits had the browser's default top margin on top of the card padding, and the "more"
   disclosures were loose links whose gaps changed with what was open. Now: no stray margins, and every disclosure is
   one row of the same height inside a box. */
.hr-facts, .hr-benefits, .pp-leave, .kv { margin-top: 0; }
details.pp-more, details.hr-more { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 0 !important; }
details.pp-more > summary, details.hr-more > summary { display: flex; width: 100%; box-sizing: border-box; align-items: center; gap: 8px;
  min-height: 44px; margin: 0 !important; padding: 0 var(--s3); font-size: 14px; font-weight: 600; color: var(--accent-text);
  cursor: pointer; list-style: none; border-radius: var(--r); }
details.pp-more > summary::-webkit-details-marker { display: none; }
details.pp-more > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.pp-more[open] > summary::after { transform: rotate(225deg); }
details.pp-more > summary:hover, details.hr-more > summary:hover { background: var(--surface-2); }
details.pp-more[open] > summary, details.hr-more[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--r) var(--r) 0 0;
  background: var(--surface-2); }
details.pp-more > :not(summary), details.hr-more > :not(summary) { margin: var(--s3); }
.oc-add-change .pp-more + .pp-more { padding-top: 0 !important; }
.stack > details.pp-more + details.pp-more, .stack > details.hr-more + details.hr-more,
.stack-sm > details.pp-more + details.pp-more { margin-top: var(--s2); }
.hr-table-scroll { overflow-x: auto; margin-top: var(--s2); }
@media (max-width: 600px) {
  .rb-savebar { grid-template-columns: minmax(0, 1fr) auto !important; gap: 6px var(--s2) !important; padding: 10px var(--s3) !important; }
  .rb-save-note { display: none; }
  .rb-save-actions .btn { flex: none; }
  .rb-pending-count { font-size: 13.5px; }
  .rb-savebar.has-changes .rb-save-actions { grid-column: 1 / -1; }
  .rb-savebar.has-changes .rb-save-actions .btn { flex: 1 1 auto; }
}
