/* Laurie — Private Edition
   New presentation layer. Existing selectors are intentionally reinterpreted
   while routes, forms, data attributes, and server behavior stay intact. */

:root {
  --pe-paper: #f4f0e8;
  --pe-paper-light: #fbf8f2;
  --pe-ink: #171412;
  --pe-muted: #6d655e;
  --pe-wine: #7b2438;
  --pe-wine-dark: #5f192b;
  --pe-clay: #c77a5a;
  --pe-moss: #556052;
  --pe-rule: rgba(23, 20, 18, 0.16);
  --pe-rule-strong: rgba(23, 20, 18, 0.3);
  --pe-shadow: 0 24px 80px rgba(23, 20, 18, 0.14);
  --pe-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --pe-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pe-rail: 88px;
  --pe-admin-rail: 232px;
  --pe-content: 860px;
  --pe-wide: 1100px;
  --pe-focus: 0 0 0 3px rgba(123, 36, 56, 0.22);
}

html[data-theme="night"] {
  --pe-paper: #171412;
  --pe-paper-light: #211d1b;
  --pe-ink: #f2ede4;
  --pe-muted: #aaa098;
  --pe-rule: rgba(242, 237, 228, 0.15);
  --pe-rule-strong: rgba(242, 237, 228, 0.3);
  --pe-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

html {
  background: var(--pe-paper);
  color: var(--pe-ink);
  scroll-behavior: smooth;
}

body,
body.public-entry-page,
body.admin-page {
  margin: 0;
  min-height: 100vh;
  background: var(--pe-paper);
  color: var(--pe-ink);
  font-family: var(--pe-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  display: none !important;
}

* {
  box-sizing: border-box;
}

::selection {
  color: var(--pe-paper-light);
  background: var(--pe-wine);
}

img,
video,
iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

h1,
h2,
h3,
blockquote {
  margin-top: 0;
  color: var(--pe-ink);
  font-family: var(--pe-serif);
  font-weight: 400;
  letter-spacing: -0.035em;
}

h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); line-height: 0.96; }
h2 { font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.04; }
h3 { font-size: 1.35rem; line-height: 1.2; }

p { margin-top: 0; }

.eyebrow,
.entry-kicker,
.feed-kicker,
.post-meta,
.rail-label {
  color: var(--pe-wine);
  font-family: var(--pe-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1.3;
  text-transform: uppercase;
}

.muted,
small {
  color: var(--pe-muted);
}

.button,
button,
input[type="submit"] {
  min-height: 46px;
  border: 1px solid var(--pe-wine);
  border-radius: 3px;
  background: var(--pe-wine);
  box-shadow: none;
  color: #fff9f3;
  font: 650 0.88rem/1 var(--pe-sans);
  letter-spacing: 0.01em;
  text-transform: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  border-color: var(--pe-wine-dark);
  background: var(--pe-wine-dark);
  transform: translateY(-1px);
}

.button.secondary,
button.secondary,
.secondary,
.text-button {
  border-color: var(--pe-rule-strong);
  background: transparent;
  color: var(--pe-ink);
}

.button.secondary:hover,
button.secondary:hover,
.secondary:hover,
.text-button:hover {
  border-color: var(--pe-ink);
  background: transparent;
  color: var(--pe-wine);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 0;
  box-shadow: var(--pe-focus);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--pe-rule-strong);
  border-radius: 5px;
  background: var(--pe-paper-light);
  color: var(--pe-ink);
  font: 1rem/1.45 var(--pe-sans);
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 48px;
  padding: 0.75rem 0.9rem;
}

textarea {
  min-height: 110px;
  padding: 0.85rem 0.9rem;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pe-wine);
}

label {
  color: var(--pe-ink);
  font-size: 0.87rem;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.stack { gap: 1.15rem; }

.panel,
.legal,
.edit-panel,
.community-card,
.stat,
.admin-post,
.access-card,
.chat-form {
  border-color: var(--pe-rule);
  background: transparent;
  box-shadow: none;
}

.empty,
.notice,
.announcement {
  border: 1px solid var(--pe-rule);
  border-radius: 5px;
  background: transparent;
  color: var(--pe-muted);
}

/* Member shell */

body:not(.public-entry-page):not(.admin-page) > .topbar {
  position: fixed;
  z-index: 70;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--pe-rail);
  height: 100vh;
  padding: 22px 12px 26px;
  border: 0;
  border-right: 1px solid var(--pe-rule);
  background: color-mix(in srgb, var(--pe-paper) 95%, transparent);
  backdrop-filter: blur(16px);
}

body:not(.public-entry-page):not(.admin-page) > .topbar .brand {
  display: grid;
  width: 100%;
  height: 58px;
  place-items: center;
  overflow: hidden;
}

body:not(.public-entry-page):not(.admin-page) > .topbar .brand::after {
  content: "L";
  font: 400 2.1rem/1 var(--pe-serif);
}

body:not(.public-entry-page):not(.admin-page) > .topbar .brand-logo {
  display: none;
}

body:not(.public-entry-page):not(.admin-page) > .topbar nav {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  padding-top: 42px;
}

.topbar .nav-link {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--pe-muted);
  font-size: 0;
  font-weight: 650;
  text-decoration: none;
}

.topbar .nav-link:hover,
.topbar .nav-link.is-active {
  background: transparent;
  color: var(--pe-wine);
}

.topbar .nav-link.is-active::before {
  position: absolute;
  left: -12px;
  width: 3px;
  height: 32px;
  background: var(--pe-wine);
  content: "";
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.topbar .nav-link:first-of-type .nav-icon svg path { fill: currentColor; stroke: none; }

.nav-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--pe-wine);
  color: #fff;
  font-size: 0.65rem;
}

.nav-profile {
  display: flex;
  margin-top: auto;
  align-items: center;
  flex-direction: column;
  gap: 5px;
}

.nav-member-name { display: block; }
.nav-avatar { width: 38px; height: 38px; border: 1px solid var(--pe-rule-strong); border-radius: 50%; object-fit: cover; }
.nav-member-label,
.nav-profile .member-badge { display: none; }
.nav-change-link { color: var(--pe-muted); font-size: 0.65rem; text-decoration: none; }
.nav-signout { min-height: 38px !important; font-size: 0.63rem !important; }

body:not(.public-entry-page):not(.admin-page) > main {
  width: auto;
  max-width: none;
  margin: 0 0 0 var(--pe-rail);
  padding: 0 clamp(24px, 5vw, 76px) 96px;
}

body:not(.public-entry-page):not(.admin-page) > .site-footer {
  margin-left: var(--pe-rail);
}

