:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e2e5ea;
  --border-strong: #cbd1da;
  --text: #16191f;
  --text-muted: #6b7280;
  --accent: #1f6feb;
  --accent-dark: #1a5fd0;
  --danger: #c0362c;
  --ok: #1a7f4b;

  --box-low: #fdeceb;
  --box-mid: #fdf6e3;
  --box-high: #ebf7ef;
  --box-low-line: #f0c4c0;
  --box-mid-line: #eddfb4;
  --box-high-line: #bfe3cd;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; }
a { color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar__inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; min-height: 58px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.brand__mark--lg { width: 44px; height: 44px; font-size: 14px; border-radius: 10px; margin: 0 auto 16px; }
.brand__name { font-weight: 600; font-size: 15px; }

.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav__link {
  padding: 7px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-muted); font-size: 14px; font-weight: 500;
}
.topnav__link:hover { background: var(--surface-2); color: var(--text); }
.topnav__link.is-active { background: #eaf1fd; color: var(--accent-dark); }

.topbar__user { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

/* ---------- page ---------- */
.page { max-width: 1400px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__sub { margin: 0; color: var(--text-muted); font-size: 14px; }
.page-head__actions { display: flex; align-items: center; gap: 12px; }

.body--centered { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.signin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 40px; max-width: 420px; text-align: center;
}
.signin-card h1 { font-size: 21px; }
.signin-card__lede { color: var(--text-muted); font-size: 14px; margin: 8px 0 24px; }
.signin-card__note { color: var(--text-muted); font-size: 12.5px; margin: 18px 0 0; }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
form.button_to { display: inline; }

.input, .select {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; font-size: 14px; color: var(--text); max-width: 100%;
}
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.select.is-invalid { border-color: var(--danger); outline-color: var(--danger); }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.inline-form { display: inline; }

/* ---------- flashes, tags ---------- */
.flashes { max-width: 1400px; margin: 16px auto 0; padding: 0 24px; display: grid; gap: 8px; }
.flash { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid; }
.flash--notice { background: #ebf7ef; border-color: #bfe3cd; color: #12633a; }
.flash--alert  { background: #fdeceb; border-color: #f0c4c0; color: #93291f; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.tag--hr { background: #eaf1fd; color: var(--accent-dark); }
.tag--done { background: #ebf7ef; color: var(--ok); }
.tag--progress { background: #fdf6e3; color: #8a6d1f; }
.tag--todo { background: #f1f3f6; color: var(--text-muted); }
.tag--locked { background: #f1f3f6; color: var(--text-muted); }

.counter {
  display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 99px;
  background: #f1f3f6; color: var(--text-muted); font-size: 12px; font-weight: 600;
}

/* ---------- progress ---------- */
.progress { display: flex; align-items: center; gap: 10px; }
.progress__bar { width: 130px; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress__bar span { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.progress__label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* ---------- nine box ---------- */
.ninebox { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 22px; gap: 6px; }
.ninebox--readonly { margin-bottom: 28px; }

.ninebox__ylabel, .ninebox__xlabel {
  display: grid; place-items: center; color: var(--text-muted);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.ninebox__ylabel span { writing-mode: vertical-rl; transform: rotate(180deg); }
.ninebox__xlabel { grid-column: 2; }

.ninebox__grid {
  display: grid;
  grid-template-columns: 74px repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(160px, auto)) 22px;
  gap: 8px;
}
.ninebox__rowlabel, .ninebox__collabel {
  display: grid; place-items: center; color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.ninebox__corner { }

/* Tints come from HR's 9_Box_Grid.xlsx, applied per box via --box-tint. */
.box {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  background: var(--box-tint, var(--surface));
  transition: outline-color .12s;
}
.box__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.box__name { font-size: 12.5px; font-weight: 600; }
.box__num {
  display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 99px;
  background: rgba(0, 0, 0, .07); font-size: 10.5px; font-weight: 700;
  letter-spacing: .02em; vertical-align: 1px;
}
.box__share { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.box__count { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-top: auto; }
.box__action { font-size: 11.5px; line-height: 1.35; margin: -2px 0 0; opacity: .75; }
.box__cards { display: grid; gap: 8px; align-content: start; flex: 1; }

.box__info { position: relative; }
.box__info summary {
  list-style: none; cursor: pointer; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .1);
  font-size: 10px; font-weight: 700; font-style: italic;
}
.box__info summary::-webkit-details-marker { display: none; }
.box__info-body {
  position: absolute; right: 0; top: 20px; z-index: 10; width: 250px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 11px; font-size: 12px;
}
.box__info-body p { margin: 0 0 7px; }
.box__info-body ul { margin: 0; padding-left: 16px; }
.box__info-body li { margin-bottom: 3px; }

.gridnote { font-size: 12.5px; color: var(--text-muted); margin: 10px 0 24px; }

/* ---------- movement ---------- */
.move { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.move--up { color: var(--ok); }
.move--down { color: var(--danger); }
.input--sm { padding: 4px 8px; font-size: 12.5px; width: 100%; margin-top: 4px; }
.panel--wide { margin-top: 20px; }

/* ---------- cards ---------- */
.card {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 7px 9px; box-shadow: var(--shadow);
}
.card--static { cursor: default; }
.card__avatar {
  display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px;
  border-radius: 50%; background: #eaf1fd; color: var(--accent-dark);
  font-size: 10.5px; font-weight: 700;
}
.card__body { display: grid; min-width: 0; }
.card__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__role { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__flag { margin-left: auto; color: var(--ok); font-size: 13px; }

/* ---------- tables, panels ---------- */
.listview { margin-top: 32px; }
.listview__hint { color: var(--text-muted); font-size: 13px; margin: -6px 0 14px; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.columns { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }

.table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.panel .table { border: 0; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table__name { font-weight: 600; }
.table__muted { color: var(--text-muted); }
.table__actions { text-align: right; white-space: nowrap; }
.table__actions > * { margin-left: 6px; }

.stacklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stacklist li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }

/* ---------- forms ---------- */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; max-width: 560px; box-shadow: var(--shadow); }
.form__row { display: grid; gap: 5px; margin-bottom: 16px; }
.form__row label { font-size: 13px; font-weight: 600; }
.form__row--check { display: flex; align-items: center; gap: 8px; }
.form__row--check label { font-weight: 400; }
.form__hint { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }
.form__actions { display: flex; gap: 10px; margin-top: 22px; }

.errors { background: #fdeceb; border: 1px solid #f0c4c0; color: #93291f; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }

.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 48px 24px; text-align: center; }
.empty p { color: var(--text-muted); margin: 6px 0 0; }



/* ---------- development sign-in bypass (dev only) ---------- */
.devbox {
  margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--border-strong);
  text-align: left;
}
.devbox h2 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 6px;
}
.devbox p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 12px; }
.devbox__list { display: grid; gap: 6px; }
.devbox__list form { display: block; }
.devbox__list .btn { width: 100%; justify-content: flex-start; }
.devbox__empty { margin-top: 8px; }
.devbox code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ---------- guided assessment ---------- */
.backlink {
  display: inline-block; margin-bottom: 14px; font-size: 13.5px;
  text-decoration: none; color: var(--text-muted);
}
.backlink:hover { color: var(--accent); }

.teamlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.teamcard {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.teamcard__link {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  text-decoration: none; color: var(--text);
}
.teamcard__link:hover { background: var(--surface-2); }
.teamcard--not_started { border-left: 3px solid var(--danger); }
.teamcard--in_progress { border-left: 3px solid #c99a1f; }
.teamcard--complete    { border-left: 3px solid var(--ok); }
.teamcard__body { display: grid; margin-right: auto; min-width: 0; }
.teamcard__name { font-weight: 600; font-size: 15px; }
.teamcard__role { font-size: 12.5px; color: var(--text-muted); }
.teamcard__state { display: grid; justify-items: end; gap: 3px; text-align: right; }
.teamcard__box { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }
.swatch {
  width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px;
  background: var(--box-tint); border: 1px solid rgba(0, 0, 0, .18);
}
.teamcard__go { color: var(--text-muted); font-size: 17px; }

.submitbar {
  margin-top: 22px; padding: 18px; display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.submitbar p { margin: 0; margin-right: auto; font-size: 14px; }

.assess { max-width: 760px; }
.assess__head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 22px;
  padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.assess__head h1 { font-size: 21px; margin: 0; }
.assess__step {
  margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.card__avatar--lg { flex: 0 0 44px; width: 44px; height: 44px; font-size: 14px; }

.assess__prompt {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.assess__prompt h2 { font-size: 19px; margin: 0 0 2px; }
.assess__window {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: 0 0 14px;
}
.assess__question { font-size: 15.5px; line-height: 1.5; margin: 0 0 12px; }
.assess__evidence { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }

.choices { display: grid; gap: 12px; margin-bottom: 18px; }
.choice {
  display: block; position: relative;
  background: var(--level-tint, var(--surface));
  border: 1px solid var(--border-strong); border-left: 4px solid var(--level-line, var(--border-strong));
  border-radius: var(--radius); padding: 16px 18px; cursor: pointer;
  transition: box-shadow .12s, transform .06s;
}
.choice--low      { --level-line: #d64545; }
.choice--moderate { --level-line: #d69e2e; }
.choice--high     { --level-line: #2f8a54; }
.choice:hover { box-shadow: var(--shadow-lg); }
.choice:active { transform: translateY(1px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { box-shadow: 0 0 0 2px var(--level-line); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.choice__head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.choice__num {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--level-line); color: #fff; font-size: 12px; font-weight: 700;
}
.choice__label {
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--level-line);
}
.choice__headline { font-weight: 600; font-size: 15.5px; }
.choice__tick {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
  background: rgba(0, 0, 0, .07); color: transparent;
}
.choice:has(input:checked) .choice__tick { background: var(--level-line); color: #fff; }
.choice__def { display: block; font-size: 13.5px; line-height: 1.5; opacity: .8; margin-bottom: 9px; }
.choice__indicators { margin: 0; padding-left: 17px; font-size: 13px; line-height: 1.55; opacity: .78; }
.choice__indicators li { margin-bottom: 3px; }

.components {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.components h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: 0 0 12px;
}
.components__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .components__grid { grid-template-columns: 1fr; } }
.component {
  display: grid; gap: 4px; padding: 12px 13px;
  background: var(--surface-2); border-radius: var(--radius-sm);
  border-top: 3px solid var(--accent);
}
.component__name { font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.component__desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.components__note { font-size: 12.5px; color: var(--text-muted); margin: 13px 0 0; }

.assess__footnote {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.55;
  margin: 0 0 22px; padding: 12px 14px;
  background: var(--surface-2); border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.assess__actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.assess__note { font-size: 12.5px; color: var(--text-muted); margin-top: 18px; }

.result {
  background: var(--box-tint, var(--surface)); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px;
}
.result__num {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  background: rgba(0, 0, 0, .1); font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
}
.result__name { font-size: 22px; margin: 9px 0 6px; }
.result__summary { font-size: 14px; margin: 0 0 18px; opacity: .85; }
.result__axes { display: flex; gap: 36px; margin: 0; }
.result__axes dt {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .65;
}
.result__axes dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }

.result__actions, .result__movement {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.result__actions h3, .result__movement h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: 0 0 9px;
}
.result__movement h3 { display: flex; align-items: center; gap: 10px; }
.result__priority { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.result__actions ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-muted); }
.result__actions li { margin-bottom: 4px; }
.result__movement p { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; }
.form--inline { background: none; border: 0; box-shadow: none; padding: 0; max-width: none; display: grid; gap: 10px; }
.form--inline .btn { justify-self: start; }
.result__reason { font-size: 14px; margin: 0; }

/* ---------- HR viewing as a manager ---------- */
.viewas {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 24px; font-size: 13.5px;
  background: #fdf6e3; color: #6b5411; border-bottom: 1px solid #eddfb4;
}
.viewas__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: #c99a1f;
}
.viewas span { margin-right: auto; }
.viewas__stop {
  background: #6b5411; color: #fff; border-color: #6b5411; margin-left: auto;
}
.viewas__stop:hover { background: #553f0b; }


.tag--behalf { background: #fdf6e3; color: #6b5411; margin-left: 4px; }

/* A coverage figure that can't be trusted. Loud on purpose: a 0% that means
   "not allowed to ask" must not be read as "no data exists". */
.listview__hint--warn {
  color: var(--text);
  background: #fdf6e3;
  border: 1px solid #e8d9a8;
  border-left: 3px solid #b8912a;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 14px;
}
.listview__hint--warn code { background: rgba(0, 0, 0, 0.06); padding: 1px 4px; border-radius: 3px; }

/* Changes tab: outstanding count in the nav, and what appeared since the last check. */
.topnav__badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.tag--new { background: #eaf1fd; color: var(--accent-dark); margin-left: 6px; }
.changes__head { font-size: 15px; margin: 18px 0 8px; }
.changes__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.table__check { width: 32px; }

/* My grid: teams below the viewer, one colour each, dashed so they read as
   someone else's placements even without colour. */
:root {
  --team-1: #7b5ea7; --team-2: #00897b; --team-3: #d1600f;
  --team-4: #c2185b; --team-5: #3949ab; --team-6: #6d4c41;
}
.card--below {
  border-style: dashed; border-color: var(--team); border-left: 4px solid var(--team);
  background: color-mix(in srgb, var(--team) 7%, var(--surface)); box-shadow: none;
}
.card--below .card__avatar { background: var(--team); color: #fff; }
.card--below .card__role { color: var(--team); font-weight: 600; }
.teamkey { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 12px; font-size: 13.5px; }
.teamkey__item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.teamkey__item--own { cursor: default; font-weight: 600; }
.teamkey__swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--surface); }
.teamkey__swatch--below { border: 2px dashed var(--team); background: color-mix(in srgb, var(--team) 15%, var(--surface)); }
.teamkey__note { flex-basis: 100%; }

/* Notifications bell in the top bar: a count, and a menu of what needs you. */
.bell { position: relative; }
.bell__button {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text);
}
.bell__button::-webkit-details-marker { display: none; }
.bell__button:hover, .bell[open] .bell__button { border-color: var(--accent); color: var(--accent-dark); }
.bell__badge {
  min-width: 18px; padding: 0 5px; border-radius: 9px; background: #d93025; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.bell__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(340px, 90vw);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 6px; display: grid; gap: 2px;
}
.bell__item { display: grid; gap: 2px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 13.5px; }
.bell__item:hover { background: var(--surface-2); }
.bell__item--urgent { border-left: 3px solid #d93025; }

/* The manager's own grid: sent back, waiting, or approved. */
.gridbanner { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left-width: 4px; margin-bottom: 14px; background: var(--surface); }
.gridbanner--returned { border-left-color: #d93025; background: #fdeceb; border-color: #f0c4c0; }
.gridbanner__title { font-size: 17px; margin: 0 0 8px; color: #93291f; }
.gridbanner__note { margin: 0 0 8px; padding: 8px 12px; background: var(--surface); border-radius: var(--radius-sm); font-size: 15px; }
.gridbanner__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.gridbanner .table__muted { margin: 0; }
.progress--returned .progress__bar span { background: #d93025; }
.progress--returned .progress__label { color: #c0392b; font-weight: 600; }
.gridbanner--submitted { border-left-color: #b8912a; background: #fdf6e3; }
.gridbanner--approved { border-left-color: var(--ok); background: #ebf7ef; }
.foldbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* Approve / send back, and HR's unlock: a reveal, then a note. */
.decide { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.decide__back > summary, .unlock > summary { list-style: none; }
.decide__back > summary::-webkit-details-marker, .unlock > summary::-webkit-details-marker { display: none; }
.decide__form, .unlock__form { display: grid; gap: 8px; margin-top: 10px; min-width: min(420px, 100%); }
.unlock { display: inline-block; text-align: left; }
.unlock[open] { display: block; }
.input { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }

/* Foldable panels on the HR overview. */
.fold > .fold__head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.fold > .fold__head::-webkit-details-marker { display: none; }
.fold > .fold__head::before { content: "▸"; color: var(--text-muted); font-size: 13px; transition: transform .15s; }
.fold[open] > .fold__head::before { transform: rotate(90deg); }
.fold > .fold__head h2 { margin: 0; }
.fold[open] > .fold__head { margin-bottom: 12px; }

/* HR overview: a box shows its share, and opens to list who is in it. */
.box--summary { color: inherit; text-decoration: none; cursor: pointer; min-height: 150px; }
.box--summary:hover { outline: 2px solid var(--accent); outline-offset: -1px; }
.box--summary.is-open { outline: 3px solid var(--accent); outline-offset: -2px; }
.box__figure { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.box__percent { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.box__figure .box__count { margin-top: 0; font-size: 13px; }
.card--link { color: inherit; text-decoration: none; }
.card--link:hover { border-color: var(--accent); }

/* Profile: placements over time on a small grid, then the full history. */
.profile { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .profile { grid-template-columns: 1fr; } }
.minigrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.minigrid__box {
  min-height: 64px; padding: 5px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--box-tint, var(--surface)); display: flex; flex-direction: column; gap: 3px;
}
.minigrid__box.is-current { outline: 3px solid var(--accent); outline-offset: -2px; }
.minigrid__num { font-size: 11px; font-weight: 700; opacity: .6; }
.minigrid__mark {
  font-size: 11px; font-weight: 600; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 0 6px; align-self: flex-start;
}

/* Chain of command: an org tree whose columns line up at every depth —
   who, placed, grid state, where it goes. Rows open to show the team. */
.chainstats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chainstat {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13.5px;
}
.chainstat:hover { border-color: var(--accent); }
.chainstat.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chainstat__num { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chainstat--submitted .chainstat__num { color: #a17a14; }
.chainstat--returned .chainstat__num { color: #c0392b; }
.chainstat--approved .chainstat__num { color: var(--ok); }

.chain__tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.chain__search { max-width: 280px; }
.chain__tools .btn { margin-left: auto; }

.chain__head, .chain__line {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: minmax(0, 1fr) 120px 190px 150px;
}
.chain__head {
  padding: 0 12px 8px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.chain__tree, .chain__kids, .chain__team { list-style: none; margin: 0; padding: 0; }
.chain__item.is-faded > details > summary { opacity: .55; }
.chain__row > summary { list-style: none; cursor: pointer; }
.chain__row > summary::-webkit-details-marker { display: none; }
.chain__line { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.chain__line:hover { background: var(--surface-2); }
.chain__who { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: calc(var(--depth, 0) * 26px); }
.chain__toggle { width: 12px; flex: 0 0 12px; color: var(--text-muted); font-size: 11px; }
.chain__toggle::before { content: "▸"; display: inline-block; transition: transform .15s; }
.chain__row[open] > summary .chain__toggle::before { transform: rotate(90deg); }
.chain__avatar {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-muted);
  border: 2px solid var(--border-strong);
}
.chain__avatar--submitted { border-color: #c99a1f; }
.chain__avatar--returned { border-color: #c0392b; }
.chain__avatar--approved { border-color: var(--ok); }
.chain__ident { display: grid; min-width: 0; }
.chain__name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain__meta { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain__placed { display: flex; align-items: center; gap: 8px; }
.chain__bar { flex: 1; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.chain__bar span { display: block; height: 100%; background: var(--ok); }
.chain__count { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-muted); min-width: 34px; text-align: right; }
.chain__state { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chain__when { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain__to { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain__to span { color: var(--text-muted); }
.pill { display: inline-block; align-self: flex-start; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill--draft { background: #f1f3f6; color: var(--text-muted); }
.pill--submitted { background: #fdf6e3; color: #8a6d1f; }
.pill--returned { background: #fdeceb; color: #93291f; }
.pill--approved { background: #ebf7ef; color: var(--ok); }

/* The team, note and unlock sit under their manager's name; the managers
   below are rows of their own, full width, indented by their own depth. */
.chain__body > :not(.chain__kids) { margin-left: calc(var(--depth, 0) * 26px + 66px); }
.chain__team { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px 0; border-bottom: 1px solid var(--border); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: 13px;
}
.chip:hover { border-color: var(--accent); }
.chip__box {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--box-tint); border: 1px solid rgba(0, 0, 0, .08);
}
.chip__box--empty { background: var(--surface-2); color: var(--text-muted); }
.chip--plain { padding: 3px 10px; color: var(--text); }
.chain__note { margin: 10px 12px 0 0; padding: 8px 12px; border-left: 3px solid #c0392b; background: var(--surface-2); font-size: 13.5px; }
.chain__actions { margin: 10px 0 0; }
.chain__empty { margin: 10px 0; font-size: 13px; }
.chain__foot { margin: 14px 0 0; font-size: 12.5px; }

@media (max-width: 760px) {
  .chain__head { display: none; }
  .chain__line { grid-template-columns: 1fr auto; row-gap: 6px; }
  .chain__who { grid-column: 1 / -1; padding-left: calc(var(--depth, 0) * 14px); }
  .chain__placed { padding-left: calc(var(--depth, 0) * 14px + 22px); }
  .chain__to { grid-column: 1 / -1; padding-left: calc(var(--depth, 0) * 14px + 22px); }
  .chain__body > :not(.chain__kids) { margin-left: calc(var(--depth, 0) * 14px + 22px); }
}

/* An import run with records that weren't written. */
.tag--failed { background: #fdeceb; color: #93291f; margin-left: 6px; }

/* A team in the import picker: the manager and the people they would rate. */
.team { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 14px; overflow: hidden; }
.team__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.team__manager { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.team__manager input { width: 16px; height: 16px; cursor: pointer; }
.team__name { font-weight: 600; }
.team__meta { display: flex; align-items: center; gap: 8px; }
.team__members { margin: 0; }
.team__members th:first-child, .table__tick { width: 36px; text-align: center; }
.table__tick input { width: 16px; height: 16px; cursor: pointer; }
.team__members td label { cursor: pointer; }
.picker__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.picker__actions .btn--primary { margin-left: auto; }

/* Irreversible actions. Quiet until hovered, so it reads as available rather
   than inviting — it sits beside everyday buttons. */
.btn--danger { color: #a3281f; border-color: #e7c3bf; background: var(--surface); }
.btn--danger:hover { background: #a3281f; border-color: #a3281f; color: #fff; }

/* Segmented control for choosing how a list is grouped. */
.filters--split { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented__option {
  padding: 7px 14px; font-size: 13px; color: var(--text-muted); text-decoration: none;
  background: var(--surface); border-right: 1px solid var(--border); white-space: nowrap;
}
.segmented__option:last-child { border-right: 0; }
.segmented__option:hover { background: var(--surface-2); color: var(--text); }
.segmented__option.is-active { background: var(--accent); color: #fff; }
.segmented__option.is-active:hover { background: var(--accent-dark); color: #fff; }

/* ---------- dark mode ----------
   Kept last in the file so it overrides component styles on equal
   specificity. New styles go ABOVE this block. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --surface: #1c1f24; --surface-2: #22262c;
    --border: #2c3138; --border-strong: #3a4049;
    --text: #e6e9ee; --text-muted: #98a1ae;
    --accent: #4f8ef7; --accent-dark: #3b7ae4;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.5);
  }
  .topnav__link.is-active { background: #23324a; color: #a9c7fb; }
  .card__avatar { background: #23324a; color: #a9c7fb; }
  .tag--hr { background: #23324a; color: #a9c7fb; }
  .tag--done { background: #1a2721; color: #6fd19b; }
  .tag--progress { background: #2a2618; color: #d8b54e; }
  .tag--todo, .tag--locked, .counter { background: #262b32; color: var(--text-muted); }
  .flash--notice { background: #1a2721; border-color: #2b4636; color: #8fdcb2; }
  .flash--alert { background: #2b1e1e; border-color: #4a2f2c; color: #f0a49b; }
  .errors { background: #2b1e1e; border-color: #4a2f2c; color: #f0a49b; }
  /* Keep HR's hues but at low saturation so the grid stays readable in dark. */
  .box, .result, .minigrid__box { background: color-mix(in srgb, var(--box-tint, var(--surface)) 13%, var(--surface)); }
  .choice { background: color-mix(in srgb, var(--level-tint, var(--surface)) 15%, var(--surface)); }
  .choice__tick { background: rgba(255, 255, 255, .12); }
  .choice--low { --level-line: #e06c6c; }
  .choice--moderate { --level-line: #e0b74a; }
  .choice--high { --level-line: #55b57e; }
  .swatch { border-color: rgba(255, 255, 255, .22); }
  .result__num { background: rgba(255, 255, 255, .12); }
  .box__num, .box__info summary { background: rgba(255, 255, 255, .11); }
}

@media (prefers-color-scheme: dark) {
  .viewas { background: #2a2618; color: #e0c678; border-bottom-color: #4a4229; }
  .viewas__stop { background: #e0b74a; color: #14161a; border-color: #e0b74a; }
  .tag--behalf { background: #2a2618; color: #d8b54e; }
  .listview__hint--warn {
    background: #2a2618; border-color: #4a4229; border-left-color: #d8b54e; color: #e8e2cf;
  }
  .listview__hint--warn code { background: rgba(255, 255, 255, .1); }
  .tag--failed { background: #2c1b1a; color: #f0a49b; }
  .tag--new { background: #1c2a40; color: #9cc0f5; }
  .pill--draft { background: rgba(255, 255, 255, .08); }
  .pill--submitted { background: #2a2618; color: #d8b54e; }
  .pill--returned { background: #2c1b1a; color: #f0a49b; }
  .pill--approved { background: #17271d; color: #7fd19b; }
  .chip__box { border-color: rgba(255, 255, 255, .12); }
  :root:not([data-theme="light"]) { --team-1: #b59ce0; --team-2: #4fc3b5; --team-3: #f0a060; --team-4: #f07aa8; --team-5: #8e9cf0; --team-6: #c4a294; }
  .card--below .card__avatar { color: #14161a; }
  .gridbanner--returned { background: #2c1b1a; border-color: #4a2f2c; }
  .gridbanner__title { color: #f0a49b; }
  .progress--returned .progress__label { color: #f0a49b; }
  .gridbanner--submitted { background: #2a2618; }
  .gridbanner--approved { background: #17271d; }
  .team { border-color: var(--border); }
  .team__head { background: var(--surface-2); border-bottom-color: var(--border); }
  .btn--danger { color: #f0a49b; border-color: #4a2f2c; background: var(--surface); }
  .btn--danger:hover { background: #a3281f; border-color: #a3281f; color: #fff; }
  .segmented__option.is-active, .segmented__option.is-active:hover { color: #fff; }
}
