/* Nuuko - Cozy Storybook Journaling Experience */
/* Pure CSS version - Stunning & Lightweight */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Crimson+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

/* === ROOT VARIABLES === */
:root {
  /* Nuuko Color Palette */
  --nuuko-green: #6B8F71;
  --nuuko-clay: #9A6B51; 
  --nuuko-espresso: #3D342C;
  --nuuko-cream: #F3EFE5;
  --nuuko-stone: #8D877E;
  
  /* Extended Palette */
  --cream-light: #FDFCF9;
  --cream-dark: #EDE7DB;
  --green-light: #A6C3A7;
  --green-dark: #5A7A60;
  --clay-light: #CFA88D;
  --stone-light: #A69B93;
  
  /* Mood Colors */
  --mood-anxious: #D67E7E;
  --mood-sad: #A8809C;
  --mood-calm: #8DB0A8;
  --mood-thoughtful: #9BA47C;
  --mood-happy: #C5A572;
  --mood-excited: #D4956B;
  --mood-grateful: #B88B6B;
  
  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Crimson Pro', serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;
  
  /* Shadows */
  --shadow-soft: 0 2px 8px rgba(61, 52, 44, 0.08), 0 1px 3px rgba(61, 52, 44, 0.06);
  --shadow-medium: 0 8px 25px rgba(61, 52, 44, 0.12), 0 3px 10px rgba(61, 52, 44, 0.08);
  --shadow-warm: 0 8px 32px rgba(154, 107, 81, 0.15);
  
  /* Animations */
  --ease-gentle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  color: var(--nuuko-espresso);
  background: var(--nuuko-cream);
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
  background: 
    radial-gradient(circle at 20% 30%, rgba(107, 143, 113, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(154, 107, 81, 0.03) 0%, transparent 50%),
    linear-gradient(135deg, var(--nuuko-cream) 0%, var(--cream-dark) 100%);
  background-attachment: fixed;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--nuuko-espresso);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

p {
  color: var(--nuuko-stone);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.text-encouraging {
  color: var(--nuuko-green);
  font-weight: 500;
}

.text-muted {
  color: var(--stone-light);
}

.text-small {
  font-size: 0.875rem;
}

.text-xs {
  font-size: 0.75rem;
}

.italic {
  font-style: italic;
}

/* === LAYOUT === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container-sm {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-sidebar {
  grid-template-columns: 2fr 1fr;
  gap: var(--space-2xl);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

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

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* === CARDS === */
.card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(141, 135, 126, 0.15);
  backdrop-filter: blur(12px);
  transition: all 0.3s var(--ease-gentle);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
  border-color: rgba(107, 143, 113, 0.3);
}

.card-minimal {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid rgba(141, 135, 126, 0.15);
  backdrop-filter: blur(8px);
}

.card-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(243, 239, 229, 0.98) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(141, 135, 126, 0.12);
  box-shadow: 
    0 8px 32px rgba(154, 107, 81, 0.12),
    0 2px 8px rgba(61, 52, 44, 0.06),
    inset 0 1px 2px rgba(255, 255, 255, 0.6);
  position: relative;
}

.card-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(107, 143, 113, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(154, 107, 81, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.card-hero > * {
  position: relative;
  z-index: 1;
}

/* === WRAPPED SECTION === */
.wrapped-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nuuko-stone);
}

.wrapped-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wrapped-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
}

.wrapped-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(107, 143, 113, 0.15);
  color: var(--nuuko-espresso);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

.wrapped-badge--muted {
  background: rgba(61, 52, 44, 0.08);
  color: var(--nuuko-stone);
}

.wrapped-summary-sentence {
  font-size: 1rem;
  color: var(--nuuko-espresso);
  margin-bottom: var(--space-sm);
}

.wrapped-highlights {
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.wrapped-highlight {
  background: rgba(154, 107, 81, 0.12);
  color: var(--nuuko-clay);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
}

.wrapped-empty {
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(61, 52, 44, 0.2);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin: var(--space-sm) 0;
}

.wrapped-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.wrapped-card {
  border: 1px solid rgba(61, 52, 44, 0.08);
  border-radius: 28px;
  padding: var(--space-xl);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, rgba(243, 239, 229, 0.6) 0%, rgba(255, 255, 255, 0.9) 60%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

.wrapped-card__background {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(107, 143, 113, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(154, 107, 81, 0.08) 0%, transparent 45%);
  opacity: 0.65;
  z-index: -1;
}

.wrapped-card__month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-serif);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--nuuko-espresso);
  font-size: 0.9rem;
}

