.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cert-toggle { position: relative; cursor: pointer; }
.cert-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cert-toggle__box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--surface-1);
  color: var(--text-muted);
  font: 600 12px/1 var(--font-sans);
  transition: all var(--dur-fast);
}
.cert-toggle__box .ic { display: none; }
.cert-toggle input:checked + .cert-toggle__box { color: var(--success-fg); border-color: color-mix(in srgb, var(--success) 50%, transparent); background: var(--success-subtle); }
.cert-toggle input:checked + .cert-toggle__box .ic { display: inline-block; }
.cert-toggle input:focus-visible + .cert-toggle__box { box-shadow: var(--focus-ring); }

.profile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 14px; }
.profile__name { font: 600 19px/1.2 var(--font-sans); }
.profile__alias { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.profile__badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.profile__actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.profile__actions > * { flex: 1 1 auto; }
.profile__actions form { display: flex; }
.profile__actions form .btn { flex: 1; }
.note-box { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-1); border-left: 2px solid var(--accent); }
.note-box .label { display: block; margin-bottom: 4px; }

.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tally__item {
  --c: var(--text-secondary);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tally__item--plus { --c: var(--success-fg); }
.tally__item--praise { --c: var(--info-fg); }
.tally__item--minus { --c: var(--warning-fg); }
.tally__item--reprimand { --c: var(--danger-fg); }
.tally__value { font: 600 22px/1 var(--font-sans); color: var(--c); font-variant-numeric: tabular-nums; }
.tally__value small { font-size: 13px; color: var(--text-muted); margin-left: 2px; }
.tally__label { font: 400 12px/1.3 var(--font-sans); color: var(--text-muted); }
.tally--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tally--compact .tally__item { padding: 10px 12px; background: var(--surface-1); }
.tally--compact .tally__value { font-size: 20px; }

.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.tl:first-child { border-top: 0; padding-top: 0; }
.tl__time { font: 400 12px/1.5 var(--font-sans); color: var(--text-muted); width: 118px; flex: none; }
.tl__dot { width: 8px; height: 8px; border-radius: 9px; margin-top: 6px; flex: none; background: var(--navy-500); }
.tl--promotion .tl__dot { background: var(--accent); }
.tl--demotion .tl__dot { background: var(--danger); }
.tl--hire .tl__dot, .tl--rehire .tl__dot { background: var(--success); }
.tl__text { font: var(--text-small); }
.tl__who { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stages__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}
.stages__item.is-done { border-style: solid; border-color: color-mix(in srgb, var(--success) 45%, transparent); background: var(--success-subtle); color: var(--text-primary); }
.stages__mark { color: var(--text-disabled); }
.stages__item.is-done .stages__mark { color: var(--success-fg); }
.stages__label { font-weight: 600; font-size: 13px; }
.stages__meta { font: 400 12px/1.4 var(--font-sans); color: var(--text-muted); }
.id-photo {
  position: relative;
  width: 136px;
  height: 168px;
  flex: none;
  border-radius: var(--radius-xs);
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
}
.id-photo img { width: 100%; height: 100%; object-fit: cover; background: var(--navy-700); }
.id-photo--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface-3); border: 1px dashed var(--border-strong); padding: 0; }
.id-photo__initials { font: 600 34px/1 var(--font-sans); color: var(--text-muted); }
.id-photo__hint { font: 400 12px/1.3 var(--font-sans); color: var(--text-disabled); }
.id-photo__edit {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-press);
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-2);
}
.id-photo__edit:hover { background: var(--accent-hover); }
.id-photo__lock {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
}
.stripes { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.stripes i { display: block; width: 4px; height: 13px; border-radius: 1px; background: #B8912F; transform: skewX(-32deg); }
.id-photo__stripes { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 48px); flex-wrap: wrap; padding: 4px 6px; border-radius: var(--radius-xs); background: rgba(20, 24, 30, .8); }
.stripes--inline i { height: 11px; width: 3px; }
.id-photo--preview { width: 120px; height: 148px; }
.photo-upload { display: flex; gap: 18px; align-items: flex-start; }
.photo-upload .upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (max-width: 640px) {
  .photo-upload { flex-direction: column; align-items: center; }
}
.tab--admin { color: var(--danger-fg); }
.tab--admin.is-active::after { background: var(--danger); }
.kv__row--admin dt { color: var(--danger-fg); display: inline-flex; align-items: center; gap: 4px; }

.tl__note { margin-top: 6px; font: 400 13px/1.45 var(--font-sans); color: var(--text-primary); }
.tl__signers { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--gold-300); }

@media (max-width: 900px) {
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.crop { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: none; }
.crop__frame {
  position: relative;
  width: 216px;
  height: 267px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.crop__frame:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.crop__frame.is-dragging { cursor: grabbing; }
.crop__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255, 255, 255, .22) calc(33.33% - .5px), rgba(255, 255, 255, .22) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .22) calc(66.66% - .5px), rgba(255, 255, 255, .22) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255, 255, 255, .22) calc(33.33% - .5px), rgba(255, 255, 255, .22) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255, 255, 255, .22) calc(66.66% - .5px), rgba(255, 255, 255, .22) calc(66.66% + .5px), transparent calc(66.66% + .5px));
  opacity: 0;
  transition: opacity var(--dur-base);
}
.crop__frame.is-dragging::after, .crop__frame:hover::after { opacity: 1; }
.crop__img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.crop__zoom { display: flex; align-items: center; gap: 8px; width: 216px; color: var(--text-muted); }
.crop__zoom input { flex: 1; min-width: 0; accent-color: var(--accent); }
.crop-help { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--surface-3); }
.crop-help__round { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-1); }
.crop-help .btn { align-self: flex-start; padding-left: 0; }
