:root {
  --bg: #f7f7f7;
  --card: #fff;
  --text: #202124;
  --muted: #85858f;
  --line: #ececf0;
  --header-bg: rgba(247,247,247,.94);
  --pink: #ff2f73;
  --pink2: #ff3f5f;
  --gold: #f8b532;
  --shadow: 0 20px 50px rgba(0,0,0,.16);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; }

/* Premium post-purchase offers ------------------------------------------- */
html.premium-oto-open,
html.premium-oto-open body { overflow: hidden; }
.premium-oto-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(51, 39, 43, .2);
  backdrop-filter: blur(8px);
}
.premium-oto-screen {
  width: min(100%, 480px);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 190, 91, .22), transparent 33%),
    linear-gradient(180deg, #fffdfb 0%, #f8f7f6 100%);
  color: #242126;
}
.premium-oto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: max(12px, env(safe-area-inset-top)) 20px 8px;
}
.premium-oto-wordmark {
  color: #272329;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.premium-oto-wordmark b { color: var(--pink); }
.premium-oto-dismiss,
.premium-oto-footer-skip {
  border: 0;
  background: transparent;
  color: #8a8389;
  cursor: pointer;
}
.premium-oto-dismiss { padding: 9px 0 9px 14px; font-size: 13px; font-weight: 700; }
.premium-oto-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 22px 24px;
}
.premium-oto-copy { text-align: center; }
.premium-oto-eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff0f5;
  color: #e42b68;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
}
.premium-oto-copy h1 {
  max-width: 410px;
  margin: 16px auto 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 8.8vw, 42px);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.premium-oto-copy p {
  max-width: 390px;
  margin: 0 auto;
  color: #746e74;
  font-size: 15px;
  line-height: 1.55;
}
.premium-oto-archive {
  position: relative;
  margin: 26px auto 24px;
  max-width: 390px;
  padding: 10px;
  border: 1px solid #eee5df;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 45px rgba(78, 48, 36, .12);
}
.premium-oto-archive-main {
  display: block;
  width: 100%;
  min-height: 158px;
  object-fit: cover;
  border-radius: 16px;
}
.premium-oto-archive > div { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.premium-oto-archive > div img { width: 100%; height: 92px; object-fit: cover; border-radius: 13px; }
.premium-oto-keepsakes {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 13px;
  margin: 28px auto 24px;
  max-width: 400px;
}
.premium-oto-keepsakes figure,
.premium-oto-cast figure { margin: 0; }
.premium-oto-keepsakes figure {
  padding: 9px 9px 12px;
  border: 1px solid #ece6df;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(62, 48, 42, .09);
}
.premium-oto-keepsakes figure:nth-child(2) { transform: translateY(18px) rotate(1.5deg); }
.premium-oto-keepsakes img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; }
.premium-oto-keepsakes figcaption { padding-top: 10px; text-align: center; color: #625a61; font-size: 12px; font-weight: 750; }
.premium-oto-cast {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 28px auto 24px;
  max-width: 410px;
}
.premium-oto-cast figure {
  overflow: hidden;
  border: 1px solid #eee5e8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 15px 35px rgba(61, 41, 50, .1);
}
.premium-oto-cast img { display: block; width: 100%; aspect-ratio: .8; object-fit: cover; }
.premium-oto-cast figcaption { display: grid; gap: 2px; padding: 10px 6px 12px; text-align: center; }
.premium-oto-cast strong { font-size: 13px; }
.premium-oto-cast span { color: #90888e; font-size: 10px; }
.premium-oto-chat-demo {
  width: 100%;
  max-width: 410px;
  margin: 22px auto 0;
}
.premium-oto-fated_chat.is-chatting .premium-oto-scroll {
  display: flex;
  flex-direction: column;
  padding-top: 0;
}
.premium-oto-fated_chat.is-chatting .premium-oto-copy {
  flex: 0 0 auto;
  text-align: left;
}
.premium-oto-fated_chat.is-chatting .premium-oto-eyebrow { display: none; }
.premium-oto-fated_chat.is-chatting .premium-oto-copy h1 {
  margin: 2px 0 4px;
  font-family: inherit;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -.025em;
}
.premium-oto-fated_chat.is-chatting .premium-oto-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.premium-oto-fated_chat.is-chatting .premium-oto-chat-demo,
.premium-oto-fated_chat.is-chatting .premium-oto-chat-stage {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}
.premium-oto-fated_chat.is-chatting .premium-oto-chat-demo { margin-top: 12px; }
.premium-oto-chat-chooser[hidden],
.premium-oto-chat-stage[hidden],
.premium-oto-chat-offer[hidden] { display: none; }
.premium-oto-chat-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.premium-oto-chat-cards button {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e8dfe3;
  border-radius: 19px;
  background: #fff;
  color: #302b2e;
  box-shadow: 0 15px 32px rgba(60, 38, 48, .1);
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.premium-oto-chat-cards button:hover,
.premium-oto-chat-cards button:focus-visible {
  border-color: #ed2f6e;
  box-shadow: 0 17px 36px rgba(210, 42, 96, .17);
  outline: none;
  transform: translateY(-4px);
}
.premium-oto-chat-cards img {
  display: block;
  width: 100%;
  aspect-ratio: .76;
  object-fit: cover;
}
.premium-oto-chat-cards span {
  display: grid;
  gap: 2px;
  padding: 10px 9px 11px;
  text-align: center;
}
.premium-oto-chat-cards strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.premium-oto-chat-cards small { color: #91888e; font-size: 9px; }
.premium-oto-chat-chooser > p {
  margin: 13px 0 0;
  color: #8d858a;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}
.premium-oto-chat-stage { animation: premiumOtoChatStageIn .28s ease-out both; }
.premium-oto-chat-offer {
  padding: 4px 0 8px;
  text-align: center;
  animation: premiumOtoChatStageIn .32s ease-out both;
}
.premium-oto-chat-trial-price {
  display: grid;
  justify-items: center;
  margin: 0 auto 10px;
}
.premium-oto-chat-trial-price del {
  position: relative;
  color: #938a90;
  font-size: 18px;
  font-weight: 800;
  text-decoration-color: #ed2f6e;
  text-decoration-thickness: 3px;
}
.premium-oto-chat-trial-price strong {
  margin-top: -2px;
  color: #ed2f6e;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -.06em;
}
.premium-oto-chat-trial-price span {
  margin-top: 5px;
  color: #6f666c;
  font-size: 12px;
  font-weight: 800;
}
.premium-oto-chat-offer-cards {
  display: flex;
  min-height: 142px;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 9px;
}
.premium-oto-chat-offer-cards img {
  width: 94px;
  aspect-ratio: .78;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 17px;
  box-shadow: 0 14px 30px rgba(53, 34, 43, .16);
}
.premium-oto-chat-offer-cards img:nth-child(1) { transform: translateX(19px) rotate(-7deg); }
.premium-oto-chat-offer-cards img:nth-child(2) { z-index: 2; transform: translateY(-10px); }
.premium-oto-chat-offer-cards img:nth-child(3) { transform: translateX(-19px) rotate(7deg); }
.premium-oto-chat-offer > strong,
.premium-oto-chat-offer > span { display: block; }
.premium-oto-chat-offer > strong { color: #332d31; font-size: 17px; }
.premium-oto-chat-offer > span { margin-top: 5px; color: #81777d; font-size: 12px; }
.premium-oto-chat-disclosure {
  max-width: 370px;
  margin: 13px auto 0;
  color: #857c82;
  font-size: 10px;
  line-height: 1.5;
}
@keyframes premiumOtoChatStageIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.premium-oto-chat-people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.premium-oto-chat-people button {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid #e9e3e6;
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: #3d383c;
  cursor: pointer;
  text-align: left;
}
.premium-oto-chat-people button.is-active {
  border-color: #f43d78;
  background: #fff3f7;
  box-shadow: 0 0 0 2px rgba(244, 61, 120, .1);
}
.premium-oto-chat-people button.is-locked { opacity: .48; cursor: not-allowed; }
.premium-oto-chat-people img {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 50%;
  object-fit: cover;
}
.premium-oto-chat-people span { display: grid; min-width: 0; }
.premium-oto-chat-people strong,
.premium-oto-chat-people small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium-oto-chat-people strong { font-size: 11px; }
.premium-oto-chat-people small { margin-top: 2px; color: #938b91; font-size: 9px; }
.premium-oto-chat-window {
  overflow: hidden;
  border: 1px solid #e8e2e5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(54, 36, 44, .12);
}
.premium-oto-fated_chat.is-chatting .premium-oto-chat-window {
  display: grid;
  min-height: 390px;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(132px, 1fr) auto auto;
}
.premium-oto-chat-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 14px;
  border-bottom: 1px solid #f0ecee;
  background: #fffafb;
}
.premium-oto-chat-bar img { width: 39px; height: 39px; border-radius: 50%; object-fit: cover; }
.premium-oto-chat-bar > span { display: grid; gap: 2px; }
.premium-oto-chat-bar strong { font-size: 13px; }
.premium-oto-chat-bar small { color: #888087; font-size: 10px; }
.premium-oto-chat-change {
  margin-left: auto;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: #c82a60;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.premium-oto-chat-change:disabled { opacity: .4; cursor: default; }
.premium-oto-chat-bar i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-radius: 50%;
  background: #2abf75;
}
.premium-oto-chat-messages {
  display: flex;
  min-height: 190px;
  max-height: 260px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 14px;
  background: linear-gradient(180deg, #fff 0%, #fffbfc 100%);
}
.premium-oto-fated_chat.is-chatting .premium-oto-chat-messages {
  min-height: 0;
  max-height: none;
  justify-content: flex-end;
  padding: 16px;
}
.premium-oto-chat-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 11px;
  background: #fffbfc;
}
.premium-oto-chat-answers[hidden] { display: none; }
.premium-oto-chat-answers button {
  width: auto;
  padding: 8px 11px;
  border: 1px solid #efccd8;
  border-radius: 999px;
  background: #fff5f8;
  color: #b92758;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}
.premium-oto-chat-answers button:hover:not(:disabled) { border-color: #ed2f6e; background: #ffedf3; }
.premium-oto-chat-answers button:disabled { opacity: .55; cursor: default; }
.premium-oto-chat-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 15px;
  font-size: 12px;
  line-height: 1.42;
}
.premium-oto-chat-bubble.bot {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #f2eff1;
  color: #3d383c;
}
.premium-oto-chat-bubble.user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: linear-gradient(135deg, #ff527f, #e8296c);
  color: #fff;
}
.premium-oto-chat-prompts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 12px 10px;
  scrollbar-width: none;
}
.premium-oto-chat-prompts::-webkit-scrollbar { display: none; }
.premium-oto-chat-prompts button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #f0ccd8;
  border-radius: 999px;
  background: #fff7fa;
  color: #c72a60;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.premium-oto-chat-compose {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #f0ecee;
}
.premium-oto-chat-compose input {
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border: 1px solid #e5dfe2;
  border-radius: 13px;
  background: #faf8f9;
  color: #2f2a2e;
  font: inherit;
  font-size: 12px;
}
.premium-oto-chat-compose input:focus { outline: 2px solid rgba(238, 46, 108, .18); border-color: #ee2e6c; }
.premium-oto-chat-compose button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #ed2f6e;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
}
.premium-oto-chat-compose :disabled { opacity: .55; cursor: default; }
.premium-oto-chat-typing {
  display: flex;
  align-self: flex-start;
  gap: 4px;
  padding: 11px 13px;
  border-radius: 15px 15px 15px 4px;
  background: #f2eff1;
}
.premium-oto-chat-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #958c92;
  animation: premiumOtoTyping .9s infinite alternate;
}
.premium-oto-chat-typing span:nth-child(2) { animation-delay: .16s; }
.premium-oto-chat-typing span:nth-child(3) { animation-delay: .32s; }
@keyframes premiumOtoTyping { to { opacity: .28; transform: translateY(-2px); } }
.premium-oto-chat-note {
  margin: 10px 0 0;
  color: #91898f;
  text-align: center;
  font-size: 10px;
}
.premium-oto-chat-trial {
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid #f2cbd8;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff4f8, #fff9f1);
  text-align: center;
}
.premium-oto-chat-trial[hidden] { display: none; }
.premium-oto-chat-trial strong,
.premium-oto-chat-trial span { display: block; }
.premium-oto-chat-trial strong { color: #342d31; font-size: 14px; }
.premium-oto-chat-trial span { margin-top: 3px; color: #7c7178; font-size: 11px; }
.premium-oto-footer-gated { display: none; }
.premium-oto-footer-gated.is-revealed { display: block; }
.premium-oto-book {
  position: relative;
  width: 184px;
  margin: 26px auto 24px;
  isolation: isolate;
  perspective: 800px;
}
.premium-oto-book-glow {
  position: absolute;
  z-index: -1;
  inset: 12% -38% -4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 91, 139, .28), rgba(255, 180, 94, .1) 48%, transparent 72%);
  filter: blur(9px);
}
.premium-oto-book img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 9px 17px 17px 9px;
  transform: rotateY(-8deg) rotateZ(-1deg);
  box-shadow: 18px 24px 42px rgba(50, 31, 40, .24), inset -5px 0 8px rgba(0, 0, 0, .12);
}
.premium-oto-book span {
  position: absolute;
  right: -46px;
  bottom: 24px;
  padding: 9px 13px;
  border: 1px solid #f0dfe5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  color: #3f373c;
  box-shadow: 0 10px 24px rgba(64, 41, 51, .13);
  font-size: 12px;
  font-weight: 850;
}
.premium-oto-library-price {
  min-height: 118px;
  margin: 2px auto 8px;
  text-align: center;
}
.premium-oto-library-price > span {
  display: block;
  color: #8d858a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  animation: premiumLibraryFadeUp .35s .05s both;
}
.premium-oto-library-price > div {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.premium-oto-library-price del {
  position: relative;
  color: #2e292c;
  font-size: clamp(40px, 11vw, 52px);
  font-weight: 900;
  letter-spacing: -.055em;
  text-decoration: none;
  animation: premiumLibraryOldPrice .4s .2s both;
}
.premium-oto-library-price del::after {
  position: absolute;
  top: 51%;
  left: -5%;
  width: 110%;
  height: 5px;
  border-radius: 999px;
  background: #ed2f6e;
  content: "";
  transform: rotate(-7deg) scaleX(0);
  transform-origin: left center;
  animation: premiumLibraryStrike .5s .68s cubic-bezier(.2,.85,.25,1) both;
}
.premium-oto-library-price strong {
  color: #ed2f6e;
  font-size: clamp(31px, 8vw, 39px);
  letter-spacing: -.05em;
  animation: premiumLibraryNewPrice .5s 1.12s cubic-bezier(.18,.9,.35,1.25) both;
}
.premium-oto-library-price small {
  display: block;
  margin-top: -3px;
  color: #7f767c;
  font-size: 11px;
  font-weight: 700;
  animation: premiumLibraryFadeUp .4s 1.35s both;
}
.premium-oto-library_forever .premium-oto-copy {
  animation: premiumLibraryFadeUp .55s 1.62s both;
}
.premium-oto-library {
  position: relative;
  height: 260px;
  max-width: 390px;
  margin: 16px auto 8px;
}
.premium-oto-library img {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 128px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 9px;
  box-shadow: 0 18px 34px rgba(44, 31, 37, .2);
  transform-origin: 50% 100%;
}
.premium-oto-library img:nth-child(1) { z-index: 5; animation: premiumLibraryCenter .48s 2.12s both; }
.premium-oto-library img:nth-child(2) { z-index: 4; animation: premiumLibraryFanLeft .7s 2.42s cubic-bezier(.17,.82,.28,1) both; }
.premium-oto-library img:nth-child(3) { z-index: 3; animation: premiumLibraryFanRight .7s 2.48s cubic-bezier(.17,.82,.28,1) both; }
.premium-oto-library img:nth-child(4) { z-index: 2; animation: premiumLibraryFanFarLeft .76s 2.58s cubic-bezier(.17,.82,.28,1) both; }
.premium-oto-library img:nth-child(5) { z-index: 1; animation: premiumLibraryFanFarRight .76s 2.64s cubic-bezier(.17,.82,.28,1) both; }
.premium-oto-library strong {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  padding: 9px 15px;
  border-radius: 999px;
  background: #fff;
  color: #e42b68;
  box-shadow: 0 10px 26px rgba(61, 41, 50, .16);
  font-size: 12px;
  white-space: nowrap;
  animation: premiumLibraryNewPrice .45s 3.05s both;
}
.premium-oto-library_forever .premium-oto-footer { animation: premiumLibraryFadeUp .45s 3.18s both; }
@keyframes premiumLibraryOldPrice {
  from { opacity: 0; transform: translateY(8px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes premiumLibraryStrike {
  to { transform: rotate(-7deg) scaleX(1); }
}
@keyframes premiumLibraryNewPrice {
  from { opacity: 0; transform: translateY(8px) scale(.72); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes premiumLibraryFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes premiumLibraryCenter {
  from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.84); }
  to { opacity: 1; transform: translateX(-50%) translateY(-8px) scale(1); }
}
@keyframes premiumLibraryFanLeft {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.82); }
  to { opacity: 1; transform: translateX(-104%) rotate(-13deg) scale(1); }
}
@keyframes premiumLibraryFanRight {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.82); }
  to { opacity: 1; transform: translateX(4%) rotate(13deg) scale(1); }
}
@keyframes premiumLibraryFanFarLeft {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.78); }
  to { opacity: 1; transform: translateX(-148%) translateY(10px) rotate(-24deg) scale(1); }
}
@keyframes premiumLibraryFanFarRight {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.78); }
  to { opacity: 1; transform: translateX(48%) translateY(10px) rotate(24deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .premium-oto-library-price > span,
  .premium-oto-library-price del,
  .premium-oto-library-price del::after,
  .premium-oto-library-price strong,
  .premium-oto-library-price small,
  .premium-oto-library_forever .premium-oto-copy,
  .premium-oto-library img,
  .premium-oto-library strong,
  .premium-oto-library_forever .premium-oto-footer { animation-delay: 0s; animation-duration: .01ms; }
}
.premium-oto-benefits {
  display: grid;
  gap: 10px;
  max-width: 390px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.premium-oto-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #ebe7e8;
  border-radius: 14px;
  background: rgba(255, 255, 255, .76);
  color: #4b464b;
  font-size: 13px;
  font-weight: 650;
}
.premium-oto-benefits li span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: #fff0f5;
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
}
.premium-oto-footer {
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(218, 211, 214, .78);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -14px 35px rgba(56, 40, 46, .07);
  backdrop-filter: blur(16px);
}
.premium-oto-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin-bottom: 10px;
}
.premium-oto-price del {
  color: #aaa2a7;
  font-size: 17px;
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-decoration-color: #e2547f;
}
.premium-oto-price strong { color: #262126; font-size: 24px; letter-spacing: -.035em; }
.premium-oto-price span { color: #8a8389; font-size: 12px; }
.premium-oto-cta {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(115deg, #ff9e47 0%, #ff3575 54%, #ed286f 100%);
  color: #fff;
  box-shadow: 0 13px 28px rgba(238, 40, 111, .24);
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
}
.premium-oto-cta:disabled { opacity: .65; cursor: wait; }
.premium-oto-footer-skip { display: block; margin: 8px auto 0; padding: 5px 10px; font-size: 12px; }
.premium-oto-footer-note {
  max-width: 420px;
  margin: 9px auto 0;
  color: #777076;
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
}
.premium-oto-error { margin: 7px 0 0; color: #c6284c; text-align: center; font-size: 12px; }
@media (min-width: 560px) {
  .premium-oto-screen {
    height: min(850px, 92dvh);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 30px;
    box-shadow: 0 35px 90px rgba(50, 35, 42, .24);
  }
}
@media (max-width: 420px) {
  .premium-oto-header {
    min-height: 54px;
    padding: max(10px, env(safe-area-inset-top)) 16px 6px;
  }
  .premium-oto-scroll { padding: 6px 16px 18px; }
  .premium-oto-copy h1 {
    margin: 13px auto 9px;
    font-size: clamp(28px, 9.2vw, 36px);
    line-height: 1.02;
  }
  .premium-oto-copy p { font-size: 14px; line-height: 1.46; }
  .premium-oto-archive,
  .premium-oto-keepsakes,
  .premium-oto-cast { margin-top: 20px; margin-bottom: 18px; }
  .premium-oto-archive-main { min-height: 132px; }
  .premium-oto-archive > div img { height: 76px; }
  .premium-oto-keepsakes { gap: 9px; }
  .premium-oto-keepsakes figure { padding: 7px 7px 10px; border-radius: 16px; }
  .premium-oto-keepsakes figure:nth-child(2) { transform: translateY(10px) rotate(1.5deg); }
  .premium-oto-keepsakes img { height: clamp(145px, 44vw, 178px); }
  .premium-oto-book { width: 154px; margin: 20px auto 18px; }
  .premium-oto-book span { right: -36px; bottom: 18px; padding: 8px 10px; font-size: 11px; }
  .premium-oto-benefits { gap: 7px; }
  .premium-oto-benefits li { gap: 8px; padding: 10px 11px; font-size: 12px; }
  .premium-oto-library-price { min-height: 104px; margin-bottom: 4px; }
  .premium-oto-library-price > div { min-height: 61px; gap: 11px; }
  .premium-oto-library-price del { font-size: clamp(35px, 10.5vw, 44px); }
  .premium-oto-library-price strong { font-size: clamp(28px, 8.4vw, 35px); }
  .premium-oto-library { height: 224px; margin: 10px auto 4px; }
  .premium-oto-library img { width: 108px; bottom: 16px; }
  .premium-oto-footer { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .premium-oto-price { margin-bottom: 7px; }
  .premium-oto-price strong { font-size: 22px; }
  .premium-oto-cta { min-height: 51px; border-radius: 15px; font-size: 15px; }
  .premium-oto-footer-skip { margin-top: 5px; }
  .premium-oto-chat-demo { margin-top: 17px; }
  .premium-oto-chat-cards { gap: 7px; }
  .premium-oto-chat-cards button { border-radius: 15px; }
  .premium-oto-chat-cards span { padding: 8px 5px 9px; }
  .premium-oto-chat-cards strong { font-size: 12px; }
  .premium-oto-chat-offer-cards { min-height: 124px; }
  .premium-oto-chat-offer-cards img { width: 82px; }
  .premium-oto-chat-disclosure { font-size: 9.5px; line-height: 1.42; }
}
@media (max-width: 360px) {
  .premium-oto-header { padding-right: 13px; padding-left: 13px; }
  .premium-oto-scroll { padding-right: 13px; padding-left: 13px; }
  .premium-oto-wordmark { font-size: 14px; }
  .premium-oto-dismiss { font-size: 12px; }
  .premium-oto-copy h1 { font-size: 27px; }
  .premium-oto-copy p { font-size: 13px; }
  .premium-oto-eyebrow { padding: 6px 9px; font-size: 9px; }
  .premium-oto-library { height: 208px; }
  .premium-oto-library img { width: 96px; }
  .premium-oto-library img:nth-child(2) { animation-name: premiumLibraryFanLeftNarrow; }
  .premium-oto-library img:nth-child(3) { animation-name: premiumLibraryFanRightNarrow; }
  .premium-oto-library img:nth-child(4) { animation-name: premiumLibraryFanFarLeftNarrow; }
  .premium-oto-library img:nth-child(5) { animation-name: premiumLibraryFanFarRightNarrow; }
  .premium-oto-chat-window { border-radius: 19px; }
  .premium-oto-fated_chat.is-chatting .premium-oto-chat-window { min-height: 350px; }
  .premium-oto-chat-answers button { padding: 7px 9px; font-size: 9px; }
  .premium-oto-chat-compose { grid-template-columns: 1fr 36px; padding: 8px 9px 10px; }
  .premium-oto-chat-compose input { height: 38px; padding: 0 10px; }
  .premium-oto-footer { padding-right: 12px; padding-left: 12px; }
}
@media (max-height: 700px) {
  .premium-oto-copy h1 { margin-top: 10px; font-size: clamp(27px, 8.5vw, 34px); }
  .premium-oto-copy p { line-height: 1.4; }
  .premium-oto-book { width: 142px; margin-top: 16px; }
  .premium-oto-archive,
  .premium-oto-keepsakes { margin-top: 16px; }
  .premium-oto-library-price { min-height: 94px; }
  .premium-oto-library-price > div { min-height: 54px; }
  .premium-oto-library { height: 194px; }
  .premium-oto-library img { width: 92px; }
  .premium-oto-benefits li { padding-top: 9px; padding-bottom: 9px; }
}
@keyframes premiumLibraryFanLeftNarrow {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.82); }
  to { opacity: 1; transform: translateX(-98%) rotate(-13deg) scale(1); }
}
@keyframes premiumLibraryFanRightNarrow {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.82); }
  to { opacity: 1; transform: translateX(-2%) rotate(13deg) scale(1); }
}
@keyframes premiumLibraryFanFarLeftNarrow {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.78); }
  to { opacity: 1; transform: translateX(-135%) translateY(9px) rotate(-22deg) scale(1); }
}
@keyframes premiumLibraryFanFarRightNarrow {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(.78); }
  to { opacity: 1; transform: translateX(35%) translateY(9px) rotate(22deg) scale(1); }
}

