/* Oldhams — isolated directory. Slate surfaces, ink accent. Do not leak into the kiosk. */

body.oldhams-app {
  --oldhams-bg: #f8fafc;
  --oldhams-card: #ffffff;
  --oldhams-ink: #0f172a;
  --oldhams-muted: #64748b;
  --oldhams-line: #e2e8f0;
  --oldhams-accent: #1e3a5f;
  --oldhams-accent-soft: #e8eef5;
  --oldhams-danger: #b42318;
  --oldhams-radius: 18px;
  --oldhams-shadow: 0 8px 24px rgb(15 23 42 / 0.06);
  background: var(--oldhams-bg);
  color: var(--oldhams-ink);
  height: auto;
  min-height: 100%;
  overscroll-behavior: auto;
}

.oldhams-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.oldhams-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.oldhams-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(248 250 252 / 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--oldhams-line);
}

.oldhams-top-inner {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.oldhams-brand,
.oldhams-brand-mark {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--oldhams-ink);
  text-decoration: none;
}

.oldhams-top-simple .oldhams-top-inner {
  align-items: flex-start;
  min-height: 0;
  padding-top: 14px;
  padding-bottom: 14px;
}

.oldhams-brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.oldhams-brand-tagline {
  margin: 0;
  max-width: 40rem;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--oldhams-muted);
}

.oldhams-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--oldhams-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  cursor: pointer;
}

.oldhams-menu-bars,
.oldhams-menu-bars::before,
.oldhams-menu-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--oldhams-ink);
  border-radius: 999px;
  position: relative;
}

.oldhams-menu-bars::before,
.oldhams-menu-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.oldhams-menu-bars::before { top: -6px; }
.oldhams-menu-bars::after { top: 6px; }

.oldhams-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.oldhams-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--oldhams-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.oldhams-tab.is-active {
  background: var(--oldhams-accent-soft);
  color: var(--oldhams-accent);
}

.oldhams-tab-logout {
  color: var(--oldhams-danger);
}

.oldhams-page-head,
.oldhams-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.oldhams-page-head { margin-bottom: 18px; }

.oldhams-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oldhams-muted);
}

.oldhams-title {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.oldhams-lede,
.oldhams-hint,
.oldhams-meta {
  color: var(--oldhams-muted);
}

.oldhams-lede {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.45;
}

.oldhams-hint,
.oldhams-meta {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.oldhams-card,
.oldhams-empty {
  background: var(--oldhams-card);
  border: 1px solid var(--oldhams-line);
  border-radius: var(--oldhams-radius);
  box-shadow: var(--oldhams-shadow);
}

.oldhams-card { padding: 20px; margin-bottom: 16px; }

.oldhams-empty {
  padding: 36px 22px;
  text-align: center;
}

.oldhams-empty-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.oldhams-empty-copy {
  margin: 0 0 18px;
  color: var(--oldhams-muted);
}

.oldhams-section-title,
.oldhams-card-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 800;
}

.oldhams-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 650;
  color: #475569;
}

.oldhams-form,
.oldhams-fieldset,
.oldhams-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.oldhams-fieldset {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--oldhams-line);
}

.oldhams-fieldset:last-of-type { border-bottom: 0; }

.oldhams-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.oldhams-field { min-width: 0; }

.oldhams-app .form-input,
.oldhams-app .form-select,
.oldhams-app .form-textarea {
  min-height: 48px;
  border-radius: 12px;
  border-color: #e2e8f0;
}

.oldhams-app .form-textarea {
  min-height: 112px;
  resize: vertical;
}

.oldhams-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--oldhams-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.oldhams-btn-primary {
  background: var(--oldhams-accent);
  color: #fff;
}

.oldhams-btn-secondary {
  border-color: var(--oldhams-line);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.oldhams-btn-ghost {
  background: transparent;
  color: var(--oldhams-muted);
}

.oldhams-btn-danger {
  background: transparent;
  color: var(--oldhams-danger);
}

.oldhams-btn-block { width: 100%; }

.oldhams-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.oldhams-search,
.oldhams-upload,
.oldhams-inline-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.oldhams-search { align-items: end; }

.oldhams-people,
.oldhams-card-list,
.oldhams-date-list,
.oldhams-family-members,
.oldhams-user-list,
.oldhams-contact-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.oldhams-person,
.oldhams-person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
}

.oldhams-person:active,
.oldhams-person:hover {
  background: var(--oldhams-accent-soft);
}

.oldhams-person-row { justify-content: space-between; padding-right: 0; }

.oldhams-person-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.oldhams-person-name { font-size: 16px; }

.oldhams-person-meta {
  color: var(--oldhams-muted);
  font-size: 13px;
  font-weight: 600;
}

.oldhams-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--oldhams-accent-soft);
}

.oldhams-avatar-lg { width: 88px; height: 88px; }

.oldhams-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--oldhams-accent);
}

