:root {
  --bg: #f7f3ea;
  --panel: #fffaf2;
  --panel-soft: #f1eadf;
  --ink: #28231d;
  --muted: #746b60;
  --line: #ded3c2;
  --section-line: #e7ddd0;
  --accent: #7f6245;
  --button: #28231d;
  --button-ink: #fffaf2;
  --button-hover: #3b332a;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scrollbar-gutter: stable;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #4fb4d8 rgba(79, 180, 216, 0.12);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(79, 180, 216, 0.12);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #4fb4d8;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  touch-action: manipulation;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  touch-action: manipulation;
}

a {
  color: inherit;
}

.material-symbols-outlined {
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  overflow: hidden;
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
}

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.public-brand {
  display: flex;
  align-items: center;
}

.public-brand picture {
  display: flex;
  align-items: center;
}

.public-brand img {
  width: 150px;
  max-height: 42px;
  object-fit: contain;
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.public-nav a,
.nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.public-nav a:hover,
.public-nav a[aria-current="page"],
.nav-list a:hover,
.nav-list a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

.public-main {
  padding: 24px 24px 56px;
}

.content-card {
  width: min(1120px, 100%);
  min-height: 344px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.content-card > * + * {
  border-top: 1px solid var(--section-line);
}

.public-hero {
  display: grid;
  width: min(1220px, 100%);
  height: clamp(280px, 46vh, 520px);
  margin: 0 auto;
  place-items: end center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(rgba(247, 243, 234, 0.34), rgba(247, 243, 234, 0.34)),
    var(--hero-image) center center / cover no-repeat,
    var(--panel-soft);
}

.public-hero img {
  display: block;
  width: min(420px, 82vw);
  max-height: 100%;
  object-fit: contain;
}

.memorials-page {
  background: #fff;
}

.memorials-hero {
  display: grid;
  height: 136px;
  place-items: center;
  background:
    linear-gradient(rgba(226, 221, 239, 0.6), rgba(226, 221, 239, 0.6)),
    var(--hero-image) center center / cover no-repeat;
}

.memorials-hero img {
  width: min(300px, 72vw);
  height: auto;
}

.memorials-hero .holder-hero-mark {
  width: min(220px, 54vw);
  max-height: 180px;
  object-fit: contain;
}

.holder-page .memorials-hero:has(.holder-hero-mark) {
  height: auto;
  min-height: 136px;
  padding: 18px 20px;
}

.memorials-main {
  padding: 8px;
}

.memorial-filter {
  position: relative;
  display: block;
  min-height: 54px;
  margin-bottom: 5px;
  padding: 15px 14px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  color: #49535f;
  font-size: 18px;
  line-height: 22px;
  outline: 0;
  overflow: hidden;
  white-space: nowrap;
  caret-color: #28323d;
}

.memorial-filter:empty::before,
.memorial-filter[data-empty="true"]::before {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #49535f;
  pointer-events: none;
}

.memorial-filter:focus:empty::before,
.memorial-filter:focus[data-empty="true"]::before {
  content: "";
}

.memorial-filter:focus {
  border-color: #bfc8d6;
  box-shadow: 0 0 0 3px rgba(79, 180, 216, 0.16);
}

.directory-filter {
  text-align: center;
}

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

.holder-topbar {
  grid-template-columns: auto minmax(0, 1fr);
}

.holder-name {
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holder-page .memorials-main {
  padding-bottom: 0;
}

.holder-page .memorials-grid {
  grid-template-columns: repeat(auto-fit, 150px);
  justify-content: center;
}

.holder-footer {
  display: grid;
  gap: 10px;
  min-height: 58px;
  margin-top: 100px;
  place-items: center;
  padding: 16px;
  color: #7a7a7a;
  font-size: 13px;
  font-weight: 700;
}

.holder-footer-logo {
  display: block;
  width: auto;
  max-width: min(150px, 68vw);
  max-height: 58px;
  object-fit: contain;
}

.holder-agency-info {
  display: grid;
  gap: 6px;
  max-width: min(520px, 92vw);
  margin: 0;
  color: #555f68;
  font-style: normal;
  line-height: 1.45;
  text-align: center;
}

.holder-agency-info span,
.holder-agency-info a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: inherit;
  text-decoration-color: rgba(79, 180, 216, 0.45);
  text-underline-offset: 3px;
}

.holder-agency-info .material-symbols-outlined {
  color: #4fb4d8;
  font-size: 17px;
}

.memorial-card {
  display: grid;
  align-content: start;
  min-height: 196px;
  padding: 12px 8px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  color: #000;
  line-height: 1.7;
  text-align: center;
  text-decoration: none;
}

.directory-grid {
  grid-template-columns: repeat(auto-fill, minmax(136px, 176px));
  justify-content: center;
}

.directory-card {
  min-height: 118px;
  align-content: center;
  gap: 6px;
  padding: 12px 10px;
}

.memorial-card:hover {
  border-color: #c9d6df;
  box-shadow: 0 2px 12px rgba(36, 45, 54, 0.08);
}

.memorial-thumb-wrap {
  display: grid;
  justify-items: center;
  padding: 4px;
}

.memorial-thumb {
  display: block;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border: 2px solid #d8d8d8;
  border-radius: 999px;
  object-fit: cover;
  filter: blur(2px);
}

.memorial-primary {
  display: grid;
  gap: 0;
  min-height: 66px;
  place-items: center;
}

.memorial-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.memorial-year,
.memorial-place,
.memorial-family {
  font-size: 11px;
  line-height: 1.55;
}

.memorial-family {
  color: #536070;
}

.memorial-provider {
  color: #536070;
  font-size: 9px;
  line-height: 1.35;
}

.memorial-card[hidden] {
  display: none;
}

.directory-icon {
  display: block;
  margin: 0 auto;
  color: #4fb4d8;
  font-size: 24px;
  line-height: 1;
}

.associates-list {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.associate-row {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}

.associate-row:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--panel-soft);
}

.associate-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
}

