:root {
  --card-radius: 0.9rem;
  --glass-bg: rgba(255, 253, 244, 0.96);
  --glass-border: rgba(83, 66, 38, 0.22);
  --shadow-card: 0 0.36rem 0.72rem rgba(17, 46, 29, 0.14);
  --shadow-hover: 0 0.5rem 0.85rem rgba(17, 46, 29, 0.18);
  --shadow-glow: 0 0 0 0.16rem rgba(255, 211, 95, 0.2);
  --glass-blur: none;
}

/* ---------- Shared App Section Backdrops ---------- */

.profile-nook {
  align-items: center;
  background: var(--kw-product-profile-canvas) center / cover no-repeat #c9e2b8;
}

.reading-creek {
  align-items: center;
  min-height: 70svh;
  background: var(--kw-section-family-creek) center / cover no-repeat #bcdcc9;
}

.library-meadow {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--kw-product-library-canvas) center / cover no-repeat #c3dcb2;
}

.app-layout {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(91rem, 100%);
  gap: clamp(1.2rem, 2.4vw, 2.4rem);
  margin: 0 auto;
}

.app-heading {
  margin-bottom: 0;
}

.app-heading h1,
.app-heading h2 {
  font-size: clamp(2.4rem, 4.8vw, 5rem);
  letter-spacing: -0.01em;
}

.app-heading p:not(.eyebrow) {
  max-width: 52rem;
  font-weight: 800;
}

/* ---------- Welcome Banner ---------- */

.welcome-banner {
  position: relative;
  z-index: 3;
  width: min(72rem, 100%);
  margin: 0 auto clamp(1.4rem, 2.6vw, 2.4rem);
  padding: clamp(2rem, 3.6vw, 3.4rem) clamp(1.8rem, 3.4vw, 3rem);
  background: radial-gradient(ellipse at 30% 40%, rgba(255, 252, 224, 0.72) 0%, rgba(255, 248, 210, 0.42) 52%, rgba(255, 248, 210, 0.08) 100%);
  border-radius: 2rem;
  backdrop-filter: blur(0.12rem);
  box-shadow: inset 0 0.06rem 0 rgba(255, 255, 255, 0.5), 0 0.8rem 2rem rgba(20, 45, 26, 0.12);
  text-align: center;
  animation: banner-rise 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

@keyframes banner-rise {
  from { opacity: 0; transform: translateY(1.8rem) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-banner::before {
  content: "";
  position: absolute;
  inset: 0.4rem;
  border: 0.08rem dashed rgba(139, 110, 77, 0.2);
  border-radius: 1.6rem;
  pointer-events: none;
}

.welcome-banner .eyebrow {
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  letter-spacing: 0.22em;
  color: #1a6b44;
}

.welcome-banner h1 {
  margin: 0.35rem 0 0;
  color: #174d38;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4.6vw, 4.8rem);
  line-height: 0.96;
  text-shadow: 0 0.1rem 0 rgba(255, 240, 180, 0.6), 0 0.5rem 1.4rem rgba(20, 57, 35, 0.15);
}

.welcome-banner .welcome-sub {
  max-width: 34rem;
  margin: 0.8rem auto 0;
  color: #152b1e;
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  font-weight: 700;
  line-height: 1.55;
}

.welcome-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.8rem, 1.6vw, 1.5rem);
  justify-content: center;
  margin-top: clamp(1rem, 2vw, 1.6rem);
}

.welcome-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem 0.45rem 0.85rem;
  background: rgba(255, 253, 242, 0.88);
  border: 0.08rem solid rgba(91, 60, 27, 0.16);
  border-radius: 2rem;
  box-shadow: 0 0.08rem 0.2rem rgba(0, 0, 0, 0.05);
  font-size: 0.88rem;
  font-weight: 800;
  color: #2e2210;
}

.welcome-stat-icon {
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8d5a3, #d4b87a);
  border-radius: 50%;
  font-size: 0.9rem;
  box-shadow: inset 0 0.06rem 0 rgba(255,255,255,0.4);
}

/* ---------- Child Profile Switcher (Redesigned) ---------- */

.dashboard-profile-switcher {
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin: 0 auto clamp(1.2rem, 2.4vw, 2rem);
  padding: 1rem 1.8rem;
  background: rgba(255, 253, 242, 0.88);
  border: 0.12rem solid rgba(91, 60, 27, 0.18);
  border-radius: 3rem;
  box-shadow: 0 0.3rem 1rem rgba(20, 45, 26, 0.1), inset 0 0.06rem 0 rgba(255, 255, 255, 0.5);
  width: max-content;
  max-width: 95%;
  backdrop-filter: var(--glass-blur);
}

.avatar-select-btn {
  background: transparent;
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  outline: none;
  transition: transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.avatar-select-btn:hover {
  transform: scale(1.08);
}

.avatar-circle {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  border: 0.18rem solid #c4a87a;
  background: #fffdf6;
  overflow: hidden;
  box-shadow: 0 0.15rem 0.4rem rgba(0, 0, 0, 0.08);
  transition: all 300ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.avatar-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: #4d3a1f;
  transition: color 250ms ease;
  white-space: nowrap;
}

.avatar-select-btn.is-active .avatar-circle {
  border-color: #62a353;
  box-shadow: 0 0 0 0.25rem rgba(98, 163, 83, 0.25), 0 0.3rem 0.8rem rgba(98, 163, 83, 0.3);
  background: #f0fae8;
  transform: scale(1.06);
}

.avatar-select-btn.is-active .avatar-name {
  color: #2d6b3e;
  font-weight: 900;
}

.avatar-select-btn.is-active::after {
  content: "";
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  width: 1rem;
  height: 1rem;
  background: #62a353;
  border: 0.12rem solid #fffdf6;
  border-radius: 50%;
  box-shadow: 0 0.06rem 0.15rem rgba(0,0,0,0.1);
}

.no-profiles-hint {
  font-size: 0.82rem;
  color: #6e5a3f;
  font-weight: 700;
  text-align: center;
  margin: 0;
  padding: 0.4rem 0.6rem;
}

/* ---------- Dashboard Grid ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 1.8vw, 1.6rem);
  width: min(78rem, 100%);
  margin: 0 auto;
  position: relative;
  z-index: 3;
}

.dashboard-card {
  background: var(--glass-bg);
  border: 0.1rem solid var(--glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card), inset 0 0.06rem 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: var(--glass-blur);
  padding: clamp(1.2rem, 2vw, 1.6rem);
  transition: box-shadow 300ms ease, transform 300ms ease;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-hover);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 0.08rem dashed rgba(91, 60, 27, 0.12);
}

.dashboard-card-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d4e8c0, #b8dba4);
  border-radius: 0.6rem;
  font-size: 1rem;
}

.dashboard-card-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  color: #174d38;
  line-height: 1.1;
}

.dashboard-card-header a {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 800;
  color: #62a353;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-card-header a:hover {
  text-decoration: underline;
  color: #4a8a3e;
}

/* ---------- Continue Reading Section ---------- */

.dashboard-card-full {
  grid-column: 1 / -1;
}

.continue-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.5);
  border: 0.06rem solid rgba(91, 60, 27, 0.08);
  border-radius: 0.7rem;
  transition: background 200ms ease, transform 200ms ease;
}

.continue-row:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(0.2rem);
}

.continue-row + .continue-row {
  margin-top: 0.5rem;
}

.continue-thumb {
  width: 3.2rem;
  height: 2.4rem;
  border-radius: 0.4rem;
  object-fit: cover;
  border: 0.06rem solid rgba(91, 60, 27, 0.1);
  flex-shrink: 0;
}

.continue-info {
  flex: 1;
  min-width: 0;
}

.continue-info h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #174d38;
  line-height: 1.2;
}

.continue-info p {
  margin: 0.1rem 0 0;
  font-size: 0.74rem;
  color: #6e5a3f;
  font-weight: 700;
}

.continue-progress {
  width: 4rem;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 800;
  color: #62a353;
  flex-shrink: 0;
}

/* ---------- Stat Grid ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.stat-item {
  text-align: center;
  padding: 0.6rem 0.4rem;
  background: rgba(255, 255, 255, 0.5);
  border: 0.06rem solid rgba(91, 60, 27, 0.08);
  border-radius: 0.7rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.stat-item:hover {
  transform: translateY(-0.08rem);
  box-shadow: 0 0.2rem 0.5rem rgba(20, 45, 26, 0.06);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 800;
  color: #174d38;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #6e5a3f;
  margin-top: 0.15rem;
}

/* ---------- Skill Progress ---------- */

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.skill-name {
  min-width: 5rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #4d3a1f;
  flex-shrink: 0;
}

.skill-bar-bg {
  flex: 1;
  height: 0.55rem;
  background: rgba(91, 60, 27, 0.08);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: inset 0 0.04rem 0.08rem rgba(0,0,0,0.04);
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #b8dba4, #62a353);
  border-radius: 1rem;
  transition: width 600ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.skill-bar-fill::after {
  content: "";
  position: absolute;
  right: -0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.35rem;
  height: 0.35rem;
  background: #f3cf67;
  border-radius: 999px;
}

.skill-pct {
  min-width: 2.5rem;
  text-align: right;
  font-size: 0.74rem;
  font-weight: 800;
  color: #62a353;
  flex-shrink: 0;
}

/* ---------- Membership Panel ---------- */

.membership-card {
  display: flex;
  flex-direction: column;
}

.membership-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.8rem 0.3rem;
  background: linear-gradient(135deg, #f5ecd0, #ede2be);
  border: 0.08rem solid #d4b87a;
  border-radius: 2rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: #6e4e26;
  width: fit-content;
  margin-bottom: 0.6rem;
}

.membership-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4d3a1f;
}

.membership-detail + .membership-detail {
  border-top: 0.06rem solid rgba(91, 60, 27, 0.06);
}

.membership-detail-value {
  color: #174d38;
  font-weight: 800;
}

.membership-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 0.08rem dashed rgba(91, 60, 27, 0.1);
}

.membership-actions .wood-button {
  min-height: 2.4rem;
  padding: 0.2rem 0.8rem 0.36rem;
  font-size: 0.82rem;
}

.children-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.child-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  background: rgba(255, 255, 255, 0.5);
  border: 0.06rem solid rgba(91, 60, 27, 0.08);
  border-radius: 0.6rem;
  transition: background 200ms ease;
}

.child-row:hover {
  background: rgba(255, 255, 255, 0.8);
}

.child-avatar-small {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 0.06rem solid #c4a87a;
  object-fit: cover;
  flex-shrink: 0;
}

.child-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 700;
  color: #174d38;
}

.child-stat {
  font-size: 0.74rem;
  font-weight: 700;
  color: #6e5a3f;
  flex-shrink: 0;
}

/* ---------- Profile Board ---------- */

.profile-board {
  position: relative;
  min-height: clamp(26rem, 36vw, 35rem);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  padding: 3rem;
  align-items: center;
}

.profile-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--forest-text);
  font-weight: 500;
  max-width: 60%;
}

.profile-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  line-height: 1.05;
  color: var(--focus-ring);
}

.profile-copy p {
  margin: 0.8rem 0 0;
  max-width: 20rem;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.5;
  color: var(--bark-text);
}

.profile-copy .profile-plan-line {
  margin: 0.35rem 0 0;
  color: #5d3c1d;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
}

/* ---------- 3D Bookshelf (enhanced) ---------- */

.bookshelf-container {
  position: relative;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.2rem, 3vw, 2.8rem);
  background: rgba(244, 237, 216, 0.9) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><rect width="120" height="120" fill="%23f4edd8"/><path d="M0 30 C30 35 90 25 120 30 M0 60 C40 55 80 65 120 60 M0 90 C30 95 90 85 120 90" stroke="%23e8dec0" stroke-width="2" fill="none" opacity="0.5"/></svg>') repeat;
  border: 0.3rem solid #5b3c1b;
  border-radius: 1.5rem;
  box-shadow: inset 0 1.2rem 2.8rem rgba(45, 30, 15, 0.2), inset 0 -1.2rem 2.8rem rgba(45, 30, 15, 0.2), 0 1.5rem 3.5rem rgba(0, 0, 0, 0.14);
  width: min(84rem, 100%);
  margin: 0 auto;
  perspective: 1200px;
}

