:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --ink: #1f2933;
  --muted: #637083;
  --line: #d8ddd4;
  --accent: #2f6f67;
  --accent-strong: #184d47;
  --surface: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav a,
.nav button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.gate {
  display: grid;
  min-height: calc(100vh - 160px);
  align-items: center;
}

.gate h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 96px);
}

.gate p {
  max-width: 620px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  background: var(--accent-strong);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.button.secondary {
  background: var(--surface);
  color: var(--accent-strong);
}

.button.danger {
  border-color: #9f2f2f;
  background: #9f2f2f;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h1,
.panel h1 {
  margin: 0;
  font-size: 36px;
}

.section-description {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.message {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
}

.message.success {
  border-color: rgba(47, 111, 103, 0.45);
  background: #edf7f4;
  color: var(--accent-strong);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.metrics div,
.panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.metrics strong {
  display: block;
  font-size: 32px;
}

.metrics span {
  color: var(--muted);
}

.panel {
  max-width: 760px;
}

.panel.narrow {
  max-width: 440px;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.form p {
  display: grid;
  gap: 8px;
  margin: 0;
}

.form input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

.empty-state h2 {
  margin: 0 0 8px;
}

.empty-state p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.photo-select-item {
  display: grid;
  gap: 0.45rem;
}

.photo-select-item > label {
  align-items: center;
  display: flex;
  font-size: 0.85rem;
  gap: 0.4rem;
}

.photo-select-item > label input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

.photo-select-item .photo-tile {
  height: 100%;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.album-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.album-card img,
.album-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.album-placeholder {
  display: grid;
  place-items: center;
  background: #e9efeb;
  color: var(--accent-strong);
  font-size: 40px;
  font-weight: 700;
}

.album-card span {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.album-card small {
  color: var(--muted);
}

.catalog-sections,
.catalog-section {
  display: grid;
  gap: 18px;
}

.catalog-section h2 {
  margin: 0;
}

.system-collection {
  border-style: dashed;
}

.system-badge {
  color: var(--accent-strong) !important;
  font-weight: 700;
  text-transform: uppercase;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.album-photo {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.album-remove {
  width: 100%;
  border: 0;
  background: none;
  color: #9f2f2f;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.trash-grid {
  display: grid;
  gap: 10px;
}

.trash-section {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.trash-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.trash-section__head h2,
.trash-section__head p {
  margin: 0;
}

.trash-section__head p {
  color: var(--muted);
}

.trash-item {
  display: grid;
  grid-template-columns: auto 96px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.trash-item img {
  width: 96px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
}

.trash-item--album {
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
}

.trash-placeholder {
  display: grid;
  width: 96px;
  height: 72px;
  place-items: center;
  border-radius: 6px;
  background: #e9efeb;
  color: var(--accent-strong);
  font-size: 30px;
  font-weight: 700;
}

.trash-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trash-item strong {
  overflow-wrap: anywhere;
}

.trash-item small {
  color: var(--muted);
}

.trash-empty h3 {
  margin: 0;
}

.permanent-delete-confirm {
  display: grid;
  gap: 16px;
}

.permanent-delete-confirm form {
  display: grid;
  gap: 16px;
}

.manifest-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.manifest-list div {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 12px;
}

.manifest-list dt {
  color: var(--muted);
  font-weight: 700;
}

.manifest-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
}

.confirm-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.photo-tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile > span:not(.photo-caption) {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.photo-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 28px 10px 9px;
  background: linear-gradient(0deg, rgba(20, 31, 39, 0.76), rgba(20, 31, 39, 0));
  color: white;
}

.photo-caption strong,
.photo-caption small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-caption strong {
  font-size: 13px;
}

.photo-caption small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.photo-viewer {
  display: grid;
  justify-items: center;
  margin-bottom: 22px;
}

.photo-viewer img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.16);
}

.archive-face-overlay {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.archive-face-overlay img {
  display: block;
  width: 100%;
  height: auto;
}

.archive-face-overlay__box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #ffb000;
  background: rgb(255 176 0 / 10%);
  color: #1f2933;
  text-decoration: none;
  line-height: 1.1;
  outline-offset: 2px;
}

.archive-face-overlay__box:hover,
.archive-face-overlay__box:focus-visible {
  border-color: #0b6b5f;
  background: rgb(11 107 95 / 14%);
}

.archive-face-overlay__label {
  position: absolute;
  left: 0;
  top: 0;
  max-width: min(240px, 70vw);
  padding: .22rem .38rem;
  border-radius: 0 0 4px 0;
  background: #ffb000;
  color: #111;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.photo-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.photo-meta div {
  display: grid;
  gap: 6px;
  min-width: 0;
  background: var(--surface);
  padding: 14px;
}

.photo-meta strong {
  color: var(--muted);
  font-size: 13px;
}

.photo-meta span {
  overflow-wrap: anywhere;
}

.derivative-list {
  margin-top: 22px;
}

.derivative-list h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.derivative-list div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.derivative-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.person-card,
.face-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.person-card img,
.face-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #edf1ec;
}

.person-placeholder {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  background: #e9efeb;
  color: var(--accent-strong);
  font-size: 36px;
  font-weight: 700;
}

.person-card span,
.face-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
}

.person-card strong,
.face-card strong,
.person-card small,
.face-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-action,
.cover-label {
  width: 100%;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.album-action { cursor: pointer; }
.cover-label { display: inline-block; }

.album-bulk-form { display: grid; gap: 16px; }
.album-bulk-toolbar,
.album-bulk-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.album-bulk-toolbar { position: sticky; top: 8px; z-index: 5; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px; }
.album-photo-selectable { position: relative; transition: border-color .15s, box-shadow .15s; }
.album-photo-selectable.is-selected { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(43, 105, 78, .2); }
.album-photo-check { display: flex; align-items: center; gap: 7px; padding: 8px; }
.album-photo-check label { overflow: hidden; cursor: pointer; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.compact-photo-checkbox { width: 16px !important; height: 16px; min-height: 16px !important; flex: 0 0 16px; margin: 0; padding: 0; }
.album-bulk-actions { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 16px; }
.album-bulk-actions h2, .album-bulk-actions p { margin: 0; }
.album-target-picker summary { cursor: pointer; color: var(--accent-strong); font-weight: 700; }
.album-target-list { display: grid; max-height: 220px; gap: 7px; overflow: auto; margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.album-target-list label { display: flex; align-items: center; gap: 8px; }

@media (max-width: 640px) {
  .album-bulk-toolbar .button, .album-bulk-buttons .button { width: 100%; }
  .album-bulk-toolbar { position: static; }
}

.check-picker { display: grid; gap: 8px; }
.check-picker-list { max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.check-picker-list ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--ink); }
.check-picker-list label { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.35; }
.check-picker-list input { width: 18px; min-height: 18px; }
.check-picker-list input[type="checkbox"],
.check-picker-list input[type="radio"] {
  flex: 0 0 auto;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
}

.danger-zone { margin-top: 28px; border: 1px solid #d8a7a7; border-radius: 8px; background: #fffafa; padding: 20px; }
.danger-zone h2 { margin-top: 0; }
.membership-list { display: grid; gap: 8px; }
.membership-list > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.membership-list a { color: var(--accent-strong); font-weight: 700; }
.membership-list .album-remove, .membership-list .cover-label { width: auto; }
.album-manage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.album-manage-grid form { border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.album-manage-grid h3 { margin: 0; }

.face-crop-placeholder {
  font-size: 14px;
}

.person-card strong {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.person-card small,
.face-card small {
  color: var(--muted);
}

.person-card .attention-label {
  width: fit-content;
  overflow: visible;
  border: 1px solid #d97706;
  border-radius: 4px;
  background: #fff7ed;
  padding: 3px 6px;
  color: #9a3412;
  font-weight: 700;
  text-overflow: clip;
  white-space: normal;
}

.face-card a {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.face-card > form {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 0 12px 12px;
}

.face-card > form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.face-card > form label > span {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}

.face-card select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 7px 9px;
  font: inherit;
}

.face-card .button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  height: auto;
  padding: 9px 12px;
  text-align: center;
  white-space: normal;
}

.face-card .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.face-card.selectable {
  position: relative;
}

.face-select {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  padding: 5px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.face-select input {
  width: 15px;
  height: 15px;
}

.face-actions {
  display: grid;
  gap: 8px;
}

.person-profile-hero {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 0 24px;
}

.person-profile-hero img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.person-profile-hero h2 {
  margin: 4px 0 12px;
  font-size: 28px;
}

.person-profile-hero a {
  color: var(--accent-strong);
  font-weight: 700;
}

.face-card .avatar-label {
  color: var(--accent-strong);
  font-weight: 700;
}

.face-avatar-action {
  padding: 0 12px 12px;
}

.face-avatar-action .button {
  width: 100%;
}

.face-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 12px;
}

.content-block {
  margin-top: 28px;
}

.content-block h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.people-search {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.people-search label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.people-search div {
  display: flex;
  gap: 8px;
}

.people-search input,
.people-search select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 9px 11px;
  font: inherit;
}

.people-search input {
  flex: 1 1 420px;
}

.people-sort {
  display: grid;
  gap: 4px;
  min-width: 160px;
}

.search-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.search-panel label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.search-panel label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-panel input,
.search-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px 10px;
  font: inherit;
}

.search-query-field {
  grid-column: span 2;
}

.search-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.result-count {
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}

.tree-picker {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 32px;
}

.tree-picker label {
  display: grid;
  flex: 1 1 420px;
  gap: 6px;
  max-width: 620px;
}

.tree-picker label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tree-picker select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 8px 10px;
  font: inherit;
}

.pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.pagination a,
.pagination strong {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d7d7d7);
  border-radius: 0.4rem;
  padding: 0.45rem 0.7rem;
}

.photo-select-item.is-selected {
  outline: 3px solid var(--accent, #7b5cff);
  outline-offset: 3px;
}

.tree-depth-field {
  max-width: 180px !important;
}

.tree-shell {
  display: grid;
  gap: 12px;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tree-toolbar output {
  min-width: 54px;
  color: var(--muted);
  text-align: center;
}

.tree-viewport {
  position: relative;
  height: min(70vh, 760px);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #f7f9f8;
  background-image: radial-gradient(#cbd6d2 1px, transparent 1px);
  background-size: 20px 20px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tree-viewport:active {
  cursor: grabbing;
}

.tree-canvas {
  position: absolute;
  transform-origin: 0 0;
  will-change: transform;
}

.tree-lines,
.tree-cards {
  position: absolute;
  inset: 0;
}

.tree-edge {
  fill: none;
  stroke: #8aa39b;
  stroke-width: 2;
}

.tree-edge-spouse {
  stroke: var(--accent);
  stroke-dasharray: 7 5;
  stroke-width: 3;
}

.tree-edge-sibling {
  stroke: #7b739e;
  stroke-dasharray: 3 5;
}

.full-tree-card {
  position: absolute;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: minmax(78px, auto) auto;
  width: 230px;
  min-height: 154px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgb(31 55 47 / 10%);
  user-select: text;
}

.full-tree-card.is-focus {
  border: 3px solid var(--accent);
  box-shadow: 0 6px 22px rgb(29 112 89 / 24%);
}

.full-tree-card.is-deceased {
  background: #f1f1ef;
  filter: saturate(0.55);
}

.full-tree-card > img,
.tree-avatar-placeholder {
  width: 42px;
  height: 42px;
  margin: 12px 0 0 10px;
  border-radius: 50%;
  object-fit: cover;
}

.tree-avatar-placeholder {
  display: grid;
  place-items: center;
  background: #dce9e5;
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.tree-card-copy {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 10px;
}

.tree-card-copy strong {
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.tree-card-copy small,
.tree-card-copy span,
.tree-help,
.tree-warning {
  color: var(--muted);
}

.tree-card-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 38px;
  border-top: 1px solid var(--line);
}

.tree-card-actions a,
.tree-card-actions button {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.tree-card-actions button {
  border-right: 0;
  font-size: 20px;
}

.tree-warning {
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #b8851f;
  background: #fff7df;
}

.tree-help {
  margin: 0;
  font-size: 13px;
}

.family-tree-link {
  margin: 0 0 18px;
}

.compact-family {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.compact-family section {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-family h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.family-tree {
  display: grid;
  gap: 34px;
}

.tree-level {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.tree-level h2,
.tree-side-group h2 {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tree-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tree-node {
  display: grid;
  width: min(220px, 100%);
  min-height: 92px;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  text-align: center;
  text-decoration: none;
}

.tree-node small,
.tree-node span {
  color: var(--muted);
}

.tree-focus {
  border-color: var(--accent);
  background: #edf7f4;
}

.tree-center-level {
  grid-template-columns: minmax(0, 1fr) minmax(200px, 240px) minmax(0, 1fr);
  align-items: center;
}

.tree-side-group {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.muted {
  color: var(--muted);
}

.relation-list {
  display: grid;
  gap: 10px;
}

.relation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.relation-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.relation-row strong {
  color: var(--muted);
  font-size: 13px;
}

.relation-row a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.relation-row form {
  flex: 0 0 auto;
}

.relation-edit {
  margin-left: auto;
}

.relation-edit summary {
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.relation-edit form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.relation-edit select {
  max-width: 240px;
  min-height: 38px;
}

.relation-form {
  margin-top: 16px;
}

.assignment-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.assignment-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.assignment-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.assign-form {
  display: grid;
  gap: 12px;
}

.assign-form label {
  display: grid;
  gap: 6px;
}

.assign-form label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.assign-form .checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assign-form .checkbox-field input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.assign-form input,
.assign-form select,
.assign-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 8px 10px;
  font: inherit;
}

.assign-form input,
.assign-form select {
  min-height: 40px;
}

.assign-form textarea {
  min-height: 92px;
  resize: vertical;
}

.assign-form ul {
  margin: 0;
  padding-left: 18px;
  color: #9f2f2f;
}

@media (max-width: 720px) {
  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    padding: 18px;
  }

  .nav {
    flex-wrap: wrap;
    max-width: 100%;
    gap: 12px 16px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: flex-start;
  }

  .photo-meta {
    grid-template-columns: 1fr;
  }

  .assignment-panel {
    grid-template-columns: 1fr;
  }

  .person-profile-hero {
    grid-template-columns: minmax(110px, 160px) 1fr;
    gap: 16px;
  }

  .person-profile-hero h2 {
    font-size: 22px;
  }

  .relation-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .people-search div {
    align-items: stretch;
    flex-direction: column;
  }

  .people-search input {
    flex-basis: auto;
    min-height: 42px;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .search-query-field {
    grid-column: auto;
  }

  .search-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tree-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .tree-picker label {
    flex-basis: auto;
  }

  .album-manage-grid { grid-template-columns: 1fr; }

  .tree-depth-field {
    max-width: none !important;
  }

  .tree-viewport {
    height: 68vh;
    min-height: 400px;
  }

  .tree-toolbar .button:last-child {
    flex: 1 1 auto;
  }

  .tree-center-level {
    grid-template-columns: 1fr;
  }

  .trash-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .trash-item img,
  .trash-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .trash-item form,
  .trash-item .button {
    grid-column: 1 / -1;
  }
}
.album-person {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.album-person img,
.album-person-fallback {
  border-radius: 50%;
  height: 48px;
  object-fit: cover;
  width: 48px;
}

.album-person-fallback {
  align-items: center;
  background: var(--surface-muted, #e7e2d8);
  display: inline-flex;
  justify-content: center;
}

/* Archive UI family-style pass. Keep selectors and form attributes intact. */
:root {
  --bg: var(--family-bg);
  --ink: var(--family-text);
  --muted: var(--family-text-secondary);
  --line: var(--family-border);
  --accent: var(--family-green);
  --accent-strong: var(--family-green);
  --surface: var(--family-surface);
  --archive-surface-raised: rgba(255, 255, 255, 0.92);
  --archive-header-bg: #f3f8ee;
  --archive-danger: var(--family-error);
  font-family: var(--family-font);
}

html {
  min-width: 0;
}

body {
  min-width: 320px;
  background: var(--family-bg);
  color: var(--family-text);
  font-family: var(--family-font);
}

.topbar.family-topbar {
  position: sticky;
  top: 0;
  justify-content: flex-start;
  width: min(var(--family-container), calc(100% - 32px));
  min-height: 64px;
  margin: var(--space-4) auto 0;
  padding: 0 var(--space-4);
  border: 1px solid rgba(226, 217, 201, 0.75);
  border-radius: var(--radius-md);
  background: var(--archive-header-bg);
  box-shadow: var(--shadow-soft);
}

.topbar .brand {
  color: var(--family-text);
}

.topbar .nav {
  gap: var(--space-2);
}

.topbar .nav a,
.topbar .nav button {
  min-height: 34px;
  border-radius: 999px;
  color: var(--family-text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.topbar .nav a {
  padding: 9px 13px;
}

.topbar .nav a:hover,
.topbar .nav a[aria-current="page"] {
  background: #e7efdf;
  color: var(--family-green);
}

.archive-mobile-menu {
  top: 86px;
}

.page {
  width: min(var(--family-container), calc(100% - 32px));
  margin: var(--space-5) auto var(--space-7);
  padding: 0;
}

.gate {
  min-height: calc(100vh - 180px);
}

.gate h1,
.section-head h1,
.panel h1 {
  color: var(--family-text);
  font-weight: 800;
  letter-spacing: 0;
}

.section-head {
  align-items: flex-start;
  margin-bottom: var(--space-5);
}

.section-head h1,
.panel h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.08;
}

.section-description,
.empty-state p,
.assignment-panel p,
.trash-item small,
.photo-meta strong,
.derivative-list span,
.metrics span,
.muted,
.result-count {
  color: var(--family-text-secondary);
}

.eyebrow {
  color: var(--family-green);
  letter-spacing: 0;
}

.button,
.nav button,
.album-action,
.cover-label {
  border-radius: 999px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.button {
  min-height: var(--button-height);
  border-color: var(--family-green);
  background: var(--family-green);
  color: #fffaf0;
  box-shadow: 0 10px 22px rgba(47, 107, 63, 0.12);
}

.button:hover {
  border-color: var(--family-green-hover);
  background: var(--family-green-hover);
}

.button.secondary {
  border-color: var(--family-border);
  background: var(--family-surface);
  color: var(--family-green);
  box-shadow: none;
}

.button.secondary:hover {
  border-color: #cfdcc7;
  background: #eef5e8;
  color: var(--family-green-hover);
}

.button.danger {
  border-color: var(--archive-danger);
  background: var(--archive-danger);
  color: #fffaf0;
}

.button.danger:hover {
  border-color: #7f2821;
  background: #7f2821;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions {
  gap: var(--space-3);
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.metrics div,
.panel,
.empty-state,
.assignment-panel,
.album-bulk-actions,
.album-bulk-toolbar,
.search-panel,
.content-block,
.danger-zone,
.tree-viewport,
.compact-family section,
.album-manage-grid form {
  border-color: var(--family-border);
  border-radius: var(--radius-md);
  background: var(--archive-surface-raised);
  box-shadow: var(--shadow-soft);
}

.content-block {
  padding: var(--space-5);
}

.content-block:has(.photo-grid),
.content-block:has(.person-grid),
.content-block:has(.face-grid) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.panel,
.assignment-panel,
.album-bulk-actions,
.album-bulk-toolbar,
.search-panel,
.danger-zone,
.empty-state {
  padding: var(--space-5);
}

.empty-state {
  border-style: dashed;
  background: rgba(255, 253, 248, 0.7);
}

.message {
  border-color: var(--family-border);
  border-radius: var(--radius-sm);
  background: var(--family-surface);
  box-shadow: 0 8px 22px rgba(40, 32, 18, 0.06);
}

.message.success {
  border-color: #c9ddbf;
  background: #eef7e9;
  color: var(--family-green);
}

.message.error,
.message.warning {
  border-color: #e4b4ad;
  background: #fff4f2;
  color: var(--family-error);
}

.photo-tile,
.album-card,
.person-card,
.face-card,
.trash-item,
.tree-node,
.full-tree-card {
  border-color: var(--family-border);
  border-radius: var(--radius-sm);
  background: var(--family-surface);
  box-shadow: 0 8px 20px rgba(40, 32, 18, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.photo-tile:hover,
.album-card:hover,
.person-card:hover,
.face-card:hover,
.tree-node:hover {
  border-color: #cfdcc7;
  box-shadow: 0 14px 30px rgba(40, 32, 18, 0.1);
  transform: translateY(-1px);
}

.album-placeholder,
.person-placeholder,
.tree-avatar-placeholder,
.tree-focus {
  background: #e7efdf;
  color: var(--family-green);
}

.photo-caption {
  background: linear-gradient(0deg, rgba(23, 32, 24, 0.78), rgba(23, 32, 24, 0));
}

.photo-viewer img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.photo-meta {
  border-color: var(--family-border);
  border-radius: var(--radius-md);
  background: var(--family-border);
}

.photo-meta div {
  background: var(--family-surface);
}

.trash-grid,
.catalog-sections,
.catalog-section,
.face-grid,
.person-grid,
.photo-grid,
.album-grid {
  min-width: 0;
}

.trash-item {
  grid-template-columns: auto 96px minmax(0, 1fr) max-content max-content;
}

.trash-item--album {
  grid-template-columns: 96px minmax(0, 1fr) max-content max-content;
}

.search-panel,
.people-search,
.tree-picker,
.assign-form,
.form {
  min-width: 0;
}

.form input,
.form select,
.form textarea,
.assign-form input,
.assign-form select,
.assign-form textarea,
.people-search input,
.people-search select,
.search-panel input,
.search-panel select,
.tree-picker select,
.face-card select,
.relation-edit select,
.check-picker-list {
  border-color: var(--family-border);
  border-radius: var(--radius-sm);
  background: var(--family-surface);
  color: var(--family-text);
}

.form input[type="checkbox"],
.form input[type="radio"],
.assign-form input[type="checkbox"],
.assign-form input[type="radio"],
.search-panel input[type="checkbox"],
.search-panel input[type="radio"],
.people-search input[type="checkbox"],
.people-search input[type="radio"],
.tree-picker input[type="checkbox"],
.tree-picker input[type="radio"],
.face-card input[type="checkbox"],
.face-card input[type="radio"],
.check-picker-list input[type="checkbox"],
.check-picker-list input[type="radio"],
.album-target-list input[type="checkbox"],
.album-target-list input[type="radio"],
.photo-select-item > label input[type="checkbox"],
.trash-item input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 1px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--family-green);
}

.form input[type="radio"],
.assign-form input[type="radio"],
.search-panel input[type="radio"],
.people-search input[type="radio"],
.tree-picker input[type="radio"],
.face-card input[type="radio"],
.check-picker-list input[type="radio"],
.album-target-list input[type="radio"] {
  border-radius: 50%;
}

.check-picker-list li,
.check-picker-list label,
.album-target-list label,
.trash-item label,
.photo-select-item > label,
.album-photo-check,
.face-select {
  min-width: 0;
}

.check-picker-list label,
.album-target-list label,
.trash-item label,
.photo-select-item > label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  line-height: 1.35;
}

.check-picker-list label,
.album-target-list label {
  overflow-wrap: anywhere;
}

.photo-select-item > label {
  align-items: center;
  min-height: 32px;
  padding: 0 2px;
  color: var(--family-text-secondary);
  font-weight: 700;
}

.photo-select-item.is-selected > label {
  color: var(--family-green);
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.assign-form input:focus,
.assign-form select:focus,
.assign-form textarea:focus,
.people-search input:focus,
.search-panel input:focus,
.search-panel select:focus,
.tree-picker select:focus,
.face-card select:focus {
  border-color: var(--family-focus);
  outline: 3px solid rgba(217, 164, 65, 0.22);
  outline-offset: 1px;
}

.form textarea,
.assign-form textarea {
  min-height: 110px;
}

.assign-form ul,
.form .errorlist {
  color: var(--family-error);
}

.check-picker-list,
.album-target-list {
  scrollbar-color: #cfdcc7 var(--family-surface-soft);
}

.pagination a,
.pagination strong {
  border-color: var(--family-border);
  border-radius: 999px;
  background: var(--family-surface);
  color: var(--family-text-secondary);
  min-width: 38px;
  text-align: center;
  text-decoration: none;
}

.pagination a:hover,
.pagination strong {
  background: #e7efdf;
  color: var(--family-green);
}

.album-action,
.cover-label,
.album-remove,
.relation-edit summary,
.relation-row a,
.membership-list a,
.face-card a,
.album-target-picker summary,
.tree-card-actions a,
.tree-card-actions button {
  color: var(--family-green);
}

.album-remove {
  color: var(--family-error);
}

.danger-zone {
  border-color: #e4b4ad;
  background: #fff8f6;
}

.tree-viewport {
  background-color: #f9f8f3;
  background-image: radial-gradient(#d8d0bf 1px, transparent 1px);
}

.tree-edge {
  stroke: #86a578;
}

.tree-edge-spouse {
  stroke: var(--family-green);
}

.full-tree-card.is-focus {
  border-color: var(--family-green);
}

.archive-selection-bar {
  position: sticky;
  top: 94px;
  z-index: 10;
}

.upload-result-head {
  margin-bottom: var(--space-5);
}

.trash-section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
}

.trash-section-actions__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.trash-section-actions__group--primary {
  margin-left: var(--space-3);
}

.trash-section-actions .button {
  width: auto;
  min-width: 0;
  white-space: normal;
}

.trash-item {
  grid-template-columns: auto 96px minmax(0, 1fr) max-content;
}

.trash-item--album {
  grid-template-columns: auto 96px minmax(0, 1fr) max-content;
}

.trash-item > .trash-item__info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trash-item > .trash-item__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: max-content;
}

.trash-item > .trash-item__actions form {
  display: contents;
}

.trash-item > .trash-item__actions .button {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .trash-section-actions,
  .trash-section-actions__group {
    align-items: stretch;
  }

  .trash-section-actions__group--primary {
    margin-left: 0;
  }

  .trash-section-actions .button {
    flex: 1 1 220px;
  }

  .trash-item,
  .trash-item--album {
    grid-template-columns: auto 96px minmax(0, 1fr);
  }

  .trash-item > .trash-item__actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 700px) {
  .trash-section-actions,
  .trash-section-actions__group {
    width: 100%;
  }

  .trash-section-actions .button {
    flex-basis: 100%;
    width: 100%;
  }

  .trash-item,
  .trash-item--album {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .trash-item img,
  .trash-placeholder {
    width: 88px;
    height: 66px;
    aspect-ratio: auto;
  }

  .trash-item > .trash-item__info {
    grid-column: 1 / -1;
  }

  .trash-item > .trash-item__actions {
    width: 100%;
  }

  .trash-item > .trash-item__actions .button {
    flex: 1 1 160px;
    width: auto;
    white-space: normal;
  }
}

.upload-result-stack {
  display: grid;
  gap: var(--space-5);
}

.upload-result-stack .upload-error-block,
.upload-result-stack .upload-items {
  margin: 0;
}

@media (max-width: 1024px) {
  .topbar .family-nav {
    display: none;
  }

  .topbar .family-menu-button {
    display: inline-flex;
  }

@media (max-width: 720px) {
  .topbar.family-topbar,
  .section-head {
    flex-direction: row;
  }

  .topbar.family-topbar {
    align-items: center;
    min-height: 62px;
    padding: 0 var(--space-3);
  }

  .family-brand {
    min-width: 0;
  }

  .family-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .archive-user-menu {
    display: none;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-4);
  }

  .actions,
  .album-bulk-buttons,
  .tree-toolbar {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .actions .button,
  .album-bulk-buttons .button,
  .tree-toolbar .button,
  .people-search .button,
  .search-actions .button,
  .tree-picker .button {
    width: 100%;
  }

  .page {
    width: min(var(--family-container), calc(100% - 24px));
    margin-top: var(--space-4);
  }

  .panel,
  .assignment-panel,
  .album-bulk-actions,
  .album-bulk-toolbar,
  .search-panel,
  .danger-zone,
  .empty-state,
  .content-block {
    padding: var(--space-4);
  }

  .content-block:has(.photo-grid),
  .content-block:has(.person-grid),
  .content-block:has(.face-grid) {
    padding: 0;
  }

  .metrics strong {
    font-size: 28px;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  }

  .album-grid {
    grid-template-columns: 1fr;
  }

  .person-grid,
  .face-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  }

  .trash-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .trash-item img,
  .trash-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .trash-item label,
  .trash-item form,
  .trash-item .button {
    grid-column: 1 / -1;
  }

  .manifest-list div {
    grid-template-columns: minmax(0, 1fr);
  }

  .archive-selection-bar {
    position: static;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-caption {
    padding: 24px 8px 8px;
  }

  .face-card .actions {
    grid-template-columns: 1fr;
  }

  .person-profile-hero {
    grid-template-columns: 1fr;
  }
}
.processing-section { margin-block: 2rem; }
.processing-grid { display: grid; gap: 1rem; }
.processing-card { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 1rem; padding: 1rem; border: 1px solid var(--color-border, #d8d1c7); border-radius: 16px; background: #fff; }
.processing-card > img, .processing-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #eee9e2; }
.processing-placeholder { display: grid; place-items: center; color: #685f55; }
.processing-card dl { margin: 0; }
.processing-card dl div { display: grid; grid-template-columns: 8rem 1fr; gap: .5rem; margin-block: .3rem; }
.processing-card dt { font-weight: 700; }
.processing-card dd { margin: 0; overflow-wrap: anywhere; }
.processing-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; align-items: center; }
.processing-actions form { margin: 0; }
.face-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 1rem; align-items: start; }
.face-editor__stage { position: relative; line-height: 0; touch-action: none; user-select: none; }
.face-editor__stage img { display: block; width: 100%; height: auto; border-radius: 12px; }
.face-editor__box { position: absolute; border: 3px solid #ffb000; background: rgb(255 176 0 / 12%); cursor: move; line-height: 1; box-sizing: border-box; }
.face-editor__box > span { position: absolute; left: 0; top: 0; padding: .2rem .35rem; color: #111; background: #ffb000; font-weight: 700; }
.face-editor__resize { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 50%; background: #ffb000; cursor: nwse-resize; }
.face-editor__panel { position: sticky; top: 1rem; }
.face-editor__row { padding-block: .8rem; border-bottom: 1px solid #ddd; }
.face-editor__row p { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.face-editor__row button { margin: 0 .35rem .35rem 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.data-table th,
.data-table td {
  padding: .7rem;
  border-bottom: 1px solid var(--color-border, #d8d1c7);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.data-table th {
  font-weight: 700;
}
@media (max-width: 760px) {
  .processing-card, .face-editor { grid-template-columns: 1fr; }
  .processing-card dl div { grid-template-columns: 1fr; gap: 0; }
  .face-editor__panel { position: static; }
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .data-table tr {
    padding: .75rem 0;
    border-bottom: 1px solid var(--color-border, #d8d1c7);
  }
  .data-table td {
    display: grid;
    grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
    gap: .6rem;
    padding: .35rem 0;
    border-bottom: 0;
  }
  .data-table td::before {
    font-weight: 700;
    color: var(--color-muted, #685f55);
  }
  .data-table td:nth-child(1)::before { content: "Имя Фамилия"; }
  .data-table td:nth-child(2)::before { content: "Email"; }
  .data-table td:nth-child(3)::before { content: "Роль"; }
  .data-table td:nth-child(4)::before { content: "Статус доступа"; }
  .data-table td:nth-child(5)::before { content: "Последний вход"; }
  .data-table td:nth-child(6)::before { content: "Учётная запись"; }
  .data-table td:nth-child(7)::before { content: "Действие"; }
}
