/* ═══════════════════════════════════════════════════════════
   内在小孩疗愈 — Watercolor Healing Theme
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #fdfcff;
  --bg-warm: #faf7fc;
  --text: #3f3a55;
  --text-light: #817b92;
  --primary: #8f82c9;
  --primary-light: #c9c1eb;
  --primary-dark: #675c9e;
  --accent: #D4A574;
  --accent-light: #E8C892;
  --blue: #6B9BC5;
  --green: #8BB89B;
  --rose: #D4899B;
  --card-back: #6B5FA8;
  --shadow: rgba(79, 70, 112, 0.08);
  --shadow-lg: rgba(79, 70, 112, 0.14);
  --radius: 14px;
  --radius-lg: 24px;
  --transition: 0.3s ease;
  --sidebar-width: 180px;
  --app-content-gap: 24px;
  --glass-surface: rgba(255, 255, 255, 0.68);
  --glass-surface-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-shadow: 0 18px 54px rgba(75, 66, 110, 0.10);
  --main-nav-height: 62px;
  --page-context-height: 48px;
  --app-chrome-height: 110px;
  --font-serif: 'Noto Serif SC', serif;
  --font-sans: 'Noto Sans SC', -apple-system, sans-serif;
}

.return-to-space {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(119, 104, 174, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(74, 65, 112, 0.16);
  color: #655b96;
  font: 500 14px/1 "Noto Sans SC", sans-serif;
  text-decoration: none;
  backdrop-filter: blur(16px);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.return-to-space:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(74, 65, 112, 0.22);
}

body.is-space-embed .return-to-space,
body.is-space-embed #main-nav,
body.is-space-embed #page-context-bar {
  display: none !important;
}

body.is-space-embed .page.active {
  padding-top: 18px !important;
}

.platform-experience-dialog{width:min(1380px,98vw);height:min(920px,96dvh);padding:0;border:1px solid rgba(139,126,190,.22);border-radius:24px;background:#faf8fd;box-shadow:0 30px 100px rgba(55,43,90,.28);overflow:hidden}.platform-experience-dialog::backdrop{background:rgba(49,39,74,.32);backdrop-filter:blur(8px)}.platform-experience-dialog header{height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid rgba(139,126,190,.12);background:rgba(255,255,255,.86)}.platform-experience-dialog h2{margin:0;font-family:var(--font-serif);font-size:20px;color:var(--text)}.platform-experience-dialog header button{padding:10px 16px;border:1px solid rgba(139,126,190,.22);border-radius:999px;color:#6f6398;background:#fff}.platform-experience-frame{display:block;width:100%;height:calc(100% - 64px);border:0;background:#fff}

@media (max-width: 640px) {
  .return-to-space {
    right: 14px;
    bottom: 14px;
    padding-inline: 14px;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(250,248,254,0.94) 48%, rgba(255,251,248,0.96)),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  background:
    radial-gradient(circle at 77% 9%, rgba(194, 181, 234, 0.22), transparent 32%),
    radial-gradient(circle at 21% 19%, rgba(251, 220, 198, 0.18), transparent 30%),
    radial-gradient(circle at 62% 84%, rgba(205, 224, 216, 0.13), transparent 34%);
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

body.page-context-nested {
  --page-context-height: 64px;
  --app-chrome-height: 126px;
}
body.page-context-primary {
  --page-context-height: 0px;
  --app-chrome-height: var(--main-nav-height);
}

body.chat-locked {
  overflow: hidden;
}

.hidden { display: none !important; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 32px; border: none; border-radius: 50px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 4px 15px rgba(107, 95, 168, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(107, 95, 168, 0.4);
}
.btn-secondary {
  background: var(--bg-warm); color: var(--text);
  border: 1px solid rgba(139, 126, 200, 0.2);
}
.btn-secondary:hover { background: #EDE5DA; }
.btn-lg { padding: 16px 42px; font-size: 17px; }
.btn-full { width: 100%; }
.btn-back {
  background: none; border: none; color: var(--text-light);
  font-family: var(--font-sans); font-size: 15px;
  cursor: pointer; padding: 8px 0; margin-bottom: 20px;
  transition: color var(--transition);
}
.btn-back:hover { color: var(--primary); }

/* ── Navigation ───────────────────────────────────────── */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--main-nav-height);
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 126, 200, 0.1);
}
.nav-inner {
  max-width: 1700px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
  padding: 0 clamp(28px, 4vw, 56px);
  gap: 20px;
  position: relative;
}
.nav-logo {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  color: var(--primary-dark); text-decoration: none;
  flex: 0 0 auto;
}
.nav-brand-context,
.nav-menu-brand {
  display: none;
}
.nav-links {
  display: flex; align-items: center; gap: 16px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  color: var(--text-light); text-decoration: none; font-size: 14px;
  font-weight: 400; transition: color var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-account {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.nav-credits {
  display: none;
  color: var(--primary-dark);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 18px;
  background: rgba(232, 200, 146, 0.28);
  white-space: nowrap;
}
.nav-user-menu { position: relative; }
.nav-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: center;
  column-gap: 7px;
  color: var(--primary); font-size: 13px;
  padding: 9px 12px; border-radius: 20px;
  background: rgba(139, 126, 200, 0.08);
  border: none;
  font-family: var(--font-sans);
  cursor: pointer;
  line-height: 1.2;
  min-width: 96px;
  text-align: center;
}
.nav-user::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor;
  margin-left: 0;
  transform: translateY(1px);
  grid-column: 2;
  grid-row: 1;
}
.nav-user-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  grid-column: 1;
  grid-row: 1;
}
.nav-user-dropdown {
  position: fixed;
  top: 58px;
  right: clamp(16px, 4vw, 56px);
  min-width: 128px;
  background: #fff;
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow-lg);
  padding: 8px;
  z-index: 120;
}
.nav-dropdown-credits {
  padding: 9px 10px 10px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(139, 126, 200, 0.1);
  color: var(--primary);
  font-size: 13px;
  white-space: nowrap;
}
.nav-user-dropdown a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.nav-user-dropdown a:hover { background: var(--bg); color: var(--primary); }
.nav-user-dropdown .nav-logout { color: var(--rose); }
.nav-menu-toggle {
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid rgba(139, 126, 200, 0.16);
  border-radius: 10px;
  background: rgba(255,255,255,0.62);
  color: var(--primary-dark);
  cursor: pointer;
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  transition: background var(--transition), border-color var(--transition);
}
.nav-menu-toggle:hover {
  background: #fff;
  border-color: rgba(139, 126, 200, 0.32);
}
.nav-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-menu-toggle.is-open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-menu-toggle.is-open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.page-context-bar {
  position: fixed;
  top: var(--main-nav-height);
  left: 0;
  right: 0;
  z-index: 90;
  height: var(--page-context-height);
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.page-context-bar.is-nested {
  background: var(--bg);
}
.page-context-inner {
  width: 100%;
  max-width: 1700px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(28px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 18px;
}
.page-context-bar:not(.is-nested) .page-context-inner {
  justify-content: center;
}
.page-context-bar:not(.is-nested) .page-context-heading {
  position: relative;
}
.page-context-bar:not(.is-nested) .page-context-actions {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}
.page-breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  color: var(--text-light);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.page-breadcrumbs::-webkit-scrollbar { display: none; }
.page-breadcrumbs.is-empty { display: none; }
.page-breadcrumb-link {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-family: var(--font-sans);
  cursor: pointer;
}
.page-breadcrumb-link:hover,
.page-breadcrumb-link:focus-visible {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}
.page-breadcrumb-current,
.page-breadcrumb-separator {
  flex: 0 0 auto;
  white-space: nowrap;
}
.page-breadcrumb-current,
.page-context-title {
  font-family: var(--font-sans);
  line-height: 1.25;
  font-weight: 500;
  color: var(--text);
}
.page-breadcrumb-separator {
  color: rgba(139, 126, 155, 0.42);
  line-height: 1;
}
.page-breadcrumb-link,
.page-breadcrumb-current,
.page-breadcrumb-separator {
  font-size: 13px;
}
.page-context-heading {
  margin-left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 0 0 auto;
}
.page-breadcrumbs,
.page-context-heading {
  width: max-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.page-context-bar.is-nested .page-context-heading {
  display: none;
}
.page-context-title {
  font-size: 17px;
  text-align: center;
  white-space: nowrap;
}
.page-context-actions {
  display: inline-flex;
  align-items: center;
}
.page-context-info {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(74, 63, 92, 0.24);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: 0 18px 46px rgba(74, 63, 92, 0.2);
  border: 1px solid rgba(139, 126, 200, 0.1);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: rgba(139, 126, 200, 0.08);
  color: var(--primary-dark);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.redeem-modal-card {
  text-align: center;
}
.redeem-modal-card h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 8px 0;
}
.redeem-modal-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 20px;
}
.redeem-modal-card .form-group,
.redeem-modal-card .form-error,
.redeem-modal-card .form-success {
  text-align: left;
}

.card-zoom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(35, 29, 48, 0.58);
  backdrop-filter: blur(10px);
  cursor: zoom-out;
}

.card-zoom-backdrop img {
  max-width: min(82vw, 420px);
  max-height: min(82vh, 620px);
  object-fit: contain;
  border-radius: 16px;
  border: 6px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(28, 22, 40, 0.34);
  cursor: zoom-out;
}

/* ── Landing Page ─────────────────────────────────────── */
#page-landing.active {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; position: relative; overflow-x: hidden;
  padding: 42px 20px;
}
.landing-bg {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.watercolor-blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35;
  animation: blobFloat 20s ease-in-out infinite;
}
.blob1 {
  width: 500px; height: 500px; top: -100px; left: -100px;
  background: radial-gradient(circle, var(--primary-light), transparent 70%);
}
.blob2 {
  width: 400px; height: 400px; bottom: -50px; right: -50px;
  background: radial-gradient(circle, var(--accent-light), transparent 70%);
  animation-delay: -7s;
}
.blob3 {
  width: 350px; height: 350px; top: 40%; left: 50%;
  background: radial-gradient(circle, var(--blue), transparent 70%);
  opacity: 0.2; animation-delay: -13s;
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.landing-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(36px, 6vw, 86px);
  align-items: start;
  position: relative;
  z-index: 1;
}
.landing-content {
  text-align: left; position: relative; z-index: 1;
  padding: 0;
  animation: fadeInUp 1s ease;
}
.landing-icon {
  font-size: clamp(36px, 4.4vw, 54px);
  color: var(--primary);
  display: inline-flex;
  line-height: 1;
  margin: 0;
  flex: 0 0 auto;
}
.breathing { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}
.landing-title {
  display: block;
  font-family: var(--font-serif); font-size: clamp(32px, 6vw, 52px);
  font-weight: 700; color: var(--text);
  margin-bottom: 26px; letter-spacing: 2px;
}
.landing-subtitle {
  font-family: var(--font-serif); font-size: clamp(16px, 3vw, 20px);
  color: var(--text-light); margin-bottom: 24px; line-height: 2;
}
.landing-desc {
  font-size: 15px; color: var(--text-light);
  margin-bottom: 24px; line-height: 2;
}
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 12px 28px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
  color: var(--text-light);
  font-size: 15px;
}
.landing-features li {
  white-space: nowrap;
}

.landing-cards-preview {
  display: flex; justify-content: flex-start; gap: 0;
  position: relative; height: 240px;
  margin-top: 10px;
  margin-left: 0;
}
.preview-card {
  width: 138px; height: 195px; object-fit: cover;
  border-radius: var(--radius); box-shadow: 0 8px 30px var(--shadow-lg);
  position: absolute; transition: transform 0.5s ease;
  transform-origin: 50% 100%;
}
.pc1 { left: 0; top: 34px; z-index: 1; transform: rotate(-8deg); }
.pc2 { left: 156px; top: 4px; z-index: 3; transform: rotate(0deg); }
.pc3 { left: 312px; top: 34px; z-index: 2; transform: rotate(8deg); }
.landing-cards-preview:hover .pc1 { transform: rotate(-11deg); }
.landing-cards-preview:hover .pc3 { transform: rotate(11deg); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Auth Page ────────────────────────────────────────── */
#page-auth.active {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #EDE5F5 100%);
}
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 40px 36px; box-shadow: 0 12px 40px var(--shadow);
  width: 100%;
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-icon { font-size: 40px; color: var(--primary); display: block; margin-bottom: 8px; }
.auth-header h2 {
  font-family: var(--font-serif); font-size: 24px; font-weight: 600;
}
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  border-bottom: 2px solid var(--bg-warm);
}
.auth-tab {
  flex: 1; padding: 10px; background: none; border: none;
  font-family: var(--font-sans); font-size: 15px;
  color: var(--text-light); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition);
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-light); margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border: 1.5px solid #E8E2F0;
  border-radius: 10px; font-family: var(--font-sans);
  font-size: 15px; color: var(--text); background: var(--bg);
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-error {
  color: var(--rose); font-size: 13px;
  margin-bottom: 12px; min-height: 20px;
}
.form-success {
  color: var(--green); font-size: 13px;
  margin-bottom: 12px;
}
.input-with-btn {
  display: flex; gap: 8px;
}
.input-with-btn input { flex: 1; }
.btn-send-code {
  flex-shrink: 0; padding: 10px 14px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.btn-send-code:hover { background: var(--primary-dark); }
.btn-send-code:disabled {
  background: var(--bg-warm); color: var(--text-light); cursor: not-allowed;
}
.auth-link-row {
  text-align: center; margin-top: 16px;
}
.auth-link-row a {
  color: var(--primary); font-size: 13px;
  text-decoration: none;
}
.auth-link-row a:hover { text-decoration: underline; }

/* ── Intro Page ───────────────────────────────────────── */
#page-intro.active { padding-top: calc(var(--app-chrome-height) + 24px); min-height: 100vh; }
.intro-container { max-width: 880px; padding-bottom: 72px; }
.intro-header {
  text-align: center;
  padding: 34px 0 30px;
}
.intro-mark {
  display: block;
  color: var(--primary);
  font-size: 34px;
  margin-bottom: 10px;
}
.intro-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 42px);
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.intro-header p {
  color: var(--text-light);
  font-size: 15px;
}
.intro-article {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 5vw, 48px);
  box-shadow: 0 12px 38px rgba(74, 63, 92, 0.08);
}
.intro-article section + section {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid rgba(139, 126, 200, 0.12);
}
.intro-article h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--primary-dark);
  margin-bottom: 16px;
}
.intro-article p {
  color: var(--text);
  line-height: 2;
  margin-bottom: 14px;
}
.intro-article ul {
  margin: 8px 0 18px;
  padding-left: 22px;
  color: var(--text-light);
}
.intro-article li {
  margin-bottom: 8px;
  line-height: 1.8;
}
.intro-caution li::marker { color: var(--rose); }
.intro-value li::marker { color: var(--green); }

/* ── Dashboard ────────────────────────────────────────── */
#page-dashboard.active { padding-top: calc(var(--app-chrome-height) + 20px); min-height: 100vh; }
#page-dashboard .container {
  max-width: 1700px;
  padding: 0 clamp(28px, 4vw, 56px);
}
.dashboard-header {
  text-align: center; padding: 18px 0 28px;
}
.dashboard-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.dashboard-header h1 {
  font-family: var(--font-serif); font-size: 28px; font-weight: 700;
  margin-bottom: 0;
}
.dashboard-header p { color: var(--text-light); font-size: 15px; }
.info-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(139, 126, 200, 0.22);
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.info-button:hover {
  background: #fff;
  border-color: rgba(139, 126, 200, 0.42);
  transform: translateY(-1px);
}

/* ── Module Pages ─────────────────────────────────────── */
#page-module.active {
  padding-top: var(--app-chrome-height);
  min-height: 100vh;
}
.module-container {
  max-width: 1220px;
}
.module-hero {
  margin: 28px auto 0;
  padding: 46px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(139, 126, 200, 0.12);
  background:
    linear-gradient(135deg, rgba(139,126,200,0.09), rgba(232,200,146,0.12) 44%, rgba(139,184,155,0.08)),
    rgba(255,255,255,0.84);
  box-shadow: 0 12px 34px rgba(74, 63, 92, 0.08);
}
.module-hero.game-module-hero {
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.module-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(232, 200, 146, 0.24);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
}
.module-hero h1 {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.3;
  margin-bottom: 8px;
}
.module-hero h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.45;
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.module-hero p {
  max-width: 680px;
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 22px;
}
.module-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.module-chip-row span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(139,126,200,0.12);
  color: var(--text);
  font-size: 13px;
}
.module-hero.drawing-module-hero {
  max-width: 1180px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.drawing-module-header {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}
.drawing-module-header h1 {
  font-size: 34px;
  margin-bottom: 12px;
}
.drawing-module-header p {
  margin: 0 auto;
}
.drawing-hub-shell {
  min-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 42px;
}
.drawing-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.drawing-entry-card {
  min-height: 260px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.72);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,250,242,0.28)),
    rgba(255,255,255,0.58);
  box-shadow:
    0 22px 54px rgba(74, 63, 92, 0.10),
    inset 0 1px 0 rgba(255,255,255,0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.drawing-entry-card:nth-child(1) {
  background:
    linear-gradient(145deg, rgba(232,200,146,0.18), rgba(255,255,255,0.58)),
    rgba(255,255,255,0.58);
}
.drawing-entry-card:nth-child(2) {
  background:
    linear-gradient(145deg, rgba(139,126,200,0.14), rgba(255,255,255,0.62)),
    rgba(255,255,255,0.58);
}
.drawing-entry-card:nth-child(3) {
  background:
    linear-gradient(145deg, rgba(139,184,155,0.16), rgba(255,255,255,0.62)),
    rgba(255,255,255,0.58);
}
.drawing-entry-card:nth-child(4) {
  background:
    linear-gradient(145deg, rgba(107,155,197,0.13), rgba(232,200,146,0.10), rgba(255,255,255,0.62)),
    rgba(255,255,255,0.58);
}
.drawing-entry-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.88);
  box-shadow:
    0 28px 70px rgba(74, 63, 92, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.8);
}
.drawing-entry-card span,
.drawing-entry-card strong,
.drawing-entry-card em {
  display: block;
}
.drawing-entry-card span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
.drawing-entry-card strong {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}
.drawing-entry-card em {
  max-width: 220px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.8;
  font-style: normal;
}
.drawing-page-topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.drawing-page-topbar h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
  color: var(--text);
}
.drawing-back-button {
  border: 1px solid rgba(139,126,200,0.16);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(255,255,255,0.72);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.drawing-back-button::before {
  content: "";
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(2px, -2px);
}
.drawing-tool-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.drawing-tool-tabs button,
.drawing-chapter-filter button {
  border: 1px solid rgba(139,126,200,0.14);
  background: rgba(255,255,255,0.78);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.drawing-tool-tabs button {
  min-height: 82px;
  padding: 14px;
  border-radius: 8px;
  text-align: left;
}
.drawing-tool-tabs button strong,
.drawing-tool-tabs button span {
  display: block;
}
.drawing-tool-tabs button strong {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: 6px;
}
.drawing-tool-tabs button span {
  color: var(--text-light);
  font-size: 13px;
}
.drawing-tool-tabs button.active,
.drawing-chapter-filter button.active {
  border-color: rgba(139,126,200,0.45);
  background: linear-gradient(135deg, rgba(139,126,200,0.14), rgba(232,200,146,0.18)), #fff;
  box-shadow: 0 10px 24px rgba(74, 63, 92, 0.08);
}
.drawing-workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(139,126,200,0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(248,243,235,0.82)),
    rgba(255,255,255,0.86);
  box-shadow: 0 12px 30px rgba(74, 63, 92, 0.07);
}
.drawing-workspace.canvas-focused {
  min-height: auto;
  grid-template-columns: 1fr;
  align-items: start;
  align-content: start;
  grid-auto-rows: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  gap: 10px;
}
.drawing-workspace.exercise-focused {
  display: block;
  min-height: 0;
  height: calc(100svh - var(--app-chrome-height) - 36px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.drawing-section-title span,
.drawing-detail-copy span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.drawing-studio {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(139,126,200,0.13);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(249,244,235,0.96), rgba(240,235,246,0.72)),
    #f8f4ed;
  box-shadow: 0 16px 36px rgba(74,63,92,0.08);
  overflow: visible;
}
.drawing-tool-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(139,126,200,0.14);
  border-radius: 11px;
  background: rgba(255,253,249,0.9);
  box-shadow: 0 8px 22px rgba(74,63,92,0.08);
  z-index: 4;
}
.drawing-tool-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #625772;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.drawing-tool-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.drawing-tool-button:hover,
.drawing-tool-button:focus-visible,
.drawing-tool-button.panel-open,
.drawing-tool-button.active {
  border-color: rgba(139,126,200,0.26);
  background: rgba(139,126,200,0.12);
  color: var(--primary-dark);
  outline: none;
  box-shadow: 0 5px 14px rgba(107,95,168,0.1);
}
.drawing-tool-button:focus-visible {
  outline: 2px solid rgba(107,95,168,0.5);
  outline-offset: 2px;
}
.drawing-tool-button.primary {
  margin-top: 0;
  border-color: transparent;
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 8px 18px rgba(107,95,168,0.25);
}
.drawing-tool-button.primary:hover,
.drawing-tool-button.primary:focus-visible {
  background: #5d5199;
  color: #fff;
}
.drawing-tool-button:disabled {
  cursor: wait;
  opacity: 0.62;
}
.drawing-tool-button[aria-busy="true"] svg {
  animation: drawingSavePulse 900ms ease-in-out infinite alternate;
}
@keyframes drawingSavePulse {
  to { opacity: 0.45; transform: translateY(-1px); }
}
.drawing-tool-panel {
  position: absolute;
  top: 16px;
  left: 76px;
  z-index: 8;
  width: min(262px, calc(100% - 94px));
  padding: 17px;
  border: 1px solid rgba(139,126,200,0.18);
  border-radius: 13px;
  background: rgba(255,253,249,0.96);
  box-shadow: 0 18px 44px rgba(74,63,92,0.18);
  backdrop-filter: blur(14px);
  animation: drawingPanelIn 180ms ease-out;
}
.drawing-tool-panel[hidden] { display: none; }
@keyframes drawingPanelIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}
.drawing-tool-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.drawing-tool-panel-heading strong {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
}
.drawing-tool-panel-heading button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(139,126,200,0.09);
  color: var(--text-light);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.drawing-color-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawing-swatch-row {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  gap: 10px;
}
.drawing-swatch {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.96);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 2px 8px rgba(74,63,92,0.14);
  cursor: pointer;
}
.drawing-swatch.active {
  outline: 2px solid rgba(91,79,107,0.38);
  outline-offset: 2px;
}
.drawing-custom-color {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1px solid rgba(139,126,200,0.12);
  border-radius: 50%;
  background: rgba(255,255,255,0.76);
  box-shadow: 0 2px 10px rgba(74,63,92,0.08);
  cursor: pointer;
  overflow: hidden;
}
.drawing-custom-color input {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.drawing-brush-tools {
  display: grid;
  gap: 8px;
}
.drawing-brush-tools label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-light);
  font-size: 13px;
}
.drawing-brush-tools output {
  min-width: 32px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(139,126,200,0.1);
  color: var(--primary-dark);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.drawing-brush-tools input[type="range"] {
  width: 100%;
  margin: 0 0 10px;
  accent-color: var(--primary);
}
.drawing-save-status {
  position: absolute;
  left: 68px;
  bottom: 15px;
  z-index: 7;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,253,249,0.9);
  color: var(--primary);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.drawing-save-status:empty {
  display: none;
}
.drawing-canvas-panel {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(232,200,146,0.18), rgba(139,184,155,0.12)),
    rgba(255,255,255,0.72);
}
.drawing-canvas-panel canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1180 / 680;
  height: auto;
  min-height: 560px;
  border-radius: 8px;
  border: 1px solid rgba(74,63,92,0.12);
  background: #fffdf9;
  touch-action: none;
  cursor: crosshair;
}
.drawing-random-exercise {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: 10px;
}
.drawing-exercise-prompt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 8px 10px;
}
.drawing-exercise-prompt-copy {
  min-width: 0;
}
.drawing-exercise-reference-block {
  min-width: 0;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.drawing-exercise-reference {
  width: 84px;
  height: 84px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 16px;
  background: rgba(255,255,255,0.58);
  box-shadow: 0 10px 24px rgba(75,66,110,0.08);
}
.drawing-exercise-reference img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drawing-exercise-prompt-copy > h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.25;
}
.drawing-exercise-instructions {
  margin-top: 6px;
  min-width: 0;
}
.drawing-exercise-instructions p {
  margin: 0;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.55;
}
.drawing-exercise-instructions p + p {
  margin-top: 3px;
}
.drawing-exercise-prompt > .btn {
  padding: 9px 18px;
  font-size: 13px;
  box-shadow: none;
  white-space: nowrap;
}
.drawing-random-exercise > .drawing-studio {
  min-height: 0;
  height: 100%;
}
.drawing-random-exercise .drawing-canvas-panel {
  display: flex;
  min-height: 0;
  height: 100%;
}
.drawing-random-exercise .drawing-canvas-panel canvas {
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
}
.drawing-random-copy {
  display: flex;
  justify-content: center;
  padding: 4px 18px 0;
}
.drawing-random-copy .btn {
  padding: 9px 28px;
  font-size: 14px;
}
.drawing-random-copy span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}
.drawing-random-copy h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.3;
  margin: 10px 0 18px;
}
.drawing-random-detail .drawing-detail-media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}
.drawing-random-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  height: 100%;
  min-height: 0;
  align-items: stretch;
  border: 1px solid rgba(139,126,200,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.88);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(74, 63, 92, 0.07);
}
.drawing-random-detail .drawing-detail-media {
  min-width: 0;
  min-height: 0;
  background: #fffdf9;
}
.drawing-random-detail .drawing-detail-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: clamp(18px, 2.5vw, 30px);
}
.drawing-random-detail .drawing-detail-copy h3 {
  font-size: clamp(20px, 2vw, 24px);
  margin: 5px 0 9px;
}
.drawing-random-detail .drawing-detail-copy p,
.drawing-random-detail .drawing-detail-copy li {
  font-size: 12px;
  line-height: 1.55;
}
.drawing-random-detail .drawing-detail-copy p {
  margin-bottom: 7px;
}
.drawing-random-detail .drawing-detail-copy ol {
  margin-top: 7px;
}
.drawing-exercise-section {
  margin-top: 26px;
}
.drawing-section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 14px;
}
.drawing-section-title h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  margin-top: 4px;
}
.drawing-section-title p {
  max-width: 420px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}
.drawing-chapter-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.drawing-chapter-filter button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
}
.drawing-exercise-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
.drawing-exercise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}
.drawing-exercise-card {
  min-height: 236px;
  padding: 0 0 12px;
  border: 1px solid rgba(139,126,200,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.drawing-exercise-card:hover,
.drawing-exercise-card.active {
  transform: translateY(-2px);
  border-color: rgba(139,126,200,0.42);
  box-shadow: 0 12px 24px rgba(74, 63, 92, 0.09);
}
.drawing-exercise-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.drawing-exercise-card span,
.drawing-exercise-card strong,
.drawing-exercise-card em {
  display: block;
  margin-left: 12px;
  margin-right: 12px;
}
.drawing-exercise-card span {
  margin-top: 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.drawing-exercise-card strong {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.45;
}
.drawing-exercise-card em {
  margin-top: 5px;
  color: var(--text-light);
  font-size: 12px;
  font-style: normal;
}
.drawing-exercise-detail {
  position: sticky;
  top: 84px;
  border: 1px solid rgba(139,126,200,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.88);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(74, 63, 92, 0.07);
}
.drawing-detail-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.drawing-detail-copy {
  padding: 18px;
}
.drawing-detail-copy h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.35;
  margin: 7px 0 12px;
}
.drawing-detail-copy p,
.drawing-detail-copy li {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.75;
}
.drawing-detail-copy p {
  margin-bottom: 10px;
}
.drawing-detail-copy strong {
  color: var(--text);
}
.drawing-detail-copy ol {
  padding-left: 20px;
  margin-top: 12px;
}
.drawing-empty {
  padding: 20px;
}
.drawing-record-thumb,
.admin-drawing-thumb {
  display: block;
  width: 132px;
  aspect-ratio: 1180 / 680;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(139,126,200,0.12);
  background: #fffdf9;
}
.drawing-history-card {
  cursor: default;
}
.game-module-hero {
  max-width: 1120px;
  overflow: hidden;
  padding-bottom: 72px;
}
.game-module-copy {
  max-width: 760px;
  padding: 10px 4px 0;
  margin: 0 auto;
  text-align: center;
}
.game-module-copy h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.game-module-copy h2 {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 0;
}
.game-carousel-shell {
  position: relative;
  min-height: 420px;
  margin: 28px 0 18px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 24%, rgba(232, 200, 146, 0.2), transparent 26%),
    linear-gradient(135deg, #171526, #253b43 52%, #f5efe6);
  overflow: hidden;
}
.game-carousel {
  position: relative;
  height: 420px;
  perspective: 1200px;
}
.game-slide {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(520px, 54vw);
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #f8f1e7;
  box-shadow: 0 24px 54px rgba(20, 18, 32, 0.34);
  transform:
    translate(-50%, -50%)
    translateX(calc(var(--offset) * 230px))
    translateZ(calc((2 - var(--abs-offset)) * 22px))
    rotateY(calc(var(--offset) * -18deg))
    scale(calc(1 - var(--abs-offset) * 0.18));
  opacity: calc(1 - var(--abs-offset) * 0.22);
  z-index: var(--z-index);
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
}
.game-slide.active {
  box-shadow: 0 28px 70px rgba(20, 18, 32, 0.42);
}
.game-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-slide span {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(32, 25, 44, 0.12);
}
.game-nav-button {
  position: absolute;
  top: 50%;
  z-index: 20;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.78);
  color: var(--primary-dark);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: all var(--transition);
  box-shadow: 0 10px 28px rgba(30, 27, 42, 0.16);
}
.game-nav-button:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.04);
}
.game-nav-prev { left: 18px; }
.game-nav-next { right: 18px; }
.game-active-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 10px 4px 28px;
}
.game-active-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.game-active-panel h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.35;
  margin-bottom: 6px;
}
.game-active-panel p {
  margin: 0;
  max-width: 680px;
}