.kid-collection {
  row-gap: clamp(4.2rem, 7vw, 6.2rem);
}

.kid-card.is-theme-red { --spine-base: #a23a3a; --spine-dark: #7b2929; --spine-gold: #dfb13c; --ribbon-color: #dfb13c; }
.kid-card.is-theme-green { --spine-base: #387a5c; --spine-dark: #24523d; --spine-gold: #dfb13c; --ribbon-color: #d94e4e; }
.kid-card.is-theme-lavender { --spine-base: #7b6f93; --spine-dark: #574e6a; --spine-gold: #dfb13c; --ribbon-color: #dfb13c; }
.kid-card.is-theme-gold { --spine-base: #d9a435; --spine-dark: #9e731b; --spine-gold: #a23a3a; --ribbon-color: #a23a3a; }

.kid-card {
  position: relative;
  background-color: #fffdf6;
  background-image: linear-gradient(
    to right,
    var(--spine-dark, #4e3215) 0%,
    var(--spine-base, #5b3c1b) 8%,
    var(--spine-base, #5b3c1b) 12%,
    rgba(0, 0, 0, 0.2) 13%,
    rgba(0, 0, 0, 0.05) 15%,
    transparent 18%
  );
  padding-left: 1.45rem;
  padding-right: 0.85rem;
  border: 0.16rem solid #5b3c1b;
  border-left-width: 0.22rem;
  border-radius: 0.4rem 0.9rem 0.9rem 0.4rem;
  box-shadow: 0.35rem 0.5rem 1rem rgba(45, 30, 15, 0.22), inset 0.08rem 0.08rem 0 rgba(255, 255, 255, 0.6);
  transition: transform 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 400ms ease;
  transform-style: preserve-3d;
}

.kid-card::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  right: -0.32rem;
  bottom: 0.25rem;
  width: 0.32rem;
  background: repeating-linear-gradient(
    to bottom,
    #fffdf6,
    #fffdf6 0.12rem,
    #e5deb8 0.12rem,
    #e5deb8 0.16rem
  );
  border: 0.12rem solid #5b3c1b;
  border-left: none;
  border-radius: 0 0.25rem 0.25rem 0;
  z-index: 0;
}

.kid-card::after {
  content: "";
  position: absolute;
  bottom: -1.35rem;
  left: -8%;
  width: 116%;
  height: 1rem;
  background: linear-gradient(to bottom, #aa794a 0%, #85572e 40%, #543314 100%);
  border: 0.12rem solid #3a220d;
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 0.9rem rgba(0, 0, 0, 0.24), 0 0.1rem 0.2rem rgba(0, 0, 0, 0.14), inset 0 0.1rem 0.1rem rgba(255, 255, 255, 0.25);
  z-index: -1;
}

.kid-card:hover {
  transform: translateY(-0.85rem) rotateY(-8deg) rotateX(2deg) scale(1.03);
  box-shadow: 0.8rem 1.2rem 2.2rem rgba(45, 30, 15, 0.35), inset 0.08rem 0.08rem 0 rgba(255, 255, 255, 0.6);
}

.kid-card-art {
  position: relative;
  border-radius: 0.2rem 0.45rem 0.45rem 0.2rem;
  border: 0.08rem solid rgba(91, 60, 27, 0.15);
  overflow: hidden;
}

.kid-card-art::after {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border: 0.12rem double var(--spine-gold, #dfb13c);
  border-radius: 0.25rem;
  pointer-events: none;
  opacity: 0.75;
  transition: opacity 300ms ease;
}

.kid-card:hover .kid-card-art::after {
  opacity: 0.95;
}

.kid-card-body {
  position: relative;
}

.kid-card-body::after {
  content: "";
  position: absolute;
  bottom: -0.65rem;
  left: 20%;
  width: 0.85rem;
  height: 1.8rem;
  background: var(--ribbon-color, #d94e4e);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 82%, 0% 100%);
  z-index: -1;
  transition: transform 350ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0.08rem 0.15rem rgba(0,0,0,0.15);
}

.kid-card:hover .kid-card-body::after {
  transform: translateY(0.18rem) rotate(3deg);
}

.lock-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: #f7e8c4;
  border: 0.15rem solid #8a5a22;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  z-index: 5;
  box-shadow: 0 0.15rem 0.3rem rgba(0,0,0,0.15);
  transition: transform 200ms ease;
}

@keyframes lock-wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

.kid-card.is-locked:hover .lock-badge {
  animation: lock-wobble 0.5s infinite alternate ease-in-out;
}

.kid-card.is-locked {
  filter: grayscale(0.15) opacity(0.85);
}

.kid-card.is-locked:hover {
  filter: grayscale(0) opacity(1);
}

/* ---------- Leaf Progress Indicator ---------- */

.book-progress-wrap {
  width: 100%;
  margin: 0.65rem 0 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.progress-bar-bg {
  width: 85%;
  height: 0.75rem;
  background: #fffdf6;
  border: 0.12rem solid #5b3c1b;
  border-radius: 0.5rem;
  overflow: visible;
  position: relative;
  box-shadow: inset 0 0.08rem 0.12rem rgba(0,0,0,0.08);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #a5d290, #62a353);
  border-radius: 0.3rem 0 0 0.3rem;
  transition: width 400ms ease;
  position: relative;
  box-shadow: inset 0 0.05rem 0.05rem rgba(255, 255, 255, 0.2);
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  right: -0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.45rem;
  height: 0.45rem;
  background: #f3cf67;
  border-radius: 999px;
  box-shadow: 0 0 0 0.08rem rgba(255, 253, 246, 0.8);
}

.progress-status {
  font-size: 0.76rem;
  color: #6e4e26;
  font-weight: 800;
}

.progress-ribbon {
  background: linear-gradient(135deg, #ffe066 0%, #dfb13c 50%, #b58918 100%);
  border: 0.12rem solid #5b3c1b;
  color: #5b3c1b;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.28rem 1rem 0.32rem;
  border-radius: 2rem;
  text-shadow: 0 0.05rem 0 rgba(255,255,255,0.4);
  box-shadow: 0 0.2rem 0.4rem rgba(0,0,0,0.15);
  animation: pulse-gold 2.2s infinite ease-in-out;
}

@keyframes pulse-gold {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); box-shadow: 0 0.2rem 0.5rem rgba(223, 177, 60, 0.35); }
}

/* ---------- Parent Unlock Modal ---------- */

.parent-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 44, 30, 0.65);
  backdrop-filter: blur(0.25rem);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modal-fade-in 200ms ease-out;
}

.parent-modal-card {
  background: #fffdf6;
  border: 0.22rem solid #5b3c1b;
  border-radius: 1.2rem;
  width: min(28rem, 90%);
  padding: 2.2rem 1.8rem;
  box-shadow: 0 1.2rem 2.8rem rgba(12, 28, 14, 0.4);
  text-align: center;
  position: relative;
  animation: modal-pop-in 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-decor-lock {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%235b3c1b"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.parent-modal-card h3 {
  font-family: var(--font-display);
  color: #5b3c1b;
  font-size: 1.65rem;
  margin: 0 0 0.65rem;
}

.parent-modal-card p {
  color: #4d574e;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 1.45rem;
}

.parent-modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  flex-wrap: wrap;
}

.parent-modal-actions .wood-button {
  min-height: 2.8rem;
  padding: 0.25rem 0.95rem 0.38rem;
  font-size: 0.88rem;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop-in {
  from { transform: scale(0.9) translateY(1rem); }
  to { transform: scale(1) translateY(0); }
}

/* ---------- Library Banner ---------- */

.library-banner {
  position: relative;
  z-index: 3;
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: clamp(1.6rem, 2.8vw, 2.4rem) clamp(1.5rem, 2.8vw, 2.4rem);
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 252, 224, 0.68) 0%, rgba(255, 248, 210, 0.35) 52%, rgba(255, 248, 210, 0.06) 100%);
  border-radius: 1.8rem;
  backdrop-filter: blur(0.12rem);
  box-shadow: inset 0 0.06rem 0 rgba(255, 255, 255, 0.5), 0 0.8rem 2rem rgba(20, 45, 26, 0.1);
  text-align: center;
  animation: banner-rise 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.library-banner .eyebrow {
  color: #1a6b44;
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  letter-spacing: 0.22em;
}

.library-banner h1 {
  margin: 0.35rem 0 0;
  color: #174d38;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.2vw, 4.4rem);
  line-height: 0.96;
  text-shadow: 0 0.1rem 0 rgba(255, 240, 180, 0.6), 0 0.5rem 1.4rem rgba(20, 57, 35, 0.15);
}

.library-banner p {
  max-width: 36rem;
  margin: 0.6rem auto 0;
  color: #2b5c3c;
  font-size: clamp(0.95rem, 1.15vw, 1.1rem);
  font-weight: 700;
  line-height: 1.5;
}

/* ---------- Plan Hint Banner ---------- */

.plan-hint-banner {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(56rem, 100%);
  margin: 0.6rem auto 0;
  padding: 0.55rem 1rem;
  background: rgba(255, 253, 242, 0.7);
  border: 0.06rem solid rgba(91, 60, 27, 0.1);
  border-radius: 2rem;
  backdrop-filter: blur(0.08rem);
  font-size: 0.78rem;
  font-weight: 700;
  color: #4d3a1f;
  text-align: center;
  justify-content: center;
  line-height: 1.35;
}

.plan-hint-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ---------- Library Controls ---------- */

.library-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  width: min(84rem, 100%);
  margin: 0.8rem auto 0.6rem;
  position: relative;
  z-index: 5;
}

.search-box-wrap {
  position: relative;
  flex: 1;
  min-width: min(18rem, 100%);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.88rem;
  color: #6e4e26;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  font-size: 0.85rem;
  border: 0.1rem solid rgba(91, 60, 27, 0.2);
  border-radius: 2rem;
  background: rgba(255, 253, 242, 0.88);
  color: #2b4634;
  font-weight: 700;
  outline: none;
  box-shadow: 0 0.08rem 0.3rem rgba(0,0,0,0.03), inset 0 0.06rem 0.1rem rgba(0,0,0,0.04);
  transition: border-color 250ms ease, box-shadow 250ms ease, background 250ms ease;
}

.search-input:focus {
  border-color: #62a353;
  background: #fffef8;
  box-shadow: 0 0 0 0.18rem rgba(98, 163, 83, 0.12), inset 0 0.06rem 0.1rem rgba(0,0,0,0.04);
}

.search-input::placeholder {
  color: #8a7a5f;
  opacity: 0.8;
}

.language-toggle-wrap .wood-button {
  min-height: 2.4rem;
  padding: 0.18rem 0.85rem 0.32rem;
  font-size: 0.82rem;
  border-radius: 2rem;
}

/* ---------- Library Filters ---------- */

.library-filters-wrap {
  position: relative;
  z-index: 3;
  width: min(84rem, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 253, 242, 0.55);
  border: 0.06rem solid rgba(91, 60, 27, 0.08);
  border-radius: 2.5rem;
  backdrop-filter: blur(0.08rem);
}

.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filters-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  color: #6e5a3f;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0.4rem 0 0.2rem;
  white-space: nowrap;
}

.library-filters .leaf-badge {
  min-width: 0;
  min-height: 2rem;
  padding: 0.2rem 0.65rem 0.32rem;
  font-size: 0.74rem;
  border: 0;
  opacity: 0.75;
  filter: saturate(0.72);
  transition: opacity 250ms ease, filter 250ms ease, transform 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.library-filters .leaf-badge:hover {
  opacity: 0.95;
  filter: saturate(0.95) drop-shadow(0 0.15rem 0.25rem rgba(30, 61, 35, 0.12)) drop-shadow(0 0 0.4rem rgba(255, 240, 163, 0.25));
  transform: translateY(-0.1rem) scale(1.04);
}

.library-filters .leaf-badge.is-active {
  opacity: 1;
  filter: saturate(1.15) drop-shadow(0 0.2rem 0.3rem rgba(30, 61, 35, 0.25)) drop-shadow(0 0 0.5rem rgba(255, 240, 163, 0.35));
  transform: translateY(-0.06rem);
}

/* ---------- Library Collection (Story Cards) ---------- */

.library-collection {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(84rem, 100%);
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: clamp(1.2rem, 2.2vw, 2rem);
  align-items: start;
  justify-items: center;
  margin-top: clamp(1.2rem, 2.4vw, 2rem);
}

/* ---------- Storycard Shared ---------- */

.story-card {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 21rem;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  transition: transform 350ms cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 350ms ease;
  will-change: transform, box-shadow;
  z-index: 1;
  overflow: hidden;
}

.story-card:hover {
  transform: translateY(-0.4rem) scale(1.02);
  box-shadow: 0 15px 35px rgba(28, 48, 24, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 10;
}

.story-card-art {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.3);
}

.story-card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.story-card:hover .story-card-art img {
  transform: scale(1.045);
}

.story-card-body {
  display: grid;
  justify-items: center;
  gap: 0.34rem;
  padding: 1.2rem 1.2rem 1.4rem;
  background: transparent;
  text-align: center;
}

.story-card-body h3 {
  margin: 0;
  color: var(--focus-ring);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.5vw, 1.4rem);
  line-height: 1.1;
  text-wrap: balance;
}

.story-card-blurb {
  margin: 0;
  max-width: 16rem;
  color: #3d3b27;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  text-wrap: pretty;
}

.story-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
  justify-content: center;
}

.story-card-meta .leaf-badge {
  min-height: 1.85rem;
  padding: 0.18rem 0.6rem 0.28rem;
  font-size: 0.7rem;
}

.story-card-meta .acorn-badge {
  width: 2.55rem;
  font-size: 0.64rem;
}

.story-state {
  display: block;
  color: #6a4a25;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-top: 0.15rem;
}

.story-card-actions .wood-button {
  min-width: 4.6rem;
  min-height: 2.4rem;
  padding: 0.18rem 0.78rem 0.36rem;
  font-size: 0.84rem;
  border-radius: 0.65rem;
}

.story-card .saved-star {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  z-index: 2;
  display: inline-flex;
  min-width: 3.4rem;
  min-height: 2.2rem;
  align-items: center;
  justify-content: center;
  padding: 0.24rem 0.7rem 0.34rem;
  place-items: center;
  background: linear-gradient(135deg, #f5e8b8, #e8d09a);
  border: 0.1rem solid #c4a87a;
  border-radius: 0.6rem;
  color: #6e4e26;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0.12rem 0.3rem rgba(0,0,0,0.08);
}

/* ---------- Empty State ---------- */

.empty-sign {
  width: min(34rem, 100%);
  margin-inline: auto;
  text-align: center;
  animation: sign-bob 4s infinite ease-in-out;
  grid-column: 1 / -1;
  justify-self: center;
}

.empty-sign .wood-button {
  align-self: center;
  margin-top: 0.85rem;
}

.empty-sign h3 {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
}

@keyframes sign-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-0.35rem) rotate(0.5deg); }
}

/* ---------- Library Cards Animated ---------- */

.story-card-animated {
  animation: library-card-enter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

@keyframes library-card-enter {
  0% {
    opacity: 0;
    transform: translateY(2rem) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Shelf Options ---------- */

.shelf-options {
  display: flex;
  justify-content: center;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 3;
}

.shelf-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: #5b3c1b;
  cursor: pointer;
  user-select: none;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 253, 242, 0.5);
  border: 0.06rem solid rgba(91, 60, 27, 0.1);
  border-radius: 2rem;
}

.shelf-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.shelf-toggle-custom {
  position: relative;
  display: inline-block;
  width: 2.4rem;
  height: 1.3rem;
  background: rgba(91, 60, 27, 0.12);
  border-radius: 1rem;
  border: 0.1rem solid rgba(91, 60, 27, 0.2);
  transition: background 250ms ease;
  flex-shrink: 0;
}

.shelf-toggle-custom::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.1rem;
  width: 0.9rem;
  height: 0.9rem;
  background: #a88258;
  border-radius: 50%;
  transition: transform 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275), background 250ms ease;
  box-shadow: 0 0.06rem 0.15rem rgba(0,0,0,0.12);
}

