/**
 * Base, layout and components.
 * Every value references a token from tokens.css (blueprint section 110).
 */

/* ---------------------------------------------------------------- reset -- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background:
    radial-gradient(
      circle at 8% -10%,
      color-mix(in srgb, var(--color-primary-soft) 70%, transparent),
      transparent 28rem
    ),
    var(--color-bg);
  min-height: 100dvh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--color-primary-border);
  color: var(--color-text);
}
img,
svg,
video {
  max-width: 100%;
  display: block;
}
/* Components set an explicit `display`, which would otherwise beat [hidden]. */
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: var(--leading-tight);
  font-weight: var(--weight-bold);
  letter-spacing: -0.01em;
}
h1,
h2 {
  font-family: var(--font-serif);
  text-wrap: balance;
}
p {
  margin: 0 0 var(--space-3);
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-3);
}

.noscript {
  padding: var(--space-5);
  text-align: center;
  color: var(--color-text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --------------------------------------------------------------- layout -- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border-bottom: 1px solid var(--color-border);
  padding-top: env(safe-area-inset-top);
}
.app-header::after {
  content: '';
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}
.is-navigating .app-header::after {
  opacity: 1;
  animation: route-progress 900ms ease-in-out infinite;
}
@keyframes route-progress {
  0% {
    transform: scaleX(0);
  }
  55% {
    transform: scaleX(0.7);
  }
  100% {
    transform: scaleX(1);
    transform-origin: right;
  }
}
.app-header__inner {
  height: var(--header-height);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.app-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  min-width: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand__mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  color: var(--color-primary);
}
.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand__name {
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  font-family: var(--font-serif);
  letter-spacing: 0.015em;
  white-space: nowrap;
}
.brand__tagline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 30rem) {
  .brand__tagline {
    display: none;
  }
}

.location-bar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/*
 * An icon dropped straight into running text has no component around it to set
 * its size, so it inherits only the base `max-width: 100%` and paints at the
 * full width of its column. Components that own their icons (.button, .chip,
 * .notice, .tabbar) size them explicitly and are unaffected by this; this is
 * the fallback for the places that do not.
 */
.location-bar svg,
.app-main p > svg,
.app-main li > svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  display: inline-block;
  vertical-align: -0.2em;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(var(--space-4), 3vw, var(--space-6)) var(--space-4)
    calc(var(--tabbar-height) + var(--space-7));
  outline: none;
}
@media (min-width: 48rem) {
  .app-main {
    padding-bottom: var(--space-7);
  }
}

.site-credit {
  order: 3;
  width: 100%;
  padding: var(--space-5) var(--space-4)
    calc(var(--tabbar-height) + var(--space-5) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background: color-mix(in srgb, var(--color-surface-raised) 72%, transparent);
  color: var(--color-text-muted);
}
.site-credit__inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  text-align: center;
}
.site-credit p {
  margin: 0;
}
.site-credit__lead {
  color: var(--color-text);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}
.site-credit__lead strong {
  color: var(--color-primary);
  font-family: var(--font-serif);
}
.site-credit__partners,
.site-credit__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
}
.site-credit__links a {
  color: var(--color-text-muted);
}
@media (min-width: 48rem) {
  .site-credit {
    padding-bottom: var(--space-5);
  }
  .site-credit__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'lead links'
      'partners links';
    align-items: center;
    column-gap: var(--space-6);
    text-align: left;
  }
  .site-credit__lead {
    grid-area: lead;
  }
  .site-credit__partners {
    grid-area: partners;
    justify-content: flex-start;
  }
  .site-credit__links {
    grid-area: links;
    justify-content: flex-end;
    margin-top: 0;
  }
}

/* --------------------------------------------------------------- tabbar -- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border-top: 1px solid var(--color-border);
}
.tabbar__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.tabbar__item:hover {
  text-decoration: none;
  color: var(--color-text);
}
.tabbar__item[aria-current='page'] {
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}
.tabbar__item[aria-current='page']::after {
  content: '';
  position: absolute;
  bottom: 0.35rem;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: var(--radius-pill);
  background: currentColor;
}
.tabbar__item svg {
  width: 1.375rem;
  height: 1.375rem;
}
.tabbar__item--primary .tabbar__badge {
  width: 2.75rem;
  height: 2.75rem;
  margin-top: -1.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
}
.tabbar__item--primary svg {
  width: 1.5rem;
  height: 1.5rem;
}
@media (min-width: 48rem) {
  /* The navigation is last in the mobile DOM so it can be a fixed bottom bar.
     Reorder the flex items on larger screens so the same navigation becomes
     a visible top-level bar directly below the header. */
  .app-header {
    order: 0;
  }
  .tabbar {
    order: 1;
  }
  .app-main {
    order: 2;
  }
  .tabbar {
    position: sticky;
    top: var(--header-height);
    bottom: auto;
    height: auto;
    justify-content: center;
    gap: var(--space-1);
    border-top: none;
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-4);
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  }
  .tabbar__item {
    position: relative;
    flex: none;
    flex-direction: row;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--text-base);
  }
  .tabbar__item[aria-current='page'] {
    background: var(--color-primary-soft);
  }
  .tabbar__item[aria-current='page']::after {
    display: none;
  }
  .tabbar__item--primary .tabbar__badge {
    width: auto;
    height: auto;
    margin: 0;
    background: none;
    color: inherit;
    box-shadow: none;
  }
}