.spread-grid {
  display: block;
  margin-bottom: 60px;
}
.deck-switcher {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.deck-switcher::-webkit-scrollbar { display: none; }
.deck-tab {
  flex: 0 0 176px;
  width: 176px;
  min-height: 52px;
  text-align: center;
  border: 1.5px solid rgba(139, 126, 200, 0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  padding: 10px 17px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.deck-tab span {
  display: block;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  margin-bottom: 0;
}
.deck-tab strong {
  display: inline-block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 9px;
  line-height: 1;
}
.deck-tab.active {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: none;
}
.deck-tab:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}
.deck-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  margin-bottom: 28px;
  background:
    linear-gradient(135deg, rgba(232, 200, 146, 0.16), rgba(255,255,255,0) 48%),
    #fff;
  border: 1px solid rgba(139, 126, 200, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(74, 63, 92, 0.08);
}
.deck-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.deck-overview h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0;
}
.deck-overview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
}
.deck-overview-info {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  font-size: 11px;
}
.deck-overview p {
  color: var(--text-light);
  font-size: 14px;
}
.deck-preview {
  height: 150px;
  position: relative;
}
.deck-preview img {
  position: absolute;
  width: 82px;
  height: 118px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(74, 63, 92, 0.18);
  top: 15px;
}
.deck-preview img:nth-child(1) { right: 126px; transform: rotate(-8deg); }
.deck-preview img:nth-child(2) { right: 78px; transform: rotate(0deg); z-index: 2; }
.deck-preview img:nth-child(3) { right: 30px; transform: rotate(8deg); }
.spread-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.spread-card {
  background:
    linear-gradient(135deg, rgba(139, 126, 200, 0.06), rgba(255,255,255,0) 46%),
    #fff;
  border-radius: var(--radius-lg);
  padding: 32px; cursor: pointer;
  box-shadow: 0 10px 34px rgba(74, 63, 92, 0.08);
  transition: all var(--transition);
  border: 1.5px solid rgba(139, 126, 200, 0.08);
  position: relative; overflow: hidden;
}
.spread-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, var(--spread-a), transparent 32%),
    radial-gradient(circle at 100% 18%, var(--spread-b), transparent 30%),
    linear-gradient(135deg, var(--spread-c), transparent 58%);
  opacity: 1;
}
.spread-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--line-a), var(--line-b));
  opacity: 0.55;
}
.spread-card:nth-child(1) { --spread-a: rgba(139,126,200,0.13); --spread-b: rgba(107,155,197,0.08); --spread-c: rgba(255,255,255,0); --line-a: #B8AEE0; --line-b: #A6C9E6; }
.spread-card:nth-child(2) { --spread-a: rgba(212,165,116,0.12); --spread-b: rgba(212,137,155,0.08); --spread-c: rgba(255,255,255,0); --line-a: #E8C892; --line-b: #E3A8B6; }
.spread-card:nth-child(3) { --spread-a: rgba(107,155,197,0.12); --spread-b: rgba(139,184,155,0.09); --spread-c: rgba(255,255,255,0); --line-a: #9BC5E6; --line-b: #A8D4B7; }
.spread-card:nth-child(4) { --spread-a: rgba(212,137,155,0.11); --spread-b: rgba(139,126,200,0.09); --spread-c: rgba(255,255,255,0); --line-a: #E0A6B5; --line-b: #B8AEE0; }
.spread-card:nth-child(5) { --spread-a: rgba(139,184,155,0.12); --spread-b: rgba(212,165,116,0.08); --spread-c: rgba(255,255,255,0); --line-a: #A8D4B7; --line-b: #E8C892; }
.spread-card:nth-child(6) { --spread-a: rgba(184,174,224,0.11); --spread-b: rgba(232,200,146,0.08); --spread-c: rgba(255,255,255,0); --line-a: #C8BFEA; --line-b: #ECD6A8; }
.spread-card:nth-child(7) { --spread-a: rgba(107,155,197,0.10); --spread-b: rgba(212,165,116,0.09); --spread-c: rgba(255,255,255,0); --line-a: #A6C9E6; --line-b: #E8C892; }
.spread-card:nth-child(8) { --spread-a: rgba(139,184,155,0.10); --spread-b: rgba(212,137,155,0.08); --spread-c: rgba(255,255,255,0); --line-a: #A8D4B7; --line-b: #E3A8B6; }
.spread-card:nth-child(9) { --spread-a: rgba(139,126,200,0.10); --spread-b: rgba(139,184,155,0.08); --spread-c: rgba(255,255,255,0); --line-a: #B8AEE0; --line-b: #A8D4B7; }
.spread-card:nth-child(10) { --spread-a: rgba(212,165,116,0.10); --spread-b: rgba(107,155,197,0.08); --spread-c: rgba(255,255,255,0); --line-a: #E8C892; --line-b: #A6C9E6; }
.money-spread {
  background:
    linear-gradient(135deg, rgba(212,165,116,0.11), rgba(139,184,155,0.06) 54%),
    #fff;
}
.spread-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 38px rgba(74, 63, 92, 0.13);
  border-color: rgba(139, 126, 200, 0.18);
}
.spread-card-icon { font-size: 36px; margin-bottom: 12px; display: block; }
.spread-card > * {
  position: relative;
  z-index: 1;
}
.spread-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.spread-card h3 {
  font-family: var(--font-serif); font-size: 19px; font-weight: 600;
  margin-bottom: 0;
  line-height: 1.45;
}
.spread-card p { font-size: 13px; color: var(--text-light); margin-bottom: 12px; line-height: 1.8; }
.spread-card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--primary);
}
.card-count-badge {
  font-size: 13px;
  line-height: 1.5;
  padding: 2px 8px;
  border-radius: 16px;
  background: rgba(139, 126, 200, 0.1);
  flex-shrink: 0;
  margin-top: 2px;
}
.spread-position-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.position-mini {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 12px;
  color: var(--text-light);
}
.position-mini span {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139, 126, 200, 0.1);
  color: var(--primary-dark);
  font-weight: 600;
}
.position-mini strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}
.position-mini em {
  display: block;
  font-style: normal;
  line-height: 1.5;
  margin-top: 2px;
}

/* ── Recent readings on dashboard ─────────────────────── */
.recent-readings h2 {
  font-family: var(--font-serif); font-size: 22px; font-weight: 600;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(139, 126, 200, 0.1);
}
.recent-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: #fff;
  border-radius: var(--radius); margin-bottom: 12px;
  box-shadow: 0 2px 10px var(--shadow);
  cursor: pointer; transition: all var(--transition);
}
.recent-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 15px var(--shadow-lg);
}
.recent-item-info h4 { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.recent-item-info span { font-size: 12px; color: var(--text-light); }
.recent-item-arrow { color: var(--text-light); font-size: 18px; }

/* ── Spread Page ──────────────────────────────────────── */
#page-spread.active { padding-top: calc(var(--app-chrome-height) + 8px); min-height: 100vh; }
.spread-step { animation: fadeInUp 0.5s ease; }

body.draw-mode #page-spread.active {
  padding-top: var(--app-chrome-height);
}
body.draw-mode .chat-panel {
  margin-top: 0;
}

.spread-intro { text-align: center; padding: 40px 0; }
.spread-intro h1 {
  font-family: var(--font-serif); font-size: 30px; font-weight: 700;
  margin-bottom: 16px;
}
.spread-description {
  font-size: 16px; color: var(--text-light);
  max-width: 600px; margin: 0 auto 32px; line-height: 1.9;
}
.spread-positions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin-bottom: 36px;
}
.position-tag {
  padding: 8px 20px; background: rgba(139, 126, 200, 0.08);
  border-radius: 50px; font-size: 14px; color: var(--primary-dark);
}

/* ── Card Selection: Slot + Fan Layout ─────────────────── */
.selection-header { text-align: center; padding: 20px 0 12px; }
body.draw-mode .selection-header {
  padding: 4px 0 6px;
}
.selection-header h2 {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  margin-bottom: 6px;
}
.selection-count { font-size: 15px; color: var(--primary); font-weight: 500; }
.selection-actions {
  display: flex; justify-content: center; gap: 12px; margin-top: 12px;
}

/* Slots (top area) */
.card-slots {
  display: flex; justify-content: center; gap: 16px;
  padding: 18px 0 28px; flex-wrap: wrap;
}
body.draw-mode .card-slots {
  padding: 18px 0 28px;
}
.card-slot {
  width: 118px; height: 166px;
  border: 2px dashed rgba(139, 126, 200, 0.3);
  border-radius: 10px; position: relative;
  background: rgba(139, 126, 200, 0.04);
  transition: all 0.3s ease;
  padding: 42px 12px 12px;
  text-align: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-slot-number {
  position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139, 126, 200, 0.14);
  color: var(--primary-dark);
  font-size: 13px; font-weight: 600;
}
.card-slot-title {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.card-slot-label {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--text-light); white-space: nowrap;
}
.card-slot.filled {
  border-color: transparent; background: none; padding: 0;
}
.card-slot.filled img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 8px; box-shadow: 0 4px 15px var(--shadow-lg);
}
.card-slot.filled .card-slot-number {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 2px 8px var(--shadow);
}
.card-slot.filled .card-slot-title {
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  padding: 5px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px var(--shadow);
  font-size: 11px;
}

/* Fan area (bottom) */
.card-fan-wrapper {
  position: relative; width: 100%; height: 170px;
  margin: 18px auto 10px; overflow: visible;
}
body.draw-mode .card-fan-wrapper {
  height: 170px;
  margin: 18px auto 10px;
}
.card-fan {
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
}
.fan-card {
  position: absolute; width: 70px; height: 98px;
  transform-origin: 50% 135%;
  cursor: pointer;
  transition: margin-top 0.25s ease, filter 0.25s ease;
  border-radius: 7px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.fan-card img {
  width: 100%; height: 100%; object-fit: cover;
  pointer-events: none;
}
.fan-card:hover {
  margin-top: -18px;
  filter: brightness(1.1);
  z-index: 200 !important;
}
.fan-card.dealing {
  transition: all 0.55s cubic-bezier(.4,.0,.2,1);
  pointer-events: none;
}
.fan-card.disabled { opacity: 0.3; pointer-events: none; }

/* Fan entrance: cards fly in from below */
@keyframes fanIn {
  from { opacity: 0; transform: var(--fan-final) translateY(120px) scale(0.7); }
  to   { opacity: 1; transform: var(--fan-final); }
}

/* ── Spread Result Display ────────────────────────────── */
.spread-result-cards {
  display: flex; justify-content: center; gap: 20px;
  flex-wrap: wrap; padding: 16px 0 12px;
}
.spread-result-cards:empty { display: none; }
.spread-result-cards.sticky-spread {
  position: sticky;
  top: 64px;
  z-index: 20;
  background: rgba(255, 248, 240, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(139, 126, 200, 0.08);
}
.spread-result-cards.sticky-spread::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -12px;
  height: 12px;
  background: rgba(255, 248, 240, 0.96);
  backdrop-filter: blur(14px);
}
.spread-result-card {
  text-align: center; cursor: pointer;
  transition: transform 0.3s ease;
}
.spread-result-card img { cursor: zoom-in; }
.spread-result-card:hover { transform: translateY(-4px); }
.spread-result-card img {
  width: 100px; height: 140px; object-fit: cover;
  border-radius: 10px; box-shadow: 0 4px 18px var(--shadow-lg);
  border: 3px solid transparent; transition: border-color 0.3s ease;
}
.spread-result-card.active-card img { border-color: var(--primary); }
.spread-result-card .src-label {
  font-size: 12px; color: var(--text-light); margin-top: 8px;
  line-height: 1.4;
}
.spread-result-card .src-name {
  font-size: 13px; font-weight: 500; color: var(--text);
}
.spread-result-card .src-position {
  width: 130px;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-light);
}
.spread-result-card .src-position strong {
  display: block;
  color: var(--text);
  font-weight: 500;
}

/* Sequential question display */
.question-single {
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px; margin: 20px auto;
  box-shadow: 0 4px 20px var(--shadow);
  max-width: 640px;
  animation: fadeInUp 0.4s ease;
}
.question-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(139, 126, 200, 0.1);
}
.question-dots {
  display: flex; gap: 8px; justify-content: center;
  margin: 16px 0;
}
.q-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-warm); transition: background 0.3s ease;
}
.q-dot.done { background: var(--green); }
.q-dot.current { background: var(--primary); transform: scale(1.3); }

/* ── AI Chat ───────────────────────────────────────────── */
.ai-opening-card {
  max-width: 640px;
  margin: 0 auto 28px;
}
.chat-panel {
  max-width: 1120px;
  margin: 0 auto 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
.chat-session-header {
  display: none;
}
.chat-session-header h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.chat-session-header p {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.8;
  max-width: 680px;
  margin: 0 auto;
}
.chat-log {
  max-height: none;
  overflow: visible;
  padding: 4px 2px 14px;
}
.chat-message {
  display: flex;
  margin-bottom: 14px;
}
.chat-message.ai { justify-content: flex-start; }
.chat-message.user { justify-content: flex-end; }
.chat-bubble {
  max-width: min(78%, 520px);
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.75;
  box-shadow: 0 4px 18px rgba(74, 63, 92, 0.06);
}
.chat-message.ai .chat-bubble {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.chat-message.user .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  padding-top: 16px;
  border-top: none;
}
.chat-input-row textarea {
  flex: 1;
  min-height: 54px;
  max-height: 120px;
  resize: vertical;
  border: 1.5px solid #E8E2F0;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.chat-input-row textarea:focus { border-color: var(--primary-light); }
.history-chat-log {
  max-height: none;
  overflow: visible;
}
.embedded-draw {
  border-top: none;
  padding-top: 12px;
  margin-top: 6px;
}
body.draw-mode .embedded-draw {
  animation: fadeInUp 0.45s ease both;
}

body.chat-locked #page-spread {
  height: 100vh;
  overflow: hidden;
  padding-top: var(--app-chrome-height);
}
body.chat-locked #page-spread > .container {
  height: calc(100vh - var(--app-chrome-height));
  max-width: none;
  padding: 0;
}
body.chat-locked #spread-step-questions {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.chat-locked #spread-step-questions .chat-panel {
  height: 100%;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 4fr) minmax(0, 6fr);
  grid-template-rows: minmax(0, 1fr) auto auto;
  column-gap: 0;
  min-height: 0;
  overflow: hidden;
}
body.chat-locked #spread-step-questions .spread-result-cards {
  grid-column: 1;
  grid-row: 1 / 4;
  position: static;
  top: auto;
  z-index: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 132px));
  align-content: center;
  justify-items: center;
  gap: 26px 16px;
  align-items: start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px clamp(24px, 3vw, 48px);
  border-right: 1px solid rgba(139, 126, 200, 0.08);
  border-bottom: none;
  background: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
}
body.chat-locked #spread-step-questions .spread-result-cards.sticky-spread::before {
  content: none;
}
body.chat-locked #spread-step-questions .spread-result-cards::-webkit-scrollbar,
body.chat-locked #spread-step-questions .chat-log::-webkit-scrollbar,
body.chat-locked #spread-step-questions .chat-input-row textarea::-webkit-scrollbar {
  display: none;
}
body.chat-locked #spread-step-questions .spread-result-card {
  width: 132px;
  min-width: 0;
}
body.chat-locked #spread-step-questions .spread-result-card img {
  width: 112px;
  height: 156px;
}
body.chat-locked #spread-step-questions .spread-result-card .src-position {
  width: auto;
  max-width: 132px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 6px;
  line-height: 1.35;
}
body.chat-locked #spread-step-questions .chat-log {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: clamp(26px, 4vh, 42px) clamp(18px, 3vw, 48px) 18px clamp(24px, 4vw, 56px);
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.chat-locked #spread-step-questions .chat-input-row,
body.chat-locked #spread-step-questions .questions-actions {
  grid-column: 2;
  width: calc(100% - clamp(42px, 7vw, 104px));
  margin: 0 auto;
  margin-left: clamp(24px, 4vw, 56px);
  align-self: end;
  background: transparent;
}
body.chat-locked #spread-step-questions .chat-input-row {
  grid-row: 2;
  padding: 14px 0 8px;
  border-top: none;
}
body.chat-locked #spread-step-questions .chat-input-row textarea {
  min-height: 49px;
  height: 49px;
  max-height: 72px;
  padding: 10px 15px;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
body.chat-locked #spread-step-questions .chat-input-row .btn {
  min-height: 49px;
  padding: 11px 30px;
  box-shadow: none;
}
body.chat-locked #spread-step-questions .questions-actions {
  grid-row: 3;
  padding: 12px 0 8px;
}
body.chat-locked #spread-step-questions .chat-bubble {
  max-width: min(82%, 620px);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .review-banner {
    align-items: stretch;
    flex-direction: column;
    text-align: left;
  }

  .review-banner .btn {
    width: 100%;
    align-self: stretch;
  }

  .review-banner-main,
  .review-history-inline {
    width: 100%;
  }

  body.chat-locked #spread-step-questions .chat-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 304px minmax(0, 1fr) auto auto;
    column-gap: 0;
  }

  body.chat-locked #spread-step-questions .spread-result-cards {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    justify-content: center;
    justify-items: center;
    gap: 14px 12px;
    max-height: 304px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 4px 18px;
    border-right: none;
    border-bottom: 1px solid rgba(139, 126, 200, 0.06);
    background: rgba(255, 248, 240, 0.96);
  }

  body.chat-locked #spread-step-questions .chat-log {
    grid-column: 1;
    grid-row: 2;
    padding: 14px 10px 14px;
  }

  body.chat-locked #spread-step-questions .chat-input-row {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  body.chat-locked #spread-step-questions .questions-actions {
    grid-column: 1;
    grid-row: 4;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  body.chat-locked #spread-step-questions .spread-result-card {
    width: 100%;
    min-width: 0;
  }

  body.chat-locked #spread-step-questions .spread-result-card img {
    width: 68px;
    height: 96px;
  }

  body.chat-locked #spread-step-questions .spread-result-card .src-position {
    width: auto;
    max-width: 96px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Questions Step ───────────────────────────────────── */
.questions-container { padding: 20px 0; }
.question-block {
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px; margin-bottom: 24px;
  box-shadow: 0 4px 20px var(--shadow);
  animation: fadeInUp 0.5s ease;
}
.question-block:nth-child(2) { animation-delay: 0.1s; }
.question-block:nth-child(3) { animation-delay: 0.2s; }
.question-block:nth-child(4) { animation-delay: 0.3s; }
.question-block:nth-child(5) { animation-delay: 0.4s; }

.question-position {
  font-size: 12px; color: var(--primary); font-weight: 500;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}
.question-card-display {
  display: flex; justify-content: center; gap: 20px; align-items: flex-start;
  margin-bottom: 20px;
}
.question-card-img {
  width: 100px; height: 140px; object-fit: cover;
  border-radius: 8px; box-shadow: 0 4px 15px var(--shadow);
  flex-shrink: 0;
}
.question-card-info h3 {
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  margin-bottom: 4px;
}
.question-card-info .card-theme {
  font-size: 13px; color: var(--text-light); margin-bottom: 8px;
}
.question-card-info .card-desc {
  font-size: 14px; color: var(--text); line-height: 1.7;
}
.question-text {
  font-family: var(--font-serif); font-size: 16px;
  color: var(--text); margin-bottom: 12px; line-height: 1.7;
  padding-left: 16px;
  border-left: 3px solid var(--primary-light);
}
.questions-actions { text-align: center; padding: 20px 0 40px; }
.btn-loading { display: inline-flex; align-items: center; gap: 8px; }

/* ── Result ───────────────────────────────────────────── */
.result-header {
  text-align: center; padding: 30px 0 20px;
}
.result-header h2 {
  font-family: var(--font-serif); font-size: 26px; font-weight: 700;
  color: var(--primary-dark);
}
.result-cards {
  display: flex; justify-content: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 32px;
}
.result-card-thumb {
  text-align: center;
}
.result-card-thumb img {
  width: 90px; height: 126px; object-fit: cover;
  border-radius: 8px; box-shadow: 0 4px 15px var(--shadow);
}
.result-card-thumb .thumb-label {
  font-size: 11px; color: var(--text-light); margin-top: 6px;
}

.analysis-content {
  background: #fff; border-radius: var(--radius-lg);
  padding: 36px; box-shadow: 0 4px 20px var(--shadow);
  margin-bottom: 32px; line-height: 2;
}
.analysis-content h1, .analysis-content h2, .analysis-content h3 {
  font-family: var(--font-serif); color: var(--primary-dark);
  margin-top: 24px; margin-bottom: 12px;
}
.analysis-content h1 { font-size: 22px; }
.analysis-content h2 { font-size: 19px; }
.analysis-content h3 { font-size: 17px; }
.analysis-content p { margin-bottom: 12px; }
.analysis-content ul, .analysis-content ol {
  margin-left: 20px; margin-bottom: 12px;
}
.analysis-content li { margin-bottom: 6px; }
.analysis-content blockquote {
  border-left: 3px solid var(--primary-light);
  padding-left: 16px; color: var(--text-light);
  font-style: italic; margin: 16px 0;
}
.analysis-content strong { color: var(--primary-dark); }
.analysis-content em { color: var(--rose); }

.result-actions {
  display: flex; justify-content: center; gap: 16px;
  padding: 20px 0 60px;
}

/* ── History Page ─────────────────────────────────────── */
#page-history.active { padding-top: calc(var(--app-chrome-height) + 18px); min-height: 100vh; }
.history-title {
  font-family: var(--font-serif); font-size: 28px; font-weight: 700;
  text-align: center; padding-top: 40px; margin-bottom: 8px;
}
.history-subtitle {
  text-align: center; color: var(--text-light); font-size: 15px;
  padding-top: 24px; margin-bottom: 36px;
}
.history-list { padding-bottom: 60px; }
.history-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 26px;
  overflow-x: auto;
  padding: 0 0 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.history-filter-tabs::-webkit-scrollbar { display: none; }
.history-filter-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(139, 126, 200, 0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: var(--text-light);
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.history-filter-tab.active {
  background: #fff;
  border-color: rgba(139,126,200,0.34);
  color: var(--primary-dark);
  box-shadow: 0 5px 16px rgba(74, 63, 92, 0.08);
}
.review-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(139, 126, 200, 0.14);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 3px 15px var(--shadow);
}
.review-banner-main {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.review-banner h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.review-banner p {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.7;
}
.review-history-inline {
  position: relative;
  width: fit-content;
  margin-top: 12px;
}
.review-history-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.review-history-chevron {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
}
.review-history-trigger.active .review-history-chevron {
  transform: rotate(225deg);
}
.review-history-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(360px, calc(100vw - 56px));
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(139, 126, 200, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(76, 64, 112, 0.16);
}
.review-history-list {
  display: grid;
  gap: 8px;
}
.review-history-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(139, 126, 200, 0.14);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.review-history-list em {
  color: var(--text-light);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}
.history-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 16px;
  box-shadow: 0 3px 15px var(--shadow);
  cursor: pointer; transition: all var(--transition);
  display: flex; justify-content: space-between; align-items: center;
}
.history-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px var(--shadow-lg);
}
.history-card-info h3 {
  font-family: var(--font-serif); font-size: 17px; font-weight: 600;
  margin-bottom: 4px;
}
.history-card-meta {
  display: grid;
  justify-items: start;
  gap: 7px;
  font-size: 13px;
  color: var(--text-light);
}
.history-card-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(139, 126, 200, 0.14);
  background: rgba(139, 126, 200, 0.08);
  color: var(--primary-dark);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}
.history-card-meta em.pending {
  background: rgba(232, 200, 146, 0.14);
  color: var(--text-light);
}
.history-card-cards {
  display: flex; gap: 6px;
}
.history-mini-card {
  width: 36px; height: 50px; object-fit: cover;
  border-radius: 4px; box-shadow: 0 2px 6px var(--shadow);
}
.history-empty {
  text-align: center; padding: 60px 20px; color: var(--text-light);
}
.history-empty-icon { font-size: 48px; margin-bottom: 16px; display: block; opacity: 0.4; }

/* ── Reading Detail ───────────────────────────────────── */
#page-reading.active { padding-top: var(--app-chrome-height); min-height: 100vh; }
.reading-detail-header {
  text-align: center; padding: 20px 0;
}
.reading-detail-header h1 {
  font-family: var(--font-serif); font-size: 26px; font-weight: 700;
  margin-bottom: 6px;
}
.reading-detail-header .reading-date {
  font-size: 14px; color: var(--text-light);
}

