/* Shared visual tokens and application shell. Keep native text zoom and focus visible. */
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
/* The reader's text-size choice scales every rem-based size; percentages keep the browser's own setting. */
html[data-text-size="large"] {
  font-size: 112.5%;
}
html[data-text-size="larger"] {
  font-size: 125%;
}
:root {
  --hb-ground: #f4f4f0;
  --hb-surface: #ffffff;
  --hb-ink: #1b1f1c;
  --hb-muted: #5b625d;
  --hb-faint: #7d847e;
  --hb-hair: #e2e4df;
  --hb-glass: rgba(255, 255, 255, 0.74);
  --hb-glass-edge: rgba(27, 31, 28, 0.08);
  --hb-glass-shadow: 0 0.9rem 1.8rem -1.3rem rgba(22, 32, 26, 0.38);
  --hb-display: "Instrument Serif", Georgia, serif;
  --hb-text: "EB Garamond", Georgia, serif;
  --hb-header-h: 5.5rem;
  --fz-paper: #f7f6f1;
  --fz-surface: #fffefa;
  --fz-ink: #293e35;
  --fz-muted: #6c786f;
  --fz-line: #d9dfd3;
  --fz-green: #345944;
  --fz-soft: #edf1e7;
  --fz-control-line: #adbba6;
  --fz-control-hover: #a9baa5;
  --fz-control-focus: #345944;
  --fz-radius: 12px;
  --fz-font:
    "Instrument Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}
body {
  margin: 0;
  background: var(--fz-paper);
  color: var(--fz-ink);
  font-family: var(--fz-font);
  line-height: 1.5;
}

/* Shared interaction primitives. Page styles define layout; these own controls. */
button.fz-button,
button.fz-icon-button {
  appearance: none;
  font: 500 0.875rem/1.2 var(--fz-font);
  color: var(--fz-ink);
  background: var(--fz-surface);
  border: 1px solid var(--fz-control-line);
  border-radius: 8px;
  cursor: pointer;
}
button.fz-button {
  min-height: 38px;
  padding: 8px 12px;
}
button.fz-button--compact {
  min-height: 34px;
  padding: 6px 10px;
}
button.fz-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
}
button.fz-button:hover,
button.fz-icon-button:hover {
  background: var(--fz-soft);
  border-color: var(--fz-control-hover);
}
button.fz-button svg,
button.fz-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
article.fz-section,
details.fz-section {
  margin: 0;
  padding: 12px 0;
  color: var(--fz-ink);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--fz-line);
  border-radius: 0;
}
details.fz-section > summary {
  color: var(--fz-ink);
  font: 600 0.9rem/1.4 var(--fz-font);
}
.fz-header.site-header {
  box-sizing: border-box;
  min-height: 5.5rem;
  height: auto;
  margin: 0;
  padding: 0.9rem clamp(1rem, 3vw, 2.6rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  background: transparent;
  color: var(--hb-ink);
  position: relative;
  z-index: 5;
}
.fz-brand.site-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--hb-ink);
}
.fz-brand.site-brand > span {
  font: 400 2.5rem/1 var(--hb-display);
  letter-spacing: -0.015em;
}
.fz-header :is(.fz-nav, .fz-tools) {
  background: var(--hb-glass);
  border: 1px solid var(--hb-glass-edge);
  border-radius: 999px;
  box-shadow:
    var(--hb-glass-shadow),
    inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
.fz-nav.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.3rem;
  height: auto;
  min-width: 0;
}
.fz-nav.site-nav a {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border-radius: 999px;
  font: 500 1rem/1.2 var(--fz-font);
  text-decoration: none;
  white-space: nowrap;
  color: var(--hb-muted);
  transition:
    color 0.2s,
    background 0.2s;
}
.fz-nav.site-nav a:hover {
  color: var(--hb-ink);
  background: rgba(255, 255, 255, 0.7);
}
.fz-nav.site-nav a[aria-current] {
  color: var(--hb-ink);
  background: var(--hb-surface);
  box-shadow:
    0 0.35rem 0.9rem -0.5rem rgba(22, 32, 26, 0.45),
    0 0 0 1px rgba(27, 31, 28, 0.06);
}
.fz-nav.site-nav a:after {
  display: none;
}
.fz-tools.site-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.3rem;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.fz-tools button {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--hb-ink);
  cursor: pointer;
  transition: background 0.2s;
}
.fz-tools button:hover {
  background: var(--hb-surface);
}
.fz-tools svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}
.hb-text-size {
  display: flex;
  align-items: center;
  padding: 0 0.45rem 0 0.35rem;
  margin-right: 0.2rem;
  border-right: 1px solid var(--hb-hair);
}
.fz-tools .hb-text-size button {
  min-width: 2rem;
  font-family: var(--hb-display);
  line-height: 1;
  color: var(--hb-faint);
}
.fz-tools .hb-text-size button:nth-child(1) {
  font-size: 1.05rem;
}
.fz-tools .hb-text-size button:nth-child(2) {
  font-size: 1.35rem;
}
.fz-tools .hb-text-size button:nth-child(3) {
  font-size: 1.7rem;
}
.fz-tools .hb-text-size button[aria-pressed="true"] {
  color: var(--hb-ink);
}
.fz-access {
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--hb-muted);
  padding: 0 0.35rem 0 0.6rem;
  white-space: nowrap;
}
.hb-initial {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--hb-ink);
  color: #fff;
  font: 400 1.25rem/1 var(--hb-display);
}
/* Text fields show focus by their caret and a slightly darker border, never a ring. */
:is(input, select, textarea):is(:focus, :focus-visible) {
  outline: none;
  box-shadow: none;
}
:where(input, select, textarea):focus {
  border-color: #9aa19b !important;
}
:where(input, select, textarea):hover:not(:disabled) {
  border-color: var(--fz-control-hover);
}
.fz-header :is(a, button):focus-visible,
.fz-page :is(a, button, summary, [tabindex]):focus-visible,
:where(.people-review-dialog, .person-portrait-dialog, .album-name-dialog)
  :is(a, button, summary):focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--fz-surface),
    0 0 0 4px rgba(27, 31, 28, 0.3);
}
/* Focus rings: none after a mouse click or tap, a soft ring for keyboard users. */
:focus:not(:focus-visible) {
  outline: none;
}
:is(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid rgba(27, 31, 28, 0.35);
  outline-offset: 3px;
}
#people-directory.fz-page,
#photo-people-review.fz-page {
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 28px 64px;
  color: var(--fz-ink);
  font-family: var(--fz-font);
}
.fz-page h1 {
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}
.fz-page h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.fz-page h3 {
  font-size: 1.05rem;
}
.fz-page p {
  line-height: 1.55;
}
.fz-page > p,
.fz-page > [data-people-content] > p {
  color: var(--fz-muted);
}
#people-directory.fz-page button,
#photo-people-review.fz-page button {
  font: inherit;
  border-radius: 8px;
  cursor: pointer;
}
#people-directory.fz-page input,
#people-directory.fz-page select,
#people-directory.fz-page textarea,
#photo-people-review.fz-page input,
#photo-people-review.fz-page select {
  font: inherit;
  color: var(--fz-ink);
  border: 1px solid var(--fz-control-line);
  border-radius: 8px;
  background: var(--fz-surface);
  box-sizing: border-box;
  padding: 10px;
  max-width: 100%;
  min-width: 0;
}
.fz-page button:disabled {
  cursor: default;
  opacity: 0.55;
}
.fz-page [hidden] {
  display: none !important;
}
.fz-page .directory-controls,
.fz-page .people-bulk,
.fz-page .people-processing,
.fz-page .group-relationship,
.fz-page .person-manage {
  border: 1px solid var(--fz-line);
  background: var(--fz-surface);
  border-radius: var(--fz-radius);
  padding: 20px;
}
.fz-page .people-processing {
  margin: 24px 0;
}
.fz-page .directory-controls {
  gap: 18px;
}
.fz-page summary {
  cursor: pointer;
  font-weight: 600;
}
.fz-page .person-directory-card,
.fz-page .people-group-card {
  background: var(--fz-surface);
  border: 1px solid var(--fz-line);
  border-radius: var(--fz-radius);
  box-shadow: none;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.fz-page .person-directory-card:hover,
.fz-page .people-group-card:hover {
  background: #f2f5ed;
  border-color: #9bac91;
}
.fz-page .person-directory-card h2 {
  font-size: 1.1rem;
}
.fz-page .person-directory-card p {
  color: var(--fz-muted);
}
.fz-page .person-tree-status {
  background: var(--fz-soft);
  font-size: 0.8rem;
}
.fz-page .people-review-views {
  gap: 8px;
  margin: 24px 0;
}
.fz-page .people-review-views button {
  border: 1px solid var(--fz-line);
  padding: 9px 14px;
  background: var(--fz-surface);
  color: var(--fz-ink);
}
.fz-page .people-review-views button[aria-pressed="true"] {
  background: var(--fz-green);
  border-color: var(--fz-green);
  color: white;
}
.fz-page [data-bulk-confirm],
.fz-page [data-confirm-person],
.fz-page [data-create-person],
.fz-page [data-person-details] > button,
.fz-page [data-relation] > button {
  background: var(--fz-green) !important;
  color: white !important;
  border: 1px solid var(--fz-green) !important;
  padding: 10px 16px;
}
.fz-page [data-library-status]:not(:empty),
.fz-page [data-people-status]:not(:empty) {
  font-size: 0.9rem;
  color: var(--fz-muted);
}
.fz-page .person-profile {
  margin: 20px 0 32px;
}
.fz-page .person-photos {
  gap: 20px;
}
.fz-page .person-photos article {
  background: var(--fz-surface);
  border-color: var(--fz-line);
}
.fz-page .person-relatives a {
  background: var(--fz-soft);
}
.fz-account {
  font: 1rem/1.5 var(--fz-font);
  color: var(--fz-ink);
  background: var(--fz-surface);
  border: 1px solid var(--fz-line);
  border-radius: 16px;
  padding: 24px;
  width: min(420px, 85vw);
}
.fz-account::backdrop {
  background: #16271c88;
}
.fz-account > button:first-child {
  float: right;
}
.fz-account button {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid var(--fz-line);
  border-radius: 8px;
  background: var(--fz-soft);
  cursor: pointer;
}
@media (max-width: 1180px) {
  .fz-header.site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    row-gap: 0.5rem;
    column-gap: 1rem;
  }
  .fz-header.site-header::after {
    content: "";
    order: 2;
    flex-basis: 100%;
  }
  .fz-nav.site-nav {
    order: 3;
    flex: 0 1 auto;
    margin-right: auto;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .fz-access {
    display: none;
  }
}
@media (max-width: 600px) {
  #people-directory.fz-page,
  #photo-people-review.fz-page {
    padding: 24px 16px 48px;
  }
  .fz-brand.site-brand > span {
    font-size: 2rem;
  }
  .fz-nav.site-nav a {
    padding: 0 0.85rem;
  }
  .hb-text-size {
    padding: 0 0.2rem;
  }
  .fz-tools .hb-text-size button {
    min-width: 1.6rem;
  }
  .fz-page .directory-controls,
  .fz-page .people-bulk,
  .fz-page .person-manage {
    padding: 16px;
  }
  .fz-page .person-profile {
    gap: 16px;
  }
  .fz-page .person-search-results {
    max-height: 16rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fz-page * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
#photo-people-review.fz-page button {
  border: 1px solid #adbba6;
  background: var(--fz-surface);
  color: var(--fz-ink);
  padding: 9px 13px;
}
#photo-people-review.fz-page .face-selection-tools button[aria-pressed="true"] {
  background: var(--fz-soft);
  border-color: var(--fz-green);
  color: var(--fz-green);
}
#photo-people-review.fz-page .people-review-views button[aria-pressed="true"] {
  background: var(--fz-green);
  border-color: var(--fz-green);
  color: white;
}
#photo-people-review.fz-page button.face-icon {
  padding: 8px;
}
#photo-people-review.fz-page button.face-exclude {
  color: #a52d2d;
  border-color: #d7abab;
}
#photo-people-review.fz-page button.people-group-card {
  padding: 18px;
  text-align: left;
  border-color: var(--fz-line);
}
.people-review-dialog,
.person-portrait-dialog,
.album-name-dialog {
  font-family: var(--fz-font);
  color: var(--fz-ink);
  background: var(--fz-surface);
  border: 1px solid var(--fz-line);
  border-radius: 16px;
}
#people-directory.fz-page .person-portrait-control {
  width: 104px;
  flex-basis: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 8px;
}
#people-directory.fz-page .person-portrait-control img,
#people-directory.fz-page .person-portrait-control .person-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}
#people-directory.fz-page
  .person-portrait-control
  > span:last-child:not(.person-placeholder) {
  font-size: 12px;
  color: var(--fz-green);
}
@media (max-width: 550px) {
  #people-directory.fz-page .person-portrait-control {
    width: 84px;
    flex-basis: 84px;
  }
  #people-directory.fz-page .person-portrait-control img,
  #people-directory.fz-page .person-portrait-control .person-placeholder {
    width: 80px;
    height: 80px;
  }
}

/* The shared account action must remain reachable in the mobile tree view. */
.fz-header .fz-tools > .icon-button {
  display: grid;
}
