:root {
  /* Matching circular corners at the standard 1003:1672 card proportions. */
  --tarot-card-radius: 4% / 2.4%;
  color-scheme: dark;
  font-family: "IBM Plex Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: #160d13;
  color: #f4eee9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html, body, #app { min-height: 100%; margin: 0; }

/* The app scrolls its panels, never the document behind the keyboard.
   Public editorial pages do not have #app and retain document scrolling. */
html:has(#app), body:has(> #app) { height: 100%; overflow: hidden; overscroll-behavior: none; }
#app { min-height: 0; position: fixed; top: var(--app-viewport-top, 0px); left: 0; width: 100%; height: var(--app-viewport-height, 100dvh); }

body { min-width: 320px; background: #160d13; }

button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  --topbar-height: 84px;
  --conversation-offset: 160px;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(100%, 390px);
  margin: 0 auto;
  height: 100dvh;
  min-height: 640px;
  /* Animated menu focus must not scroll the entire portrait canvas. */
  overflow: clip;
  isolation: isolate;
  background: #211119;
}

/* The hand ends above 36.5% of the 780:1686 portrait. Match cover's
   width/height scale in every mode, including fullscreen. Size containment
   supplies actual shell dimensions, rather than the browser's aspect ratio. */
.app-shell:not(.app-shell--spread) {
  container-type: size;
  width: min(100%, 390px, calc(100dvh * .6));
  min-height: 0;
  height: var(--app-viewport-height, 100dvh);
}
.app-shell:not(.app-shell--spread) > .conversation {
  --conversation-offset: max(0px, calc(79cqw - var(--topbar-height)), calc(36.5cqh - var(--topbar-height)));
}

.scene {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
  overflow: hidden;
  background-image: var(--room-image);
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
}

.scene > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Both media use the original 1170:2529 canvas, center/top cover. No
   layout participation, separate menu background, crossfade or transform. */
.scene--portrait { background-image: none; pointer-events: none; }
.scene[hidden] { display: none; }
.scene--portrait > img,
.scene--portrait > video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.scene--portrait > video { opacity: 0; }
.scene--portrait.has-video-frame > video { opacity: 1; }

.scene::after {
  position: absolute;
  content: "";
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 30, 30, 0) 30%, rgba(30, 30, 30, .6) 100%);
}

.topbar {
  display: flex;
  justify-content: flex-end;
  min-height: var(--topbar-height);
  padding: 40px 14px 0;
}

.topbar--spread { justify-content: space-between; }

.own-spread-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 50%;
  color: #e8c47f;
  background: rgba(39, 18, 28, .68);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.own-spread-back svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.own-spread-back:hover,
.own-spread-back:focus-visible {
  border-color: rgba(218, 177, 105, .98);
  color: #f5d690;
  background: rgba(102, 55, 55, .46);
  box-shadow: 0 0 0 3px rgba(218, 177, 105, .1), 0 8px 20px rgba(8, 3, 8, .24);
  outline: none;
}

.own-spread-back:active { transform: scale(.96); }

.menu-button {
  display: grid;
  place-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(218, 177, 105, .82);
  border-radius: 50%;
  color: #e8c47f;
  background: rgba(39, 18, 28, .68);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.menu-button span { display: block; width: 17px; height: 1.5px; background: currentColor; }

.menu-button:hover,
.menu-button:focus-visible,
.side-menu__close:hover,
.side-menu__close:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  border-color: rgba(218, 177, 105, .98);
  color: #f5d690;
  background: rgba(102, 55, 55, .46);
  box-shadow: 0 0 0 3px rgba(218, 177, 105, .1), 0 8px 20px rgba(8, 3, 8, .24);
  outline: none;
}

.menu-button:active,
.side-menu__close:active,
.modal-close:active { transform: scale(.96); }

.conversation {
  position: relative;
  min-height: 0;
  overflow: hidden;
  margin: var(--conversation-offset) 14px 0;
  border: 1px solid rgba(210, 174, 114, 1);
  border-radius: 13px;
  background: rgba(40, 20, 30, .7);
  box-shadow: 0 12px 30px rgba(8, 3, 8, .2);
}

.conversation--fade-top::before {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 28px;
  content: "";
  background: linear-gradient(180deg, rgba(40, 20, 30, .98), rgba(40, 20, 30, 0));
  pointer-events: none;
}

.conversation--fade-bottom::after {
  position: absolute;
  z-index: 2;
  bottom: 0;
  right: 0;
  left: 0;
  height: 28px;
  content: "";
  background: linear-gradient(0deg, rgba(40, 20, 30, .98), rgba(40, 20, 30, 0));
  pointer-events: none;
}

.scroll-navigation {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 14px;
  display: grid;
  gap: 5px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.conversation--scroll-nav-visible .scroll-navigation {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.scroll-navigation__button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0 0 2px;
  border: 1px solid rgba(245, 238, 232, .2);
  border-radius: 50%;
  color: #f5eee8;
  background: rgba(49, 47, 48, .9);
  box-shadow: 0 5px 14px rgba(8, 3, 8, .28);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: opacity 160ms ease, transform 160ms ease, background 140ms ease, border-color 140ms ease;
}

.scroll-navigation__button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.scroll-navigation__button:hover,
.scroll-navigation__button:focus-visible {
  border-color: rgba(240, 200, 119, .9);
  background: rgba(75, 67, 68, .96);
  outline: none;
}

.scroll-navigation__button:active { transform: scale(.94); }

.message-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  margin: 0 auto;
  padding: 14px 14px 120px;
}

.message-stack::-webkit-scrollbar { display: none; }