.theme-toggle,
.install-app-button,
.help-button,
.notification-center-button,
.mobile-profile-link {
  z-index: 85;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--pe-ink);
}

.theme-toggle:hover,
.install-app-button:hover,
.help-button:hover,
.notification-center-button:hover,
.mobile-profile-link:hover {
  border: 0;
  background: transparent;
  transform: none;
}

body:not(.public-entry-page):not(.admin-page) > .theme-toggle { position: fixed; right: auto; bottom: 60px; left: 23px; }
body:not(.public-entry-page):not(.admin-page) > .install-app-button { position: fixed; right: auto; bottom: 108px; left: 23px; }
body:not(.public-entry-page):not(.admin-page) > .help-button { position: fixed; top: auto; right: auto; bottom: 156px; left: 23px; }
body:not(.public-entry-page):not(.admin-page) > .notification-center-button { position: fixed; top: auto; right: auto; bottom: 204px; left: 23px; }
body:not(.public-entry-page):not(.admin-page) > .mobile-profile-link { display: none; }

.theme-toggle img,
.install-app-button img,
.help-button img { width: 24px; height: 24px; filter: grayscale(1); opacity: 0.72; }

/* Creator profile and member feed */

.creator-profile-member {
  width: min(100%, var(--pe-wide));
  margin: 0 auto;
  padding-top: 26px;
}

.creator-profile-cover {
  height: clamp(260px, 34vw, 430px);
  margin: 0;
  overflow: hidden;
  background: var(--pe-paper-light);
}

.creator-profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.creator-profile-body {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 36px;
  min-height: 170px;
  align-items: center;
  padding: 34px 0 28px 42px;
  border-bottom: 1px solid var(--pe-rule);
}

.creator-profile-avatar {
  position: relative;
  align-self: start;
  width: 190px;
  aspect-ratio: 1;
  margin: -96px 0 0;
  border: 6px solid var(--pe-paper);
  background: var(--pe-paper-light);
  overflow: hidden;
}

.creator-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.creator-profile-copy .eyebrow { margin-bottom: 8px; }
.creator-profile-copy h1 { margin-bottom: 12px; font-size: clamp(3.4rem, 6vw, 5rem); }
.creator-profile-copy > p:last-child { max-width: 560px; margin: 0; font: 1.2rem/1.5 var(--pe-serif); }
.creator-profile-actions { display: flex; align-items: flex-end; flex-direction: column; gap: 18px; }
.creator-profile-actions > span { color: var(--pe-muted); font-size: 0.78rem; }
.creator-profile-actions .button { min-width: 160px; }

.member-feed-heading,
.feed-front-section,
.announcement,
.member-timeout-notice,
.member-feed-note,
.member-feed-layout {
  width: min(100%, var(--pe-content));
  margin-right: auto;
  margin-left: auto;
}

.member-feed-heading {
  margin-top: 64px;
  margin-bottom: 22px;
  padding: 0;
  align-items: end;
  border: 0;
}

.member-feed-heading .feed-title { margin: 0; font-size: clamp(2.4rem, 4vw, 3.6rem); }
.feed-archive-link { color: var(--pe-wine); font-size: 0.82rem; font-weight: 650; text-decoration: none; }

.feed-stories {
  padding: 0 0 38px;
  border-bottom: 1px solid var(--pe-rule);
}

.daily-laurie-title { display: none; }
.feed-story-track { display: flex; gap: 22px; overflow-x: auto; padding: 8px 2px; scrollbar-width: none; }
.feed-story-track::-webkit-scrollbar { display: none; }
.feed-story { min-width: 72px; min-height: 72px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.feed-story:hover { background: transparent; transform: translateY(-2px); }
.feed-story-ring { display: block; width: 70px; height: 70px; padding: 3px; border: 1px solid var(--pe-wine); border-radius: 50%; }
.feed-story-ring img,
.feed-story-ring > span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.feed-polls { padding: 36px 0; border-bottom: 1px solid var(--pe-rule); }
.feed-stories-title { display: flex; align-items: baseline; justify-content: space-between; }
.feed-stories-title h2 { margin-bottom: 22px; font-size: 2rem; }
.feed-stories-title span { color: var(--pe-muted); font-size: 0.8rem; }
.feed-poll-list { display: grid; gap: 20px; }
.poll-card { padding: 24px 0; border-width: 1px 0 0; border-radius: 0; }
.poll-option { padding: 12px 0; border-bottom: 1px solid var(--pe-rule); }

.announcement {
  margin-top: 30px;
  padding: 16px 0;
  border-width: 1px 0;
  border-radius: 0;
  color: var(--pe-ink);
  font-family: var(--pe-serif);
  font-size: 1.15rem;
}

.member-feed-note {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 44px;
  margin-bottom: 18px;
  padding: 28px 0;
  border-bottom: 1px solid var(--pe-rule);
  background: transparent;
}

.member-feed-note > div { display: flex; gap: 16px; align-items: center; }
.member-feed-note img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.member-feed-note p { margin: 0; font: 1.08rem/1.5 var(--pe-serif); }
.member-feed-note a { color: var(--pe-wine); font-size: 0.8rem; font-weight: 650; text-decoration: none; }

.feed {
  width: 100%;
  display: block;
}

.feed > .post,
.post {
  width: 100%;
  margin: 0;
  padding: clamp(48px, 7vw, 82px) 0;
  border: 0;
  border-bottom: 1px solid var(--pe-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.post-body,
.post-foot {
  width: min(100%, var(--pe-content));
  margin: 0 auto;
  padding: 0;
}

.post-author-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.post-author-avatar,
.post-author-avatar img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.post-author-row > span:nth-child(2) { display: flex; align-items: baseline; gap: 8px; }
.post-author-row strong { color: var(--pe-ink); font-family: var(--pe-serif); font-size: 1.05rem; font-weight: 600; }
.post-author-row small { font-size: 0.72rem; }
.post-author-row time { color: var(--pe-muted); font-size: 0.76rem; }

.post-body > h2 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
}

.post-body > p:not(.post-access-label) {
  max-width: 680px;
  margin-bottom: 30px;
  color: var(--pe-ink);
  font-family: var(--pe-serif);
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.58;
}

.post-access-label { margin-bottom: 8px; color: var(--pe-wine); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

.post > .post-media,
.post > .post-gallery-wrap {
  width: min(100%, var(--pe-wide));
  margin: 0 auto 22px;
  border: 0;
  border-radius: 0;
  background: #141210;
  overflow: hidden;
}

.post-media > img,
.gallery-slide img,
.post-media iframe,
.gallery-slide iframe {
  display: block;
  width: 100%;
  max-height: min(80vh, 900px);
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: #141210;
}

.post-media iframe,
.gallery-slide iframe { aspect-ratio: 16 / 9; }

.post-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.post-gallery::-webkit-scrollbar { display: none; }
.gallery-slide { min-width: 100%; scroll-snap-align: start; }
.gallery-count { top: 18px; right: 18px; padding: 7px 10px; border-radius: 999px; background: rgba(23, 20, 18, 0.74); color: #fff; font: 0.72rem/1 var(--pe-sans); }
.gallery-arrow { width: 44px; height: 44px; min-height: 44px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: rgba(23,20,18,.7); color: #fff; }
.gallery-arrow:hover { background: rgba(23,20,18,.92); }

.post-action-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 0 24px;
  border-bottom: 1px solid var(--pe-rule);
}

.post-action-row .icon-button,
.post-action-row .button {
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--pe-ink);
  font-size: 0.82rem;
}

.post-action-row .icon-button:hover,
.post-action-row .button:hover { color: var(--pe-wine); background: transparent; transform: none; }
.post-like-button .like-heart { font-size: 1.55rem; }
.post-like-button.active .like-heart { color: var(--pe-wine); }
.bookmark-button { margin-left: auto; }

.comments { padding: 28px 0 0; }
.comments h3 { margin-bottom: 18px; font-size: 1.35rem; }
.comment { padding: 16px 0; border-top: 1px solid var(--pe-rule); }
.comment p { margin: 6px 0 0; }
.comment-head { display: flex; justify-content: space-between; }
.comment-replies { margin: 14px 0 0 28px; padding-left: 18px; border-left: 2px solid var(--pe-wine); }
.comment-reply { padding: 10px 0; }
.comment-composer { margin-top: 24px; padding: 22px 0 0; border-top: 1px solid var(--pe-rule); }
.emoji-toolbar { display: flex; gap: 6px; overflow-x: auto; }
.emoji-button { min-width: 40px; min-height: 40px; padding: 0; border: 0; background: transparent; color: inherit; }

.pagination { justify-content: center; gap: 8px; padding: 38px 0; }
.pagination a,
.pagination span { border: 0; border-radius: 0; background: transparent; }

/* Locked and shop content */

.locked-media {
  position: relative;
  min-height: 420px;
  background: #312b28;
}

.locked-media img {
  width: 100%;
  min-height: 420px;
  object-fit: cover;
  filter: blur(12px) saturate(.65);
  transform: scale(1.035);
}

.locked-media::after {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 18, 0.38);
  content: "";
}

.locked-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 30px;
  color: #fff9f3;
  text-align: center;
}

.locked-overlay > span { font-size: 1.65rem; }
.locked-overlay strong { font: 400 clamp(1.8rem, 4vw, 2.7rem)/1.1 var(--pe-serif); }
.locked-overlay small { max-width: 360px; color: rgba(255,249,243,.82); font-size: 0.9rem; }
.tier-locked .locked-placeholder { width: min(100%, var(--pe-wide)); margin: 0 auto; }
.shop-card-head { align-items: start; }
.shop-price,
.status-pill { border: 0; border-radius: 0; background: transparent; color: var(--pe-wine); font-weight: 700; }
.unlock-panel { padding: 26px 0 0; border: 0; background: transparent; }
.shop-actions { display: flex; gap: 12px; }
.unlock-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 18px; }
.download-panel { border-width: 1px 0; border-radius: 0; background: transparent; }