@media (max-width: 30rem) {
  .tabbar__item {
    font-size: 0.6875rem;
    letter-spacing: -0.01em;
  }
  .tabbar__item svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* ------------------------------------------------------------ utilities -- */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stack--tight {
  gap: var(--space-2);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.muted {
  color: var(--color-text-muted);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-xs {
  font-size: var(--text-xs);
}
.reading {
  max-width: var(--reading-max);
  line-height: var(--leading-relaxed);
}
.reading p {
  margin-bottom: var(--space-4);
}

/* -------------------------------------------------------------- section -- */
.section {
  margin-bottom: clamp(var(--space-6), 5vw, var(--space-7));
}
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
/* A step up from the body text it sits above. At `--text-lg` a section
   heading and a card title were within a hair of each other, which left the
   page reading as one undifferentiated column. */
.section__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section__sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}
.section__link {
  font-size: var(--text-sm);
  white-space: nowrap;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
}
.section__link:hover {
  border-color: var(--color-primary-border);
  color: var(--color-primary);
  text-decoration: none;
}

.page-title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  margin-bottom: var(--space-2);
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.page-lede {
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  max-width: 44rem;
  font-size: var(--text-md);
}

/* -------------------------------------------------------------- profile -- */
.profile-hero {
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  margin-bottom: var(--space-5);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--color-primary-soft) 78%, transparent),
      transparent 17rem
    ),
    var(--color-surface);
}
.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--space-1);
  background: var(--color-primary);
}
.profile-hero__identity {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.profile-hero__avatar {
  width: 4rem;
  height: 4rem;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
}
.profile-hero__avatar svg {
  width: 1.75rem;
  height: 1.75rem;
}
.profile-hero__copy {
  min-width: 0;
  flex: 1;
}
.profile-hero__eyebrow,
.profile-credit__eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.profile-hero__title {
  font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.profile-hero__contact {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.profile-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.profile-hero__notice {
  margin-top: var(--space-4);
}
.profile-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}
.profile-action-card {
  display: block;
  padding: var(--space-4);
  color: inherit;
  min-width: 0;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}
.profile-action-card:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transform: translateY(-1px);
}
.profile-action-card__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 3rem;
}
.profile-action-card__icon {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.profile-action-card__icon svg,
.profile-action-card__chevron svg {
  width: 1.2rem;
  height: 1.2rem;
}
.profile-action-card__copy {
  flex: 1;
  min-width: 0;
}
.profile-action-card__copy strong,
.profile-action-card__copy span {
  display: block;
}
.profile-action-card__copy span {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-tight);
}
.profile-action-card__chevron {
  color: var(--color-text-muted);
}
.profile-credit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3) var(--space-4);
  align-items: center;
  margin-top: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  background: var(--color-primary-soft);
}
.profile-credit__mark {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-primary);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}
.profile-credit__copy h2 {
  font-size: var(--text-lg);
}
.profile-credit__copy h2 strong {
  color: var(--color-primary);
}
.profile-credit__copy p:last-child {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.profile-credit__link {
  grid-column: 1 / -1;
  justify-self: stretch;
}
.profile-signout {
  margin-top: var(--space-5);
}

@media (min-width: 42rem) {
  .profile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-credit {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .profile-credit__link {
    grid-column: auto;
    justify-self: end;
  }
}

@media (max-width: 30rem) {
  .profile-hero__identity {
    flex-direction: column;
  }
  .profile-hero__avatar {
    width: 3.5rem;
    height: 3.5rem;
  }
}

/* --------------------------------------------------------------- button -- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
  text-decoration: none;
  min-height: 2.875rem;
  box-shadow: var(--shadow-xs);
  -webkit-tap-highlight-color: transparent;
}
.button:hover {
  background: var(--color-primary-hover);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.button:active {
  transform: translateY(1px);
}
.button[disabled],
.button[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.button svg {
  width: 1.125rem;
  height: 1.125rem;
}
.button--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.button--secondary:hover {
  background: var(--color-bg-subtle);
}
.button--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}
.button--ghost:hover {
  background: var(--color-bg-subtle);
}
.button--danger {
  background: var(--color-danger);
}
.button--block {
  width: 100%;
}
.button--sm {
  padding: var(--space-2) var(--space-3);
  min-height: 2.25rem;
  font-size: var(--text-sm);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.icon-button:hover {
  background: var(--color-bg-subtle);
  text-decoration: none;
}
.icon-button svg {
  width: 1.25rem;
  height: 1.25rem;
}
.icon-button[aria-pressed='true'] {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

/* ----------------------------------------------------------------- card -- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.card--pad {
  padding: clamp(var(--space-4), 3vw, var(--space-5));
}

.temple-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: inherit;
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
.temple-card:hover {
  text-decoration: none;
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}
.temple-card__media {
  flex: none;
  width: 5rem;
  height: 5rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--color-text-muted);
}
.temple-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.temple-card__media svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}
.temple-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.temple-card__name {
  font-weight: var(--weight-medium);
  font-size: var(--text-md);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.temple-card__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.temple-card__meta > span + span::before {
  content: '\00b7';
  margin-right: var(--space-2);
  color: var(--color-border-strong);
}
.temple-card__foot {
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.card-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

/* Sacred feed cards stay calm and text-first: every preview names its source,
   while the restrained lamp-like glow separates the feed from social posts. */
.sacred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-3);
}
.sacred-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 15rem;
  padding: clamp(var(--space-4), 3vw, var(--space-5));
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--color-primary-soft) 62%, transparent),
      transparent 12rem
    ),
    var(--color-surface);
  box-shadow: var(--shadow-xs);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}