.associate-row span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.associate-row[hidden] {
  display: none;
}

.has-hero .public-main .content-card {
  position: relative;
  z-index: 1;
  margin-top: -48px;
  box-shadow: 0 18px 48px rgba(48, 38, 24, 0.12);
}

.heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 112px;
  padding: 28px 24px 24px;
}

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

.title {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--button);
  border-radius: 5px;
  background: var(--button);
  color: var(--button-ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--button-hover);
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.mobile-nav-button {
  display: none;
}

.cards,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 20px;
}

.action-card {
  display: grid;
  gap: 10px;
  min-height: 152px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  text-decoration: none;
}

.action-card strong {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-card b {
  font-size: 22px;
  line-height: 1.1;
}

.action-card span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-grid > .panel {
  border-right: 1px solid var(--section-line);
}

.dashboard-grid > .panel:nth-child(2n) {
  border-right: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--section-line);
  background: color-mix(in srgb, var(--ink) 2%, var(--panel));
}

.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 17px;
}

.list {
  display: grid;
}

.list-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 13px 20px;
  border-top: 1px solid var(--section-line);
}

.list-row:first-child {
  border-top: 0;
}

.list-row[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  box-shadow: inset 4px 0 0 var(--accent);
}

.row-link {
  padding-right: 40px;
  color: inherit;
  text-decoration: none;
}

.list-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.list-row span {
  color: var(--muted);
  font-size: 14px;
}

mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.guide-layout {
  --accent: #4fb4d8;
  align-items: start;
}

.guide-menu {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.mobile-content-switcher {
  display: none;
}

.mobile-content-switcher label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

.markdown-body {
  max-width: 820px;
  padding: 24px;
  line-height: 1.65;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  line-height: 1.18;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child,
.markdown-body p:first-child {
  margin-top: 0;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.notice {
  padding: 16px 20px;
  border-top: 1px solid var(--section-line);
  color: var(--ink);
  font-weight: 700;
}

.donation-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px;
}

.donation-panel .markdown-body {
  justify-self: stretch;
}

.donation-form {
  display: grid;
  width: min(560px, 100%);
  gap: 10px;
}

.donation-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.donation-form input,
.donation-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.donation-form textarea {
  min-height: 76px;
  resize: vertical;
}

.donation-amounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.donation-amounts label {
  display: block;
}

.donation-amounts input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.donation-amounts span {
  display: grid;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 900;
  place-items: center;
}

.donation-amounts input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent);
}