.wrapped-card__month {
  font-weight: 600;
}

.wrapped-card__icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: inset 0 0 0 1px rgba(61, 52, 44, 0.08);
}

.wrapped-card__title {
  font-size: 1rem;
  text-transform: lowercase;
  color: var(--nuuko-stone);
  letter-spacing: 0.08em;
}

.wrapped-card__hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.wrapped-card__hero-value {
  font-size: clamp(2.5rem, 6vw, 3.4rem);
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--nuuko-espresso);
  line-height: 1;
}

.wrapped-card__hero-label {
  font-size: 0.9rem;
  color: var(--nuuko-stone);
  text-transform: lowercase;
}

.wrapped-card__body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--nuuko-espresso);
}

.wrapped-card::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -5%;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  filter: blur(0.5px);
  z-index: -1;
}

.wrapped-card__list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wrapped-card__list-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 0.9rem;
  color: var(--nuuko-espresso);
  position: relative;
  padding: 0.4rem 0;
}

.wrapped-card__list-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(107, 143, 113, 0.2), rgba(154, 107, 81, 0.2));
  border-radius: var(--radius-pill);
  opacity: 0.25;
  transform-origin: left center;
  transform: scaleX(calc((var(--wrapped-progress, 100)) / 100));
}

.wrapped-card__list-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  z-index: 1;
}

.wrapped-card__list-label {
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.wrapped-card__list-context {
  font-size: 0.75rem;
  color: var(--nuuko-stone);
}

.wrapped-card__list-value {
  text-align: right;
  font-size: 0.85rem;
  color: var(--nuuko-stone);
  z-index: 1;
}

.wrapped-card__chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.45rem;
}

.wrapped-chip {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--nuuko-espresso);
  text-transform: lowercase;
  box-shadow: inset 0 0 0 1px rgba(61, 52, 44, 0.05);
}

.wrapped-card__quotes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: var(--space-sm);
  position: relative;
}

.wrapped-card__quote {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--nuuko-stone);
  border-left: 3px solid rgba(154, 107, 81, 0.4);
  padding-left: 0.75rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
}

.wrapped-card__string-lights {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0 0.5rem;
}

.wrapped-card__string-lights span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(212, 149, 107, 0.8);
  box-shadow: 0 4px 8px rgba(212, 149, 107, 0.35);
}
.wrapped-card[data-accent="clay"] {
  border-color: rgba(154, 107, 81, 0.35);
}

.wrapped-card[data-accent="green"] {
  border-color: rgba(107, 143, 113, 0.35);
}

.wrapped-card[data-accent="rose"] {
  border-color: rgba(214, 126, 126, 0.35);
}

.wrapped-card[data-accent="lilac"] {
  border-color: rgba(168, 128, 156, 0.35);
}

.wrapped-card[data-accent="stone"] {
  border-color: rgba(141, 135, 126, 0.35);
}

.wrapped-card[data-accent="gold"] {
  border-color: rgba(197, 165, 114, 0.4);
}

.wrapped-card[data-accent="sunset"] {
  border-color: rgba(212, 149, 107, 0.4);
}

.wrapped-card[data-accent="sage"] {
  border-color: rgba(141, 176, 168, 0.4);
}

/* === SUMMARY SETTINGS META === */
.summary-schedule-meta {
  display: flex;
  gap: var(--space-2xl);
  flex-wrap: wrap;
  margin: var(--space-sm) 0 var(--space-md);
}

.summary-schedule-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 180px;
}

.summary-schedule-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nuuko-stone);
}

.summary-schedule-value {
  font-size: 0.95rem;
  color: var(--nuuko-espresso);
}

.summary-schedule-overdue {
  color: var(--mood-anxious);
  font-weight: 600;
}