.sacred-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(
    var(--color-primary),
    color-mix(in srgb, var(--color-primary) 18%, transparent)
  );
  content: '';
}
.sacred-card:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.sacred-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.sacred-card__type,
.sacred-card__official {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.sacred-card__type {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sacred-card__official {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.sacred-card__eyebrow svg,
.sacred-card__action svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}
.sacred-card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.sacred-card__title a {
  color: inherit;
}
.sacred-card__title a:hover {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
}
.sacred-card__summary {
  display: -webkit-box;
  margin: var(--space-3) 0 var(--space-4);
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.sacred-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.sacred-card__source {
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
.sacred-card__action {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
  min-height: 2rem;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.sacred-card__action:hover {
  text-decoration: none;
}
.sacred-card--compact {
  min-height: 13rem;
}
.sacred-card--compact .sacred-card__summary {
  -webkit-line-clamp: 3;
}
.sacred-disclosure {
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
}
@media (max-width: 30rem) {
  .sacred-card__eyebrow,
  .sacred-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .sacred-card__footer {
    gap: var(--space-2);
  }
}
@media (min-width: 40rem) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 60rem) {
  .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/**
 * A horizontal rail of cards.
 *
 * Three things make the difference between a rail that reads as designed and
 * one that reads as broken, and the previous version had none of them:
 *
 * - **Fixed column width, not `1fr`.** With a flexible track the last card
 *   stretches to whatever room is left and gets sliced mid-word at the
 *   container edge, which looks like a layout bug rather than an invitation
 *   to scroll.
 * - **`scroll-padding-inline`**, so a snapped card lands against the content
 *   edge instead of under the page gutter.
 * - **A masked right edge.** The cut card fades out, which says "there is
 *   more this way" in the one way that needs no explaining.
 */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 16rem;
  gap: var(--space-3);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-2);
  margin-inline: calc(var(--space-3) * -1);
  padding-inline: var(--space-3);
  scroll-padding-inline: var(--space-3);
  scrollbar-width: none;
  /* Fade the trailing edge so a partly visible card is obviously the next
     one along. Removed once every card fits, where there is nothing to hint. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent);
}
.rail::-webkit-scrollbar {
  display: none;
}
.rail > * {
  scroll-snap-align: start;
}
@media (min-width: 60rem) {
  .rail {
    grid-auto-columns: 18rem;
  }
}
/* Wide enough for the whole set: a grid, no scrolling, no fade. */
@media (min-width: 90rem) {
  .rail {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.tile {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  min-height: 100%;
  box-shadow: var(--shadow-xs);
}
.tile:hover {
  text-decoration: none;
  border-color: var(--color-border-strong);
}
.tile__image {
  aspect-ratio: 16 / 10;
  background: var(--color-bg-subtle);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile__image svg {
  width: 2rem;
  height: 2rem;
  color: var(--color-text-muted);
  opacity: 0.4;
}
.tile__body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}
.tile__title {
  font-weight: var(--weight-medium);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tile__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ----------------------------------------------------------------- chip -- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.chip svg {
  width: 0.875rem;
  height: 0.875rem;
}
.chip--interactive {
  cursor: pointer;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition-fast);
  min-height: 2.25rem;
  padding-inline: var(--space-3);
}
.chip--interactive:hover {
  border-color: var(--color-border-strong);
  text-decoration: none;
}
.chip--interactive[aria-pressed='true'],
.chip--active {
  background: var(--color-primary-soft);
  border-color: var(--color-primary-border);
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}
.chip--open {
  color: var(--color-success);
  background: var(--color-success-soft);
  border-color: transparent;
}
.chip--closed {
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border-color: transparent;
}

/* --------------------------------------------------- trust presentation -- */
/* Blueprint section 150: verified fact, community information, tradition and
   AI summary must never be visually indistinguishable. */
.trust {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.trust svg {
  width: 0.875rem;
  height: 0.875rem;
}
.trust--official_verified {
  color: var(--color-verified);
  background: var(--color-success-soft);
}
.trust--research_reviewed {
  color: var(--color-verified);
  background: var(--color-success-soft);
}
.trust--source_supported {
  color: var(--color-sourced);
  background: var(--color-info-soft);
}
.trust--community_submitted {
  color: var(--color-community);
  background: var(--color-warning-soft);
}
.trust--unverified {
  color: var(--color-unverified);
  background: var(--color-bg-subtle);
}
.trust--disputed {
  color: var(--color-disputed);
  background: var(--color-danger-soft);
}

.narrative {
  border-left: 3px solid var(--color-border-strong);
  padding-left: var(--space-4);
}
.narrative--tradition {
  border-left-color: var(--color-community);
  background: var(--color-warning-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
}
.narrative__label {
  display: block;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  font-weight: var(--weight-medium);
}

.confidence-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  overflow: hidden;
}
.confidence-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}
.confidence-bar__fill--low {
  background: var(--color-community);
}
.confidence-bar__fill--none {
  background: var(--color-border-strong);
}

.quality-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}
.quality-item__head {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

/* ---------------------------------------------------------------- forms -- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.field__hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.field__error {
  font-size: var(--text-xs);
  color: var(--color-danger);
}
.input,
.select,
.textarea,
.field__input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 2.75rem;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}
.input:focus,
.select:focus,
.textarea:focus,
.field__input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: var(--focus-ring);
}
.input::placeholder,
.textarea::placeholder,
.field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.8;
}
.input[aria-invalid='true'] {
  border-color: var(--color-danger);
}
.textarea {
  min-height: 7rem;
  resize: vertical;
}
.field__input:is(textarea) {
  min-height: 7rem;
  resize: vertical;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
}
.checkbox input {
  margin-top: 3px;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--color-primary);
}
.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-2) var(--space-3);
  cursor: pointer;
}
.field--check input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15rem;
  accent-color: var(--color-primary);
}
.field--check .field__hint {
  grid-column: 2;
}

details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 2.75rem;
  cursor: pointer;
  color: var(--color-text);
  font-weight: var(--weight-medium);
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::after {
  content: '+';
  display: grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1;
}
details[open] > summary::after {
  content: '\2212';
}

.avatar,
.avatar--placeholder {
  flex: none;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-border);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}
.searchbar:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring), var(--shadow-sm);
  background: var(--color-surface-raised);
}
.searchbar svg {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--color-text-muted);
  flex: none;
}
.searchbar input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  min-width: 0;
  min-height: 2rem;
}

.suggestions {
  margin-top: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  overflow: hidden;
}
.suggestions__item {
  display: block;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  color: inherit;
}
.suggestions__item--button {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.suggestions__item:last-child {
  border-bottom: none;
}
.suggestions__item:hover,
.suggestions__item:focus,
.suggestions__item[aria-selected='true'] {
  background: var(--color-bg-subtle);
  text-decoration: none;
}
.suggestions--status {
  padding: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ----------------------------------------------------------------- misc -- */
.notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.notice svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  margin-top: 1px;
}
.notice--info {
  background: var(--color-info-soft);
  border-color: transparent;
  color: var(--color-info);
}
.notice--warning {
  background: var(--color-warning-soft);
  border-color: transparent;
  color: var(--color-warning);
}
.notice--danger {
  background: var(--color-danger-soft);
  border-color: transparent;
  color: var(--color-danger);
}

.empty {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--color-text-muted);
  max-width: 36rem;
  margin-inline: auto;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
}
.empty svg {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto var(--space-3);
  opacity: 0.4;
}
.empty__title {
  font-weight: var(--weight-medium);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-subtle) 25%,
    var(--color-border) 37%,
    var(--color-bg-subtle) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
.skeleton--line {
  height: 0.85rem;
  margin-bottom: var(--space-2);
}
.skeleton--card {
  height: 6.5rem;
}

.toast-stack {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-height) + var(--space-4));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(28rem, calc(100vw - var(--space-6)));
  pointer-events: none;
}
.toast {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--kt-stone-900);
  color: var(--kt-stone-0);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  pointer-events: auto;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.toast--error {
  background: var(--color-danger);
  color: #fff;
}
.toast--success {
  background: var(--color-success);
  color: #fff;
}

/* ------------------------------------------------------------ temple pg -- */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-bg-subtle);
  aspect-ratio: 16 / 9;
  max-height: 22rem;
  display: grid;
  place-items: center;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__placeholder {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-5);
}
.hero__placeholder svg {
  width: 3rem;
  height: 3rem;
  opacity: 0.35;
  margin: 0 auto;
}