.pending-report-card {
  text-align: center;
  padding: 32px 24px;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.pending-report-card h2 {
  color: var(--text);
  font-size: 22px;
  margin-bottom: 10px;
}

.pending-report-card p {
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto 22px;
  line-height: 1.8;
}

.review-source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 26px;
}
.review-source-list button {
  text-align: left;
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.review-source-list button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--shadow);
}
.review-source-list strong,
.review-source-list span {
  display: block;
}
.review-source-list span {
  color: var(--text-light);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Profile Page ─────────────────────────────────────── */
#page-profile.active { padding-top: var(--app-chrome-height); min-height: 100vh; }
.profile-card {
  max-width: 680px;
  margin: 0 auto 60px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 4px 20px var(--shadow);
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.credit-card { margin-bottom: 20px; }
.credit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.credit-header h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 4px;
}
.credit-header p { color: var(--text-light); font-size: 13px; }
.credit-header strong {
  font-size: 34px;
  color: var(--primary-dark);
  font-family: var(--font-serif);
}
.redeem-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.credit-transactions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.credit-transaction {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid rgba(139, 126, 200, 0.1);
  font-size: 13px;
  color: var(--text-light);
}
.credit-transaction strong { color: var(--text); }
.credit-transaction .plus { color: var(--green); }
.credit-transaction .minus { color: var(--rose); }

/* ── Admin Page ───────────────────────────────────────── */
.admin-body {
  min-height: 100vh;
  background: var(--bg);
}
.admin-login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.admin-login-card {
  width: min(440px, 100%);
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 56px);
  background: rgba(255, 248, 240, 0.94);
  border-bottom: 1px solid rgba(139, 126, 200, 0.1);
  backdrop-filter: blur(18px);
}
.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 28px clamp(20px, 3vw, 44px) 72px;
}
.admin-sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid rgba(139, 126, 200, 0.08);
  padding: 18px;
}
.admin-sidebar-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--primary-dark);
  font-weight: 700;
  padding: 6px 10px 14px;
}
.admin-menu {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 14px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}
.admin-menu:hover,
.admin-menu.active {
  background: rgba(139, 126, 200, 0.1);
  color: var(--primary-dark);
}
.admin-main {
  min-width: 0;
}
.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}
.admin-page-head h1 {
  font-family: var(--font-serif);
  color: var(--text);
  font-size: 28px;
  margin-bottom: 4px;
}
.admin-page-head p {
  color: var(--text-light);
  font-size: 14px;
}
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: fadeInUp 0.25s ease; }
#page-admin.active { padding-top: var(--app-chrome-height); min-height: 100vh; }
.admin-container { max-width: 1280px; padding-bottom: 80px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.admin-stat, .admin-section {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px var(--shadow);
  border: 1px solid rgba(139, 126, 200, 0.08);
}
.admin-stat {
  padding: 18px;
}
.admin-stat span {
  display: block;
  color: var(--text-light);
  font-size: 12px;
}
.admin-stat strong {
  display: block;
  font-family: var(--font-serif);
  color: var(--primary-dark);
  font-size: 24px;
  margin-top: 4px;
}
.admin-section {
  padding: 24px;
  margin-bottom: 20px;
}
.admin-section-head {
  margin-bottom: 16px;
}
.admin-section h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 4px;
}
.admin-section p {
  color: var(--text-light);
  font-size: 13px;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.admin-toolbar input,
.admin-form-grid input,
.admin-form-grid select {
  width: min(360px, 100%);
  padding: 11px 14px;
  border: 1.5px solid #E8E2F0;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 248, 240, 0.72);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.admin-form-grid input,
.admin-form-grid select {
  width: 100%;
}
.admin-toolbar input:focus,
.admin-form-grid input:focus,
.admin-form-grid select:focus {
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(139, 126, 200, 0.08);
}
.admin-spread-editor {
  text-align: left;
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th, .admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(139, 126, 200, 0.1);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.admin-table th {
  color: var(--primary-dark);
  font-weight: 600;
  background: rgba(139, 126, 200, 0.06);
}
.admin-mini-btn {
  border: none;
  background: rgba(139, 126, 200, 0.1);
  color: var(--primary-dark);
  border-radius: 16px;
  padding: 5px 10px;
  cursor: pointer;
  margin-right: 6px;
}
.admin-mini-btn.danger {
  color: var(--rose);
  background: rgba(212, 137, 155, 0.1);
}
.voucher-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  color: var(--text);
}
.admin-copy-btn {
  border: none;
  background: rgba(139, 126, 200, 0.1);
  color: var(--primary-dark);
  border-radius: 14px;
  padding: 4px 9px;
  cursor: pointer;
  margin-left: 8px;
  font-size: 12px;
}
.admin-copy-btn:hover {
  background: rgba(139, 126, 200, 0.18);
}
.admin-settings { max-width: 900px; }
.admin-form-modal-card {
  width: min(460px, 94vw);
  text-align: left;
}
.admin-form-modal-card h2,
.admin-modal-head h2 {
  font-family: var(--font-serif);
  color: var(--primary-dark);
  font-size: 24px;
  margin-bottom: 6px;
}
.admin-form-modal-card p,
.admin-modal-head p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 18px;
}
.admin-spread-modal-card {
  width: min(920px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  text-align: left;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.admin-spread-modal-card .admin-spread-editor {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}
.admin-modal-sticky-head {
  position: relative;
  flex: 0 0 auto;
  padding: 28px 34px 14px;
  border-bottom: 1px solid rgba(139, 126, 200, 0.1);
  background: #fff;
}
.admin-modal-sticky-head .modal-close {
  top: 22px;
  right: 24px;
}
.admin-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 34px 4px;
}
.admin-modal-foot {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 34px 22px;
  border-top: 1px solid rgba(139, 126, 200, 0.1);
  background: rgba(255, 255, 255, 0.96);
}
.admin-modal-foot .form-success,
.admin-modal-foot .form-error {
  margin-bottom: 0;
}
.admin-reading-modal-card {
  width: min(1120px, 96vw);
  max-height: 88vh;
  overflow: auto;
  text-align: left;
}
.admin-reading-head h2 {
  font-family: var(--font-serif);
  color: var(--primary-dark);
  font-size: 24px;
  margin-bottom: 4px;
}
.admin-reading-head p {
  color: var(--text-light);
  margin-bottom: 16px;
}
.admin-reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.admin-reading-meta span {
  background: rgba(139, 126, 200, 0.08);
  color: var(--text-light);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
}
.admin-reading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}
.admin-reading-actions span {
  color: var(--text-light);
  font-size: 12px;
}
.admin-reading-modal-card h3 {
  font-family: var(--font-serif);
  color: var(--text);
  margin: 22px 0 12px;
}
.admin-reading-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
}
.admin-reading-subhead h3 {
  margin: 0;
}
.admin-reading-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.admin-reading-card {
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 248, 240, 0.52);
}
.admin-reading-card img {
  width: 52px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  float: left;
  margin-right: 10px;
}
.admin-reading-card strong,
.admin-reading-card span {
  display: block;
}
.admin-reading-card span,
.admin-reading-card p {
  color: var(--text-light);
  font-size: 12px;
}
.admin-reading-chat {
  display: grid;
  gap: 10px;
}
.admin-reading-message {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(139, 126, 200, 0.08);
}
.admin-reading-message.user {
  background: rgba(232, 200, 146, 0.18);
}
.admin-reading-message p,
.admin-reading-report {
  color: var(--text);
  line-height: 1.8;
}
.admin-reading-report {
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 12px;
  padding: 16px;
  background: rgba(255,255,255,0.7);
}
.admin-ai-request {
  display: grid;
  gap: 10px;
}
.admin-prompt-block {
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
  overflow: hidden;
}
.admin-prompt-block summary {
  padding: 12px 14px;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 600;
}
.admin-prompt-block pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-top: 1px solid rgba(139, 126, 200, 0.1);
  color: var(--text);
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Yi Xin coin casting ───────────────────────────────── */
.coin-cast-modal-card {
  width: min(680px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  text-align: center;
}
.coin-cast-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 26px 30px 14px;
}
.coin-cast-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--primary-dark);
  margin: 4px 0 8px;
}
.coin-cast-header p {
  color: var(--text-light);
  font-size: 14px;
}
.coin-cast-body {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 30px 18px;
}
.coin-cast-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 30px 22px;
  border-top: 1px solid rgba(139, 126, 200, 0.12);
  background: rgba(255, 255, 255, 0.92);
}
.coin-stage {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding-top: 8px;
}
.coin {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid #b89457;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.72), transparent 24%),
    radial-gradient(circle at 50% 56%, #edcf85 0%, #d6a94f 58%, #9e7131 100%);
  color: #67451f;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 5px rgba(255, 240, 184, 0.42),
    inset 0 0 0 10px rgba(142, 97, 38, 0.16),
    0 10px 22px rgba(107, 95, 168, 0.18);
  text-shadow: 0 1px 0 rgba(255,255,255,0.42);
  overflow: hidden;
  isolation: isolate;
}
.coin::before {
  content: '';
  position: absolute;
  inset: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 3px;
  background: #fffaf2;
  border: 3px solid rgba(125, 82, 30, 0.44);
  box-shadow:
    inset 0 2px 5px rgba(74, 63, 92, 0.16),
    0 0 0 2px rgba(255,255,255,0.2);
  z-index: 0;
  pointer-events: none;
}
.coin::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(105, 70, 27, 0.3);
  pointer-events: none;
  z-index: 1;
}
.coin.flipping {
  animation: coinFlip 0.55s ease;
}
@keyframes coinFlip {
  0% { transform: rotateY(0) translateY(0); }
  45% { transform: rotateY(540deg) translateY(-8px); }
  100% { transform: rotateY(720deg) translateY(0); }
}
.coin-progress {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  color: var(--text-light);
  font-size: 14px;
}
.coin-progress strong {
  color: var(--primary-dark);
}
.hexagram-preview,
.hexagram-history {
  display: grid;
  gap: 16px;
}
.hex-lines {
  display: grid;
  gap: 8px;
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.74);
}
.hex-lines p {
  text-align: center;
  color: var(--text-light);
}
.hex-line {
  display: grid;
  grid-template-columns: 64px 1fr 86px;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.hex-line span,
.hex-line em {
  font-style: normal;
  font-size: 13px;
  color: var(--text-light);
}
.hex-line b {
  width: 184px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-self: center;
}
.hex-line b i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--primary-dark);
}
.hex-line.yang b i {
  width: 184px;
}
.hex-line.yin b i {
  width: 76px;
}
.hex-line.changing b i {
  background: var(--accent);
}
.hex-line.changing em {
  color: var(--accent);
}
.hex-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(680px, 100%);
  margin: 0 auto;
}
.hex-summary div {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(139, 126, 200, 0.12);
  background: rgba(255,255,255,0.72);
  text-align: center;
}
.hex-summary span,
.hex-summary em {
  display: block;
  color: var(--text-light);
  font-size: 12px;
  font-style: normal;
}
.hex-summary strong {
  display: block;
  margin: 4px 0;
  color: var(--primary-dark);
  font-family: var(--font-serif);
  font-size: 22px;
}
.history-hex-lines {
  margin-bottom: 28px;
}

/* ── Page transitions ─────────────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadeInUp 0.4s ease; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Loading spinner ──────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ── Glass healing space ─────────────────────────────── */
.glass-panel {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.module-page-heading {
  margin: 0 0 24px;
}
.module-page-heading > span {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.module-page-heading h1 {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.22;
  font-weight: 600;
}
.module-page-heading p {
  margin-top: 7px;
  max-width: 620px;
  color: var(--text-light);
  font-size: 13px;
}

.drawing-hub-shell {
  justify-content: flex-start;
}
.drawing-entry-card {
  min-height: 300px;
  padding: 28px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.drawing-entry-card::before {
  content: '';
  display: none;
  position: absolute;
  inset: 42% 0 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  opacity: 0.38;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%);
  mask-image: linear-gradient(to bottom, transparent, #000 35%);
}
.drawing-entry-card span,
.drawing-entry-card strong,
.drawing-entry-card em {
  position: relative;
  z-index: 1;
}

.game-module-hero {
  max-width: none;
  overflow: visible;
  padding-bottom: 54px;
}
.game-page-heading { margin-bottom: 22px; }
.game-showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}
.game-feature-card {
  min-height: 520px;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.game-feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(49,44,65,0.70), rgba(58,50,76,0.21) 64%, transparent);
}
.game-feature-card > img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
}
.game-feature-copy {
  width: min(480px, 62%);
  padding: clamp(34px, 5vw, 66px);
  position: relative;
  z-index: 1;
  color: #fff;
}
.game-feature-copy > span {
  display: inline-flex;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  font-size: 11px;
}
.game-feature-copy h2 {
  margin: 24px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.2;
}
.game-feature-copy p {
  color: rgba(255,255,255,0.84);
  font-size: 13px;
  line-height: 1.8;
}
.game-feature-copy .btn {
  margin-top: 30px;
  padding: 11px 22px;
  border: 1px solid rgba(255,255,255,0.42);
  background: rgba(143,130,201,0.88);
  box-shadow: none;
}
.game-feature-copy .btn i { font-style: normal; }
.game-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.game-library-card {
  min-height: 0;
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  color: #fff;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition);
}
.game-library-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(75, 66, 110, 0.15);
}
.game-library-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(36,32,48,0.76), rgba(49,44,65,0.08) 72%);
}
.game-library-card img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: -2;
  object-fit: cover;
}
.game-library-card > span,
.game-library-card > strong,
.game-library-card > em {
  display: block;
  position: relative;
  z-index: 1;
}
.game-library-card > span {
  margin: 92px 18px 5px;
  color: rgba(255,255,255,0.70);
  font-size: 9px;
}
.game-library-card > strong {
  margin: 0 18px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}
.game-library-card > em {
  margin: 6px 42px 17px 18px;
  color: rgba(255,255,255,0.74);
  font-size: 10px;
  line-height: 1.55;
  font-style: normal;
}
.game-library-card > i {
  width: 28px;
  height: 28px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.68);
  color: var(--primary-dark);
  font-style: normal;
}

.game-flat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.game-flat-card {
  min-width: 0;
  padding: 10px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.70);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.game-flat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(143, 130, 201, 0.30);
  box-shadow: 0 22px 50px rgba(89, 76, 132, 0.13);
}
.game-flat-cover {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: rgba(235, 230, 246, 0.72);
}
.game-flat-cover::after {
  content: '';
  position: absolute;
  inset: 54% 0 0;
  background: linear-gradient(to top, rgba(34, 30, 47, 0.22), transparent);
  pointer-events: none;
}
.game-flat-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.game-flat-cover b {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 999px;
  background: rgba(255,255,255,0.74);
  color: var(--primary-dark);
  backdrop-filter: blur(14px);
  font-size: 10px;
  font-weight: 600;
}
.game-flat-copy {
  min-height: 138px;
  padding: 16px 10px 13px;
  display: block;
  position: relative;
}
.game-flat-copy em,
.game-flat-copy strong,
.game-flat-copy small { display: block; }
.game-flat-copy em {
  color: var(--primary-dark);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.game-flat-copy strong {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 600;
}
.game-flat-copy small {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#page-home.active {
  min-height: 100vh;
  padding-top: calc(var(--main-nav-height) + 24px);
}
.healing-home-shell {
  width: min(1440px, calc(100% - 56px));
  margin: 0 auto;
  padding: 12px 0 56px;
}
.healing-home-header {
  margin-bottom: 26px;
}
.healing-home-header > span,
.home-card-kicker {
  display: block;
  color: var(--primary-dark);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.healing-home-header h1 {
  margin-top: 0;
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.healing-home-header p {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 14px;
}
.healing-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.7fr) minmax(220px, 0.7fr);
  grid-template-areas:
    'continue status streak'
    'continue today today'
    'records library library'
    'recommend recommend recommend';
  gap: 18px;
}
.healing-home-grid > .glass-panel,
.home-recommendation {
  border-radius: 26px;
}
.home-continue-card {
  grid-area: continue;
  min-height: 408px;
  padding: clamp(28px, 4vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.9fr);
  align-items: center;
  gap: 24px;
  overflow: hidden;
  position: relative;
}
.home-continue-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 76%, rgba(242, 200, 177, 0.30), transparent 36%),
    radial-gradient(circle at 72% 20%, rgba(181, 167, 225, 0.27), transparent 40%);
  pointer-events: none;
}
.home-card-copy,
.home-card-preview {
  position: relative;
  z-index: 1;
}
.home-card-copy h2 {
  margin: 14px 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.25;
  font-weight: 600;
  white-space: nowrap;
}
.home-card-copy p {
  max-width: 340px;
  color: var(--text-light);
  font-size: 14px;
}
.home-card-copy .btn {
  margin-top: 30px;
  border-radius: 14px;
  padding: 11px 24px;
  background: rgba(112, 97, 178, 0.88);
  box-shadow: 0 12px 26px rgba(99, 84, 163, 0.18);
}
.home-card-preview {
  min-height: 258px;
}
.home-card-preview img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 126px;
  aspect-ratio: 0.72;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.9);
  border-radius: 15px;
  box-shadow: 0 22px 38px rgba(69, 60, 95, 0.16);
}
.home-card-preview img:nth-child(1) { transform: translate(-92%, -47%) rotate(-10deg); }
.home-card-preview img:nth-child(2) { transform: translate(-50%, -55%); z-index: 2; }
.home-card-preview img:nth-child(3) { transform: translate(-8%, -47%) rotate(10deg); }
.home-status-card,
.home-streak-card {
  min-height: 202px;
  padding: 24px;
}
.home-status-card { grid-area: status; text-align: center; }
.home-streak-card { grid-area: streak; }
.home-status-orb {
  width: 72px;
  height: 72px;
  margin: 16px auto 12px;
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 32%, rgba(255,255,255,0.96), transparent 28%),
    linear-gradient(135deg, rgba(244,198,164,0.82), rgba(177,161,225,0.78));
  box-shadow: 0 12px 30px rgba(116, 99, 163, 0.18), inset 0 0 24px rgba(255,255,255,0.6);
}
.home-status-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
}
.home-status-card p,
.home-streak-card p {
  margin-top: 6px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.65;
}
.home-streak-card > strong {
  display: block;
  margin: 10px 0 2px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 500;
}
.home-streak-card > strong b {
  margin-right: 3px;
  font-size: 42px;
  line-height: 1;
  font-weight: 500;
}
.home-streak-dots {
  display: flex;
  gap: 7px;
  margin-top: 18px;
}
.home-streak-dots i {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(103,92,158,0.28);
  border-radius: 50%;
}
.home-streak-dots i.is-filled {
  border-color: var(--primary);
  background: var(--primary);
}
.home-today-card {
  grid-area: today;
  min-height: 174px;
  padding: 18px;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.home-today-card:hover,
.home-recommendation:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 58px rgba(75, 66, 110, 0.14);
}
.home-today-art {
  height: 138px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(70,57,97,0.12)),
    radial-gradient(circle at 72% 30%, rgba(245,212,159,0.9), transparent 24%),
    radial-gradient(circle at 34% 70%, rgba(138,176,153,0.76), transparent 29%),
    linear-gradient(135deg, #dfd7ef, #f4d8c4);
}
.home-today-card h2,
.home-section-heading h2 {
  margin-top: 5px;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
}
.home-today-card p {
  margin-top: 7px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.7;
}
.home-inline-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.64);
  color: var(--primary-dark);
}
.home-records-card {
  grid-area: records;
  padding: 26px;
}
.home-thinking-emotion {
  grid-area: library;
  padding: 26px;
}
.home-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.home-section-heading > button {
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
}
.home-library-note {
  padding: 5px 10px;
  border: 1px solid rgba(143,130,201,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.44);
  color: var(--text-light);
  font-size: 10px;
  white-space: nowrap;
}
.home-records-list {
  display: grid;
}
.home-record-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border: 0;
  border-top: 1px solid rgba(111, 99, 150, 0.10);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.home-record-mark {
  width: 34px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(191,181,228,0.72), rgba(240,211,190,0.74));
}
.home-record-row strong,
.home-record-row small {
  display: block;
}
.home-record-row strong { font-size: 13px; font-weight: 500; }
.home-record-row small { color: var(--text-light); font-size: 10px; }
.home-record-row i { color: var(--primary); font-style: normal; }
.home-empty-copy {
  padding: 22px 0;
  color: var(--text-light);
  font-size: 12px;
}
.home-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.home-library-entry {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 18px;
  background: rgba(255,255,255,0.34);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.home-library-entry:hover,
.home-library-entry:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(143,130,201,0.28);
  background: rgba(255,255,255,0.56);
}
.home-library-entry img {
  width: 84px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}
.home-library-entry strong,
.home-library-entry span { display: block; }
.home-library-entry strong {
  font-family: var(--font-serif);
  font-size: 16px;
}
.home-library-entry span {
  margin-top: 5px;
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.6;
}
.home-recommendations { grid-area: recommend; padding-top: 10px; }
.home-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.home-recommendation {
  min-height: 142px;
  padding: 22px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.home-recommendation-index {
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}
.home-recommendation h3 {
  margin: 7px 0 5px;
  font-family: var(--font-serif);
  font-size: 18px;
}
.home-recommendation p { color: var(--text-light); font-size: 12px; }

/* ── Personal healing home: calm glass dashboard ─────── */
.home-welcome-hero {
  position: relative;
  min-height: 238px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: clamp(34px, 4vw, 58px);
  border-radius: 28px;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 222, 198, 0.42), transparent 34%),
    radial-gradient(circle at 72% 24%, rgba(199, 186, 235, 0.42), transparent 40%),
    radial-gradient(circle at 58% 96%, rgba(255, 255, 255, 0.76), transparent 46%),
    rgba(255, 255, 255, 0.42);
}
.home-welcome-hero::before,
.home-welcome-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}
.home-welcome-hero::before {
  width: 310px;
  height: 126px;
  right: 19%;
  bottom: -52px;
  background: rgba(255, 245, 237, 0.64);
  box-shadow: 160px -22px 0 rgba(236, 226, 249, 0.48);
}
.home-welcome-hero::after {
  width: 180px;
  height: 180px;
  right: 4%;
  top: -88px;
  background: rgba(222, 211, 245, 0.36);
}
.home-welcome-copy,
.home-hero-scene {
  position: relative;
  z-index: 1;
}
.home-welcome-copy h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(32px, 3.4vw, 46px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.home-welcome-copy p {
  margin-top: 16px;
  color: var(--primary-dark);
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.5;
}
.home-hero-scene {
  min-height: 166px;
}
.home-hero-arch {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 112px;
  height: 148px;
  transform: translateX(-50%);
  border: 3px solid rgba(255, 255, 255, 0.84);
  border-bottom-width: 7px;
  border-radius: 999px 999px 22px 22px;
  box-shadow: 0 18px 44px rgba(95, 82, 142, 0.10), inset 0 0 24px rgba(255,255,255,0.42);
}
.home-hero-orb {
  position: absolute;
  left: 50%;
  bottom: 24px;
  width: 58px;
  height: 58px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,0.92);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.98), transparent 30%),
    linear-gradient(145deg, rgba(248,210,174,0.82), rgba(183,165,225,0.80));
  box-shadow: 0 16px 34px rgba(103, 87, 161, 0.16), inset 0 0 18px rgba(255,255,255,0.72);
}
.home-hero-sprig {
  position: absolute;
  right: 8%;
  bottom: 20px;
  width: 2px;
  height: 104px;
  transform: rotate(8deg);
  border-radius: 999px;
  background: rgba(111, 131, 94, 0.38);
}
.home-hero-sprig i {
  position: absolute;
  width: 28px;
  height: 13px;
  border-radius: 100% 0 100% 0;
  background: rgba(145, 163, 122, 0.36);
}
.home-hero-sprig i:nth-child(1) { top: 12px; right: 1px; transform: rotate(12deg); }
.home-hero-sprig i:nth-child(2) { top: 36px; left: 2px; transform: rotate(168deg); }
.home-hero-sprig i:nth-child(3) { top: 61px; right: 1px; transform: rotate(8deg); }
.home-hero-sprig i:nth-child(4) { top: 82px; left: 1px; transform: rotate(170deg); }

.home-tools-panel {
  margin-top: 18px;
  padding: 26px;
  border-radius: 28px;
}
.home-tools-panel .home-section-heading {
  margin-bottom: 16px;
}
.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.home-tool-card {
  min-width: 0;
  min-height: 178px;
  display: grid;
  grid-template-rows: 84px auto auto;
  align-content: start;
  justify-items: start;
  gap: 7px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 20px;
  background: rgba(255,255,255,0.36);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(76,66,112,0.06);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.home-tool-card:hover,
.home-tool-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(143,130,201,0.30);
  background: rgba(255,255,255,0.58);
}
.home-tool-card strong {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}
.home-tool-card small {
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.55;
}
.home-tool-visual {
  position: relative;
  width: 100%;
  height: 78px;
  overflow: hidden;
  border-radius: 15px;
  background:
    radial-gradient(circle at 68% 28%, rgba(255,255,255,0.76), transparent 25%),
    linear-gradient(135deg, var(--tool-a), var(--tool-b));
}
.home-tool-card--notice { --tool-a: rgba(213,202,239,0.66); --tool-b: rgba(245,219,205,0.58); }
.home-tool-card--breathe { --tool-a: rgba(248,218,211,0.66); --tool-b: rgba(234,220,246,0.58); }
.home-tool-card--draw { --tool-a: rgba(213,227,244,0.66); --tool-b: rgba(229,217,239,0.58); }
.home-tool-card--story { --tool-a: rgba(222,235,216,0.66); --tool-b: rgba(246,225,198,0.58); }
.home-tool-card--notice .home-tool-visual i {
  position: absolute;
  bottom: 13px;
  width: 32px;
  height: 44px;
  border: 2px solid rgba(99,88,145,0.38);
  border-radius: 999px 999px 12px 12px;
}
.home-tool-card--notice .home-tool-visual i:nth-child(1) { left: 24%; transform: rotate(-10deg); }
.home-tool-card--notice .home-tool-visual i:nth-child(2) { left: calc(50% - 16px); height: 52px; }
.home-tool-card--notice .home-tool-visual i:nth-child(3) { right: 24%; transform: rotate(10deg); }
.home-tool-card--breathe .home-tool-visual i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid rgba(167,104,119,0.26);
  border-radius: 50% 50% 8px 50%;
  box-shadow: 18px -18px 0 rgba(255,255,255,0.25), -18px 18px 0 rgba(255,255,255,0.20);
}
.home-tool-card--draw .home-tool-visual i:first-child {
  position: absolute;
  left: 22%;
  right: 22%;
  top: 24px;
  height: 24px;
  border-bottom: 3px solid rgba(84,112,153,0.34);
  border-radius: 50%;
  transform: rotate(-8deg);
}
.home-tool-card--draw .home-tool-visual i:last-child {
  position: absolute;
  width: 13px;
  height: 56px;
  right: 29%;
  top: 9px;
  transform: rotate(28deg);
  border-radius: 999px;
  background: rgba(90,77,129,0.34);
}
.home-tool-card--story .home-tool-visual i {
  position: absolute;
  left: 50%;
  top: 15px;
  width: 58px;
  height: 48px;
  transform: translateX(-50%);
  border: 2px solid rgba(89,112,76,0.30);
  border-radius: 8px 8px 22px 22px;
  box-shadow: 10px 7px 0 rgba(255,255,255,0.24);
}
.home-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}
.home-lower-grid .home-records-card,
.home-content-library {
  grid-area: auto;
  min-height: 260px;
  padding: 26px;
  border-radius: 28px;
}
.home-content-library .home-library-entry {
  min-height: 112px;
  padding: 12px;
}
.home-content-library .home-library-entry img {
  height: 86px;
}