.message-card {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.message--shirley {
  align-self: flex-start;
}

.message--you {
  align-self: flex-end;
  width: 100%;
  max-width: 100%;
}

.message-label,
.message-speaker-label {
  display: inline;
  margin-right: 0;
  color: #d2ae72;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.35;
}

.message--you .message-label {
  color: #c8a9d2;
  font: inherit;
}

.message-card p {
  display: inline;
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

/* First-visit conversation starters are part of the conversation, not Shirley's speech. */
.starter-prompts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  padding: 2px 0 4px;
}

.starter-prompts__heading {
  margin: 0 0 2px;
  color: rgba(245, 238, 232, .76);
  font-size: 12px;
  line-height: 1.4;
}

.starter-prompts__button {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid rgba(210, 174, 114, .43);
  border-radius: 11px;
  color: #f5eee8;
  background: rgba(27, 14, 22, .7);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.starter-prompts__button:hover:not(:disabled),
.starter-prompts__button:focus-visible {
  border-color: rgba(240, 200, 119, .95);
  background: rgba(71, 42, 51, .84);
  outline: none;
}

.starter-prompts__button:focus-visible { box-shadow: 0 0 0 2px rgba(240, 200, 119, .25); }
.starter-prompts__button.is-selected { border-color: #f0c877; background: rgba(96, 56, 62, .66); }
.starter-prompts__button:disabled { opacity: .42; cursor: default; }

.message-action { color: #c3bec4; }
.message-dialogue { color: #e59829; }

.message--with-card {
  width: 100%;
  max-width: 100%;
}

.card-inline {
  display: inline;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(240, 200, 119, .95);
  color: #f0c97d;
  background: rgba(117, 73, 38, .16);
  font: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
}

.card-inline:active,
.card-inline:focus-visible { color: #ffe3a6; background: rgba(163, 110, 55, .28); }

.message--loading { min-width: 134px; }

.streaming-indicator {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 14px;
  pointer-events: none;
}
.message--streaming { min-height: 22px; }
.message--interrupted { opacity: .82; }
.message-interrupted-label {
  display: block;
  margin-top: 5px;
  color: rgba(218, 177, 105, .84);
  font-size: 11px;
  line-height: 1.3;
}

.typing-dots { display: inline-flex; gap: 6px; padding-top: 3px; vertical-align: middle; }

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e6bc73;
  animation: breathe 1.1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: .16s; }
.typing-dots span:nth-child(3) { animation-delay: .32s; }

@keyframes breathe { 0%, 60%, 100% { opacity: .32; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.notice {
  align-self: center;
  max-width: 92%;
  padding: 8px 12px;
  border: 1px solid rgba(211, 169, 94, .62);
  border-radius: 12px;
  color: #f0dcc1;
  background: rgba(35, 16, 25, .84);
  font-size: 13px;
  text-align: center;
}

.privacy-consent {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  width: auto;
  min-width: 0;
  min-height: 0;
  max-height: max(0px, calc(var(--privacy-overlay-space, 70dvh) - max(12px, env(safe-area-inset-top))));
  overflow-y: auto;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  color: #f5eee8;
  background: #1e0c16;
  overflow-wrap: anywhere;
}

.privacy-consent__heading { display: flex; flex-shrink: 0; align-items: center; gap: 8px; margin-bottom: 7px; }
.privacy-consent__heading h2 { min-width: 0; margin: 0; color: #f5eee8; font-size: 14px; font-weight: 500; line-height: 1.3; }
.privacy-consent__icon { display: inline-flex; flex: 0 0 20px; width: 20px; height: 20px; color: #e8c47f; }
.privacy-consent__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.privacy-consent__copy { flex: 0 1 auto; min-height: 2.9em; overflow-y: auto; overscroll-behavior: contain; color: rgba(245, 238, 232, .77); font-size: 12px; line-height: 1.45; }
.privacy-consent__copy p { margin: 0 0 7px; }
.privacy-consent__copy p:last-child { margin-bottom: 0; }
.privacy-consent__policy { flex-shrink: 0; align-self: flex-start; min-width: 0; max-width: 100%; margin: 7px 0 0; padding: 0; border: 0; color: #e8c47f; background: transparent; font: inherit; font-size: 11px; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.privacy-consent__policy:hover, .privacy-consent__policy:focus-visible { color: #ffe3a6; }
.privacy-consent__actions { display: grid; flex-shrink: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.privacy-consent__button { width: 100%; min-width: 0; min-height: 36px; padding: 5px 10px; border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; }
.privacy-consent__button--secondary { border: 1px solid rgba(218, 177, 105, .48); color: #f0dcc1; background: transparent; }
.privacy-consent__button--primary { border: 1px solid #e8c47f; color: #27151c; background: #e8c47f; }
.privacy-consent:focus-visible,
.privacy-consent__copy:focus-visible,
.privacy-consent__policy:focus-visible,
.privacy-consent__button:focus-visible { outline: 2px solid #ffe3a6; outline-offset: 2px; }

/* The notice overlays the chat without taking space from the composer. */
.composer-wrap:has(.privacy-consent) { z-index: 5; }
.composer:has(> .privacy-consent) { position: relative; }

.composer-wrap {
  position: relative;
  z-index: 2;
  padding: 14px 14px max(20px, calc(env(safe-area-inset-bottom) + 12px));
  background: linear-gradient(180deg, rgba(19, 8, 14, 0), rgba(19, 8, 14, .88) 34%);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 0;
}

.composer input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 0;
  outline: 0;
  color: #f5eee7;
  background: transparent;
  font-size: 16px;
  font-family: "IBM Plex Sans", Arial, sans-serif;
}

.composer textarea {
  min-width: 0;
  flex: 1;
  min-height: 44px;
  max-height: 132px;
  padding: 9px 13px;
  border: 1px solid rgba(204, 170, 114, .4);
  border-radius: 13px;
  outline: 0;
  resize: none;
  overflow-y: hidden;
  color: #f5eee7;
  background: rgba(30, 30, 30, .8);
  font-size: 16px;
  font-family: "IBM Plex Sans", Arial, sans-serif;
  line-height: 1.35;
  transition: border-color 140ms ease;
}

.composer textarea:focus { border-color: rgba(204, 170, 114, 1); }

.composer input::placeholder,
.composer textarea::placeholder { color: rgba(247, 237, 228, .72); }
.composer input:disabled,
.composer textarea:disabled { color: rgba(247, 237, 228, .46); }

.send-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(204, 170, 114, .4);
  border-radius: 50%;
  color: #f4ce8b;
  background: rgba(30, 30, 30, .8);
  cursor: pointer;
  line-height: 1;
  transition: border-color 140ms ease, opacity 140ms ease;
}

.send-button:not(.is-disabled) { border-color: rgba(204, 170, 114, 1); }

.send-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.send-button svg path:first-child { fill: currentColor; stroke: currentColor; }

.send-button.is-disabled { opacity: .42; cursor: default; }

.close-button {
  position: relative;
  font-size: 0;
}

.close-button::before,
.close-button::after {
  position: absolute;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  content: "";
  background: currentColor;
}

.close-button::before { transform: rotate(45deg); }
.close-button::after { transform: rotate(-45deg); }

.side-menu {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  justify-content: flex-end;
}

.side-menu__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 4, 10, .58);
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.side-menu__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(92vw, 360px);
  height: 100%;
  overflow-y: auto;
  padding: max(28px, calc(env(safe-area-inset-top) + 18px)) 18px max(24px, env(safe-area-inset-bottom));
  border-left: 1px solid rgba(218, 177, 105, .88);
  background: linear-gradient(180deg, rgba(55, 25, 37, .98), rgba(25, 10, 20, .98));
  box-shadow: -14px 0 34px rgba(8, 3, 8, .35);
  animation: menu-enter 180ms ease-out both;
}

.side-menu__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.side-menu__eyebrow {
  margin: 0 0 7px;
  color: rgba(218, 177, 105, .78);
  font-size: 10px;
  letter-spacing: .14em;
}

.side-menu__header h2 {
  margin: 0;
  color: #f4eee9;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.02em;
}

.side-menu__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 50%;
  color: #e8c47f;
  background: rgba(39, 18, 28, .7);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.side-menu__nav { display: grid; gap: 9px; padding: 22px 0; }

.side-menu__item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #f4eee9;
  background: rgba(20, 9, 17, .32);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.side-menu__item:hover,
.side-menu__item:focus-visible {
  border-color: rgba(218, 177, 105, .56);
  background: rgba(102, 55, 55, .34);
  outline: none;
  transform: translateX(-2px);
}

.side-menu__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(218, 177, 105, .48);
  border-radius: 50%;
  color: #e8c47f;
  font-size: 15px;
}

.side-menu__card-icon { display: block; width: 17px; height: 20px; }
.side-menu__settings-icon { display: block; width: 18px; height: 18px; }

.side-menu__item-copy { display: grid; gap: 2px; min-width: 0; }
.side-menu__item-copy strong { color: #f5eee8; font-size: 16px; font-weight: 500; }
.side-menu__item-copy small {
  overflow: hidden;
  color: rgba(235, 218, 211, .62);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-menu__item-copy small.is-scrolling { text-overflow: clip; }
.side-menu__chevron { color: rgba(218, 177, 105, .84); font-size: 24px; line-height: 1; }

.side-menu__footer {
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(218, 177, 105, .2);
  color: rgba(235, 218, 211, .54);
  font-size: 12px;
  line-height: 1.4;
}

.side-menu--home .side-menu__panel { background: #341925; }

.side-menu__nav--grouped { gap: 16px; }
.side-menu__group { display: grid; gap: 9px; }
.side-menu__divider { width: 100%; margin: 0; border: 0; border-top: 1px solid rgba(235, 218, 211, .24); }

.side-menu--home .side-menu__item {
  grid-template-columns: 38px minmax(0, 1fr) 14px;
  gap: 12px;
  min-height: 68px;
  background: rgba(20, 9, 17, .5);
}

.side-menu--home .side-menu__item:hover,
.side-menu--home .side-menu__item:focus-visible { background: rgba(102, 55, 55, .34); }
.side-menu--home .side-menu__icon { width: 36px; height: 36px; }
.side-menu__outline-icon { display: block; width: 20px; height: 20px; }

.side-menu__home-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(235, 218, 211, .24);
}

.side-menu__legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(235, 218, 211, .76);
  font-size: clamp(10px, 2.7vw, 11px);
}

.side-menu__legal-links :is(button, a) {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-width: 0;
  min-height: 44px;
  padding: 2px;
  border: 0;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}

.side-menu__legal-links :is(button, a):hover { color: #e8c47f; }
.side-menu__legal-links :is(button, a):focus-visible { outline: 1px solid #e8c47f; outline-offset: 2px; border-radius: 4px; }
.side-menu__home-footer .side-menu__footer { margin: 0; padding-top: 10px; border: 0; text-align: center; }
.side-menu__copyright { margin: 10px 0 0; color: rgba(235, 218, 211, .54); font-size: 10px; line-height: 1.4; text-align: center; }

.my-space-panel { padding-bottom: 24px; }
.my-space__spread-settings { margin-top: 26px; }
.my-space__spread-settings h3 { margin: 0 0 14px; color: #f5eee8; font-size: 17px; font-weight: 500; }
.my-space__decks { min-width: 0; margin: 26px 0 0; padding: 0; border: 0; }
.my-space__decks legend { margin-bottom: 14px; padding: 0; color: #f5eee8; font-size: 17px; font-weight: 500; }

.my-space__deck {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 14px 12px;
  border: 1px solid rgba(218, 177, 105, .22);
  border-radius: 12px;
  background: rgba(20, 9, 17, .4);
  cursor: pointer;
}

.my-space__deck.is-disabled { opacity: .55; cursor: not-allowed; }
.my-space__deck.is-selected { border-color: rgba(218, 177, 105, .72); background: rgba(73, 40, 43, .44); }
.my-space__deck-copy { display: block; min-width: 0; text-align: left; }
.my-space__deck-credit { display: block; margin-top: 4px; color: rgba(235, 218, 211, .64); font-size: 11px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.my-space__deck-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.my-space__deck-credit a:focus-visible { outline: 1px solid #e8c47f; outline-offset: 2px; }
.my-space__deck-name { color: #f5eee8; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.my-space__deck-thumbnail { display: block; width: 48px; aspect-ratio: 1003 / 1672; object-fit: contain; border-radius: var(--tarot-card-radius); overflow: hidden; box-shadow: 0 4px 12px rgba(8, 3, 8, .3); }
.my-space__deck-choice { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }

.my-space__deck-switch {
  position: relative;
  justify-self: end;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(218, 177, 105, .7);
  border-radius: 50%;
  background: rgba(19, 8, 14, .65);
  transition: background .16s ease, border-color .16s ease;
}

.my-space__deck-switch::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
  background: #e8c47f;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.my-space__deck-choice:checked + .my-space__deck-switch { border-color: #e8c47f; }
.my-space__deck-choice:checked + .my-space__deck-switch::after { opacity: 1; }
.my-space__deck-choice:focus-visible + .my-space__deck-switch { outline: 2px solid #ffe3a6; outline-offset: 3px; }

.my-space__reversed-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  margin-top: 0;
  padding-block: 10px;
  cursor: pointer;
}
.my-space__reversed-copy { min-width: 0; text-align: left; }
.my-space__reversed-label { display: block; color: #f5eee8; font-size: 14px; line-height: 1.45; }
.my-space__reversed-description { display: block; margin-top: 5px; color: rgba(235, 218, 211, .64); font-size: 12px; line-height: 1.45; }
.my-space__reversed-toggle { position: relative; display: flex; align-items: center; justify-content: flex-end; width: 44px; min-height: 44px; }
.my-space__reversed-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.my-space__reversed-toggle > span { position: relative; display: block; width: 38px; height: 22px; border: 1px solid rgba(218, 177, 105, .5); border-radius: 999px; background: rgba(235, 218, 211, .12); }
.my-space__reversed-toggle > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #f5eee8; }
.my-space__reversed-toggle input:checked + span { border-color: #e8c47f; background: rgba(218, 177, 105, .34); }
.my-space__reversed-toggle input:checked + span::after { transform: translateX(16px); }
.my-space__reversed-toggle input:focus-visible + span { outline: 2px solid #ffe3a6; outline-offset: 3px; }

@media (max-width: 360px) {
  .side-menu--home .side-menu__item { grid-template-columns: 34px minmax(0, 1fr) 12px; gap: 8px; }
  .side-menu--home .side-menu__icon { width: 32px; height: 32px; }
  .my-space__deck { gap: 8px; padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .my-space__deck-switch,
  .my-space__deck-switch::after { transition: none; }
}

.side-menu__subheader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
}

.side-menu__subheader-line {
  flex: 1;
  height: 1px;
  margin-right: 2px;
  background: rgba(218, 177, 105, .25);
}

.settings-panel { padding-top: 0; }

.card-library-panel { padding-top: 0; }

.premium-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding-top: 0;
}
.premium-submenu { padding-top: 22px; }

.app-shell--spread {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  background: #2d1712;
}

.app-shell--spread .topbar {
  min-height: calc(var(--topbar-height) + env(safe-area-inset-top));
  padding: max(12px, calc(env(safe-area-inset-top) + 8px)) max(14px, calc(env(safe-area-inset-right) + 14px)) 0 max(14px, calc(env(safe-area-inset-left) + 14px));
}

.app-shell--spread .menu-button,
.app-shell--spread .side-menu__close { position: relative; top: -2px; }

.spread-deck {
  /* Keep the tabletop stack the same physical card size as the fan. */
  --spread-fan-card-width: clamp(62px, 8vw, 112px);
  --spread-deck-width: var(--spread-fan-card-width);
  position: absolute;
  z-index: 1;
  left: max(24px, calc(env(safe-area-inset-left) + 24px));
  bottom: clamp(10px, 8vh, 76px);
  width: var(--spread-deck-width);
  aspect-ratio: 1003 / 1672;
  pointer-events: none;
  transform: perspective(900px) rotateX(4deg) rotateZ(-20deg);
  transform-origin: center center;
  filter: drop-shadow(0 14px 16px rgba(8, 3, 8, .42));
  transition: left 760ms cubic-bezier(.22, .8, .24, 1), bottom 760ms cubic-bezier(.22, .8, .24, 1), width 760ms cubic-bezier(.22, .8, .24, 1), height 760ms cubic-bezier(.22, .8, .24, 1), transform 760ms cubic-bezier(.22, .8, .24, 1), filter 420ms ease;
}

.spread-deck__stack {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  border-radius: var(--tarot-card-radius);
  isolation: isolate;
  cursor: pointer;
  pointer-events: auto;
}

/* Two half-decks expose fine paper edges even while the deck is at rest.
   Decorative leaves have no card identity and never enter the logical fan. */
.spread-deck__stack::before {
  content: "";
  position: absolute;
  inset: 10% -8% -17%;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(ellipse, rgba(9, 3, 7, .5), transparent 70%);
  opacity: .8;
  pointer-events: none;
}

.spread-deck__stack:focus-visible {
  outline: 2px solid #f5d690;
  outline-offset: 5px;
}

.spread-deck__shuffle,
.spread-deck__packet,
.spread-deck__shuffle-leaf {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--tarot-card-radius);
  pointer-events: none;
}

.spread-deck__shuffle {
  --packet-depth: clamp(7px, .9vw, 12px);
}

.spread-deck__packet { isolation: isolate; }
.spread-deck__packet::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  transform: translate(2px, var(--packet-depth));
  background:
    linear-gradient(90deg, rgba(83, 61, 44, .25), transparent 22%, transparent 78%, rgba(61, 39, 30, .3)),
    repeating-linear-gradient(0deg, #a99678 0 .65px, #ebdfc9 .65px 1.6px, #cfbda0 1.6px 2.25px);
  box-shadow: 1px 1px 0 #8d765b, 2px 4px 6px rgba(12, 5, 8, .28);
}

.spread-deck__packet--lower {
  --packet-side: -1;
  --packet-rest: var(--packet-depth);
  z-index: 1;
  transform: translateY(var(--packet-rest));
}
.spread-deck__packet--upper {
  --packet-side: 1;
  --packet-rest: 0px;
  z-index: 12;
}

.spread-deck__shuffle-leaf {
  z-index: calc(2 + var(--leaf-index));
  opacity: 0;
  box-shadow: 0 1px 0 #e2d0ae, 0 3px 5px rgba(12, 5, 8, .18);
}

.spread-deck__fan {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 max(12px, 1.8vw) max(6px, env(safe-area-inset-bottom));
  overflow-x: auto;
  overflow-y: hidden;
  opacity: 0;
  pointer-events: none;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  transition: opacity 280ms ease;
}

.spread-deck__fan::-webkit-scrollbar { display: none; }

.spread-deck__fan-card {
  position: relative;
  z-index: 1;
  flex: 0 0 var(--spread-fan-card-width);
  aspect-ratio: 1003 / 1672;
  margin-left: clamp(-68px, -5vw, -28px);
  --fan-rise-adjusted: var(--fan-rise);
  --fan-slide-distance: clamp(44px, 6vw, 92px);
  transform: translateX(var(--fan-neighbor-shift, 0px)) translateY(56px) rotate(0deg);
  transform-origin: 50% 100%;
  border-radius: var(--tarot-card-radius);
  opacity: 0;
  transition: transform 760ms cubic-bezier(.22, .8, .24, 1), opacity 360ms ease, filter 160ms ease;
  transition-delay: var(--fan-delay), var(--fan-delay);
}

.spread-deck__fan-edge {
  opacity: .3;
  pointer-events: none;
  filter: saturate(.82);
}

.spread-deck__fan-edge .spread-deck__fan-card-inner {
  opacity: .72;
}

.spread-deck__fan-edge {
  appearance: none;
  /* Keep the neighboring fan card above the overlap so the first available
     card remains selectable. The exposed portion of this translucent card
     still acts as the navigation target. */
  z-index: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.spread-deck__fan-edge:not(:disabled):hover,
.spread-deck__fan-edge:not(:disabled):focus-visible {
  filter: brightness(1.14) saturate(1.08);
  outline: 2px solid rgba(232, 196, 127, .84);
  outline-offset: 3px;
}

.spread-deck__fan-edge:disabled { cursor: default; }

.spread-deck__fan-card--placeholder {
  cursor: default;
  pointer-events: none;
  opacity: .28;
  filter: none;
}

.spread-deck__fan-card--placeholder .spread-deck__fan-card-inner {
  border: 1px solid rgba(235, 208, 160, .36);
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(29, 22, 30, .72), rgba(67, 44, 54, .42));
  box-shadow: inset 0 0 0 2px rgba(17, 12, 20, .32), 0 8px 12px rgba(8, 3, 8, .16);
}

.spread-deck__fan-card:first-child { margin-left: 0; }

.spread-deck__fan-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.spread-deck__fan-card-inner > img,
.spread-deck__fan-card-inner > .tarot-card-image,
.spread-deck__fan-card-inner > .spread-deck__face--fallback {
  border-radius: var(--tarot-card-radius);
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.spread-deck__fan-card-inner > .tarot-card-image,
.spread-deck__fan-card-inner > .spread-deck__face--front {
  transform: rotateY(180deg);
}

.spread-deck__fan-card img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid transparent;
  border-radius: inherit;
  object-fit: contain;
  box-shadow: 0 8px 12px rgba(8, 3, 8, .28);
  pointer-events: none;
}

.spread-deck__fan-card {
  cursor: grab;
  touch-action: pan-x;
  user-select: none;
}

/* Edge cards are navigation controls, never draggable Tarot cards. Keep this
   rule after the generic fan-card cursor so it wins in the cascade. */
.spread-deck__fan-edge { cursor: pointer; touch-action: manipulation; }

.spread-deck__fan-card.is-pressed,
.spread-deck__placed-card.is-pressed {
  filter: brightness(1.08);
  box-shadow: inset 0 0 0 2px #e8c47f, 0 10px 18px rgba(8, 3, 8, .28);
}

.spread-deck__fan-card.is-selected,
.spread-deck__placed-card.is-selected {
  z-index: 12;
  filter: brightness(1.12);
  box-shadow: inset 0 0 0 3px #f5d690, 0 16px 18px rgba(8, 3, 8, .38);
}

.spread-deck__placed,
.spread-deck__drag-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.spread-deck__placed {
  display: none;
  z-index: 3;
}

.spread-deck__placed-card {
  position: absolute;
  width: var(--spread-fan-card-width);
  aspect-ratio: 1003 / 1672;
  perspective: 760px;
  border-radius: var(--tarot-card-radius);
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.spread-deck__placed-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  border-radius: inherit;
  transition: transform 420ms cubic-bezier(.22, .8, .24, 1);
}

.spread-deck__placed-card.is-flipped .spread-deck__placed-card-inner { transform: rotateY(180deg); }

.spread-deck__placed-card.is-flipping {
  z-index: 30;
  animation: spread-card-flip-lift 440ms cubic-bezier(.4, 0, .2, 1) both;
  will-change: transform, filter;
}

.spread-deck__placed-card.is-flipping .spread-deck__placed-card-inner {
  transition: none;
}

.spread-deck__placed-card.is-flipping-to-front .spread-deck__placed-card-inner {
  animation: spread-card-flip-to-front 440ms cubic-bezier(.4, 0, .2, 1) both;
}

.spread-deck__placed-card.is-flipping-to-back {
  animation-direction: reverse;
}

.spread-deck__placed-card.is-flipping-to-back .spread-deck__placed-card-inner {
  animation: spread-card-flip-to-front 440ms cubic-bezier(.4, 0, .2, 1) reverse both;
}

@keyframes spread-card-flip-lift {
  0%, 100% {
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 6px 6px rgba(8, 3, 8, .2));
  }
  45%, 55% {
    transform: translate(-50%, -50%) translateY(-9px);
    filter: drop-shadow(0 16px 12px rgba(8, 3, 8, .42));
  }
}

@keyframes spread-card-flip-to-front {
  0% { transform: rotateY(0deg); }
  45% { transform: rotateY(-78deg); }
  50% { transform: rotateY(-90deg); }
  55% { transform: rotateY(-102deg); }
  100% { transform: rotateY(-180deg); }
}

@keyframes spread-card-flip-to-back {
  0% { transform: rotateY(180deg); }
  45% { transform: rotateY(102deg); }
  50% { transform: rotateY(90deg); }
  55% { transform: rotateY(78deg); }
  100% { transform: rotateY(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spread-deck__placed-card-inner { transition: none; }
  .spread-deck__placed-card.is-flipping,
  .spread-deck__placed-card.is-flipping .spread-deck__placed-card-inner {
    animation: none;
  }
}

.spread-deck__placed-card .spread-deck__face,
.spread-deck__placed-card .tarot-card-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.spread-deck__placed-card img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid transparent;
  border-radius: inherit;
  object-fit: contain;
  box-shadow: 0 12px 18px rgba(8, 3, 8, .34);
  pointer-events: none;
}

.spread-deck__placed-card .spread-deck__face--front,
.spread-deck__placed-card .tarot-card-image { transform: rotateY(180deg); }

.spread-deck__placed-card .tarot-card-image {
  overflow: hidden;
  border-radius: inherit;
}

.spread-deck__placed-card .tarot-card-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The picture wrapper is the rotated face; its image must stay in the same
   plane so a face is never double-rotated into an invisible state. */
.spread-deck__placed-card .tarot-card-image img.spread-deck__face--front { transform: none; }

/* Reverse only the illustration; positioning, the back and the 3D flip stay independent. */
.spread-deck__placed-card.is-reversed .tarot-card-image img.spread-deck__face--front { transform: rotate(180deg); }
.spread-deck__placed-card.is-reversed .spread-deck__face--fallback { transform: rotateY(180deg) rotate(180deg); }

.spread-deck__drag-layer {
  z-index: 12;
}

.spread-deck.is-dragging .spread-deck__fan-card.is-dragging,
.spread-deck.is-dragging .spread-deck__placed-card.is-dragging {
  position: absolute;
  display: block;
  z-index: 20;
  flex: none;
  margin: 0;
  opacity: 1;
  cursor: grabbing;
  pointer-events: auto;
  touch-action: none;
  animation: none;
  transform: translate(-50%, -50%);
  transition: transform 150ms cubic-bezier(.22, .8, .24, 1);
}

.spread-chat-toggle {
  position: absolute;
  z-index: 7;
  top: 50%;
  right: env(safe-area-inset-right);
  display: grid;
  place-items: center;
  width: 24px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(218, 177, 105, .82);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  color: #e8c47f;
  background: rgba(39, 18, 28, .82);
  box-shadow: -8px 10px 24px rgba(8, 3, 8, .28);
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.spread-chat-toggle:hover,
.spread-chat-toggle:focus-visible {
  border-color: rgba(218, 177, 105, .98);
  color: #f5d690;
  background: rgba(102, 55, 55, .5);
  box-shadow: 0 0 0 3px rgba(218, 177, 105, .1), -8px 10px 24px rgba(8, 3, 8, .3);
  outline: none;
}

.spread-chat-toggle:active { transform: translateY(-50%) scale(.96); }
.spread-chat-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.spread-chat-panel {
  --spread-chat-edge-space: max(14px, calc(env(safe-area-inset-top) + 12px), calc(env(safe-area-inset-bottom) + 12px));
  position: absolute;
  z-index: 6;
  inset: 0 0 0 auto;
  display: flex;
  width: min(92vw, 420px);
  flex-direction: column;
  padding: var(--spread-chat-edge-space) 0 0;
  border-left: 1px solid rgba(218, 177, 105, .64);
  background: rgba(24, 10, 19, .97);
  box-shadow: -18px 0 40px rgba(8, 3, 8, .34);
  transform: translateX(100%);
  transition: transform 220ms ease;
  will-change: transform;
}

.spread-chat-panel.is-open { transform: translateX(0); }

.spread-chat-close {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: -19px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(218, 177, 105, .72);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  color: #e8c47f;
  background: rgba(39, 18, 28, .68);
  cursor: pointer;
  transform: translateY(-50%);
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.spread-chat-close:hover,
.spread-chat-close:focus-visible {
  border-color: rgba(218, 177, 105, .98);
  color: #f5d690;
  background: rgba(102, 55, 55, .46);
  box-shadow: 0 0 0 3px rgba(218, 177, 105, .1), 0 8px 20px rgba(8, 3, 8, .24);
  outline: none;
}

.spread-chat-close:active { transform: translateY(-50%) scale(.96); }
.spread-chat-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.spread-chat-panel .conversation {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 14px;
}

.spread-chat-panel .composer-wrap {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px max(14px, calc(env(safe-area-inset-right) + 14px)) var(--spread-chat-edge-space);
  background: linear-gradient(180deg, rgba(24, 10, 19, 0), rgba(24, 10, 19, .98) 18%);
}

@media (prefers-reduced-motion: reduce) {
  .spread-chat-panel { transition: none; }
}

@media (max-width: 1000px) and (orientation: landscape) {
  .spread-deck {
    left: max(16px, calc(env(safe-area-inset-left) + 16px));
    bottom: max(8px, calc(env(safe-area-inset-bottom) + 8px));
  }

  .spread-deck.is-fan { --spread-deck-control-space: 60px; }

  .spread-deck__placed-card { width: var(--spread-fan-card-width); }
}

@media (max-width: 700px) and (orientation: portrait) {
  .spread-deck {
    --spread-fan-card-width: clamp(48px, 18vw, 78px);
    left: max(16px, calc(env(safe-area-inset-left) + 16px));
    bottom: max(8px, calc(env(safe-area-inset-bottom) + 8px));
  }

  .spread-deck.is-fan { --spread-deck-control-space: 60px; }
}

.spread-deck.is-fan {
  --spread-deck-control-space: clamp(48px, 7vh, 60px);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(clamp(160px, 28vh, 260px) + var(--spread-deck-control-space));
  aspect-ratio: auto;
  pointer-events: auto;
  transform: none;
  filter: none;
}

.spread-deck.is-shuffling {
  pointer-events: none;
}

.spread-deck.is-shuffling .spread-deck__stack {
  pointer-events: none;
}

.spread-deck.is-shuffling .spread-deck__fan {
  opacity: 0;
  pointer-events: none;
}

.spread-deck.is-shuffling .spread-deck__shuffle {
  animation: spread-shuffle-lift var(--spread-shuffle-duration) cubic-bezier(.4, 0, .2, 1) both;
  will-change: transform;
}

.spread-deck.is-shuffling .spread-deck__packet {
  animation: spread-shuffle-packet var(--spread-shuffle-duration) cubic-bezier(.4, 0, .2, 1) both;
  will-change: transform;
}

.spread-deck.is-shuffling .spread-deck__shuffle-leaf {
  animation: spread-shuffle-weave calc(var(--spread-shuffle-duration) - 240ms) cubic-bezier(.35, .05, .3, 1) both;
  animation-delay: calc(var(--leaf-index) * 30ms);
  will-change: transform, opacity;
}

.spread-deck.is-shuffling .spread-deck__stack::before {
  animation: spread-shuffle-shadow var(--spread-shuffle-duration) ease both;
}

.spread-deck.is-fan .spread-deck__stack {
  pointer-events: none;
  opacity: 0;
}

.spread-deck.is-fan .spread-deck__fan {
  opacity: 1;
  pointer-events: auto;
}

.spread-deck.is-fan .spread-deck__fan-card {
  opacity: 1;
  transform: translateX(var(--fan-neighbor-shift, 0px)) translateY(calc(var(--fan-rise-adjusted) * -1)) rotate(var(--fan-rotation));
}

.spread-deck.is-fan .spread-deck__fan-card--edge {
  opacity: .3;
  filter: saturate(.82);
  pointer-events: auto;
}

.spread-deck.is-fan .spread-deck__fan-card--edge:disabled { pointer-events: none; }

.spread-deck.is-fan .spread-deck__fan-edge:not(:disabled):hover,
.spread-deck.is-fan .spread-deck__fan-edge:not(:disabled):focus-visible {
  filter: brightness(1.14) saturate(1.08);
}

/* A single, dense POV fan. Its cards retain their physical layout size;
   activation raises the hand rather than scaling the artwork. */
.spread-deck.is-pov-fan {
  --spread-stack-left: max(calc(env(safe-area-inset-left) + 16px), 5.5vw);
  --spread-stack-bottom: max(calc(env(safe-area-inset-bottom) + 28px), clamp(28px, 7vh, 76px));
  height: 0;
  pointer-events: none;
  transition: none;
}

.spread-deck.is-pov-fan .spread-deck__fan {
  inset: auto 0;
  bottom: calc(var(--spread-fan-card-width) * -1);
  display: block;
  width: 100%;
  height: calc(var(--spread-fan-card-width) * 1672 / 1003);
  padding: 0;
  overflow: visible;
  touch-action: none;
  user-select: none;
  z-index: 4;
  transition: bottom 240ms cubic-bezier(.22, .8, .24, 1);
}

.spread-deck.is-pov-fan .spread-deck__fan.is-active {
  bottom: calc(var(--spread-fan-card-width) * -.35);
}

.spread-deck.is-pov-fan .spread-deck__fan-card {
  position: absolute;
  top: 0;
  left: calc(var(--spread-fan-card-width) / 2 + (100% - var(--spread-fan-card-width)) * var(--fan-position));
  width: var(--spread-fan-card-width);
  height: 100%;
  margin: 0;
  z-index: var(--fan-stack);
  --fan-rise-adjusted: var(--fan-rise);
  transform: translate(-50%, calc(var(--fan-rise) * -1)) rotate(var(--fan-rotation));
  transform-origin: 50% 100%;
  pointer-events: none;
  touch-action: none;
  border-radius: var(--tarot-card-radius);
  transition: left 240ms cubic-bezier(.22, .8, .24, 1), transform 200ms cubic-bezier(.22, .8, .24, 1), filter 160ms ease;
}

.spread-deck.is-pov-fan .spread-deck__fan-card-inner { border-radius: inherit; }

.spread-deck.is-pov-fan .spread-deck__fan-card.is-hovered {
  z-index: 1000;
  pointer-events: auto;
  filter: brightness(1.08);
  transform: translate(-50%, calc(var(--fan-rise) * -1 - clamp(36px, var(--spread-fan-card-width) * .6, 68px))) rotate(var(--fan-rotation));
  box-shadow: 0 0 0 1px rgba(232, 196, 127, .8), 0 10px 20px rgba(8, 3, 8, .4);
}

.spread-deck.is-pov-fan .spread-deck__fan-card--placeholder {
  z-index: 1000;
  opacity: .72;
  filter: none;
  box-shadow: 0 0 0 1px rgba(232, 196, 127, .6), 0 4px 12px rgba(8, 3, 8, .4);
  transition: opacity 160ms ease, box-shadow 160ms ease;
}

.spread-deck.is-pov-fan .spread-deck__fan-card--placeholder .spread-deck__fan-card-inner {
  border-color: rgba(232, 196, 127, .65);
  background: linear-gradient(145deg, rgba(26, 16, 28, .94), rgba(64, 41, 49, .88));
}

.spread-deck.is-pov-fan .spread-deck__fan-card--placeholder.is-return-target {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(245, 214, 144, .92), 0 0 18px rgba(232, 196, 127, .48);
}

.spread-deck.is-pov-fan .spread-deck__fan-card--placeholder.is-return-target .spread-deck__fan-card-inner {
  border-color: #f5d690;
}

.spread-deck.is-pov-fan .spread-deck__fan-card.is-returning {
  z-index: 1001;
  pointer-events: none;
}

.spread-deck.is-pov-fan.is-dragging .spread-deck__fan-card.is-dragging {
  z-index: 20;
  height: auto;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(var(--spread-carry-rotation, 0deg));
  transform-origin: center center;
  transition: none;
}

.spread-deck.is-pov-fan .spread-deck__position {
  left: max(12px, env(safe-area-inset-left));
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: none;
  color: #e8c47f;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: rgba(31, 13, 24, .82);
  border-radius: 999px;
  z-index: 6;
}

.spread-deck.is-pov-fan .spread-deck__collect {
  left: auto;
  right: max(10px, env(safe-area-inset-right));
  transform: none;
  z-index: 6;
}

.spread-deck.is-fan .spread-deck__placed {
  display: block;
}

.spread-deck.is-fan .spread-deck__fan:active { cursor: grabbing; }

.spread-deck__position {
  position: absolute;
  z-index: 5;
  bottom: max(60px, calc(env(safe-area-inset-bottom) + 60px));
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 10px;
  padding: 3px 9px;
  transform: translateX(-50%);
  pointer-events: none;
}

.spread-deck__golden-thread {
  position: relative;
  display: block;
  width: clamp(120px, 22vw, 260px);
  height: 12px;
  flex: 0 1 clamp(120px, 22vw, 260px);
}

.spread-deck__golden-thread-track {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(218, 177, 105, .28), rgba(232, 196, 127, .82), rgba(218, 177, 105, .28));
  box-shadow: 0 0 4px rgba(232, 196, 127, .24);
  transform: translateY(-50%);
}

.spread-deck__golden-thread-indicator {
  position: absolute;
  top: 50%;
  left: calc(var(--thread-progress, 0) * 100%);
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 231, 174, .86);
  border-radius: 50%;
  background: #e8c47f;
  box-shadow: 0 0 8px rgba(232, 196, 127, .64), 0 0 2px rgba(255, 239, 190, .95);
  transform: translate(-50%, -50%);
  transition: left 240ms cubic-bezier(.22, .8, .24, 1), box-shadow 180ms ease;
}

.spread-deck__hidden-count {
  min-width: 12px;
  color: rgba(232, 196, 127, .78);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.spread-deck__collect {
  position: absolute;
  z-index: 5;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  min-width: 128px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid rgba(218, 177, 105, .6);
  border-radius: 999px;
  color: rgba(245, 214, 144, .92);
  font: inherit;
  font-size: 13px;
  background: rgba(39, 18, 28, .78);
  box-shadow: 0 6px 18px rgba(8, 3, 8, .22);
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(-50%);
}

.spread-deck__placed-card.is-pinching {
  z-index: 30;
}

.spread-deck__placed-card.is-flipped.is-pinching .spread-deck__placed-card-inner {
  transform: scale(var(--pinch-scale, 1)) rotateY(180deg);
  transition: transform 80ms linear;
}

.spread-deck__collect:hover,
.spread-deck__collect:focus-visible {
  border-color: rgba(245, 214, 144, .98);
  color: #fff2c9;
  outline: none;
}

.spread-deck__confirm {
  pointer-events: auto;
  position: fixed;
  z-index: 20;
  top: 50%;
  left: 50%;
  width: min(88vw, 340px);
  box-sizing: border-box;
  padding: 18px 18px 16px;
  border: 1px solid rgba(218, 177, 105, .78);
  border-radius: 18px;
  color: #f5eee8;
  background: rgba(31, 13, 24, .98);
  box-shadow: 0 22px 60px rgba(8, 3, 8, .48);
  transform: translate(-50%, -50%);
  text-align: center;
}

.spread-deck__confirm-backdrop {
  position: fixed;
  z-index: 19;
  inset: 0;
  background: rgba(8, 3, 8, .3);
  pointer-events: auto;
}

.spread-deck__confirm h2 {
  margin: 0 0 8px;
  color: #f5d690;
  font-size: 18px;
  font-weight: 600;
}

.spread-deck__confirm p {
  margin: 0;
  color: rgba(245, 238, 232, .78);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.spread-deck__confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.spread-deck__confirm-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 999px;
  color: #f5eee8;
  font: inherit;
  font-size: 13px;
  background: rgba(39, 18, 28, .74);
  cursor: pointer;
}

.spread-deck__confirm-button--confirm {
  color: #2d1712;
  background: #f5d690;
}

.spread-deck__confirm-button:hover,
.spread-deck__confirm-button:focus-visible {
  border-color: #f5d690;
  outline: none;
}

.spread-deck__face--fallback {
  border-radius: var(--tarot-card-radius);
  display: grid !important;
  place-content: center;
  justify-items: center;
  gap: 6px;
  box-sizing: border-box;
  padding: 10px;
  color: #f5d690;
  text-align: center;
  background: radial-gradient(circle at 50% 18%, rgba(218, 177, 105, .22), transparent 48%), #34202d;
  border: 1px solid transparent;
  box-shadow: 0 12px 18px rgba(8, 3, 8, .34);
}

.spread-deck__fallback-mark { font-size: 20px; line-height: 1; }
.spread-deck__face--fallback strong { max-width: 100%; font-size: 10px; line-height: 1.15; }
.spread-deck__face--fallback small { color: rgba(245, 238, 232, .62); font-size: 8px; line-height: 1.2; }

/* The physical deck stays on the fabric. Opening and collecting animate
   the individual cards to/from this same pose without scaling their artwork. */
.spread-deck.is-pov-fan .spread-deck__stack {
  inset: auto auto var(--spread-stack-bottom) var(--spread-stack-left);
  width: var(--spread-deck-width);
  height: calc(var(--spread-deck-width) * 1672 / 1003);
  aspect-ratio: 1003 / 1672;
  transform: perspective(900px) rotateX(4deg) rotateZ(-20deg);
  transform-origin: center center;
  filter: drop-shadow(0 10px 10px rgba(8, 3, 8, .4));
  opacity: 0;
  pointer-events: none;
}

.spread-deck.is-pov-fan.is-stacked .spread-deck__stack,
.spread-deck.is-pov-fan.is-shuffling .spread-deck__stack {
  opacity: 1;
}

.spread-deck.is-pov-fan.is-stacked .spread-deck__stack { pointer-events: auto; }

.spread-deck.is-pov-fan.is-stacked .spread-deck__fan,
.spread-deck.is-pov-fan.is-shuffling .spread-deck__fan {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.spread-deck.is-pov-fan.is-dealing .spread-deck__fan,
.spread-deck.is-pov-fan.is-collecting .spread-deck__fan {
  pointer-events: none;
  transition: none;
}

.spread-deck.is-pov-fan.is-dealing .spread-deck__fan-card,
.spread-deck.is-pov-fan.is-collecting .spread-deck__fan-card,
.spread-deck.is-pov-fan.is-collecting .spread-deck__placed-card {
  pointer-events: none;
  transition: none;
}

.spread-deck.is-pov-fan.is-collecting .spread-deck__stack {
  animation: spread-stack-reassemble 590ms ease both;
}

@keyframes spread-stack-reassemble {
  0%, 45% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes spread-shuffle-lift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  18% { transform: translate3d(35%, -24%, 0) rotate(8deg); }
  35%, 67% { transform: translate3d(35%, -28%, 0) rotate(8deg); }
  82% { transform: translate3d(12%, -18%, 0) rotate(2deg); }
  91% { transform: translate3d(0, -3%, 0) rotate(-1deg); }
  96% { transform: translate3d(0, 1.5%, 0) rotate(.5deg); }
}

@keyframes spread-shuffle-packet {
  0%, 12%, 84%, 100% { transform: translate3d(0, var(--packet-rest), 0) rotate(0deg); }
  28% { transform: translate3d(calc(var(--packet-side) * 44%), calc(var(--packet-side) * -5%), 0) rotate(calc(var(--packet-side) * 11deg)); }
  42% { transform: translate3d(calc(var(--packet-side) * 19%), calc(var(--packet-side) * -2%), 0) rotate(calc(var(--packet-side) * 4deg)); }
  52% { transform: translate3d(calc(var(--packet-side) * 31%), calc(var(--packet-side) * -3%), 0) rotate(calc(var(--packet-side) * 7deg)); }
  63% { transform: translate3d(calc(var(--packet-side) * 10%), var(--packet-rest), 0) rotate(calc(var(--packet-side) * 2deg)); }
  71% { transform: translate3d(calc(var(--packet-side) * 16%), var(--packet-rest), 0) rotate(calc(var(--packet-side) * 3deg)); }
}

@keyframes spread-shuffle-weave {
  0%, 22% { opacity: 0; transform: translate3d(calc(var(--leaf-side) * 46%), -3%, 0) rotate(calc(var(--leaf-side) * 10deg)); }
  30% { opacity: 1; transform: translate3d(calc(var(--leaf-side) * 52%), calc(var(--leaf-index) * -1.5%), 0) rotate(calc(var(--leaf-side) * 12deg)); }
  43% { opacity: 1; transform: translate3d(calc(var(--leaf-side) * 6%), calc(var(--leaf-index) * .8%), 0) rotate(calc(var(--leaf-side) * -2deg)); }
  54% { opacity: 1; transform: translate3d(calc(var(--leaf-side) * 30%), calc(var(--leaf-index) * -1%), 0) rotate(calc(var(--leaf-side) * 6deg)); }
  66% { opacity: 1; transform: translate3d(calc(var(--leaf-side) * -4%), calc(var(--leaf-index) * .7%), 0) rotate(calc(var(--leaf-side) * -1deg)); }
  78%, 100% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
}

@keyframes spread-shuffle-shadow {
  0%, 100% { opacity: .8; transform: scale(1); }
  20%, 70% { opacity: .3; transform: translateX(12%) scale(1.25); }
}

@media (max-width: 700px) {
  .spread-deck__placed-card { width: var(--spread-fan-card-width); }
  .spread-deck__collect {
    min-width: 116px;
    padding-inline: 12px;
    font-size: 12px;
  }
}

@media (min-width: 701px) {
  .spread-deck:not(.is-fan) {
    --spread-deck-width: var(--spread-fan-card-width);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spread-deck,
  .spread-deck__fan,
  .spread-deck__fan-card,
  .spread-deck__placed-card-inner,
  .spread-deck__placed-card,
  .spread-deck__collect {
    transition: none;
  }

  .spread-deck.is-shuffling .spread-deck__stack,
  .spread-deck.is-collecting .spread-deck__stack { animation: none; }
  .spread-deck.is-shuffling .spread-deck__shuffle,
  .spread-deck.is-shuffling .spread-deck__packet,
  .spread-deck.is-shuffling .spread-deck__shuffle-leaf,
  .spread-deck.is-shuffling .spread-deck__stack::before { animation: none; will-change: auto; }
  .spread-deck.is-pov-fan .spread-deck__fan,
  .spread-deck.is-pov-fan .spread-deck__fan-card { transition: none; }
}

@media (orientation: landscape) {
  .own-spread-rotate { display: none; }
}

.own-spread-rotate {
  position: absolute;
  z-index: 2;
  top: calc(var(--topbar-height) + 8px);
  right: 18px;
  left: 18px;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 36px);
  padding: 8px 12px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 999px;
  color: #e8c47f;
  background: rgba(32, 14, 23, .9);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  opacity: 1;
  box-shadow: 0 8px 20px rgba(8, 3, 8, .24);
  pointer-events: none;
  transition: opacity 240ms ease;
}

.own-spread-rotate.is-fading { opacity: 0; }
.own-spread-rotate[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .own-spread-rotate { transition: none; }
}

.premium-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 54px 16px 40px;
  color: rgba(245, 238, 232, .78);
  text-align: center;
}

.premium-placeholder__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 50%;
  color: #e8c47f;
  background: rgba(20, 9, 17, .34);
  box-shadow: 0 10px 24px rgba(8, 3, 8, .24);
  font-size: 22px;
}

.premium-placeholder h3 { margin: 8px 0 0; color: #f5eee8; font-size: 19px; font-weight: 500; }
.premium-placeholder p { max-width: 220px; margin: 0; color: rgba(235, 218, 211, .64); font-size: 13px; line-height: 1.45; }

.legal-panel { padding-top: 0; }
.legal-panel > .side-menu__subheader { margin-bottom: 4px; }
.legal-copy {
  padding: 18px 2px 12px;
  color: rgba(245, 238, 232, .8);
  font-size: 13px;
  line-height: 1.56;
}
.legal-copy p { margin: 0 0 13px; }
.legal-copy__updated { color: rgba(218, 177, 105, .78); font-size: 11px; letter-spacing: .02em; }
.legal-copy__lead { color: #f5eee8; font-size: 15px; line-height: 1.45; }
.legal-copy__section { margin-top: 20px; }
.legal-copy__section h3 { margin: 0 0 7px; color: #e8c47f; font-size: 15px; font-weight: 500; }
.legal-copy__section ul { margin: 0 0 13px; padding-left: 18px; }
.legal-copy__section li { margin: 0 0 8px; padding-left: 2px; }
.legal-copy__email {
  color: #e8c47f;
  text-decoration: underline;
  text-decoration-color: rgba(232, 196, 127, .58);
  text-underline-offset: 2px;
}
.legal-copy__email:hover,
.legal-copy__email:focus-visible {
  color: #ffe3a6;
  text-decoration-color: currentColor;
  outline: none;
}

.privacy-consent-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 4px;
  padding: 12px;
  border: 1px solid rgba(218, 177, 105, .25);
  border-radius: 12px;
  background: rgba(35, 16, 25, .42);
}
.privacy-consent-setting h3 { margin: 0 0 3px; color: #f5eee8; font-size: 13px; font-weight: 500; }
.privacy-consent-setting p { margin: 0; color: rgba(245, 238, 232, .62); font-size: 11px; line-height: 1.4; }
.privacy-toggle { position: relative; display: inline-flex; flex: 0 0 auto; width: 38px; height: 22px; cursor: pointer; }
.privacy-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.privacy-toggle span { width: 100%; height: 100%; border: 1px solid rgba(218, 177, 105, .5); border-radius: 999px; background: rgba(19, 8, 14, .65); transition: background .16s ease, border-color .16s ease; }
.privacy-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: rgba(245, 238, 232, .68); transition: transform .16s ease, background .16s ease; }
.privacy-toggle input:checked + span { border-color: #e8c47f; background: rgba(218, 177, 105, .34); }
.privacy-toggle input:checked + span::after { transform: translateX(16px); background: #e8c47f; }
.privacy-toggle input:focus-visible + span { outline: 2px solid #ffe3a6; outline-offset: 2px; }

.card-library-toolbar {
  display: grid;
  gap: 15px;
  padding-top: 18px;
}

.card-library-deck-field { display: grid; gap: 7px; min-width: 0; position: relative; }
.card-library-deck-field.is-open { z-index: 15; }
.card-library-deck-wrap { position: relative; min-width: 0; }
.card-library-deck-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 15px 9px 12px;
  border: 1px solid rgba(218, 177, 105, .36);
  border-radius: 11px;
  color: #f5eee8;
  background: rgba(20, 9, 17, .42);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.card-library-deck-trigger:hover,
.card-library-deck-field.is-open .card-library-deck-trigger { border-color: rgba(218, 177, 105, .72); }
.card-library-deck-trigger:focus-visible { outline: 2px solid #e8c47f; outline-offset: 2px; }
.card-library-deck-chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #d8b47a;
  border-bottom: 2px solid #d8b47a;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}
.card-library-deck-field.is-open .card-library-deck-chevron { transform: translateY(2px) rotate(225deg); }
.card-library-deck-options {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 3px;
  max-height: min(280px, 50vh);
  padding: 5px;
  border: 1px solid rgba(218, 177, 105, .53);
  border-radius: 11px;
  background: #301822;
  box-shadow: 0 12px 28px rgba(7, 3, 6, .45);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.card-library-deck-options[hidden] { display: none; }
.card-library-deck-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 39px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #f5eee8;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.card-library-deck-option:hover,
.card-library-deck-option:focus-visible {
  border-color: rgba(218, 177, 105, .3);
  background: rgba(218, 177, 105, .12);
  outline: none;
}
.card-library-deck-option.is-selected { color: #efcc89; background: rgba(218, 177, 105, .09); }
.card-library-deck-check { flex: 0 0 16px; width: 16px; height: 16px; opacity: 0; }
.card-library-deck-option.is-selected .card-library-deck-check { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .card-library-deck-chevron { transition: none; }
}

.card-library-search-wrap {
  position: relative;
  display: block;
}

.card-library-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: rgba(235, 218, 211, .66);
  font-size: 22px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-54%);
}

.card-library-search {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px 10px 35px;
  border: 1px solid rgba(218, 177, 105, .36);
  border-radius: 11px;
  color: #f5eee8;
  background: rgba(20, 9, 17, .42);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.card-library-search::placeholder { color: rgba(235, 218, 211, .54); }
.card-library-search:focus { border-color: rgba(218, 177, 105, .88); box-shadow: 0 0 0 2px rgba(218, 177, 105, .1); }

.card-library-filter-group { display: grid; gap: 7px; }
.card-library-filter-label { color: rgba(235, 218, 211, .64); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.card-library-filter-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.card-library-filter-list::-webkit-scrollbar { display: none; }

.card-library-filter {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(218, 177, 105, .28);
  border-radius: 999px;
  color: rgba(245, 238, 232, .78);
  background: rgba(20, 9, 17, .32);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.card-library-filter:hover,
.card-library-filter:focus-visible,
.card-library-filter.is-selected {
  border-color: rgba(218, 177, 105, .82);
  color: #f5eee8;
  background: rgba(102, 55, 55, .5);
  outline: none;
}

.card-library-meta {
  color: rgba(235, 218, 211, .56);
  font-size: 11px;
}

.card-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 32px;
  padding: 0 0 24px;
}

.tarot-card-image {
  display: block;
  border-radius: var(--tarot-card-radius);
  overflow: hidden;
}

.card-library-card {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  background: transparent;
  cursor: pointer;
  transition: transform 140ms ease;
}

/* Published cards are real links, styled exactly like the original tiles. */
a.card-library-card { text-decoration: none; }

.card-library-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1003 / 1672;
  /* Keep the whole card visible when a source image has a different ratio.
     The library slot follows the canonical 1003:1672 artwork proportions. */
  object-fit: contain;
  background: #1d1017;
  border: 1px solid transparent;
  border-radius: var(--tarot-card-radius);
  box-shadow: 0 9px 20px rgba(8, 3, 8, .3);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.card-library-card img.card-image--muted,
.card-modal__image--muted { filter: saturate(.72); }

.card-library-card:hover { transform: translateY(-2px); }
.card-library-card:hover img,
.card-library-card:focus-visible img {
  box-shadow: 0 12px 26px rgba(8, 3, 8, .42);
}
.card-library-card:focus-visible { outline: 1px solid rgba(240, 200, 119, .94); outline-offset: 4px; border-radius: var(--tarot-card-radius); }

.card-library-card__name {
  overflow: hidden;
  color: #f5eee8;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.major-arcana-mark {
  color: #e4bb76;
  font-size: .8em;
  line-height: 1;
  vertical-align: .06em;
}

.card-library-card__meta { color: rgba(235, 218, 211, .52); font-size: 10px; }

.card-library-empty {
  grid-column: 1 / -1;
  margin: 12px 0 30px;
  color: rgba(235, 218, 211, .64);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.card-library-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 54px 16px 40px;
  color: rgba(245, 238, 232, .78);
  text-align: center;
}

.card-library-placeholder__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 72px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 6px;
  color: #e8c47f;
  background: rgba(20, 9, 17, .34);
  box-shadow: 0 10px 24px rgba(8, 3, 8, .24);
  font-size: 22px;
}

.card-library-placeholder h3 { margin: 8px 0 0; color: #f5eee8; font-size: 19px; font-weight: 500; }
.card-library-placeholder p { max-width: 220px; margin: 0; color: rgba(235, 218, 211, .64); font-size: 13px; line-height: 1.45; }

.settings-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  color: rgba(235, 218, 211, .72);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.settings-back:hover,
.settings-back:focus-visible { color: #f1cb87; outline: none; }

.settings-section { padding-top: 26px; }
.settings-section h3 { margin: 0 0 14px; color: #f5eee8; font-size: 19px; font-weight: 500; }
.settings-section > p { margin: 7px 0 18px; color: rgba(235, 218, 211, .64); font-size: 12px; line-height: 1.45; }

.auth-panel button,
.auth-manage > summary,
.settings-fullscreen-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 12px;
  color: #e8c47f;
  background: rgba(39, 18, 28, .68);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.settings-fullscreen-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:is(.auth-panel button, .auth-manage > summary):active,
:is(.settings-fullscreen-button, .auth-panel button, .auth-manage > summary):hover,
:is(.settings-fullscreen-button, .auth-panel button, .auth-manage > summary):focus-visible { border-color: rgba(218, 177, 105, .98); color: #f5d690; background: rgba(102, 55, 55, .46); box-shadow: 0 0 0 3px rgba(218, 177, 105, .1); outline: none; }
:is(.settings-fullscreen-button, .auth-panel button):disabled { cursor: not-allowed; opacity: .5; }

.language-options { display: grid; gap: 8px; }

.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(218, 177, 105, .25);
  border-radius: 11px;
  color: #f5eee8;
  background: rgba(20, 9, 17, .32);
  text-align: left;
  cursor: pointer;
}

.language-option:hover,
.language-option:focus-visible,
.language-option.is-selected {
  border-color: rgba(218, 177, 105, .78);
  background: rgba(102, 55, 55, .38);
  outline: none;
}

.language-option__main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.language-option__flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex: 0 0 24px;
  font-size: 19px;
  line-height: 1;
}
.language-option__labels { display: grid; gap: 3px; min-width: 0; }
.language-option strong { font-size: 15px; font-weight: 500; }
.language-option small { color: rgba(235, 218, 211, .58); font-size: 11px; }
.language-option__check { min-width: 18px; color: #e8c47f; font-size: 17px; }

.about-panel { padding-top: 0; }

.about-portrait-frame {
  width: min(100%, 270px);
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid rgba(218, 177, 105, .82);
  border-radius: 13px;
  box-shadow: 0 16px 36px rgba(8, 3, 8, .42);
}

.about-portrait { display: block; width: 100%; height: auto; }
.about-panel > .side-menu__subheader { margin-bottom: 14px; }

.about-copy {
  padding-top: 14px;
  color: rgba(245, 238, 232, .78);
  font-size: 14px;
  line-height: 1.58;
}

.about-copy p { margin: 0 0 18px; }
.about-copy__lead { color: #f5eee8; font-size: 18px; line-height: 1.35; }

.about-copy blockquote {
  margin: 26px 0;
  padding: 16px 14px;
  border-left: 2px solid rgba(218, 177, 105, .82);
  color: #e8c47f;
  background: rgba(20, 9, 17, .34);
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
}

.about-copy__footer { color: rgba(218, 177, 105, .82); font-size: 13px; }

.support-panel { padding-top: 0; }
.support-copy {
  display: grid;
  justify-items: center;
  gap: 15px;
  padding: 36px 8px 12px;
  color: rgba(245, 238, 232, .78);
  font-size: 14px;
  line-height: 1.58;
  text-align: center;
}
.support-copy p { margin: 0; }
.support-copy__note { color: rgba(235, 218, 211, .56); font-size: 12px; }
.support-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-top: 9px;
  border: 1px solid rgba(218, 177, 105, .78);
  border-radius: 12px;
  color: #1d1017;
  background: linear-gradient(135deg, #f0d39c, #d3a75e);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 140ms ease, transform 140ms ease;
}
.support-button:hover,
.support-button:focus-visible { filter: brightness(1.08); transform: translateY(-1px); outline: none; }
.support-button span { font-size: 17px; }

@keyframes menu-enter { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

.new-conversation-confirm-backdrop {
  position: fixed;
  z-index: 39;
  inset: 0;
  background: rgba(8, 3, 8, .3);
  pointer-events: auto;
}

.new-conversation-confirm {
  position: fixed;
  z-index: 40;
  top: 50%;
  left: 50%;
  width: min(88vw, 340px);
  box-sizing: border-box;
  padding: 18px 18px 16px;
  border: 1px solid rgba(218, 177, 105, .78);
  border-radius: 18px;
  color: #f5eee8;
  background: rgba(31, 13, 24, .98);
  box-shadow: 0 22px 60px rgba(8, 3, 8, .48);
  transform: translate(-50%, -50%);
  text-align: center;
}

.new-conversation-confirm h2 { margin: 0 0 8px; color: #f5d690; font-size: 18px; font-weight: 600; }
.new-conversation-confirm p { margin: 0; color: rgba(245, 238, 232, .78); font-size: 14px; line-height: 1.5; white-space: pre-line; }
.new-conversation-confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.new-conversation-confirm-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid rgba(218, 177, 105, .72);
  border-radius: 999px;
  color: #f5eee8;
  font: inherit;
  font-size: 13px;
  background: rgba(39, 18, 28, .74);
  cursor: pointer;
}
.new-conversation-confirm-button--confirm { color: #2d1712; background: #f5d690; }
.new-conversation-confirm-button:hover,
.new-conversation-confirm-button:focus-visible { border-color: #f5d690; outline: none; }

.card-modal {
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow-y: auto;
  padding: max(16px, calc(env(safe-area-inset-top) + 8px)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(25, 10, 20, .86);
}

/* Blur the backdrop without making the scrolling modal a containing block
   for its fixed, viewport-anchored close button. */
.card-modal::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Keep the library card and fullscreen viewer close control at the same
   safe-area-aware corner used by the existing mobile spread modal. */
.card-modal > .modal-close,
.card-zoom > .modal-close {
  top: max(12px, calc(env(safe-area-inset-top) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 14px));
}

.modal-close {
  position: fixed;
  z-index: 11;
  top: 40px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(222, 182, 108, .92);
  border-radius: 50%;
  color: #f1cb87;
  background: rgba(47, 23, 33, .82);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.app-shell--spread .modal-close {
  top: max(12px, calc(env(safe-area-inset-top) + 8px));
  right: max(14px, calc(env(safe-area-inset-right) + 14px));
}

.card-modal__inner { display: grid; gap: 18px; width: min(100%, 460px); margin: 0 auto; }

.card-modal__image-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--tarot-card-radius);
  box-shadow: 0 16px 42px rgba(7, 2, 7, .54);
}

.card-modal__image {
  display: block;
  aspect-ratio: 1003 / 1672;
  object-fit: contain;
  width: auto;
  height: min(57vh, 520px);
  max-width: min(100%, calc(100vw - 120px));
  margin: 0 auto;
  border-radius: var(--tarot-card-radius);
}

.card-modal__copy {
  padding: 22px 18px 24px;
  border: 1px solid rgba(211, 169, 94, .92);
  border-radius: 17px;
  background: rgba(47, 20, 31, .91);
  box-shadow: 0 12px 28px rgba(9, 3, 8, .3);
}

.card-modal__image--reversed { transform: rotate(180deg); }

.card-modal__copy h1 {
  margin: 0;
  color: #e4bb76;
  font-family: inherit;
  font-size: clamp(18px, 5vw, 25px);
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.25;
  text-align: center;
}

.card-modal__copy p { margin: 0 0 14px; color: #f5eee8; font-size: 16px; line-height: 1.48; }
.card-modal__meaning-title { margin: 0 0 9px; color: #ead1a2; font-size: 15px; font-weight: 500; line-height: 1.4; }
.card-modal__copy .card-modal__source-note { margin-top: 16px; color: rgba(245, 238, 232, .57); font-size: 12px; line-height: 1.45; }
.card-modal__placeholder { color: rgba(245, 238, 232, .68) !important; font-size: 14px !important; }
.card-modal__copy p:last-child { margin-bottom: 0; }

.ornament { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; color: #e0b873; }
.ornament b { font-size: 21px; font-weight: 400; }
.card-orientation-switch__option { display: flex; flex: 1 1 0; min-width: 0; min-height: 44px; align-items: center; gap: 6px; padding: 0; border: 0; border-radius: 4px; color: rgba(245, 238, 232, .5); background: transparent; font: inherit; font-size: 12px; line-height: 1.3; text-align: left; cursor: pointer; }
.card-orientation-switch__option--reversed { text-align: right; }
.card-orientation-switch__option.is-selected { color: #e0b873; }
.card-orientation-switch__option:focus-visible { outline: 2px solid #e8c47f; outline-offset: 3px; }
.card-orientation-switch__label { min-width: 0; overflow-wrap: anywhere; }
.card-orientation-switch__line { flex: 1 0 10px; height: 1px; background: linear-gradient(90deg, currentColor, transparent); }
.card-orientation-switch__option--reversed .card-orientation-switch__line { background: linear-gradient(90deg, transparent, currentColor); }
.card-modal__symbolism h2 { margin: 16px 0 8px; color: #e0b873; font-size: 14px; font-weight: 500; line-height: 1.4; }

@media (min-width: 700px) {
  .app-shell { box-shadow: 0 0 80px rgba(0, 0, 0, .35); }
}

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

/* Historical deck backs are a separate face, not the existing front-picture
   wrapper. Their responsive sources must remain in the unrotated back plane. */
.tarot-deck-back { display: block; border-radius: var(--tarot-card-radius); overflow: hidden; }
.tarot-deck-back img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.spread-deck .tarot-deck-back { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; backface-visibility: hidden; }
.spread-deck__placed-card .tarot-deck-back { transform: none; }

/* Temporary neutral artwork never borrows a different deck's illustrations. */
.tarot-deck-back--placeholder {
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: inherit;
  background: #302a30;
  box-shadow: none;
}
.tarot-card-placeholder {
  display: grid;
  place-content: center;
  gap: 12px;
  width: 100%;
  aspect-ratio: 1003 / 1672;
  box-sizing: border-box;
  padding: 16px;
  color: rgba(245, 238, 232, .78);
  background: #302a30;
  border: 1px solid transparent;
  border-radius: var(--tarot-card-radius);
  text-align: center;
}
.tarot-card-placeholder strong { font-size: 14px; font-weight: 500; }
.tarot-card-placeholder small { font-size: 12px; line-height: 1.4; }
.tarot-card-placeholder.card-modal__image { width: min(31vh, calc(100vw - 120px)); height: auto; }


/* Card-detail navigation and the bounded illustration viewer. */
.card-modal__artwork { position: relative; min-width: 0; padding-inline: 52px; }
.card-modal__artwork .card-modal__image { max-width: 100%; height: auto; width: min(100%, calc(57vh * 1003 / 1672), calc(520px * 1003 / 1672)); }
.card-modal__artwork .card-modal__image-frame { width: fit-content; }
.card-modal__artwork .card-modal__image-frame:has(img) { width: min(100%, calc(57vh * 1003 / 1672), calc(520px * 1003 / 1672)); }
.card-modal__navigation { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.card-modal__navigation[hidden] { display: none; }

.card-modal__navigation button { display: grid; place-items: center; width: 44px; min-height: 64px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #e4bb76; font-family: Georgia, "Times New Roman", serif; font-size: 56px; font-weight: 400; line-height: 1; opacity: .75; cursor: pointer; pointer-events: auto; transition: color 140ms ease, opacity 140ms ease; }
.card-modal__navigation button:not(:disabled):hover, .card-modal__navigation button:focus-visible { color: #f5d690; opacity: 1; }
.card-zoom__toolbar button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 4px; background: transparent; color: #f1cb87; font-size: 22px; cursor: pointer; }
.card-zoom__toolbar button:not(:disabled):hover { color: #f5d690; }
.card-modal__navigation button:disabled, .card-zoom__toolbar button:disabled { opacity: .35; cursor: default; }
.card-modal__image-frame.js-card-zoom { display: block; padding: 0; border: 0; background: transparent; color: inherit; cursor: zoom-in; touch-action: pan-y pinch-zoom; }
.card-modal__image-frame.js-card-zoom:disabled { cursor: default; }
.card-modal__zoom-hint { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 22px; height: 22px; color: #e4bb76; opacity: 0; pointer-events: none; transition: opacity 140ms ease; }
.card-modal__zoom-hint svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.js-card-zoom:hover .card-modal__zoom-hint, .js-card-zoom:focus-visible .card-modal__zoom-hint { opacity: .9; }
@media (hover: none), (any-pointer: coarse) { .card-modal__zoom-hint { opacity: .8; } }
.js-card-zoom img { -webkit-user-drag: none; user-select: none; }
.card-modal button:not(.modal-close):focus-visible, .card-zoom__toolbar button:focus-visible { outline: 2px solid #ffe1a4; outline-offset: 4px; }
.card-modal.is-zoom-open > .modal-close { visibility: hidden; }
.card-zoom { position: fixed; inset: 0; z-index: 1000; background: #10090ff5; color: #f1cb87; overscroll-behavior: none; }
.card-zoom__toolbar { position: absolute; z-index: 1; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
.card-zoom__viewport { position: absolute; top: calc(76px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); bottom: calc(64px + env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left)); overflow: hidden; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; user-select: none; }
.card-zoom__viewport:active { cursor: grabbing; }
.card-zoom__viewport img { display: block; flex: none; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; pointer-events: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { .card-modal__navigation button, .card-zoom *, .js-card-zoom { animation: none; transition: none; scroll-behavior: auto; } }

/* Public About HTML uses the same panel heading and link geometry. */
.side-menu__header h1 { margin: 0; color: #f4eee9; font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
a.side-menu__item, a.side-menu__close, a.settings-back { text-decoration: none; }

/* Full RWS articles share the card's single scrolling surface. */
.card-modal__article section + section { margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(224, 184, 115, .19); }
.card-modal__article h2 { margin: 0 0 12px; color: #e4bb76; font-family: inherit; font-size: 19px; font-weight: 500; line-height: 1.35; }
.card-modal__article p, .card-modal__article dl { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.card-modal__article .card-modal__themes { color: #ead1a2; }
.card-modal__article dl { margin: 0; color: #f5eee8; }
.card-modal__article dl > div + div { margin-top: 12px; }
.card-modal__article dt, .card-modal__article dd { display: inline; margin: 0; }
.card-modal__article dt { color: #ead1a2; font-weight: 600; }
.card-modal__article .card-modal__reflection { font-style: normal; }
.card-modal__article .card-modal__source-note { margin-top: 28px; }
.rws-attribution > span { display: inline; }
@media (min-width: 800px) {
  .rws-attribution > span { display: block; }
}
.card-modal__source-note a { color: inherit; text-decoration-color: rgba(245, 238, 232, .3); text-underline-offset: 3px; }
.card-modal__source-note a:focus-visible { outline: 2px solid #ffe1a4; outline-offset: 4px; }

/* Shared card-viewer chrome: reading width, orientation controls and navigation. */
@media (min-width: 800px) {
  .card-modal__inner { width: min(100%, 620px); }
  .card-modal__copy { padding-right: 30px; padding-left: 30px; }
}
.card-orientation-switch__option { min-height: 48px; padding: 7px 8px; color: rgba(245, 238, 232, .78); font-size: 14px; transition: color 140ms ease, background-color 140ms ease; }
.card-orientation-switch__option.is-selected { color: #edc77f; background: rgba(224, 184, 115, .07); }
@media (hover: hover) {
  .card-orientation-switch__option:hover { color: #ffe1a4; background: rgba(224, 184, 115, .14); }
}
.card-orientation-switch__option:focus-visible { color: #ffe1a4; background: rgba(224, 184, 115, .14); }
.card-modal__navigation a { position: relative; display: grid; place-items: center; width: 44px; min-height: 64px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #e4bb76; font-family: Georgia, "Times New Roman", serif; font-size: 56px; font-weight: 400; line-height: 1; opacity: .75; cursor: pointer; pointer-events: auto; text-decoration: none; }
.card-modal__navigation button { position: relative; }
.card-modal__navigation a:hover, .card-modal__navigation a:focus-visible { color: #f5d690; opacity: 1; }
.card-navigation-tooltip { position: absolute; z-index: 2; top: calc(100% + 6px); left: 50%; width: max-content; max-width: 150px; padding: 7px 9px; transform: translateX(-50%); border: 1px solid rgba(224,184,115,.45); border-radius: 6px; background: #2f1721; color: #f5eee8; font-family: "IBM Plex Sans", Arial, sans-serif; font-size: 12px; font-weight: 400; line-height: 1.4; text-align: center; pointer-events: none; opacity: 0; }
.card-modal__navigation :is(button,a):focus-visible .card-navigation-tooltip { opacity: 1; }
@media (hover: hover) { .card-modal__navigation :is(button,a):hover .card-navigation-tooltip { opacity: 1; } }
.card-pagination { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin-top: 8px; padding: 14px 4px 20px; }
.card-pagination :is(a,button) { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; min-height: 48px; padding: 6px; border: 0; border-radius: 4px; color: #e4bb76; background: transparent; font: inherit; line-height: 1.45; text-align: left; text-decoration: none; cursor: pointer; }
.card-pagination :is(a,button):last-child { align-items: flex-end; text-align: right; }
.card-pagination__label { color: #d3b78d; font-size: 12px; }
.card-pagination__name { font-size: 16px; overflow-wrap: anywhere; }
.card-pagination :is(a,button):hover { color: #ffe1a4; background: rgba(224,184,115,.08); }
.card-pagination :is(a,button):focus-visible { outline: 2px solid #ffe1a4; outline-offset: 3px; }
.card-modal__navigation > :first-child .card-navigation-tooltip { left: 0; transform: none; }
.card-modal__navigation > :last-child .card-navigation-tooltip { right: 0; left: auto; transform: none; }

@media (max-width: 799px) {
  .card-modal__copy .card-orientation-switch { margin-bottom: 24px; }
}

/* Passwordless account controls remain inside the existing scrollable settings panel. */
.auth-panel { min-width: 0; }
.auth-panel p { line-height: 1.5; font-size: .9rem; overflow-wrap: anywhere; }
/* Account actions inherit the Fullscreen component, including its interaction states. */
.auth-panel button { font: inherit; }
.auth-panel button[aria-pressed="true"] { border-color: rgba(218, 177, 105, .98); background: rgba(102, 55, 55, .46); }
.auth-panel input:focus-visible { outline: 2px solid #e9c98b; outline-offset: 3px; }
.auth-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.auth-email { display: block; margin-top: 6px; color: #f5eee8; }
.auth-manage { margin-top: 12px; }
.auth-manage > summary { display: list-item; box-sizing: border-box; text-align: center; }
.auth-manage > .auth-actions, .auth-delete-confirm { margin-top: 12px; }
.auth-status:empty { display: none; }
.auth-panel + .settings-section, .settings-fullscreen + .settings-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid rgba(218, 177, 105, .2); }
.auth-form { display: grid; gap: .8rem; margin-block: .8rem; }
.auth-form label { display: grid; gap: .4rem; }
.auth-form input { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: 16px; color: inherit; background: rgba(0,0,0,.2); border: 1px solid rgba(215,185,135,.5); border-radius: .5rem; padding: .75rem; }
.auth-status { min-height: 1.4em; }

.send-control { position: relative; display: inline-flex; flex: 0 0 44px; width: 44px; height: 44px; }
/* Only the server's settled usage drives this ring; the plane remains unchanged. */
.send-button.has-quota-ring { position: relative; border: 0; box-shadow: inset 0 0 0 1.25px rgba(245,238,232,.14); transition: none; }
.send-control svg.quota-ring { position: absolute; inset: 0; width: 44px; height: 44px; pointer-events: none; overflow: visible; fill: none; stroke: #e8c47f; stroke-width: 1.5; }
.quota-ring circle { pointer-events: none; transition: stroke-dashoffset 320ms ease, stroke-width 120ms ease; }
.send-control .quota-hit { stroke: transparent; stroke-width: 13.1; pointer-events: none; transition: stroke-dashoffset 320ms ease; }
.quota-tooltip { display: none; position: absolute; bottom: calc(100% + 8px); right: 0; padding: 7px 10px; border-radius: 8px; background: #2e2025; color: #f4e8da; font-family: inherit; font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.quota-tooltip.is-user-open { display: block; }
.send-control .quota-hit { pointer-events: stroke; }
.send-control .quota-ring.is-empty .quota-hit { pointer-events: none; }
.send-control .quota-ring:focus-visible { outline: 2px solid #ffe3a6; outline-offset: 4px; border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
 .send-control:has(.quota-hit:hover) .quota-remaining { stroke-width: 2.4; }
 .send-control:has(.quota-hit:hover) .quota-tooltip { display: block; }
}
.send-button.has-quota-ring.is-disabled { opacity: 1; }
.send-button.has-quota-ring.is-disabled .send-plane { opacity: .42; }
.send-button:focus-visible { outline: 2px solid #ffe3a6; outline-offset: 4px; }
.quota-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.quota-notice.privacy-consent { position: relative; inset: auto; width: min(100%,560px); max-height: min(250px,35dvh); margin: 0 auto 10px; }
.quota-notice .privacy-consent__copy { max-height: 15dvh; }
.quota-notice .privacy-consent__actions:has(:only-child) { grid-template-columns: 1fr; }
@media (prefers-reduced-motion: reduce) { .quota-ring circle { transition: none !important; animation: none !important; } }

/* Guest email flow: a compact mode choice, then one primary action. */
.auth-mode { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.auth-mode button { min-width: 0; padding: 8px 6px; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; color: #e2ccc4; }
.auth-mode button[aria-selected="true"] { color: #f5d690; font-weight: 600; border-color: rgba(218,177,105,.85); background: rgba(102,55,55,.46); }
.auth-mode button:disabled { opacity: .8; }
.auth-mode button[aria-selected="true"]:disabled { opacity: 1; }
.auth-form .auth-help { margin: 0; color: #e2ccc4; font-size: 13px; line-height: 1.45; }
.auth-form .auth-primary { font-weight: 600; background: rgba(102,55,55,.46); }
.auth-secondary { display: flex; flex-wrap: wrap; gap: 8px; }
.auth-secondary button { flex: 1 1 130px; font-size: 13px; padding-inline: 8px; }
.auth-history { margin-top: 8px; color: #e2ccc4; font-size: 13px; }
.auth-history summary { cursor: pointer; min-height: 44px; align-content: center; width: fit-content; max-width: 100%; border-radius: 6px; }
.auth-history summary:focus-visible { outline: 2px solid #e9c98b; outline-offset: 3px; }
.auth-history summary:hover { color: #f5d690; }
.auth-history p { margin: 0 0 8px; font-size: 13px; }
.auth-form input[aria-invalid="true"] { border-color: #f0a59d; }
.auth-panel .auth-status { margin-block: 8px 0; color: #f5d690; font-size: 13px; }

/* Native confirmations reuse Collect Cards typography, card and button styles. */
dialog.app-confirmation {
  inset: 0;
  margin: auto;
  transform: none;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.app-confirmation::backdrop { background: rgba(8, 3, 8, .3); }
dialog.app-confirmation .spread-deck__confirm-button:focus-visible {
  outline: 2px solid #f5d690;
  outline-offset: 3px;
}


.own-spread-controls { display: flex; align-items: center; gap: 10px; }


.auth-mode button:focus-visible { outline: 2px solid #f5d690; outline-offset: 2px; }
.auth-mode button:not(:disabled):hover { background: rgba(102,55,55,.46); }

.quota-notice.quota-notice--compact { display: grid; grid-template-columns: 16px minmax(0,1fr) 36px; align-items: center; gap: 8px; min-height: 56px; padding: 6px 10px; font-size: 12px; line-height: 1.35; text-align: left; }
.quota-compact-info { width: 16px; height: 16px; fill: none; stroke: #e8c47f; stroke-width: 1.4; stroke-linecap: round; }
.quota-compact-copy { display: grid; gap: 2px; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.quota-register-link { justify-self: start; padding: 0; border: 0; background: none; color: #e8c47f; font: inherit; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.quota-notice--compact .quota-expand { width: 36px; height: 40px; min-width: 36px; min-height: 40px; margin: 0; padding: 8px; border: 0; border-radius: 0; display: grid; place-items: center; color: inherit; background: transparent; }
/* Quota notices occupy their own row, including short keyboard viewports. */
.app-shell:has(.quota-notice) > .conversation { min-height: 0; overflow: hidden; }
.app-shell:has(.quota-notice) > .conversation .message-stack { padding-bottom: 14px; }

.quota-notice.quota-notice--monthly { grid-template-columns: 16px minmax(0,1fr); }
.quota-monthly-title { font-size: 13px; font-weight: 500; }
.quota-notice--monthly .quota-reset { color: rgba(245,238,232,.77); }