.temple-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: var(--space-2);
}

.tabs {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
  scrollbar-width: thin;
  position: sticky;
  top: var(--header-height);
  z-index: 20;
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
@media (min-width: 48rem) {
  .tabs {
    top: calc(var(--header-height) + 3.9rem);
  }
}
.tabs__tab {
  padding: var(--space-3) var(--space-3);
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  font-size: var(--text-base);
}
.tabs__tab[aria-selected='true'] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: var(--weight-medium);
}

.datalist {
  display: grid;
  gap: var(--space-2);
}
.datalist__row {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) 1fr;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-base);
}
.datalist__row:last-child {
  border-bottom: none;
}
.datalist__key {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
@media (max-width: 30rem) {
  .datalist__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.timing-day {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.timing-day--today {
  font-weight: var(--weight-medium);
  color: var(--color-primary);
}

.source-item {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

/* ------------------------------------------------------------------ map -- */
.map-page {
  display: grid;
  gap: var(--space-3);
}
.map-page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}
.map-page__head .page-lede {
  margin-bottom: 0;
}
.map-page__actions {
  display: flex;
  gap: var(--space-2);
  flex: none;
}
.map-filter-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-1) 2px var(--space-2);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.map-filter-row::-webkit-scrollbar {
  display: none;
}
.map-filter-row > * {
  flex: none;
  scroll-snap-align: start;
}
.map-shell {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  box-shadow: var(--shadow-md);
}
.map-shell--explore {
  border-radius: var(--radius-xl);
}
.map-canvas {
  /* A collapsed container is the single most common way a Leaflet map ends up
     as a black rectangle: it measures itself once, at creation, and a height
     of zero means it never asks for a tile. The floors below make that
     impossible on any screen. */
  height: min(68vh, 46rem);
  min-height: 32.5rem; /* 520px */
  width: 100%;
  background: var(--color-bg-subtle);
}
@media (max-width: 640px) {
  .map-canvas {
    height: 62vh;
    min-height: 28rem;
  }
  .map-page__head {
    align-items: flex-start;
    flex-direction: column;
  }
  .map-page__actions {
    width: 100%;
  }
  .map-page__actions > * {
    flex: 1;
  }
  .map-shell--explore {
    border-radius: var(--radius-lg);
  }
}
.map-canvas--compact {
  height: 14rem;
  min-height: 14rem;
}
.map-overlay {
  position: absolute;
  /* Right, not left: Leaflet puts its zoom control at the top left, and an
     overlay there sits underneath it — the count reads as "+ temples in view"
     with the number hidden behind the button. */
  right: var(--space-3);
  top: var(--space-3);
  z-index: 500;
  max-width: min(22rem, calc(100% - 5rem));
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.map-overlay[data-state='error'] {
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 28%, var(--color-border));
}
.map-legend {
  position: absolute;
  z-index: 500;
  left: var(--space-3);
  bottom: calc(var(--space-3) + 1.25rem);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.map-legend__dot {
  width: 0.625rem;
  height: 0.625rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #8a4b2a;
  box-shadow: 0 0 0 1px rgba(28, 25, 23, 0.16);
}
.map-legend__dot--verified {
  background: #1f7a4d;
}
.map-legend__dot--you {
  background: #fff;
  border-color: #14584f;
}
.map-page__note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.map-unavailable {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-5);
  color: var(--color-text-muted);
  text-align: center;
}
.map-unavailable svg {
  width: 2rem;
  height: 2rem;
  color: var(--color-danger);
}
.map-unavailable strong {
  color: var(--color-text);
}
.leaflet-bar a {
  color: var(--color-text);
}
.leaflet-control-zoom a {
  width: 2.5rem;
  height: 2.5rem;
  line-height: 2.4rem;
}
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--color-surface) 82%, transparent) !important;
  color: var(--color-text-muted);
}
.kt-marker {
  filter: drop-shadow(0 3px 4px rgba(28, 25, 23, 0.25));
}
@media (max-width: 640px) {
  .map-legend {
    right: var(--space-2);
    left: var(--space-2);
    justify-content: center;
  }
}
.leaflet-container {
  font: inherit;
  background: var(--color-bg-subtle);
}