.oldhams-households {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.oldhams-card.oldhams-household {
  padding: 16px 16px 10px;
  overflow: hidden;
  margin-bottom: 0;
}

.oldhams-household-head,
.oldhams-family-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.oldhams-household-head {
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #d5e2ef;
}

.oldhams-household-heading,
.oldhams-family-heading > div {
  min-width: 0;
}

.oldhams-household-avatar-link {
  display: block;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.oldhams-household-avatar,
.oldhams-member-avatar {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e8eef5;
}

.oldhams-household-avatar {
  width: 48px;
  height: 48px;
}

.oldhams-household-avatar-lg {
  width: 64px;
  height: 64px;
}

.oldhams-member-avatar {
  width: 40px;
  height: 40px;
}

.oldhams-photo-preview {
  margin-bottom: 8px;
}

.oldhams-household-title {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.oldhams-household-title-link {
  color: var(--oldhams-accent);
  text-decoration: none;
}

.oldhams-household-title-link:hover,
.oldhams-household-title-link:active {
  text-decoration: underline;
}

.oldhams-household-address {
  margin: 0;
  color: var(--oldhams-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.oldhams-member-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.oldhams-member-lines-children,
.oldhams-member-lines-others {
  margin-top: 6px;
  padding-top: 6px;
}

.oldhams-member-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.oldhams-member-line:hover,
.oldhams-member-line:active {
  background: var(--oldhams-accent-soft);
}

.oldhams-member-line-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.oldhams-member-line-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
}

.oldhams-member-line-title {
  color: var(--oldhams-accent);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.3;
}

.oldhams-member-line-age {
  color: var(--oldhams-muted);
  font-size: 14px;
  font-weight: 650;
}

.oldhams-member-line-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.oldhams-household-member-row,
.oldhams-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.oldhams-household-member {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--oldhams-accent);
  font-weight: 750;
  text-decoration: none;
}

.oldhams-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  white-space: nowrap;
}

.oldhams-pill-deceased {
  background: #f3e8ea;
  color: #6b4450;
  border: 1px solid #e4d0d4;
}

.oldhams-pill-role {
  background: #e8eef5;
  color: var(--oldhams-accent);
  border: 1px solid #c5d4e8;
}

a .oldhams-pill-deceased {
  color: #6b4450;
}

.oldhams-household-member:active,
.oldhams-household-member:hover {
  text-decoration: underline;
}

.oldhams-letter { margin-bottom: 18px; }

.oldhams-letter-label,
.oldhams-month-name {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oldhams-muted);
}

.oldhams-contact-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.oldhams-contact-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
}

.oldhams-contact-value {
  color: var(--oldhams-ink);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.oldhams-inline-link {
  color: var(--oldhams-accent);
  font-weight: 750;
  text-decoration: none;
}

.oldhams-profile-top,
.oldhams-family-top,
.oldhams-family-head,
.oldhams-date-row,
.oldhams-user-row {
  display: flex;
  gap: 14px;
}

.oldhams-profile-top { align-items: center; }
.oldhams-family-head {
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.oldhams-family-photo {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef2f6;
}

.oldhams-family-stack { display: flex; flex-direction: column; gap: 12px; }

.oldhams-date-when {
  width: 88px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.oldhams-date-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.oldhams-month + .oldhams-month { margin-top: 16px; }

.oldhams-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.oldhams-gallery-tile,
.oldhams-media-tile {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--oldhams-line);
}

.oldhams-gallery-tile img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.oldhams-gallery-tile figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 650;
}

.oldhams-media-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.oldhams-family-scan {
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--oldhams-line);
}

.oldhams-scan-open img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #f8fafc;
}

.oldhams-lightbox {
  position: relative;
  border: 0;
  padding: 0;
  max-width: min(94vw, 960px);
  max-height: 92vh;
  background: transparent;
}

.oldhams-lightbox::backdrop { background: rgb(15 23 42 / 0.72); }

.oldhams-lightbox img {
  display: block;
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  background: #111;
}

.oldhams-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.oldhams-auth {
  min-height: calc(100vh - 96px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.oldhams-auth-card { width: min(420px, 100%); padding: 28px 22px; }

.oldhams-auth-card .oldhams-title { margin-bottom: 16px; }

.oldhams-auth-card .oldhams-lede {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 15px;
}

.oldhams-auth-links {
  margin: 4px 0 0;
  text-align: center;
}

.oldhams-auth-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--oldhams-muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.oldhams-auth-links a:hover { color: var(--oldhams-accent); }

.oldhams-flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.oldhams-flash {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 650;
}

.oldhams-flash-notice { background: #ecfdf3; color: #166534; }
.oldhams-flash-alert { background: #fef3f2; color: var(--oldhams-danger); }

.oldhams-errors {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef3f2;
  color: var(--oldhams-danger);
  font-weight: 650;
}

.oldhams-user-row {
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--oldhams-line);
}

.oldhams-user-row:last-child { border-bottom: 0; }

.oldhams-app .file-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.oldhams-app .file-picker-trigger {
  min-height: 44px;
}

@media (min-width: 960px) {
  .oldhams-households { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 720px) {
  .oldhams-grid { grid-template-columns: 1fr 1fr; }
  .oldhams-span-2 { grid-column: span 2; }
  .oldhams-search { grid-template-columns: 1fr auto auto; }
  .oldhams-search .oldhams-label { grid-column: 1 / -1; }
  .oldhams-upload { grid-template-columns: 180px 1fr auto; align-items: end; }
}

@media (max-width: 900px) {
  .oldhams-menu-btn { display: inline-flex; }

  .oldhams-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--oldhams-line);
    border-radius: 16px;
    box-shadow: var(--oldhams-shadow);
  }

  .oldhams-nav.is-open { display: flex; }

  .oldhams-tab {
    justify-content: flex-start;
    min-height: 48px;
    border-radius: 12px;
  }
}

@media (max-width: 520px) {
  .oldhams-shell { width: min(100% - 24px, 1100px); }
  .oldhams-contact-row { grid-template-columns: 1fr auto; }
  .oldhams-contact-row .oldhams-label { grid-column: 1 / -1; }
  .oldhams-family-top { flex-direction: column; }
  .oldhams-family-photo { width: 100%; height: 200px; }
}
