/* ── Person hero (detail header card) ─────────────────────────────────── */
.person-hero {
  display: flex; gap: 24px; align-items: flex-start;
  margin-bottom: 16px; position: relative;
}
/* PDF action — the .btn base carries layout/typography; only the delta here. */
.pdf-btn {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border-bright));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-2));
  color: var(--danger);
}
.pdf-btn:hover {
  background: var(--danger); border-color: var(--danger);
  color: var(--on-accent);
}
/* Phones: shrink the corner PDF action to a compact chip that tucks neatly into
   the tighter panel padding (applies everywhere .pdf-btn is used — the person
   dossier and the muster report). */
@media (max-width: 720px) {
  .pdf-btn {
    top: 12px; right: 12px;
    padding: 5px 10px; gap: 5px;
    font-size: 11px; letter-spacing: .4px;
  }
  .pdf-btn svg { width: 13px; height: 13px; }
}
.person-hero-main { min-width: 0; flex: 1; }
.person-hero-rank {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--signal); margin-bottom: 4px;
}
.person-hero-name {
  margin: 0 0 10px; font-family: var(--font-display); font-weight: 700;
  font-size: 26px; line-height: 1.15; letter-spacing: -.2px;
}
.person-hero-callsign { color: var(--accent-2); font-weight: 600; }
.person-hero-status { margin-bottom: 14px; }
.person-hero-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px; margin: 0;
}
.person-hero-facts > div { min-width: 0; }
.person-hero-facts dt {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 3px;
}
/* Facts wrap rather than truncate — the detail page is where the full
   subdivision path / responsible officer belong, so never clip them. */
.person-hero-facts dd { margin: 0; color: var(--text); font-size: 13.5px; overflow-wrap: anywhere; }
.person-hero-tags { margin-top: 16px; }
.person-description { margin: 8px 0 0; color: var(--text); }

/* Phone: keep the hero left-aligned (a centred photo + name over a left-aligned
   readout read as two different cards). Photo shrinks to a compact document
   portrait; the PDF button stays pinned top-right, clear of the left-set photo,
   and every fact stacks full-width. */
@media (max-width: 560px) {
  .person-hero { flex-direction: column; gap: 16px; }
  .person-hero .avatar.lg { width: 104px; height: 139px; font-size: 30px; }
  .person-hero-name { font-size: 21px; }
  .person-hero-facts { grid-template-columns: 1fr; gap: 11px; }
  .dl { grid-template-columns: 124px 1fr; }
}

/* ── Ward list (підопічні) ──────────────────────────────────────────────
   Rendered with the same person-card (.pcard) as the personnel list, so a
   guardian's subordinates read exactly like the main roster. Unlike that list
   these cards show at every width (there's no table variant here). */
.ward-cards { display: flex; flex-direction: column; gap: 9px; list-style: none; padding: 0; margin: 8px 0 0; }
.ward-cards > li { margin: 0; }

/* ── Person documents ─────────────────────────────────────────────────── */
.panel-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.panel-head-row > h3 { margin: 0; }
/* Phone: the "Додати контакт"/"Додати документ" buttons collapse to their glyph
   next to the heading (the labels crowd the long section titles) — same idiom as
   the topbar (.btn:has(.btn-ico) label hidden), title carries the a11y name. */
@media (max-width: 560px) {
  .panel-head-row .btn:has(.btn-ico) {
    width: 40px; min-width: 40px; height: 40px; padding: 0; gap: 0; justify-content: center;
  }
  .panel-head-row .btn:has(.btn-ico) .btn-lbl { display: none; }
}
.doc-list { list-style: none; padding: 0; margin: 12px 0 0; }
.doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.doc-item:last-child { border-bottom: none; }
.doc-icon { flex: none; color: var(--muted-2); display: flex; }
.doc-main { min-width: 0; flex: 1; }
.doc-name {
  display: block; color: var(--text); font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-name:hover { color: var(--accent-2); text-decoration: underline; }
.doc-meta {
  font-family: var(--font-mono); font-size: 11px; color: var(--muted-2);
  margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.badge.doc-kind {
  background: color-mix(in srgb, var(--signal) 14%, var(--panel-2));
  color: var(--signal); border-color: transparent;
}
.doc-item form { flex: none; margin: 0; }

/* ── Person detail ────────────────────────────────────────────────────── */
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: none; }
td .badge { margin-bottom: 2px; }