/* Never filter, invert or fade the tile pane to fake a dark map. It makes
   roads unreadable, it breaks the attribution's legibility, and it hides
   genuine tile failures behind something that merely looks intentional. A
   dark map means a dark tile provider (see assets/js/config/map.js). */

/* The no-network basemap: a graticule and state names, drawn from data already
   on the device. Deliberately quiet — it is a backdrop for the markers, not a
   map in its own right, and it must never be mistaken for one. */
/* `currentColor` rather than a border token: the grid has to stay visible on
   both themes, and a border colour tuned for a 1px edge between two surfaces
   disappears entirely when it is a hairline on a near-black field. */
.map-fallback {
  color: var(--color-text-muted);
  /* The global `svg { max-width: 100% }` resolves against a Leaflet pane,
     which is a zero-width positioned container — so the reset collapses this
     overlay to nothing and the grid renders invisibly at full height and no
     width. It sizes itself in JS instead. */
  max-width: none;
}
.map-fallback__grid {
  stroke: currentColor;
  stroke-width: 1;
  opacity: 0.28;
}
.map-fallback__tick {
  fill: currentColor;
  font-size: 10px;
  font-family: inherit;
  opacity: 0.7;
}
.map-fallback__place {
  fill: currentColor;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-anchor: middle;
  opacity: 0.85;
}

/* Shown only when the basemap genuinely cannot load. The markers stay on
   screen underneath: they are ours, and they are still correct. */