.donation-details {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 1.5%, var(--panel));
}

.donation-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
}

.donation-details[open] summary {
  color: var(--ink);
}

.donation-payment {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.donation-express {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.donation-payment[hidden] {
  display: none;
}

.donation-form [hidden] {
  display: none;
}

.donation-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.donation-result-panel {
  text-align: center;
}

.donation-result-icon {
  color: #4aaed8;
  font-size: 46px;
}

.donation-result-panel h2,
.donation-result-panel p {
  margin: 0;
}

.donation-result-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(520px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.donation-result-summary div {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-left: 1px solid var(--section-line);
}

.donation-result-summary div:first-child {
  border-left: 0;
}

.donation-result-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.donation-result-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.donation-button {
  position: relative;
  width: auto;
  min-width: 112px;
  overflow: hidden;
  isolation: isolate;
}

.donation-button::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  z-index: -1;
  background: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.34) 50%, transparent 58%);
  transform: translateX(-60%);
  animation: donation-shine 5s ease-in-out infinite;
}

@keyframes donation-shine {
  0%,
  52% {
    transform: translateX(-60%);
    opacity: 0;
  }
  62% {
    opacity: 1;
  }
  82%,
  100% {
    transform: translateX(60%);
    opacity: 0;
  }
}

.stripe-methods {
  width: min(260px, 100%);
  height: auto;
  justify-self: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 18px 20px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

dialog {
  position: fixed;
  inset: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 32px));
  margin: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  overflow: auto;
  scrollbar-gutter: stable;
}

.dialog-close-form {
  position: absolute;
  top: 10px;
  right: 10px;
  margin: 0;
}

.dialog-close {
  width: 34px;
  height: 34px;
}

dialog .nav-list {
  display: grid;
  gap: 6px;
  padding-top: 38px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 900px) {
  .public-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 14px 20px;
  }

  .memorials-hero {
    height: 110px;
  }

  .hide-mobile-hero .memorials-hero {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .memorials-main {
    padding: 6px;
  }

  .memorials-grid {
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    gap: 6px;
  }

  .holder-page .memorials-grid {
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    justify-content: stretch;
  }

  .holder-page .memorials-main {
    padding-right: 5px;
    padding-left: 5px;
  }

  .holder-topbar {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .holder-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
  }

  .holder-name {
    font-size: 14px;
  }

  .memorial-card {
    min-height: 190px;
  }

  .directory-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .directory-card {
    min-height: 112px;
    padding: 11px 8px;
  }

  .donation-result-summary {
    grid-template-columns: 1fr;
  }

  .donation-result-summary div,
  .donation-result-summary div:first-child {
    border-top: 1px solid var(--section-line);
    border-left: 0;
  }

  .donation-result-summary div:first-child {
    border-top: 0;
  }

  .public-nav {
    display: none;
  }

  .mobile-nav-button {
    display: inline-grid;
  }

  .public-main {
    padding: 8px 8px 28px;
  }

  .content-card {
    width: auto;
    margin: 8px 8px 0;
  }

  .public-hero {
    height: clamp(260px, 42vh, 400px);
  }

  .has-hero .public-main .content-card {
    margin-top: -32px;
  }

  .heading {
    display: block;
    min-height: auto;
    padding: 28px 20px 20px;
  }

  .heading .button {
    width: 100%;
    margin-top: 20px;
  }

  .cards,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid > .panel {
    border-right: 0;
    border-top: 1px solid var(--section-line);
  }

  .dashboard-grid > .panel:first-child,
  .guide-layout > .markdown-panel {
    border-top: 0;
  }

  .mobile-content-switcher {
    position: sticky;
    top: 76px;
    z-index: 4;
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--section-line);
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .guide-menu {
    display: none;
  }

  .markdown-body {
    padding: 18px 16px 20px;
  }

  .cards {
    padding: 14px 12px 14px;
  }

  .site-footer {
    display: grid;
  }
}