/* Public shell and discover */

body.public-entry-page > .topbar,
body.public-entry-page > .site-footer .footer-logo { display: none; }

body.public-entry-page > main {
  width: min(100%, 1280px);
  max-width: none;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px) 80px;
}

body.public-entry-page > .theme-toggle { position: fixed; top: auto; right: 22px; bottom: 22px; }
body.public-entry-page > .install-app-button { display: none !important; }
body.public-entry-page > .help-button { position: fixed; top: auto; right: 70px; bottom: 22px; }

.preview-nav,
.public-entry-nav {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 36px;
  min-height: 74px;
  align-items: center;
  padding: 0;
  border-bottom: 1px solid var(--pe-rule);
  background: transparent;
}

.preview-wordmark,
.public-wordmark {
  font: 400 1.65rem/1 var(--pe-serif);
  letter-spacing: -0.04em;
  text-decoration: none;
}

.preview-nav nav,
.public-entry-nav nav { display: flex; gap: 28px; }
.preview-nav nav a,
.public-entry-nav nav a { position: relative; color: var(--pe-muted); font-size: 0.82rem; font-weight: 600; text-decoration: none; }
.preview-nav nav a.is-active,
.public-entry-nav nav a.is-active { color: var(--pe-ink); }
.preview-nav nav a.is-active::after,
.public-entry-nav nav a.is-active::after { position: absolute; right: 0; bottom: -25px; left: 0; height: 2px; background: var(--pe-wine); content: ""; }
.preview-join-link { padding: 8px 0; color: var(--pe-wine); font-size: 0.82rem; font-weight: 700; text-decoration: none; }

.discover-profile {
  margin: 28px 0 0;
  padding: 0 0 52px;
  border-bottom: 1px solid var(--pe-rule);
}

.discover-cover {
  width: 100%;
  height: clamp(310px, 38vw, 500px);
  margin: 0;
  overflow: hidden;
}

.discover-cover img { width: 100%; height: 100%; object-fit: cover; }

.discover-profile-row {
  display: grid;
  grid-template-columns: 210px 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 36px 34px 0;
}

.discover-avatar {
  width: 210px;
  aspect-ratio: 1;
  margin: -116px 0 0;
  border: 7px solid var(--pe-paper);
  border-radius: 0;
  overflow: hidden;
}

.discover-avatar img { width: 100%; height: 100%; object-fit: cover; }
.discover-profile-copy h1 { margin-bottom: 10px; }
.discover-profile-copy > p:last-child { margin: 0; font: 1.2rem/1.5 var(--pe-serif); }
.discover-profile-cta { min-width: 180px; }

.discover-index {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding: 38px 34px;
  border-bottom: 1px solid var(--pe-rule);
}
.discover-index > p { margin: 0; color: var(--pe-muted); font-size: 0.78rem; }
.discover-index ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin: 0; padding: 0; list-style: none; }
.discover-index li { font: 1rem/1.35 var(--pe-serif); }
.discover-index li span { display: block; margin-bottom: 6px; color: var(--pe-wine); font: 0.68rem/1 var(--pe-sans); }

.discover-stories-wrap { width: min(100%, 920px); margin: 54px auto 0; }
.discover-stories { padding: 12px 0 44px; border-bottom: 1px solid var(--pe-rule); }
.discover-story-lock { width: min(100%, 720px); margin: 60px auto; padding: 60px 0; border-width: 1px 0; border-radius: 0; background: transparent; text-align: center; }