/* === SUMMARY HISTORY LIST === */
.summary-history-item {
  padding: 1rem 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(61, 52, 44, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.2s var(--ease-gentle), box-shadow 0.2s var(--ease-gentle);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
}

.summary-history-item--highlight {
  box-shadow: 0 0 0 2px rgba(107, 143, 113, 0.25);
  background: rgba(107, 143, 113, 0.08);
}

.summary-history-item:hover {
  border-color: rgba(107, 143, 113, 0.35);
}

.summary-history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
}

.summary-history-date {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--nuuko-espresso);
  text-transform: lowercase;
}

.summary-history-range {
  font-size: 0.8rem;
  color: var(--nuuko-stone);
}

.summary-history-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.summary-history-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.summary-history-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(61, 52, 44, 0.1);
  color: var(--nuuko-espresso);
  background: rgba(255, 255, 255, 0.8);
}

.summary-history-badge[data-tone="cadence"] {
  border-color: rgba(107, 143, 113, 0.25);
  background: rgba(107, 143, 113, 0.12);
  color: var(--nuuko-espresso);
}

.summary-history-badge[data-tone="gemini"] {
  border-color: rgba(154, 107, 81, 0.25);
  background: rgba(154, 107, 81, 0.12);
  color: var(--nuuko-clay);
}

.summary-history-badge[data-tone="fallback"] {
  border-color: rgba(214, 126, 126, 0.3);
  background: rgba(214, 126, 126, 0.15);
  color: var(--mood-anxious);
}

.summary-history-snippet {
  margin: 0;
  font-size: 0.9rem;
  color: var(--nuuko-stone);
  line-height: 1.6;
}

.summary-history-card-thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.summary-history-card-thumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(61, 52, 44, 0.08);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  color: var(--nuuko-espresso);
}

.summary-history-card-icon {
  font-size: 1rem;
  line-height: 1;
}

.summary-modal-block {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(61, 52, 44, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.summary-modal-heading {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nuuko-stone);
}

.summary-modal-lede {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--nuuko-espresso);
}

.summary-modal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.summary-modal-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.summary-modal-card {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.summary-modal-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(107, 143, 113, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.summary-modal-card-title {
  font-weight: 600;
  color: var(--nuuko-espresso);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.summary-modal-card-body {
  font-size: 0.9rem;
  color: var(--nuuko-stone);
}

.summary-modal-raw {
  margin-top: 0.75rem;
  background: rgba(61, 52, 44, 0.04);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(61, 52, 44, 0.08);
}

.summary-modal-raw summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--nuuko-stone);
}

.summary-modal-raw pre {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--nuuko-espresso);
  white-space: pre-wrap;
  background: rgba(255,255,255,0.9);
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(61, 52, 44, 0.08);
}

.summary-modal-hero {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.summary-modal-hero-stat {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(61, 52, 44, 0.08);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  min-width: 120px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

.summary-modal-hero-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--nuuko-espresso);
  line-height: 1.1;
}

.summary-modal-hero-label {
  font-size: 0.85rem;
  color: var(--nuuko-stone);
  text-transform: lowercase;
}

.summary-modal-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
  color: var(--nuuko-espresso);
}
.summary-history-hero {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin: 0.25rem 0;
}

.summary-history-hero-value {
  font-size: 1.6rem;
  font-weight: 600;
  font-family: var(--font-serif);
  color: var(--nuuko-espresso);
  line-height: 1.1;
}