.content-library-container {
  width: 100%;
  max-width: none;
  padding: 0;
}
.content-library-shell {
  width: 100%;
  min-height: calc(100svh - var(--app-chrome-height) - 36px);
  padding: 28px;
  border-radius: 28px;
}
.content-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.content-library-header span {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.content-library-header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.2;
  font-weight: 600;
}
.content-library-header p {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.7;
}
.content-library-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 15px;
  background: rgba(255,255,255,0.42);
}
.content-library-tabs button {
  min-height: 38px;
  padding: 7px 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-light);
  font-family: var(--font-sans);
  cursor: pointer;
}
.content-library-tabs button.active {
  background: linear-gradient(135deg, rgba(156,144,215,0.92), rgba(111,99,171,0.95));
  color: #fff;
}
.content-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 18px;
}
.content-library-card {
  min-width: 0;
  overflow: hidden;
  padding: 9px 9px 12px;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 19px;
  background: rgba(255,255,255,0.48);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: zoom-in;
  box-shadow: 0 12px 28px rgba(75,66,110,0.07);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.content-library-card:hover,
.content-library-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(143,130,201,0.26);
  box-shadow: 0 18px 38px rgba(75,66,110,0.12);
}
.content-library-image {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(255,253,250,0.78);
}
.content-library-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.content-library-card-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 11px 4px 0;
}
.content-library-card-copy small {
  color: var(--primary);
  font-size: 10px;
}
.content-library-card-copy strong {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-library-status {
  grid-column: 1 / -1;
  padding: 72px 20px;
  color: var(--text-light);
  text-align: center;
}

.card-page-heading {
  margin: 4px 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-page-heading span {
  display: block;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.card-page-heading h1 {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.25;
  font-weight: 600;
}
.card-page-info {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  font-size: 14px;
}
.card-page-heading h1,
.module-page-heading h1 {
  font-size: 40px;
}
.deck-switcher.glass-panel {
  justify-content: stretch;
  gap: 4px;
  margin-bottom: 22px;
  padding: 5px;
  border-radius: 20px;
}
.deck-switcher.glass-panel .deck-tab {
  flex: 1 1 0;
  width: auto;
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: transparent;
}
.deck-switcher.glass-panel .deck-tab:hover:not(:disabled) {
  background: rgba(139,126,200,0.09);
}
.deck-switcher.glass-panel .deck-tab.active {
  background: linear-gradient(135deg, rgba(151,136,211,0.90), rgba(116,101,177,0.88));
  color: #fff;
  box-shadow: 0 10px 28px rgba(98,82,162,0.16);
}
.deck-overview.glass-panel {
  min-height: 310px;
  grid-template-columns: minmax(0, 1fr) 42%;
  padding: clamp(32px, 5vw, 64px);
  background:
    radial-gradient(circle at 18% 70%, rgba(192,178,229,0.24), transparent 38%),
    radial-gradient(circle at 82% 34%, rgba(246,203,171,0.25), transparent 40%),
    var(--glass-surface);
  border-radius: 28px;
  box-shadow: var(--glass-shadow);
}
.deck-overview.glass-panel h2 { font-size: 40px; }
.deck-overview.glass-panel p { max-width: 540px; font-size: 14px; }
.deck-overview.glass-panel .deck-preview { height: 220px; }
.deck-overview.glass-panel .deck-preview img {
  width: 126px;
  height: 182px;
  border: 3px solid rgba(255,255,255,0.88);
  border-radius: 15px;
  box-shadow: 0 22px 38px rgba(69,60,95,0.16);
  top: 18px;
}
.deck-overview.glass-panel .deck-preview img:nth-child(1) { right: 50%; transform: translateX(-18%) rotate(-9deg); }
.deck-overview.glass-panel .deck-preview img:nth-child(2) { right: 50%; transform: translateX(50%); }
.deck-overview.glass-panel .deck-preview img:nth-child(3) { right: 50%; transform: translateX(118%) rotate(9deg); }
.spread-grid-inner { gap: 18px; }
.spread-card.glass-panel {
  min-height: 310px;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 0%, var(--spread-a), transparent 34%),
    radial-gradient(circle at 100% 22%, var(--spread-b), transparent 32%),
    var(--glass-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.spread-card.glass-panel::after { display: none; }

@media (min-width: 769px) {
  body.app-shell-active {
    --main-nav-height: 0px;
    --app-chrome-height: 0px;
    height: 100vh;
    overflow: hidden;
  }
  body.app-shell-active.page-context-nested {
    --page-context-height: 58px;
    --app-chrome-height: 70px;
  }
  body.app-shell-active #main-nav {
    top: 16px;
    left: 16px;
    right: auto;
    width: var(--sidebar-width);
    height: calc(100vh - 32px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    background: var(--glass-surface);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    overflow: visible;
  }
  body.app-shell-active .nav-inner {
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 24px 14px 16px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 24px;
  }
  body.app-shell-active .nav-logo {
    padding: 4px 8px 14px;
    font-size: 17px;
  }
  body.app-shell-active .nav-links {
    width: 100%;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    overflow: visible;
  }
  body.app-shell-active .nav-link {
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 15px;
    display: flex;
    align-items: center;
    color: #625d74;
    font-size: 13px;
  }
  body.app-shell-active .nav-link::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-right: 13px;
    border: 1px solid currentColor;
    border-radius: 50%;
    opacity: 0.64;
  }
  body.app-shell-active .nav-link:hover {
    background: rgba(255,255,255,0.36);
    color: var(--primary-dark);
  }
  body.app-shell-active .nav-link.active {
    border-color: rgba(255,255,255,0.72);
    background: rgba(155,141,210,0.17);
    color: var(--primary-dark);
  }
  body.app-shell-active .nav-link.active::before {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(143,130,201,0.10);
  }
  body.app-shell-active .nav-account {
    width: 100%;
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
  }
  body.app-shell-active .nav-user { width: 100%; min-height: 44px; }
  body.app-shell-active .nav-user-dropdown {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 52px;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(20px);
  }
  body.app-shell-active .page.active {
    min-height: 0 !important;
    padding: 24px 24px 34px;
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: calc(16px + var(--sidebar-width) + var(--app-content-gap));
    right: 16px;
    border: 1px solid rgba(255,255,255,0.76);
    border-radius: 28px;
    background: rgba(255,255,255,0.31);
    box-shadow: 0 18px 54px rgba(75,66,110,0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  body.app-shell-active .page.active::-webkit-scrollbar {
    display: none;
    width: 0;
  }
  body.app-shell-active .page.active::-webkit-scrollbar-track {
    margin-block: 24px;
    background: transparent;
  }
  body.app-shell-active .page.active::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(135,119,198,0.42);
    background-clip: padding-box;
  }
  body.app-shell-active .page.active > .container,
  body.app-shell-active .healing-home-shell {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  body.app-shell-active #page-dashboard.active > .container,
  body.app-shell-active #page-module.active > .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  body.app-shell-active #page-home.active,
  body.app-shell-active #page-dashboard.active,
  body.app-shell-active #page-module.active {
    padding-top: 24px;
  }
  body.app-shell-active.page-context-nested #page-spread.active {
    padding-top: var(--app-chrome-height);
  }
  body.app-shell-active.page-context-nested #page-module.active {
    padding-top: var(--app-chrome-height);
  }
  body.app-shell-active.page-context-nested #page-library.active {
    padding-top: calc(var(--page-context-height) + 24px);
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused),
  body.app-shell-active #page-module.active:has(.drawing-workspace.exercise-focused) {
    overflow-y: hidden;
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) > .container,
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .module-hero,
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .drawing-workspace,
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .drawing-studio {
    min-height: 0;
    height: 100%;
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .module-hero,
  body.app-shell-active #page-module.active:has(.drawing-workspace.exercise-focused) .module-hero {
    margin-top: 0;
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .drawing-canvas-panel {
    display: flex;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .drawing-canvas-panel canvas {
    min-height: 0;
    height: 100%;
    aspect-ratio: auto;
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .drawing-studio[data-drawing-tool="mandala"] .drawing-canvas-panel {
    justify-content: center;
  }
  body.app-shell-active #page-module.active:has(.drawing-workspace.canvas-focused) .drawing-studio[data-drawing-tool="mandala"] .drawing-canvas-panel canvas {
    width: auto;
    max-width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
  }
  body.app-shell-active .healing-home-shell {
    padding-top: 0;
  }
  body.app-shell-active .page-context-bar.is-nested {
    top: 16px;
    left: calc(16px + var(--sidebar-width) + var(--app-content-gap));
    right: 16px;
    border-radius: 28px 28px 0 0;
    background: rgba(252,250,255,0.88);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }
  body.app-shell-active .page-context-inner {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .game-flat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-showcase-grid { grid-template-columns: 1fr; }
  .game-feature-card { min-height: 410px; }
  .game-library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .healing-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      'continue continue'
      'status streak'
      'today today'
      'records records'
      'library library'
      'recommend recommend';
  }
  .home-continue-card { min-height: 350px; }
  .drawing-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .drawing-workspace {
    grid-template-columns: 1fr;
  }
  .drawing-random-detail {
    grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1.35fr);
  }
  .drawing-random-detail .drawing-detail-copy {
    display: flex;
    padding: 16px;
  }
  .drawing-workspace.canvas-focused {
    min-height: auto;
    align-content: start;
  }
  .drawing-canvas-text {
    max-width: none;
  }
  .drawing-canvas-panel canvas {
    aspect-ratio: 1180 / 680;
    min-height: 0;
  }
  .drawing-canvas-panel {
    padding: 4px;
  }
  .spread-grid-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }
  .admin-sidebar-title { display: none; }
  .admin-menu {
    white-space: nowrap;
    width: auto;
  }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  :root {
    --main-nav-height: 70px;
    --page-context-height: 44px;
    --app-chrome-height: 114px;
  }
  body.page-context-nested {
    --page-context-height: 52px;
    --app-chrome-height: 134px;
  }
  body.app-shell-active #main-nav {
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    height: var(--main-nav-height);
    border: 0;
    border-bottom: 1px solid rgba(139,126,200,0.12);
    border-radius: 0;
    background: #fffdfb;
    box-shadow: 0 8px 24px rgba(75,66,110,0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.page-context-nested .page-context-bar.is-nested {
    top: 78px;
    left: 10px;
    right: 10px;
    width: auto;
    border: 1px solid rgba(139,126,200,0.12);
    border-radius: 18px;
    background: #fffdfb;
    box-shadow: 0 12px 30px rgba(75,66,110,0.09);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
  }
  body.app-shell-active .page.active {
    padding-left: 0;
  }
  #page-home.active {
    padding-top: calc(var(--main-nav-height) + 20px);
  }
  .healing-home-shell {
    width: calc(100% - 28px);
    padding: 4px 0 38px;
  }
  .healing-home-header {
    margin-bottom: 18px;
    padding: 0 4px;
  }
  .healing-home-header h1 {
    font-size: 27px;
    line-height: 1.26;
  }
  .healing-home-header p {
    max-width: 30em;
    font-size: 12px;
    line-height: 1.7;
  }
  .healing-home-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .healing-home-grid > .glass-panel,
  .home-recommendation {
    border-radius: 21px;
  }
  .home-continue-card {
    min-height: 0;
    padding: 24px 22px 20px;
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .home-card-copy h2 {
    margin-top: 8px;
    font-size: 27px;
  }
  .home-card-copy p { font-size: 12.5px; }
  .home-card-copy .btn {
    margin-top: 18px;
    padding: 10px 20px;
    box-shadow: none;
  }
  .home-card-preview {
    min-height: 198px;
    margin-top: -8px;
  }
  .home-card-preview img {
    width: 96px;
    border-width: 2px;
    border-radius: 12px;
    box-shadow: 0 15px 28px rgba(69, 60, 95, 0.13);
  }
  .home-status-card,
  .home-streak-card,
  .home-records-card,
  .home-thinking-emotion {
    min-height: 0;
    padding: 20px;
  }
  .home-status-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    text-align: left;
  }
  .home-status-card .home-card-kicker { grid-column: 1 / -1; }
  .home-status-orb {
    grid-column: 1;
    grid-row: 2 / 4;
    width: 56px;
    height: 56px;
    margin: 14px 0 0;
  }
  .home-status-card strong {
    grid-column: 2;
    margin-top: 13px;
  }
  .home-status-card p {
    grid-column: 2;
    margin-top: 2px;
  }
  .home-streak-card > strong b { font-size: 34px; }
  .home-streak-dots { margin-top: 12px; }
  .home-today-card {
    min-height: 0;
    padding: 14px;
    grid-template-columns: 86px minmax(0, 1fr) 28px;
    gap: 13px;
  }
  .home-today-art {
    height: 92px;
    border-radius: 15px;
  }
  .home-today-card h2,
  .home-section-heading h2 { font-size: 18px; }
  .home-today-card p { font-size: 11px; }
  .home-inline-arrow {
    width: 28px;
    height: 28px;
  }
  .home-section-heading {
    gap: 10px;
    margin-bottom: 14px;
  }
  .home-library-grid,
  .home-recommendation-grid {
    grid-template-columns: 1fr;
  }
  .home-library-entry {
    grid-template-columns: 74px minmax(0, 1fr);
  }
  .home-library-entry img {
    width: 74px;
    height: 64px;
  }
  .home-recommendations { padding-top: 2px; }
  .home-recommendation {
    min-height: 0;
    padding: 18px 20px;
  }
  .card-page-heading {
    margin: 0 0 14px;
  }
  .card-page-heading h1 { font-size: 27px; }
  .card-page-info {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .deck-switcher.glass-panel {
    gap: 3px;
    margin: 0 0 16px;
    padding: 4px;
    border-radius: 16px;
  }
  .deck-switcher.glass-panel .deck-tab {
    flex-basis: 0;
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 5px 4px;
    border-radius: 12px;
  }
  .deck-switcher.glass-panel .deck-tab span { font-size: 14px; }
  .deck-overview.glass-panel {
    min-height: 0;
    padding: 24px 22px;
    grid-template-columns: 1fr;
    border-radius: 22px;
  }
  .deck-overview.glass-panel h2 { font-size: 27px; }
  .deck-overview.glass-panel p {
    margin-top: 13px;
    font-size: 12.5px;
    line-height: 1.75;
  }
  .deck-overview.glass-panel .deck-preview { display: none; }
  .spread-card.glass-panel {
    min-height: 0;
    padding: 22px;
  }
  .module-page-heading {
    margin: 0 4px 18px;
  }
  .module-page-heading h1 {
    font-size: 27px;
  }
  .game-page-heading,
  .drawing-page-heading {
    display: none;
  }
  .module-page-heading p {
    font-size: 12px;
    line-height: 1.7;
  }
  .drawing-hub-shell {
    min-height: 0;
    justify-content: flex-start;
    padding-bottom: 18px;
  }
  .drawing-entry-card {
    min-height: 180px;
    padding: 20px;
    border-radius: 18px;
  }
  .drawing-entry-card::before {
    display: none;
    inset: 38% 8px 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
  }
  .game-module-hero {
    padding: 0 0 42px;
  }
  .game-flat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .game-flat-card {
    min-height: 156px;
    padding: 8px;
    display: grid;
    grid-template-columns: minmax(118px, 0.88fr) minmax(0, 1.12fr);
    border-radius: 20px;
  }
  .game-flat-cover {
    height: 100%;
    min-height: 140px;
    aspect-ratio: auto;
    border-radius: 15px;
  }
  .game-flat-copy {
    min-height: 140px;
    padding: 15px 16px 12px;
  }
  .game-flat-copy strong { font-size: 18px; }
  .game-flat-copy small {
    font-size: 10.5px;
    -webkit-line-clamp: 3;
  }
  .game-showcase-grid { gap: 14px; }
  .game-feature-card {
    min-height: 430px;
    border-radius: 22px;
  }
  .game-feature-card::after {
    background: linear-gradient(to top, rgba(46,40,62,0.78), rgba(54,46,72,0.12) 76%);
  }
  .game-feature-copy {
    width: 100%;
    padding: 190px 24px 26px;
  }
  .game-feature-copy h2 {
    margin: 16px 0 9px;
    font-size: 32px;
  }
  .game-feature-copy p {
    font-size: 12px;
    line-height: 1.7;
  }
  .game-feature-copy .btn { margin-top: 18px; }
  .game-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .game-library-card { min-height: 224px; }
  .game-library-card > span { margin-top: 108px; }
  .game-library-card > strong { font-size: 16px; }
  .game-library-card > em {
    margin-right: 16px;
    padding-bottom: 32px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .nav-inner {
    height: 100%;
    padding: 0 10px;
    gap: 10px;
  }
  .page-context-inner {
    padding: 0 16px;
    gap: 10px;
  }
  .page-breadcrumbs { gap: 6px; }
  .page-breadcrumb-link,
  .page-breadcrumb-current,
  .page-breadcrumb-separator { font-size: 13px; }
  .page-context-title { font-size: 17px; }
  .page-breadcrumbs,
  .page-context-heading {
    padding: 0;
    border-radius: 0;
  }
  .page-context-heading { gap: 6px; }
  .nav-logo {
    min-width: 0;
    font-size: 16px;
    white-space: nowrap;
  }
  .nav-brand-full { display: none; }
  .nav-brand-context { display: inline; }
  #primary-navigation {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    overflow: visible;
    border: 1px solid rgba(139, 126, 200, 0.14);
    border-radius: 14px;
    background: #fffdfb;
    box-shadow: 0 18px 44px rgba(74,63,92,0.14);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  #primary-navigation.is-open { display: grid; }
  #primary-navigation .nav-menu-brand {
    display: block;
    grid-column: 1 / -1;
    padding: 5px 8px 10px;
    border-bottom: 1px solid rgba(139, 126, 200, 0.12);
    color: var(--primary-dark);
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
  }
  #primary-navigation .nav-link {
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 14px;
    text-align: center;
  }
  #primary-navigation .nav-link:hover,
  #primary-navigation .nav-link.active {
    background: rgba(139, 126, 200, 0.08);
  }
  .nav-account {
    margin-left: auto;
    gap: 6px;
  }
  .nav-user {
    min-width: 70px;
    max-width: 82px;
    padding: 8px 9px;
  }
  .nav-menu-toggle { display: inline-flex; }
  #page-dashboard.active > .container,
  #page-module.active > .container {
    width: calc(100% - 28px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }
  .drawing-entry-grid {
    grid-template-columns: 1fr;
  }
  .drawing-entry-card {
    min-height: 180px;
  }
  .drawing-entry-card span {
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
  }
  .drawing-entry-card strong {
    font-size: 25px;
    line-height: 1.25;
    margin-bottom: 10px;
  }
  .drawing-entry-card em {
    max-width: none;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 300;
    line-height: 1.75;
  }
  .drawing-page-topbar {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }
  .drawing-page-topbar h1 {
    font-size: 20px;
    text-align: left;
  }
  .drawing-back-button {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
  }
  .drawing-tool-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .drawing-workspace {
    grid-template-columns: 1fr;
    padding: 8px;
  }
  .drawing-workspace.canvas-focused {
    min-height: auto;
    align-content: start;
  }
  .drawing-workspace.exercise-focused {
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .drawing-random-exercise {
    height: auto;
    gap: 8px;
  }
  .drawing-exercise-prompt {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
    padding: 10px 2px;
  }
  .drawing-exercise-prompt-copy {
    display: block;
  }
  .drawing-exercise-reference-block {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 11px;
  }
  .drawing-exercise-reference {
    width: 66px;
    height: 66px;
    border-radius: 13px;
  }
  .drawing-exercise-prompt-copy > h2 {
    font-size: 17px;
  }
  .drawing-exercise-instructions {
    margin-top: 5px;
  }
  .drawing-exercise-instructions p {
    font-size: 12px;
    line-height: 1.45;
  }
  .drawing-exercise-instructions p + p {
    margin-top: 2px;
  }
  .drawing-exercise-prompt > .btn {
    padding: 9px 11px;
    border-radius: 11px;
    font-size: 11px;
  }
  .drawing-random-exercise > .drawing-studio {
    min-height: 0;
    height: auto;
  }
  .drawing-random-detail {
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    height: auto;
    align-items: start;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: none;
  }
  .drawing-random-detail .drawing-detail-media {
    grid-column: 1;
    grid-row: 1;
    width: 128px;
    aspect-ratio: 1;
    border-radius: 14px;
    overflow: hidden;
  }
  .drawing-random-detail .drawing-detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .drawing-random-detail .drawing-detail-copy {
    display: contents;
  }
  .drawing-random-detail .drawing-detail-heading {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    min-width: 0;
  }
  .drawing-random-detail .drawing-detail-body {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }
  .drawing-random-detail .drawing-detail-copy span {
    font-size: 10.5px;
    letter-spacing: 0.04em;
  }
  .drawing-random-detail .drawing-detail-copy h3 {
    font-size: 21px;
    line-height: 1.3;
    margin: 8px 0 0;
  }
  .drawing-random-detail .drawing-detail-copy p,
  .drawing-random-detail .drawing-detail-copy li {
    font-size: 12.5px;
    line-height: 1.65;
  }
  .drawing-random-detail .drawing-detail-copy p {
    margin-bottom: 9px;
  }
  .drawing-random-detail .drawing-detail-copy ol {
    margin-top: 10px;
    padding-left: 18px;
  }
  .drawing-random-copy {
    padding: 14px 0 0;
  }
  .drawing-random-copy .btn {
    width: 100%;
    padding: 12px 20px;
    border-radius: 13px;
    font-size: 14px;
    box-shadow: none;
  }
  .drawing-studio {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }
  .drawing-tool-rail {
    flex-direction: row;
    width: 100%;
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .drawing-tool-rail::-webkit-scrollbar { display: none; }
  .drawing-tool-button.primary {
    margin-top: 0;
    margin-left: auto;
  }
  .drawing-tool-panel {
    top: 68px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    animation-name: drawingPanelDown;
  }
  @keyframes drawingPanelDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .drawing-save-status {
    top: 70px;
    right: 14px;
    bottom: auto;
    left: auto;
  }
  .drawing-section-title {
    display: block;
  }
  .drawing-section-title p {
    max-width: none;
    margin-top: 8px;
  }
  .drawing-exercise-layout {
    grid-template-columns: 1fr;
  }
  .drawing-exercise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }
  .drawing-exercise-detail {
    position: static;
  }
  .drawing-canvas-panel canvas {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }
  .drawing-studio[data-drawing-tool="mandala"] .drawing-canvas-panel canvas {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto !important;
  }
  .drawing-canvas-panel {
    padding: 4px;
  }
  #page-landing.active { padding: 22px 16px 36px; align-items: flex-start; }
  .landing-shell { grid-template-columns: 1fr; gap: 22px; }
  .landing-content { text-align: center; padding: 8px 0 0; }
  .landing-title { margin-bottom: 20px; }
  .landing-features {
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: 10px 24px;
    margin-bottom: 22px;
    text-align: left;
  }
  .landing-cards-preview { justify-content: center; height: 154px; width: 278px; margin: 10px auto 0; }
  .deck-switcher {
    justify-content: flex-start;
    gap: 7px;
    margin-left: -2px;
    margin-right: -2px;
  }
  .deck-tab {
    flex-basis: 110px;
    width: 110px;
    min-height: 38px;
    padding: 5px 7px;
  }
  .deck-tab span {
    font-size: 14px;
  }
  .deck-tab strong {
    margin-top: 1px;
    font-size: 7px;
  }
  .deck-overview, .spread-grid-inner { grid-template-columns: 1fr; }
  .deck-overview { padding: 22px; }
  .deck-overview h2 { font-size: 22px; }
  .deck-preview { display: none; }
  .card-pool { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .question-card-display { flex-direction: column; align-items: center; text-align: center; }
  .question-card-img { width: 120px; height: 168px; }
  .auth-card { padding: 28px 24px; }
  .nav-credits { display: none; }
  .result-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .result-actions > * {
    flex: 1 1 0;
    min-width: 0;
  }
  .analysis-content { padding: 24px 20px; }
  .profile-card { padding: 24px 20px; }
  .profile-grid { grid-template-columns: 1fr; gap: 0; }
  .history-card {
    gap: 16px;
    padding: 22px 20px;
  }
  .history-card-info {
    min-width: 0;
    flex: 1;
  }
  .history-card-info h3 {
    font-size: 16px;
    line-height: 1.35;
  }
  .history-card-meta {
    font-size: 12px;
    line-height: 1.45;
  }
  .history-card-cards {
    flex-shrink: 0;
    max-width: 46%;
    overflow: hidden;
  }
  .preview-card { width: 92px; height: 130px; }
  .pc1 { left: 0; top: 22px; transform: rotate(-8deg); }
  .pc2 { left: 93px; top: 2px; transform: rotate(0deg); }
  .pc3 { left: 186px; top: 22px; transform: rotate(8deg); }
  .intro-article { padding: 24px 20px; }
  .module-hero {
    margin-top: 30px;
    padding: 30px 24px;
  }
  .module-hero h1 {
    font-size: 28px;
  }
  .module-hero h2 {
    font-size: 19px;
  }
  .game-module-hero {
    padding: 0 0 58px;
  }
  .game-module-copy { padding: 2px 2px 0; }
  .game-module-copy h1 {
    font-size: 28px;
  }
  .game-module-copy h2 {
    font-size: 15px;
  }
  .game-carousel-shell {
    min-height: 300px;
    margin: 18px 0 16px;
  }
  .game-carousel {
    height: 300px;
  }
  .game-slide {
    width: min(360px, 72vw);
    transform:
      translate(-50%, -50%)
      translateX(calc(var(--offset) * 118px))
      rotateY(calc(var(--offset) * -12deg))
      scale(calc(1 - var(--abs-offset) * 0.16));
  }
  .game-slide span {
    left: 12px;
    bottom: 12px;
    font-size: 12px;
  }
  .game-nav-button {
    width: 36px;
    height: 36px;
    font-size: 26px;
  }
  .game-nav-prev { left: 10px; }
  .game-nav-next { right: 10px; }
  .game-active-panel {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-bottom: 30px;
  }
  .game-active-panel h3 {
    font-size: 21px;
  }
  .history-filter-tabs {
    justify-content: flex-start;
    margin-left: -2px;
    margin-right: -2px;
  }
  .redeem-row, .admin-form-grid, .admin-stats { grid-template-columns: 1fr; }
  .credit-header { align-items: flex-start; flex-direction: column; }
  body.draw-mode #page-spread.active {
    padding-top: var(--app-chrome-height);
  }
  body.draw-mode .selection-header {
    padding-top: 2px;
  }
  body.draw-mode .card-slots {
    padding: 18px 0 28px;
    gap: 10px;
  }
  body.draw-mode .card-slot {
    width: 96px;
    height: 136px;
  }
  body.draw-mode .card-fan-wrapper {
    height: 170px;
    margin: 18px auto 10px;
  }
  body.chat-locked #page-spread {
    padding-top: var(--app-chrome-height);
  }
  body.chat-locked #page-spread > .container {
    height: calc(100vh - var(--app-chrome-height));
    padding: 0 14px;
  }
  body.chat-locked #spread-step-questions .chat-panel {
    grid-template-rows: 276px minmax(0, 1fr) auto auto;
  }
  body.chat-locked #spread-step-questions .spread-result-cards {
    gap: 12px 8px;
    max-height: 276px;
    padding: 24px 2px 16px;
  }
  body.chat-locked #spread-step-questions .spread-result-card img {
    width: 64px;
    height: 90px;
  }
  body.chat-locked #spread-step-questions .spread-result-card .src-position {
    width: 102px;
    font-size: 10px;
  }
  body.chat-locked #spread-step-questions .chat-log {
    padding: 14px 10px 14px;
  }
  body.chat-locked #spread-step-questions .chat-input-row {
    gap: 8px;
    padding: 7px 0 9px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  body.chat-locked #spread-step-questions .chat-input-row textarea {
    min-height: 49px;
    height: 49px;
    max-height: 68px;
  }
  body.chat-locked #spread-step-questions .chat-input-row .btn {
    min-height: 49px;
    padding: 11px 22px;
    box-shadow: none;
  }
  body.chat-locked #spread-step-questions .chat-bubble {
    max-width: 92%;
  }
  .admin-modal-sticky-head {
    padding: 24px 22px 12px;
  }
  .admin-modal-scroll {
    padding: 18px 22px 2px;
  }
  .admin-modal-foot {
    grid-template-columns: 1fr;
    padding: 14px 22px 18px;
  }
  .coin {
    width: 62px;
    height: 62px;
    font-size: 18px;
  }
  .coin-cast-header {
    padding: 22px 20px 12px;
  }
  .coin-cast-body {
    padding: 16px 18px 14px;
  }
  .coin-cast-actions {
    flex-direction: column;
    padding: 14px 18px 18px;
  }
  .coin-cast-actions .btn {
    width: 100%;
  }
  .coin-stage {
    gap: 10px;
  }
  .coin-progress {
    flex-direction: column;
    gap: 2px;
  }
  .hex-line {
    grid-template-columns: 52px 1fr 72px;
    gap: 8px;
  }
  .hex-line b {
    width: 128px;
  }
  .hex-line.yang b i {
    width: 128px;
  }
  .hex-line.yin b i {
    width: 52px;
  }
  .hex-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .card-pool { grid-template-columns: repeat(4, 1fr); }
  .landing-title { font-size: 28px; }
  .nav-inner {
    padding: 12px 14px;
    gap: 10px;
  }
  .nav-logo {
    width: auto;
    overflow: visible;
    font-size: 15px;
  }
  .nav-account { gap: 6px; }
  .nav-user {
    min-width: 68px;
    max-width: 86px;
    padding: 8px 9px;
  }
  .nav-user-dropdown {
    top: 54px;
    right: 12px;
  }
  #primary-navigation {
    left: 10px;
    right: 10px;
  }
  .dashboard-title-row {
    gap: 8px;
  }
  .info-button {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }
  .deck-overview-info {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .review-banner {
    padding: 20px 18px;
  }
  .review-history-popover {
    width: calc(100vw - 72px);
  }
  .history-card {
    padding: 20px 18px;
    gap: 12px;
  }
  .history-mini-card {
    width: 30px;
    height: 42px;
  }
  .history-card-cards {
    gap: 5px;
    max-width: 48%;
  }
}

@media (max-width: 768px) {
  .content-library-container {
    padding: 0 10px 18px;
  }
  .content-library-shell {
    min-height: 0;
    padding: 18px 14px;
    border-radius: 22px;
  }
  .content-library-header {
    display: grid;
    gap: 15px;
    margin-bottom: 18px;
  }
  .content-library-header h1 {
    font-size: 27px;
  }
  .content-library-header p {
    font-size: 12px;
  }
  .content-library-tabs {
    width: 100%;
  }
  .content-library-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }
  .content-library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .content-library-card {
    padding: 6px 6px 9px;
    border-radius: 15px;
  }
  .content-library-image {
    border-radius: 10px;
  }
  .content-library-card-copy {
    display: block;
    padding: 8px 3px 0;
  }
  .content-library-card-copy small {
    display: block;
    margin-bottom: 2px;
  }
  .content-library-card-copy strong {
    display: block;
    font-size: 13px;
  }
}

@media (max-width: 1100px) {
  .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.page-context-nested #page-library.active {
    padding-top: calc(var(--app-chrome-height) + 12px);
  }
  .home-welcome-hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 8px;
    padding: 24px 20px;
    border-radius: 22px;
  }
  .home-welcome-copy h1 {
    font-size: 27px;
    line-height: 1.3;
  }
  .home-welcome-copy p {
    margin-top: 8px;
    font-size: 16px;
  }
  .home-hero-scene {
    min-height: 112px;
  }
  .home-hero-arch {
    width: 70px;
    height: 94px;
    bottom: 1px;
    border-width: 2px;
    border-bottom-width: 5px;
  }
  .home-hero-orb {
    width: 38px;
    height: 38px;
    bottom: 12px;
  }
  .home-hero-sprig {
    display: none;
  }
  .home-tools-panel {
    margin-top: 14px;
    padding: 18px;
    border-radius: 22px;
  }
  .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .home-tool-card {
    min-height: 154px;
    grid-template-rows: 65px auto auto;
    padding: 12px;
    border-radius: 17px;
  }
  .home-tool-visual {
    height: 60px;
    border-radius: 12px;
  }
  .home-tool-card strong {
    font-size: 16px;
  }
  .home-tool-card small {
    font-size: 10.5px;
  }
  .home-lower-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 14px;
  }
  .home-lower-grid .home-records-card,
  .home-content-library {
    min-height: 0;
    padding: 20px;
    border-radius: 22px;
  }
  .home-content-library .home-library-grid {
    grid-template-columns: 1fr;
  }
  .home-content-library .home-library-entry {
    min-height: 0;
  }
  .content-library-header {
    align-items: stretch;
  }
}

@media (max-width: 420px) {
  .home-welcome-hero {
    grid-template-columns: 1fr;
  }
  .home-hero-scene {
    display: none;
  }
}

/* ── Healing home: luminous illustrated cards ────────── */
.deck-switcher.glass-panel .deck-tab.active:hover:not(:disabled),
.deck-switcher.glass-panel .deck-tab.active:focus-visible {
  background: linear-gradient(135deg, #978bd6 0%, #7468b6 100%);
  color: #fff;
}

.home-welcome-hero {
  isolation: isolate;
  min-height: clamp(190px, 22vh, 250px);
  display: block;
  padding: clamp(30px, 4vw, 62px);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 24px 70px rgba(79, 69, 116, 0.08);
}
.home-welcome-hero::before {
  z-index: 1;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0.46) 0%, rgba(255,255,255,0.16) 46%, transparent 72%);
  box-shadow: none;
  filter: none;
}
.home-welcome-hero::after {
  display: none;
}
.home-welcome-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
.home-welcome-copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: calc(clamp(190px, 22vh, 250px) - clamp(60px, 8vw, 124px));
  max-width: 58%;
}
.home-welcome-copy h1 {
  font-size: clamp(30px, 3.15vw, 48px);
}

.home-tools-panel {
  padding: clamp(22px, 2.4vw, 36px);
}
.home-tools-panel .home-section-heading {
  margin-bottom: 18px;
}
.home-tools-panel .home-section-heading h2,
.home-content-library .home-section-heading h2,
.home-records-card .home-section-heading h2 {
  margin: 0;
  font-size: clamp(22px, 1.8vw, 30px);
}
.home-tools-panel .home-tool-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.home-tools-panel .home-tool-card {
  min-height: 360px;
  display: grid;
  grid-template-rows: 158px minmax(0, 1fr);
  align-content: stretch;
  justify-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: 22px;
  background: rgba(255,255,255,0.38);
  cursor: default;
  box-shadow: 0 14px 42px rgba(76,66,112,0.07);
}
.home-tools-panel .home-tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143,130,201,0.22);
  background: rgba(255,255,255,0.48);
}
.home-tool-image {
  display: block;
  width: 100%;
  height: 158px;
  object-fit: cover;
  border-bottom: 1px solid rgba(133,119,177,0.08);
}
.home-tool-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.home-tool-copy h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}
.home-tool-copy p {
  margin: 8px 0 16px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.7;
}
.home-tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.home-tool-links button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(126,111,183,0.17);
  border-radius: 999px;
  background: rgba(255,255,255,0.56);
  color: var(--primary-dark);
  font: 500 11px/1.2 var(--font-sans);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.home-tool-links button:hover,
.home-tool-links button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(126,111,183,0.32);
  background: rgba(139,126,200,0.12);
  color: #6153a4;
}

.home-lower-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-records-card,
.home-content-library {
  background: rgba(255,255,255,0.42);
}
.home-record-open {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(126,111,183,0.14);
  border-radius: 11px;
  background: rgba(255,255,255,0.54);
  color: var(--primary-dark);
  transition: transform var(--transition), background var(--transition), color var(--transition);
}
.home-record-open svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-record-row:hover .home-record-open,
.home-record-row:focus-visible .home-record-open {
  transform: translateY(-1px);
  background: rgba(139,126,200,0.14);
  color: #6658ab;
}