.preview-hero-only {
  width: min(100%, 1080px);
  margin: 92px auto 0;
  padding: 0;
  background: transparent;
}

.discover-section-head {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: end;
  margin-bottom: 38px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--pe-rule);
}
.discover-section-head h2 { margin: 0; }
.discover-section-head > p { margin: 0; color: var(--pe-muted); font-family: var(--pe-serif); font-size: 1.1rem; }

.preview-hero-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px 22px;
}

.preview-card {
  display: block;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.preview-card:first-child { grid-column: 1 / -1; }
.preview-card:first-child .preview-media { aspect-ratio: 16 / 8.6; }
.preview-media { position: relative; aspect-ratio: 4 / 5; border-radius: 0; overflow: hidden; }
.preview-media img { width: 100%; height: 100%; object-fit: cover; }
.preview-card.is-blurred .preview-media img { filter: blur(12px) saturate(.65); transform: scale(1.04); }
.preview-card.is-blurred .preview-media::after { position: absolute; inset: 0; background: rgba(23,20,18,.42); content: ""; }
.preview-lock {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 30px;
  color: #fff;
  text-align: center;
}
.preview-lock strong { font: 400 clamp(1.45rem, 3vw, 2.4rem)/1.15 var(--pe-serif); }
.preview-lock small { color: rgba(255,255,255,.8); }
.preview-free-badge { top: 14px; left: 14px; border-radius: 0; background: var(--pe-paper); color: var(--pe-ink); font-size: 0.7rem; }
.preview-card-copy { padding: 16px 0 0; }
.preview-card-copy > span { color: var(--pe-wine); font-size: 0.7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.preview-card-copy h2 { margin: 5px 0 0; font-size: clamp(1.5rem, 3vw, 2.3rem); }

.preview-cta {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 48px;
  align-items: center;
  width: min(100%, 1080px);
  margin: 110px auto 30px;
  padding: 64px 0;
  border-width: 1px 0;
  border-style: solid;
  border-color: var(--pe-rule);
  border-radius: 0;
  background: transparent;
}
.preview-cta h2 { margin: 0; }
.preview-cta > p { margin: 0; color: var(--pe-muted); font: 1.15rem/1.55 var(--pe-serif); }
.preview-cta-actions { display: flex; min-width: 190px; align-items: center; flex-direction: column; gap: 12px; }
.preview-cta-actions .button { width: 100%; }
.preview-cta-actions > a:last-child { color: var(--pe-muted); font-size: 0.8rem; }

/* Entry, access, help and legal */

.join-gate {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, .75fr);
  min-height: calc(100vh - 75px);
  padding: 70px 0 40px;
  background: transparent;
}
.join-copy { display: flex; max-width: 740px; justify-content: center; flex-direction: column; padding: 0 7vw 70px 3vw; }
.join-copy h1 { max-width: 700px; margin-bottom: 28px; }
.join-intro { max-width: 560px; color: var(--pe-muted); font: 1.35rem/1.55 var(--pe-serif); }
.join-actions { display: flex; gap: 20px; align-items: center; margin-top: 22px; }
.join-manifesto { display: flex; justify-content: center; flex-direction: column; padding: 50px; border-left: 1px solid var(--pe-rule); background: var(--pe-paper-light); }
.join-manifesto blockquote { margin: 30px 0; font-size: clamp(3rem, 6vw, 5rem); line-height: .98; }
.join-handnote { color: var(--pe-muted); font-family: var(--pe-serif); font-size: 1.1rem; font-style: italic; }
.join-benefits { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); border-width: 1px 0; border-style: solid; border-color: var(--pe-rule); }
.join-benefits span { padding: 22px 30px; border-right: 1px solid var(--pe-rule); }
.join-benefits b { margin-right: 12px; color: var(--pe-wine); font-size: .7rem; }

.access-shell,
.help-page,
.legal,
.account-shell,
.chat-shell,
.community-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 74px 0 90px;
}
.access-card { padding: 0; border: 0; }
.access-card > h1 { margin-bottom: 18px; }
.access-grid { gap: 50px; margin-top: 42px; }
.access-form { padding: 32px 0; border-width: 1px 0 0; border-style: solid; border-color: var(--pe-rule); }
.legal { max-width: 760px; }
.legal h1 { margin-bottom: 34px; }
.legal h2 { margin-top: 48px; font-size: 2rem; }
.help-hero { padding: 0 0 60px; border-bottom: 1px solid var(--pe-rule); }
.help-jump { margin: 0; padding: 24px 0; border-bottom: 1px solid var(--pe-rule); }
.help-section { padding: 70px 0; border-bottom: 1px solid var(--pe-rule); }
.help-grid,
.help-icon-grid { gap: 32px; }
.help-grid article,
.help-icon-grid article,
.help-feature-list article { border: 0; border-top: 1px solid var(--pe-rule); border-radius: 0; background: transparent; box-shadow: none; }

/* Member secondary pages */

.feed-header {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--pe-rule);
  background: transparent;
}
.feed-header h1 { margin-bottom: 10px; }

body:not(.member-journal-page):not(.public-entry-page):not(.admin-page) > main {
  padding-top: 72px;
}

.community-shell { max-width: var(--pe-wide); padding-top: 0; }
.community-section { padding: 62px 0; border-bottom: 1px solid var(--pe-rule); }
.event-list { grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--pe-rule); }
.event-card { padding: 24px 22px; border: 0; border-right: 1px solid var(--pe-rule); border-radius: 0; }
.saved-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
.saved-card { border: 0; border-radius: 0; background: transparent; }
.saved-card .media-preview { border-radius: 0; }
.request-panel { display: grid; grid-template-columns: .7fr 1.3fr; gap: 60px; padding: 72px 0; border-bottom: 1px solid var(--pe-rule); background: transparent; }

.chat-shell { max-width: 820px; padding-top: 0; }
.chat-thread { min-height: 420px; padding: 42px 0; background: transparent; }
.chat-bubble { max-width: 74%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--pe-rule); border-radius: 0; background: transparent; color: var(--pe-ink); box-shadow: none; }
.chat-bubble.admin { margin-right: auto; }
.chat-bubble.member { margin-left: auto; }
.chat-form { position: sticky; bottom: 18px; padding: 20px; border: 1px solid var(--pe-rule); border-radius: 8px; background: color-mix(in srgb, var(--pe-paper) 94%, transparent); backdrop-filter: blur(18px); }

.account-card,
.profile-card { padding: 36px 0; border-width: 1px 0; border-radius: 0; background: transparent; }