.summary-history-hero-label {
  font-size: 0.9rem;
  color: var(--nuuko-stone);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

/* === MODAL STYLES === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(61, 52, 44, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s var(--ease-gentle);
  opacity: 1;
  visibility: visible;
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 
    0 20px 60px rgba(61, 52, 44, 0.3),
    0 8px 32px rgba(154, 107, 81, 0.2);
  border: 1px solid rgba(141, 135, 126, 0.2);
  backdrop-filter: blur(20px);
  transform: scale(1);
  transition: all 0.3s var(--ease-gentle);
}

.modal.hidden .modal-content {
  transform: scale(0.95);
}

.modal-header {
  padding: var(--space-xl);
  border-bottom: 1px solid rgba(141, 135, 126, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(243, 239, 229, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--nuuko-espresso);
  margin: 0;
  font-family: var(--font-serif);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--nuuko-stone);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: all 0.3s var(--ease-gentle);
  line-height: 1;
}

.close-btn:hover {
  background: rgba(141, 135, 126, 0.1);
  color: var(--nuuko-espresso);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  max-height: calc(80vh - 120px);
}

.modal-mood {
  margin-bottom: var(--space-md);
}

.modal-mood span {
  display: inline-block;
  background: rgba(107, 143, 113, 0.1);
  color: var(--nuuko-green);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(107, 143, 113, 0.2);
}

.modal-text {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--nuuko-espresso);
  margin-bottom: var(--space-lg);
  white-space: pre-wrap;
  font-family: var(--font-serif);
}

.modal-stats {
  padding-top: var(--space-md);
  border-top: 1px solid rgba(141, 135, 126, 0.15);
  font-size: 0.875rem;
  color: var(--nuuko-stone);
  font-style: italic;
}

#libraryModal {
  align-items: flex-start;
  padding: var(--space-2xl) var(--space-md);
}

.modal-content--wide {
  max-width: 980px;
  width: min(960px, 95%);
  border-radius: 36px;
}

.summary-consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  position: sticky;
  bottom: 0;
  padding-top: var(--space-sm);
  background: rgba(255, 255, 255, 0.95);
}

.library-modal-header {
  background: linear-gradient(135deg, rgba(243, 239, 229, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.library-modal-body {
  padding: calc(var(--space-xl) * 1.2) calc(var(--space-xl) * 1.5);
  background: rgba(255, 255, 255, 0.95);
}

.library-modal-body .library-shelf {
  gap: calc(var(--space-xl) * 1.2);
}

.library-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--nuuko-stone);
  font-style: italic;
}

.library-empty-state .empty-icon {
  font-size: 2.25rem;
  display: block;
  margin-bottom: var(--space-sm);
}

/* Book-like entry cards */
.book-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all 0.3s var(--ease-gentle);
  cursor: pointer;
  border: 1px solid rgba(141, 135, 126, 0.15);
}

.book-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: rgba(107, 143, 113, 0.3);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--nuuko-green) 0%, var(--nuuko-clay) 100%);
  opacity: 0.7;
  transition: all 0.3s var(--ease-gentle);
  border-radius: 0 2px 2px 0;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 25px rgba(61, 52, 44, 0.08),
    0 3px 10px rgba(61, 52, 44, 0.06),
    0 1px 4px rgba(107, 143, 113, 0.1);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(107, 143, 113, 0.25);
}

.book-card:hover::before {
  opacity: 1;
  width: 5px;
}

/* Library open-book layout */
.library-shelf {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 960px;
  margin: 0 auto;
}

.book-open {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: var(--space-lg);
  padding: calc(var(--space-xl) * 1.2) calc(var(--space-xl) * 1.4);
  border-radius: 30px;
  background: linear-gradient(130deg, rgba(154, 107, 81, 0.32) 0%, rgba(107, 143, 113, 0.18) 100%);
  box-shadow: var(--shadow-warm);
  overflow: hidden;
  isolation: isolate;
}

.book-open::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 26px;
  border: 1px solid rgba(141, 135, 126, 0.15);
  pointer-events: none;
}

.book-open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 50%, rgba(255, 255, 255, 0.07));
  pointer-events: none;
  opacity: 0.4;
}

.book-spine {
  position: relative;
  width: 14px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  z-index: 1;
}

.book-spine::before {
  content: '';
  width: 3px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(154, 107, 81, 0.75),
    rgba(154, 107, 81, 0.75) 10px,
    transparent 10px,
    transparent 18px
  );
  box-shadow: 0 0 0 1px rgba(141, 135, 126, 0.15);
}

.book-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: 22px;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.95) 0%, rgba(243, 239, 229, 0.95) 65%, rgba(237, 231, 219, 0.9) 100%);
  box-shadow: inset 0 0 0 1px rgba(141, 135, 126, 0.15), 0 18px 32px -24px rgba(61, 52, 44, 0.75);
  cursor: pointer;
  min-height: 240px;
  color: var(--nuuko-espresso);
  transition: transform 0.35s var(--ease-gentle), box-shadow 0.35s var(--ease-gentle), background 0.35s var(--ease-gentle);
}