/* Desktop OTO composition. Mobile keeps the focused single-column sheet;
 * wide screens use the available canvas as a proper sales presentation. */
@media (min-width: 900px) {
  .premium-oto-layer {
    padding: 24px 32px;
    background:
      radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .5), transparent 23%),
      rgba(49, 38, 43, .28);
  }
  .premium-oto-screen {
    width: min(1120px, calc(100vw - 64px));
    height: min(780px, calc(100dvh - 48px));
    grid-template-rows: 72px minmax(0, 1fr) auto;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 32px;
    background:
      radial-gradient(circle at 88% 12%, rgba(255, 188, 88, .24), transparent 34%),
      radial-gradient(circle at 68% 88%, rgba(240, 45, 113, .08), transparent 31%),
      linear-gradient(125deg, #fffdfb 0%, #fff 50%, #fbf6f2 100%);
    box-shadow: 0 38px 110px rgba(43, 29, 35, .25);
  }
  .premium-oto-header {
    min-height: 72px;
    padding: 14px 32px 8px;
  }
  .premium-oto-wordmark { font-size: 18px; }
  .premium-oto-dismiss { font-size: 14px; }
  .premium-oto-scroll {
    display: grid;
    grid-template-columns: minmax(330px, .92fr) minmax(440px, 1.08fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "lead visual"
      "copy visual"
      "benefits visual";
    align-content: safe center;
    align-items: center;
    column-gap: clamp(42px, 5vw, 76px);
    padding: 24px clamp(48px, 5.4vw, 76px) 32px;
  }
  .premium-oto-copy {
    grid-area: copy;
    text-align: left;
  }
  .premium-oto-eyebrow {
    padding: 8px 13px;
    font-size: 11px;
  }
  .premium-oto-copy h1 {
    max-width: 490px;
    margin: 19px 0 14px;
    font-size: clamp(43px, 4vw, 59px);
    line-height: .98;
  }
  .premium-oto-copy p {
    max-width: 470px;
    margin: 0;
    font-size: 17px;
    line-height: 1.55;
  }
  .premium-oto-author_bundle .premium-oto-copy h1 {
    font-size: clamp(42px, 3.4vw, 52px);
  }
  .premium-oto-book,
  .premium-oto-archive,
  .premium-oto-keepsakes,
  .premium-oto-cast,
  .premium-oto-library,
  .premium-oto-chat-demo {
    grid-area: visual;
  }
  .premium-oto-benefits {
    grid-area: benefits;
    width: 100%;
    max-width: 470px;
    margin: 24px 0 0;
  }
  .premium-oto-benefits li {
    padding: 12px 15px;
    font-size: 14px;
  }
  .premium-oto-book {
    width: 240px;
    margin: 0 auto;
  }
  .premium-oto-book span {
    right: -58px;
    bottom: 33px;
    padding: 11px 14px;
    font-size: 13px;
  }
  .premium-oto-archive {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 13px;
  }
  .premium-oto-archive-main { min-height: 230px; }
  .premium-oto-archive > div img { height: 112px; }
  .premium-oto-keepsakes {
    width: 100%;
    max-width: 500px;
    gap: 17px;
    margin: 0 auto;
  }
  .premium-oto-keepsakes img { height: 265px; }
  .premium-oto-cast {
    width: 100%;
    max-width: 520px;
    gap: 14px;
    margin: 0 auto;
  }
  .premium-oto-chat-demo {
    width: 100%;
    max-width: 530px;
    margin: 0 auto;
  }
  .premium-oto-chat-cards { gap: 14px; }
  .premium-oto-chat-cards button { border-radius: 23px; }
  .premium-oto-chat-cards span { padding: 13px 10px 14px; }
  .premium-oto-chat-cards strong { font-size: 15px; }
  .premium-oto-chat-cards small { font-size: 11px; }
  .premium-oto-chat-chooser > p { margin-top: 17px; font-size: 12px; }
  .premium-oto-fated_chat.is-chatting .premium-oto-scroll {
    display: grid;
    grid-template-columns: minmax(300px, .78fr) minmax(480px, 1.22fr);
    grid-template-rows: 1fr;
    grid-template-areas: "copy visual";
    align-items: center;
    padding-top: 18px;
  }
  .premium-oto-fated_chat.is-chatting .premium-oto-copy {
    align-self: center;
  }
  .premium-oto-fated_chat.is-chatting .premium-oto-copy h1 {
    margin: 14px 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
    line-height: 1;
  }
  .premium-oto-fated_chat.is-chatting .premium-oto-copy p {
    font-size: 17px;
    line-height: 1.55;
  }
  .premium-oto-fated_chat.is-chatting .premium-oto-chat-demo {
    min-height: 0;
    margin: 0 auto;
  }
  .premium-oto-fated_chat.is-chatting .premium-oto-chat-window {
    min-height: min(500px, calc(100dvh - 230px));
  }
  .premium-oto-chat-bar { padding: 14px 16px; }
  .premium-oto-chat-bar img { width: 45px; height: 45px; }
  .premium-oto-chat-bar strong { font-size: 15px; }
  .premium-oto-chat-bubble { max-width: 78%; font-size: 14px; }
  .premium-oto-chat-offer { padding: 0 22px 8px; }
  .premium-oto-chat-offer-cards { min-height: 168px; }
  .premium-oto-chat-offer-cards img { width: 112px; }
  .premium-oto-chat-offer > strong { font-size: 20px; }
  .premium-oto-chat-offer > span { font-size: 14px; }
  .premium-oto-chat-disclosure {
    max-width: 500px;
    font-size: 11px;
    line-height: 1.5;
  }
  .premium-oto-library-price {
    grid-area: lead;
    justify-items: start;
    min-height: 112px;
    margin: 0 0 4px;
    text-align: left;
  }
  .premium-oto-library-price > div { justify-content: start; }
  .premium-oto-library-price del { font-size: 49px; }
  .premium-oto-library-price strong { font-size: 40px; }
  .premium-oto-library {
    width: 100%;
    max-width: 540px;
    height: 390px;
    margin: 0 auto;
  }
  .premium-oto-library img { width: 155px; bottom: 45px; }
  .premium-oto-library strong { bottom: 7px; font-size: 15px; }
  .premium-oto-footer {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(360px, 470px) minmax(190px, 1fr);
    align-items: center;
    gap: 22px;
    min-height: 88px;
    padding: 14px 32px 16px;
  }
  .premium-oto-footer-gated:not(.is-revealed) { display: none; }
  .premium-oto-footer-gated.is-revealed { display: grid; }
  .premium-oto-price {
    justify-content: flex-start;
    margin: 0;
  }
  .premium-oto-price del { font-size: 18px; }
  .premium-oto-price strong { font-size: 28px; }
  .premium-oto-price span { font-size: 13px; }
  .premium-oto-cta {
    grid-column: 2;
    min-height: 58px;
    font-size: 17px;
  }
  .premium-oto-footer-skip {
    grid-column: 3;
    justify-self: end;
    margin: 0;
    font-size: 13px;
  }
  .premium-oto-footer-note,
  .premium-oto-error {
    grid-column: 2;
    margin: -13px 0 0;
  }
}
@media (min-width: 900px) and (max-height: 760px) {
  .premium-oto-scroll {
    padding-top: 14px;
    padding-bottom: 8px;
  }
  .premium-oto-copy h1 {
    margin: 14px 0 10px;
    font-size: 46px;
    line-height: .98;
  }
  .premium-oto-copy p {
    font-size: 15.5px;
    line-height: 1.45;
  }
  .premium-oto-benefits {
    gap: 6px;
    margin-top: 13px;
  }
  .premium-oto-benefits li {
    padding: 9px 13px;
    font-size: 13px;
  }
  .premium-oto-book { width: 205px; }
  .premium-oto-book span { right: -52px; bottom: 27px; }
  .premium-oto-archive { max-width: 470px; }
  .premium-oto-archive-main { min-height: 188px; }
  .premium-oto-archive > div img { height: 86px; }
  .premium-oto-keepsakes { max-width: 470px; }
  .premium-oto-keepsakes img { height: 215px; }
  .premium-oto-fated_chat.is-chatting .premium-oto-copy h1 {
    font-size: 46px;
  }
  .premium-oto-library-price { min-height: 98px; }
  .premium-oto-library-price del { font-size: 44px; }
  .premium-oto-library-price strong { font-size: 37px; }
  .premium-oto-library {
    height: 345px;
    max-width: 510px;
  }
  .premium-oto-library img { width: 139px; bottom: 40px; }
}
.premium-app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
}
.premium-page {
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(92px + env(safe-area-inset-bottom));
}
.premium-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(50px + env(safe-area-inset-top));
  margin: calc(-16px - env(safe-area-inset-top)) -20px 16px;
  padding: env(safe-area-inset-top) 18px 0;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}