.map-problem {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  /* Clear of Leaflet's attribution strip, which is a licence condition and
     must stay legible rather than be covered by our own notice. */
  bottom: calc(var(--space-3) + 1.5rem);
  z-index: 1000;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.map-problem p {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
}
.map-problem[hidden] {
  display: none !important;
}

/**
 * The same notice on a mini-map.
 *
 * A 14rem map with a three-line explanation and a Retry button on top of it is
 * not a map with a notice, it is a notice with a map behind it — and the thing
 * the reader came for, one pin showing where the temple is, is completely
 * hidden. On a compact map the notice shrinks to a single chip in the corner:
 * enough to explain the plain background, small enough to leave the map
 * visible. The full explanation stays on the full-size map, where there is
 * room for it and where somebody is actually navigating.
 */
.map-canvas--compact .map-problem {
  right: auto;
  bottom: var(--space-2);
  left: var(--space-2);
  max-width: calc(100% - var(--space-4));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  box-shadow: var(--shadow-sm);
}
.map-canvas--compact .map-problem strong {
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}
.map-canvas--compact .map-problem p,
.map-canvas--compact .map-problem [data-map-retry] {
  display: none;
}
.leaflet-popup-content {
  margin: var(--space-3);
  font: inherit;
}
.map-popup__name {
  font-weight: var(--weight-medium);
  display: block;
  margin-bottom: 2px;
}

.filters {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scrollbar-width: thin;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.auth-shell {
  position: relative;
  isolation: isolate;
  width: min(100%, 30rem);
  max-width: 30rem;
  margin: clamp(var(--space-5), 7vh, var(--space-8)) auto;
  padding: clamp(var(--space-5), 5vw, var(--space-7));
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--color-primary) 13%, transparent),
      transparent 13rem
    ),
    var(--color-surface-raised);
  box-shadow: var(--shadow-lg);
}
.auth-shell::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}
.auth-shell__mark {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  box-shadow: var(--shadow-xs);
}
.auth-shell__mark svg {
  width: 1.45rem;
  height: 1.45rem;
}
.auth-shell__eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-shell__title {
  max-width: 24rem;
  margin-bottom: var(--space-2);
  font-size: clamp(var(--text-xl), 6vw, 2rem);
}
.auth-shell__sub {
  max-width: 27rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.auth-shell .button--block {
  min-height: 3.25rem;
  font-weight: var(--weight-bold);
}
.auth-code__address {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: calc(var(--space-2) * -1) 0 var(--space-5);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg-subtle) 80%, transparent);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.auth-code__address svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  color: var(--color-primary);
}
.auth-code__address span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.auth-code__input {
  min-height: 4.25rem;
  padding-left: calc(var(--space-4) + 0.3em);
  font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: clamp(1.75rem, 8vw, 2.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
  letter-spacing: 0.3em;
  text-align: center;
}
.auth-code__input::placeholder {
  color: color-mix(in srgb, var(--color-text-muted) 42%, transparent);
}
.auth-code__submit {
  margin-top: var(--space-2);
}
.auth-code__security {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  margin-top: var(--space-5);
  padding: var(--space-3);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.auth-code__security svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-primary);
}
.auth-code__security p {
  margin: 0;
}
.auth-code__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.auth-code__resend {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
}
.auth-code__resend:hover {
  text-decoration: underline;
}
.auth-code__resend:disabled {
  color: var(--color-text-muted);
  cursor: wait;
  text-decoration: none;
}
.auth-code__status {
  min-height: 1.25rem;
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-align: center;
}
@media (max-width: 30rem) {
  .auth-shell {
    margin: var(--space-3) auto;
    padding: var(--space-5);
  }
  .auth-shell__mark {
    width: 3rem;
    height: 3rem;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: var(--space-3);
  text-align: center;
}
.stat__value {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}
.stat__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.progress-line {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-subtle);
  overflow: hidden;
}
.progress-line__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
}

/* --------------------------------------------------------------- home -- */