.home-content-library .home-library-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.home-content-library .home-library-entry {
  min-height: 178px;
  grid-template-columns: minmax(112px, 42%) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255,255,255,0.34);
}
.home-library-media {
  align-self: stretch;
  min-height: 176px;
  margin: 0 !important;
  overflow: hidden;
  border-right: 1px solid rgba(126,111,183,0.08);
}
.home-content-library .home-library-entry .home-library-media img {
  width: 100%;
  height: 100%;
  min-height: 176px;
  object-fit: cover;
  border-radius: 0;
}
.home-library-copy {
  align-self: stretch;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  margin: 0 !important;
  padding: 18px;
}
.home-library-copy strong {
  font-size: 20px;
}
.home-library-copy span {
  margin-top: 7px;
  line-height: 1.65;
}
.home-library-copy small {
  align-self: flex-start;
  margin-top: 14px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(139,126,200,0.10);
  color: var(--primary-dark);
  font-size: 10px;
}

@media (max-width: 1100px) {
  .home-tools-panel .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-tools-panel .home-tool-card {
    min-height: 330px;
  }
}

@media (max-width: 768px) {
  .home-welcome-hero {
    min-height: 166px;
    display: block;
    padding: 24px 20px;
    border-radius: 22px;
  }
  .home-welcome-copy {
    min-height: 118px;
    max-width: 56%;
  }
  .home-welcome-copy h1 {
    font-size: 26px;
    line-height: 1.35;
  }
  .home-welcome-art {
    object-position: 58% center;
  }
  .home-tools-panel .home-tool-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .home-tools-panel .home-tool-card {
    min-height: 180px;
    grid-template-columns: 39% minmax(0, 1fr);
    grid-template-rows: none;
  }
  .home-tool-image {
    width: 100%;
    height: 100%;
    min-height: 180px;
    border-right: 1px solid rgba(133,119,177,0.08);
    border-bottom: 0;
  }
  .home-tool-copy {
    padding: 16px;
  }
  .home-tool-copy h3 {
    font-size: 20px;
  }
  .home-tool-copy p {
    margin-bottom: 12px;
    font-size: 11.5px;
  }
  .home-lower-grid {
    grid-template-columns: 1fr;
  }
  .home-content-library .home-library-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .home-welcome-copy {
    max-width: 62%;
  }
  .home-welcome-copy h1 {
    font-size: 23px;
  }
  .home-tools-panel {
    padding: 16px;
  }
  .home-tools-panel .home-tool-card {
    min-height: 174px;
    grid-template-columns: 38% minmax(0, 1fr);
  }
  .home-tool-image {
    min-height: 174px;
  }
  .home-tool-links {
    gap: 6px;
  }
  .home-tool-links button {
    min-height: 31px;
    padding: 6px 9px;
    font-size: 10px;
  }
  .home-content-library .home-library-entry {
    grid-template-columns: 40% minmax(0, 1fr);
  }
  .home-library-copy {
    padding: 14px;
  }
}

/* Final neutral controls: remove the remaining lilac/green visual language. */
.emotion-wheel-question-primary-action button,
.emotion-wheel-question-actions button:last-child,
.emotion-wheel-question-actions--single button{
  border-color:#20221f!important;background:#20221f!important;background-image:none!important;color:#fff!important;box-shadow:none!important;
}
.emotion-wheel-question-actions button:first-child:not(:last-child){border-color:#dedfdb!important;background:#fff!important;color:#555a55!important;box-shadow:none!important}
.hold-intensity-orb{
  border-color:#d7dad5!important;
  background:radial-gradient(circle at 31% 27%,#fff 0 13%,transparent 38%),radial-gradient(circle at 68% 74%,#dfe2de,#fafafa 72%)!important;
  color:#555a55!important;box-shadow:0 14px 30px rgba(38,40,37,.08)!important;
}
.hold-intensity-orb:focus-visible{box-shadow:0 0 0 4px rgba(32,34,31,.08),0 14px 30px rgba(38,40,37,.08)!important}
.hold-intensity-value strong{color:#343834!important}
.emotion-wheel-chip.is-selected{border-color:#242724!important;background:#242724!important;color:#fff!important;box-shadow:none!important}

/* Healing home: compact library on the left, visual records on the right. */
.home-lower-grid {
  grid-template-columns: minmax(320px, 0.78fr) minmax(460px, 1.22fr);
  align-items: start;
}

.home-content-library {
  align-self: start;
  min-height: 0;
  padding: 22px;
}

.home-content-library .home-library-grid {
  grid-template-columns: 1fr;
  align-content: start;
  gap: 10px;
}

.home-content-library .home-library-entry {
  height: 108px;
  min-height: 108px;
  grid-template-columns: minmax(100px, 35%) minmax(0, 1fr);
  border-radius: 20px;
}

.home-content-library .home-library-media,
.home-content-library .home-library-media img {
  min-height: 108px;
  height: 108px;
}

.home-content-library .home-library-copy {
  gap: 6px;
  padding: 14px 16px;
}

.home-library-title-row {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible !important;
  white-space: normal !important;
}

.home-library-title-row strong {
  font-size: 20px;
  line-height: 1.25;
}

.home-library-title-row small {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin: 0 !important;
  padding: 4px 8px;
  border: 1px solid rgba(139, 126, 200, 0.12);
  border-radius: 999px;
  background: rgba(244, 241, 250, 0.82);
  color: var(--primary-dark);
  font-size: 10px;
  line-height: 1;
}

.home-records-list {
  display: grid;
  gap: 10px;
}

.home-record-row {
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 94px;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(139, 126, 200, 0.11);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(250,248,255,0.48)),
    rgba(255,255,255,0.42);
  box-shadow: 0 10px 28px rgba(76, 66, 112, 0.04);
}

.home-record-row:hover,
.home-record-row:focus-visible {
  border-color: rgba(139, 126, 200, 0.23);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.9), rgba(246,243,253,0.66)),
    rgba(255,255,255,0.54);
}

.home-record-cards {
  position: relative;
  display: block;
  grid-column: 1;
  width: 104px;
  height: 70px;
  justify-self: start;
}

.home-record-cards img {
  position: absolute;
  top: 50%;
  left: calc(var(--card-index) * 27px);
  width: 44px;
  height: 64px;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.9);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(63, 53, 91, 0.13);
  transform: translateY(-50%) rotate(calc((var(--card-index) - 1) * 3deg));
}

.home-record-copy {
  display: flex;
  grid-column: 2;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  text-align: left;
}

.home-record-copy strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-record-copy small {
  color: var(--text-light);
  font-size: 11px;
}

.home-record-row .home-record-mark {
  grid-column: 1;
  width: 104px;
  height: 70px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(224,217,243,0.88), rgba(247,229,217,0.82));
}

@media (max-width: 960px) {
  .home-lower-grid {
    grid-template-columns: minmax(280px, 0.82fr) minmax(380px, 1.18fr);
  }
}

@media (max-width: 768px) {
  .home-lower-grid {
    grid-template-columns: 1fr;
  }

  .home-content-library .home-library-entry {
    height: 104px;
    min-height: 104px;
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
  }

  .home-content-library .home-library-media,
  .home-content-library .home-library-media img {
    height: 104px;
    min-height: 104px;
  }

  .home-content-library .home-library-copy {
    padding: 16px 14px;
  }

  .home-library-title-row strong {
    font-size: 18px;
  }

  .home-record-row {
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 88px;
    gap: 12px;
    padding: 9px 11px;
  }

  .home-record-cards,
  .home-record-row .home-record-mark {
    width: 90px;
    height: 66px;
  }

  .home-record-cards img {
    left: calc(var(--card-index) * 23px);
    width: 40px;
    height: 60px;
  }
}

/* Personal-home tools: white paper-glass with one restrained neutral wash. */
.home-tools-panel .home-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.home-tools-panel .home-tool-card {
  --tool-glow-a: rgba(218, 214, 229, 0.11);
  --tool-glow-b: rgba(235, 229, 225, 0.1);
  --tool-surface: rgba(255, 255, 255, 0.92);
  --tool-accent: #4c4560;
  min-height: 184px;
  display: flex;
  align-items: center;
  padding: 26px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: var(--tool-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(105, 94, 139, 0.08),
    inset 0 0 0 1px rgba(118, 104, 165, 0.035),
    0 16px 38px rgba(77, 68, 107, 0.085);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  cursor: pointer;
}
.home-tools-panel .home-tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(112deg, rgba(255,255,255,.42) 0 22%, transparent 48%),
    radial-gradient(circle at 92% 10%, var(--tool-glow-a), transparent 48%);
  pointer-events: none;
}
.home-tools-panel .home-tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, .98) 0 24%, rgba(255, 255, 255, .9) 42%, rgba(255, 255, 255, .34) 66%, rgba(255, 255, 255, .08) 100%);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}
.home-tool-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  filter: saturate(.78) contrast(.96) brightness(1.035);
  transform: scale(1.012);
  transition: transform .65s cubic-bezier(.2,.75,.2,1), filter .35s ease;
  pointer-events: none;
}
.home-tools-panel .home-tool-card:hover,
.home-tools-panel .home-tool-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1px 0 rgba(105, 94, 139, 0.07),
    0 20px 44px rgba(77, 68, 107, 0.11);
}
.home-tools-panel .home-tool-card:hover .home-tool-backdrop,
.home-tools-panel .home-tool-card:focus-visible .home-tool-backdrop {
  filter: saturate(.86) contrast(.98) brightness(1.02);
  transform: scale(1.045);
}
.home-tools-panel .home-tool-copy {
  width: min(54%, 260px);
  padding: 0;
  position: relative;
  z-index: 3;
}
.home-tools-panel .home-tool-copy strong {
  color: var(--tool-accent, #3f3954);
  font-size: 20px;
}
.home-tools-panel .home-tool-copy > span {
  color: #625c73;
  font-size: 12px;
}
.home-tool-detail-hero {
  grid-template-columns: minmax(0, 1fr);
  min-height: 190px;
  background: linear-gradient(135deg, rgba(255,255,255,0.72), rgba(241,237,249,0.62));
}
.home-tool-detail-hero > div {
  align-self: center;
}
.home-library-copy strong,
.content-library-header h1,
.content-library-card-copy strong {
  color: #3d3851;
  opacity: 1;
}
.home-library-copy > span,
.content-library-card-copy small {
  color: #625b72;
  opacity: 1;
}
.home-library-copy small {
  color: #5d537e;
  opacity: 1;
}

@media (max-width: 768px) {
  .home-tools-panel .home-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .home-tools-panel .home-tool-card {
    min-height: 142px;
    padding: 16px;
    border-radius: 18px;
  }
  .home-tool-backdrop {
    object-position: 68% center;
    filter: saturate(.7) contrast(.94) brightness(1.055);
  }
  .home-tools-panel .home-tool-card::after {
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255,255,255,.98) 0 32%, rgba(255,255,255,.88) 56%, rgba(255,255,255,.22) 100%);
  }
  .home-tools-panel .home-tool-copy { width: 72%; }
  .home-tools-panel .home-tool-copy strong {
    font-size: 17px;
  }
  .home-tools-panel .home-tool-copy > span {
    font-size: 11px;
    white-space: normal;
  }
}

/* Final personal-home polish: the welcome line and section titles share one scale. */
.home-welcome-copy h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.35;
}
.home-welcome-name,
.home-welcome-return {
  display: inline;
}
.home-tools-panel .home-tool-card {
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.home-tool-copy strong {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}
.home-tool-copy > span {
  min-width: 0;
  margin-top: 8px;
  overflow: hidden;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-library-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-tool-detail-container {
  width: 100%;
  max-width: none;
  padding: 0;
}
.home-tool-detail-shell {
  min-height: 100%;
  padding: clamp(20px, 3vw, 42px);
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 26px;
  background: rgba(255,255,255,0.34);
  box-shadow: 0 18px 54px rgba(76,66,112,0.07);
  backdrop-filter: blur(22px) saturate(118%);
}
.home-tool-detail-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.18fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  padding: clamp(18px, 2.4vw, 34px);
  border: 1px solid rgba(255,255,255,0.86);
  border-radius: 22px;
  background: rgba(255,255,255,0.45);
}
.home-tool-detail-hero img {
  display: block;
  width: 100%;
  height: clamp(220px, 28vw, 330px);
  object-fit: cover;
  border-radius: 18px;
}
.home-tool-detail-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.25;
}
.home-tool-detail-hero p {
  margin: 14px 0 0;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.75;
}
.home-tool-detail-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.home-tool-detail-actions button {
  min-height: 126px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 20px;
  background: rgba(255,255,255,0.42);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(76,66,112,0.055);
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.home-tool-detail-actions button:hover,
.home-tool-detail-actions button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(139,126,200,0.28);
  background: rgba(255,255,255,0.58);
}
.home-tool-detail-actions strong,
.home-tool-detail-actions span {
  display: block;
}
.home-tool-detail-actions strong {
  font-family: var(--font-serif);
  font-size: 20px;
}
.home-tool-detail-actions span {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.6;
}

/* ── Emotion wheel ───────────────────────────────────── */
.emotion-wheel-page {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto 48px;
  color: var(--text);
}
.emotion-wheel-layout {
  display: grid;
  grid-template-columns: minmax(430px, .92fr) minmax(440px, 1.08fr);
  align-items: start;
  gap: clamp(24px, 3vw, 42px);
  padding-top: 0;
}
.emotion-wheel-picker,
.emotion-wheel-form,
.emotion-wheel-recent {
  border: 1px solid rgba(107, 98, 137, .11);
  background:
    radial-gradient(circle at 80% 12%, rgba(235, 231, 244, .34), transparent 35%),
    rgba(255, 255, 255, .91);
  box-shadow: 0 22px 64px rgba(66, 58, 91, .065);
}
.emotion-wheel-picker {
  position: static;
  padding: 26px;
  border-radius: 26px;
}
.emotion-wheel-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}
.emotion-wheel-step-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(103, 92, 158, .2);
  border-radius: 50%;
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
}
.emotion-wheel-step-heading h2,
.emotion-wheel-field h2 {
  margin: 0;
  color: #49445b;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.emotion-wheel-step-heading p {
  margin: 4px 0 0;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.55;
}
.emotion-wheel-disc {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 24px auto 2px;
  border: 1px solid rgba(105, 96, 135, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  box-shadow:
    inset 0 0 0 14px rgba(246, 244, 248, .72),
    inset 0 0 0 15px rgba(113, 104, 141, .06),
    0 18px 46px rgba(67, 60, 92, .07);
}
.emotion-wheel-disc::before,
.emotion-wheel-disc::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.emotion-wheel-disc::before {
  inset: 56px;
  border: 1px dashed rgba(103, 92, 158, .12);
  border-radius: 50%;
}
.emotion-wheel-disc::after {
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 231, 244, .62), rgba(250, 249, 252, .88) 68%, rgba(255, 255, 255, .2));
  filter: blur(1px);
}
.emotion-wheel-center {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: flex;
  width: 136px;
  height: 136px;
  padding: 18px;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 34px rgba(72, 64, 99, .1);
  text-align: center;
  backdrop-filter: blur(12px);
}
.emotion-wheel-center span {
  color: var(--text-light);
  font-size: 10px;
  letter-spacing: .16em;
}
.emotion-wheel-center strong {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}
.emotion-wheel-center small {
  max-width: 96px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-light);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emotion-wheel-orbit {
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: 50%;
  animation: emotion-wheel-spin 180s linear infinite;
}
.emotion-wheel-primary-slot {
  position: absolute;
  top: var(--wheel-y);
  left: var(--wheel-x);
  display: block;
  width: 0;
  height: 0;
  animation: emotion-wheel-counter-spin 180s linear infinite;
}
.emotion-wheel-primary {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: flex;
  width: 96px;
  min-height: 64px;
  padding: 10px 5px;
  transform: translate(-50%, -50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(105, 96, 135, .13);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98) 48%, var(--emotion-tint, rgba(235, 231, 244, .42))),
    rgba(255, 255, 255, .94);
  color: #514b65;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(67, 60, 92, .055);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