.book-page:hover,
.book-page:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(107, 143, 113, 0.25), 0 22px 38px -20px rgba(61, 52, 44, 0.45);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.97) 0%, rgba(243, 239, 229, 0.97) 65%, rgba(237, 231, 219, 0.92) 100%);
}

.book-page--left:hover,
.book-page--left:focus-visible {
  transform: translateY(-6px) rotate(-0.6deg);
}

.book-page--right:hover,
.book-page--right:focus-visible {
  transform: translateY(-6px) rotate(0.6deg);
}

.book-page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
}

.book-page-date {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.375rem;
  color: var(--nuuko-espresso);
  text-transform: capitalize;
}

.book-page-mood {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(107, 143, 113, 0.1);
  border: 1px solid rgba(107, 143, 113, 0.2);
  color: var(--nuuko-green);
  text-transform: lowercase;
}

.book-page-preview {
  flex: 1;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--nuuko-espresso);
  margin-bottom: 0;
}

.book-page-footer {
  font-size: 0.8125rem;
  color: var(--nuuko-stone);
  font-style: italic;
  text-align: right;
}

.book-page--empty {
  cursor: default;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85),
    rgba(255, 255, 255, 0.85) 12px,
    rgba(243, 239, 229, 0.85) 12px,
    rgba(243, 239, 229, 0.85) 24px
  );
  box-shadow: inset 0 0 0 1px rgba(141, 135, 126, 0.1);
  color: var(--stone-light);
}

.book-page--empty:hover,
.book-page--empty:focus-visible {
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(141, 135, 126, 0.1);
}