.home-intro {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: var(--space-5);
  padding: clamp(var(--space-5), 6vw, var(--space-7));
  margin-bottom: var(--space-5);
  overflow: hidden;
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(
      circle at 92% 0%,
      color-mix(in srgb, var(--color-primary) 18%, transparent),
      transparent 16rem
    ),
    linear-gradient(145deg, var(--color-surface-raised), var(--color-primary-soft));
  box-shadow: var(--shadow-md);
}
.home-intro::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 13rem;
  height: 13rem;
  right: -5rem;
  bottom: -7rem;
  border: 1px solid var(--color-primary-border);
  border-radius: 50%;
  box-shadow:
    0 0 0 2rem color-mix(in srgb, var(--color-primary-border) 35%, transparent),
    0 0 0 4rem color-mix(in srgb, var(--color-primary-border) 18%, transparent);
}
.home-intro__copy {
  max-width: 46rem;
}
.home-intro__eyebrow,
.map-page__eyebrow {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.home-intro__title {
  max-width: 42rem;
  font-size: clamp(2rem, 7vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.home-intro__lede {
  max-width: 37rem;
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-md);
}
.home-search {
  position: relative;
  z-index: 2;
  width: min(100%, 42rem);
}
.home-search .searchbar--hero {
  width: 100%;
}
.searchbar--hero {
  position: relative;
  z-index: 1;
  min-height: 3.5rem;
  padding-block: var(--space-1);
  background: var(--color-surface-raised);
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.home-search .suggestions {
  margin-top: var(--space-2);
  border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-md);
}
.suggestions__item--button {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
}
.suggestions__meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: right;
}
.searchbar--hero input {
  font-size: var(--text-md);
}
.searchbar__submit {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: var(--color-on-primary);
  cursor: pointer;
}
.searchbar__submit:hover {
  background: var(--color-primary-hover);
}
.searchbar__submit svg {
  width: 1.125rem;
  height: 1.125rem;
}

/**
 * The hero.
 *
 * A single photograph with the name over it. The scrim is a gradient rather
 * than a flat overlay so the top of the image keeps its detail while the text
 * at the bottom stays legible over whatever happens to be there — sky, granite
 * or a crowd.
 */
.hero-card {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  min-height: 13rem;
  color: #fff;
  text-decoration: none;
  background: var(--color-bg-subtle);
}
.hero-card img {
  width: 100%;
  height: 100%;
  min-height: 13rem;
  max-height: 22rem;
  object-fit: cover;
  display: block;
}
.hero-card__body {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 2px;
  padding: var(--space-7) clamp(var(--space-4), 4vw, var(--space-6)) var(--space-5);
  background: linear-gradient(to top, rgba(10, 8, 6, 0.88), rgba(10, 8, 6, 0));
}
.hero-card__eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kt-bronze-300);
}
.hero-card__title {
  font-family: var(--font-serif);
  font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
  font-weight: var(--weight-bold);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.hero-card__meta {
  font-size: var(--text-sm);
  opacity: 0.85;
}

/**
 * The quick-action grid.
 *
 * Four across on a phone, eight across once there is room. Fixed columns
 * rather than a scroller: a row you have to swipe hides half its own options,
 * and these are the options.
 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
@media (min-width: 720px) {
  .quick-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

/* Collections carry more text than temple cards. A real grid keeps every
   name and native-language label readable instead of cutting the next card
   behind a desktop scrollbar. */
.collection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.collection-grid .tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 10.5rem;
}
.collection-grid .tile__ring {
  align-self: end;
  margin: 0;
  padding: var(--space-4);
}
@media (min-width: 42rem) {
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 66rem) {
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Denser than it was. Eight tiles at the old size cost most of a phone screen
   before a single temple appeared — a shortcut grid that pushes the content
   it is shortcutting below the fold is working against itself. */
.quick-tile {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    transform var(--transition-fast);
}
.quick-tile:hover,
.quick-tile:focus-visible {
  border-color: var(--color-primary-border);
  transform: translateY(-1px);
}
.quick-tile__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.quick-tile__icon svg {
  width: 18px;
  height: 18px;
}
.quick-tile__label {
  font-size: var(--text-xs);
  text-align: center;
  line-height: 1.25;
  color: var(--color-text-muted);
}

/**
 * The frame for a temple with no photograph.
 *
 * Branded, flat, and unmistakably not a photograph. It must never be confused
 * for a picture of the temple it sits beside.
 */
.photo-placeholder {
  --placeholder-hue: 38;
  --placeholder-turn: 0deg;
  --placeholder-x: 50%;
  --placeholder-y: 85%;
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-1);
  width: 100%;
  height: 100%;
  min-height: 4rem;
  overflow: hidden;
  isolation: isolate;
  color: hsl(var(--placeholder-hue) 58% 70%);
  /* The record's stable hash moves the warm glow and turns the seal, while its
     deity/Siddhar context selects the glyph. Every missing image is recognisably
     a placeholder, but no longer the same anonymous mark repeated hundreds of
     times. */
  background:
    radial-gradient(
      95% 85% at var(--placeholder-x) var(--placeholder-y),
      hsl(var(--placeholder-hue) 58% 45% / 0.27),
      transparent 64%
    ),
    linear-gradient(160deg, #1e1a15, #16130f);
  box-shadow: inset 0 0 0 1px hsl(var(--placeholder-hue) 55% 68% / 0.25);
}
.photo-placeholder::before {
  position: absolute;
  width: 72%;
  max-width: 15rem;
  aspect-ratio: 1;
  border: 1px solid hsl(var(--placeholder-hue) 55% 68% / 0.14);
  border-radius: 50%;
  background:
    linear-gradient(
      90deg,
      transparent 49.5%,
      hsl(var(--placeholder-hue) 55% 68% / 0.1) 50%,
      transparent 50.5%
    ),
    linear-gradient(
      transparent 49.5%,
      hsl(var(--placeholder-hue) 55% 68% / 0.1) 50%,
      transparent 50.5%
    );
  box-shadow:
    0 0 0 1.35rem hsl(var(--placeholder-hue) 55% 68% / 0.025),
    0 0 0 2.7rem hsl(var(--placeholder-hue) 55% 68% / 0.018);
  content: '';
  transform: rotate(var(--placeholder-turn));
  pointer-events: none;
}
.photo-placeholder__mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  border: 1px solid hsl(var(--placeholder-hue) 55% 72% / 0.52);
  border-radius: 50%;
  background: hsl(var(--placeholder-hue) 42% 14% / 0.86);
  box-shadow:
    inset 0 0 0 3px rgba(10, 8, 6, 0.36),
    0 0 1.5rem hsl(var(--placeholder-hue) 60% 42% / 0.18);
}
.photo-placeholder__glyph {
  display: grid;
  place-items: center;
}
.photo-placeholder__glyph svg,
.temple-card__media .photo-placeholder__glyph svg,
.tile__image .photo-placeholder__glyph svg {
  width: 1.65rem;
  height: 1.65rem;
  color: currentColor;
  opacity: 1;
}
.photo-placeholder__initials {
  position: absolute;
  right: -0.4rem;
  bottom: -0.25rem;
  display: grid;
  min-width: 1.65rem;
  height: 1.15rem;
  place-items: center;
  padding: 0 0.28rem;
  border: 1px solid hsl(var(--placeholder-hue) 58% 76% / 0.72);
  border-radius: var(--radius-pill);
  background: #17130f;
  color: hsl(var(--placeholder-hue) 62% 76%);
  font-size: 0.55rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  line-height: 1;
}
.photo-placeholder__text {
  position: relative;
  z-index: 1;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
  text-align: center;
  padding: 0 var(--space-1);
}
.photo-placeholder--hero {
  min-height: 100%;
  gap: var(--space-3);
}
.photo-placeholder--hero .photo-placeholder__mark {
  width: 7rem;
  height: 7rem;
  border-width: 2px;
}
.photo-placeholder--hero .photo-placeholder__glyph svg {
  width: 3.5rem;
  height: 3.5rem;
}
.photo-placeholder--hero .photo-placeholder__initials {
  right: -0.55rem;
  bottom: 0.1rem;
  min-width: 2.35rem;
  height: 1.55rem;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}
