/* My Big Family Tree v3.5 — persistent tree context, focused family view,
   high-fidelity GEDCOM review, and administrator visibility preview. */

.current-tree-banner,
.view-as-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 69, 57, .24);
  border-radius: 6px;
  background: #eef4ef;
  color: #173f33;
}

.direct-member-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.direct-member-grid>label input,.direct-member-grid>label select{display:block;width:100%;margin-top:6px;padding:10px;border:1px solid var(--line);background:#fff}.direct-member-grid fieldset{grid-column:1/-1;display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:9px;border:1px solid var(--line);padding:15px;background:#fff}.direct-member-grid fieldset legend{font-weight:700;padding:0 7px}.direct-member-action{grid-column:1/-1;display:flex;align-items:center;gap:14px;flex-wrap:wrap}.direct-member-action small{color:var(--muted)}
@media(max-width:700px){.direct-member-grid{grid-template-columns:1fr}.direct-member-grid fieldset,.direct-member-action{grid-column:auto}}
.skip-link{position:fixed;left:12px;top:12px;z-index:10000;transform:translateY(-160%);padding:10px 14px;background:#fff;color:#123f34;border:2px solid #123f34;border-radius:4px;font-weight:700}.skip-link:focus{transform:translateY(0)}:focus-visible{outline:3px solid #d19b37;outline-offset:3px}.v2-main:focus{outline:none}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
.access-audit-list{display:grid;gap:14px}.access-audit-card{padding:18px;border:1px solid var(--line);background:#fff;border-left:5px solid #4f8469}.access-audit-card.needs-review{border-left-color:#a84b3c;background:#fff9f7}.access-audit-card details{margin-top:12px}.access-audit-card summary{cursor:pointer;font-weight:700;color:var(--green)}.warning-list{margin:12px 0;padding:12px 12px 12px 32px;background:#fff0eb;color:#85382d}.access-isolation-summary{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:700px){.access-isolation-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}

.current-tree-banner > div,
.view-as-banner > div {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.current-tree-banner b,
.current-tree-banner small,
.view-as-banner b,
.view-as-banner small {
  display: block;
}

.current-tree-banner small,
.view-as-banner small {
  margin-top: 2px;
  color: #5d6a63;
}

.current-tree-banner a,
.view-as-banner button {
  flex: 0 0 auto;
  color: #173f33;
  font-weight: 700;
}

.current-tree-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(22,69,57,.24);
}

.current-tree-missing {
  border-color: #b67943;
  background: #fff3e5;
  color: #714521;
}

.view-as-banner {
  border-color: #8a6238;
  background: #fff3df;
  color: #714521;
}

.view-as-banner form {
  margin: 0;
}

.view-as-banner button {
  border: 1px solid #8a6238;
  background: #fffaf2;
  padding: 8px 11px;
  border-radius: 4px;
  cursor: pointer;
}

.dashboard-tree-card.is-current,
.branch-card.is-current {
  border-color: #1f5949;
  box-shadow: 0 0 0 3px rgba(31, 89, 73, .12);
}

.current-tree-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: #dceade;
  color: #285636;
  padding: 4px 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.tree-card-actions form {
  display: inline;
  margin: 0;
}

.tree-card-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--green, #174638);
  padding: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.tree-card-link:hover,
.tree-card-link:focus-visible {
  text-decoration: underline;
}

/* Focused family connections */
.focused-family-panel {
  overflow: hidden;
}

.focused-family-stack {
  display: grid;
  gap: 14px;
  position: relative;
}

.focused-family-level {
  position: relative;
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 7px;
  background: #fffefb;
  padding: 14px;
}

.focused-family-level + .focused-family-level::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  height: 14px;
  border-left: 2px solid #c4b9aa;
}

.focused-family-level h3 {
  margin: 0 0 10px;
  color: #5d665f;
  font: 800 .72rem/1.2 system-ui, sans-serif;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.focused-family-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.focused-family-cards.extended {
  margin-bottom: 14px;
}

.focused-person-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.focused-person-card.is-focus {
  border-color: #276653;
  background: #eef4ef;
}

.focused-person-copy {
  min-width: 0;
}

.focused-person-copy b,
.focused-person-copy small,
.focused-person-copy span {
  display: block;
}

.focused-person-copy b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focused-person-copy small {
  margin-top: 2px;
  color: var(--muted, #6e746f);
}

.focused-person-copy span {
  margin-top: 4px;
  color: #5f4f41;
  font-size: .76rem;
  font-weight: 700;
}

.mini-edit {
  align-self: start;
  color: var(--green, #174638);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.extended-family-details {
  margin-top: 14px;
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 6px;
  background: #faf8f2;
  padding: 0 14px 14px;
}

.extended-family-details summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--green, #174638);
  font-weight: 800;
}

/* Administrator visibility preview */
.view-as-card {
  border-left: 5px solid #8a6238;
}

.view-as-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 9px;
}

.view-as-options button,
.view-as-options a {
  width: 100%;
  min-height: 44px;
}

.admin-visibility-note {
  border: 1px solid rgba(22,69,57,.2);
  border-radius: 5px;
  background: #eef4ef;
  padding: 12px;
}

/* GEDCOM import and review */
.gedcom-security-note {
  border-left: 5px solid #1e5a49;
  background: #eef4ef;
}

.gedcom-preview-grid,
.gedcom-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.gedcom-stat {
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 5px;
  background: #fff;
  padding: 12px;
}

.gedcom-stat b,
.gedcom-stat span {
  display: block;
}

.gedcom-stat b {
  font: 700 1.55rem Georgia, serif;
}

.gedcom-stat span {
  color: var(--muted, #6e746f);
  font-size: .78rem;
}

.gedcom-person-preview {
  display: grid;
  gap: 8px;
}

.gedcom-person-preview article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 5px;
  background: #fff;
  padding: 11px 12px;
}

.gedcom-person-preview b,
.gedcom-person-preview small {
  display: block;
}

.gedcom-person-preview small {
  margin-top: 3px;
  color: var(--muted, #6e746f);
}

.gedcom-warning-list {
  max-height: 16rem;
  overflow: auto;
  border: 1px solid #d8b07d;
  background: #fff7e9;
  padding: 12px 12px 12px 30px;
}

.gedcom-history-table td small {
  display: block;
  color: var(--muted, #6e746f);
}

/* Prevent toolbar/button collisions and preserve wide labels at zoom. */
.v2-head,
.section-title,
.page-intro {
  min-width: 0;
}

.profile-actions,
.button-row,
.head-links {
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .current-tree-banner,
  .view-as-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .focused-family-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .focused-person-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .focused-person-card .mini-edit {
    grid-column: 2;
    justify-self: start;
  }

  .gedcom-person-preview article {
    grid-template-columns: 1fr;
  }
}

.system-test-overview {
  display: grid;
  grid-template-columns: minmax(260px,1fr) minmax(360px,1.2fr);
  gap: 22px;
  align-items: center;
  border-left: 6px solid var(--green,#153f34);
}
.system-test-overview.system-test-warning { border-left-color: #a36b21; }
.system-test-overview.system-test-fail { border-left-color: #9f332d; }
.system-test-overview .button-row { grid-column: 1/-1; }
.system-test-category { margin-top: 18px; }
.system-test-row.status-warning { border-left: 4px solid #bf812d; }
.system-test-row.status-fail {
  border-left: 4px solid #a53c34;
  background: #fff5f3;
}
.system-test-row.status-fail .status-dot { background: #a53c34; color: #fff; }
.system-test-row .badge { margin-left: auto; }
.heritage-hero { display:grid; grid-template-columns:220px minmax(0,1fr); gap:30px; align-items:center; background:linear-gradient(135deg,#fffdf8,#eee5d5); }
.heritage-crest { display:grid; place-items:center; min-height:210px; padding:18px; border:1px solid #d3c4ab; border-radius:10px; background:#fff; text-align:center; }
.heritage-crest img { display:block; width:100%; max-height:190px; object-fit:contain; }
.heritage-crest span { color:#9b6b45; font-size:6rem; line-height:1; }
.heritage-crest small { color:#6e756f; }
.heritage-hero h2 { margin:3px 0 12px; font:700 clamp(2.2rem,5vw,4.5rem)/1 Georgia,serif; }
.heritage-hero blockquote { margin:0 0 16px; padding-left:18px; border-left:4px solid #a7754f; color:#583c2b; font:italic 1.25rem/1.5 Georgia,serif; }
.heritage-hero blockquote small { display:block; color:#6b746f; font:normal .85rem/1.4 system-ui,sans-serif; }
.heritage-editor { margin-top:20px; }
.heritage-editor .editor-section > div:first-child p { max-width:240px; }
.heritage-reading-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-top:18px; }
.heritage-reading-grid .section-card { margin:0; }
.heritage-reading-grid p { line-height:1.7; white-space:normal; }
.heritage-caution { margin-top:20px; }
@media (max-width:760px) {
  .heritage-hero,.heritage-reading-grid { grid-template-columns:1fr; }
  .heritage-crest { min-height:150px; }
}
@media (max-width: 760px) {
  .system-test-overview { grid-template-columns: 1fr; }
  .system-test-overview .button-row { grid-column: auto; }
}

@media print {
  .current-tree-banner,
  .view-as-banner,
  .view-as-card,
  .mini-edit {
    display: none !important;
  }

  .extended-family-details {
    display: block;
  }

  .extended-family-details > summary {
    display: none;
  }
}

/* Focused tree page: calm, nearest-family-first layout. */
.focused-tree-toolbar {
  display: grid;
  grid-template-columns: minmax(320px,1fr) auto;
  align-items: end;
  gap: 18px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 7px;
  background: #fffefb;
}

.focused-tree-toolbar > label {
  min-width: 0;
  color: var(--forest, #173f33);
  font-size: .8rem;
  font-weight: 800;
}

.focused-tree-toolbar .person-picker {
  margin-top: 8px;
}
.focused-tree-toolbar .person-picker-input {
  min-height: 46px;
  border: 1px solid #c8c0b4;
  border-radius: 5px;
  background: #fff;
  font-size: .96rem;
  font-weight: 700;
}
.focused-tree-toolbar > .button-row {
  justify-content: flex-end;
  gap: 8px;
}
.focused-tree-toolbar .button-link,
.focused-tree-toolbar button.button-link,
.main-person-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 5px;
  white-space: nowrap;
}
.tree-main-person-form { margin:0; }
.main-person-status {
  border: 1px solid #9db8aa;
  background: #eaf3ed;
  color: var(--forest,#173f33);
  font-weight: 800;
}
.main-person-status::before {
  content: "★";
  margin-right: 7px;
  color: #a77831;
}
.main-person-link { border-color:#b99a62 !important; background:#fff8e8 !important; }
@media(max-width:980px){
  .focused-tree-toolbar { grid-template-columns:1fr; align-items:stretch; }
  .focused-tree-toolbar > .button-row { justify-content:flex-start; }
}
@media(max-width:620px){
  .focused-tree-toolbar > .button-row { display:grid; grid-template-columns:1fr; }
  .focused-tree-toolbar .button-link,.focused-tree-toolbar button.button-link,.main-person-status { width:100%; white-space:normal; }
}

.focused-family-view {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0 0 16px;
  padding: 22px;
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefb 0%, #f8f5ee 100%);
  overflow: hidden;
}

.focused-family-view > header {
  margin-bottom: 18px;
  text-align: center;
}

.focused-family-view > header h2 {
  margin: 4px 0 6px;
}

.focused-family-view > header p:last-child {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted, #6e746f);
}

.focused-family-view .focused-family-level {
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 0;
}

.focused-family-view .focused-family-level::before {
  display: none;
}

.focused-level-label {
  display: block;
  margin: 0 0 9px;
  color: #68716b;
  font: 800 .72rem/1.2 system-ui, sans-serif;
  letter-spacing: .09em;
  text-align: center;
  text-transform: uppercase;
}

.focused-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.focused-card-row .tree-person-card {
  flex: 0 0 150px;
  width: 150px;
  min-height: 164px;
  box-shadow: 0 6px 16px rgba(38, 44, 38, .12);
}

.focused-card-row .tree-person-card.focus {
  border-color: #276653;
  outline: 3px solid rgba(39, 102, 83, .20);
  background: #f5faf7;
}

.focused-line {
  width: 2px;
  height: 26px;
  margin: 5px auto;
  background: #b9afa1;
}

.focused-family-more {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.focused-family-more details {
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 7px;
  background: #fffefb;
  padding: 0 15px 15px;
}

.focused-family-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 13px 0;
  color: var(--forest, #173f33);
  font-weight: 800;
}

.focused-family-more summary span {
  min-width: 28px;
  border-radius: 999px;
  background: #e8eee9;
  padding: 3px 8px;
  color: #416153;
  font-size: .75rem;
  text-align: center;
}

.focused-card-row.compact-cards {
  justify-content: flex-start;
}

.focused-card-row.compact-cards .tree-person-card {
  flex-basis: 132px;
  width: 132px;
  min-height: 150px;
}

.focused-family-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

/*
 * Expanded chart cards deliberately show the complete protected photograph.
 * Profile and directory thumbnails may crop to a portrait, but the movable
 * tree canvas must also handle landscape, group, and historical photographs.
 */
.tree-canvas-shell .tree-generation {
  gap: 28px;
}

.tree-canvas-shell .tree-person-card {
  width: 184px;
  min-height: 222px;
  padding: 10px;
  border-radius: 8px;
}

.tree-canvas-shell .tree-person-photo {
  height: 126px;
  margin: -10px -10px 10px;
  padding: 5px;
  background: #dfe5e2;
}

.tree-canvas-shell .tree-person-card.female .tree-person-photo {
  background: #eaded9;
}

.tree-canvas-shell .tree-person-photo img {
  object-fit: contain;
  object-position: center;
  background: inherit;
}

.tree-canvas-shell .tree-person-card h3 {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.2;
}

.tree-canvas-shell .tree-person-card small {
  font-size: 11px;
  line-height: 1.35;
}

.tree-canvas-shell .tree-card-badges span {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.dashboard-current-tree {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0;
  color: #4f6258;
  font-size: .88rem;
}

.dashboard-current-tree > span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(22,69,57,.18);
}
.tree-order-help { margin: -6px 0 14px; color: var(--muted,#6e746f); font-size: .82rem; }
[data-tree-card] { cursor: grab; transition: opacity .16s ease,transform .16s ease,box-shadow .16s ease; }
[data-tree-card]:active { cursor: grabbing; }
[data-tree-card].is-dragging { opacity: .42; transform: scale(.98); box-shadow: 0 14px 32px rgba(20,63,52,.22); }
[data-tree-card-list].order-saved { outline: 3px solid rgba(47,115,91,.22); outline-offset: 7px; border-radius: 6px; }
.branch-top .branch-crest { width: 92px; height: 66px; object-fit: contain; object-position: center; filter: drop-shadow(0 2px 2px rgba(0,0,0,.14)); }
.tree-order-controls { position:absolute; z-index:3; top:8px; left:8px; display:flex; gap:4px; }
.tree-order-controls button { width:32px; height:32px; border:1px solid rgba(23,63,51,.24); border-radius:4px; background:#fff; color:var(--forest); font-weight:800; cursor:pointer; }
.tree-order-controls button:hover,.tree-order-controls button:focus-visible { background:var(--forest); color:#fff; outline:2px solid #fff; }
.member-access-complete { grid-template-columns:minmax(150px,.35fr) minmax(150px,.35fr) minmax(260px,1fr) minmax(210px,.65fr); align-items:start; }
.member-access-complete fieldset { min-width:0; margin:0; padding:10px 12px; border:1px solid var(--line); }
.member-access-complete fieldset legend { font-weight:700; padding:0 5px; }
.member-access-complete .checkbox-row { display:flex; gap:7px; align-items:center; margin:6px 0; }
@media(max-width:900px){.member-access-complete{grid-template-columns:1fr}.tree-order-controls{position:static;padding:8px}.tree-order-help{font-size:12px}}

.dashboard-current-tree.needs-selection {
  color: #7a4d25;
}

.dashboard-tree-required {
  color: var(--green, #174638);
  font-weight: 800;
}

.branch-detailed.is-current-tree {
  border-color: #276653;
  box-shadow: 0 0 0 3px rgba(39,102,83,.12), 0 8px 24px rgba(38,44,38,.05);
}

.branch-detailed .branch-top {
  position: relative;
}

.branch-detailed .branch-top > span {
  position: absolute;
  right: 14px;
  top: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  padding: 4px 8px;
  color: var(--forest, #173f33);
  font: 800 .68rem/1.2 system-ui, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.branch-action-row form {
  margin: 0;
}

.branch-action-row .tree-open,
.branch-action-row .tree-card-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--green, #174638);
  padding: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.branch-action-row .danger-link {
  color: #8a352b;
}

.view-as-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.view-as-control .admin-visibility-note {
  grid-column: 1 / -1;
}

.view-as-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 0;
}

.view-as-form label {
  min-width: 210px;
}

.gedcom-security-note,
.gedcom-preview-head {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(22,69,57,.20);
  border-radius: 7px;
}

.gedcom-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #fffefb;
}

.gedcom-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.gedcom-stat-grid article {
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.gedcom-stat-grid span,
.gedcom-stat-grid b {
  display: block;
}

.gedcom-stat-grid span {
  color: var(--muted, #6e746f);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.gedcom-stat-grid b {
  margin-top: 4px;
  font: 700 1.55rem Georgia, serif;
}

.gedcom-review-grid {
  align-items: start;
}

.current-tree-confirm {
  margin-bottom: 14px;
  border: 1px solid rgba(22,69,57,.20);
  border-radius: 5px;
  background: #eef4ef;
  padding: 12px;
}

.current-tree-confirm small,
.current-tree-confirm b,
.current-tree-confirm span {
  display: block;
}

.current-tree-confirm b {
  margin: 2px 0;
  color: #173f33;
  font-size: 1.1rem;
}

.gedcom-header-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 14px;
  background: var(--line, #ddd5c8);
  border: 1px solid var(--line, #ddd5c8);
}

.gedcom-header-list > div {
  background: #fff;
  padding: 10px;
}

.gedcom-header-list dt {
  color: var(--muted, #6e746f);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gedcom-header-list dd {
  margin: 3px 0 0;
}

@media (max-width: 760px) {
  .focused-family-view {
    padding: 16px 12px;
  }

  .focused-card-row {
    gap: 12px;
  }

  .focused-card-row .tree-person-card,
  .focused-card-row.compact-cards .tree-person-card {
    flex: 1 1 132px;
    width: min(100%, 170px);
    max-width: 170px;
  }

  .view-as-control {
    grid-template-columns: 1fr;
  }

  .view-as-form,
  .gedcom-preview-head {
    align-items: stretch;
    flex-direction: column;
  }

  .gedcom-header-list {
    grid-template-columns: 1fr;
  }
}

/* Evidence-based duplicate hints (next roadmap item). */
.duplicate-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.duplicate-evidence-grid > div {
  border: 1px solid var(--line, #ddd5c8);
  border-radius: 6px;
  background: #fff;
  padding: 14px;
}

.duplicate-evidence-grid h3 {
  margin-top: 0;
}

.duplicate-evidence-grid ul {
  margin-bottom: 0;
  padding-left: 1.2rem;
}

@media (max-width: 760px) {
  .duplicate-evidence-grid {
    grid-template-columns: 1fr;
  }
}

/* Administration and manually approved membership milestone. */
.admin-hero {
  display: grid;
  grid-template-columns: minmax(240px, .85fr) minmax(0, 1.4fr);
  gap: 28px;
  margin-bottom: 22px;
  padding: clamp(20px, 4vw, 38px);
  border-radius: 10px;
  background: #173f33;
  color: #fff;
}

.admin-hero h2 { margin: 4px 0 8px; color: #fff; }
.admin-hero p { color: #dce8e1; }
.admin-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-kpis a {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  padding: 15px;
  color: #fff;
  text-decoration: none;
}
.admin-kpis a:hover, .admin-kpis a:focus-visible { background: rgba(255,255,255,.15); }
.admin-kpis b { font: 700 1.8rem/1 Georgia, serif; }
.admin-kpis span { margin-top: 7px; font-size: .78rem; }
.admin-section { margin-bottom: 22px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line,#ddd5c8); border-radius: 9px; background: #fffefb; }
.admin-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.admin-action-grid > a {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 4px 12px;
  min-height: 112px;
  align-content: center;
  border: 1px solid var(--line,#ddd5c8);
  border-radius: 7px;
  padding: 16px;
  color: var(--forest,#173f33);
  text-decoration: none;
}
.admin-action-grid > a:hover, .admin-action-grid > a:focus-visible { border-color: #276653; background: #f3f8f4; }
.admin-action-grid > a > span { grid-row: 1 / 3; color: #a07d58; font: 700 .72rem/1 system-ui,sans-serif; }
.admin-action-grid b, .admin-action-grid small { display: block; }
.admin-action-grid small { color: var(--muted,#6e746f); line-height: 1.45; }
.membership-request-card { width: min(720px, calc(100% - 28px)); margin-block:28px; padding:clamp(24px,5vw,48px); border-radius:12px; box-shadow:0 18px 55px rgba(15,48,39,.22); }
.membership-request-card > h1 { margin:5px 0 8px; }
.membership-request-card > p { max-width:570px; margin:10px auto 18px; line-height:1.55; }
.membership-request-card .language-switcher { margin:0 auto 16px; }
.membership-request-card form > label { display: grid; gap: 6px; margin: 0 0 16px; text-align: left; }
.membership-request-card input:not([type="radio"]):not([type="checkbox"]),.membership-request-card select { width: 100%; min-height: 50px; padding: 11px 12px; border: 1px solid var(--line,#ddd5c8); background: #fff; }
.membership-request-card textarea { width: 100%; min-height: 106px; padding: 11px 12px; border: 1px solid var(--line,#ddd5c8); background: #fff; resize: vertical; }
.membership-tier-picker,.contact-address { margin:22px 0; padding:18px; border:1px solid var(--line,#ddd5c8); border-radius:8px; text-align:left; }
.membership-tier-picker legend,.contact-address legend { padding:0 7px; font-weight:800; color:var(--forest,#173f33); }
.membership-tier-picker { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.membership-tier-picker > label { display:flex; align-items:center; gap:12px; min-height:82px; padding:14px; border:1px solid var(--line,#ddd5c8); border-radius:7px; background:#fff; cursor:pointer; }
.membership-tier-picker > label:has(input:checked) { border-color:var(--forest,#173f33); box-shadow:0 0 0 2px rgba(23,63,51,.12); background:#f4f8f5; }
.membership-tier-picker input { flex:0 0 auto; width:20px; height:20px; accent-color:var(--forest,#173f33); }
.membership-tier-picker span,.membership-tier-picker b,.membership-tier-picker small { display:block; }
.membership-tier-picker span { min-width:0; }
.membership-tier-picker small { margin-top:5px; color:var(--muted,#6e746f); }
.contact-address { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.contact-address label { display:grid; gap:6px; }
.purchase-switch { display:flex !important; align-items:flex-start; gap:12px; padding:16px; border:1px solid var(--line,#ddd5c8); border-radius:7px; background:#f7faf8; }
.purchase-switch input { width:20px !important; height:20px; margin-top:2px; accent-color:var(--forest,#173f33); }
.purchase-switch b,.purchase-switch small { display:block; }
.purchase-switch small { margin-top:5px; color:var(--muted,#6e746f); line-height:1.45; }
.membership-price { display: flex; align-items: center; justify-content: space-between; margin: 15px 0; border: 1px solid #d9c8b1; border-radius: 7px; background: #fffaf2; padding: 13px 15px; }
.membership-price b { font-size: 1.05rem; }
.venmo-button, .request-access-link {
  display: block;
  margin: 12px 0;
  border-radius: 6px;
  background: #3564d4;
  padding: 12px 15px;
  color: #fff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.request-access-link { background: transparent; color: var(--green,#174638); border: 1px solid var(--green,#174638); }
.privacy-note { border-top: 1px solid var(--line,#ddd5c8); padding-top: 12px; color: var(--muted,#6e746f); font-size: .78rem; }
.membership-list { display: grid; gap: 14px; }
.membership-item { border: 1px solid var(--line,#ddd5c8); border-radius: 8px; background: #fff; padding: 17px; }
.membership-item > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.membership-item h3, .membership-item p { margin: 0; }
.membership-item header p { margin-top: 4px; color: var(--muted,#6e746f); font-size: .8rem; }
.membership-item dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 15px 0; }
.membership-item dl > div { border-radius: 5px; background: #f8f6f1; padding: 10px; }
.membership-item dt { color: var(--muted,#6e746f); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.membership-item dd { margin: 4px 0 0; }
.membership-review-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(180px,.35fr); gap: 12px; border-top: 1px solid var(--line,#ddd5c8); padding-top: 14px; }
.membership-review-form .button-row { grid-column: 1 / -1; }
.membership-form-trap { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.membership-security-settings { margin: 6px 0; padding: 14px; border: 1px solid var(--line,#ddd5c8); border-radius: 7px; background: #faf8f2; }
.membership-security-settings legend { padding: 0 7px; color: var(--forest,#173f33); font-weight: 800; }
.membership-status-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.membership-status-filters a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line,#ddd5c8); border-radius: 999px; background: #fff; color: var(--forest,#173f33); text-decoration: none; font-weight: 800; }
.membership-status-filters a.active { border-color: var(--forest,#173f33); background: var(--forest,#173f33); color: #fff; }
.membership-status-filters span { min-width: 1.6em; border-radius: 999px; background: rgba(128,128,128,.13); padding: 2px 6px; text-align: center; font-size: .78rem; }

.media-card .button-row {
  align-items: center;
}
.media-delete-form {
  display: inline-flex;
  margin: 0;
}
.media-delete-form .media-delete-button {
  min-height: 0;
  padding: 6px 10px;
  font-size: 12px;
}
.media-library-head .section-title { align-items:flex-start; }
.media-library-filters {
  display:grid;
  grid-template-columns:minmax(250px,1.7fr) repeat(5,minmax(145px,1fr)) auto;
  gap:12px;
  align-items:end;
  margin-top:18px;
}
.media-library-filters label,
.media-bulk-toolbar > label {
  display:grid;
  gap:6px;
  color:var(--forest,#173f33);
  font-size:12px;
  font-weight:800;
}
.media-library-filters input,
.media-library-filters select,
.media-bulk-toolbar input,
.media-bulk-toolbar select {
  width:100%;
  min-height:42px;
  border:1px solid var(--line,#ddd5c8);
  border-radius:5px;
  background:#fff;
  padding:8px 10px;
  color:var(--ink,#222b25);
}
.media-library-filters button { min-height:42px; }
.complete-media-grid { grid-template-columns:repeat(auto-fill,minmax(285px,1fr)); }
.media-bulk-toolbar {
  position:sticky;
  top:8px;
  z-index:45;
  display:grid;
  grid-template-columns:minmax(155px,.7fr) repeat(3,minmax(170px,1fr)) auto;
  gap:12px;
  align-items:end;
  margin:16px 0;
  padding:14px;
  border:1px solid #c9d8d0;
  border-radius:8px;
  background:rgba(247,251,248,.97);
  box-shadow:0 8px 24px rgba(18,50,40,.12);
  backdrop-filter:blur(8px);
}
.media-selection-count {
  display:grid;
  gap:7px;
  align-self:center;
}
.media-selection-count label { font-weight:800; }
.media-selection-count strong { color:var(--muted,#6e746f); font-size:12px; }
.media-bulk-actions { align-items:center; flex-wrap:nowrap; }
.media-bulk-actions button { white-space:nowrap; }
.media-library-card { position:relative; overflow:hidden; }
.media-card-selector {
  position:absolute;
  top:10px;
  left:10px;
  z-index:4;
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 9px;
  border:1px solid rgba(255,255,255,.85);
  border-radius:999px;
  background:rgba(255,255,255,.94);
  box-shadow:0 3px 12px rgba(20,45,36,.16);
  color:var(--forest,#173f33);
  font-size:11px;
  font-weight:800;
  cursor:pointer;
}
.media-card-selector input { width:17px; height:17px; margin:0; accent-color:var(--forest,#173f33); }
.media-library-card:has(.media-select-checkbox:checked) {
  border-color:#2d7259;
  box-shadow:0 0 0 3px rgba(45,114,89,.15);
}
.media-library-card .media-copy { display:grid; gap:9px; }
.media-library-card .media-copy h3 { margin:0; }
.media-library-card .media-filename { overflow-wrap:anywhere; line-height:1.45; }
.media-status-chips { display:flex; flex-wrap:wrap; gap:6px; }
.media-status-chips span {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  border-radius:999px;
  background:#eee9df;
  padding:4px 8px;
  color:#554f45;
  font-size:10px;
  font-weight:800;
}
.media-status-chips .is-ready { background:#e2efe7; color:#225c43; }
.media-status-chips .needs-attention { background:#fff0d7; color:#875a16; }
.media-card-metadata {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin:0;
}
.media-card-metadata > div {
  min-width:0;
  border-radius:5px;
  background:#f8f6f1;
  padding:8px;
}
.media-card-metadata .span-2 { grid-column:1/-1; }
.media-card-metadata dt {
  color:var(--muted,#6e746f);
  font-size:9px;
  font-weight:800;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.media-card-metadata dd {
  margin:3px 0 0;
  overflow-wrap:anywhere;
  color:var(--ink,#222b25);
  font-size:11px;
  line-height:1.35;
}
.checkbox-row { display: flex !important; align-items: center; gap: 9px; }
.checkbox-row input { width: auto !important; }

@media (max-width: 760px) {
  .admin-hero, .admin-action-grid, .membership-review-form { grid-template-columns: 1fr; }
  .membership-review-form .button-row { grid-column: auto; }
  .membership-item > header { flex-direction: column; }
  .membership-item dl { grid-template-columns: 1fr; }
  .membership-tier-picker,.contact-address { grid-template-columns:1fr; }
  .membership-request-card { width:min(100% - 18px,720px); margin-block:9px; padding:22px 16px; }
  .media-library-filters,.media-bulk-toolbar { grid-template-columns:1fr; }
  .media-bulk-toolbar { position:static; }
  .media-bulk-actions { align-items:stretch; flex-direction:column; }
  .media-bulk-actions button { width:100%; }
  .complete-media-grid { grid-template-columns:1fr; }
}

@media (min-width:761px) and (max-width:1250px) {
  .media-library-filters { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .media-search-field { grid-column:span 2; }
  .media-bulk-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .media-bulk-actions { grid-column:1/-1; justify-content:flex-end; }
}

/* Build 57 member administration and profile-quality review. */
.access-guide { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; padding: 1px; background: var(--line,#ddd5c8); }
.access-guide > div { background: #fff; padding: 13px; }
.access-guide b, .access-guide span { display: block; }
.access-guide span { margin-top: 5px; color: var(--muted,#6e746f); font-size: .78rem; line-height: 1.45; }
.member-directory { display: grid; gap: 13px; }
.member-row { display: grid; grid-template-columns: minmax(250px,1fr) auto; gap: 14px; border: 1px solid var(--line,#ddd5c8); border-radius: 8px; background: #fff; padding: 16px; }
.member-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-identity h3, .member-identity p { margin: 0; }
.member-identity p, .member-identity small { overflow-wrap: anywhere; }
.member-identity p { margin-top: 3px; color: var(--muted,#6e746f); }
.member-identity small { display: block; margin-top: 5px; color: var(--muted,#6e746f); font-size: .72rem; }
.member-badges { text-align: right; }
.member-access-form { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(160px,.4fr) minmax(160px,.4fr) minmax(180px,1fr); align-items: end; gap: 12px; border-top: 1px solid var(--line,#ddd5c8); padding-top: 13px; }
.profile-tabs { position: sticky; top: 0; z-index: 20; box-shadow: 0 5px 12px rgba(38,44,38,.05); }
.profile-health .section-title > b { color: var(--forest,#173f33); font: 700 1.55rem/1 Georgia,serif; }
.health-meter { height: 9px; overflow: hidden; border-radius: 999px; background: #e6e2da; }
.health-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#b1743e,#2f735b); }
.quality-ready { color: #285c45; font-weight: 700; }
.quality-warning-list { margin: 13px 0; padding-left: 1.2rem; color: #71502d; font-size: .82rem; line-height: 1.55; }
.fact-row.has-alternatives { border-left: 4px solid #b17a3d; background: #fffaf2; }

.account-page .manage-head { margin-bottom: 18px; }
.account-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  border: 1px solid var(--line,#ddd5c8);
  border-radius: 8px;
  background: #fffefb;
  padding: 8px;
}
.account-toolbar > a {
  border-radius: 5px;
  padding: 9px 12px;
  color: var(--green,#174638);
  font-weight: 700;
  text-decoration: none;
}
.account-toolbar > a:hover,
.account-toolbar > a:focus-visible { background: #eee8dc; }
.account-toolbar > a.active { background: var(--forest,#173f33); color: #fff; }
.account-toolbar .language-switch { margin-left: auto; }
.account-page .view-as-control { margin-bottom: 18px; }
.account-page .admin-visibility-note {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: 5px 12px;
  line-height: 1.45;
}
.account-page .admin-visibility-note b { white-space: nowrap; }
.account-page .account-grid { align-items: start; }
.account-page .editor,
.account-page .records { border-radius: 7px; }
.account-page .account-card h2,
.account-page .editor h2,
.account-page .admin-card h2 { margin-bottom: 16px; }

.dashboard-tree-required {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 6px;
  background: #fff5df;
  padding: 8px 11px;
  color: #714c25;
  text-decoration: none;
}
.dashboard-tree-required::before { content: "Choose tree"; margin-right: 8px; border-radius: 999px; background: #173f33; padding: 3px 7px; color: #fff; font-size: .65rem; text-transform: uppercase; }
.stats > a { transition: transform .16s ease, box-shadow .16s ease; }
.stats > a:hover,
.stats > a:focus-visible { position: relative; z-index: 1; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(38,44,38,.08); }
.branch-action-row { gap: 7px 14px; }
.branch-action-row form:first-child .tree-open {
  border-radius: 5px;
  background: var(--forest,#173f33);
  padding: 8px 11px;
  color: #fff;
}
.branch-action-row .tree-card-link { padding: 8px 2px; }
.dashboard-tools { align-items: stretch; }
.dashboard-tools .panel { padding: clamp(18px,3vw,26px); }
.dashboard-tool-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.dashboard-tool-list li { margin: 0; }
.dashboard-tool-list a {
  display: block;
  height: 100%;
  border: 1px solid var(--line,#ddd5c8);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  color: var(--forest,#173f33);
  text-decoration: none;
}
.dashboard-tool-list a:hover,
.dashboard-tool-list a:focus-visible { border-color: #276653; background: #f3f8f4; }
.dashboard-tool-list b,
.dashboard-tool-list span { display: block; }
.dashboard-tool-list b { font-size: .88rem; }
.dashboard-tool-list span { margin-top: 4px; color: var(--muted,#6e746f); font-size: .73rem; line-height: 1.4; }
.companion-reference-list { display: grid; gap: 14px; }
.companion-reference { display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.65fr); gap: 20px; border: 1px solid var(--line,#ddd5c8); border-radius: 8px; background: #fff; padding: 17px; }
.companion-reference h3 { margin: 7px 0 3px; }
.reference-path { overflow-wrap: anywhere; border-radius: 4px; background: #f5f2eb; padding: 7px 9px; color: #655f56; font-family: ui-monospace,Consolas,monospace; font-size: .75rem; }
.companion-reference dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 13px 0 0; }
.companion-reference dl > div { border-top: 1px solid var(--line,#ddd5c8); padding-top: 8px; }
.companion-reference dt { color: var(--muted,#6e746f); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.companion-reference dd { margin: 3px 0 0; font-size: .8rem; }
.companion-upload { display: grid; gap: 10px; border-left: 1px solid var(--line,#ddd5c8); padding-left: 18px; }
.companion-upload textarea { min-height: 72px; }
.sensitive-export-confirm { border: 1px solid #c98b44; border-radius: 5px; background: #fff5df; padding: 10px; }
.export-scope-note { display: grid; align-content: center; gap: 4px; padding: 10px 12px; border: 1px solid var(--line,#ddd5c8); border-radius: 5px; background: #faf8f2; }
.export-scope-note small { color: var(--muted,#6e746f); line-height: 1.45; }
.membership-tier-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.membership-tier-settings article { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line,#ddd5c8); border-radius: 5px; background: #faf8f2; }
.membership-tier-picker { display: grid; gap: 8px; margin: 14px 0; padding: 12px; border: 1px solid var(--line,#ddd5c8); }
.membership-tier-picker label { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line,#ddd5c8); border-radius: 5px; background: #fff; cursor: pointer; }
.membership-tier-picker label span,.membership-tier-picker label small { display: block; }
.membership-tier-picker label small { margin-top: 2px; color: var(--muted,#6e746f); }
.contact-address { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid var(--line,#ddd5c8); }
.place-review-form { display: grid; gap: 11px; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line,#ddd5c8); border-radius: 6px; background: #faf8f2; }
.place-review-form label { display: grid; gap: 5px; font-size: .78rem; font-weight: 700; }
.place-review-form input,.place-review-form select,.place-review-form textarea { width: 100%; padding: 9px; border: 1px solid var(--line,#ddd5c8); background: #fff; }
.place-review-form textarea { min-height: 84px; resize: vertical; }
.place-review-form .form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.place-review-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin: 0 0 12px; }
.place-review-summary a { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line,#ddd5c8); border-radius: 6px; background: #fff; color: var(--forest,#143f34); text-decoration: none; }
.place-review-summary b { font: 700 1.3rem Georgia,serif; }
.place-review-summary span { color: var(--muted,#6e746f); font-size: .7rem; text-transform: uppercase; }
.place-batch-actions { display: flex; justify-content: space-between; gap: 12px; align-items: end; margin: 0 0 15px; padding: 12px; border: 1px solid var(--line,#ddd5c8); background: #fffdf8; }
.place-batch-actions form { display: flex; align-items: end; gap: 8px; margin: 0; }
.place-batch-actions label { display: grid; gap: 4px; font-size: .75rem; font-weight: 700; }
.place-batch-actions select { min-width: 190px; padding: 9px; border: 1px solid var(--line,#ddd5c8); background: #fff; }
.place-batch-list { display: grid; gap: 8px; }
.place-batch-list article { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line,#ddd5c8); background: #faf8f2; }
.place-batch-list b,.place-batch-list small { display: block; }
.place-batch-list small { color: var(--muted,#6e746f); }
.person-family-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-bottom: 14px; }
.person-family-actions a { padding: 12px; border-radius: 5px; background: var(--forest,#143f34); color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
.person-family-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.person-family-summary article { padding: 12px; border: 1px solid var(--line,#ddd5c8); background: #faf8f2; }
.person-family-summary h3 { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 1rem; }
.person-family-summary article > a { display: block; padding: 7px 0; border-top: 1px solid var(--line,#ddd5c8); color: var(--forest,#143f34); font-weight: 700; text-decoration: none; }
.person-family-summary small { display: block; color: var(--muted,#6e746f); font-weight: 400; }
.person-life-events { margin-top: 14px; }
.person-life-events > a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line,#ddd5c8); color: var(--forest,#143f34); text-decoration: none; }
.person-media-strip { display: grid; grid-template-columns: repeat(auto-fill,minmax(125px,1fr)); gap: 10px; margin-top: 13px; }
.person-media-strip a { min-width: 0; border: 1px solid var(--line,#ddd5c8); background: #fff; color: var(--forest,#143f34); text-decoration: none; }
.person-media-strip img,.person-media-strip span { display: grid; place-items: center; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eee9df; }
.person-media-strip b { display: block; padding: 8px; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.life-story-draft-button { margin: 12px 0 6px; }
.custom-membership-tier { border-style: dashed !important; background: #fffdf8 !important; }
.print-controls-expanded { display: grid !important; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 16px; align-items: end; padding:24px; border:1px solid #d8d0c2; border-radius:10px; background:linear-gradient(180deg,#fff,#faf8f3); box-shadow:0 10px 28px rgba(29,55,46,.08); }
.print-controls-expanded label { display: grid; gap: 7px; color:var(--forest,#173f33); font-size:.7rem; font-weight:800; letter-spacing:.03em; }
.print-controls-expanded input,.print-controls-expanded select,.print-controls-expanded textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfc6b7; border-radius:5px; background: #fff; color:var(--ink,#24312a); }
.print-controls-expanded input:focus,.print-controls-expanded select:focus,.print-controls-expanded textarea:focus { border-color:var(--forest,#173f33); outline:3px solid rgba(23,63,51,.12); }
.print-controls-expanded textarea { min-height:78px; }
.print-controls-expanded fieldset { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 22px; margin:3px 0; padding:16px; border: 1px solid #d8d0c2; border-radius:7px; background:#f5f2eb; }
.print-controls-expanded fieldset legend { padding:0 7px; color:var(--forest,#173f33); font-weight:800; }
.print-controls-expanded fieldset label { display: flex; align-items: center; gap: 6px; }
.print-controls-expanded fieldset input { width: auto; min-height: 0; }
.print-controls-expanded > button { min-height:48px; border-radius:6px; font-weight:800; }
.print-controls-expanded > button:last-child { background:#9b6b45; }
.print-guide-invitation { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:16px 18px; border:1px solid #c9d9d2; border-radius:7px; background:#edf5f1; }
.print-guide-invitation div { display:grid; gap:3px; }
.print-guide-invitation b { color:var(--forest,#173f33); font-size:1rem; }
.print-guide-invitation span { color:#5e6c65; font-size:.84rem; }
.print-guide-invitation button { flex:0 0 auto; min-height:42px; }
.print-guide-dialog { width:min(1180px,94vw); max-width:none; height:min(88vh,920px); max-height:none; padding:0; border:0; border-radius:14px; background:#f7f3ea; color:var(--ink,#24312a); box-shadow:0 28px 80px rgba(10,27,22,.35); }
.print-guide-dialog::backdrop { background:rgba(10,25,21,.74); backdrop-filter:blur(3px); }
.print-guide-shell { height:100%; overflow:auto; overscroll-behavior:contain; }
.print-guide-shell > header { position:sticky; z-index:4; top:0; display:flex; justify-content:space-between; gap:24px; padding:25px 30px 20px; border-bottom:1px solid #d8d0c2; background:rgba(255,253,248,.97); }
.print-guide-shell > header h2 { margin:2px 0 5px; font:700 clamp(1.7rem,3vw,2.7rem)/1.05 Georgia,serif; }
.print-guide-shell > header p:last-child { max-width:800px; margin:0; color:#647069; }
.print-guide-close { width:44px; height:44px; padding:0; border:1px solid #cfc6b7; border-radius:50%; background:#fff; color:var(--forest,#173f33); font-size:1.8rem; line-height:1; cursor:pointer; }
.print-guide-jump { position:sticky; z-index:3; top:116px; display:flex; flex-wrap:wrap; gap:8px; padding:11px 30px; border-bottom:1px solid #ddd5c8; background:rgba(247,243,234,.97); }
.print-guide-jump a { padding:7px 12px; border-radius:99px; background:#fff; color:var(--forest,#173f33); font-size:.78rem; font-weight:800; text-decoration:none; }
.print-guide-shell > section { scroll-margin-top:180px; padding:30px; border-bottom:1px solid #ddd5c8; }
.print-guide-shell h3 { margin:0; font:700 1.55rem/1.15 Georgia,serif; }
.print-guide-layouts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.print-guide-card { display:grid; grid-template-columns:155px minmax(0,1fr); gap:15px; align-items:center; padding:14px; border:1px solid #d8d0c2; border-radius:9px; background:#fff; }
.print-guide-card h4 { margin:0 0 5px; color:var(--forest,#173f33); font-size:1rem; }
.print-guide-card p { margin:0 0 7px; color:#58655f; font-size:.84rem; line-height:1.45; }
.print-guide-card small { display:block; line-height:1.4; }
.print-guide-card > button { grid-column:2; justify-self:start; border:0; background:transparent; color:var(--forest,#173f33); font-weight:800; text-decoration:underline; cursor:pointer; }
.print-example { position:relative; display:grid; grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(2,1fr); gap:6px; width:155px; aspect-ratio:1.45; padding:10px; overflow:hidden; border-radius:6px; background:#f0ece3; }
.print-example i { position:relative; z-index:1; min-width:0; border:1px solid #9ba9a2; border-radius:3px; background:#fff; box-shadow:0 2px 4px rgba(20,50,40,.08); }
.print-example-connected i,.print-example-connected_descendants i,.print-example-pedigree i,.print-example-descendants i,.print-example-hourglass i,.print-example-bowtie i { height:23px; align-self:center; }
.print-example-connected::before,.print-example-connected_descendants::before,.print-example-pedigree::before,.print-example-descendants::before,.print-example-hourglass::before,.print-example-bowtie::before { content:""; position:absolute; inset:25% 12%; border-top:2px solid #8ca096; border-bottom:2px solid #8ca096; }
.print-example-wide,.print-example-families,.print-example-album,.print-example-profile,.print-example-book { grid-template-columns:repeat(2,1fr); }
.print-example-families i { border-left:5px solid #caa26a; }
.print-example-album i::before,.print-example-profile i::before,.print-example-book i::before { content:""; display:block; height:45%; background:#c9d8d1; }
.print-example-fan { border-radius:100px 100px 7px 7px; transform:scale(.92); }
.print-example-fan i:nth-child(1) { grid-column:2; }
.print-example-timeline,.print-example-directory,.print-example-sources { grid-template-columns:1fr; }
.print-example-timeline i { border-left:7px solid #b68655; }
.print-example-directory { gap:3px; }
.print-example-directory i { height:9px; border-radius:0; }
.print-example-sources { gap:5px; }
.print-example-sources i { border:0; border-bottom:2px solid #aaa; box-shadow:none; background:transparent; }
.print-guide-table-wrap { overflow:auto; }
.print-guide-table { width:100%; border-collapse:collapse; background:#fff; }
.print-guide-table th,.print-guide-table td { padding:13px; border:1px solid #d8d0c2; text-align:left; vertical-align:top; }
.print-guide-tip-grid,.print-guide-content { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px; margin-top:18px; }
.print-guide-tip-grid article,.print-guide-content article { padding:17px; border:1px solid #d8d0c2; border-radius:7px; background:#fff; }
.print-guide-tip-grid p,.print-guide-content p { margin:6px 0 0; color:#5e6963; line-height:1.45; }
.print-theme-guide { display:grid; grid-template-columns:repeat(7,minmax(100px,1fr)); gap:10px; }
.print-theme-guide article { display:grid; gap:6px; text-align:center; }
.print-theme-guide small { line-height:1.35; }
.theme-swatch { display:block; height:70px; border:1px solid #cfc6b7; border-radius:7px; background:#f6f2e9; box-shadow:inset 0 0 0 8px #fff; }
.theme-swatch-modern { background:linear-gradient(135deg,#153f34 50%,#d9b267 50%); }
.theme-swatch-minimal { background:#fff; }
.theme-swatch-memorial { background:linear-gradient(135deg,#e3e0dc,#7b7b7b); }
.theme-swatch-photo { background:linear-gradient(135deg,#a9c5c0,#e3b6a8,#d5c48b); }
.theme-swatch-heritage { background:linear-gradient(135deg,#6e4328,#d7b980); }
.theme-swatch-botanical { background:linear-gradient(135deg,#315845,#c8d8b1); }
.print-guide-privacy { margin-top:18px; padding:18px; border-left:5px solid #9b6b45; background:#f2e8d8; }
.print-guide-privacy p { margin:5px 0 0; }
.print-guide-shell > footer { display:flex; justify-content:flex-end; padding:22px 30px 30px; }
@media (max-width:850px) {
  .print-guide-layouts,.print-guide-tip-grid,.print-guide-content { grid-template-columns:1fr; }
  .print-theme-guide { grid-template-columns:repeat(2,minmax(100px,1fr)); }
  .print-guide-card { grid-template-columns:120px minmax(0,1fr); }
  .print-example { width:120px; }
  .print-guide-jump { position:static; }
}
@media (max-width:560px) {
  .print-guide-invitation,.print-guide-shell > header { align-items:stretch; flex-direction:column; }
  .print-guide-card { grid-template-columns:1fr; }
  .print-guide-card > button { grid-column:1; }
  .print-example { width:100%; max-width:220px; }
}
.print-theme-modern .print-document { font-family: Arial,sans-serif; }
.print-theme-minimal .print-document { box-shadow: none; border: 0; }
.print-theme-memorial .print-document { border-top: 8px solid #4d4d4d; }
.print-theme-photo .print-document { border-top: 8px solid #9a684b; }
.print-theme-heritage .print-document { background: #fbf4df; }
.print-theme-botanical .print-document { border: 7px double #66816d; }
.print-fit-shrink .print-document { font-size: .82em; }
.publication-cover { min-height: 8.4in; display: grid; align-content: center; justify-items: center; gap: 18px; padding: 60px; border: 10px double var(--forest,#173f33); text-align: center; break-after: page; }
.publication-cover > p { color: #966746; font-weight: 800; letter-spacing: .2em; }
.publication-cover h1 { margin: 0; font-size: 3.2rem; }
.publication-cover h2 { margin: 0; color: var(--muted,#6e746f); font-weight: 400; }
.publication-cover blockquote { max-width: 540px; margin: 30px 0; font: italic 1.15rem/1.7 Georgia,serif; }
.publication-toc { padding: 24px 10%; break-after: page; }
.publication-toc ol { columns: 2; column-gap: 50px; padding-left: 24px; }
.publication-toc li { padding: 5px 0; border-bottom: 1px dotted #bbb; break-inside: avoid; }
.publication-front-matter { break-after:page; }
.publication-photo { display: block; width: 110px; height: 110px; object-fit: contain; object-position: center; margin: 0 auto 12px; border: 1px solid var(--line,#ddd5c8); background: #ece9e2; }
.publication-initial { display: grid; place-items: center; color: #8d6548; font: 700 42px Georgia,serif; }
.publication-events { margin: 16px 0 0; padding: 0; border-left: 2px solid #cbbda7; list-style: none; }
.publication-events li { position: relative; display: grid; grid-template-columns: minmax(105px,.35fr) 1fr; gap: 12px; padding: 0 0 14px 18px; }
.publication-events li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--forest,#173f33); }
.publication-events span { color: var(--muted,#6e746f); }
.publication-chart { text-align: center; }
.chart-core { width: 220px; margin: 0 auto 28px; padding: 22px; border: 4px double #9b764b; border-radius: 50%; }
.chart-people { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 14px; }
.chart-people article { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line,#ddd5c8); text-align: left; break-inside: avoid; }
.chart-people .publication-photo { width: 58px; height: 68px; margin: 0; }
.chart-people b,.chart-people small { display: block; }
.chart-relationship-key { margin-top: 24px; columns: 2; text-align: left; }
.chart-relationship-key p { padding: 7px; border-bottom: 1px solid var(--line,#ddd5c8); break-inside: avoid; }
.publication-chart-fan .chart-people { grid-template-columns: repeat(5,minmax(130px,1fr)); }
.publication-chart-bowtie .chart-people,.publication-chart-hourglass .chart-people { grid-template-columns: repeat(3,minmax(170px,1fr)); }
.publication-timeline article { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line,#ddd5c8); break-inside: avoid; }
.publication-timeline article > header { display: flex; align-items: center; gap: 15px; }
.publication-timeline article > header .publication-photo { width: 72px; height: 82px; margin: 0; }
.publication-timeline h2 { margin: 0 0 3px; }
.publication-directory { overflow-x: auto; }
.publication-directory table { width: 100%; border-collapse: collapse; }
.publication-directory th,.publication-directory td { padding: 9px; border: 1px solid var(--line,#ddd5c8); text-align: left; }
.publication-directory th { background: #edf1ed; }
.publication-directory tr { break-inside: avoid; }
.publication-sources article { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line,#ddd5c8); break-inside: avoid; }
.publication-sources article > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--forest,#173f33); color: white; }
.publication-connected-tree { break-inside:avoid; }
.publication-connected-tree > header { margin-bottom:18px; text-align:center; }
.publication-connected-tree > header h2 { margin-bottom:4px; }
.publication-connected-tree > header p { margin:0; color:var(--muted,#6e746f); }
.connected-tree-canvas { width:100%; overflow:auto; padding:12px; border:1px solid var(--line,#ddd5c8); background:#f4f1e9; }
.connected-tree-canvas svg { display:block; width:100%; height:auto; min-width:760px; }
.print-studio > .version-footer { margin-top:36px; }
@media screen {
  body[class*="print-layout-"] .print-document { max-width:none; padding:0; border:0; background:transparent; box-shadow:none; }
  .print-document > .publication-cover,
  .print-document > .publication-front-matter,
  .print-document > .publication-connected-tree,
  .print-document > .publication-notes-page,
  .print-document > .print-tree-grid,
  .print-document > .family-groups,
  .print-document > .publication-chart,
  .print-document > .publication-timeline,
  .print-document > .publication-directory,
  .print-document > .publication-sources,
  .print-document > .publication-profiles {
    width:min(100%,8.5in);
    min-height:11in;
    margin:0 auto 34px;
    padding:.55in;
    border:1px solid #ddd6ca;
    background:#fff;
    box-shadow:0 16px 42px rgba(24,50,41,.14);
  }
  .print-document > .publication-cover { padding:.55in; border:10px double var(--forest,#173f33); }
  .print-document > .publication-connected-tree { display:flex; flex-direction:column; justify-content:center; }
  .print-document > footer { width:min(100%,8.5in); margin:-82px auto 34px; padding:18px .55in; position:relative; z-index:2; }
}
.publication-sources h2 { margin: 0 0 5px; font-size: 1.05rem; }
.publication-profiles article { position: relative; }
.publication-profiles .publication-photo { width: 190px; height: 210px; border-radius: 8px; }
.publication-biography { max-width: 760px; margin: 18px auto; font: 1rem/1.65 Georgia,serif; }
.publication-profiles aside { margin-top: 25px; padding: 14px; border: 1px dashed #a78b76; background: #fff9ee; }
.publication-notes-page { min-height: 8.4in; padding: 35px; break-before: page; }
.publication-notes-page div { height: 34px; border-bottom: 1px solid #b9b9b9; }
.publication-mirrored { padding-left: 58px; padding-right: 42px; }
.quick-create-person { margin-top: 8px; padding: 13px; border: 1px dashed #a88452; border-radius: 6px; background: #fffaf0; }
.quick-create-person small { color: var(--muted,#6e746f); line-height: 1.45; }
.tree-card-quick{position:absolute;left:7px;bottom:6px;border:0;border-radius:999px;background:#173f34;color:#fff;padding:4px 8px;font-size:9px;font-weight:800;cursor:pointer;z-index:3}
.person-quick-backdrop{display:none;position:fixed;inset:0;border:0;background:rgba(18,30,25,.48);z-index:2450}
.person-quick-drawer{display:none;position:fixed;left:50%;top:50%;width:min(94vw,820px);max-height:min(90vh,900px);background:#f8f5ed;border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.32);z-index:2500;padding:24px;overflow:auto;transform:translate(-50%,-46%) scale(.98);opacity:0;transition:transform .18s ease,opacity .18s ease}
.person-drawer-open{overflow:hidden}.person-drawer-open .person-quick-backdrop{display:block}.person-drawer-open .person-quick-drawer{display:block;transform:translate(-50%,-50%) scale(1);opacity:1}
.person-quick-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:16px}
.person-quick-head>div{min-width:0}.person-quick-head img{width:58px;height:58px;object-fit:cover;border-radius:50%;float:left;margin-right:12px}.person-quick-head h2{margin:2px 0;font-size:26px}.person-quick-head button{border:0;background:#eee7da;width:42px;height:42px;border-radius:50%;font-size:26px;cursor:pointer}
.person-quick-form fieldset{border:1px solid var(--line);padding:12px;margin:12px 0}.person-quick-form legend{font-weight:800;padding:0 6px}.person-quick-message{min-height:24px;color:#275e49;font-weight:700}.person-quick-relations{border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:18px 0;padding:15px 0}.person-quick-loading{padding:40px 10px;text-align:center;color:var(--muted)}
@media(max-width:620px){.person-quick-drawer{width:calc(100% - 18px);max-height:calc(100vh - 18px);padding:16px;border-radius:12px}.person-quick-form .form-grid{grid-template-columns:1fr}.tree-card-quick{font-size:10px;padding:6px 9px}}
.dna-result-profile details{margin:12px 0}.dna-chromosome-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}.dna-chromosome-list span{background:#edf3ef;border:1px solid #cfddd5;border-radius:999px;padding:5px 8px;font-size:11px}.dna-profile-warnings{background:#fff3dc;border-left:4px solid #c8882d;padding:8px 11px;margin:10px 0}.dna-profile-warnings p{margin:3px 0;font-size:12px}
:root {
  --signed-in-sidebar-width: 250px;
  --signed-in-content-max: 1480px;
  --signed-in-content-gutter: clamp(20px,3vw,40px);
}
.persistent-sidebar-shell,
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--signed-in-sidebar-width) minmax(0,1fr);
  background: var(--paper,#f5f1e8);
}
.persistent-sidebar-content,
.shell > main {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  margin-left: 0;
}
.persistent-sidebar-content > .manage-wrap,
.shell > main > .content {
  width: 100%;
  max-width: var(--signed-in-content-max);
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--signed-in-content-gutter);
  padding-left: var(--signed-in-content-gutter);
}
.mobile-nav-toggle,.mobile-nav-backdrop,.mobile-sidebar-head { display:none; }
.primary-sidebar,
.persistent-sidebar-shell > aside.primary-sidebar,
.shell > aside.primary-sidebar { position: sticky; top: 0; z-index: 2000; display: flex; flex-direction: column; width: var(--signed-in-sidebar-width); height: 100vh; padding: 0; overflow: visible; background: var(--forest,#143f34); color: #fff; }
/* The dashboard's older .shell > aside rule enables vertical scrolling and
   consequently clips horizontal flyouts. Keep this more-specific override so
   every submenu can extend over the page instead of disappearing behind it. */
.shell > aside.primary-sidebar { z-index: 2000; overflow: visible; }
.primary-sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 28px 24px 22px; color: #fff; text-decoration: none; }
.primary-sidebar .brand > span { color: #d4a547; font-size: 30px; }
.primary-sidebar .brand b,.primary-sidebar .brand small { display: block; }
.primary-sidebar .brand small { margin-top: 3px; opacity: .68; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
.primary-sidebar nav { display: grid; gap: 3px; padding: 8px 16px; }
.sidebar-group { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 34px; border-radius: 6px; }
.sidebar-group.active,.sidebar-group:hover,.sidebar-group:focus-within,.sidebar-group.is-open { background: rgba(255,255,255,.1); }
.sidebar-main { display: flex; align-items: center; gap: 11px; min-height: 45px; padding: 9px 5px 9px 12px; color: #edf5f1; text-decoration: none; }
.sidebar-main > span { width: 18px; text-align: center; opacity: .8; }
.sidebar-main b { font-size: .88rem; font-weight: 500; }
.sidebar-expand { margin: 6px 4px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #fff; font-size: 23px; cursor: pointer; }
.sidebar-flyout { position: absolute; top: 0; left: 100%; z-index: 2100; display: none; width: 245px; padding: 10px; border: 1px solid #d8d0c2; border-radius: 0 7px 7px 7px; background: #fffdf8; box-shadow: 0 12px 32px rgba(15,40,32,.25); color: var(--ink,#24312a); }
.sidebar-group:hover .sidebar-flyout,.sidebar-group:focus-within .sidebar-flyout,.sidebar-group.is-open .sidebar-flyout { display: grid; }
.sidebar-flyout strong { padding: 8px 10px; color: var(--forest,#143f34); font-family: Georgia,serif; font-size: 1.08rem; }
.sidebar-flyout a { padding: 10px; border-radius: 4px; color: var(--forest,#143f34); text-decoration: none; font-size: .82rem; font-weight: 700; }
.sidebar-flyout a:hover,.sidebar-flyout a:focus-visible { background: #edf3ef; }
.primary-sidebar .aside-foot { margin-top: auto; padding: 20px 24px 25px; border-top: 1px solid rgba(255,255,255,.16); }
.primary-sidebar .aside-foot small,.primary-sidebar .aside-foot b { display: block; }
.primary-sidebar .admin-sidebar-build { display: block; margin-bottom: 10px; color: #d8bc68; font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.primary-sidebar .aside-foot .signout { margin-top: 12px; padding: 0; border: 0; background: transparent; color: #e6c86d; text-decoration: underline; }
.admin-section-toolbar { display: grid; grid-template-columns: repeat(4,minmax(145px,1fr)); align-items: stretch; overflow: visible; }
.admin-section-toolbar > a { display: flex; align-items: center; min-height: 44px; }
.admin-section-toolbar .language-switch { grid-column: -2 / -1; justify-self: end; margin-left: 0; }

/* Role-aware deterrence for paid/member and View As sessions. */
.protected-member-view {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.protected-member-view input,
.protected-member-view textarea,
.protected-member-view select,
.protected-member-view [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}
.protected-member-view img {
  -webkit-user-drag: none;
  user-drag: none;
}
.protected-watermark {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-template-rows: repeat(4,1fr);
  pointer-events: none;
  overflow: hidden;
  opacity: .09;
}
.protected-watermark span {
  align-self: center;
  justify-self: center;
  width: 260px;
  color: #173f33;
  font: 700 .72rem/1.35 system-ui,sans-serif;
  text-align: center;
  transform: rotate(-24deg);
}

@media (max-width: 900px) {
  .access-guide { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-section-toolbar { grid-template-columns: repeat(2,minmax(140px,1fr)); }
}
@media (max-width: 700px) {
  .access-guide, .member-row, .member-access-form { grid-template-columns: 1fr; }
  .member-badges { text-align: left; }
  .profile-tabs { position: static; }
  .account-toolbar { align-items: stretch; flex-direction: column; }
  .account-toolbar .language-switch { align-self: flex-start; margin-left: 0; }
  .account-page .admin-visibility-note { grid-template-columns: 1fr; }
  .dashboard-tool-list { grid-template-columns: 1fr; }
  .companion-reference { grid-template-columns: 1fr; }
  .companion-upload { border-top: 1px solid var(--line,#ddd5c8); border-left: 0; padding-top: 15px; padding-left: 0; }
  .companion-reference dl { grid-template-columns: 1fr; }
  .protected-watermark { grid-template-columns: repeat(2,1fr); }
  .membership-tier-settings,.contact-address { grid-template-columns: 1fr; }
  .person-family-actions,.person-family-summary { grid-template-columns: 1fr; }
  .print-controls-expanded { grid-template-columns: 1fr; }
  .chart-people,.publication-chart-fan .chart-people,.publication-chart-bowtie .chart-people,.publication-chart-hourglass .chart-people { grid-template-columns: 1fr; }
  .publication-toc ol,.chart-relationship-key { columns: 1; }
  .place-review-form .form-grid,.place-review-summary { grid-template-columns: 1fr; }
  .place-batch-actions,.place-batch-actions form,.place-batch-list article { align-items: stretch; flex-direction: column; }
}
@media (max-width: 900px) {
  .persistent-sidebar-shell,
  .shell { display:block; padding-top:62px; }
  .shell > main,
  .persistent-sidebar-content { width:100%; min-width:0; margin-left:0; }
  .persistent-sidebar-content { width:100%; }
  .persistent-sidebar-content > .manage-wrap,
  .shell > main > .content {
    max-width:none;
    padding-right:clamp(15px,4vw,24px);
    padding-left:clamp(15px,4vw,24px);
  }
  .mobile-nav-toggle { position:fixed; top:10px; left:10px; z-index:2205; display:flex; align-items:center; gap:9px; min-height:44px; padding:9px 14px; border:1px solid #d8d0c2; border-radius:7px; background:#fffdf8; box-shadow:0 4px 16px rgba(15,40,32,.18); color:var(--forest,#143f34); font-size:.95rem; cursor:pointer; }
  .mobile-nav-toggle span { font-size:1.25rem; line-height:1; }
  .mobile-nav-backdrop { position:fixed; inset:0; z-index:2190; width:100%; height:100%; border:0; background:rgba(11,28,23,.52); cursor:pointer; }
  body.mobile-nav-open .mobile-nav-backdrop { display:block; }
  body.mobile-nav-open { overflow:hidden; }
  .primary-sidebar,
  .persistent-sidebar-shell > aside.primary-sidebar,
  .shell > aside.primary-sidebar { position:fixed; inset:0 auto 0 0; z-index:2200; display:flex; width:min(88vw,330px); max-width:calc(100vw - 32px); height:100dvh; overflow-x:hidden; overflow-y:auto; box-shadow:10px 0 34px rgba(7,25,19,.35); transform:translateX(-105%); transition:transform .22s ease; }
  body.mobile-nav-open .primary-sidebar,
  body.mobile-nav-open .persistent-sidebar-shell > aside.primary-sidebar,
  body.mobile-nav-open .shell > aside.primary-sidebar { transform:translateX(0); }
  .mobile-sidebar-head { position:sticky; top:0; z-index:3; display:flex; align-items:center; justify-content:space-between; min-height:52px; padding:8px 14px 8px 22px; background:#0e332a; border-bottom:1px solid rgba(255,255,255,.15); color:#fff; font-weight:800; }
  .mobile-nav-close { display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:6px; background:rgba(255,255,255,.1); color:#fff; font-size:1.7rem; cursor:pointer; }
  .primary-sidebar .brand { justify-content:flex-start; padding:20px 22px 14px; }
  .primary-sidebar .brand div,.primary-sidebar .sidebar-main b,.primary-sidebar .aside-foot small,.primary-sidebar .aside-foot b,.primary-sidebar .admin-sidebar-build { display:block; }
  .primary-sidebar nav { padding:8px 12px 16px; }
  .sidebar-group { grid-template-columns:minmax(0,1fr) 44px; }
  .sidebar-main { justify-content:flex-start; min-height:48px; padding:10px 8px 10px 12px; }
  .sidebar-main > span { width:22px; font-size:18px; }
  .sidebar-main b { font-size:.96rem; }
  .sidebar-expand { position:static; inset:auto; margin:4px; color:#fff; font-size:24px; }
  .sidebar-flyout { position:static; grid-column:1/-1; width:auto; margin:0 7px 8px; border-radius:6px; box-shadow:none; }
  .sidebar-group:hover .sidebar-flyout,.sidebar-group:focus-within .sidebar-flyout { display:none; }
  .sidebar-group.is-open .sidebar-flyout { display:grid; }
  .sidebar-flyout strong { display:none; }
  .sidebar-flyout a { min-height:42px; display:flex; align-items:center; }
  .primary-sidebar .aside-foot { margin-top:18px; padding:18px 22px 26px; text-align:left; }
  .primary-sidebar .aside-foot form { margin:0; }
  .primary-sidebar .aside-foot .signout { min-height:40px; }
}

@media (prefers-reduced-motion:reduce) {
  .primary-sidebar { transition:none; }
}

@media print {
  /* Print Studio must output only the prepared publication. The expanded
     control grid uses !important on screen, so it needs an equally explicit
     print override here. */
  .print-studio > .no-print,
  .print-studio > .print-controls,
  .print-studio > .print-controls-expanded,
  .print-studio > .version-footer,
  .print-studio > header,
  .primary-sidebar,
  .mobile-nav-toggle,
  .mobile-nav-backdrop,
  .admin-toolbar,
  .action-toolbar {
    display: none !important;
  }
  .persistent-sidebar-shell { display: block !important; min-height: 0 !important; }
  .persistent-sidebar-content { width: 100% !important; min-width: 0 !important; }
  body[class*="print-layout-"] { margin: 0 !important; background: #fff !important; }
  body[class*="print-layout-"] .manage-wrap.print-studio { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  body[class*="print-layout-"] .print-document { display: block !important; max-width: none !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }
  .connected-tree-canvas { overflow:visible !important; border:0 !important; padding:0 !important; }
  .connected-tree-canvas svg { min-width:0 !important; max-width:100% !important; height:auto !important; }
  .publication-cover,.publication-toc,.publication-notes-page { break-after: page; }
  .publication-front-matter,.publication-connected-tree { break-after:page; }
  .publication-page-numbers { counter-reset: publication-page; }
  .publication-page-numbers > section { counter-increment: publication-page; }
  .publication-page-numbers > section::after { content: "Page " counter(publication-page); display: block; margin-top: 18px; color: #777; font-size: 9pt; text-align: center; }
  .print-fit-shrink .publication-chart,.print-fit-shrink .print-tree-grid { width: 121.95%; transform: scale(.82); transform-origin: top left; }
  .protected-member-view > * { display: none !important; }
  .protected-member-view::before {
    display: block;
    padding: 48px;
    color: #111;
    content: "Printing protected family archive content is disabled for this account.";
    font: 700 18px/1.5 system-ui,sans-serif;
  }
}
.batch-file-names{display:grid;gap:10px;margin-top:18px}
.batch-file-name{display:grid;grid-template-columns:minmax(180px,.8fr) minmax(220px,1.2fr);gap:14px;align-items:center;padding:12px;border:1px solid var(--line,#ddd5c8);border-radius:8px;background:#fff}
.batch-file-name span{overflow-wrap:anywhere;color:var(--muted,#6c7069)}
.batch-upload-results{display:grid;gap:10px;margin:18px 0}
.batch-upload-results article{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:14px;border:1px solid var(--line,#ddd5c8);border-radius:8px;background:#fff}
.batch-upload-results small{display:block}
@media(max-width:700px){.batch-file-name{grid-template-columns:1fr}.batch-upload-results article{align-items:stretch;flex-direction:column}}

/* Local OCR progress and result states. */
.ocr-progress-shell{
  display:block;
  width:100%;
  height:8px;
  margin:-7px 0 12px;
  overflow:hidden;
  border:1px solid var(--line,#ddd5c8);
  border-radius:999px;
  background:#eee8dc;
}
.ocr-progress-shell[hidden]{display:none}
.ocr-progress-bar{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#2c6b59,#d29a3d);
  transition:width .2s ease;
}
.ocr-cancel-button{
  margin-left:.55rem;
}
@media (max-width:680px){
  .ocr-cancel-button{
    width:100%;
    margin-left:0;
  }
}
.ocr-status.is-working{border-left:4px solid #2c6b59;background:#eef5f1}
.ocr-status.is-success{border-left:4px solid #32805c;background:#e4f2e9;color:#173d32}
.ocr-status.is-warning{border-left:4px solid #c98723;background:#fbf2df;color:#704914}
.ocr-status.is-error{border-left:4px solid #b74438;background:#fae8e5;color:#8b2f27}
#read-image-text[aria-busy="true"]{cursor:progress;opacity:.78}
@media (prefers-reduced-motion:reduce){
  .ocr-progress-bar{transition:none}
}

/* Administrator visual relationship editor. Dragging stages genealogy changes;
   the server applies them only after the review form is confirmed. */
.visual-editor-safety{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:center;
  margin-bottom:18px;
}
.visual-editor-safety h2{margin:.15rem 0 .4rem}
.visual-editor-safety p:last-child{max-width:850px;margin-bottom:0}
.visual-focus-controls{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:end;
  margin-bottom:18px;
}
.visual-focus-controls form{flex:1;max-width:700px}
.visual-focus-controls label,.visual-focus-controls select{display:block;width:100%}
.visual-focus-actions{display:flex;align-items:center;gap:12px;margin-top:10px}
.visual-focus-actions [data-visual-focus-status]{color:#667068;font-size:.9rem}
.visual-focus-controls > div{display:grid;gap:2px;text-align:right}
.visual-focus-controls strong{font:700 1.2rem/1.2 Georgia,serif}
.visual-tree-workspace{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(290px,.75fr);
  gap:18px;
  align-items:start;
  scroll-margin-top:18px;
}
.visual-tree-workspace:focus{outline:none}
.visual-family-canvas{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  min-height:720px;
  padding:28px;
  border-radius:10px;
  color:#f7f3eb;
  background:
    radial-gradient(circle at 50% 22%,rgba(255,255,255,.08),transparent 32%),
    #3f4241;
  box-shadow:0 12px 30px rgba(24,29,27,.16);
}
.visual-canvas-title{
  grid-column:1/-1;
  text-align:center;
}
.visual-canvas-title h2{margin:.1rem 0;color:#fff}
.visual-canvas-title p:last-child{margin:.3rem auto 0;max-width:720px;color:#d9dcd8}
.visual-focus-card{
  grid-column:1/-1;
  display:flex;
  justify-content:center;
  position:relative;
}
.visual-focus-card::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:-19px;
  width:1px;
  height:19px;
  background:#aeb4af;
}
.visual-drop-zone{
  min-height:235px;
  padding:16px;
  border:2px dashed #8d9690;
  border-radius:9px;
  outline:none;
  background:rgba(255,255,255,.035);
  transition:border-color .15s ease,background .15s ease,transform .15s ease;
}
.visual-drop-zone:focus-visible{
  border-color:#f2bd53;
  box-shadow:0 0 0 3px rgba(242,189,83,.22);
}
.visual-drop-zone.is-drag-over{
  border-color:#f2bd53;
  background:rgba(242,189,83,.13);
  transform:translateY(-2px);
}
.visual-drop-zone header{margin-bottom:12px}
.visual-drop-zone h3{margin:0;color:#fff}
.visual-drop-zone header small{color:#c7cdc8}
.visual-existing-cards{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(132px,1fr));
  gap:10px;
}
.visual-existing-wrap{display:grid;gap:5px}
.visual-existing-wrap > a{color:#f1d896;font-size:.78rem;text-align:center}
.visual-empty-role{color:#d1d5d2;font-style:italic}
.visual-person-card{
  display:grid;
  grid-template-rows:82px 1fr;
  min-width:0;
  overflow:hidden;
  border:1px solid #d9d5cc;
  border-radius:7px;
  color:#202723;
  background:#fff;
  box-shadow:0 4px 12px rgba(18,26,22,.15);
}
.visual-person-image{
  display:grid;
  place-items:center;
  overflow:hidden;
  color:#486875;
  background:#dce8ed;
  font:700 2rem/1 Georgia,serif;
}
.visual-person-image img{width:100%;height:100%;object-fit:cover}
.visual-person-card > div:nth-child(2){display:grid;gap:4px;padding:10px}
.visual-person-card b{line-height:1.16;overflow-wrap:anywhere}
.visual-person-card small{color:#68706b}
.visual-person-source{
  cursor:grab;
  grid-template-columns:70px minmax(0,1fr);
  grid-template-rows:auto auto;
}
.visual-person-source:active{cursor:grabbing}
.visual-person-source .visual-person-image{grid-row:1/-1;min-height:92px}
.visual-person-source .visual-stage-button{
  margin:0 10px 10px;
  padding:7px 9px;
  border:0;
  border-radius:5px;
  color:#fff;
  background:#174738;
  cursor:pointer;
}
.visual-person-source.is-dragging{opacity:.55}
.visual-person-source.is-staged{outline:3px solid #d7a53f;outline-offset:1px}
.visual-people-palette{
  position:sticky;
  top:18px;
  max-height:calc(100vh - 36px);
  overflow:auto;
  padding:20px;
  border:1px solid var(--line,#ddd5c8);
  border-radius:9px;
  background:#fbfaf7;
}
.visual-palette-head{display:grid;gap:14px}
.visual-palette-head h2{margin:.1rem 0}
.visual-palette-head label,.visual-palette-head input{display:block;width:100%}
.visual-keyboard-choice{
  margin:15px 0;
  padding:12px;
  border:1px solid #ddd5c8;
  border-radius:7px;
  background:#f2eee5;
}
.visual-keyboard-choice label,.visual-keyboard-choice select{display:block;width:100%}
.visual-keyboard-choice p{margin:.5rem 0 0;color:#626b65;font-size:.83rem}
.visual-palette-list{display:grid;gap:10px}
.visual-person-card[hidden]{display:none}
.visual-pending-panel{grid-column:1/-1}
.visual-pending-list{display:grid;gap:8px;margin:0 0 18px;padding:0;list-style:none}
.visual-pending-list li{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
  padding:12px 14px;
  border:1px solid #ddd5c8;
  border-left:4px solid #d7a53f;
  border-radius:6px;
  background:#fff;
}
.visual-confirm-review{margin:14px 0}
.visual-confirm-review input{margin-top:.2rem}
@media(max-width:1000px){
  .visual-tree-workspace{grid-template-columns:1fr}
  .visual-people-palette{position:static;max-height:none}
  .visual-palette-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .visual-editor-safety,.visual-focus-controls{align-items:stretch;flex-direction:column}
  .visual-focus-controls > div{text-align:left}
  .visual-family-canvas{grid-template-columns:1fr;min-height:0;padding:18px}
  .visual-drop-zone{grid-column:1;min-height:180px}
  .visual-palette-list{grid-template-columns:1fr}
  .visual-pending-list li{align-items:stretch;flex-direction:column}
}
@media(prefers-reduced-motion:reduce){
  .visual-drop-zone{transition:none}
}