@keyframes emotion-wheel-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes emotion-wheel-counter-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.emotion-wheel-primary:hover,
.emotion-wheel-primary:focus-visible {
  transform: translate(-50%, -50%) translateY(-2px);
  border-color: rgba(103, 92, 158, .34);
  outline: none;
  box-shadow: 0 10px 28px rgba(67, 60, 92, .1);
}
.emotion-wheel-primary.is-selected {
  border-color: rgba(103, 92, 158, .38);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .99) 34%, var(--emotion-tint, rgba(235, 231, 244, .72))),
    rgba(255, 255, 255, .96);
  color: var(--primary-dark);
  box-shadow: 0 12px 28px rgba(94, 82, 143, .15);
}
.emotion-wheel-primary strong {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}
.emotion-wheel-primary span {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 9px;
  line-height: 1.25;
  white-space: nowrap;
}
.emotion-wheel-form {
  overflow: hidden;
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .96), rgba(250, 249, 252, .9)),
    rgba(255, 255, 255, .94);
}
.emotion-wheel-form--sequential {
  display: flex;
  min-height: 430px;
}
.emotion-wheel-question-shell {
  display: flex;
  width: 100%;
  min-height: 430px;
  padding: clamp(24px, 4vw, 42px);
  flex-direction: column;
}
.emotion-wheel-question-progress {
  display: flex;
  width: min(220px, 52%);
  margin-left: auto;
  align-items: center;
  gap: 7px;
}
.emotion-wheel-question-progress i {
  height: 3px;
  flex: 1;
  border-radius: 999px;
  background: rgba(111, 100, 149, .11);
  transition: background .25s ease, transform .25s ease;
}
.emotion-wheel-question-progress i.is-complete { background: rgba(111, 100, 149, .28); }
.emotion-wheel-question-progress i.is-active { transform: scaleY(1.7); background: rgba(103, 92, 158, .7); }
.emotion-wheel-answer-trail {
  display: flex;
  min-height: 40px;
  margin-top: 22px;
  flex-wrap: wrap;
  gap: 7px;
}
.emotion-wheel-answer-trail span {
  height: 27px;
  padding: 4px 11px;
  border: 1px solid rgba(103,92,158,.1);
  border-radius: 999px;
  background: rgba(247,245,250,.72);
  color: rgba(83, 76, 105, .56);
  font-size: 9px;
}
.emotion-wheel-question-stage {
  margin: auto 0;
  padding: 28px 0;
  border: 0;
  background: transparent;
  animation: emotion-question-arrive .34s cubic-bezier(.22,.8,.22,1) both;
}
.emotion-wheel-question-stage h2,
.emotion-wheel-question-stage .emotion-wheel-field-label label,
.emotion-wheel-question-stage .emotion-wheel-note-label { font-size: 18px; }
.emotion-wheel-question-stage .emotion-wheel-step-heading h2 { font-size: 18px; }
.emotion-wheel-question-stage .emotion-wheel-step-heading p { font-size: 12px; }
.emotion-wheel-question-stage .emotion-wheel-chips { margin-top: 22px; gap: 10px; }
.emotion-wheel-question-stage .emotion-wheel-chip { min-height: 38px; padding: 8px 17px; }
.emotion-wheel-question-stage .emotion-wheel-submit-row {
  min-height: auto;
  margin-top: 26px;
  padding: 0;
  justify-content: flex-end;
  background: transparent;
}
.emotion-wheel-question-waiting {
  display: grid;
  margin: auto;
  place-items: center;
  color: rgba(74,68,91,.68);
  text-align: center;
  animation: emotion-question-arrive .34s ease both;
}
.emotion-wheel-question-waiting > span {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(103,92,158,.12);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff, rgba(235,231,244,.72));
  color: rgba(103,92,158,.55);
  font-size: 20px;
  box-shadow: 0 12px 30px rgba(67,60,92,.07);
}
.emotion-wheel-question-waiting strong { font-family: var(--font-serif); font-size: 20px; font-weight: 600; }
.emotion-wheel-question-waiting p { margin-top: 7px; color: var(--text-light); font-size: 11px; }
.emotion-wheel-next {
  display: block;
  margin: 28px 0 0 auto;
  padding: 9px 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(103,92,158,.9);
  color: #fff;
  cursor: pointer;
  font: 11px var(--font-sans);
}
.emotion-wheel-question-footer {
  display: flex;
  min-height: 28px;
  margin-top: auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.emotion-wheel-question-footer > button {
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid rgba(103,92,158,.18);
  background: transparent;
  color: rgba(83,76,105,.55);
  cursor: pointer;
  font: 10px var(--font-sans);
}
.emotion-wheel-question-footer p { margin: 0 0 0 auto; color: rgba(71,98,75,.78); font-size: 10px; text-align: right; }
.emotion-wheel-question-footer p.is-error { color: #a45f68; }
@keyframes emotion-question-arrive {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.emotion-wheel-field {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(91, 84, 116, .085);
}
.emotion-wheel-field.is-muted {
  background: rgba(247, 246, 249, .5);
}
.emotion-wheel-step-heading--compact > span {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}
.emotion-wheel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}
.emotion-wheel-chip {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid rgba(102, 94, 129, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #625c72;
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}
.emotion-wheel-chip:hover,
.emotion-wheel-chip:focus-visible {
  border-color: rgba(103, 92, 158, .35);
  outline: none;
  transform: translateY(-1px);
}
.emotion-wheel-chip.is-selected {
  border-color: rgba(103, 92, 158, .4);
  background: linear-gradient(145deg, #fff, rgba(235, 231, 244, .9));
  color: var(--primary-dark);
  font-weight: 500;
}
.emotion-wheel-placeholder {
  width: 100%;
  padding: 11px 13px;
  border: 1px dashed rgba(102, 94, 129, .14);
  border-radius: 12px;
  color: rgba(98, 92, 114, .58);
  font-size: 12px;
}
.emotion-wheel-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.emotion-wheel-field-label label,
.emotion-wheel-note-label {
  color: #49445b;
  font-size: 14px;
  font-weight: 600;
}
.emotion-wheel-field-label output {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--primary-dark);
}
.emotion-wheel-field-label output strong {
  font-size: 22px;
  line-height: 1;
}
.emotion-wheel-field-label output span {
  color: var(--text-light);
  font-size: 11px;
}
.emotion-wheel-range {
  width: 100%;
  height: 4px;
  margin: 22px 0 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, rgba(207, 201, 222, .48), rgba(125, 112, 181, .62));
  cursor: pointer;
}
.emotion-wheel-range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50%;
  appearance: none;
  background: var(--primary-dark);
  box-shadow: 0 2px 9px rgba(75, 65, 118, .28);
}
.emotion-wheel-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--primary-dark);
  box-shadow: 0 2px 9px rgba(75, 65, 118, .28);
}
.emotion-wheel-range:focus-visible {
  outline: 2px solid rgba(103, 92, 158, .36);
  outline-offset: 5px;
}
.emotion-wheel-range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: rgba(98, 92, 114, .65);
  font-size: 10px;
}
.emotion-wheel-note-label {
  display: block;
}
.emotion-wheel-note-label span {
  margin-left: 4px;
  color: var(--text-light);
  font-size: 11px;
  font-weight: 400;
}
.emotion-wheel-field textarea,
.body-map-field textarea {
  width: 100%;
  min-height: 82px;
  margin-top: 11px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid rgba(102, 94, 129, .14);
  border-radius: 13px;
  background: rgba(255, 255, 255, .82);
  color: var(--text);
  font: 13px/1.7 var(--font-sans);
}
.emotion-wheel-field textarea:focus,
.body-map-field textarea:focus {
  border-color: rgba(103, 92, 158, .4);
  outline: 3px solid rgba(103, 92, 158, .08);
}
.emotion-wheel-field textarea::placeholder,
.body-map-field textarea::placeholder {
  color: rgba(98, 92, 114, .48);
}
.emotion-wheel-submit-row {
  display: flex;
  min-height: 82px;
  padding: 17px 24px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(247, 246, 249, .54);
}
.emotion-wheel-submit-row p {
  flex: 1;
  margin: 0;
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.55;
}
.emotion-wheel-submit-row p.is-success { color: #5f735f; }
.emotion-wheel-submit-row p.is-error,
.emotion-wheel-empty.is-error { color: #a55f69; }
.emotion-wheel-submit {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 10px 22px;
  border: 1px solid rgba(88, 77, 139, .9);
  border-radius: 999px;
  background: #6d619f;
  color: #fff;
  font: 500 13px var(--font-sans);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(88, 77, 139, .2);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.emotion-wheel-submit:hover,
.emotion-wheel-submit:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 10px 26px rgba(88, 77, 139, .28);
}
.emotion-wheel-submit:disabled { cursor: wait; opacity: .62; }
.emotion-wheel-recent {
  margin-top: 28px;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
}
.emotion-wheel-recent-heading {
  padding: 28px 30px 8px;
}
.emotion-wheel-recent-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.emotion-wheel-recent-list {
  display: block;
  padding: 4px 30px 26px;
}
.emotion-wheel-record {
  position: relative;
  display: grid;
  grid-template-columns: 64px 24px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-width: 0;
  padding: 24px 0 30px;
  align-items: start;
  column-gap: 12px;
}
.emotion-wheel-record::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 88px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(115, 105, 151, .08), rgba(115, 105, 151, .32), rgba(115, 105, 151, .08));
  content: '';
}
.emotion-wheel-record-node {
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  width: 10px;
  height: 10px;
  margin: 4px auto 0;
  border: 3px solid rgba(255, 255, 255, .98);
  border-radius: 50%;
  background: rgba(105, 94, 157, .72);
  box-shadow: 0 0 0 4px rgba(105, 94, 157, .09);
}
.emotion-wheel-record-date {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  padding-top: 2px;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: rgba(83, 79, 91, .58);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.emotion-wheel-record-date strong {
  color: rgba(64, 60, 71, .78);
  font-size: 12px;
  font-weight: 500;
}
.emotion-wheel-record-content {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}
.emotion-wheel-record-main {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 16px;
}
.emotion-wheel-record-main > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}
.emotion-wheel-record-main span {
  color: var(--text-light);
  font-size: 11px;
}
.emotion-wheel-record-main strong {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emotion-wheel-record-main em {
  margin-left: 4px;
  color: rgba(76, 70, 96, .68);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-style: normal;
}
.emotion-wheel-record-context {
  display: flex;
  min-width: 0;
  margin-top: 10px;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 11px;
}
.emotion-wheel-record-context span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emotion-wheel-record-context i {
  flex: 0 0 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(98, 92, 104, .34);
}
.emotion-wheel-record-note {
  margin: 12px 0 0;
  color: rgba(62, 59, 69, .72);
  font-size: 11px;
  line-height: 1.7;
}
.emotion-wheel-record-response {
  position: relative;
  grid-column: 3;
  grid-row: 2;
  min-height: 54px;
  margin-top: 17px;
  padding: 18px 0 0 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.emotion-wheel-record-response::before {
  position: absolute;
  top: 12px;
  left: 0;
  color: rgba(105, 94, 157, .22);
  font-family: Georgia, serif;
  font-size: 34px;
  line-height: 1;
  content: '“';
}
.emotion-wheel-record-response::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(to right, rgba(105, 94, 157, .18), rgba(105, 94, 157, 0));
  content: '';
}
.emotion-wheel-record-response > span {
  display: block;
  margin-bottom: 6px;
  color: rgba(82, 76, 101, .52);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
}
.emotion-wheel-record-response p {
  margin: 0;
  max-width: 780px;
  color: rgba(54, 51, 62, .82);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.75;
}
.emotion-wheel-record-response.is-loading p,
.emotion-wheel-record-response.is-idle p,
.emotion-wheel-record-response.is-error p {
  color: rgba(88, 83, 91, .58);
  font-family: inherit;
  font-size: 11px;
}
.emotion-wheel-record-response button {
  margin-top: 9px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(92, 84, 123, .24);
  border-radius: 0;
  background: transparent;
  color: rgba(65, 61, 70, .74);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  line-height: 1.5;
}
.emotion-wheel-record-response button:hover,
.emotion-wheel-record-response button:focus-visible {
  border-bottom-color: rgba(76, 70, 84, .64);
  outline: none;
}
.emotion-wheel-empty {
  margin: 0;
  padding: 28px 24px;
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
}

/* Emotion memories live as a quiet, touchable field instead of a report list. */
.emotion-wheel-recent {
  position: relative;
  min-height: 340px;
  background:
    radial-gradient(circle at 12% 84%, rgba(220, 237, 231, .24), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(229, 222, 243, .22), transparent 26%),
    rgba(255, 255, 255, .94);
}
.emotion-wheel-recent-heading {
  display: flex;
  padding: 30px 34px 4px;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.emotion-wheel-recent-heading p {
  margin: 0;
  color: rgba(82, 76, 101, .5);
  font-size: 11px;
}
.emotion-bubble-field {
  display: flex;
  min-height: 270px;
  padding: 18px clamp(24px, 4vw, 52px) 38px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(14px, 2.2vw, 30px);
}
.emotion-bubble {
  position: relative;
  display: grid;
  width: calc(var(--bubble-size) + 16px);
  height: calc(var(--bubble-size) + 16px);
  padding: 8px;
  flex: 0 0 auto;
  place-items: center;
  overflow: visible;
  border: 0;
  background:
    transparent;
  color: #514b62;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.emotion-bubble-body {
  position: relative;
  display: flex;
  width: var(--bubble-size);
  height: var(--bubble-size);
  padding: 18px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .99) 0 24%, transparent 58%),
    radial-gradient(circle at 72% 78%, var(--bubble-tint), rgba(255, 255, 255, .98) 72%);
  box-shadow:
    inset 0 0 0 1px rgba(107, 98, 137, .045),
    inset -12px -16px 28px rgba(255, 255, 255, .5),
    0 16px 38px rgba(70, 62, 94, .09);
  animation: emotion-bubble-drift 7s ease-in-out infinite;
  animation-delay: var(--bubble-delay);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.emotion-bubble-body::before {
  position: absolute;
  top: 13%;
  left: 22%;
  width: 22%;
  height: 10%;
  transform: rotate(-24deg);
  border-radius: 50%;
  background: rgba(255, 255, 255, .72);
  filter: blur(3px);
  content: '';
}
.emotion-bubble:nth-child(3n + 2) { margin-top: 38px; }
.emotion-bubble:nth-child(4n) { margin-top: -22px; }
.emotion-bubble:hover,
.emotion-bubble:focus-visible {
  z-index: 2;
  outline: none;
}
.emotion-bubble:hover .emotion-bubble-body,
.emotion-bubble:focus-visible .emotion-bubble-body {
  animation-play-state: paused;
  transform: translateY(-5px) scale(1.045);
  border-color: rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 0 0 1px rgba(107, 98, 137, .055),
    0 22px 52px rgba(70, 62, 94, .15);
}
.emotion-bubble-date,
.emotion-bubble-primary,
.emotion-bubble strong,
.emotion-bubble em {
  position: relative;
  z-index: 1;
}
.emotion-bubble-date {
  color: rgba(75, 70, 88, .42);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}
.emotion-bubble-primary {
  margin-top: 8px;
  color: rgba(75, 70, 88, .54);
  font-size: 10px;
}
.emotion-bubble strong {
  margin-top: 2px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 600;
  line-height: 1.2;
}
.emotion-bubble em {
  margin-top: 8px;
  color: rgba(76, 70, 96, .7);
  font-size: 15px;
  font-style: normal;
}
.emotion-bubble em small { margin-left: 2px; font-size: 8px; }
.emotion-bubble-body > i {
  position: absolute;
  right: 19%;
  bottom: 16%;
  width: 6px;
  height: 6px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: rgba(102, 92, 153, .6);
  box-shadow: 0 0 0 3px rgba(102, 92, 153, .08);
}
@keyframes emotion-bubble-drift {
  0%, 100% { transform: translate3d(-3px, 2px, 0) rotate(-.5deg); }
  33% { transform: translate3d(3px, -4px, 0) rotate(.7deg); }
  66% { transform: translate3d(4px, 2px, 0) rotate(-.2deg); }
}

body.emotion-bubble-dialog-open { overflow: hidden; }
.emotion-bubble-dialog-backdrop {
  position: fixed;
  z-index: 4000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(50, 45, 63, .18);
  backdrop-filter: blur(14px) saturate(88%);
  -webkit-backdrop-filter: blur(14px) saturate(88%);
  animation: emotion-dialog-fade .22s ease both;
}
.emotion-bubble-dialog {
  position: relative;
  display: grid;
  width: min(820px, calc(100vw - 48px));
  max-height: min(700px, calc(100vh - 48px));
  padding: clamp(34px, 5vw, 58px);
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: clamp(34px, 5vw, 68px);
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 18%, var(--bubble-tint), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.99), rgba(251,250,252,.96));
  box-shadow: 0 30px 100px rgba(48, 42, 65, .22);
  outline: none;
  animation: emotion-dialog-rise .28s cubic-bezier(.2,.8,.2,1) both;
}
.emotion-bubble-dialog-close {
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 22px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(92,84,123,.12);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: rgba(67,62,79,.64);
  cursor: pointer;
  font: 300 24px/1 var(--font-sans);
}
.emotion-bubble-dialog-close:hover,
.emotion-bubble-dialog-close:focus-visible {
  border-color: rgba(92,84,123,.3);
  outline: none;
}
.emotion-bubble-dialog-orb {
  position: relative;
  display: flex;
  width: 210px;
  height: 210px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,.98) 0 20%, transparent 56%),
    radial-gradient(circle at 70% 76%, var(--bubble-tint), rgba(255,255,255,.96) 72%);
  box-shadow: inset 0 0 0 1px rgba(102,92,153,.04), 0 22px 52px rgba(69,62,92,.12);
}
.emotion-bubble-dialog-orb span { color: rgba(75,70,88,.52); font-size: 11px; }
.emotion-bubble-dialog-orb strong { margin-top: 4px; font-family: var(--font-serif); font-size: 32px; font-weight: 600; }
.emotion-bubble-dialog-orb em { margin-top: 12px; color: rgba(76,70,96,.68); font-size: 18px; font-style: normal; }
.emotion-bubble-dialog-orb small { margin-left: 2px; font-size: 9px; }
.emotion-bubble-dialog-kicker {
  margin: 0 0 8px;
  color: rgba(81,75,99,.48);
  font-size: 10px;
  letter-spacing: .12em;
}
.emotion-bubble-dialog-copy h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.35;
}
.emotion-bubble-dialog-meta {
  display: flex;
  margin-top: 18px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(81,75,99,.58);
  font-size: 11px;
}
.emotion-bubble-dialog-meta i { width: 3px; height: 3px; border-radius: 50%; background: rgba(81,75,99,.28); }
.emotion-bubble-dialog-note {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 1px solid rgba(92,84,123,.18);
  color: rgba(54,51,62,.68);
  font-size: 12px;
  line-height: 1.7;
}
.emotion-bubble-dialog-response {
  position: relative;
  margin-top: 24px;
  padding: 20px 22px;
  border: 1px solid rgba(92,84,123,.09);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.72), rgba(255,255,255,.42));
}
.emotion-bubble-dialog-response > span {
  display: block;
  margin-bottom: 8px;
  color: rgba(81,75,99,.5);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
}
.emotion-bubble-dialog-response p {
  margin: 0;
  color: rgba(48,45,56,.82);
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.8;
}
.emotion-bubble-dialog.is-loading .emotion-bubble-dialog-response p,
.emotion-bubble-dialog.is-error .emotion-bubble-dialog-response p,
.emotion-bubble-dialog.is-idle .emotion-bubble-dialog-response p {
  color: rgba(68,64,76,.62);
  font-family: var(--font-sans);
  font-size: 12px;
}
.emotion-bubble-dialog-response button {
  margin-top: 12px;
  padding: 7px 15px;
  border: 1px solid rgba(92,84,123,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: rgba(69,63,91,.78);
  cursor: pointer;
  font: 11px var(--font-sans);
}
.emotion-bubble-dialog-actions {
  display: flex;
  min-height: 32px;
  margin-top: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.emotion-bubble-dialog-actions p {
  margin: 0;
  color: #a45f68;
  font-size: 10px;
}
.emotion-bubble-dialog-delete {
  margin-left: auto;
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid rgba(142, 82, 91, .18);
  background: transparent;
  color: rgba(125, 75, 84, .56);
  cursor: pointer;
  font: 10px var(--font-sans);
}
.emotion-bubble-dialog-delete:hover,
.emotion-bubble-dialog-delete:focus-visible {
  border-bottom-color: rgba(142, 82, 91, .5);
  color: rgba(125, 75, 84, .84);
  outline: none;
}
.emotion-bubble-dialog-delete:disabled { cursor: wait; opacity: .4; }
.emotion-bubble-thinking { display: inline-block; width: 20px; animation: emotion-thinking 1.15s steps(4,end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes emotion-thinking { 0% { width: 4px; } 100% { width: 20px; } }
@keyframes emotion-dialog-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes emotion-dialog-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* Quick body scan */
.body-map-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 42px;
}
.body-map-layout {
  display: grid;
  grid-template-columns: minmax(360px, .86fr) minmax(430px, 1.14fr);
  align-items: start;
  gap: 20px;
}
.body-map-scan-panel,
.body-map-form,
.body-map-recent {
  overflow: hidden;
  border: 1px solid rgba(101, 93, 127, .09);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 8%, rgba(236, 231, 246, .38), transparent 30%),
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(252,251,253,.94));
  box-shadow: 0 20px 58px rgba(66, 58, 91, .065);
}
.body-map-scan-panel { padding: 28px 28px 22px; }
.body-map-heading > span {
  color: rgba(94, 84, 142, .66);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
}
.body-map-heading h1 {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.3;
}
.body-map-heading p {
  margin: 7px 0 0;
  color: var(--text-light);
  font-size: 12px;
}
.body-map-figure {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 3 / 4;
  margin: 18px auto 8px;
  overflow: hidden;
  border: 1px solid rgba(105, 96, 135, .08);
  border-radius: 44% 44% 28px 28px;
  background:
    radial-gradient(circle at 50% 42%, rgba(233, 228, 244, .5), transparent 38%),
    radial-gradient(circle at 50% 75%, rgba(221, 236, 233, .32), transparent 32%),
    rgba(255,255,255,.72);
}
.body-map-figure::before {
  position: absolute;
  inset: 8% 14%;
  border: 1px dashed rgba(100, 91, 142, .09);
  border-radius: 50%;
  content: '';
}
.body-map-figure svg {
  position: absolute;
  top: 8%;
  bottom: 5%;
  left: 50%;
  width: 48%;
  height: 87%;
  transform: translateX(-50%);
  overflow: visible;
}
.body-map-figure svg circle,
.body-map-figure svg path {
  fill: url(#body-map-fill);
  stroke: rgba(91, 82, 126, .2);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.body-map-figure svg path:not(:first-of-type) { fill: none; }
.body-map-figure svg .body-map-breath-line {
  stroke: rgba(129, 112, 181, .22);
  stroke-dasharray: 5 7;
}
.body-map-zone {
  position: absolute;
  z-index: 2;
  top: var(--zone-y);
  left: var(--zone-x);
  display: inline-flex;
  min-width: 62px;
  min-height: 30px;
  padding: 6px 9px;
  transform: translate(-50%, -50%);
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(105,96,135,.12);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), var(--zone-tint));
  color: rgba(74, 68, 91, .74);
  cursor: pointer;
  font: 10px var(--font-sans);
  box-shadow: 0 7px 18px rgba(66,58,91,.06);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.body-map-zone i {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(105,92,160,.42);
  box-shadow: 0 0 0 4px rgba(105,92,160,.07);
}
.body-map-zone:hover,
.body-map-zone:focus-visible,
.body-map-zone.is-selected {
  transform: translate(-50%, -50%) scale(1.055);
  border-color: rgba(105,92,160,.34);
  outline: none;
  box-shadow: 0 10px 24px rgba(66,58,91,.12);
}
.body-map-zone.is-selected { color: var(--primary-dark); font-weight: 500; }
.body-map-safety {
  margin: 14px auto 0;
  max-width: 390px;
  color: rgba(76, 70, 91, .5);
  font-size: 9px;
  line-height: 1.65;
  text-align: center;
}
.body-map-form { background: rgba(255,255,255,.94); }
.body-map-field {
  position: relative;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(91,84,116,.085);
}
.body-map-field.is-muted { background: rgba(247,246,249,.48); }
.body-map-field > .body-map-step {
  position: absolute;
  top: 23px;
  left: 26px;
}
.body-map-step {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(103,92,158,.18);
  border-radius: 50%;
  color: var(--primary-dark);
  font-size: 8px;
  font-weight: 600;
}
.body-map-field > h2,
.body-map-field > p { margin-left: 36px; }
.body-map-field h2 {
  color: #49445b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.body-map-field > p {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 11px;
}
.body-map-chips {
  display: flex;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.body-map-chip {
  min-height: 34px;
  padding: 7px 14px;
  border: 1px solid rgba(102,94,129,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #625c72;
  cursor: pointer;
  font: 11px var(--font-sans);
}
.body-map-chip:hover,
.body-map-chip:focus-visible,
.body-map-chip.is-selected {
  border-color: rgba(103,92,158,.34);
  outline: none;
  background: linear-gradient(145deg, #fff, rgba(233,229,243,.84));
  color: var(--primary-dark);
}
.body-map-chip:disabled { cursor: not-allowed; opacity: .4; }
.body-map-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.body-map-field-label > div { display: flex; align-items: center; gap: 12px; }
.body-map-field-label output { display: flex; align-items: baseline; gap: 4px; color: var(--primary-dark); }
.body-map-field-label output strong { font-size: 22px; }
.body-map-field-label output span { color: var(--text-light); font-size: 10px; }
.body-map-field textarea { width: 100%; }
.body-map-submit-row {
  display: flex;
  min-height: 82px;
  padding: 16px 26px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.body-map-submit-row p { margin: 0; color: rgba(71,98,75,.78); font-size: 11px; }
.body-map-submit-row p.is-error,
.body-map-empty.is-error { color: #a45f68; }
.body-map-recent { margin-top: 20px; padding: 28px 30px 34px; }
.body-map-recent-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
}
.body-map-recent-list {
  display: grid;
  margin-top: 22px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
}
.body-map-empty { grid-column: 1 / -1; padding: 34px 20px; color: var(--text-light); font-size: 11px; text-align: center; }
.body-map-mark {
  position: relative;
  display: flex;
  min-height: 158px;
  padding: 18px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  overflow: hidden;
  border: 1px solid rgba(105,96,135,.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 74% 20%, var(--mark-tint), transparent 40%),
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(250,249,252,.9));
  color: #514b62;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 10px 28px rgba(66,58,91,.055);
  transition: transform .2s ease, box-shadow .2s ease;
}
.body-map-mark::before {
  position: absolute;
  top: 18px;
  right: 18px;
  width: calc(14px + var(--mark-level) * 1.2px);
  height: calc(14px + var(--mark-level) * 1.2px);
  border: 1px solid rgba(105,92,160,.18);
  border-radius: 50%;
  background: var(--mark-tint);
  box-shadow: 0 0 0 7px rgba(105,92,160,.035);
  content: '';
}
.body-map-mark:hover,
.body-map-mark:focus-visible { transform: translateY(-2px); outline: none; box-shadow: 0 15px 34px rgba(66,58,91,.1); }
.body-map-mark > span { color: rgba(75,70,88,.42); font-size: 9px; letter-spacing: .08em; }
.body-map-mark > small { margin-top: 18px; color: rgba(75,70,88,.54); font-size: 10px; }
.body-map-mark > strong { margin-top: 2px; font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.body-map-mark > em { margin-top: 7px; color: rgba(76,70,96,.68); font-size: 13px; font-style: normal; }
.body-map-mark > em i { font-size: 8px; font-style: normal; }
.body-map-dialog { background: radial-gradient(circle at 12% 18%, var(--mark-tint), transparent 34%), linear-gradient(145deg, #fff, rgba(251,250,252,.97)); }
.body-map-dialog-orb {
  display: flex;
  width: 210px;
  height: 210px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 44% 56% 50% 50%;
  background: radial-gradient(circle at 32% 24%, #fff 0 20%, transparent 56%), radial-gradient(circle at 70% 76%, var(--mark-tint), #fff 72%);
  box-shadow: 0 22px 52px rgba(69,62,92,.11);
}
.body-map-dialog-orb span { color: rgba(75,70,88,.52); font-size: 11px; }
.body-map-dialog-orb strong { margin-top: 4px; font-family: var(--font-serif); font-size: 31px; font-weight: 600; }
.body-map-dialog-orb em { margin-top: 12px; color: rgba(76,70,96,.68); font-size: 18px; font-style: normal; }
.body-map-dialog-orb small { margin-left: 2px; font-size: 9px; }

/* Body atlas: front and back, multi-region observation */
.body-map-atlas {
  overflow: hidden;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid rgba(91, 84, 116, .09);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 12%, rgba(229, 239, 236, .42), transparent 25%),
    radial-gradient(circle at 82% 8%, rgba(236, 231, 244, .46), transparent 24%),
    rgba(255, 255, 255, .96);
  box-shadow: 0 24px 64px rgba(66, 58, 91, .065);
}
.body-map-atlas-bar {
  display: flex;
  padding: 0 2px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(91, 84, 116, .08);
}
.body-map-atlas-bar p {
  margin: 0;
  color: #4d485e;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 24px);
}
.body-map-atlas-bar > span {
  flex: 0 0 auto;
  color: rgba(74, 68, 91, .48);
  font-size: 10px;
}
.body-map-atlas-bar strong { color: var(--primary-dark); font-size: 14px; }
.body-map-models {
  display: grid;
  width: min(900px, 100%);
  margin: 24px auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 28px);
}
.body-map-model {
  position: relative;
  min-width: 0;
  padding: 36px clamp(10px, 2vw, 24px) 18px;
  overflow: hidden;
  border: 1px solid rgba(100, 92, 126, .075);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgba(237, 233, 245, .34), transparent 34%),
    linear-gradient(165deg, rgba(255,255,255,.86), rgba(248,250,249,.68));
}
.body-map-model::after {
  position: absolute;
  inset: 13% 10% 5%;
  border: 1px dashed rgba(101, 93, 127, .075);
  border-radius: 48%;
  content: '';
  pointer-events: none;
}
.body-map-model-label {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 18px;
  padding: 4px 10px;
  border: 1px solid rgba(103, 92, 158, .1);
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  color: rgba(79, 72, 103, .62);
  font-size: 9px;
  letter-spacing: .12em;
}
.body-map-atlas .body-map-figure {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  aspect-ratio: 280 / 620;
  margin: 0 auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.body-map-atlas .body-map-figure::before { display: none; }
.body-map-atlas .body-map-figure svg {
  position: static;
  width: 100%;
  height: 100%;
  transform: none;
  overflow: visible;
  filter: drop-shadow(0 18px 28px rgba(72, 65, 96, .075));
}
.body-map-atlas .body-map-figure svg .body-shape {
  fill: url(#body-silhouette-front);
  stroke: rgba(91, 82, 126, .26);
  stroke-width: 1.35;
}
.body-map-atlas .body-map-silhouette {
  transform: scaleX(1.13);
  transform-box: fill-box;
  transform-origin: center;
}
.body-map-atlas .body-map-figure--back svg .body-shape { fill: url(#body-silhouette-back); }
.body-map-atlas .body-map-figure svg .body-detail {
  fill: none;
  stroke: rgba(91, 82, 126, .14);
  stroke-width: 1.1;
}
.body-map-hotspot {
  position: absolute;
  z-index: 4;
  top: var(--hotspot-y);
  left: var(--hotspot-x);
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 1px solid rgba(103, 92, 158, .28);
  border-radius: 50%;
  background: rgba(255,255,255,.91);
  color: var(--primary-dark);
  cursor: pointer;
  font: 600 8px var(--font-sans);
  box-shadow: 0 0 0 5px rgba(108, 96, 157, .055), 0 6px 16px rgba(67,60,92,.1);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.body-map-hotspot::before {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(103,92,158,.09);
  border-radius: inherit;
  content: '';
}
.body-map-hotspot span { position: relative; z-index: 1; }
.body-map-hotspot em {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  width: max-content;
  padding: 4px 8px;
  transform: translateY(-50%) translateX(-3px);
  border: 1px solid rgba(103,92,158,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: rgba(75,69,94,.72);
  font: normal 8px var(--font-sans);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 5px 16px rgba(67,60,92,.06);
}
.body-map-model--back .body-map-hotspot em { right: calc(100% + 10px); left: auto; }
.body-map-hotspot:hover,
.body-map-hotspot:focus-visible {
  transform: translate(-50%, -50%) scale(1.12);
  outline: none;
  box-shadow: 0 0 0 7px rgba(108,96,157,.07), 0 8px 20px rgba(67,60,92,.14);
}
.body-map-hotspot:hover em,
.body-map-hotspot:focus-visible em { transform: translateY(-50%); opacity: 1; }
.body-map-hotspot.is-selected {
  border-color: rgba(91, 133, 117, .42);
  background: linear-gradient(145deg, #fff, rgba(222,238,231,.92));
  color: #4f7567;
  box-shadow: 0 0 0 7px rgba(91,133,117,.075), 0 8px 20px rgba(67,60,92,.1);
}
.body-map-observation-tray {
  display: flex;
  min-height: 62px;
  margin-top: 22px;
  padding: 12px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid rgba(101, 93, 127, .075);
  border-radius: 20px;
  background: rgba(248, 248, 250, .58);
}
.body-map-observation-tray > p {
  width: 100%;
  margin: 0;
  color: rgba(75, 70, 88, .42);
  font-size: 10px;
  text-align: center;
}
.body-map-observation-tray > article {
  position: relative;
  min-width: 148px;
  border: 1px solid rgba(101,93,127,.1);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
}
.body-map-observation-edit {
  display: grid;
  width: 100%;
  min-height: 52px;
  padding: 10px 34px 10px 42px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #514b62;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.body-map-observation-edit > span {
  position: absolute;
  top: 50%;
  left: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  place-items: center;
  border-radius: 50%;
  background: rgba(232, 239, 236, .9);
  color: #527163;
  font-size: 8px;
}
.body-map-observation-edit strong { font-size: 11px; font-weight: 600; }
.body-map-observation-edit small { margin-top: 2px; color: rgba(75,70,88,.5); font-size: 9px; }
.body-map-observation-remove {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 11px;
  width: 20px;
  height: 28px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: rgba(75,70,88,.38);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  text-align: center;
}
.body-map-observation-edit:hover,
.body-map-observation-edit:focus-visible,
.body-map-observation-remove:hover,
.body-map-observation-remove:focus-visible { outline: none; color: var(--primary-dark); }
.body-map-final-action {
  display: flex;
  min-height: 70px;
  padding: 16px 2px 0;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}
.body-map-final-action p { margin: 0 auto 0 0; color: rgba(71,98,75,.78); font-size: 10px; }
.body-map-final-action p.is-error { color: #a45f68; }
.body-map-final-action .emotion-wheel-submit { width: auto; min-width: 180px; }
.body-map-atlas > .body-map-safety { max-width: none; margin-top: 2px; text-align: left; }

.body-map-region-backdrop {
  position: fixed;
  z-index: 1300;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  overflow-y: auto;
  background: rgba(43, 39, 56, .16);
  opacity: 0;
  backdrop-filter: blur(10px);
  animation: emotion-dialog-fade .22s ease forwards;
}
.body-map-region-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  padding: clamp(26px, 4vw, 42px);
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.94);
  border-radius: 30px;
  outline: none;
  background:
    radial-gradient(circle at 88% 5%, rgba(232,239,236,.65), transparent 24%),
    linear-gradient(155deg, rgba(255,255,255,.99), rgba(249,248,251,.98));
  box-shadow: 0 30px 90px rgba(55,48,76,.18);
  animation: emotion-dialog-rise .28s cubic-bezier(.22,.8,.22,1) both;
}
.body-map-region-dialog header > span {
  color: rgba(95,84,142,.62);
  font-size: 9px;
  letter-spacing: .12em;
}
.body-map-region-dialog header h2 {
  margin: 7px 44px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 600;
  line-height: 1.35;
}
.body-map-region-meanings {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.body-map-region-meanings article {
  padding: 17px 18px;
  border: 1px solid rgba(101,93,127,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.7);
}
.body-map-region-meanings span { color: rgba(80,110,97,.72); font-size: 9px; letter-spacing: .08em; }
.body-map-region-meanings p { margin: 7px 0 0; color: rgba(72,66,88,.72); font-size: 11px; line-height: 1.75; }
.body-map-region-disclaimer { margin: 10px 2px 0; color: rgba(75,70,88,.42); font-size: 9px; }
.body-map-region-question { margin-top: 24px; }
.body-map-region-question h3 { margin: 0; color: #4d485e; font-size: 13px; font-weight: 600; }
.body-map-region-question .body-map-chips { margin-top: 12px; }
.body-map-region-question .emotion-wheel-range { margin-top: 18px; }
.body-map-region-actions {
  display: flex;
  margin-top: 28px;
  justify-content: flex-end;
  gap: 9px;
}
.body-map-region-actions button {
  min-width: 100px;
  padding: 10px 18px;
  border: 1px solid rgba(103,92,158,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  color: #5d576d;
  cursor: pointer;
  font: 11px var(--font-sans);
}
.body-map-region-actions button:last-child {
  border-color: transparent;
  background: #6e62a5;
  color: #fff;
}
.body-map-region-actions button:disabled { cursor: not-allowed; opacity: .42; }
.body-map-dialog-regions {
  display: grid;
  align-content: start;
  gap: 8px;
}
.body-map-dialog-regions article {
  display: grid;
  padding: 12px 14px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(101,93,127,.08);
  border-radius: 15px;
  background: rgba(255,255,255,.62);
}
.body-map-dialog-regions article > span { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: rgba(232,239,236,.9); color: #527163; font-size: 8px; }
.body-map-dialog-regions div { display: grid; gap: 2px; }
.body-map-dialog-regions small { color: rgba(75,70,88,.45); font-size: 8px; }
.body-map-dialog-regions strong { color: #504a61; font-size: 11px; font-weight: 600; }
.body-map-dialog-regions em { color: rgba(95,84,142,.7); font-size: 10px; font-style: normal; }

@media (min-width: 769px) {
  body.app-shell-active.page-context-nested #page-toolbox.active {
    padding-top: calc(var(--page-context-height) + 24px);
  }
  .emotion-wheel-static {
    position: sticky;
    top: 0;
  }
  .body-map-scan-panel {
    position: sticky;
    top: 0;
  }
}

@media (max-width: 980px) and (min-width: 769px) {
  .emotion-wheel-record-response p { max-width: 620px; }
}

@media (min-width: 1200px) {
  .emotion-wheel-record {
    grid-template-columns: 64px 24px minmax(260px, .72fr) minmax(380px, 1.28fr);
    grid-template-rows: auto;
    column-gap: clamp(18px, 2.2vw, 38px);
  }
  .emotion-wheel-record-content {
    grid-column: 3;
    grid-row: 1;
  }
  .emotion-wheel-record-response {
    grid-column: 4;
    grid-row: 1;
    min-height: 100%;
    margin-top: 0;
    padding: 4px 0 0 36px;
  }
  .emotion-wheel-record-response::before {
    top: 1px;
    left: 12px;
  }
  .emotion-wheel-record-response::after {
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    height: auto;
    background: linear-gradient(to bottom, rgba(105, 94, 157, 0), rgba(105, 94, 157, .2), rgba(105, 94, 157, 0));
  }
  .emotion-wheel-record-response p { max-width: none; }
}

@media (max-width: 768px) {
  body.page-context-nested #page-toolbox.active {
    padding-top: calc(var(--app-chrome-height) + 12px);
  }
  .home-welcome-copy h1 {
    font-size: clamp(22px, 6vw, 26px);
  }
  .home-welcome-name,
  .home-welcome-return {
    display: block;
  }
  .home-tools-panel .home-tool-card {
    cursor: pointer;
  }
  .home-tool-detail-shell {
    padding: 14px;
    border-radius: 22px;
  }
  .home-tool-detail-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 14px;
  }
  .home-tool-detail-hero img {
    height: 190px;
  }
  .home-tool-detail-hero h1 {
    font-size: 28px;
  }
  .home-tool-detail-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .home-tool-detail-actions button {
    min-height: 92px;
    padding: 18px;
  }
  .emotion-wheel-page {
    width: calc(100% - 20px);
    margin-bottom: 28px;
  }
  .emotion-wheel-static { position: static; }
  .emotion-wheel-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 4px;
  }
  .emotion-wheel-picker {
    position: static;
    padding: 18px 14px;
    border-radius: 22px;
  }
  .emotion-wheel-disc { width: min(100%, 390px); }
  .emotion-wheel-form { border-radius: 22px; }
  .emotion-wheel-field { padding: 19px 17px; }
  .emotion-wheel-submit-row { padding: 15px 17px; }
  .emotion-wheel-recent { margin-top: 16px; border-radius: 22px; }
  .emotion-wheel-recent-heading { display: block; padding: 22px 20px 4px; }
  .emotion-wheel-recent-heading p { margin-top: 6px; line-height: 1.5; }
  .emotion-bubble-field {
    min-height: 220px;
    padding: 16px 12px 28px;
    gap: 8px;
  }
  .emotion-bubble {
    width: calc(var(--bubble-size) + 12px);
    height: calc(var(--bubble-size) + 12px);
    padding: 6px;
  }
  .emotion-bubble:nth-child(3n + 2) { margin-top: 22px; }
  .emotion-bubble:nth-child(4n) { margin-top: -10px; }
  .emotion-bubble-dialog-backdrop { padding: 12px; align-items: end; }
  .emotion-bubble-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 46px 24px 28px;
    grid-template-columns: 1fr;
    gap: 24px;
    border-radius: 28px;
  }
  .emotion-bubble-dialog-orb { width: 148px; height: 148px; margin: 0 auto; }
  .emotion-bubble-dialog-orb strong { font-size: 25px; }
  .emotion-bubble-dialog-copy h2 { font-size: 25px; text-align: center; }
  .emotion-bubble-dialog-kicker { text-align: center; }
  .emotion-bubble-dialog-meta { justify-content: center; }
  .body-map-page { width: calc(100% - 20px); margin-bottom: 28px; }
  .body-map-atlas { padding: 18px 12px; border-radius: 22px; }
  .body-map-atlas-bar { padding: 0 3px 15px; align-items: flex-start; }
  .body-map-atlas-bar p { max-width: 230px; font-size: 17px; line-height: 1.5; }
  .body-map-models { margin-top: 14px; gap: 8px; }
  .body-map-model { padding: 34px 4px 10px; border-radius: 19px; }
  .body-map-model-label { top: 11px; left: 11px; padding: 3px 8px; font-size: 8px; }
  .body-map-atlas .body-map-figure { width: min(100%, 220px); }
  .body-map-hotspot { width: 21px; height: 21px; }
  .body-map-hotspot::before { inset: -6px; }
  .body-map-hotspot em { display: none; }
  .body-map-observation-tray { min-height: 58px; margin-top: 14px; padding: 8px; border-radius: 16px; }
  .body-map-observation-tray > article { width: 100%; min-width: 0; }
  .body-map-final-action { align-items: stretch; flex-direction: column; gap: 9px; }
  .body-map-final-action .emotion-wheel-submit { width: 100%; }
  .body-map-atlas > .body-map-safety { text-align: center; }
  .body-map-region-backdrop { padding: 12px; align-items: end; }
  .body-map-region-dialog { width: 100%; max-height: calc(100vh - 24px); padding: 28px 20px 22px; border-radius: 27px; }
  .body-map-region-meanings { grid-template-columns: 1fr; }
  .body-map-region-actions { position: sticky; bottom: -22px; padding: 12px 0 0; background: linear-gradient(transparent, rgba(250,249,251,.98) 32%); }
  .body-map-region-actions button { flex: 1; }
  .body-map-dialog { grid-template-columns: 1fr; }
  .body-map-layout { grid-template-columns: 1fr; gap: 16px; }
  .body-map-scan-panel { padding: 22px 16px 18px; border-radius: 22px; }
  .body-map-figure { width: min(100%, 350px); }
  .body-map-form,
  .body-map-recent { border-radius: 22px; }
  .body-map-field { padding: 20px 18px; }
  .body-map-field > .body-map-step { top: 21px; left: 18px; }
  .body-map-submit-row { padding: 16px 18px; align-items: stretch; flex-direction: column; gap: 10px; }
  .body-map-submit-row .emotion-wheel-submit { width: 100%; }
  .body-map-recent { padding: 22px 18px 26px; }
  .body-map-recent-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .body-map-dialog-orb { width: 148px; height: 148px; margin: 0 auto; }
  .body-map-dialog-orb strong { font-size: 25px; }
}

@media (max-width: 430px) {
  .home-welcome-copy h1 {
    font-size: 22px;
  }
  .home-tool-copy strong {
    font-size: 19px;
  }
  .home-tool-copy > span {
    font-size: 11px;
  }
  .emotion-wheel-disc { width: 318px; max-width: 100%; }
  .emotion-wheel-disc::before { inset: 45px; }
  .emotion-wheel-center { width: 106px; height: 106px; padding: 12px; }
  .emotion-wheel-center strong { font-size: 17px; }
  .emotion-wheel-center small { max-width: 78px; font-size: 8px; }
  .emotion-wheel-primary-slot {
    top: var(--wheel-mobile-y);
    left: var(--wheel-mobile-x);
  }
  .emotion-wheel-primary {
    width: 70px;
    height: 46px;
    min-height: 46px;
    padding: 7px 4px;
    overflow: hidden;
    border-radius: 14px;
  }
  .emotion-wheel-primary strong { font-size: 15px; }
  .emotion-wheel-primary span { max-width: 60px; overflow: hidden; font-size: 7.5px; text-overflow: ellipsis; }
  .emotion-bubble {
    width: calc(var(--bubble-size) + 10px);
    height: calc(var(--bubble-size) + 10px);
    padding: 5px;
  }
  .emotion-bubble strong { font-size: 20px; }
  .emotion-bubble-dialog-response { padding: 17px 18px; }
  .emotion-wheel-field-label { align-items: center; }
  .emotion-wheel-submit-row { align-items: stretch; flex-direction: column; gap: 10px; }
  .emotion-wheel-submit { width: 100%; }
  .emotion-wheel-record-main { gap: 10px; }
  .emotion-wheel-record-main strong { font-size: 19px; }
  .emotion-wheel-record-response { padding-left: 23px; }
  .body-map-heading h1 { font-size: 27px; }
  .body-map-atlas { padding-right: 9px; padding-left: 9px; }
  .body-map-atlas-bar p { max-width: 210px; font-size: 15px; }
  .body-map-atlas-bar > span { font-size: 8px; }
  .body-map-models { gap: 6px; }
  .body-map-model { padding-right: 1px; padding-left: 1px; }
  .body-map-hotspot { width: 19px; height: 19px; box-shadow: 0 0 0 4px rgba(108,96,157,.05), 0 5px 12px rgba(67,60,92,.08); }
  .body-map-figure { width: 310px; max-width: 100%; }
  .body-map-zone { min-width: 54px; min-height: 27px; padding: 5px 7px; font-size: 8px; }
  .body-map-zone i { width: 4px; height: 4px; }
  .body-map-field-label { align-items: flex-start; }
  .body-map-field-label output { flex-direction: column; align-items: flex-end; gap: 0; }
  .body-map-mark { min-height: 142px; padding: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .emotion-wheel-orbit,
  .emotion-wheel-primary-slot {
    animation: none;
  }
}

/* Centered emotion wheel and modal question flow */
.emotion-wheel-layout--centered {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 0;
  place-items: start center;
}
.emotion-wheel-layout--centered .emotion-wheel-static {
  position: static;
  top: auto;
  width: 100%;
  max-width: 590px;
}
.emotion-wheel-layout--centered .emotion-wheel-picker {
  width: 100%;
  padding: 24px;
}
.emotion-wheel-layout--centered .emotion-wheel-disc { margin-right: auto; margin-left: auto; }
.emotion-wheel-question-backdrop {
  position: fixed;
  z-index: 1320;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  overflow-y: auto;
  background: rgba(47, 43, 59, .3);
  backdrop-filter: blur(10px);
  animation: emotion-dialog-fade .2s ease both;
}
.emotion-wheel-question-dialog {
  position: relative;
  width: min(680px, 100%);
  min-height: 430px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 30px;
  outline: none;
  background: #fff;
  box-shadow: 0 32px 92px rgba(46, 40, 65, .2);
  animation: emotion-dialog-rise .28s cubic-bezier(.22,.8,.22,1) both;
}
.emotion-wheel-question-dialog .emotion-wheel-question-shell {
  min-height: 430px;
  padding: 34px 38px 28px;
}
.emotion-wheel-question-dialog .emotion-wheel-question-progress {
  width: auto;
  margin: 0 auto;
  justify-content: center;
  gap: 8px;
}
.emotion-wheel-question-dialog .emotion-wheel-question-progress i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(111, 100, 149, .13);
}
.emotion-wheel-question-dialog .emotion-wheel-question-progress i.is-complete { background: rgba(111, 100, 149, .34); }
.emotion-wheel-question-dialog .emotion-wheel-question-progress i.is-active {
  transform: scale(1.35);
  background: rgba(103, 92, 158, .74);
}
.emotion-wheel-question-dialog .emotion-wheel-question-stage {
  display: flex;
  min-height: 280px;
  margin: 0;
  padding: 58px 18px 26px;
  flex-direction: column;
  justify-content: center;
  border: 0;
  background: transparent;
}
.emotion-wheel-question-dialog .emotion-wheel-question-stage h2,
.emotion-wheel-question-dialog .emotion-wheel-note-label {
  margin: 0;
  color: #49445b;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
}
.emotion-wheel-question-dialog .emotion-wheel-chips { margin-top: 24px; }
.emotion-wheel-question-dialog .emotion-wheel-field { border-bottom: 0; }
.emotion-wheel-question-dialog .emotion-wheel-question-footer {
  min-height: 26px;
  padding: 0 18px;
  border-top: 0;
}
.emotion-wheel-question-dialog .emotion-wheel-question-footer > button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: rgba(80, 73, 100, .5);
  cursor: pointer;
  font: 10px var(--font-sans);
  text-decoration: none;
}
.emotion-wheel-question-dialog .emotion-wheel-submit-row {
  margin-top: 22px;
  border: 0;
}
.emotion-wheel-inflation {
  display: grid;
  min-height: 88px;
  margin-top: 30px;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
}
.emotion-wheel-inflation-button {
  display: grid;
  width: min(calc(19px + var(--inflation-level) * 3.4px), 52px);
  height: min(calc(19px + var(--inflation-level) * 3.4px), 52px);
  margin: 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(104, 94, 139, .14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 27%, rgba(255,255,255,.98) 0 18%, transparent 46%),
    radial-gradient(circle at 65% 72%, rgba(229, 225, 240, .7), rgba(255,255,255,.96) 72%);
  color: rgba(73, 67, 91, .56);
  cursor: pointer;
  font: 9px var(--font-sans);
  box-shadow: 0 7px 18px rgba(67,60,92,.055);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.emotion-wheel-inflation-button:hover,
.emotion-wheel-inflation-button:focus-visible {
  transform: translateY(-3px) scale(1.04);
  border-color: rgba(103,92,158,.38);
  outline: none;
}
.emotion-wheel-inflation-button.is-selected {
  border-color: rgba(103,92,158,.42);
  background:
    radial-gradient(circle at 32% 27%, #fff 0 18%, transparent 46%),
    radial-gradient(circle at 68% 72%, rgba(197, 190, 222, .9), rgba(245,243,249,.98) 72%);
  color: var(--primary-dark);
  box-shadow: 0 0 0 6px rgba(103,92,158,.06), 0 10px 24px rgba(67,60,92,.12);
}
.emotion-wheel-inflation-scale {
  display: grid;
  margin-top: 14px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: rgba(75,70,88,.4);
  font-size: 9px;
}
.emotion-wheel-inflation-scale strong { color: rgba(95,84,142,.7); font-size: 10px; font-weight: 500; }
.emotion-wheel-inflation-scale span:last-child { text-align: right; }

/* Compact body atlas and opaque stepped region dialog */
.body-map-page { width: min(1060px, calc(100% - 32px)); }
.body-map-atlas {
  display: grid;
  height: min(700px, calc(100dvh - 120px));
  min-height: 610px;
  max-height: calc(100dvh - 120px);
  padding: 18px 22px 14px;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
}
.body-map-atlas-bar { min-height: 36px; padding: 0 2px 11px; }
.body-map-atlas-bar p {
  display: flex;
  margin: 0;
  align-items: baseline;
  gap: 8px;
  color: #595365;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
}
.body-map-atlas-bar p small { color: rgba(75,70,88,.42); font-size: 9px; font-weight: 400; }
.body-map-models {
  width: min(760px, 100%);
  min-height: 0;
  margin-top: 12px;
  gap: 14px;
}
.body-map-model {
  display: grid;
  min-height: 0;
  padding: 28px 8px 8px;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(255,255,255,.96), rgba(248,249,250,.76));
}
.body-map-atlas .body-map-figure {
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 430px;
  aspect-ratio: 280 / 620;
}
.body-map-atlas .body-map-figure svg .body-shape {
  fill: url(#body-silhouette-front);
  stroke: rgba(88, 81, 119, .25);
  stroke-width: 1.45;
}
.body-map-atlas .body-map-figure--back svg .body-shape { fill: url(#body-silhouette-back); }
.body-map-hotspot { width: 21px; height: 21px; }
.body-map-observation-tray {
  min-height: 50px;
  margin-top: 10px;
  padding: 7px;
  border-radius: 15px;
}
.body-map-observation-tray > article { min-width: 138px; }
.body-map-observation-edit { min-height: 42px; padding-top: 7px; padding-bottom: 7px; }
.body-map-final-action { min-height: 54px; padding-top: 9px; }
.body-map-final-action .emotion-wheel-submit { min-width: 168px; min-height: 40px; padding: 9px 20px; }
.body-map-atlas > .body-map-safety { margin-top: 0; font-size: 8px; }
.body-map-recent { margin-top: 14px; }

.body-map-region-backdrop {
  background: rgba(47, 43, 59, .32);
  backdrop-filter: blur(10px);
}
.body-map-region-dialog {
  width: min(650px, 100%);
  min-height: 430px;
  padding: 30px 34px 26px;
  border: 1px solid rgba(255,255,255,.96);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 32px 92px rgba(46,40,65,.2);
}
.body-map-region-dialog > header {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.body-map-region-progress { display: flex; gap: 7px; }
.body-map-region-progress i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(111,100,149,.13);
}
.body-map-region-progress i.is-complete { background: rgba(111,100,149,.34); }
.body-map-region-progress i.is-active { transform: scale(1.3); background: rgba(103,92,158,.74); }
.body-map-region-stage {
  display: flex;
  min-height: 330px;
  padding: 38px 4px 0;
  flex-direction: column;
  justify-content: center;
  animation: emotion-question-arrive .3s cubic-bezier(.22,.8,.22,1) both;
}
.body-map-region-stage h2 {
  margin: 0;
  color: #49445b;
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
}
.body-map-region-stage > .body-map-chips { margin-top: 24px; }
.body-map-region-meanings { margin-top: 20px; }
.body-map-region-meanings article { background: rgba(249,249,250,.86); }
.body-map-region-actions { margin-top: auto; padding-top: 22px; }
.body-map-dialog-backdrop {
  background: rgba(47,43,59,.34);
  opacity: 1;
  backdrop-filter: blur(10px);
  animation: none;
}
.emotion-bubble-dialog.body-map-dialog {
  opacity: 1;
  border: 1px solid rgba(255,255,255,.96);
  background: #fff;
  box-shadow: 0 32px 92px rgba(46,40,65,.22);
  transform: none;
  animation: none;
}

@media (max-width: 768px) {
  .emotion-wheel-layout--centered .emotion-wheel-picker { padding: 18px 14px; }
  .emotion-wheel-question-backdrop { padding: 12px; align-items: end; }
  .emotion-wheel-question-dialog {
    width: 100%;
    min-height: 440px;
    max-height: calc(100dvh - 24px);
    border-radius: 27px;
  }
  .emotion-wheel-question-dialog .emotion-wheel-question-shell { min-height: 440px; padding: 30px 18px 22px; }
  .emotion-wheel-question-dialog .emotion-wheel-question-stage { min-height: 310px; padding: 44px 2px 22px; }
  .emotion-wheel-inflation { min-height: 138px; grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 12px; }
  .body-map-page { width: calc(100% - 20px); }
  .body-map-atlas {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 14px 10px 12px;
    overflow: visible;
  }
  .body-map-atlas-bar p { display: grid; gap: 2px; font-size: 11px; }
  .body-map-atlas-bar p small { font-size: 8px; }
  .body-map-models { height: 390px; margin-top: 10px; }
  .body-map-model { padding: 28px 1px 7px; }
  .body-map-atlas .body-map-figure { max-height: 350px; }
  .body-map-observation-tray { margin-top: 9px; }
  .body-map-region-dialog { min-height: 470px; padding: 26px 20px 20px; background: #fff; }
  .body-map-region-stage { min-height: 380px; padding-top: 34px; }
  .body-map-region-meanings { grid-template-columns: 1fr; }
  .emotion-bubble-dialog.body-map-dialog { background: #fff; }
}

@media (max-width: 430px) {
  .emotion-wheel-layout--centered .emotion-wheel-static { max-width: 100%; }
  .body-map-models { height: 365px; gap: 6px; }
  .body-map-hotspot { width: 18px; height: 18px; }
}

/* Hold-to-feel controls and full-width wheel refinement */
.emotion-wheel-layout--centered .emotion-wheel-static { max-width: none; }
.emotion-wheel-layout--centered .emotion-wheel-picker { width: 100%; }
.emotion-wheel-layout--centered .emotion-wheel-disc { width: min(100%, 600px); }
.emotion-wheel-question-primary-action {
  display: flex;
  margin-top: 18px;
  justify-content: flex-end;
}
.emotion-wheel-question-primary-action button {
  min-width: 106px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: #6e62a5;
  color: #fff;
  cursor: pointer;
  font: 11px var(--font-sans);
}
.hold-intensity {
  --hold-level: 1;
  display: grid;
  min-height: 230px;
  margin-top: 14px;
  grid-template-rows: auto minmax(156px, 1fr) auto;
  user-select: none;
  -webkit-user-select: none;
}
.hold-intensity > p {
  margin: 0;
  color: rgba(75,70,88,.46);
  font-size: 10px;
  text-align: center;
}
.hold-intensity-stage { display: grid; place-items: center; }
.hold-intensity-orb {
  display: grid;
  width: calc(66px + var(--hold-level) * 8px);
  height: calc(66px + var(--hold-level) * 8px);
  padding: 0;
  place-items: center;
  border: 1px solid rgba(104,94,139,.18);
  border-radius: 50%;
  outline: none;
  background:
    radial-gradient(circle at 31% 27%, rgba(255,255,255,.98) 0 13%, transparent 38%),
    radial-gradient(circle at 68% 74%, rgba(205,198,228,.82), rgba(250,249,252,.98) 72%);
  color: rgba(76,68,101,.67);
  cursor: pointer;
  font: 10px var(--font-sans);
  box-shadow: 0 0 0 calc(var(--hold-level) * 1px) rgba(103,92,158,.025), 0 16px 34px rgba(67,60,92,.11);
  touch-action: none;
  transition: width .24s ease, height .24s ease, transform .18s ease, box-shadow .24s ease;
}
.hold-intensity-orb:focus-visible { box-shadow: 0 0 0 5px rgba(103,92,158,.12), 0 16px 34px rgba(67,60,92,.12); }
.hold-intensity--emotion .hold-intensity-orb { border-radius: 50%; }
.hold-intensity.is-holding .hold-intensity-orb { transform: scale(1.035); }
.hold-intensity-value {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  color: rgba(75,70,88,.36);
  font-size: 9px;
}
.hold-intensity-value > small:last-child { text-align: right; }
.hold-intensity-value > div { display: flex; align-items: baseline; gap: 7px; }
.hold-intensity-value strong { color: rgba(95,84,142,.78); font-size: 12px; font-weight: 600; }
.hold-intensity-value span { color: rgba(75,70,88,.5); font-size: 9px; }
.hold-intensity--body .hold-intensity-orb {
  position: relative;
  width: 150px;
  height: 78px;
  transform: scaleY(calc(1 - var(--hold-level) * .018));
  border-radius: 48%;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 13px, rgba(91,133,117,.09) 14px 15px),
    linear-gradient(180deg, #fff, rgba(225,236,232,.9));
  box-shadow:
    inset 0 calc(var(--hold-level) * 1.4px) calc(8px + var(--hold-level) * 2px) rgba(72,105,91,.12),
    0 calc(17px - var(--hold-level) * .8px) 24px rgba(67,60,92,.1);
  transition: transform .24s ease, box-shadow .24s ease, background .24s ease;
}
.hold-intensity--body.is-holding .hold-intensity-orb { transform: scale(.985) scaleY(calc(1 - var(--hold-level) * .02)); }

/* Body atlas: labels on the figure, observations beside it */
.body-map-atlas {
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px 20px 18px;
}
.body-map-atlas-bar { min-height: 48px; padding: 0 2px 12px; }
.body-map-atlas-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: rgba(75,70,88,.48);
  font-size: 10px;
}
.body-map-atlas-count strong { color: #514b62; font-size: 20px; font-weight: 500; }
.body-map-atlas-action { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.body-map-atlas-action > p { max-width: 200px; margin: 0; color: #a45f68; font-size: 9px; }
.body-map-atlas-action .emotion-wheel-submit { width: auto; min-width: 150px; min-height: 38px; padding: 9px 18px; }
.body-map-atlas-main {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 16px;
}
.body-map-atlas-main .body-map-models {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  gap: 12px;
}
.body-map-atlas-main .body-map-model { padding: 28px 4px 8px; }
.body-map-atlas-main .body-map-figure { max-height: 540px; }
.body-map-observation-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 16px 12px 12px;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(101,93,127,.075);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255,255,255,.96), rgba(248,249,250,.74));
}
.body-map-observation-panel h2 {
  margin: 0 4px 10px;
  color: #575164;
  font: 500 12px var(--font-sans);
}
.body-map-observation-panel .body-map-observation-tray {
  align-content: start;
  min-height: 0;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  border: 0;
  background: transparent;
  scrollbar-width: thin;
}
.body-map-observation-panel .body-map-observation-tray > p { margin: auto; line-height: 1.7; }
.body-map-observation-panel .body-map-observation-bubble {
  width: 94px;
  min-width: 94px;
  height: 94px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #fff, rgba(231,239,236,.74));
  box-shadow: 0 9px 22px rgba(67,60,92,.07);
}
.body-map-observation-panel .body-map-observation-edit {
  display: flex;
  height: 100%;
  min-height: 0;
  padding: 17px 12px 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.body-map-observation-panel .body-map-observation-edit > span { top: 9px; left: 50%; width: 17px; height: 17px; transform: translateX(-50%); }
.body-map-observation-panel .body-map-observation-remove { top: 7px; right: 4px; transform: none; }
.body-map-hotspot i.body-map-hotspot-leader {
  position: absolute;
  top: 50%;
  display: block;
  width: 26px;
  height: 0;
  border-top: 1px dashed rgba(103,92,158,.28);
  pointer-events: none;
}
.body-map-hotspot[data-label-side="right"] i.body-map-hotspot-leader { left: calc(100% + 5px); }
.body-map-hotspot[data-label-side="left"] i.body-map-hotspot-leader { right: calc(100% + 5px); }
.body-map-hotspot em,
.body-map-model--back .body-map-hotspot em {
  top: 50%;
  right: auto;
  left: auto;
  display: block;
  transform: translateY(-50%);
  opacity: 1;
}
.body-map-hotspot[data-label-side="right"] em { left: calc(100% + 35px); }
.body-map-hotspot[data-label-side="left"] em { right: calc(100% + 35px); }
.body-map-hotspot:hover em,
.body-map-hotspot:focus-visible em { transform: translateY(-50%); opacity: 1; }

.body-map-region-dialog > header { position: relative; padding-right: 56px; }
.body-map-region-dialog .emotion-bubble-dialog-close { top: 18px; right: 18px; }
.body-map-region-progress { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); }
.body-map-region-prompt { margin: 6px 0 0; color: rgba(75,70,88,.45); font-size: 10px; }
.body-map-region-meanings button.body-map-region-meaning {
  padding: 17px 18px;
  border: 1px solid rgba(101,93,127,.08);
  border-radius: 18px;
  background: rgba(249,249,250,.86);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.body-map-region-meanings button.body-map-region-meaning:hover,
.body-map-region-meanings button.body-map-region-meaning:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(103,92,158,.22);
  outline: none;
  box-shadow: 0 10px 24px rgba(67,60,92,.07);
}

/* Body memory bubbles */
.body-map-recent-list {
  display: flex;
  min-height: 180px;
  padding: 20px 24px 30px;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.body-map-mark {
  display: grid;
  width: var(--mark-size);
  height: var(--mark-size);
  min-height: 0;
  padding: 6px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  animation: emotion-bubble-drift 7.6s ease-in-out var(--mark-delay) infinite alternate;
}
.body-map-mark::before { display: none; }
.body-map-mark-body {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 18px 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(103,92,158,.1);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #fff, var(--mark-tint));
  box-shadow: inset 0 0 20px rgba(255,255,255,.86), 0 14px 34px rgba(67,60,92,.08);
}
.body-map-mark-body > span { color: rgba(75,70,88,.35); font-size: 8px; }
.body-map-mark-body small { margin: 4px 0 0; color: rgba(75,70,88,.5); font-size: 8px; }
.body-map-mark-body strong { margin: 1px 0 0; font: 600 19px var(--font-serif); }
.body-map-mark-body em { margin: 5px 0 0; color: rgba(95,84,142,.7); font-size: 13px; font-style: normal; }
.body-map-mark-body em i { font-size: 7px; font-style: normal; }

/* Compact, aligned body insight */
.emotion-bubble-dialog.body-map-dialog {
  display: block;
  width: min(920px, 100%);
  max-height: 66.666dvh;
  padding: 48px 34px 28px;
  overflow-y: auto;
  align-items: start;
}
.body-map-dialog > .emotion-bubble-dialog-close { top: 16px; right: 16px; }
.body-map-dialog-content {
  display: grid;
  grid-template-columns: minmax(240px, .82fr) minmax(0, 1.18fr);
  align-items: start;
  gap: 28px;
}
.body-map-dialog-regions-panel,
.body-map-dialog-insight { min-width: 0; align-self: start; }
.body-map-dialog-regions-panel > h2,
.body-map-dialog-insight > h2 {
  margin: 0 0 15px;
  color: #49445b;
  font: 600 17px var(--font-sans);
  line-height: 1.45;
}
.body-map-dialog-regions { max-height: none; overflow: visible; }
.body-map-dialog-regions article { background: rgba(248,249,250,.82); }
.body-map-dialog-insight .emotion-bubble-dialog-response { margin-top: 0; }
.body-map-dialog-insight .emotion-bubble-dialog-actions { margin-top: 16px; }

@media (max-width: 768px) {
  .emotion-wheel-layout--centered .emotion-wheel-picker { padding: 16px 10px; }
  .emotion-wheel-layout--centered .emotion-wheel-disc { width: min(100%, 356px); }
  .hold-intensity { min-height: 250px; }
  .body-map-atlas { height: auto; max-height: none; overflow: visible; }
  .body-map-atlas-main { grid-template-columns: 1fr; }
  .body-map-atlas-main .body-map-models { height: 390px; }
  .body-map-observation-panel { min-height: 126px; }
  .body-map-observation-panel .body-map-observation-tray { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .body-map-observation-panel .body-map-observation-bubble { flex: 0 0 88px; width: 88px; height: 88px; }
  .body-map-hotspot i.body-map-hotspot-leader { width: 12px; }
  .body-map-hotspot[data-label-side="right"] em { left: calc(100% + 20px); }
  .body-map-hotspot[data-label-side="left"] em { right: calc(100% + 20px); }
  .body-map-hotspot em { padding: 2px 4px; font-size: 6px; }
  .emotion-bubble-dialog.body-map-dialog { max-height: calc(100dvh - 24px); padding: 50px 20px 24px; }
  .body-map-dialog-content { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 430px) {
  .emotion-wheel-disc { width: min(100%, 348px); }
  .emotion-wheel-primary { width: 64px; height: 43px; min-height: 43px; padding: 5px 3px; }
  .emotion-wheel-primary strong { font-size: 13px; }
  .emotion-wheel-primary span { max-width: 56px; font-size: 6.7px; }
  .body-map-atlas-bar { align-items: center; }
  .body-map-atlas-action .emotion-wheel-submit { min-width: 126px; padding-right: 12px; padding-left: 12px; }
  .body-map-atlas-main .body-map-models { height: 380px; }
  .body-map-hotspot i.body-map-hotspot-leader { width: 7px; }
  .body-map-hotspot[data-label-side="right"] em { left: calc(100% + 13px); }
  .body-map-hotspot[data-label-side="left"] em { right: calc(100% + 13px); }
  .body-map-hotspot em { font-size: 5.5px; }
}

/* Continuous pressure controls and viewport-balanced wheel */
.emotion-wheel-layout--centered .emotion-wheel-disc {
  width: min(100%, 520px, calc(100dvh - 300px));
  min-width: 440px;
}
.emotion-wheel-signal {
  max-width: 530px;
  margin: 10px 0 0;
  color: rgba(75,70,88,.54);
  font-size: 10px;
  line-height: 1.75;
}
.emotion-wheel-question-actions {
  display: flex;
  width: 100%;
  margin-top: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.emotion-wheel-question-actions button,
.body-map-region-actions button {
  min-width: 108px;
  min-height: 39px;
  padding: 9px 21px;
  border: 1px solid rgba(103,92,158,.16);
  border-radius: 999px;
  background: #fff;
  color: rgba(79,72,99,.66);
  cursor: pointer;
  font: 11px var(--font-sans);
}
.emotion-wheel-question-actions button:last-child,
.body-map-region-actions button:last-child:not(:only-child) {
  border-color: transparent;
  background: #6e62a5;
  color: #fff;
}
.hold-intensity {
  --hold-progress: 1;
  min-height: 214px;
  margin-top: 8px;
  grid-template-rows: minmax(172px, 1fr) auto;
}
.hold-intensity-stage { min-height: 172px; }
.hold-intensity-orb {
  width: calc(78px + var(--hold-progress) * 7.4px);
  height: calc(78px + var(--hold-progress) * 7.4px);
  box-shadow:
    0 0 0 calc(var(--hold-progress) * 1.1px) rgba(103,92,158,.022),
    0 calc(9px + var(--hold-progress) * .8px) calc(22px + var(--hold-progress) * 1.2px) rgba(67,60,92,.105);
  transition: width .06s linear, height .06s linear, transform .12s ease, box-shadow .12s linear;
}
.hold-intensity.is-relaxing .hold-intensity-orb { transition-timing-function: ease-out; }
.hold-intensity-value {
  display: flex;
  grid-template-columns: none;
  align-items: baseline;
  justify-content: center;
}
.hold-intensity-value > div { justify-content: center; }
.hold-intensity--body .hold-intensity-orb {
  width: calc(230px - var(--hold-progress) * 3px);
  height: calc(132px - var(--hold-progress) * 7px);
  transform: none;
  border-radius: 50%;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 14px, rgba(91,133,117,.075) 15px 16px),
    radial-gradient(ellipse at 50% 28%, rgba(255,255,255,.98), rgba(219,235,229,calc(.42 + var(--hold-progress) * .035)) 80%);
  box-shadow:
    inset 0 calc(var(--hold-progress) * 1.2px) calc(8px + var(--hold-progress) * 2.4px) rgba(72,105,91,.14),
    0 calc(20px - var(--hold-progress) * 1.1px) calc(30px - var(--hold-progress) * .7px) rgba(67,60,92,.1),
    0 0 0 calc(var(--hold-progress) * 1.1px) rgba(91,133,117,.022);
  transition: width .06s linear, height .06s linear, border-radius .06s linear, box-shadow .06s linear, background .1s linear;
}
.hold-intensity--body.is-holding .hold-intensity-orb { transform: none; }

.body-map-atlas-bar { border-bottom: 0; }
.body-map-region-stage--meaning {
  min-height: 380px;
  padding-top: 24px;
  justify-content: flex-start;
}
.body-map-region-stage--meaning h3 {
  margin: 22px 0 0;
  color: #49445b;
  font: 600 14px var(--font-sans);
}
.body-map-region-stage--meaning > .body-map-chips { margin-top: 13px; }
.body-map-region-meanings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.body-map-region-meanings .body-map-region-meaning {
  padding: 14px 15px;
  border: 1px solid rgba(101,93,127,.075);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(247,248,249,.82));
}
.body-map-region-meaning > span { color: rgba(74,94,83,.55); font-size: 9px; }
.body-map-region-meaning > p { margin: 7px 0 0; color: rgba(75,70,88,.66); font-size: 10px; line-height: 1.7; }
.body-map-region-actions--single { justify-content: flex-start; }
.body-map-region-actions--single button {
  border-color: rgba(103,92,158,.16);
  background: #fff;
  color: rgba(79,72,99,.66);
}

.body-map-recent-list.emotion-bubble-field {
  min-height: 220px;
  padding: 22px 28px 34px;
}
.body-map-mark.emotion-bubble {
  width: calc(var(--bubble-size) + 18px);
  height: calc(var(--bubble-size) + 18px);
  padding: 9px;
  overflow: visible;
  border-radius: 50%;
  background: transparent;
  animation: emotion-bubble-drift 7.6s ease-in-out var(--bubble-delay) infinite alternate;
}
.body-map-mark .body-map-mark-body.emotion-bubble-body {
  width: var(--bubble-size);
  min-width: var(--bubble-size);
  max-width: var(--bubble-size);
  height: var(--bubble-size);
  min-height: var(--bubble-size);
  max-height: var(--bubble-size);
  padding: 18px 10px;
  flex: 0 0 var(--bubble-size);
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.98) 0 14%, transparent 38%),
    radial-gradient(circle at 67% 72%, var(--bubble-tint), rgba(255,255,255,.96) 74%);
  animation: none;
}

@media (min-width: 769px) and (max-width: 1100px) {
  .emotion-wheel-layout--centered .emotion-wheel-disc {
    width: min(100%, 720px);
    min-width: 0;
  }
  .emotion-wheel-primary { width: 90px; min-height: 60px; }
}

@media (max-width: 768px) {
  .emotion-wheel-page { width: calc(100% - 8px); }
  .emotion-wheel-layout--centered .emotion-wheel-picker { padding-right: 6px; padding-left: 6px; }
  .emotion-wheel-layout--centered .emotion-wheel-disc {
    width: min(100%, 430px);
    min-width: 0;
  }
  .emotion-wheel-question-actions { margin-top: 14px; }
  .body-map-region-stage--meaning { min-height: 0; }
  .body-map-region-meanings { grid-template-columns: 1fr; }
  .body-map-recent-list.emotion-bubble-field { padding-right: 10px; padding-left: 10px; }
}

@media (max-width: 430px) {
  .emotion-wheel-layout--centered .emotion-wheel-disc { width: min(100%, 368px); }
  .emotion-wheel-primary { width: 62px; height: 42px; min-height: 42px; padding: 4px 3px; }
  .emotion-wheel-primary strong { font-size: 12px; }
  .emotion-wheel-primary span { max-width: 54px; font-size: 6.3px; }
  .hold-intensity { min-height: 200px; }
}

/* Neutral glass authentication landing */
#page-landing.active {
  min-height: 100dvh;
  padding: 24px clamp(24px, 4vw, 64px);
  align-items: center;
  overflow: hidden;
  color: #191a18;
  background: linear-gradient(135deg, #f5f6f5 0%, #eceeec 52%, #e7e5e1 100%);
}
#page-landing .landing-bg {
  opacity: 1;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.98), transparent 34%),
    radial-gradient(circle at 55% 72%, rgba(241,238,231,.72), transparent 40%),
    radial-gradient(circle at 90% 12%, rgba(220,223,220,.68), transparent 34%);
}
#page-landing .watercolor-blob {
  filter: blur(34px) grayscale(1);
  opacity: .2;
}
#page-landing .blob1 { background: radial-gradient(circle, rgba(255,255,255,.92), transparent 70%); }
#page-landing .blob2 { background: radial-gradient(circle, rgba(207,204,197,.5), transparent 70%); }
#page-landing .blob3 { background: radial-gradient(circle, rgba(185,192,188,.36), transparent 70%); }
.landing-shell {
  width: min(1180px, 100%);
  min-height: min(752px, calc(100dvh - 48px));
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(42px, 6vw, 92px);
  align-items: center;
}
.landing-content {
  min-height: 650px;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: none;
}
.landing-eyebrow {
  margin: 0 0 15px;
  color: #555954;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
}
.landing-title {
  margin: 0;
  color: #181917;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1.08;
  letter-spacing: .03em;
  text-shadow: none;
}
.landing-subtitle {
  max-width: 480px;
  margin: 18px 0 0;
  color: rgba(25,26,24,.57);
  font-size: 16px;
  line-height: 1.8;
}
.landing-features {
  max-width: 510px;
  margin: 34px 0 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}
.landing-features li {
  min-height: 36px;
  padding: 9px 12px;
  border: 1px solid rgba(25,26,24,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  color: rgba(25,26,24,.66);
  font-size: 11px;
  text-align: center;
}
.landing-cards-preview {
  width: 420px;
  height: 255px;
  margin: 30px 0 0 18px;
}
.preview-card {
  width: 136px;
  border: 6px solid rgba(255,255,255,.82);
  border-radius: 17px;
  box-shadow: 0 18px 38px rgba(25,26,24,.14);
}
.preview-card.pc1 { left: 20px; top: 46px; transform: rotate(-13deg); }
.preview-card.pc2 { left: 148px; top: 2px; transform: rotate(7deg); }
.preview-card.pc3 { left: 269px; top: 58px; transform: rotate(16deg); }
.auth-card {
  width: 100%;
  max-height: calc(100dvh - 56px);
  padding: 32px 34px 30px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 30px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 28px 72px rgba(28,30,27,.12), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(28px) saturate(.84);
  -webkit-backdrop-filter: blur(28px) saturate(.84);
  scrollbar-width: thin;
}
.auth-header { margin-bottom: 20px; }
.auth-header h2 {
  margin: 0;
  color: #191a18;
  font-size: 27px;
  letter-spacing: .04em;
}
.auth-caption {
  margin: 8px 0 0;
  color: rgba(25,26,24,.48);
  font-size: 11px;
}
#page-landing .auth-tabs { margin-bottom: 21px; border-color: rgba(25,26,24,.09); }
#page-landing .auth-tab { padding: 10px 12px; color: rgba(25,26,24,.48); transition: color .16s ease; }
#page-landing .auth-tab.active { color: #181917; }
#page-landing .auth-tab.active::after { height: 2px; background: #181917; }
#page-landing .form-group { margin-bottom: 12px; }
#page-landing .form-group label { margin-bottom: 6px; color: rgba(25,26,24,.68); font-size: 11px; }
#page-landing .form-group input {
  min-height: 43px;
  border-color: rgba(25,26,24,.1);
  border-radius: 12px;
  background: rgba(239,241,239,.72);
  color: #191a18;
  font-size: 12px;
}
#page-landing .form-group input::placeholder { color: rgba(25,26,24,.36); }
#page-landing .form-group input:focus {
  border-color: rgba(25,26,24,.5);
  box-shadow: 0 0 0 3px rgba(25,26,24,.06);
  background: rgba(255,255,255,.84);
}
#page-landing .form-group input:-webkit-autofill,
#page-landing .form-group input:-webkit-autofill:hover,
#page-landing .form-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: #191a18;
  caret-color: #191a18;
  box-shadow: 0 0 0 1000px rgba(239,241,239,.96) inset;
  transition: background-color 9999s ease-out 0s;
}
#page-landing .btn-primary {
  min-height: 45px;
  border: 0;
  border-radius: 14px;
  background: #191a18;
  color: #fff;
  box-shadow: 0 12px 26px rgba(25,26,24,.18);
}
#page-landing .btn-primary:hover { background: #000; transform: translateY(-1px); }
#page-landing .btn-send-code { background: #191a18; color: #fff; }
#page-landing .btn-send-code:hover { background: #000; }
#page-landing .btn-send-code:disabled { background: #dfe1de; color: #777b76; }
#page-landing .auth-link-row a { color: #252724; }

/* Latest component refinements */
.emotion-wheel-step-heading--plain { display: block; }
.emotion-wheel-step-heading--plain h2 { font-size: 18px; }
.emotion-wheel-selected-reading {
  margin-top: 20px;
  padding: 17px 18px;
  border: 1px solid rgba(103,92,158,.08);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(250,248,255,.9), rgba(255,255,255,.96));
  animation: emotion-question-arrive .3s ease both;
}
.emotion-wheel-selected-reading .emotion-wheel-signal {
  max-width: none;
  margin: 0;
  color: rgba(75,70,88,.64);
  font-size: 11px;
}
.emotion-wheel-question-actions--single { justify-content: flex-end; }
.emotion-wheel-question-actions--single button { border-color: transparent; background: #6e62a5; color: #fff; }
.emotion-bubble-dialog-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.emotion-bubble-dialog-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(103,92,158,.055);
}
.body-map-atlas-count {
  color: #514b62;
  font-size: 12px;
  font-weight: 500;
  gap: 5px;
}
.body-map-atlas-count strong { color: #514b62; font-size: 12px; font-weight: 600; }
.body-map-observation-edit { padding-bottom: 27px; }
.body-map-observation-remove {
  top: auto;
  right: 50%;
  bottom: 8px;
  width: auto;
  height: auto;
  padding: 2px 8px;
  transform: translateX(50%);
  border-radius: 999px;
  color: rgba(141,89,99,.5);
  font-size: 8px;
}
.body-map-observation-panel .body-map-observation-remove {
  top: auto;
  right: 50%;
  bottom: 8px;
  transform: translateX(50%);
}
.hold-intensity--body .hold-intensity-orb {
  border-color: rgba(119,104,173,.14);
  background:
    radial-gradient(ellipse at 34% 24%, rgba(255,255,255,.98) 0 13%, transparent 43%),
    linear-gradient(158deg, rgba(252,251,255,.98), rgba(223,216,245,calc(.48 + var(--hold-progress) * .04)));
  box-shadow:
    inset 0 calc(var(--hold-progress) * 1px) calc(7px + var(--hold-progress) * 2px) rgba(101,84,158,.12),
    0 calc(18px - var(--hold-progress) * .8px) calc(29px - var(--hold-progress) * .5px) rgba(75,62,119,.1);
}
.body-map-mark.emotion-bubble {
  padding: 8px;
  background: transparent;
  box-shadow: none;
}
.body-map-mark .body-map-mark-body.emotion-bubble-body {
  border-color: rgba(103,92,158,.09);
  box-shadow: 0 12px 26px rgba(67,60,92,.075), inset 0 1px 0 rgba(255,255,255,.9);
}

@media (max-width: 768px) {
  #page-landing.active {
    min-height: 100dvh;
    padding: 16px 12px 28px;
    align-items: flex-start;
    overflow: visible;
  }
  .landing-shell {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .landing-content {
    min-height: 0;
    padding: 22px 12px 0;
    text-align: center;
  }
  .landing-eyebrow { margin-bottom: 9px; font-size: 10px; }
  .landing-title { font-size: clamp(36px, 11vw, 48px); }
  .landing-subtitle { margin: 10px auto 0; font-size: 12px; }
  .landing-features,
  .landing-cards-preview { display: none; }
  .auth-card {
    width: min(100%, 370px);
    max-height: none;
    margin: 0 auto;
    padding: 27px 20px 24px;
    border-radius: 24px;
  }
  .emotion-wheel-selected-reading { padding: 15px; }
}

/* Unified emotion question actions and mobile content gutters */
.emotion-wheel-selected-reading .emotion-wheel-signal {
  margin: 0;
}
.emotion-wheel-question-actions--single {
  justify-content: center;
}
.emotion-wheel-question-actions button {
  min-width: 118px;
}
.emotion-wheel-question-actions .emotion-wheel-submit {
  width: auto;
  min-width: 118px;
}
.emotion-wheel-question-actions button:disabled {
  border-color: rgba(103,92,158,.1);
  background: rgba(103,92,158,.08);
  color: rgba(79,72,99,.34);
  cursor: default;
  box-shadow: none;
}
.emotion-wheel-question-status {
  min-height: 18px;
  margin: 14px 0 0;
  color: rgba(76,99,83,.68);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}
.emotion-wheel-question-status:empty {
  display: none;
}
.emotion-wheel-question-dialog .emotion-wheel-question-shell {
  height: 100%;
}
.emotion-wheel-question-dialog .emotion-wheel-question-stage {
  flex: 1 1 auto;
  justify-content: flex-start;
}
.emotion-wheel-question-dialog .emotion-wheel-question-actions {
  margin-top: auto;
  padding-top: 32px;
}

@media (max-width: 768px) {
  .emotion-wheel-page {
    width: calc(100% - 20px);
  }
  .emotion-wheel-layout--centered .emotion-wheel-picker {
    padding-right: 18px;
    padding-left: 18px;
  }
  .emotion-wheel-layout--centered .emotion-wheel-disc {
    width: min(100%, 430px);
  }
  .body-map-atlas-main .body-map-model {
    padding-bottom: 36px;
  }
  .body-map-atlas-main .body-map-figure {
    width: min(100%, 140px);
    max-width: 140px;
    height: auto;
    max-height: calc(100% - 18px);
  }
}

@media (max-width: 430px) {
  .emotion-wheel-layout--centered .emotion-wheel-disc {
    width: min(100%, 368px);
  }
  .emotion-wheel-question-actions {
    gap: 12px;
  }
  .emotion-wheel-question-actions button,
  .emotion-wheel-question-actions .emotion-wheel-submit {
    min-width: 112px;
    padding-right: 17px;
    padding-left: 17px;
  }
}

/* Image-free healing home. */
.home-welcome-hero {
  min-height: 138px;
  display: flex;
  align-items: center;
  padding: clamp(28px, 3vw, 44px);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 40px rgba(79, 69, 116, 0.055);
}
.home-welcome-hero::before,
.home-welcome-hero::after {
  display: none;
}
.home-welcome-copy {
  min-height: 0;
  max-width: none;
}
.home-welcome-copy h1 {
  font-size: clamp(24px, 2vw, 32px);
}

.home-tools-panel .home-tool-card {
  min-height: 132px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(103, 92, 158, 0.1);
  border-radius: 18px;
  background: var(--tool-surface);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.home-tools-panel .home-tool-card::before {
  background: radial-gradient(circle at 100% 0%, var(--tool-glow-a), transparent 52%);
}
.home-tools-panel .home-tool-card::after {
  display: none;
}
.home-tools-panel .home-tool-copy {
  width: 100%;
  padding: 0;
}
.home-tools-panel .home-tool-copy strong {
  font-size: 20px;
}
.home-tools-panel .home-tool-copy > span {
  width: 100%;
  overflow: hidden;
  color: #625c73;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-content-library .home-library-entry {
  height: 94px;
  min-height: 94px;
  display: block;
  padding: 18px;
  border: 1px solid rgba(103, 92, 158, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}
.home-content-library .home-library-copy {
  justify-content: center;
  gap: 5px;
  height: 100%;
  padding: 0;
}
.home-content-library .home-library-copy > span:last-child {
  margin-top: 0;
}
.home-library-title-row {
  flex-wrap: nowrap;
}

.home-record-row {
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 76px;
  gap: 12px;
  padding: 12px 16px;
}
.home-record-index {
  align-self: center;
  color: rgba(103, 92, 158, 0.5);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.home-record-copy {
  grid-column: 2;
}

@media (max-width: 768px) {
  body.page-context-nested .page-context-bar.is-nested {
    overflow: visible;
  }
  body.page-context-nested .page-context-bar.is-nested::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -8px;
    left: -10px;
    right: -10px;
    bottom: 0;
    background: #fffdfb;
    pointer-events: none;
  }
  .home-welcome-hero {
    min-height: 112px;
    padding: 24px 20px;
  }
  .home-welcome-copy {
    max-width: none;
  }
  .home-welcome-copy h1 {
    font-size: 23px;
  }
  .home-tools-panel,
  .home-content-library,
  .home-records-card {
    padding: 18px;
  }
  .home-tools-panel .home-tool-card {
    min-height: 118px;
    padding: 16px;
  }
  .home-tools-panel .home-tool-copy strong {
    font-size: 17px;
  }
  .home-content-library .home-library-entry {
    height: 88px;
    min-height: 88px;
    padding: 16px;
  }
  .home-record-row {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 72px;
  }
}

/* Personal home: open sections with tactile frosted-glass entrances. */
.home-welcome-hero,
.home-tools-panel,
.home-content-library,
.home-records-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-welcome-hero {
  min-height: 112px;
  padding: 20px 8px 24px;
  border-radius: 0;
  overflow: visible;
}

.home-tools-panel {
  margin-top: 4px;
  padding: 22px 8px 10px;
  border-radius: 0;
}

.home-lower-grid {
  gap: 28px;
  margin-top: 26px;
}

.home-content-library,
.home-records-card {
  min-height: 0;
  padding: 8px;
  border-radius: 0;
}

.home-tools-panel .home-tool-card {
  --tool-glow-a: rgba(224, 220, 234, 0.18);
  --tool-glow-b: rgba(238, 233, 229, 0.16);
  --tool-surface: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: var(--tool-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(91, 80, 128, 0.08),
    0 15px 36px rgba(72, 62, 103, 0.08);
  backdrop-filter: blur(26px) saturate(148%);
  -webkit-backdrop-filter: blur(26px) saturate(148%);
}

.home-tools-panel .home-tool-card::before {
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.08) 43%, transparent 68%),
    radial-gradient(circle at 100% 0%, var(--tool-glow-a), transparent 54%);
}

.home-tools-panel .home-tool-card::after {
  display: block;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 42%, rgba(210, 202, 229, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.home-tools-panel .home-tool-card:hover,
.home-tools-panel .home-tool-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(91, 80, 128, 0.08),
    0 20px 42px rgba(72, 62, 103, 0.12);
}

.home-content-library .home-library-entry,
.home-record-row {
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.25));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(91, 80, 128, 0.07),
    0 13px 30px rgba(72, 62, 103, 0.07);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.home-content-library .home-library-entry:hover,
.home-content-library .home-library-entry:focus-visible,
.home-record-row:hover,
.home-record-row:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.98);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(250, 248, 255, 0.34));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(91, 80, 128, 0.07),
    0 18px 38px rgba(72, 62, 103, 0.11);
}

@media (min-width: 769px) {
  body.app-shell-active #main-nav {
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(248, 246, 252, 0.25));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.98),
      inset -1px 0 0 rgba(255, 255, 255, 0.3),
      0 24px 64px rgba(68, 58, 99, 0.1);
    backdrop-filter: blur(36px) saturate(152%);
    -webkit-backdrop-filter: blur(36px) saturate(152%);
  }

  body.app-shell-active .nav-link {
    background: rgba(255, 255, 255, 0.06);
    transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  }

  body.app-shell-active .nav-link:hover {
    transform: translateX(2px);
    border-color: rgba(255, 255, 255, 0.56);
    background: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }

  body.app-shell-active .nav-link.active {
    border-color: rgba(255, 255, 255, 0.78);
    background: linear-gradient(135deg, rgba(226, 220, 246, 0.58), rgba(255, 255, 255, 0.24));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 10px 24px rgba(91, 77, 143, 0.08);
  }

  body.app-shell-active .nav-user {
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
  }
}

@media (max-width: 768px) {
  .home-welcome-hero {
    min-height: 92px;
    padding: 14px 4px 18px;
  }

  .home-welcome-copy h1 {
    font-size: clamp(18px, 5.4vw, 23px);
    white-space: nowrap;
  }

  .home-welcome-name,
  .home-welcome-return {
    display: inline;
  }

  .home-tools-panel {
    margin-top: 0;
    padding: 16px 2px 6px;
  }

  .home-content-library,
  .home-records-card {
    padding: 4px 2px;
  }

  .home-lower-grid {
    gap: 20px;
    margin-top: 22px;
  }

  .home-tools-panel .home-tool-card,
  .home-content-library .home-library-entry,
  .home-record-row {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      inset 0 -1px 0 rgba(91, 80, 128, 0.06),
      0 10px 24px rgba(72, 62, 103, 0.065);
  }
}

/* Home after the content library was retired. */
.home-welcome-hero,
.home-tools-panel,
.home-records-card {
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-lower-grid {
  grid-template-columns: minmax(0, 1fr);
}

.home-lower-grid .home-records-card {
  min-height: 0;
  padding: 8px;
}

.home-tools-panel .home-section-heading h2,
.home-records-card .home-section-heading h2 {
  font-size: clamp(22px, 1.8vw, 30px);
  line-height: 1.35;
}

.home-record-row {
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.25));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(91, 80, 128, 0.07),
    0 13px 30px rgba(72, 62, 103, 0.07);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.spread-card .position-mini em {
  display: none;
}

@media (max-width: 768px) {
  .home-lower-grid .home-records-card {
    padding: 4px 2px;
  }
}

/* Records: selected room is unmistakable and stays flat. */
#page-history .history-filter-tab {
  min-height: 42px;
  padding: 9px 18px;
  border-color: #dedfdb;
  background: #fff;
  color: #686b66;
  box-shadow: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
#page-history .history-filter-tab:hover {
  border-color: #969a93;
  color: #1f201e;
}
#page-history .history-filter-tab.active {
  border-color: #1f201e;
  background: #1f201e;
  color: #fff;
  box-shadow: none;
}

/* Personal center: quiet editorial information architecture. */
#page-profile.active {
  padding-top: calc(var(--app-chrome-height) + 14px);
  background: #fff;
}
#page-profile .profile-container {
  width: min(1180px, calc(100% - 48px));
  padding-bottom: 70px;
}
.profile-page-header {
  display: grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,430px);
  align-items:end;
  gap: 30px;
  padding: 28px 0 30px;
  border-bottom: 1px solid #e2e4df;
}
.profile-page-header>span {
  grid-column: 1/-1;
  color: #899087;
  font: 10px/1.4 Arial,sans-serif;
  letter-spacing: 2.4px;
}
.profile-page-header h1 {
  margin: 0;
  color: #222522;
  font: 400 clamp(34px,4vw,52px)/1.15 var(--font-serif);
  letter-spacing: 1px;
}
.profile-page-header p {
  margin: 0 0 4px;
  color: #777e75;
  font-size: 13px;
  line-height: 1.8;
}
.profile-dashboard {
  display: grid;
  grid-template-columns:minmax(0,1.04fr) minmax(390px,.96fr);
  gap: 34px;
  align-items:stretch;
  padding-top: 34px;
}
#page-profile #profile-self-map { min-width:0; }
#page-profile .ar-profile-map,
#page-profile .ar-profile-empty {
  min-height: 100%;
  margin: 0;
  padding: 38px;
  border: 1px solid #dfe2dc;
  border-radius: 22px;
  background: #f5f6f2;
  box-shadow: none;
}
#page-profile .ar-profile-map { grid-template-columns:1fr;align-content:space-between;gap:24px; }
#page-profile .ar-profile-map .ar-star-chart { max-width:310px;margin:0 auto; }
#page-profile .ar-profile-empty h2,
#page-profile .ar-profile-map h2 { font-size:clamp(28px,3vw,39px); }
#page-profile .profile-card {
  max-width:none;
  margin:0;
  padding:38px;
  border:1px solid #dfe2dc;
  border-radius:22px;
  background:#fff;
  box-shadow:none;
}
.profile-card-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:24px;
  margin-bottom:28px;
  padding-bottom:23px;
  border-bottom:1px solid #e4e6e1;
}
.profile-card-header span {
  color:#8a9188;
  font:10px/1.4 Arial,sans-serif;
  letter-spacing:2px;
}
.profile-card-header h2 {
  margin:8px 0 0;
  color:#252825;
  font:400 28px/1.25 var(--font-serif);
}
.profile-privacy-note {
  max-width:210px;
  margin:0;
  color:#858c83;
  font-size:10px;
  line-height:1.7;
  text-align:right;
}
#page-profile .form-group { margin-bottom:18px; }
#page-profile .form-group label { margin-bottom:8px;color:#5e655d;font-size:11px; }
#page-profile .form-group input,
#page-profile .form-group select,
#page-profile .form-group textarea {
  border:1px solid #dfe2dc;
  border-radius:11px;
  background:#fafbf8;
  color:#2d312d;
  box-shadow:none;
}
#page-profile .form-group input,
#page-profile .form-group select { min-height:48px; }
#page-profile .form-group textarea { min-height:126px;resize:vertical; }
#page-profile .form-group input:focus,
#page-profile .form-group select:focus,
#page-profile .form-group textarea:focus {
  border-color:#858d82;
  background:#fff;
  box-shadow:0 0 0 3px rgba(31,32,30,.045);
}
#page-profile .profile-actions { justify-content:flex-end;margin-top:22px; }
#page-profile .profile-actions .btn { min-height:46px;padding:0 24px;border-radius:999px;background:#1f201e;box-shadow:none; }
@media(max-width:900px){.profile-page-header{grid-template-columns:1fr}.profile-page-header>span{grid-column:auto}.profile-dashboard{grid-template-columns:1fr}.profile-page-header p{max-width:520px}.profile-card-header{align-items:flex-end}}
@media(max-width:600px){#page-profile .profile-container{width:min(100% - 28px,1180px)}.profile-page-header{padding-top:18px}.profile-dashboard{gap:18px;padding-top:18px}#page-profile .ar-profile-map,#page-profile .ar-profile-empty,#page-profile .profile-card{padding:24px 20px;border-radius:18px}.profile-card-header{display:block}.profile-privacy-note{max-width:none;margin-top:13px;text-align:left}.profile-grid{grid-template-columns:1fr;gap:0}}
.analysis-inline-error{width:min(100%,720px);margin:14px auto 0;padding:12px 16px;border:1px solid #e3ddd2;border-radius:12px;background:#faf6ef;color:#62594e;font-size:12px;line-height:1.75;text-align:left}

/* Final neutral palette for the stepped feeling/body questions. */
.emotion-wheel-question-primary-action button,
.emotion-wheel-question-actions button:last-child,
.emotion-wheel-question-actions--single button,
.emotion-wheel-submit {
  border-color:#20221f!important;
  background:#20221f!important;
  background-image:none!important;
  color:#fff!important;
  box-shadow:none!important;
}
.emotion-wheel-question-actions button:first-child:not(:last-child){
  border-color:#dfe1dc!important;
  background:#fff!important;
  color:#626762!important;
  box-shadow:none!important;
}
.hold-intensity-orb{
  border-color:#d9ddd7!important;
  background:radial-gradient(circle at 34% 26%,#fff 0 15%,#f0f1ed 48%,#e0e3dd 100%)!important;
  box-shadow:inset 0 1px 8px rgba(39,43,38,.06),0 14px 30px rgba(39,43,38,.08)!important;
  color:#555b56!important;
}
.hold-intensity-value strong{color:#424743!important}
.emotion-wheel-chip.is-selected{border-color:#20221f!important;background:#20221f!important;color:#fff!important;box-shadow:none!important}
.emotion-wheel-question-progress i,
.body-map-region-progress i{background:#e2e4df!important}
.emotion-wheel-question-progress i.is-complete,
.body-map-region-progress i.is-complete{background:#aeb3ad!important}
.emotion-wheel-question-progress i.is-active,
.body-map-region-progress i.is-active{background:#272a27!important}

/* Keep the compact navigation account inside its rail at the 768px breakpoint. */
@media(max-width:768px){
 body.app-shell-active #main-nav .nav-inner{display:flex;align-items:center;min-width:0;width:100%;padding:10px 14px!important;gap:10px!important;box-sizing:border-box}
 body.app-shell-active #main-nav .nav-logo{flex:1 1 0;min-width:0;max-width:none;overflow:hidden;text-overflow:ellipsis}
 body.app-shell-active #main-nav .nav-account{position:static!important;display:flex;flex-direction:row!important;align-items:center!important;width:auto!important;min-width:0;flex:0 0 auto;margin:0 0 0 auto!important;gap:8px!important}
 body.app-shell-active #main-nav .nav-user-menu{position:relative;min-width:0;max-width:110px}
 body.app-shell-active #main-nav #nav-user-name{width:100%!important;min-width:76px!important;max-width:110px!important;min-height:40px;padding:9px 11px!important}
 body.app-shell-active #main-nav .nav-user-label{min-width:0!important;max-width:5em!important;flex-shrink:1!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 body.app-shell-active #main-nav .nav-space-entry{padding:10px!important;white-space:nowrap}
 body.app-shell-active #main-nav .nav-user-dropdown{position:absolute!important;inset:calc(100% + 10px) 0 auto auto!important;width:174px!important;min-width:0!important;max-width:calc(100vw - 28px);max-height:calc(100dvh - 94px);overflow:auto}
 body.app-shell-active #main-nav #primary-navigation{max-height:calc(100dvh - 86px);overflow-y:auto;overscroll-behavior:contain}
}
/* One neutral action tone and discreet scrollbars across the platform. */
body .btn-primary,body .primary-button{background:#242522!important;border-color:#242522!important;color:#fff!important}
body .btn-primary:hover,body .primary-button:hover{background:#393a37!important}
*{scrollbar-width:thin;scrollbar-color:#b2b1a8 transparent}
::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#b2b1a8;border-radius:8px}::-webkit-scrollbar-button{display:none;width:0;height:0}

/* Drawing save results remain visible even when the canvas toolbar is offscreen. */
#drawing-save-feedback{position:fixed;left:50%;top:24px;transform:translateX(-50%);z-index:20000;display:flex;align-items:center;gap:18px;max-width:min(620px,calc(100vw - 40px));padding:15px 18px 15px 22px;border:1px solid #d8d0bb;border-radius:14px;background:#f8f5e9;color:#34382e;box-shadow:0 10px 35px #28251724;font-size:14px;line-height:1.65}#drawing-save-feedback[data-state=success]{border-color:#aeb69b}#drawing-save-feedback[data-state=error]{border-color:#caa18c;color:#754637}#drawing-save-feedback button{flex:none;border:0;border-radius:50%;background:transparent;color:inherit;font-size:24px;width:30px;height:30px;cursor:pointer}#drawing-save-feedback span{min-width:0;overflow-wrap:anywhere}.drawing-save-status{max-width:calc(100% - 88px);white-space:normal;line-height:1.5}.drawing-save-status[data-state=error]{color:#8a4636}