.shelf-toggle-input:checked + .shelf-toggle-custom {
  background: rgba(98, 163, 83, 0.3);
  border-color: #62a353;
}

.shelf-toggle-input:checked + .shelf-toggle-custom::before {
  transform: translateX(1.1rem);
  background: #62a353;
}

/* ---------- Firefly Animations ---------- */

@keyframes firefly-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
  25% { opacity: 0.8; }
  50% { transform: translate(2rem, -3rem) scale(1.2); opacity: 1; }
  75% { opacity: 0.8; }
}

.firefly-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 0.35rem;
  height: 0.35rem;
  background: #fffca3;
  border-radius: 50%;
  box-shadow: 0 0 0.6rem 0.15rem rgba(255, 252, 163, 0.5);
  animation: firefly-float 8s infinite ease-in-out;
}

.firefly:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 9s; }
.firefly:nth-child(2) { left: 80%; top: 15%; animation-delay: 2s; animation-duration: 11s; }
.firefly:nth-child(3) { left: 25%; top: 60%; animation-delay: 4s; animation-duration: 8s; }
.firefly:nth-child(4) { left: 70%; top: 70%; animation-delay: 1s; animation-duration: 10s; }
.firefly:nth-child(5) { left: 50%; top: 40%; animation-delay: 3s; animation-duration: 12s; }
.firefly:nth-child(6) { left: 90%; top: 50%; animation-delay: 5s; animation-duration: 9s; }
.firefly:nth-child(7) { left: 15%; top: 80%; animation-delay: 1.5s; animation-duration: 10.5s; }

/* ---------- Profile Dropdown (enhanced) ---------- */

.profile-dropdown {
  position: relative;
  display: inline-block;
  z-index: 999;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 253, 242, 0.9);
  border: 0.12rem solid #c4a87a;
  border-radius: 1.5rem;
  padding: 0.35rem 0.85rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: #5b3c1b;
  cursor: pointer;
  width: auto;
  min-height: 2.1rem;
  font-size: 0.82rem;
  box-shadow: 0 0.1rem 0.25rem rgba(0, 0, 0, 0.06);
  transition: all 200ms ease;
}

.profile-trigger:hover {
  background: #fdfaf0;
  transform: translateY(-0.06rem);
  box-shadow: 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
}

.profile-trigger-avatar {
  font-size: 0.9rem;
}

.profile-trigger-arrow {
  font-size: 0.6rem;
  opacity: 0.6;
  transition: transform 250ms ease;
}

.profile-trigger[aria-expanded="true"] .profile-trigger-arrow {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 17.5rem;
  background: #fffdf6;
  border: 0.15rem solid #c4a87a;
  border-radius: 1rem;
  padding: 1.1rem;
  box-shadow: 0 0.8rem 2rem rgba(45, 30, 15, 0.2);
  text-align: left;
  z-index: 1000;
  animation: dropdown-fade-in 180ms ease-out;
}

@keyframes dropdown-fade-in {
  from { opacity: 0; transform: translateY(-0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-parent-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.profile-menu-icon {
  font-size: 1.6rem;
}

.profile-parent-details {
  display: flex;
  flex-direction: column;
}

.profile-parent-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: #5b3c1b;
  line-height: 1.2;
}

.profile-parent-email {
  font-size: 0.76rem;
  color: #7d5e3f;
  word-break: break-all;
}

.profile-menu-divider {
  height: 0.06rem;
  background: rgba(91, 60, 27, 0.1);
  margin: 0.65rem 0;
}

.profile-plan-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-plan-badge {
  background: #fff5d6;
  border: 0.06rem solid #e2c070;
  color: #8b6b23;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  border-radius: 0.8rem;
}

.profile-plan-link {
  font-size: 0.76rem;
  color: #5b3c1b;
  font-weight: 700;
  text-decoration: underline;
}

.profile-plan-link:hover {
  color: #62a353;
}

.profile-children-section h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  color: #5b3c1b;
  margin: 0 0 0.55rem;
}

.profile-children-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 10rem;
  overflow-y: auto;
  margin-bottom: 0.65rem;
  padding-right: 0.2rem;
}

.profile-children-list::-webkit-scrollbar {
  width: 0.25rem;
}

.profile-children-list::-webkit-scrollbar-track {
  background: rgba(91, 60, 27, 0.04);
  border-radius: 0.2rem;
}

.profile-children-list::-webkit-scrollbar-thumb {
  background: rgba(91, 60, 27, 0.15);
  border-radius: 0.2rem;
}

.profile-child-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(91, 60, 27, 0.03);
  border: 0.06rem solid rgba(91, 60, 27, 0.06);
  border-radius: 0.4rem;
  padding: 0.25rem 0.45rem;
}

.profile-child-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 0.06rem solid #c4a87a;
  background: white;
  object-fit: cover;
}

.profile-child-name {
  font-size: 0.8rem;
  color: #5b3c1b;
  font-weight: 700;
  flex-grow: 1;
}

.profile-child-remove {
  background: transparent;
  border: none;
  color: #a94442;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0 0.15rem;
  min-height: auto;
  width: auto;
  text-shadow: none;
  transition: transform 200ms ease;
}

.profile-child-remove:hover {
  transform: scale(1.25);
}

.profile-no-children {
  font-size: 0.78rem;
  color: #7d5e3f;
  margin: 0;
  font-style: italic;
}

.profile-add-child-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.55rem;
}

.profile-add-child-form input {
  height: 1.85rem;
  padding: 0.1rem 0.4rem;
  border: 0.06rem solid #c4a87a;
  border-radius: 0.3rem;
  font-size: 0.78rem;
  background: white;
  color: #37210f;
  width: 100%;
}

.profile-add-child-form select {
  height: 1.85rem;
  padding: 0 0.15rem;
  border: 0.06rem solid #c4a87a;
  border-radius: 0.3rem;
  font-size: 0.78rem;
  background: white;
  color: #37210f;
  cursor: pointer;
}

.profile-add-child-form .wood-button {
  min-width: auto;
  width: auto;
  height: 1.85rem;
  min-height: auto;
  padding: 0.15rem 0.55rem;
  font-size: 0.74rem;
  border-radius: 0.3rem;
}

.profile-signout-btn {
  width: 100%;
  min-width: 100%;
  min-height: 2.1rem;
  font-size: 0.8rem;
  border-radius: 0.5rem;
  background: #a94442;
  color: #ffffff;
  text-shadow: none;
}

.profile-signout-btn:hover {
  background: #c35c5a;
  transform: translateY(-0.05rem);
}

/* ---------- Responsive ---------- */