.book-page--empty .empty-text {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Paper texture */
.paper-texture {
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(61, 52, 44, 0.02) 1px, transparent 0);
  background-size: 20px 20px;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25;
  transition: all 0.3s var(--ease-gentle);
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--nuuko-green), 0 0 0 4px rgba(107, 143, 113, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--nuuko-green) 0%, var(--green-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 143, 113, 0.25), 0 1px 3px rgba(107, 143, 113, 0.15);
  font-weight: 500;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--nuuko-green) 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(107, 143, 113, 0.35), 0 3px 10px rgba(107, 143, 113, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(107, 143, 113, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--nuuko-espresso);
  border: 1px solid rgba(141, 135, 126, 0.25);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(61, 52, 44, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(107, 143, 113, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(61, 52, 44, 0.12), 0 1px 4px rgba(107, 143, 113, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(61, 52, 44, 0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--nuuko-stone);
}

.btn-ghost:hover {
  background: rgba(107, 143, 113, 0.1);
  color: var(--nuuko-espresso);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  min-height: 52px;
}

/* === NAVIGATION === */
.nav {
  background: rgba(243, 239, 229, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(141, 135, 126, 0.15);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 
    0 1px 3px rgba(61, 52, 44, 0.08),
    0 1px 12px rgba(61, 52, 44, 0.04);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--nuuko-espresso);
  transition: all 0.3s var(--ease-gentle);
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-logo .feather {
  font-size: 1.25rem;
  animation: float 4s ease-in-out infinite;
  transition: transform 0.3s var(--ease-gentle);
}

.nav-logo:hover .feather {
  transform: scale(1.1);
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--nuuko-stone);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.3s var(--ease-gentle);
}

.nav-link:hover {
  background: rgba(107, 143, 113, 0.1);
  color: var(--nuuko-espresso);
  transform: translateY(-1px);
}

.nav-link.active {
  background: var(--nuuko-green);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 143, 113, 0.3);
}

/* === FORMS === */
.form-group {
  margin-bottom: var(--space-lg);
}

.label {
  display: block;
  font-weight: 500;
  color: var(--nuuko-espresso);
  margin-bottom: var(--space-sm);
  font-family: var(--font-serif);
}

.input,
.textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(141, 135, 126, 0.2);
  border-radius: var(--radius-md);
  color: var(--nuuko-espresso);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all 0.3s var(--ease-gentle);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 3px rgba(61, 52, 44, 0.06);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--nuuko-stone);
  font-style: italic;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(107, 143, 113, 0.5);
  box-shadow: 
    0 0 0 3px rgba(107, 143, 113, 0.1), 
    inset 0 1px 3px rgba(61, 52, 44, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.textarea {
  min-height: 150px;
  resize: vertical;
  font-size: 1rem;
  line-height: 1.7;
}

.writing-area {
  min-height: 350px;
  font-size: 1rem;
  line-height: 1.7;
  border: none;
  background: transparent;
  resize: none;
  padding: 0;
}

.writing-area:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.writing-notebook textarea:focus,
.writing-notebook textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.date-picker-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.entry-title-input {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--nuuko-espresso);
  border-bottom: 2px dashed rgba(154, 107, 81, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.entry-title-input:focus {
  border-color: rgba(107, 143, 113, 0.6);
  background: rgba(255, 250, 242, 0.6);
}

.entry-title-input::placeholder {
  color: rgba(61, 52, 44, 0.45);
}

.date-display {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(154, 107, 81, 0.2);
  background: linear-gradient(135deg, #fffaf2, #f5ede2);
  color: var(--nuuko-espresso);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 8px 18px rgba(61, 52, 44, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.date-display:hover {
  border-color: rgba(154, 107, 81, 0.35);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 10px 22px rgba(61, 52, 44, 0.08);
}

.date-display:focus-visible {
  outline: 2px solid rgba(107, 143, 113, 0.5);
  outline-offset: 2px;
}

.date-display-icon {
  width: 20px;
  height: 20px;
}

.date-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  transform: none;
  width: 320px;
  min-width: 280px;
  background: linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(246, 238, 228, 0.98));
  border: 1px solid rgba(154, 107, 81, 0.18);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(61, 52, 44, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: 1rem;
  z-index: 50;
}

.date-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--nuuko-espresso);
  font-weight: 700;
}

.date-month {
  text-transform: lowercase;
}

.date-nav {
  border: 1px solid rgba(154, 107, 81, 0.2);
  background: rgba(255, 255, 255, 0.8);
  color: var(--nuuko-espresso);
  border-radius: 12px;
  width: 36px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.date-nav:hover {
  border-color: rgba(154, 107, 81, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.date-nav.disabled, .date-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(154, 107, 81, 0.15);
}

.date-weekdays, .date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
}

.date-weekdays {
  margin: 0.35rem 0 0.2rem;
  color: rgba(61, 52, 44, 0.7);
  font-size: 0.8rem;
  text-transform: lowercase;
}

.date-weekdays span {
  text-align: center;
}

.date-day {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.8);
  color: var(--nuuko-espresso);
  border-radius: 12px;
  padding: 0.55rem 0.35rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.date-day:hover {
  border-color: rgba(107, 143, 113, 0.35);
  background: rgba(107, 143, 113, 0.12);
}

.date-day.selected {
  background: linear-gradient(135deg, rgba(107, 143, 113, 0.8), rgba(154, 107, 81, 0.8));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(107, 143, 113, 0.2);
}

.date-day.today:not(.selected) {
  border-color: rgba(154, 107, 81, 0.35);
}

.date-day.disabled {
  color: rgba(61, 52, 44, 0.35);
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.6);
}

.date-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.date-foot-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  color: var(--nuuko-espresso);
}

.date-popover.hidden {
  display: none;
}

/* === MOOD SPECTRUM === */
.mood-spectrum {
  position: relative;
  height: 10px;
  background: linear-gradient(90deg, 
    var(--mood-anxious) 0%,
    var(--mood-sad) 16.66%,
    var(--mood-calm) 33.33%,
    var(--mood-thoughtful) 50%,
    var(--mood-happy) 66.66%,
    var(--mood-excited) 83.33%,
    var(--mood-grateful) 100%
  );
  border-radius: 6px;
  cursor: pointer;
  margin: 1.25rem 0;
  box-shadow: 
    inset 0 1px 2px rgba(61, 52, 44, 0.08),
    0 1px 3px rgba(61, 52, 44, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mood-thumb {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
  border: 2px solid var(--nuuko-espresso);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 
    0 4px 15px rgba(61, 52, 44, 0.15), 
    0 2px 6px rgba(61, 52, 44, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: all 0.3s var(--ease-gentle);
  backdrop-filter: blur(10px);
}

.mood-thumb:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 
    0 8px 25px rgba(61, 52, 44, 0.2), 
    0 3px 10px rgba(61, 52, 44, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.9);
  border-color: var(--nuuko-green);
}

.mood-thumb:active {
  transform: translate(-50%, -50%) scale(1.05);
  cursor: grabbing;
}

.mood-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--nuuko-stone);
  margin-bottom: var(--space-sm);
}

.mood-current {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nuuko-clay);
  font-style: italic;
}

/* === CALENDAR === */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(141, 135, 126, 0.15);
  border-radius: var(--radius-md);
  padding: 0.55rem;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.3s var(--ease-gentle);
  cursor: pointer;
  position: relative;
}