.photo-placeholder--hero .photo-placeholder__text {
  font-size: var(--text-sm);
  letter-spacing: 0.04em;
  text-transform: none;
}
/* In a small card the label costs more than it says. */
.temple-card__media .photo-placeholder__text {
  display: none;
}

/* ------------------------------------------------------------ filters -- */

/**
 * The filter sheet.
 *
 * Six select controls in a row is 900-odd pixels of chrome. On a phone that
 * either scrolls sideways — hiding half the options behind a gesture nobody
 * knows is there — or, worse, pushes the whole page sideways, which is what it
 * was doing. So on a narrow screen the controls live in a sheet behind one
 * button that says how many filters are in force, and the page itself never
 * scrolls horizontally.
 *
 * On a wide screen there is room, so the sheet is simply a grid that is
 * always open and the trigger disappears.
 */
.filter-bar {
  margin-bottom: var(--space-3);
}
.filter-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.filter-bar__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.filter-bar__siddhar {
  border-color: var(--color-primary-border);
  color: var(--color-primary);
}
.filter-bar__siddhar[aria-pressed='true'] {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.filter-bar__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--color-on-primary);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}
.filter-bar__count[hidden] {
  display: none;
}
.filter-sheet__backdrop {
  display: none;
}

.filter-sheet {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: start;
  margin-top: var(--space-3);
}
.filter-sheet select {
  max-width: 100%;
}
/* Each control must be allowed to shrink, or a long option name sets the
   column width and the grid overflows its container. */
.filter-sheet > * {
  min-width: 0;
}
.filter-sheet__head {
  display: none;
}
.filter-sheet__footer {
  display: none;
}
.filter-sheet__control {
  min-width: 0;
}
.filter-sheet__select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.filter-sheet__select option {
  background: var(--color-surface-raised);
  color: var(--color-text);
}
.deity-family-picker {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.deity-family-picker legend {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.deity-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--space-2);
}
.deity-family-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    color var(--transition-fast);
}
.deity-family-choice:hover {
  border-color: var(--color-primary-border);
  background: var(--color-primary-soft);
}
.deity-family-choice[aria-pressed='true'] {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.deity-family-choice__icon {
  display: grid;
  place-items: center;
  color: var(--color-primary);
}
.deity-family-choice[aria-pressed='true'] .deity-family-choice__icon {
  color: inherit;
}
.deity-family-choice__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.deity-family-choice__name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.deity-family-choice__count {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.deity-family-choice[aria-pressed='true'] .deity-family-choice__count {
  color: inherit;
  opacity: 0.8;
}

@media (max-width: 720px) {
  .filter-sheet__backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    border: 0;
    background: rgba(7, 6, 5, 0.68);
    opacity: 0;
    pointer-events: none;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    transition: opacity var(--transition-fast);
  }
  body.sheet-open .filter-sheet__backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .filter-sheet {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    display: none;
    grid-template-columns: 1fr;
    gap: var(--space-2);
    max-height: min(84dvh, 44rem);
    overflow-y: auto;
    margin: 0;
    padding: var(--space-5) var(--space-4);
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    background:
      radial-gradient(
        circle at 12% 0,
        color-mix(in srgb, var(--color-primary-soft) 78%, transparent),
        transparent 16rem
      ),
      var(--color-surface-raised);
    border: 1px solid var(--color-border-strong);
    border-bottom: 0;
    border-radius: calc(var(--radius-xl) + var(--space-1)) calc(var(--radius-xl) + var(--space-1)) 0
      0;
    box-shadow: 0 -1.5rem 4rem rgba(0, 0, 0, 0.48);
  }
  .filter-sheet::before {
    position: absolute;
    top: var(--space-2);
    left: 50%;
    width: 2.75rem;
    height: 0.25rem;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
    content: '';
    transform: translateX(-50%);
  }
  .filter-sheet[data-open='true'] {
    display: grid;
  }
  .filter-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }
  .filter-sheet__head > div {
    display: grid;
    gap: 1px;
  }
  .filter-sheet__head strong {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
  }
  .filter-sheet__eyebrow,
  .filter-sheet__summary {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
  }
  .filter-sheet__eyebrow {
    color: var(--color-primary);
    font-weight: var(--weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .filter-sheet__desktop-clear {
    display: none;
  }
  .filter-sheet__control {
    width: 100%;
    min-height: 3.15rem;
    justify-content: flex-start;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  }
  button.filter-sheet__control {
    font: inherit;
  }
  .filter-sheet__select {
    height: 100%;
    padding: 0 var(--space-1);
  }
  .deity-family-picker {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }
  .deity-family-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filter-sheet__footer {
    position: sticky;
    bottom: calc(var(--space-4) * -1 - env(safe-area-inset-bottom, 0px));
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(6rem, 0.7fr) minmax(9rem, 1.3fr);
    gap: var(--space-2);
    margin: var(--space-2) calc(var(--space-4) * -1) calc(var(--space-4) * -1);
    padding: var(--space-3) var(--space-4);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface-raised) 92%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  body.sheet-open {
    overflow: hidden;
  }
}

@media (min-width: 721px) {
  .filter-bar__trigger {
    display: none;
  }
  .filter-sheet {
    display: grid !important;
  }
}

/* The ring sits with the collection's text rather than under it, so a rail of
   collection cards reads as a row of dials at a glance. */
.tile__ring {
  display: grid;
  place-items: center;
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}
.progress-ring {
  display: block;
}
