/* Membership and read-only examples use the same quiet, tactile application shell. */
@media (orientation: portrait) {
  .demo-browsing #atlas.personal-journal #collection-actions,
  .demo-browsing #atlas.personal-journal #stats {
    display: none;
  }
}
.masthead .membership-link {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--wine);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}
.masthead .membership-link small {
  display: none;
}
.masthead .membership-link:hover {
  background: #74273908;
}
.masthead .membership-link:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 1px;
}

#demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px max(24px, env(safe-area-inset-right)) 8px
    max(24px, env(safe-area-inset-left));
  background: #f0e9dc;
  color: #675845;
  border-bottom: 1px solid #ded2be;
}
#demo-banner > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
  gap: 3px 12px;
  font-size: 12px;
  line-height: 1.45;
}
#demo-banner strong {
  color: #654a25;
  font-size: 13px;
  font-weight: 600;
}
#demo-banner > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 7px 0 7px 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: right;
}
.demo-detail-notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid #dfd2bc;
  border-left: 3px solid #a0885e;
  border-radius: 3px;
  background: #f3eddf;
  color: #675845;
  font-size: 13px;
  line-height: 1.55;
}
.demo-detail-notice strong {
  color: #654a25;
  font-weight: 600;
}
.demo-detail-notice p {
  margin: 4px 0 0;
  font-size: inherit;
  line-height: inherit;
}
.demo-source {
  margin-block: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.demo-source a,
a.demo-source {
  color: var(--wine);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.demo-library-intro {
  max-width: 650px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.demo-browsing #collection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.demo-browsing #collection-actions > button {
  min-height: 44px;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
}
.demo-browsing.personal-journal #collection-actions [data-action="log"] {
  display: inline-flex;
  align-items: center;
}
.demo-collection-card {
  --demo-card-padding: 24px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--demo-card-padding);
  overflow: hidden;
}
.demo-collection-card .collection-cover {
  display: block;
  flex: 0 0 auto;
  margin: calc(-1 * var(--demo-card-padding));
  margin-bottom: 22px;
  background: #e8dfd1;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.demo-collection-card .collection-cover img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 180ms ease;
}
.demo-collection-card .collection-cover:hover img {
  transform: scale(1.025);
}
.demo-collection-card .collection-cover:focus-visible {
  outline: 3px solid var(--wine);
  outline-offset: -3px;
}
.demo-collection-card > .eyebrow {
  color: #866d42;
  font-size: 10px;
  letter-spacing: 0.13em;
}
.demo-collection-card > h2 {
  margin: 10px 0;
  font-size: 32px;
  line-height: 1.1;
}
.demo-collection-card > p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
}
.demo-collection-card > p:last-of-type {
  margin-top: auto;
  padding-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.demo-collection-card .collection-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.demo-collection-card .collection-card-actions > a,
.demo-collection-card .collection-card-actions > button {
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding-block: 9px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}
.demo-collection-card .collection-card-actions > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.demo-collection-card .collection-card-actions .subdued-danger {
  color: #876c65;
}

/* Scope dialog geometry to the new membership component. */
dialog:has(.membership-sheet) {
  width: 920px;
  max-width: calc(100vw - 40px);
  max-height: min(92dvh, 1000px);
  height: auto;
  padding: 32px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.membership-sheet {
  min-width: 0;
  color: var(--ink);
}
.membership-sheet *,
.membership-sheet *::before,
.membership-sheet *::after {
  box-sizing: border-box;
}
.membership-sheet .membership-header {
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 14px;
}
.membership-header > div {
  min-width: 0;
}
.membership-header .eyebrow {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.15em;
}
.membership-header h1,
.membership-header h2 {
  max-width: 790px;
  margin: 8px 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.membership-header .close-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: -8px -12px 0 0;
}
.membership-intro {
  max-width: 740px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.membership-context {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 3px solid #a0885e;
  background: #f0e9dc;
  color: #675845;
  font-size: 14px;
  line-height: 1.6;
}
.membership-status {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 20px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f2eee5;
}
.membership-status > strong {
  grid-column: 1;
  color: #554a3e;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.membership-status > p {
  grid-column: 1;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.membership-status > button {
  grid-column: 2;
  grid-row: 1 / 3;
  min-height: 44px;
  padding: 8px 0;
  color: var(--wine);
  font-size: 14px;
  line-height: 1.5;
}
.membership-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}
.membership-public-access {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 0 2px 18px;
  border-bottom: 1px solid var(--line);
}
.membership-public-access > div {
  min-width: 0;
}
.membership-public-access h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin: 0 0 5px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.membership-public-access h3 > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.membership-public-access p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.membership-public-access > .text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 44px;
  max-width: 140px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
  text-decoration: none;
  white-space: normal;
}
.membership-tier {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 24px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fffdf8;
}
.membership-tier-plus {
  border-color: #b6a076;
  background: #f5eee0;
}
.membership-tier > .eyebrow {
  color: #78643f;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.1em;
}
.membership-tier h3 {
  margin: 10px 0 4px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
}
.membership-tier-description {
  min-height: 44px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.membership-price {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  margin: 0;
}
.membership-price > strong {
  display: block;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.membership-price small {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}
.membership-price > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.membership-price-status {
  display: inline-block;
  margin: 8px 0 0;
  padding: 3px 7px;
  border: 1px solid #d5c5a7;
  border-radius: 3px;
  color: #756041;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}
.membership-features {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 12px;
  width: 100%;
  margin: 24px 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.membership-features li {
  position: relative;
  margin: 0;
  padding-left: 19px;
  color: #5d5145;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.membership-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #867044;
  font-size: 13px;
}
.membership-sheet .membership-tier-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.membership-sheet .membership-tier-action:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: #8b847a;
  border: 1px solid #d6cfc3;
  background: #e8e3da;
  box-shadow: none;
}
.membership-availability {
  width: 100%;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}
.membership-footer {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}
.membership-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.membership-footer .membership-independence {
  color: #675743;
}
.membership-footer .text-button {
  justify-self: start;
  min-height: 44px;
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
#guide-page {
  height: calc(100dvh - var(--shell-height) - var(--nav-height));
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
#guide-page > .membership-sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 28px 48px;
}
.demo-image-caption {
  padding: 12px 18px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 13px;
  line-height: 1.5;
}

/* Useful no-script content remains readable before the real atlas takes over. */
.demo-server {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 28px 48px;
}
.demo-server > header {
  max-width: 680px;
  margin-bottom: 28px;
}
.demo-server > header h1 {
  margin: 10px 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.1;
}
.demo-server > header p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.demo-server > .restaurant-card {
  display: block;
  max-width: 740px;
  margin: 0 0 20px;
  padding: 22px;
  border: 1px solid var(--line);
  background: #fffdf8;
}
.demo-server .restaurant-card h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.15;
}
.demo-server .restaurant-card p {
  font-size: 14px;
  line-height: 1.6;
}
.demo-server .restaurant-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 18px 0 0;
  object-fit: cover;
}
.demo-server .album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.demo-server .album-tile {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: #fffdf8;
}
.demo-server .album-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.demo-server .album-tile figcaption {
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) {
  .masthead {
    padding-inline: max(12px, env(safe-area-inset-left))
      max(12px, env(safe-area-inset-right));
    gap: 6px;
  }
  .masthead #header-tools {
    gap: 2px;
    min-width: 0;
  }
  .masthead .membership-link {
    display: inline-flex;
    padding-inline: 5px;
  }
  .masthead #language-switch {
    width: 50px;
    min-width: 50px;
    padding: 8px 2px 8px 4px;
    font-size: 13px;
  }
  .masthead #account-nav .guest-signin {
    padding-inline: 4px;
    font-size: 13px;
  }
  #demo-banner {
    gap: 10px;
    padding: 7px max(16px, env(safe-area-inset-right)) 7px
      max(16px, env(safe-area-inset-left));
  }
  #demo-banner > div {
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    line-height: 1.4;
  }
  #demo-banner strong {
    font-size: 12px;
  }
  #demo-banner > button {
    max-width: 112px;
    padding-left: 2px;
    font-size: 12px;
    white-space: normal;
  }
  .demo-collection-card {
    --demo-card-padding: 20px;
  }
  .demo-collection-card > p {
    font-size: 15px;
  }
  .demo-detail-notice {
    margin-bottom: 16px;
    padding: 11px 12px;
  }
  dialog:has(.membership-sheet) {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
    border: 0;
    border-radius: 0;
    padding: max(16px, env(safe-area-inset-top)) 20px
      max(28px, env(safe-area-inset-bottom));
    scrollbar-gutter: auto;
  }
  .membership-sheet .membership-header {
    position: static;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  dialog .membership-sheet .membership-header {
    position: sticky;
    top: calc(-1 * max(16px, env(safe-area-inset-top)));
    z-index: 2;
    margin: calc(-1 * max(16px, env(safe-area-inset-top))) -20px 18px;
    padding: max(16px, env(safe-area-inset-top)) 20px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }
  dialog .membership-header .close-button {
    position: static;
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin: -4px -8px 0 0;
    background: var(--paper);
  }
  .membership-header h1,
  .membership-header h2 {
    font-size: 32px;
    line-height: 1.06;
  }
  .membership-intro {
    margin-bottom: 16px;
    font-size: 14px;
  }
  .membership-status {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    margin-bottom: 16px;
    padding: 10px 12px;
  }
  .membership-status > strong {
    font-size: 13px;
  }
  .membership-status > button {
    max-width: 114px;
    margin-top: 0;
    font-size: 13px;
    text-align: right;
    white-space: normal;
  }
  .membership-context {
    margin-bottom: 12px;
    padding: 9px 12px;
    font-size: 13px;
  }
  .membership-public-access {
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }
  .membership-public-access > .text-button {
    max-width: 98px;
    font-size: 12px;
  }
  .membership-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .membership-tier {
    padding: 20px;
  }
  .membership-tier-description {
    min-height: 0;
    margin-bottom: 14px;
    font-size: 14px;
  }
  .membership-features {
    margin-block: 18px;
    padding-top: 16px;
    gap: 9px;
  }
  .membership-features li {
    font-size: 14px;
  }
  .membership-sheet .membership-tier-action {
    min-height: 48px;
    font-size: 14px;
  }
  .membership-footer p {
    font-size: 13px;
  }
  #guest-page > .membership-sheet,
  .demo-server {
    padding: 24px 20px 36px;
  }
  .demo-server .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .demo-server .album-tile figcaption {
    padding: 10px;
    font-size: 13px;
  }
}
@media (max-width: 419px) {
  .masthead .wordmark {
    font-size: clamp(21px, 6.4vw, 27px);
  }
  .masthead .wordmark .brand-underline {
    width: 62px;
    height: 10px;
  }
  .masthead {
    gap: 4px;
    padding-inline: max(10px, env(safe-area-inset-left))
      max(10px, env(safe-area-inset-right));
  }
  .masthead .membership-link {
    padding-inline: 3px;
  }
  .masthead #header-tools {
    gap: 0;
  }
  .masthead #language-switch {
    width: 50px;
  }
  .masthead #account-nav .guest-signin {
    padding-inline: 3px;
  }
  #demo-banner > button {
    max-width: 100px;
  }
  .demo-server .album-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .demo-collection-card .collection-cover img {
    transition: none;
  }
  .demo-collection-card .collection-cover:hover img {
    transform: none;
  }
}