.notification-center {
  width: min(440px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--pe-rule);
  border-radius: 8px;
  background: var(--pe-paper-light);
  color: var(--pe-ink);
  box-shadow: var(--pe-shadow);
}
.notification-center-head { padding: 24px; border-bottom: 1px solid var(--pe-rule); }
.notification-center-item { padding: 18px 24px; border-bottom: 1px solid var(--pe-rule); }
.notification-center-item.unread { border-left: 3px solid var(--pe-wine); background: transparent; }

/* Creator studio */

body.admin-page > .topbar {
  position: fixed;
  z-index: 70;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--pe-admin-rail);
  height: 100vh;
  padding: 30px 22px;
  align-items: stretch;
  flex-direction: column;
  border: 0;
  background: #171412;
  color: #f4f0e8;
}
body.admin-page > .topbar .brand { display: block; width: 100%; height: auto; margin-bottom: 48px; color: #f4f0e8; font: 400 2rem/1 var(--pe-serif); text-decoration: none; }
body.admin-page > .topbar .brand::after { content: "Laurie"; }
body.admin-page > .topbar .brand-logo { display: none; }
body.admin-page > .topbar nav { display: flex; align-items: stretch; flex: 1; flex-direction: column; gap: 2px; }
body.admin-page > .topbar nav a {
  padding: 13px 12px;
  border: 0;
  border-radius: 3px;
  color: rgba(244,240,232,.72);
  font-size: .85rem;
  font-weight: 550;
  text-decoration: none;
}
body.admin-page > .topbar nav a:hover { background: rgba(244,240,232,.08); color: #f4f0e8; }
body.admin-page > .topbar nav .admin-view-site { margin-top: auto; border-top: 1px solid rgba(244,240,232,.18); border-radius: 0; padding-top: 20px; }
body.admin-page > main { width: auto; max-width: none; margin: 0 0 0 var(--pe-admin-rail); padding: 62px clamp(30px, 5vw, 74px) 100px; }
body.admin-page > .site-footer { display: none; }
body.admin-page > .theme-toggle { position: fixed; top: auto; right: auto; bottom: 24px; left: 174px; filter: invert(1); }
body.admin-page > .install-app-button,
body.admin-page > .help-button { display: none !important; }

.admin-studio-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--pe-rule);
}
.admin-studio-heading h1 { margin: 0 0 16px; font-size: clamp(3.3rem, 6vw, 5.2rem); }
.admin-studio-heading p:last-child { margin: 0; color: var(--pe-muted); font: italic 1.2rem/1.5 var(--pe-serif); }
.admin-heading-action { min-width: 150px; }

.admin-dashboard-controls { padding: 28px 0; border-bottom: 1px solid var(--pe-rule); }
.admin-dashboard-controls > h2 { margin-bottom: 16px; font: 700 .72rem/1 var(--pe-sans); letter-spacing: .15em; text-transform: uppercase; }
.admin-top-controls { display: flex; flex-wrap: wrap; gap: 0; }
.admin-top-controls .button { min-height: 40px; padding: 0 16px; border-width: 0 1px 0 0; border-radius: 0; color: var(--pe-muted); }
.admin-top-controls .admin-new-post { background: transparent; color: var(--pe-wine); }

.admin-dashboard-overview { padding: 34px 0; border-bottom: 1px solid var(--pe-rule); }
.admin-dashboard-overview > h2 { margin-bottom: 20px; font-size: 1.8rem; }
.stats-grid.compact-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; }
.compact-stats .stat { display: flex; min-height: 80px; padding: 0 22px; justify-content: center; flex-direction: column; border: 0; border-right: 1px solid var(--pe-rule); border-radius: 0; text-decoration: none; }
.compact-stats .stat:first-child { padding-left: 0; }
.compact-stats .stat strong { color: var(--pe-ink); font: 400 2.3rem/1 var(--pe-serif); }
.compact-stats .stat span { color: var(--pe-muted); font-size: .72rem; text-transform: capitalize; }