.calendar-day.active {
  background: linear-gradient(135deg, var(--nuuko-green) 0%, var(--green-dark) 100%);
  color: white;
  box-shadow: 
    0 2px 8px rgba(107, 143, 113, 0.25),
    0 1px 3px rgba(107, 143, 113, 0.15);
  font-weight: 600;
}

.calendar-day.inactive {
  background: rgba(243, 239, 229, 0.5);
  color: var(--stone-light);
}

.calendar-day:hover {
  background: rgba(107, 143, 113, 0.08);
  transform: scale(1.03);
  box-shadow: 0 2px 6px rgba(107, 143, 113, 0.1);
}

.calendar-day.active:hover {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--nuuko-green) 100%);
  transform: scale(1.03);
  box-shadow: 
    0 4px 12px rgba(107, 143, 113, 0.3),
    0 2px 6px rgba(107, 143, 113, 0.2);
}

.calendar--year {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
}

.calendar-shell {
  display: flex;
  justify-content: center;
}

.calendar-shell .calendar {
  width: 100%;
  max-width: 720px;
}
.year-month-card {
  border: 1px solid rgba(61, 52, 44, 0.08);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease-gentle);
}

.year-month-card:hover {
  border-color: rgba(107, 143, 113, 0.35);
  box-shadow: 0 4px 10px rgba(61, 52, 44, 0.12);
}

.year-month-title {
  font-weight: 600;
  text-transform: lowercase;
  color: var(--nuuko-espresso);
}

.year-month-count {
  font-size: 0.85rem;
  color: var(--nuuko-stone);
}

/* === ANIMATIONS === */
@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  25% { 
    transform: translateY(-3px) rotate(1deg); 
  }
  50% { 
    transform: translateY(-6px) rotate(0deg); 
  }
  75% { 
    transform: translateY(-3px) rotate(-1deg); 
  }
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(15px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s var(--ease-gentle);
}

.slide-up {
  animation: slideUp 0.4s var(--ease-gentle);
}