.premium-icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 30px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.premium-header-title {
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -.02em;
  color: var(--text);
}

/* ── Premium login modal ───────────────────────────────────────────────── */
.premium-login-sheet { padding: 20px 20px 28px; max-width: 440px; margin: 0 auto; }
.premium-login-sheet .sheet-close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: transparent; color: #4b5563; font-size: 24px; line-height: 1; cursor: pointer;
}
.premium-login-sheet .sheet-title {
  margin: 4px 0 8px; font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.2;
}
.premium-login-sheet .sheet-sub {
  margin: 0 0 18px; color: #4b5563; font-size: 14px; line-height: 1.5;
}
.premium-login-form { display: flex; flex-direction: column; gap: 6px; }
.premium-login-label {
  font-size: 13px; color: #374151; font-weight: 600; margin: 6px 0 2px;
}
.premium-login-input {
  appearance: none; -webkit-appearance: none;
  border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; font-family: inherit; background: #ffffff;
  color: #0f172a; transition: border-color .15s ease, box-shadow .15s ease;
}
.premium-login-input:focus {
  outline: none; border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
}
.premium-login-error {
  min-height: 18px; color: #b91c1c; font-size: 13px; margin: 6px 0 0; line-height: 1.4;
}
.premium-login-submit {
  margin-top: 10px;
  appearance: none; -webkit-appearance: none; border: 0;
  background: #16a34a; color: #ffffff; font-weight: 800; font-size: 16px;
  letter-spacing: .06em; text-transform: uppercase;
  height: 50px; border-radius: 999px; cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.premium-login-submit:hover:not(:disabled) { background: #15803d; }
.premium-login-submit:disabled { opacity: .6; cursor: default; }
.premium-login-link {
  margin-top: 10px; align-self: center;
  background: transparent; border: 0; color: #16a34a; font-weight: 600;
  font-size: 14px; cursor: pointer; padding: 6px 10px;
}
.premium-login-link:hover:not(:disabled) { text-decoration: underline; }
.premium-login-link:disabled { opacity: .5; cursor: default; }
.premium-reset-fields {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.premium-reset-fields[hidden] { display: none; }
.premium-reset-intro {
  margin: 0 0 4px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}
.premium-reset-submit { margin-top: 10px; }
[dir="rtl"] .premium-login-sheet .sheet-close { right: auto; left: 10px; }
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(480px, 100vw);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.bottom-nav a {
  text-decoration: none;
  color: #555963;
  text-align: center;
  font-size: 13px;
  padding: 6px 4px;
  border-radius: 14px;
}
.bottom-nav .nav-ico { display: block; font-size: 23px; line-height: 1.1; }
.bottom-nav a.active { color: var(--pink); font-weight: 800; }
.section-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  line-height: 1.05;
  margin: 26px 0 18px;
}
.book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.book-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.book-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  background: #ececf0;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
}
.book-card h3 { margin: 10px 0 4px; font-size: 17px; line-height: 1.15; }
.book-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.soft-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,.04);
}
.continue-card {
  display: block;
  margin: 6px 0 20px;
  padding: 18px 20px;
  text-decoration: none;
}
.continue-card strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}
.continue-card span {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 18px;
}
.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd8e6, #ff7aa8);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}
.profile-name {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}
.profile-section {
  margin-top: 16px;
}
.profile-section-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 900;
}
.viewed-list {
  display: grid;
  gap: 10px;
}
.viewed-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #f7f7f7;
  color: var(--text);
  font-size: 14px;
}
.profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.profile-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.profile-action[type="button"] {
  width: 100%;
  font: inherit;
}
.profile-small-btn {
  margin: 14px auto 0;
  display: block;
  border: 0;
  background: transparent;
  color: var(--pink);
  font-weight: 900;
  font-size: 14px;
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  margin: 24px 0 0;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.legal-links a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.language-sheet {
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  background: #f7f7f7;
}
.language-sheet h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}
.language-list {
  display: grid;
  gap: 10px;
}
.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font-weight: 850;
}
.language-option.active {
  border-color: var(--pink);
  color: var(--pink);
  background: #fff0f6;
}
.chat-hero {
  margin: 4px 0 18px;
}
.chat-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1.05;
}
.chat-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.chat-book-filters {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.chat-book-filters::-webkit-scrollbar { display: none; }
.chat-book-chip {
  flex: 0 0 auto;
  border: 1px solid #e4ddd7;
  border-radius: 999px;
  background: #fff;
  color: #544c47;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 13px;
}
.chat-book-chip.is-active {
  border-color: #c66b3d;
  background: #c66b3d;
  color: #fff;
}
.chat-book-label {
  display: block;
  color: #b45d35;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .035em;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.chat-story-note {
  background: #fff7f0;
  border: 1px solid #f0d8c7;
  border-radius: 12px;
  color: #6d5546;
  font-size: 13px;
  line-height: 1.45;
  margin: 12px 0;
  padding: 10px 12px;
}
.chat-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.chat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 10px 24px rgba(0,0,0,.04);
}
.chat-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid rgba(248, 181, 50, .58);
  border-radius: 50%;
  background: #f1edf4;
  box-shadow: 0 0 20px rgba(248,181,50,.22);
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.chat-main {
  min-width: 0;
  flex: 1;
}
.chat-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.chat-name {
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-free {
  color: #1d82d4;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}
.chat-role {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.chat-greeting {
  display: -webkit-box;
  margin: 0;
  color: #666872;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.chat-thread {
  min-height: calc(100dvh - 150px);
  display: flex;
  flex-direction: column;
}
.chat-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
}
.chat-thread-head .chat-avatar {
  width: 48px;
  height: 48px;
}
.chat-messages {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px 0 18px;
}
.chat-bubble {
  max-width: 82%;
  padding: 12px 14px;
  border-radius: 22px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 6px 16px rgba(0,0,0,.04);
}
.chat-bubble.bot {
  justify-self: start;
  border-bottom-left-radius: 6px;
  background: #f2f2f4;
}
.chat-bubble.user {
  justify-self: end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(120deg, #ffb52e, #ffdf70);
  color: #201b16;
  font-weight: 700;
}
.chat-typing {
  justify-self: start;
  display: flex;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 22px;
  background: #f2f2f4;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9a9aa2;
  animation: chatDot .8s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .12s; }
.chat-typing span:nth-child(3) { animation-delay: .24s; }
@keyframes chatDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .55; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.chat-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px 12px;
}
.chat-suggestions button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 9px 12px;
  color: #666872;
  font-size: 12px;
  font-weight: 800;
}
.chat-input-row {
  position: sticky;
  bottom: calc(70px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 0 0;
  background: var(--bg);
}
.chat-input-row textarea {
  min-height: 46px;
  max-height: 110px;
  flex: 1;
  resize: none;
  border: 1px solid #dddde5;
  border-radius: 24px;
  padding: 13px 16px;
  outline: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.25;
}
.chat-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #f2f2f4;
  color: var(--pink);
  font-size: 20px;
  font-weight: 900;
}
.chat-limit {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff0f6;
  color: #b7225a;
  font-size: 13px;
  font-weight: 850;
}
@media (max-width: 899px) {
  .chat-hero h1 {
    display: none;
  }
  .chat-hero {
    margin-top: 0;
  }
  body.chat-keyboard-open .bottom-nav {
    display: none;
  }
  body.chat-keyboard-open .premium-page {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  body.chat-keyboard-open .chat-input-row {
    bottom: 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}
.primary-btn {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink2), #ff2f93);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 12px 28px rgba(255,47,115,.24);
}
.secondary-btn {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 0 18px;
}
.muted { color: var(--muted); }
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,.58);
}
.sheet-backdrop.show { display: flex; animation: sheetBackdropIn .22s ease both; }
.sheet-backdrop.show > * { animation: sheetSlideUp .3s cubic-bezier(.22, .61, .36, 1) both; }
@keyframes sheetBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetSlideUp {
  from { transform: translateY(100%); opacity: .4; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet {
  position: relative;
  width: min(480px, 100vw);
  max-height: 88dvh;
  overflow: auto;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow);
}
.sheet h2 {
  margin: 2px 0 8px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1.15;
}
.sheet .sub {
  margin: 0 auto 18px;
  max-width: 280px;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  font-size: 16px;
}
.plan-row {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 88px;
  margin: 10px 0;
  padding: 16px 16px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  text-align: left;
  background: linear-gradient(90deg, #e4196b 0%, #ff3f77 50%, #ff8a6f 100%);
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(255, 47, 115, .14);
}
.plan-row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, .12) 0,
    rgba(255, 255, 255, .12) 1px,
    transparent 1px,
    transparent 7px
  );
  -webkit-mask-image: linear-gradient(90deg, transparent 68%, #000 96%);
  mask-image: linear-gradient(90deg, transparent 68%, #000 96%);
}
.plan-main, .plan-price { position: relative; z-index: 1; }
.plan-main {
  min-width: 0;
  max-width: 58%;
}
.plan-main strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: .01em;
}
.plan-main span {
  display: block;
  margin-top: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.3;
  opacity: .9;
}
.plan-price {
  text-align: right;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.1;
  white-space: nowrap;
}
.plan-price del {
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-top: 7px;
  font-size: 9px;
  color: #fff;
  text-decoration: none;
  position: relative;
}
.plan-price del::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 68%;
  height: 1.2px;
  background: currentColor;
}
.plan-badge {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
  padding: 5px 11px;
  background: #ffc239;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .02em;
  border-radius: 0 22px 0 14px;
}
.rules { margin: 18px 0 0; color: #878791; line-height: 1.45; font-size: 14px; }
.rules h3 { margin: 0 0 8px; color: #777984; font-size: 18px; }
.rules a { color: #1677ff; }
.paywall-card {
  margin: 42px auto 10px;
  text-align: center;
  color: #8b5817;
}
.paywall-cta-wrap {
  position: relative;
  margin-top: 28px;
  padding-top: 16px;
}
.paywall-discount-callout {
  position: absolute;
  right: 18px;
  top: 0;
  z-index: 1;
  padding: 5px 15px;
  background: #ffa825;
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(255, 168, 37, .28);
}
.paywall-discount-callout::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -6px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #ffa825;
}
.paywall-crown-img {
  display: block;
  width: 112px;
  height: auto;
  margin: 0 auto 12px;
  filter: drop-shadow(0 8px 12px rgba(248, 181, 50, .22));
}
.premium-inline-paywall {
  position: relative;
  margin: 30px auto 16px;
  padding: 0;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.reader-page,
.reader-article,
.reader-body,
.preview-locked {
  touch-action: pan-y;
}
.preview-locked::after {
  pointer-events: none;
}
.premium-inline-paywall .plan-row,
.premium-inline-paywall .primary-btn,
.premium-inline-paywall .premium-login-link,
.premium-inline-paywall .rules a {
  touch-action: pan-y;
}
.premium-inline-close {
  position: absolute;
  top: -4px;
  right: 0;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: #6b7280;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.premium-inline-close:hover {
  background: rgba(15, 23, 42, .12);
  color: #111827;
}
[dir="rtl"] .premium-inline-close {
  right: auto;
  left: 0;
}
.premium-inline-lock-icon {
  margin: 0 auto 18px;
  text-align: center;
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(255, 47, 115, .18));
}
.premium-inline-paywall .paywall-login-line {
  margin: 16px 0 0;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}
.premium-inline-paywall .premium-login-link {
  display: inline;
  margin: 0;
  padding: 0 4px;
  font-size: 14px;
}
.premium-inline-paywall .rules {
  margin-top: 22px;
}
.trial-plan-row {
  background: linear-gradient(120deg, #ffb52e 0%, #ff8a34 44%, #ff3f77 100%);
  box-shadow: 0 14px 30px rgba(255, 138, 52, .18);
}
.trial-plan-row .plan-badge {
  background: #fff;
  color: #ff7b2d;
}
.crown { font-size: 56px; color: var(--gold); line-height: 1; }
.discount-pill {
  display: inline-block;
  margin: 10px 0 -3px;
  padding: 5px 22px;
  background: #ffa825;
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
}
.retain-card {
  position: relative;
  isolation: isolate;
  margin: 64px auto 22px;
  max-width: 360px;
  background: #fff;
  border-radius: 28px;
  padding: 36px 22px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  overflow: visible;
}
.retain-top {
  position: absolute;
  z-index: -1;
  left: 16px;
  width: 56%;
  top: -50px;
  height: 116px;
  box-sizing: border-box;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(120deg, #ff366e, #ff8c45);
  color: #fff;
  text-align: left;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.18;
  box-shadow: 0 14px 26px rgba(255, 76, 104, .22);
}
.retain-crown {
  position: absolute;
  right: -10px;
  top: -86px;
  z-index: 2;
  width: 198px;
  pointer-events: none;
  filter: drop-shadow(0 14px 22px rgba(248, 181, 50, .25));
}
.retain-offer-box {
  position: relative;
  margin: 0 0 22px;
  padding: 24px 18px;
  border: 1px solid #ffd4df;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff9fb, #fff0f4);
  color: #8f2638;
  text-align: center;
  font-weight: 400;
  font-size: 21px;
  line-height: 1.45;
}
.retain-offer-box span {
  position: relative;
  z-index: 1;
}
.retain-arrow {
  position: absolute;
  right: 4px;
  bottom: -52px;
  width: 92px;
  opacity: .55;
  pointer-events: none;
}
.retain-price-wrap {
  position: relative;
  margin: 18px 0 18px;
}
.retain-price-btn {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(115deg, #ffa348 0%, #ff3f7c 50%, #ff9b54 100%);
  color: #fff;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: .01em;
  box-shadow:
    inset 0 3px 8px rgba(255,255,255,.45),
    inset 0 -8px 18px rgba(180, 20, 86, .22),
    0 14px 30px rgba(255, 63, 124, .28);
}
.retain-price-btn del {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 400;
  opacity: .62;
}
.retain-timer-badge {
  position: absolute;
  right: 16px;
  top: -18px;
  z-index: 3;
  padding: 7px 16px;
  background: linear-gradient(90deg, #ffb52e, #ff8d34);
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(255, 154, 43, .28);
}
.retain-timer-badge::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -6px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #ff9d32;
}
.close-x {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(17, 24, 39, .14);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
  color: #111827;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  padding: 0 0 2px;
}
.reader-theme-dark {
  --bg: #111;
  --card: #1a1a1a;
  --text: #f2f2f2;
  --muted: #aaa;
  --line: #2c2c2c;
  --header-bg: rgba(17, 17, 17, .94);
  color-scheme: dark;
}
.reader-theme-sepia { --bg: #f3e4c7; --card: #f7ead2; --header-bg: rgba(243, 228, 199, .94); }
.reader-theme-sage { --bg: #dfead7; --card: #edf4e8; --header-bg: rgba(223, 234, 215, .94); }
.inapp-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fff5d8;
  border: 1px solid #ffe3a0;
  border-radius: 14px;
  color: #6a4a08;
  font-size: 13px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (max-width: 340px) {
  .plan-row { padding: 20px 12px; gap: 8px; }
  .plan-main strong { font-size: 21px; }
  .plan-price { font-size: 15px; }
}

/* ── Desktop layout (≥ 900px) ─────────────────────────────────────────────
 * The /premium/* surface was originally built for a 480px phone column.
 * At ≥ 900px we widen the shell to a 1120px centered column, hoist the
 * bottom-nav into a fixed top brand bar (with "Novelo Premium" + the three
 * tab links), and restyle the per-page content so it stops looking like a
 * phone screenshot on a monitor:
 *   - Home: 4-col book grid, centered "Continue reading" hero
 *   - Library: 3-col chat list; chat-thread kept narrow & centered
 *   - Profile: 2-column grid (hero+sub on the left, viewed+actions on the right)
 *   - Legal: wide readable column
 *   - Sheets: become centered modals instead of slide-up bottom sheets
 *
 * Reader has its own page-specific desktop tweak inline in premium-reader.html
 * (so the article column stays ~720px wide for readability).
 *
 * Mobile (< 900px) is intentionally left untouched. */
@media (min-width: 900px) {
  .premium-app {
    width: 100%;
    max-width: none;
  }
  .premium-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 48px 64px;
  }
  /* Home/Library/Profile gain a fixed top brand bar. Push their content down
   * to clear the 64px-tall bar and hide the per-page .premium-header (which
   * duplicates the brand on these pages). Anchored to static markers that
   * exist on Reader (.reader-page) / Legal (.legal-content) rather than the
   * JS-appended .bottom-nav, so there's no first-paint layout shift. */
  body:not(:has(.reader-page)):not(:has(.legal-content)) .premium-page {
    padding-top: 96px;
  }
  body:not(:has(.reader-page)):not(:has(.legal-content)) .premium-header {
    display: none;
  }

  /* Reader / Legal don't render the top brand bar, so their .premium-header
   * is the only chrome. Drop the negative-margin bleed used on mobile so it
   * sits cleanly inside the wider centered column. */
  body:has(.reader-page) .premium-header,
  body:has(.legal-content) .premium-header {
    margin: 0 0 16px;
    padding: 12px 0;
    height: auto;
    background: var(--header-bg);
  }

  /* Top brand bar (only on Home/Library/Profile) */
  .bottom-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    height: 64px;
    grid-template-columns: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 48px;
    background: rgba(247, 247, 247, .94);
    border-top: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }
  .bottom-nav::before {
    content: "Novelo Premium";
    margin-right: auto;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 900;
    font-size: 20px;
    letter-spacing: -.02em;
    color: var(--text);
  }
  .bottom-nav a {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .bottom-nav a .nav-ico {
    display: inline;
    font-size: 16px;
    line-height: 1;
  }
  .bottom-nav a.active {
    background: var(--pink);
    color: #fff;
  }

  /* RTL: brand on the right, links on the left */
  [dir="rtl"] .bottom-nav { justify-content: flex-start; }
  [dir="rtl"] .bottom-nav::before { margin-right: 0; margin-left: auto; }

  /* Home */
  .book-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
  }
  .book-card h3 { font-size: 18px; margin-top: 12px; }
  .book-card p { font-size: 14px; }
  .section-title { font-size: 40px; margin: 36px 0 22px; }
  .continue-card {
    max-width: 720px;
    margin: 12px auto 28px;
    padding: 22px 28px;
  }
  .continue-card strong { font-size: 22px; }

  /* Library — chat list as 3-col, chat thread kept narrow */
  .chat-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .chat-hero { max-width: 720px; }
  .chat-hero h1 { font-size: 42px; }
  .chat-thread {
    max-width: 720px;
    margin: 0 auto;
    min-height: calc(100dvh - 200px);
  }
  .chat-input-row { bottom: 0; }
  .chat-suggestions { margin: 0; padding: 0 0 12px; }

  /* Profile — two-column grid (uses :has so only this page is affected) */
  .premium-page:has(> .profile-hero) {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-areas:
      "hero    viewed"
      "sub     actions"
      "legal   legal";
    column-gap: 40px;
    row-gap: 18px;
    align-items: start;
  }
  .premium-page:has(> .profile-hero) > .profile-hero {
    grid-area: hero;
    margin: 0;
  }
  .premium-page:has(> .profile-hero) > #sub-card {
    grid-area: sub;
    margin: 0;
  }
  .premium-page:has(> .profile-hero) > .soft-card.profile-section {
    grid-area: viewed;
    margin: 0;
  }
  .premium-page:has(> .profile-hero) > .profile-actions {
    grid-area: actions;
    margin: 0;
  }
  .premium-page:has(> .profile-hero) > .legal-links {
    grid-area: legal;
    justify-content: center;
    margin-top: 24px;
  }
  .profile-avatar {
    width: 84px;
    height: 84px;
    font-size: 34px;
  }
  .profile-name { font-size: 28px; }

  /* Legal — wider readable column */
  .legal-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
  }

  /* Modal sheets — centered with full rounding instead of bottom-anchored */
  .sheet-backdrop { align-items: center; }
  .sheet {
    width: min(520px, 92vw);
    max-height: 86vh;
    border-radius: 24px;
    padding: 28px 26px;
  }
  .language-sheet,
  .directory-sheet,
  .reader-settings-sheet {
    border-radius: 24px;
    padding-bottom: 28px;
  }
  .directory-sheet { padding-top: 12px; }
  .retain-card { margin-top: 48px; }
}

/* Active character conversations are an app-like, single-viewport surface.
 * The global site chrome remains available on the character directory, but
 * it must not compete with the conversation header or composer. */
html:has(body.chat-thread-open),
body.chat-thread-open {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body.chat-thread-open .bottom-nav,
body.chat-thread-open .novelo-en-compliance {
  display: none !important;
}
body.chat-thread-open .premium-app,
body.chat-thread-open .premium-page {
  height: 100dvh;
  min-height: 0;
}
body.chat-thread-open .premium-page {
  display: flex;
  flex-direction: column;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
  overflow: hidden;
}
body.chat-thread-open .premium-header {
  display: none;
}
body.chat-thread-open #chat-root {
  display: flex;
  flex: 1;
  min-height: 0;
}
body.chat-thread-open .chat-thread {
  display: flex;
  flex: 1;
  width: 100%;
  max-width: 720px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
}
body.chat-thread-open .chat-thread-head {
  flex: 0 0 auto;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
body.chat-thread-open .chat-story-note,
body.chat-thread-open #chat-limit,
body.chat-thread-open .chat-suggestions,
body.chat-thread-open .chat-input-row {
  flex: 0 0 auto;
}
body.chat-thread-open .chat-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
body.chat-thread-open .chat-input-row {
  position: static;
  bottom: auto;
  padding-bottom: 0;
}