.admin-studio-content.panel {
  margin: 54px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.admin-studio-content .compact-header { align-items: end; }
.admin-studio-content .compact-header h2 { margin: 0; font-size: 2.6rem; }
.bulk-actions { display: flex; gap: 12px; align-items: end; padding: 22px 0; border-bottom: 1px solid var(--pe-rule); }
.bulk-actions label { width: min(340px, 100%); }
.admin-post.with-preview {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin: 0;
  padding: 15px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}
.admin-post-link { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: center; text-decoration: none; }
.admin-post-link .media-preview { width: 112px; height: 72px; border-radius: 3px; object-fit: cover; }
.admin-post-main > span { color: var(--pe-ink); font: 1.12rem/1.2 var(--pe-serif); }
.admin-post-main small { display: block; margin-top: 5px; font-size: .74rem; }
.admin-post .row-actions { flex-wrap: nowrap; }
.admin-post .row-actions .button,
.admin-post .row-actions button { min-height: 38px; padding: 0 10px; border: 0; background: transparent; color: var(--pe-wine); font-size: .72rem; }
.admin-post .row-actions .danger { color: #a13939; }

.admin-grid { gap: 30px; }
.admin-page .panel:not(.admin-studio-content),
.admin-page .edit-panel {
  padding: 30px 0;
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
}
.admin-page .feed-header { margin-bottom: 30px; }
.community-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.community-tool { padding-right: 30px !important; }
.admin-page table { border-collapse: collapse; }
.admin-page th { color: var(--pe-muted); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.admin-page th,
.admin-page td { padding: 14px 10px; border-bottom: 1px solid var(--pe-rule); }

/* Footer */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 42px clamp(22px, 5vw, 72px);
  border-top: 1px solid var(--pe-rule);
  background: var(--pe-paper);
}
.footer-logo { width: 58px; height: 38px; object-fit: contain; filter: grayscale(1); }
.site-footer nav { display: flex; gap: 24px; }
.site-footer nav a { color: var(--pe-muted); font-size: .72rem; text-decoration: none; }

/* Responsive */

@media (min-width: 1100px) {
  body:not(.public-entry-page):not(.admin-page) > .topbar { width: 154px; }
  body:not(.public-entry-page):not(.admin-page) > main,
  body:not(.public-entry-page):not(.admin-page) > .site-footer { margin-left: 154px; }
  body:not(.public-entry-page):not(.admin-page) > .topbar nav { padding-top: 34px; }
  .topbar .nav-link { justify-content: flex-start; gap: 11px; padding: 0 13px; font-size: .76rem; }
  .topbar .nav-link.is-active::before { left: -12px; }
  .nav-profile { align-items: flex-start; padding-left: 13px; }
  .nav-member-name { display: flex; align-items: center; gap: 8px; }
  .nav-member-label { display: inline; max-width: 74px; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
  .nav-change-link { margin-left: 47px; }
  body:not(.public-entry-page):not(.admin-page) > .theme-toggle,
  body:not(.public-entry-page):not(.admin-page) > .install-app-button,
  body:not(.public-entry-page):not(.admin-page) > .help-button,
  body:not(.public-entry-page):not(.admin-page) > .notification-center-button { left: 23px; }
}

@media (max-width: 980px) {
  .creator-profile-body { grid-template-columns: 150px 1fr; padding-left: 22px; }
  .creator-profile-avatar { width: 150px; }
  .creator-profile-actions { grid-column: 2; align-items: flex-start; flex-direction: row; }
  .preview-cta { grid-template-columns: 1fr 1fr; }
  .preview-cta-actions { grid-column: 1 / -1; align-items: flex-start; }
  .preview-cta-actions .button { width: auto; }
  body.admin-page > .topbar { width: 82px; padding: 24px 11px; }
  body.admin-page > .topbar .brand::after { content: "L"; }
  body.admin-page > .topbar nav a { padding: 13px 4px; font-size: .68rem; text-align: center; }
  body.admin-page > main { margin-left: 82px; }
  body.admin-page > .theme-toggle { left: 20px; }
  .stats-grid.compact-stats { grid-template-columns: repeat(3, 1fr); row-gap: 22px; }
  .community-tools { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --pe-rail: 0px; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

  body:not(.public-entry-page):not(.admin-page) > main,
  body:not(.public-entry-page):not(.admin-page) > .site-footer {
    margin-left: 0;
  }
  body:not(.public-entry-page):not(.admin-page) > main { padding: 58px 0 40px; }
  body:not(.public-entry-page):not(.admin-page) > .topbar {
    position: fixed;
    z-index: 90;
    inset: auto 0 0;
    display: block;
    width: 100%;
    height: calc(70px + env(safe-area-inset-bottom));
    padding: 0 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--pe-rule);
    border-right: 0;
    background: color-mix(in srgb, var(--pe-paper) 94%, transparent);
    box-shadow: 0 -8px 28px rgba(23,20,18,.06);
    backdrop-filter: blur(18px);
  }
  body:not(.public-entry-page):not(.admin-page) > .topbar .brand { display: none; }
  body:not(.public-entry-page):not(.admin-page) > .topbar nav { display: grid; grid-template-columns: repeat(4, 1fr) 1fr; height: 70px; padding: 0; gap: 0; }
  .topbar .nav-link { min-height: 70px; flex-direction: column; gap: 3px; padding: 7px 2px 5px; font-size: .66rem; }
  .topbar .nav-link.is-active::before { inset: 0 24% auto; width: auto; height: 2px; }
  .nav-icon { width: 24px; height: 24px; }
  .nav-icon svg { width: 20px; height: 20px; }
  .nav-badge { top: 7px; right: 20%; }
  .nav-profile { display: contents; }
  .nav-member-name { display: none; }
  .nav-change-link { display: flex; min-height: 70px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; color: var(--pe-muted); font-size: .66rem; text-decoration: none; }
  .nav-change-link::before { content: "○"; font-size: 1.8rem; line-height: .8; }
  .nav-signout { display: none !important; }

  body:not(.public-entry-page):not(.admin-page) > .theme-toggle { top: 8px; right: 12px; bottom: auto; left: auto; }
  body:not(.public-entry-page):not(.admin-page) > .install-app-button { top: 8px; right: 54px; bottom: auto; left: auto; }
  body:not(.public-entry-page):not(.admin-page) > .help-button { top: 8px; right: 96px; bottom: auto; left: auto; }
  body:not(.public-entry-page):not(.admin-page) > .notification-center-button { top: 8px; right: auto; bottom: auto; left: 12px; }

  .creator-profile-member { width: 100%; padding: 0; }
  .creator-profile-cover { height: 230px; }
  .creator-profile-body { grid-template-columns: 108px 1fr; gap: 16px; min-height: 0; padding: 0 18px 26px; }
  .creator-profile-avatar { width: 108px; margin-top: -50px; border-width: 4px; border-radius: 50%; }
  .creator-profile-copy { padding-top: 15px; }
  .creator-profile-copy .eyebrow { display: none; }
  .creator-profile-copy h1 { margin-bottom: 3px; font-size: 2.7rem; }
  .creator-profile-copy > p:last-child { grid-column: 1 / -1; font-size: 1rem; }
  .creator-profile-actions { grid-column: 1 / -1; display: flex; width: 100%; align-items: center; justify-content: space-between; }
  .creator-profile-actions .button { min-width: 130px; min-height: 42px; }

  .member-feed-heading,
  .feed-front-section,
  .announcement,
  .member-timeout-notice,
  .member-feed-note,
  .member-feed-layout { width: 100%; }
  .member-feed-heading { margin-top: 34px; padding: 0 18px; }
  .member-feed-heading .feed-title { font-size: 2.35rem; }
  .feed-archive-link { max-width: 120px; text-align: right; }
  .feed-stories { padding: 0 18px 28px; }
  .feed-story-track { gap: 15px; }
  .feed-story { min-width: 64px; min-height: 64px; }
  .feed-story-ring { width: 62px; height: 62px; }
  .feed-polls,
  .announcement { margin-right: 18px; margin-left: 18px; }
  .member-feed-note { display: block; margin-top: 26px; padding: 24px 18px; }
  .member-feed-note .rail-label { margin-bottom: 14px; }
  .member-feed-note > a { display: inline-block; margin-top: 14px; }

  .feed > .post,
  .post { padding: 46px 0; }
  .post-body,
  .post-foot { padding-right: 18px; padding-left: 18px; }
  .post-author-row { margin-bottom: 22px; }
  .post-body > h2 { font-size: 2.15rem; }
  .post-body > p:not(.post-access-label) { margin-bottom: 24px; font-size: 1.08rem; }
  .post > .post-media,
  .post > .post-gallery-wrap { width: 100%; margin-bottom: 12px; }
  .post-media > img,
  .gallery-slide img { max-height: 75vh; }
  .gallery-arrow { display: none; }
  .post-action-row { gap: 2px; }
  .post-action-row .icon-button,
  .post-action-row .button { padding: 0 9px; }
  .comments { padding-top: 20px; }
  .locked-media,
  .locked-media img { min-height: 360px; }

  .site-footer { display: block; margin-bottom: 70px; padding: 34px 20px; text-align: center; }
  .site-footer nav { margin-top: 18px; justify-content: center; flex-wrap: wrap; }

  body.public-entry-page { padding-bottom: 0; }
  body.public-entry-page > main { padding: 0 18px 50px; }
  .preview-nav,
  .public-entry-nav { grid-template-columns: 1fr auto; min-height: 62px; }
  .preview-nav nav,
  .public-entry-nav nav { gap: 14px; }
  .preview-nav nav a,
  .public-entry-nav nav a { font-size: .72rem; }
  .preview-nav nav a.is-active::after,
  .public-entry-nav nav a.is-active::after { bottom: -19px; }
  .preview-join-link { display: none; }
  .discover-profile { margin-top: 18px; padding-bottom: 30px; }
  .discover-cover { height: 245px; }
  .discover-profile-row { grid-template-columns: 100px 1fr; gap: 16px; padding: 0 5px; }
  .discover-avatar { width: 100px; margin-top: -48px; border-width: 4px; border-radius: 50%; }
  .discover-profile-copy { padding-top: 12px; }
  .discover-profile-copy .eyebrow { display: none; }
  .discover-profile-copy h1 { margin-bottom: 4px; font-size: 2.8rem; }
  .discover-profile-copy > p:last-child { font-size: 1rem; }
  .discover-profile-cta { grid-column: 1 / -1; width: 100%; margin-top: 10px; }
  .discover-index { display: none; }
  .discover-stories-wrap { margin-top: 36px; }
  .preview-hero-only { margin-top: 64px; }
  .discover-section-head { display: block; margin-bottom: 26px; }
  .discover-section-head > p { margin-top: 12px; }
  .preview-hero-posts { grid-template-columns: 1fr; gap: 48px; }
  .preview-card:first-child { grid-column: auto; }
  .preview-card:first-child .preview-media,
  .preview-media { aspect-ratio: 4 / 5; }
  .preview-cta { display: block; margin-top: 72px; padding: 48px 0; }
  .preview-cta > p { margin: 22px 0; }
  .preview-cta-actions { align-items: stretch; }
  .preview-cta-actions .button { width: 100%; }

  .join-gate { display: block; min-height: 0; padding-top: 50px; }
  .join-copy { padding: 30px 0 60px; }
  .join-copy h1 { font-size: 3.35rem; }
  .join-actions { align-items: stretch; flex-direction: column; }
  .join-primary { width: 100%; }
  .join-manifesto { padding: 44px 24px; border-width: 1px 0 0; }
  .join-benefits { grid-template-columns: 1fr; }
  .join-benefits span { border-right: 0; border-bottom: 1px solid var(--pe-rule); }
  .access-shell,
  .help-page,
  .legal,
  .account-shell,
  .chat-shell,
  .community-shell { padding: 48px 0 60px; }
  .access-grid { grid-template-columns: 1fr; gap: 20px; }
  .help-jump { overflow-x: auto; flex-wrap: nowrap; }
  .help-grid,
  .help-icon-grid { grid-template-columns: 1fr; }

  body:not(.member-journal-page):not(.public-entry-page):not(.admin-page) > main { padding: 76px 18px 50px; }
  .event-list,
  .saved-grid { grid-template-columns: 1fr; }
  .event-card { border-right: 0; border-bottom: 1px solid var(--pe-rule); }
  .request-panel { grid-template-columns: 1fr; gap: 28px; }
  .chat-bubble { max-width: 88%; }

  body.admin-page { padding-bottom: 0; }
  body.admin-page > .topbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 12px 18px;
    flex-direction: row;
  }
  body.admin-page > .topbar .brand { width: auto; margin: 0; }
  body.admin-page > .topbar nav { display: none; }
  body.admin-page > .topbar.menu-open nav { position: absolute; top: 58px; right: 0; left: 0; display: grid; padding: 12px 18px 24px; background: #171412; }
  .admin-menu-toggle { display: flex; margin-left: auto; }
  body.admin-page > main { margin-left: 0; padding: 42px 18px 70px; }
  body.admin-page > .theme-toggle { top: 8px; right: 62px; bottom: auto; left: auto; }
  .admin-studio-heading { display: block; }
  .admin-heading-action { margin-top: 22px; }
  .admin-top-controls { display: grid; grid-template-columns: repeat(2, 1fr); }
  .admin-top-controls .button { border-width: 0 0 1px; }
  .stats-grid.compact-stats { grid-template-columns: repeat(2, 1fr); }
  .compact-stats .stat { padding: 12px 14px; }
  .admin-post.with-preview { grid-template-columns: 24px 1fr; }
  .admin-post-link { grid-template-columns: 84px 1fr; }
  .admin-post-link .media-preview { width: 84px; height: 64px; }
  .admin-post.with-preview > .row-actions { grid-column: 2; justify-content: flex-start; }
  .bulk-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Final specificity guard: the previous presentation shipped several page-level
   selectors. These keep the new component geometry authoritative. */
body.public-entry-page .button,
body.public-entry-page button:not(.theme-toggle):not(.help-button) {
  border-color: var(--pe-wine);
  background: var(--pe-wine);
  color: #fff9f3;
}

body.public-entry-page {
  --pe-paper: #f4f0e8;
  --pe-paper-light: #fbf8f2;
  --pe-ink: #171412;
  --pe-muted: #6d655e;
  --pe-rule: rgba(23, 20, 18, 0.16);
  --pe-rule-strong: rgba(23, 20, 18, 0.3);
}

body.public-discover-page .discover-profile-row {
  position: relative;
  inset: auto;
  margin: 0;
  transform: none;
}

body.public-discover-page .discover-avatar,
body.public-discover-page .discover-profile-copy,
body.public-discover-page .discover-profile-cta {
  position: relative;
  inset: auto;
  transform: none;
}

body.public-discover-page .discover-profile-copy,
body.public-discover-page .discover-profile-copy h1,
body.public-discover-page .discover-profile-copy p {
  color: var(--pe-ink);
  text-shadow: none;
}

body.public-discover-page .discover-profile-copy::before,
body.public-discover-page .discover-profile-copy::after {
  display: none;
}

body.public-discover-page .preview-join-link {
  border: 1px solid var(--pe-wine);
  background: var(--pe-wine);
  color: #fff9f3;
}

@media (max-width: 720px) {
  body.public-discover-page .discover-profile-copy { padding-top: 12px; }
  body.public-discover-page .discover-profile-copy h1 { color: var(--pe-ink); }
}

body.member-journal-page,
body.member-journal-page > main {
  --accent: #7b2438;
  --accent-dark: #5f192b;
  --accent-soft: rgba(123, 36, 56, 0.14);
  --journal-accent: #7b2438;
  background: var(--pe-paper);
  color: var(--pe-ink);
}

body.member-journal-page > main {
  display: block;
  width: calc(100% - 154px) !important;
  min-width: 0;
  max-width: none;
  margin-left: 154px !important;
  grid-template-columns: none;
  overflow: clip;
}

body.member-journal-page .creator-profile-member,
body.member-journal-page .member-feed-heading,
body.member-journal-page .feed-front-section,
body.member-journal-page .announcement,
body.member-journal-page .member-timeout-notice,
body.member-journal-page .member-feed-note,
body.member-journal-page .member-feed-layout {
  grid-area: auto;
}

body.member-journal-page .member-feed-note {
  position: static;
  inset: auto;
  width: min(100%, var(--pe-content));
  transform: none;
}

body.member-journal-page .member-feed-layout,
body.member-journal-page .member-feed-main {
  width: min(100%, var(--pe-content));
  max-width: none;
}

body.member-journal-page .creator-profile-copy,
body.member-journal-page .creator-profile-copy h1,
body.member-journal-page .creator-profile-copy p,
body.member-journal-page .member-feed-heading,
body.member-journal-page .member-feed-heading h2 {
  color: var(--pe-ink);
  text-shadow: none;
}

body.member-journal-page .creator-profile-body {
  background: var(--pe-paper) !important;
}

body.member-journal-page .button,
body.member-journal-page button:not(.theme-toggle):not(.install-app-button) {
  border-color: var(--pe-wine);
}

body.member-journal-page .creator-profile-actions .button {
  background: var(--pe-wine) !important;
  background-color: var(--pe-wine) !important;
  color: #fff9f3 !important;
}

body.member-journal-page > .topbar .nav-link,
body.member-journal-page > .topbar .nav-link.is-active,
body.member-journal-page > .topbar .nav-link:hover {
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

body.member-journal-page > .topbar .nav-link::after { display: none !important; }

body.member-journal-page > .theme-toggle,
body.member-journal-page > .install-app-button,
body.member-journal-page > .help-button,
body.member-journal-page > .notification-center-button {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme] body.member-journal-page > .topbar {
  border-color: var(--pe-rule) !important;
  background: color-mix(in srgb, var(--pe-paper) 96%, transparent) !important;
  color: var(--pe-ink) !important;
}

html[data-theme] body.member-journal-page > .topbar .nav-link,
html[data-theme] body.member-journal-page > .topbar .nav-change-link,
html[data-theme] body.member-journal-page > .topbar .nav-signout {
  color: var(--pe-muted) !important;
}

html[data-theme] body.member-journal-page > .topbar .nav-link.is-active {
  color: var(--pe-wine) !important;
}

html[data-theme] body.member-journal-page .creator-profile-actions .button {
  border-color: #7b2438 !important;
  background: #7b2438 !important;
  background-color: #7b2438 !important;
  color: #fff9f3 !important;
}

html[data-theme] body.member-journal-page .member-feed-heading .feed-title {
  color: var(--pe-ink) !important;
}

html[data-theme] body.member-journal-page .post-author-row {
  display: grid !important;
  grid-template-columns: 46px minmax(0, 1fr) auto !important;
  gap: 12px !important;
  align-items: center !important;
}

html[data-theme="night"] body.member-journal-page,
html[data-theme="night"] body.member-journal-page > main,
html[data-theme="night"] body.member-journal-page > .site-footer {
  background: #171412 !important;
  color: #f2ede4 !important;
}

html[data-theme="day"] body.member-journal-page,
html[data-theme="day"] body.member-journal-page > main,
html[data-theme="day"] body.member-journal-page > .site-footer {
  background: #f4f0e8 !important;
  color: #171412 !important;
}

@media (max-width: 1099px) {
  body.member-journal-page > main { width: calc(100% - 88px) !important; margin-left: 88px !important; }
}

@media (max-width: 720px) {
  body.member-journal-page > main { width: 100% !important; margin-left: 0 !important; }
  body.member-journal-page > .topbar nav {
    display: grid !important;
    height: 70px !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    overflow: hidden !important;
  }
  body.member-journal-page > .topbar .nav-link {
    position: static !important;
    width: auto !important;
    height: 70px !important;
    min-height: 70px !important;
    margin: 0 !important;
    padding: 7px 2px 5px !important;
    transform: none !important;
  }
  body.member-journal-page > .topbar .nav-profile {
    display: flex !important;
    grid-column: 5 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.member-journal-page > .topbar .nav-member-name { display: none !important; }
  body.member-journal-page > .topbar .nav-change-link {
    display: flex !important;
    width: 100% !important;
    height: 70px !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    margin: 0 !important;
  }
  body.member-journal-page > .topbar .nav-signout { display: none !important; }
  html body.member-journal-page:not(.admin-page):not(.landing-page):not(.discover-page) .topbar nav .nav-signout { display: none !important; }
}

body.admin-page {
  --accent: #7b2438;
  --accent-dark: #5f192b;
  --accent-soft: rgba(123, 36, 56, 0.14);
}

html[data-theme] body.admin-page {
  --accent: #7b2438;
  --accent-dark: #5f192b;
  --accent-soft: rgba(123, 36, 56, 0.14);
}

html body.admin-page > .topbar {
  width: 232px !important;
  min-width: 232px !important;
  max-width: 232px !important;
}

html body.admin-page > main {
  display: block !important;
  width: calc(100% - 232px) !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 0 0 232px !important;
  grid-template-columns: none !important;
  overflow: clip !important;
}

html body.admin-page .admin-studio-heading,
html body.admin-page .admin-dashboard-controls,
html body.admin-page .admin-dashboard-overview,
html body.admin-page .admin-studio-content {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  grid-area: auto !important;
  transform: none !important;
}

html body.admin-page .stats-grid.compact-stats {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  width: 100% !important;
  gap: 0 !important;
}

html body.admin-page .admin-studio-content.panel,
html body.admin-page .admin-post.with-preview,
html body.admin-page .bulk-actions {
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html body.admin-page .admin-post.with-preview {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
}

@media (max-width: 980px) {
  html body.admin-page > .topbar { width: 82px !important; min-width: 82px !important; max-width: 82px !important; }
  html body.admin-page > main {
    width: calc(100% - 82px) !important;
    margin-left: 82px !important;
  }
  html body.admin-page .stats-grid.compact-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 720px) {
  html body.admin-page > .topbar { width: 100% !important; min-width: 0 !important; max-width: none !important; }
  html body.admin-page > main { width: 100% !important; margin-left: 0 !important; }
  html body.admin-page .stats-grid.compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html body.admin-page .admin-post.with-preview { grid-template-columns: 24px minmax(0, 1fr) !important; }
}