@media (max-width: 1120px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-board {
    width: min(100%, 56rem);
    margin-inline: auto;
  }

  .profile-side {
    width: min(100%, 44rem);
    margin-inline: auto;
  }
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .welcome-banner {
    padding: 1.6rem 1.2rem;
    border-radius: 1.2rem;
  }

  .welcome-stats {
    gap: 0.5rem;
  }

  .welcome-stat {
    padding: 0.35rem 0.7rem 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .dashboard-profile-switcher {
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 2rem;
  }

  .avatar-circle {
    width: 3.4rem;
    height: 3.4rem;
  }

  .avatar-name {
    font-size: 0.72rem;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .library-banner {
    padding: 1.4rem 1.2rem;
    border-radius: 1.2rem;
  }

  .library-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box-wrap {
    min-width: 0;
  }

  .language-toggle-wrap {
    display: flex;
    justify-content: center;
  }

  .library-filters-wrap {
    flex-direction: column;
    align-items: stretch;
    border-radius: 1.2rem;
    padding: 0.5rem;
  }

  .library-filters {
    justify-content: center;
  }

  .filters-label {
    text-align: center;
    padding: 0.2rem 0;
  }

  .library-collection {
    grid-template-columns: 1fr;
  }

  .bookshelf-container {
    padding: 1.6rem 0.8rem 2.4rem;
    border-width: 0.22rem;
    border-radius: 1rem;
  }

  .continue-row {
    flex-wrap: wrap;
  }

  .book-progress-wrap {
    margin-top: 0.4rem;
  }
}

@media (max-width: 430px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid .stat-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
    padding: 0.4rem 0.6rem;
  }

  .stat-grid .stat-label {
    margin: 0;
  }

  .library-filters .leaf-badge {
    min-width: min(8rem, 44%);
    font-size: 0.7rem;
  }

  .welcome-banner h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .profile-trigger {
    font-size: 0.74rem;
    padding: 0.25rem 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud-sprite,
  .butterfly-sprite,
  .firefly,
  .welcome-banner,
  .library-banner,
  .story-card-animated {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Production app polish ---------- */

:root {
  --app-ink: #143529;
  --app-text: #263d2f;
  --app-muted: #52624f;
  --app-panel: rgba(255, 253, 244, 0.96);
  --app-panel-soft: rgba(248, 243, 226, 0.94);
  --app-border: rgba(63, 50, 31, 0.18);
  --app-accent: #2f8f57;
  --app-accent-dark: #1f6f44;
  --app-amber: #a36321;
  --app-coral: #c84f5f;
  --app-sky: #3d8ec4;
  --app-danger: #8d382c;
  --app-radius: 0.85rem;
  --app-radius-sm: 0.55rem;
  --app-shadow: 0 0.35rem 0.75rem rgba(17, 46, 29, 0.14);
  --app-shadow-raised: 0 0.55rem 0.95rem rgba(17, 46, 29, 0.18);
}

.kw-icon {
  display: inline-block;
  width: var(--icon-size, 1rem);
  height: var(--icon-size, 1rem);
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--kw-icon) center / contain no-repeat;
  mask: var(--kw-icon) center / contain no-repeat;
}

.kw-icon-user { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4Zm0 2c-3.31 0-6 1.79-6 4v1h12v-1c0-2.21-2.69-4-6-4Z'/%3E%3C/svg%3E"); }
.kw-icon-tree { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 5 12h4l-5 7h7v3h2v-3h7l-5-7h4L12 3Z'/%3E%3C/svg%3E"); }
.kw-icon-book-open { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5.5C5.7 4.5 7.4 4 9 4c1.4 0 2.4.3 3 .8 0 0 0 13.5 0 13.5-.8-.5-1.8-.8-3-.8-1.8 0-3.5.5-5 1.5V5.5Zm16 0V19c-1.5-1-3.2-1.5-5-1.5-1.2 0-2.2.3-3 .8V4.8c.6-.5 1.6-.8 3-.8 1.6 0 3.3.5 5 1.5Z'/%3E%3C/svg%3E"); }
.kw-icon-sprout { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21h-2v-6.2C6.5 14.2 4 11.6 4 8.3V5h3.3c3.1 0 5.7 2.3 6.2 5.3C14.5 7.8 16.9 6 19.8 6H22v2.2c0 3.6-2.9 6.5-6.5 6.5H12V21Z'/%3E%3C/svg%3E"); }
.kw-icon-bookmark { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h12v18l-6-3.6L6 21V3Z'/%3E%3C/svg%3E"); }
.kw-icon-chart { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19h14v2H3V3h2v16Zm2-2V9h3v8H7Zm5 0V5h3v12h-3Zm5 0v-6h3v6h-3Z'/%3E%3C/svg%3E"); }
.kw-icon-home { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 11 9-8 9 8-1.4 1.5L18 11.1V21h-5v-6h-2v6H6v-9.9l-1.6 1.4L3 11Z'/%3E%3C/svg%3E"); }
.kw-icon-users { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm0 2c-3.3 0-6 1.8-6 4v2h12v-2c0-2.2-2.7-4-6-4Zm7.8-.5a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm.2 1.7c-.8 0-1.5.1-2.2.4 1.4 1 2.2 2.2 2.2 3.4v1h4v-1.5c0-1.8-1.8-3.3-4-3.3Z'/%3E%3C/svg%3E"); }
.kw-icon-lock { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 9V7A5 5 0 0 0 7 7v2H5v12h14V9h-2Zm-8 0V7a3 3 0 0 1 6 0v2H9Z'/%3E%3C/svg%3E"); }
.kw-icon-check { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9.2 16.6-4-4L3.8 14l5.4 5.4L21 7.6 19.6 6 9.2 16.6Z'/%3E%3C/svg%3E"); }
.kw-icon-search { --kw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.5 4a6.5 6.5 0 0 1 5.1 10.5l4.4 4.4-1.4 1.4-4.4-4.4A6.5 6.5 0 1 1 10.5 4Zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z'/%3E%3C/svg%3E"); }

.library-meadow {
  gap: clamp(1rem, 1.8vw, 1.4rem);
  align-items: center;
}

.kw-canvas-section.library-meadow {
  padding-top: clamp(6.2rem, 8vw, 7.6rem);
}

.kw-canvas-section.library-meadow::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(238, 247, 218, 0.08)),
    radial-gradient(circle at 50% 18%, rgba(255, 251, 220, 0.42), rgba(255, 251, 220, 0) 36%);
}

.welcome-banner,
.library-banner {
  width: min(74rem, 100%);
  margin: 0 auto;
  padding: clamp(1.45rem, 2.8vw, 2.35rem);
  color: var(--app-text);
  background:
    linear-gradient(180deg, rgba(255, 253, 244, 0.97), rgba(248, 243, 226, 0.92));
  border: 0.08rem solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  backdrop-filter: none;
  text-align: left;
  animation: none;
}

.welcome-banner::before {
  display: none;
}

.welcome-banner .eyebrow,
.library-banner .eyebrow {
  margin-bottom: 0.35rem;
  color: var(--app-accent-dark);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.welcome-banner h1,
.library-banner h1 {
  margin: 0;
  color: var(--app-ink);
  font-size: 3rem;
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: none;
}

.welcome-banner .welcome-sub,
.library-banner p {
  max-width: 42rem;
  margin: 0.55rem 0 0;
  color: var(--app-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.45;
}

.welcome-stats,
.library-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-start;
  margin-top: 1rem;
}

.welcome-stat {
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  gap: 0.4rem;
  color: var(--app-text);
  background: #fffdf6;
  border: 0.06rem solid rgba(63, 50, 31, 0.14);
  border-radius: 999px;
  box-shadow: none;
  font-size: 0.86rem;
}

.welcome-stat-icon.kw-icon,
.plan-hint-icon.kw-icon {
  --icon-size: 1rem;
  color: var(--app-accent);
}

.library-summary {
  margin: 1.05rem 0 0;
  padding: 0;
}

.library-summary div {
  display: grid;
  min-width: 6rem;
  gap: 0.08rem;
  padding: 0.55rem 0.8rem;
  background: #fffdf6;
  border: 0.06rem solid rgba(63, 50, 31, 0.14);
  border-radius: var(--app-radius-sm);
}

.library-summary dt {
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.library-summary dd {
  margin: 0;
  color: var(--app-ink);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.dashboard-profile-switcher,
.plan-hint-banner,
.library-controls,
.library-filters-wrap,
.dashboard-card,
.bookshelf-container {
  background: var(--app-panel);
  border: 0.08rem solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  backdrop-filter: none;
}

.library-meadow .wood-button,
.profile-menu .wood-button {
  transition: filter 160ms ease, transform 160ms ease;
}

.library-meadow .wood-button:hover,
.library-meadow .wood-button:focus-visible,
.profile-menu .wood-button:hover,
.profile-menu .wood-button:focus-visible {
  filter: brightness(1.05);
  transform: translateY(-0.05rem);
}

.dashboard-profile-switcher {
  width: min(74rem, 100%);
  justify-content: flex-start;
  margin: 0 auto;
  padding: 0.75rem;
}

.dashboard-grid {
  width: min(74rem, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.72fr);
  gap: 0.85rem;
}

.dashboard-card {
  padding: 1rem;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-card:hover {
  box-shadow: var(--app-shadow-raised);
}

.dashboard-card-header {
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 0.06rem solid rgba(63, 50, 31, 0.12);
}

.dashboard-card-icon.kw-icon {
  --icon-size: 1.2rem;
  color: var(--app-accent);
}

.dashboard-card-header h3 {
  color: var(--app-ink);
  font-size: 1.05rem;
  letter-spacing: 0;
}

.dashboard-card-header a {
  color: var(--app-accent-dark);
  font-size: 0.82rem;
  text-decoration: none;
}

.dashboard-card-header a::after {
  content: " ->";
}

.empty-inline {
  display: grid;
  gap: 0.15rem;
  place-items: center;
  min-height: 4.2rem;
  padding: 0.85rem;
  color: var(--app-muted);
  background: rgba(255, 253, 246, 0.72);
  border: 0.06rem dashed rgba(63, 50, 31, 0.18);
  border-radius: var(--app-radius-sm);
  text-align: center;
}

.empty-inline strong {
  color: var(--app-ink);
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.1;
}

.empty-inline span {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.empty-inline.is-compact {
  min-height: 3.2rem;
  padding: 0.65rem;
}

.continue-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  color: inherit;
  background: #fffdf6;
  border: 0.06rem solid rgba(63, 50, 31, 0.12);
  border-radius: var(--app-radius-sm);
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.continue-row:hover,
.continue-row:focus-visible {
  background: #fffaf0;
  border-color: rgba(47, 118, 84, 0.34);
  transform: translateY(-0.06rem);
}

.continue-thumb {
  width: 4.4rem;
  height: 3.1rem;
  border-radius: 0.45rem;
}

.continue-info h4 {
  color: var(--app-ink);
  font-size: 0.95rem;
}

.continue-info p,
.continue-progress {
  color: var(--app-muted);
}

.continue-progress {
  min-width: 3.2rem;
  color: var(--app-accent-dark);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: right;
}

.stat-item,
.child-row {
  background: #fffdf6;
  border: 0.06rem solid rgba(63, 50, 31, 0.12);
  border-radius: var(--app-radius-sm);
  box-shadow: none;
}

.stat-number {
  color: var(--app-ink);
  font-size: 1.75rem;
}

.stat-label {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.skill-row {
  gap: 0.65rem;
}

.skill-name {
  min-width: 7rem;
  color: var(--app-text);
}

.skill-bar-bg {
  height: 0.5rem;
  background: rgba(38, 61, 47, 0.12);
}

.skill-bar-fill,
.progress-bar-fill {
  background: linear-gradient(90deg, #80b766, var(--app-accent));
}

.skill-bar-fill::after,
.progress-bar-fill::after {
  content: "";
  right: -0.1rem;
  width: 0.35rem;
  height: 0.35rem;
  background: #f3cf67;
  border-radius: 999px;
  box-shadow: 0 0 0 0.08rem rgba(255, 253, 246, 0.8);
}

.skill-pct {
  color: var(--app-accent-dark);
}

.membership-plan-badge {
  gap: 0.35rem;
  color: #684316;
  background: #fff5d8;
  border-color: rgba(156, 99, 43, 0.28);
  border-radius: 999px;
}

.membership-plan-badge .kw-icon {
  --icon-size: 0.95rem;
}

.membership-detail {
  color: var(--app-text);
}

.membership-detail-value {
  color: var(--app-ink);
}

.membership-detail-value.is-success {
  color: var(--app-accent-dark);
}

.membership-actions {
  border-top-color: rgba(63, 50, 31, 0.12);
}

.child-row {
  width: 100%;
  min-height: 3rem;
  padding: 0.45rem 0.55rem;
  color: inherit;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease;
}

.child-row:hover,
.child-row:focus-visible,
.child-row.is-active {
  background: #f5faee;
  border-color: rgba(47, 118, 84, 0.34);
}

.child-name {
  color: var(--app-ink);
  font-weight: 900;
}

.child-stat {
  color: var(--app-muted);
  font-size: 0.75rem;
}

.avatar-select-btn {
  border-radius: var(--app-radius-sm);
  transition: background 180ms ease, transform 180ms ease;
}

.avatar-select-btn:hover,
.avatar-select-btn:focus-visible,
.avatar-select-btn.is-active {
  background: #f5faee;
  transform: none;
}

.avatar-circle {
  border-color: rgba(47, 118, 84, 0.28);
  box-shadow: none;
}

.avatar-select-btn.is-active .avatar-circle {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 0.18rem rgba(47, 118, 84, 0.16);
}

.avatar-select-btn.is-active::after {
  background: var(--app-accent);
}

.shelf-options {
  margin: 0 auto;
}

.shelf-toggle-label {
  color: var(--app-text);
  background: var(--app-panel);
  border: 0.08rem solid var(--app-border);
  border-radius: var(--app-radius);
}

.shelf-toggle-input:focus-visible + .shelf-toggle-custom {
  outline: 0.16rem solid var(--focus-ring);
  outline-offset: 0.12rem;
}

.bookshelf-container {
  width: min(74rem, 100%);
  padding: clamp(1rem, 2vw, 1.6rem);
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.96), rgba(244, 237, 216, 0.94));
  perspective: none;
}

.library-collection {
  width: min(74rem, 100%);
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: clamp(0.9rem, 1.6vw, 1.35rem);
  margin-top: 0.6rem;
}

.bookshelf-container .library-collection {
  width: 100%;
  margin-top: 0;
}

.story-card {
  max-width: 22rem;
  filter: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.story-card:hover,
.story-card:focus-within {
  z-index: 2;
  transform: translateY(-0.12rem);
  filter: none;
}

.story-card-art {
  border: 0.18rem solid #fff3cf;
  border-bottom-width: 0;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.story-card-body {
  gap: 0.45rem;
  min-height: 10.8rem;
  padding: 0.9rem;
  background: #fffdf6;
  border: 0.08rem solid rgba(63, 50, 31, 0.16);
  border-top: 0;
  border-radius: 0 0 var(--app-radius) var(--app-radius);
  box-shadow: var(--app-shadow);
}

.story-card-body h3 {
  color: var(--app-ink);
  font-size: 1.2rem;
}

.story-card-blurb {
  color: var(--app-text);
  font-weight: 800;
}

.story-state {
  color: var(--app-muted);
  letter-spacing: 0.06em;
}

.story-card.is-locked .story-card-art img,
.kid-card.is-locked .story-card-art img {
  filter: saturate(0.74) brightness(0.9);
}

.story-card-actions .wood-button,
.membership-actions .wood-button {
  min-height: 2.75rem;
  border-radius: 0.6rem;
}

.kid-card,
.kid-card:hover {
  padding-left: 1rem;
  padding-right: 0.8rem;
  border-radius: var(--app-radius);
  transform: none;
  box-shadow: none;
}

.kid-card::before,
.kid-card::after,
.kid-card-body::after,
.kid-card-art::after {
  display: none;
}

.lock-badge {
  color: #684316;
  background: #fff5d8;
  border: 0.08rem solid rgba(104, 67, 22, 0.32);
}

.lock-badge .kw-icon {
  --icon-size: 1rem;
}

.is-locked-trigger {
  gap: 0.35rem;
}

.is-locked-trigger .kw-icon {
  --icon-size: 0.88rem;
}

.progress-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #684316;
  background: #fff1bc;
  animation: none;
}

.progress-ribbon .kw-icon {
  --icon-size: 0.82rem;
}

.plan-hint-banner {
  width: min(74rem, 100%);
  margin: 0 auto;
  justify-content: flex-start;
  padding: 0.7rem 0.85rem;
  color: var(--app-text);
  font-size: 0.86rem;
  text-align: left;
}

.library-controls,
.library-filters-wrap {
  width: min(74rem, 100%);
  margin: 0 auto;
  padding: 0.75rem;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.search-box-wrap {
  min-width: 0;
}

.search-icon.kw-icon {
  --icon-size: 1rem;
  color: var(--app-muted);
}

.search-input {
  min-height: 2.65rem;
  border: 0.08rem solid rgba(63, 50, 31, 0.18);
  border-radius: var(--app-radius-sm);
  background: #fffdf6;
  color: var(--app-ink);
  box-shadow: none;
}

.search-input:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 0.16rem rgba(47, 118, 84, 0.14);
}

.language-toggle-wrap .wood-button {
  min-height: 2.75rem;
  border-radius: var(--app-radius-sm);
}

.language-code {
  display: inline-flex;
  min-width: 1.55rem;
  min-height: 1.3rem;
  align-items: center;
  justify-content: center;
  margin-right: 0.35rem;
  color: #fffaf0;
  background: var(--app-accent-dark);
  border-radius: 0.3rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.library-filters-wrap {
  align-items: flex-start;
  border-radius: var(--app-radius);
}

.filters-label {
  padding-top: 0.45rem;
  color: var(--app-muted);
  letter-spacing: 0.06em;
}

.library-filters {
  gap: 0.35rem;
}

.library-filters .leaf-badge {
  min-height: 2.75rem;
  padding: 0.42rem 0.72rem;
  color: var(--app-text);
  background: #fffdf6;
  border: 0.06rem solid rgba(63, 50, 31, 0.14);
  border-radius: 999px;
  filter: none;
  text-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.library-filters .leaf-badge:hover,
.library-filters .leaf-badge:focus-visible {
  color: var(--app-accent-dark);
  background: #f5faee;
  border-color: rgba(47, 118, 84, 0.28);
  transform: none;
  filter: none;
}

.library-filters .leaf-badge.is-active {
  color: #fffaf0;
  background: var(--app-accent-dark);
  border-color: var(--app-accent-dark);
  transform: none;
  filter: none;
}

.saved-star {
  gap: 0.25rem;
  border-radius: 999px;
}

.saved-star .kw-icon {
  --icon-size: 0.72rem;
}

.skeleton-card {
  min-height: 21rem;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 253, 246, 0.82), rgba(242, 235, 215, 0.96), rgba(255, 253, 246, 0.82));
  background-size: 220% 100%;
  border: 0.08rem solid rgba(63, 50, 31, 0.12);
  border-radius: var(--app-radius);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.parent-modal-overlay {
  background: rgba(20, 42, 29, 0.72);
}

.parent-modal-card {
  border-width: 0.12rem;
  border-radius: var(--app-radius);
}

.profile-trigger {
  gap: 0.4rem;
}

.profile-trigger-avatar.kw-icon,
.profile-menu-icon.kw-icon {
  --icon-size: 1rem;
  color: var(--app-accent-dark);
}

.profile-trigger-arrow {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 0.12rem solid currentColor;
  border-bottom: 0.12rem solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform 160ms ease;
}

.profile-trigger[aria-expanded="true"] .profile-trigger-arrow {
  transform: translateY(0.1rem) rotate(225deg);
}

.profile-menu {
  border: 0.08rem solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-raised);
}

.profile-child-remove {
  min-height: 1.8rem;
  padding: 0.1rem 0.35rem;
  color: var(--app-danger);
  background: transparent;
  border: 0.06rem solid rgba(141, 56, 44, 0.22);
  border-radius: 0.35rem;
  font-size: 0.68rem;
  line-height: 1;
}

.profile-child-remove:hover,
.profile-child-remove:focus-visible {
  background: rgba(141, 56, 44, 0.08);
  transform: none;
}

@media (max-width: 900px) {
  .dashboard-grid,
  .library-controls {
    grid-template-columns: 1fr;
  }

  .welcome-banner h1,
  .library-banner h1 {
    font-size: 2.35rem;
  }

  .dashboard-profile-switcher {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .kw-canvas-section.library-meadow {
    padding-top: 5.8rem;
  }

  .welcome-banner,
  .library-banner,
  .dashboard-card,
  .dashboard-profile-switcher,
  .bookshelf-container,
  .plan-hint-banner,
  .library-controls,
  .library-filters-wrap {
    border-radius: 0.72rem;
  }

  .welcome-banner,
  .library-banner {
    padding: 1.1rem;
  }

  .welcome-banner h1,
  .library-banner h1 {
    font-size: 2rem;
  }

  .welcome-stats,
  .library-summary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .welcome-stat,
  .library-summary div {
    width: 100%;
  }

  .continue-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .continue-progress {
    grid-column: 2;
    text-align: left;
  }

  .skill-row {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .skill-bar-bg {
    grid-column: 1 / -1;
  }

  .skill-name {
    min-width: 0;
  }

  .library-filters-wrap {
    align-items: stretch;
  }

  .filters-label {
    padding-top: 0;
    text-align: left;
  }
}

@media (max-width: 430px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .profile-menu {
    right: -0.2rem;
    width: min(18rem, calc(100vw - 1.4rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-card {
    animation: none;
  }
}

/* ---------- unified forest-material app skin ---------- */

:root {
  --card-radius: 0.72rem;
  --app-ink: var(--canopy-900);
  --app-text: var(--forest-text);
  --app-muted: #536047;
  --app-panel: var(--surface-paper);
  --app-panel-soft: var(--surface-moss);
  --app-border: var(--surface-border);
  --app-border-strong: var(--surface-border-strong);
  --app-accent: var(--moss-700);
  --app-accent-dark: var(--canopy-800);
  --app-amber: var(--wood-600);
  --app-coral: var(--berry-700);
  --app-sky: #2d7f76;
  --app-danger: var(--berry-700);
  --app-radius: 0.72rem;
  --app-radius-sm: 0.48rem;
  --app-shadow: var(--surface-shadow-soft);
  --app-shadow-raised: var(--surface-shadow);
}

.welcome-banner,
.library-banner,
.dashboard-profile-switcher,
.plan-hint-banner,
.library-controls,
.library-filters-wrap,
.dashboard-card,
.bookshelf-container,
.library-summary div,
.welcome-stat,
.continue-row,
.stat-item,
.child-row,
.empty-inline,
.shelf-toggle-label,
.parent-modal-card,
.story-card-body {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 226, 154, 0.32), rgba(255, 226, 154, 0) 42%),
    linear-gradient(180deg, var(--surface-paper-strong), var(--surface-paper) 62%, rgba(239, 247, 219, 0.92));
  border-color: var(--app-border);
  box-shadow:
    inset 0 0.08rem 0 rgba(255, 255, 255, 0.6),
    var(--app-shadow);
}

.welcome-banner,
.library-banner {
  text-align: left;
}

.welcome-banner h1,
.library-banner h1,
.dashboard-card-header h3,
.empty-inline strong,
.continue-info h4,
.stat-number,
.child-name,
.story-card-body h3 {
  color: var(--app-ink);
}

.welcome-banner .welcome-sub,
.library-banner p,
.story-card-blurb,
.membership-detail,
.continue-info p,
.stat-label,
.child-stat,
.empty-inline span {
  color: var(--app-text);
}

.welcome-banner .eyebrow,
.library-banner .eyebrow,
.dashboard-card-icon.kw-icon,
.welcome-stat-icon.kw-icon,
.plan-hint-icon.kw-icon,
.profile-trigger-avatar.kw-icon,
.profile-menu-icon.kw-icon {
  color: var(--app-accent);
}

.dashboard-card:hover,
.continue-row:hover,
.continue-row:focus-visible,
.child-row:hover,
.child-row:focus-visible,
.child-row.is-active,
.avatar-select-btn:hover,
.avatar-select-btn:focus-visible,
.avatar-select-btn.is-active {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(255, 226, 154, 0.36), rgba(255, 226, 154, 0) 42%),
    linear-gradient(180deg, #fff8dc, var(--surface-moss));
  border-color: var(--app-border-strong);
  box-shadow:
    inset 0 0.08rem 0 rgba(255, 255, 255, 0.65),
    var(--app-shadow-raised);
}

.dashboard-card-header {
  border-bottom-color: rgba(91, 50, 24, 0.18);
}

.library-filters .leaf-badge,
.membership-plan-badge,
.progress-ribbon,
.language-code,
.saved-star,
.lock-badge {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 232, 163, 0.42), rgba(255, 232, 163, 0) 48%),
    linear-gradient(180deg, var(--paper-50), var(--paper-100));
  border: 0.08rem solid rgba(91, 50, 24, 0.32);
  color: var(--canopy-900);
}

.library-filters .leaf-badge:hover,
.library-filters .leaf-badge:focus-visible {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 232, 163, 0.42), rgba(255, 232, 163, 0) 48%),
    linear-gradient(180deg, var(--meadow-100), #d8ebb9);
  color: var(--canopy-900);
}

.library-filters .leaf-badge.is-active,
.avatar-select-btn.is-active::after,
.skill-bar-fill,
.progress-bar-fill {
  background: linear-gradient(90deg, var(--moss-600), var(--moss-700));
  border-color: var(--canopy-800);
  color: #fff8dc;
}

.search-input {
  background: var(--paper-50);
  border-color: rgba(91, 50, 24, 0.26);
}

.search-input:focus {
  border-color: var(--moss-700);
  box-shadow: 0 0 0 0.16rem rgba(255, 211, 95, 0.36);
}

.bookshelf-container {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 226, 154, 0.36), rgba(255, 226, 154, 0) 48%),
    linear-gradient(180deg, rgba(255, 246, 210, 0.96), rgba(239, 247, 219, 0.92));
}

.story-card-art {
  border-color: var(--paper-100);
}

.story-state,
.continue-progress,
.skill-pct,
.membership-detail-value.is-success {
  color: var(--app-accent-dark);
}

/* ---------- Library structure and KDP edition links ---------- */

.library-workspace {
  position: relative;
  z-index: 3;
  display: grid;
  width: min(74rem, 100%);
  gap: 0.82rem;
  margin: 0 auto;
}

.library-workspace .plan-hint-banner,
.library-workspace .library-controls,
.library-workspace .library-filters-wrap,
.library-workspace .library-collection {
  width: 100%;
  margin: 0;
}

.library-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem 1.2rem;
  align-items: end;
}

.library-banner .eyebrow,
.library-banner h1,
.library-banner p {
  grid-column: 1;
}

.library-summary {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
  justify-content: flex-end;
  margin: 0;
  max-width: 18.5rem;
}

.library-summary div {
  min-width: 5.45rem;
  padding: 0.52rem 0.7rem;
}

.library-controls {
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 0.65rem;
}

.library-filters-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
}

.library-collection {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  justify-items: stretch;
  gap: clamp(1rem, 1.8vw, 1.45rem);
}

.library-collection .story-card {
  max-width: none;
  height: 100%;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.library-collection .story-card:hover,
.library-collection .story-card:focus-within {
  transform: translateY(-0.1rem);
}

.library-collection .story-card-art {
  border: 0.12rem solid var(--paper-100);
  border-bottom-width: 0;
  border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.library-collection .story-card-body {
  display: flex;
  min-height: 16.5rem;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.95rem;
  text-align: left;
}

.library-collection .story-card-body h3 {
  font-size: 1.16rem;
  line-height: 1.12;
}

.library-collection .story-card-blurb {
  max-width: none;
  font-size: 0.84rem;
  line-height: 1.42;
}

.library-collection .story-card-meta {
  justify-content: flex-start;
}

.library-collection .story-state {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 0.28rem 0.48rem;
  background: rgba(245, 250, 238, 0.84);
  border: 0.06rem solid rgba(47, 118, 84, 0.18);
  border-radius: var(--app-radius-sm);
  color: var(--app-accent-dark);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.library-collection .story-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  justify-content: stretch;
  width: 100%;
  margin-top: auto;
}

.story-card-actions .story-primary-action,
.story-card-actions .kdp-buy-options {
  grid-column: 1 / -1;
}

.story-card-actions .story-primary-action {
  justify-content: center;
}

.story-card-actions .story-save-action {
  justify-self: start;
}

.kdp-buy-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.38rem;
  align-items: center;
  padding: 0.5rem;
  background: rgba(255, 250, 232, 0.86);
  border: 0.06rem solid rgba(153, 92, 0, 0.26);
  border-radius: var(--app-radius-sm);
}

.kdp-buy-label {
  grid-column: 1 / -1;
  color: #6f4300;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.kdp-buy-option.wood-button {
  min-width: 0;
  min-height: 2.35rem;
  justify-content: center;
  padding-inline: 0.55rem;
  color: #4b2d00;
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .library-banner {
    grid-template-columns: 1fr;
  }

  .library-summary {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .library-workspace {
    gap: 0.72rem;
  }

  .library-controls,
  .library-filters-wrap {
    grid-template-columns: 1fr;
  }

  .library-collection {
    grid-template-columns: 1fr;
  }

  .library-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-summary div {
    min-width: 0;
  }

  .library-collection .story-card-body {
    min-height: 0;
  }
}

/* ---------- dark storybook app shell inspired by the reference dashboard ---------- */

:root {
  --app-ink: var(--kw-story-text);
  --app-text: #ebe7f8;
  --app-muted: var(--kw-story-muted);
  --app-panel: var(--kw-story-panel);
  --app-panel-soft: #242235;
  --app-border: var(--kw-story-line);
  --app-border-strong: #665f86;
  --app-accent: var(--kw-story-cream);
  --app-accent-dark: #fff3a3;
  --app-radius: 0.72rem;
  --app-radius-sm: 0.48rem;
  --app-shadow: none;
  --app-shadow-raised: 0 0.7rem 1.4rem rgba(0, 0, 0, 0.24);
}

body {
  color: var(--app-text);
  background: var(--kw-story-night);
}

body > main {
  min-height: 100vh;
  padding-left: 9.4rem;
  background:
    radial-gradient(circle at 78% 8%, rgba(119, 88, 166, 0.18), transparent 28rem),
    linear-gradient(180deg, #121026, #0f0d20);
}

.forest-nav {
  top: 0;
  right: auto;
  bottom: 0;
  left: 0;
  width: 9.4rem;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  padding: 1.1rem 0.82rem;
  background: var(--kw-story-rail);
  border-right: 0.06rem solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
}

.forest-nav .brand-mark,
.forest-nav .branch-nav a,
.forest-nav .branch-nav button,
.forest-nav .map-toggle,
.forest-nav .profile-trigger {
  width: 100%;
  min-height: 2.55rem;
  justify-content: flex-start;
  aspect-ratio: auto;
  padding: 0.55rem 0.7rem;
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  color: #d9d4ec;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.15;
  text-align: left;
  text-shadow: none;
  box-shadow: none;
}

.forest-nav .brand-mark {
  min-height: 2.8rem;
  margin-bottom: 0.4rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 850;
}

.forest-nav .brand-mark::before {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.4rem;
}

.forest-nav .branch-nav {
  position: static;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0;
  visibility: visible;
  opacity: 1;
  background: transparent;
}

.forest-nav .branch-nav a:hover,
.forest-nav .branch-nav a:focus-visible,
.forest-nav .branch-nav button:hover,
.forest-nav .branch-nav button:focus-visible,
.forest-nav .branch-nav button[aria-current="page"],
.forest-nav .profile-trigger:hover,
.forest-nav .profile-trigger:focus-visible,
.forest-nav .profile-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: none;
  filter: none;
}

.profile-dropdown {
  width: 100%;
  margin-top: auto;
}

.profile-trigger {
  gap: 0.45rem;
}

.profile-trigger-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu {
  position: fixed;
  top: auto;
  right: auto;
  bottom: 1rem;
  left: 8.8rem;
  width: min(19rem, calc(100vw - 10rem));
  background: #302e43;
  border: 0.06rem solid #504a68;
  border-radius: 0.72rem;
  color: #f8f4ff;
  box-shadow: 0 1.1rem 2.4rem rgba(0, 0, 0, 0.36);
}

.profile-parent-name,
.profile-children-section h3 {
  color: #fff;
}

.profile-parent-email,
.profile-no-children,
.profile-plan-link,
.profile-child-name {
  color: var(--app-muted);
}

.profile-menu-divider {
  background: rgba(255, 255, 255, 0.08);
}

.kw-canvas-section.library-meadow {
  align-items: stretch;
  gap: 1.05rem;
  min-height: 100vh;
  padding: 1.35rem clamp(1rem, 2vw, 1.8rem) 2rem;
  background:
    radial-gradient(circle at 70% 8%, rgba(106, 78, 160, 0.24), transparent 24rem),
    var(--kw-product-library-canvas) center / cover no-repeat,
    linear-gradient(180deg, #121026, #0f0d20);
}

.kw-canvas-section.library-meadow::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
}

.library-meadow .asset-layer {
  opacity: 0.14;
  filter: saturate(0.55) brightness(0.7);
}

.welcome-banner,
.library-banner {
  width: min(100%, 78rem);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.welcome-banner .eyebrow,
.library-banner .eyebrow {
  color: var(--app-muted);
  letter-spacing: 0;
  text-transform: none;
}

.welcome-banner h1,
.library-banner h1 {
  color: #fff;
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.02;
}

.welcome-banner .welcome-sub,
.library-banner p {
  max-width: 39rem;
  color: var(--app-muted);
  font-weight: 650;
}

.welcome-stats,
.library-summary {
  gap: 0.5rem;
}

.welcome-stat,
.library-summary div,
.dashboard-profile-switcher,
.plan-hint-banner,
.library-controls,
.library-filters-wrap,
.dashboard-card,
.bookshelf-container,
.continue-row,
.stat-item,
.child-row,
.empty-inline,
.shelf-toggle-label,
.parent-modal-card,
.story-card-body {
  background: var(--app-panel);
  border: 0.06rem solid var(--app-border);
  box-shadow: none;
}

.welcome-stat,
.library-summary div {
  color: var(--app-text);
  border-radius: 999px;
}

.library-summary dt,
.filters-label,
.continue-info p,
.stat-label,
.child-stat,
.empty-inline span,
.story-card-blurb,
.story-state,
.progress-status,
.membership-detail {
  color: var(--app-muted);
}

.library-summary dd,
.dashboard-card-header h3,
.empty-inline strong,
.continue-info h4,
.stat-number,
.child-name,
.story-card-body h3,
.membership-detail-value {
  color: #fff;
}

.dashboard-profile-switcher,
.library-workspace,
.dashboard-grid,
.bookshelf-container,
.library-collection,
.library-controls,
.library-filters-wrap,
.plan-hint-banner {
  width: min(100%, 78rem);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(18rem, 0.82fr);
  align-items: start;
  gap: 1rem;
}

.dashboard-card-full {
  grid-column: 1 / span 2;
}

.membership-card {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.dashboard-card {
  min-height: 100%;
  padding: 1rem;
  border-radius: 0.72rem;
}

#continue-reading-card [data-continue-list] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.dashboard-card:hover,
.continue-row:hover,
.continue-row:focus-visible,
.child-row:hover,
.child-row:focus-visible,
.child-row.is-active,
.avatar-select-btn:hover,
.avatar-select-btn:focus-visible,
.avatar-select-btn.is-active {
  background: #343148;
  border-color: var(--app-border-strong);
  box-shadow: var(--app-shadow-raised);
}

.dashboard-card-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dashboard-card-header a {
  color: #f8f0a5;
}

.dashboard-card-header a::after {
  content: " ->";
}

.dashboard-card-icon.kw-icon,
.welcome-stat-icon.kw-icon,
.plan-hint-icon.kw-icon,
.profile-trigger-avatar.kw-icon,
.profile-menu-icon.kw-icon {
  color: var(--app-accent);
}

.stat-grid {
  gap: 0.55rem;
}

.stat-item {
  padding: 0.72rem 0.55rem;
}

.skill-bar-bg,
.progress-bar-bg,
.analytics-meter-row i,
.analytics-funnel i,
.analytics-book-meter {
  background: rgba(255, 255, 255, 0.16);
}

.skill-bar-fill,
.progress-bar-fill {
  background: linear-gradient(90deg, #f8f0a5, #fff7bd);
}

.skill-pct,
.continue-progress,
.membership-detail-value.is-success {
  color: var(--app-accent);
}

.continue-row {
  position: relative;
  min-height: 7.4rem;
  display: grid;
  grid-template-columns: minmax(7rem, 40%) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.72rem;
}

.continue-thumb {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 3;
  border-radius: 0.56rem;
  object-fit: cover;
  box-shadow: 0 0.55rem 0.85rem rgba(0, 0, 0, 0.2);
}

.continue-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.continue-meter {
  display: block;
  height: 0.22rem;
  margin-top: 0.78rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.continue-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff6a8, #fffbd0);
}

.continue-progress {
  position: absolute;
  right: 0.72rem;
  bottom: 0.66rem;
  font-family: var(--font-display);
  font-weight: 950;
}

.library-meadow .wood-button,
.profile-menu .wood-button {
  background: var(--app-accent);
  border: 0;
  color: #171326;
  text-shadow: none;
  box-shadow: none;
}

.library-meadow .wood-button.is-quiet,
.profile-menu .wood-button.is-quiet {
  background: #38354d;
  border: 0.06rem solid #57516f;
  color: #f7f3ff;
}

.library-meadow .wood-button:disabled {
  background: #4a4658;
  color: #9f98b6;
}

.search-input,
.profile-add-child-form input,
.profile-add-child-form select {
  background: #222033;
  border-color: #4b4563;
  color: #fff;
}

.search-input::placeholder {
  color: #aaa3c1;
}

.language-code {
  background: #1d1b2d;
  color: var(--app-accent);
}

.library-filters .leaf-badge,
.membership-plan-badge,
.progress-ribbon,
.saved-star,
.lock-badge,
.acorn-badge,
.story-card-meta .leaf-badge {
  background: #343148;
  border-color: #504a68;
  color: #efeafd;
  text-shadow: none;
}

.library-filters .leaf-badge:hover,
.library-filters .leaf-badge:focus-visible,
.library-filters .leaf-badge.is-active {
  background: var(--app-accent);
  border-color: var(--app-accent);
  color: #171326;
}

.bookshelf-container {
  padding: 0;
  background: transparent;
  border: 0;
}

.library-collection {
  grid-template-columns: repeat(auto-fit, minmax(15.8rem, 1fr));
  gap: 1rem;
  margin-top: 0;
}

.library-collection .story-card,
.kid-card {
  overflow: hidden;
  background: var(--app-panel-soft);
  border: 0.06rem solid var(--app-border);
  border-radius: 0.78rem;
  box-shadow: none;
}

.library-collection .story-card:hover,
.library-collection .story-card:focus-within,
.kid-card:hover,
.kid-card:focus-within {
  transform: translateY(-0.12rem);
  border-color: var(--app-border-strong);
  box-shadow: var(--app-shadow-raised);
}

.story-card-art,
.library-collection .story-card-art,
.kid-card-art {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 0.72rem 0.72rem 0 0;
  background: #211f33;
}

.story-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-card-body,
.library-collection .story-card-body,
.kid-card-body {
  min-height: auto;
  padding: 0.88rem;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.story-card-actions .story-primary-action,
.story-card-actions .kdp-buy-options {
  grid-column: 1 / -1;
}

.kdp-buy-options {
  background: #211f33;
  border-color: #4b4563;
}

.kdp-buy-label {
  color: var(--app-accent);
}

.parent-modal-overlay {
  background: rgba(11, 10, 22, 0.78);
}

.parent-modal-card {
  color: var(--app-text);
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .membership-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 700px) {
  body > main {
    padding-left: 0;
  }

  .forest-nav {
    right: 0;
    bottom: auto;
    width: auto;
    min-height: 4.6rem;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 0.9rem;
  }

  .forest-nav .brand-mark {
    width: auto;
    margin: 0;
  }

  .forest-nav .map-toggle {
    display: inline-flex;
    width: auto;
    margin-left: auto;
    justify-content: center;
  }

  .forest-nav .branch-nav {
    position: fixed;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: stretch;
    gap: 0.6rem;
    padding: 5.4rem 1.2rem 1.2rem;
    visibility: hidden;
    opacity: 0;
    background: rgba(18, 16, 38, 0.98);
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.nav-open .forest-nav .branch-nav {
    visibility: visible;
    opacity: 1;
  }

  .forest-nav .branch-nav a,
  .forest-nav .branch-nav button,
  .forest-nav .profile-trigger {
    width: 100%;
    min-height: 3rem;
    padding-inline: 1rem;
  }

  .profile-dropdown {
    margin-top: 1rem;
  }

  .profile-menu {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
  }

  .kw-canvas-section.library-meadow {
    padding-top: 5.8rem;
  }
}

@media (max-width: 760px) {
  .dashboard-grid,
  .dashboard-card-full,
  .library-controls,
  .library-filters-wrap {
    grid-template-columns: 1fr;
  }

  .dashboard-card-full {
    grid-column: auto;
  }

  .library-banner {
    grid-template-columns: 1fr;
  }

  .library-summary {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }

  .welcome-stats,
  .library-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-stat,
  .library-summary div {
    border-radius: 0.72rem;
  }

  #continue-reading-card [data-continue-list] {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .welcome-stats,
  .library-summary,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .library-collection {
    grid-template-columns: 1fr;
  }
}

/* ---------- Premium Design Enhancements ---------- */

/* Custom wooden frame and graphic for empty states */
.empty-inline {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: radial-gradient(circle at 50% 50%, rgba(255, 252, 230, 0.9) 0%, rgba(255, 249, 218, 0.4) 100%), var(--app-panel-soft) !important;
  border: 0.1rem dashed rgba(139, 110, 77, 0.32) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: inset 0 0.15rem 0.35rem rgba(17, 46, 29, 0.05) !important;
  padding: 1.8rem 1rem !important;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.empty-inline:hover {
  border-color: rgba(139, 110, 77, 0.5) !important;
  transform: scale(1.01);
}

.empty-inline::before {
  content: "🧭"; /* Cozy explorer compass default */
  font-size: 2.2rem;
  margin-bottom: 0.3rem;
  filter: drop-shadow(0 0.15rem 0.25rem rgba(0,0,0,0.08));
  display: block;
}

#continue-reading-card .empty-inline::before {
  content: "📖"; /* Storybook icon */
}

[data-skill-list] .empty-inline::before {
  content: "🌱"; /* Growing sprout icon */
}

[data-children-list] .empty-inline::before {
  content: "🐰"; /* Oreo & Caramel bunny profile placeholder */
}

/* Premium Explorer Pass (Membership Card Upgrade) */
.dashboard-card.membership-card {
  background: linear-gradient(135deg, rgba(255, 254, 248, 0.95), rgba(248, 243, 226, 0.98)) !important;
  border: 0.12rem solid #bfa571 !important; /* Gold/Bronze border */
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow), 0 0 0 0.25rem rgba(212, 184, 122, 0.15) !important;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.dashboard-card.membership-card:hover {
  transform: translateY(-0.15rem);
  box-shadow: var(--app-shadow-raised), 0 0 0 0.3rem rgba(212, 184, 122, 0.22) !important;
}

.dashboard-card.membership-card::after {
  content: "★";
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  width: 2.2rem;
  height: 2.2rem;
  background: #d4b87a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  font-size: 0.75rem;
  box-shadow: 0 0 0.3rem rgba(0,0,0,0.1);
  font-weight: bold;
}

.membership-plan-badge {
  background: linear-gradient(135deg, #2f8f57, #1f6f44) !important;
  color: #fff !important;
  padding: 0.45rem 1.1rem !important;
  border-radius: 2rem !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800 !important;
  font-size: 0.85rem !important;
  box-shadow: 0 0.25rem 0.5rem rgba(31, 111, 68, 0.2) !important;
  margin-bottom: 0.9rem !important;
  border: none !important;
}

/* Story Card Enhancements: 3D Lift & Soft Cover Shadow on Hover */
.library-collection .story-card,
.kid-card {
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s ease !important;
  will-change: transform, box-shadow;
}

.library-collection .story-card:hover,
.library-collection .story-card:focus-within,
.kid-card:hover,
.kid-card:focus-within {
  transform: translateY(-0.4rem) scale(1.015) !important;
  box-shadow: 0 0.8rem 1.8rem rgba(28, 48, 24, 0.16) !important;
  border-color: rgba(91, 60, 27, 0.35) !important;
}

/* Image Zoom transition on Hover */
.story-card-art img,
.library-collection .story-card-art img,
.kid-card-art img {
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.library-collection .story-card:hover .story-card-art img,
.kid-card:hover .story-card-art img {
  transform: scale(1.05) !important;
}

/* Smooth active lift & rotation for filter badges on hover */
.leaf-badge {
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.1) !important;
}

.leaf-badge:hover:not(.is-active) {
  transform: translateY(-0.1rem) scale(1.04) rotate(-0.5deg) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: var(--app-border) !important;
  box-shadow: 0 0.15rem 0.35rem rgba(0, 0, 0, 0.06) !important;
}

.leaf-badge.is-active:hover {
  transform: translateY(-0.1rem) scale(1.02) rotate(0.5deg) !important;
}

/* Active sprout pulse transition on child avatar switchers */
.avatar-circle {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.avatar-select-btn:hover .avatar-circle {
  transform: translateY(-0.15rem) scale(1.08) !important;
  box-shadow: 0 0.3rem 0.6rem rgba(17, 46, 29, 0.12) !important;
}

.avatar-select-btn.is-active .avatar-circle {
  box-shadow: 0 0 0 0.2rem #2f8f57, 0 0.25rem 0.5rem rgba(17, 46, 29, 0.15) !important;
}

/* ================================================================
   DESIGN IMPROVEMENTS — My Woods & Story Library
   Consistent, usable, uniform polish for the dark storybook shell
   ================================================================ */

/* --- Enhanced Welcome & Library Banners --- */
.welcome-banner,
.library-banner {
  padding: clamp(1.6rem, 2.8vw, 2.2rem) clamp(1.2rem, 2vw, 1.8rem);
  border-bottom: 0.06rem solid rgba(255, 255, 255, 0.06);
  margin-bottom: 0.35rem;
}

.welcome-banner h1,
.library-banner h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-weight: 850;
}

.welcome-banner .welcome-sub,
.library-banner p {
  font-size: clamp(0.92rem, 1.1vw, 1.02rem);
  line-height: 1.52;
  opacity: 0.82;
}

.welcome-banner .eyebrow,
.library-banner .eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.62;
}

/* --- Unified Stats Chips --- */
.welcome-stat,
.library-summary div {
  padding: 0.5rem 0.82rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  transition: background 200ms ease, border-color 200ms ease;
}

.welcome-stat:hover,
.library-summary div:hover {
  background: #3a374f;
  border-color: var(--app-border-strong);
}

.welcome-stat-icon.kw-icon {
  --icon-size: 0.88rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 246, 168, 0.12);
  border-radius: 0.35rem;
}

/* --- Dashboard Grid Improvements --- */
.dashboard-grid {
  gap: 0.85rem;
}

.dashboard-card {
  border-radius: 0.82rem;
  transition: transform 220ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 220ms ease,
              border-color 220ms ease;
}

.dashboard-card:hover {
  transform: translateY(-0.12rem);
}

.dashboard-card-header {
  margin-bottom: 0.72rem;
  padding-bottom: 0.55rem;
}

.dashboard-card-icon.kw-icon {
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 246, 168, 0.1);
  border-radius: 0.4rem;
  --icon-size: 0.92rem;
}

.dashboard-card-header h3 {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dashboard-card-header a {
  font-size: 0.78rem;
  font-weight: 750;
  opacity: 0.85;
  transition: opacity 180ms ease;
}

.dashboard-card-header a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --- Continue Reading Cards --- */
.continue-row {
  border-radius: 0.65rem;
  transition: transform 200ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
              background 200ms ease,
              border-color 200ms ease,
              box-shadow 200ms ease;
}

.continue-row:hover,
.continue-row:focus-visible {
  transform: translateY(-0.08rem);
}

.continue-thumb {
  border-radius: 0.45rem;
  border: 0.06rem solid rgba(255, 255, 255, 0.06);
}

.continue-info h4 {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.22;
}

/* --- Stat Items --- */
.stat-item {
  border-radius: 0.55rem;
  padding: 0.8rem 0.6rem;
  transition: background 200ms ease, border-color 200ms ease;
}

.stat-item:hover {
  background: #343148;
  border-color: var(--app-border-strong);
}

.stat-number {
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* --- Skill Progress Bars --- */
.skill-row {
  padding: 0.25rem 0;
}

.skill-name {
  font-size: 0.78rem;
  font-weight: 800;
}

.skill-bar-bg {
  height: 0.42rem;
  border-radius: 999px;
}

.skill-bar-fill {
  border-radius: 999px;
}

.skill-pct {
  font-size: 0.72rem;
  font-weight: 900;
  font-family: var(--font-display);
}

/* --- Membership Card --- */
.dashboard-card.membership-card {
  background: linear-gradient(160deg, #2d2b3f 0%, #282640 60%, #302c48 100%) !important;
  border: 0.08rem solid rgba(212, 184, 122, 0.25) !important;
  box-shadow: 0 0 0 0.06rem rgba(212, 184, 122, 0.08), var(--app-shadow-raised) !important;
}

.dashboard-card.membership-card::after {
  display: none;
}

.dashboard-card.membership-card:hover {
  border-color: rgba(212, 184, 122, 0.4) !important;
  box-shadow: 0 0 0 0.08rem rgba(212, 184, 122, 0.12), var(--app-shadow-raised) !important;
}

.membership-plan-badge {
  background: linear-gradient(135deg, rgba(255, 246, 168, 0.15), rgba(255, 246, 168, 0.08)) !important;
  color: var(--app-accent) !important;
  border: 0.06rem solid rgba(255, 246, 168, 0.25) !important;
  padding: 0.35rem 0.82rem !important;
  font-size: 0.78rem !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.membership-detail {
  padding: 0.42rem 0;
  font-size: 0.82rem;
}

.membership-detail + .membership-detail {
  border-top: 0.06rem solid rgba(255, 255, 255, 0.06);
}

.membership-actions {
  padding-top: 0.72rem;
  margin-top: 0.72rem;
  border-top: 0.06rem solid rgba(255, 255, 255, 0.06);
  gap: 0.45rem;
}

/* --- Children / Readers --- */
.child-row {
  border-radius: 0.55rem;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease;
}

.child-row:hover {
  transform: translateY(-0.05rem);
}

/* --- Empty States (Cleaner) --- */
.empty-inline {
  min-height: 5.2rem !important;
  padding: 1.4rem 1rem !important;
  border-radius: 0.65rem !important;
  border: 0.08rem dashed rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none !important;
}

.empty-inline::before {
  font-size: 1.8rem;
  margin-bottom: 0.2rem;
  opacity: 0.7;
}

.empty-inline strong {
  font-size: 0.92rem;
  font-weight: 800;
  opacity: 0.9;
}

.empty-inline span {
  font-size: 0.78rem;
  font-weight: 650;
  opacity: 0.6;
  line-height: 1.4;
}

/* --- Profile Switcher --- */
.dashboard-profile-switcher {
  padding: 0.65rem 0.85rem;
  gap: 0.65rem;
  border-radius: 0.72rem;
}

.avatar-circle {
  width: 3.4rem;
  height: 3.4rem;
  border-width: 0.12rem;
  border-color: rgba(255, 255, 255, 0.12);
}

.avatar-name {
  font-size: 0.72rem;
  font-weight: 750;
  opacity: 0.72;
}

.avatar-select-btn.is-active .avatar-name {
  opacity: 1;
  color: var(--app-accent);
}

/* --- Library Banner Layout Uniformity --- */
.library-banner {
  gap: 0.65rem 1.2rem;
}

.library-summary div {
  padding: 0.5rem 0.72rem;
  border-radius: 0.55rem;
}

.library-summary dt {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.library-summary dd {
  font-size: 1.4rem;
  font-weight: 900;
}

/* --- Search & Filters (Cleaner) --- */
.library-controls {
  padding: 0.6rem;
  gap: 0.55rem;
  border-radius: 0.72rem;
}

.search-input {
  min-height: 2.55rem;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: 0.55rem;
  padding: 0.48rem 1rem 0.48rem 2.4rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-input:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 0.14rem rgba(255, 246, 168, 0.12);
  background: #292740;
}

.library-filters-wrap {
  padding: 0.6rem;
  border-radius: 0.72rem;
  gap: 0.45rem;
}

.library-filters {
  gap: 0.38rem;
}

.library-filters .leaf-badge {
  min-height: 2.45rem;
  padding: 0.35rem 0.72rem;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: 0.55rem;
  transition: all 180ms ease;
}

.library-filters .leaf-badge:hover,
.library-filters .leaf-badge:focus-visible {
  background: #3a374f;
  border-color: var(--app-border-strong);
  color: #fff;
  transform: none !important;
}

.library-filters .leaf-badge.is-active {
  background: var(--app-accent) !important;
  color: #171326 !important;
  border-color: var(--app-accent) !important;
  font-weight: 900;
  transform: none !important;
}

/* --- Story Cards Polish --- */
.library-collection .story-card,
.kid-card {
  border-radius: 0.82rem;
  overflow: hidden;
  transition: transform 280ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 280ms ease,
              border-color 280ms ease !important;
}

.library-collection .story-card:hover,
.library-collection .story-card:focus-within,
.kid-card:hover,
.kid-card:focus-within {
  transform: translateY(-0.25rem) scale(1.01) !important;
  box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.28) !important;
  border-color: rgba(255, 246, 168, 0.18) !important;
}

.story-card-art img,
.library-collection .story-card-art img,
.kid-card-art img {
  transition: transform 350ms cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.library-collection .story-card:hover .story-card-art img,
.kid-card:hover .kid-card-art img {
  transform: scale(1.04) !important;
}

.library-collection .story-card-body {
  padding: 0.95rem;
  gap: 0.55rem;
}

.library-collection .story-card-body h3 {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.18;
}

.library-collection .story-card-blurb {
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.72;
}

.library-collection .story-state {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.22rem 0.42rem;
  border-radius: 0.35rem;
}

/* --- Plan Hint Banner --- */
.plan-hint-banner {
  padding: 0.62rem 0.85rem;
  border-radius: 0.72rem;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

/* --- Bookshelf toggle --- */
.shelf-toggle-label {
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  border-radius: 0.55rem;
  transition: background 180ms ease, border-color 180ms ease;
}

.shelf-toggle-label:hover {
  background: #343148;
  border-color: var(--app-border-strong);
}

/* --- Smooth page entrance --- */
@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kw-canvas-section.library-meadow > * {
  animation: page-fade-in 0.4s ease backwards;
}

.kw-canvas-section.library-meadow > :nth-child(2) { animation-delay: 0.05s; }
.kw-canvas-section.library-meadow > :nth-child(3) { animation-delay: 0.1s; }
.kw-canvas-section.library-meadow > :nth-child(4) { animation-delay: 0.15s; }
.kw-canvas-section.library-meadow > :nth-child(5) { animation-delay: 0.2s; }
.kw-canvas-section.library-meadow > :nth-child(6) { animation-delay: 0.25s; }
.kw-canvas-section.library-meadow > :nth-child(7) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .kw-canvas-section.library-meadow > * {
    animation: none;
  }
}

/* --- Responsive refinements --- */
@media (max-width: 700px) {
  .welcome-banner h1,
  .library-banner h1 {
    font-size: clamp(1.75rem, 6vw, 2.2rem);
  }

  .dashboard-card {
    padding: 0.85rem;
  }

  .stat-item {
    padding: 0.6rem 0.5rem;
  }

  .stat-number {
    font-size: 1.35rem;
  }

  .library-collection .story-card-body {
    padding: 0.82rem;
  }

  .avatar-circle {
    width: 2.8rem;
    height: 2.8rem;
  }

  .dashboard-profile-switcher {
    padding: 0.5rem 0.65rem;
    gap: 0.45rem;
  }
}

/* ---------- Sunlit Storybook Meadow & Dashboard Aesthetic Pass ---------- */

.story-shelf {
  width: min(76rem, 100%);
  margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.story-shelf-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.5rem;
}

.story-shelf-heading h2 {
  margin: 0.2rem 0 0;
  color: #14432d;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  line-height: 1.05;
  text-shadow: 0 0.08rem 0 rgba(255, 240, 180, 0.6);
}

.story-shelf-sub {
  margin: 0.3rem 0 0;
  color: #264332;
  font-size: 0.98rem;
  font-weight: 700;
}

.shelf-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  background: rgba(255, 253, 242, 0.92);
  border: 0.1rem solid rgba(91, 60, 27, 0.22);
  border-radius: 2rem;
  box-shadow: 0 0.2rem 0.6rem rgba(20, 45, 26, 0.08);
  color: #2b1f10;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 200ms ease;
}

.shelf-toggle-label:hover {
  background: #fffdf5;
  border-color: rgba(47, 143, 87, 0.4);
  transform: translateY(-0.06rem);
  box-shadow: 0 0.35rem 0.8rem rgba(20, 45, 26, 0.12);
}

.bookshelf-container {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: clamp(1.2rem, 2.4vw, 2.2rem);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 248, 210, 0.65) 0%, rgba(240, 230, 198, 0.35) 70%),
              rgba(255, 253, 244, 0.88);
  border: 0.14rem solid rgba(91, 60, 27, 0.22);
  border-radius: 1.8rem;
  box-shadow: 0 0.8rem 2.2rem rgba(17, 46, 29, 0.14), inset 0 0.08rem 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(0.2rem);
}

/* Polished Dashboard Cards with Sunlit Parchment Glassmorphism */
.dashboard-card {
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 252, 226, 0.85) 0%, rgba(253, 246, 220, 0.65) 100%),
              rgba(255, 253, 244, 0.94);
  border: 0.12rem solid rgba(91, 60, 27, 0.18);
  border-radius: 1.4rem;
  box-shadow: 0 0.6rem 1.6rem rgba(17, 46, 29, 0.11), inset 0 0.08rem 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(0.15rem);
  transition: transform 250ms cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 250ms ease, border-color 250ms ease;
}

.dashboard-card:hover {
  transform: translateY(-0.2rem);
  box-shadow: 0 0.9rem 2.2rem rgba(17, 46, 29, 0.16), 0 0 0 0.18rem rgba(255, 211, 95, 0.3);
  border-color: rgba(47, 143, 87, 0.32);
}

.dashboard-card-icon.kw-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #44a065, #237443);
  color: #fffdf2;
  border-radius: 0.7rem;
  box-shadow: 0 0.2rem 0.5rem rgba(35, 116, 67, 0.3), inset 0 0.06rem 0.06rem rgba(255, 255, 255, 0.35);
}

.dashboard-card-header h3 {
  color: #123d29;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.4vw, 1.32rem);
  font-weight: 800;
  text-shadow: 0 0.06rem 0 rgba(255, 240, 180, 0.5);
}

.dashboard-card-header a {
  color: #277e48;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 800;
  transition: color 180ms ease, transform 180ms ease;
}

.dashboard-card-header a:hover {
  color: #17542d;
  text-decoration: underline;
}

/* Stat & Skill items inside cards */
.stat-item, .continue-row, .child-row {
  background: rgba(255, 255, 255, 0.65);
  border: 0.08rem solid rgba(91, 60, 27, 0.12);
  border-radius: 0.9rem;
  transition: all 220ms ease;
}

.stat-item:hover, .continue-row:hover, .child-row:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(47, 143, 87, 0.35);
  box-shadow: 0 0.3rem 0.8rem rgba(17, 46, 29, 0.08);
}

.stat-number {
  color: #14432d;
  font-family: var(--font-display);
  font-weight: 800;
}

.stat-label {
  color: #4a3821;
  font-weight: 800;
}

.skill-bar-fill {
  background: linear-gradient(90deg, #62a353, #2d6a4f);
  border-radius: 1rem;
}

.membership-plan-badge {
  background: linear-gradient(135deg, #fff3cf, #f5e2a6);
  border: 0.08rem solid #d4a74e;
  color: #5c3f15;
  box-shadow: 0 0.12rem 0.3rem rgba(92, 63, 21, 0.12);
}

@media (max-width: 768px) {
  .story-shelf {
    margin-top: 1rem;
  }

  .story-shelf-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .dashboard-card {
    padding: 1.1rem;
  }
}