.float {
  animation: float 4s ease-in-out infinite;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .container,
  .container-sm {
    padding: 0 var(--space-md);
  }
  
  .grid-sidebar {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  #libraryModal {
    padding: var(--space-xl) var(--space-sm);
  }
  
  .modal-content--wide {
    width: calc(100% - 1.5rem);
    border-radius: 24px;
  }
  
  .library-modal-body {
    padding: var(--space-lg);
  }
  
  .library-modal-body .library-shelf {
    gap: var(--space-lg);
  }
  
  .library-empty-state {
    padding: 3rem 1rem;
  }
  
  .nav-content {
    padding: 0 var(--space-md);
  }
  
  .nav-links {
    display: none;
  }
  
  .card {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
  }
  
  .card-hero {
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
  }
  
  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.9rem;
    min-height: 48px;
  }
  
  .calendar {
    padding: var(--space-md);
    gap: 0.375rem;
  }
  
  .writing-area {
    padding-left: 2.5rem !important;
    font-size: 0.9rem;
  }
  
  .mood-spectrum {
    height: 8px;
  }
  
  .mood-thumb {
    width: 22px;
    height: 22px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .library-shelf {
    gap: var(--space-lg);
    max-width: 100%;
  }
  
  .book-open {
    grid-template-columns: 1fr;
    padding: var(--space-lg);
    border-radius: 24px;
  }
  
  .book-open::before {
    inset: 12px;
    border-radius: 20px;
  }
  
  .book-spine {
    display: none;
  }
  
  .book-page {
    min-height: auto;
  }
  
  .book-page--left:hover,
  .book-page--left:focus-visible,
  .book-page--right:hover,
  .book-page--right:focus-visible {
    transform: translateY(-4px);
  }
  
  /* Writing page mobile adjustments */
  .write-controls {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .writing-notebook textarea {
    min-height: 400px !important;
    padding: 2rem 1.5rem 2rem 3rem !important;
    font-size: 1rem !important;
  }
  
  .notebook-holes {
    display: none !important;
  }
}

.summary-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid rgba(154, 107, 81, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(250, 245, 236, 0.95) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.summary-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.summary-toggle-label {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(61, 52, 44, 0.6);
}

.summary-toggle-subtext {
  margin: 0;
  font-size: 0.95rem;
  color: var(--nuuko-espresso);
}

.summary-toggle-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(107, 143, 113, 0.35);
  transition: background 0.2s ease;
  cursor: pointer;
}

.summary-toggle-control input {
  opacity: 0;
  position: absolute;
  inset: 0;
  margin: 0;
}

.summary-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(61, 52, 44, 0.15);
  transition: transform 0.2s ease;
}

.summary-toggle-control input:checked + .summary-toggle-thumb {
  transform: translateX(20px);
  box-shadow: 0 6px 16px rgba(107, 143, 113, 0.25);
}

.summary-toggle-control input:focus-visible + .summary-toggle-thumb {
  outline: 2px solid var(--nuuko-green);
  outline-offset: 2px;
}

.summary-toggle-control input:checked ~ .summary-toggle-thumb,
.summary-toggle-control input:checked + .summary-toggle-thumb {
  transform: translateX(20px);
}

@media (max-width: 600px) {
  .summary-toggle-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-toggle-control {
    align-self: flex-start;
  }
}

/* === WRAPPED SECTION === */
.wrapped-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.wrapped-heading {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.wrapped-kicker {
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(61, 52, 44, 0.6);
  margin-bottom: 0.25rem;
}

#wrappedHeading {
  font-size: 2rem;
  margin: 0;
  color: var(--nuuko-espresso);
  font-family: var(--font-serif);
  text-transform: lowercase;
}

#wrappedSubcopy {
  color: var(--nuuko-stone);
  margin: 0.5rem auto 0;
  max-width: 520px;
}

.wrapped-cadence-group {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(107, 143, 113, 0.12);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
  align-self: center;
}

.wrapped-cadence-btn {
  border: none;
  background: transparent;
  color: var(--nuuko-espresso);
  font-size: 0.85rem;
  text-transform: lowercase;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.wrapped-cadence-btn.active {
  background: #fff;
  color: var(--nuuko-espresso);
  box-shadow: 0 6px 18px rgba(107, 143, 113, 0.15);
}

.wrapped-range-label {
  font-size: 0.95rem;
  text-align: center;
  color: var(--nuuko-stone);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .wrapped-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    text-align: left;
  }

  #wrappedSubcopy {
    margin-left: 0;
    margin-right: 0;
  }

  .wrapped-cadence-group {
    align-self: flex-start;
  }

  .wrapped-range-label {
    text-align: left;
  }
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.w-full { width: 100%; }

.hidden { display: none !important; }

/* Modal display */
.modal-visible {
  display: flex !important;
}

.divider {
  height: 1px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(141, 135, 126, 0.3) 50%, 
    transparent 100%
  );
  margin: var(--space-xl) 0;
}

/* === ICON STYLES === */
.icon {
  display: inline-block;
  font-style: normal;
  font-size: 1rem;
}

.icon-sm {
  font-size: 0.875rem;
}

.icon-lg {
  font-size: 1.25rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream-light);
}

::-webkit-scrollbar-thumb {
  background: var(--nuuko-stone);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nuuko-espresso);
}

/* Selection styling */
::selection {
  background: rgba(107, 143, 113, 0.2);
  color: var(--nuuko-espresso);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.hidden {
  display: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
