@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Jost:wght@300;400;500&family=Great+Vibes&display=swap');

/* =============================================
   CSS VARIABLES & ROOT
   ============================================= */
:root {
  --cream:        #faf6f1;
  --parchment:    #f2eade;
  --blush:        #e8d5cc;
  --dusty-rose:   #c9a49a;
  --mauve:        #9e7b78;
  --deep-rose:    #7a4f4e;
  --gold:         #c4a35a;
  --gold-light:   #e8d49a;
  --gold-dark:    #9a7a38;
  --ink:          #2c1f1e;
  --ink-soft:     #4a3635;
  --ink-muted:    #7a6260;
  --border:       rgba(196,163,90,0.25);
  --border-soft:  rgba(196,163,90,0.12);
  --shadow:       rgba(44,31,30,0.08);
  --shadow-deep:  rgba(44,31,30,0.18);

  --font-display: 'Great Vibes', cursive;
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-sans:    'Jost', sans-serif;

  --radius:       12px;
  --radius-lg:    20px;
  --transition:   0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--parchment); }
::-webkit-scrollbar-thumb { background: var(--dusty-rose); border-radius: 3px; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 400; }

.site-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  color: var(--deep-rose);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.site-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

/* =============================================
   DECORATIVE ELEMENTS
   ============================================= */
.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 2rem 0;
}

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: rgba(250,246,241,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.nav-links { display: flex; gap: 0.5rem; align-items: center; }

.btn-nav {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-nav:hover,
.btn-nav.active {
  background: var(--deep-rose);
  border-color: var(--deep-rose);
  color: var(--cream);
}

.btn-nav svg { width: 13px; height: 13px; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =============================================
   HEADER / HERO
   ============================================= */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero-date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.06em;
}

/* =============================================
   PAGES
   ============================================= */
.page { display: none; animation: pageFadeIn 0.4s ease; }
.page.active { display: block; }

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

/* =============================================
   FORM CARD
   ============================================= */
.form-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 2px 20px var(--shadow), 0 1px 4px var(--shadow);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dusty-rose), var(--gold), var(--dusty-rose));
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.section-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--parchment), var(--blush));
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--deep-rose);
  font-weight: 500;
}

/* =============================================
   FORM FIELDS
   ============================================= */
.field-group { margin-bottom: 1.4rem; }
.field-group:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.45rem;
}

.field-input,
.field-textarea {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  outline: none;
  transition: all var(--transition);
  resize: none;
  line-height: 1.6;
}

.field-input::placeholder,
.field-textarea::placeholder {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.field-input:focus,
.field-textarea:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(196,163,90,0.1);
}

.field-textarea { min-height: 90px; overflow: hidden; }
.field-textarea.tall { min-height: 110px; }

/* Title field */
.title-input {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  text-align: center;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 0.5rem 0.5rem;
  color: var(--ink);
}
.title-input:focus {
  border-bottom-color: var(--gold);
  background: transparent;
  box-shadow: none;
}

/* =============================================
   RATINGS GRID
   ============================================= */
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.rating-item {
  background: var(--cream);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: all var(--transition);
}

.rating-item:hover {
  border-color: var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}

.rating-label {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rating-label .rating-emoji { font-size: 0.95rem; }

.stars {
  display: flex;
  gap: 0.15rem;
  width: 100%;
}

.star {
  flex: 1;
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2rem);
  cursor: pointer;
  color: var(--blush);
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
}

.star:hover,
.star.filled {
  color: var(--gold);
  transform: scale(1.15);
}

.star.filled { text-shadow: 0 0 8px rgba(196,163,90,0.4); }

.rating-required-hint {
  font-size: 0.7rem;
  color: var(--dusty-rose);
  font-style: italic;
  margin-top: 0.3rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.rating-item.error .rating-required-hint { opacity: 1; }
.rating-item.error { border-color: var(--dusty-rose); }

/* =============================================
   SUBMIT BUTTON
   ============================================= */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 2rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: linear-gradient(135deg, var(--deep-rose) 0%, var(--mauve) 50%, var(--gold-dark) 100%);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--mauve) 0%, var(--deep-rose) 50%, var(--gold-dark) 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.btn-submit:hover::before { opacity: 1; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(122,79,78,0.35); }
.btn-submit:active { transform: translateY(0); }

.btn-submit span { position: relative; z-index: 1; }
.btn-submit svg { position: relative; z-index: 1; width: 18px; height: 18px; }

/* =============================================
   VALIDATION MESSAGE
   ============================================= */
.validation-msg {
  display: none;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--dusty-rose);
  margin-top: 0.75rem;
  padding: 0.5rem;
}
.validation-msg.visible { display: block; animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* =============================================
   PRAISE ANIMATION OVERLAY
   ============================================= */
.praise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.praise-overlay.active {
  pointer-events: all;
  opacity: 1;
}

.praise-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44,31,30,0.55);
  backdrop-filter: blur(4px);
}

.praise-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #fff, var(--parchment));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(44,31,30,0.3);
  transform: scale(0.8) translateY(20px);
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.praise-overlay.active .praise-card {
  transform: scale(1) translateY(0);
}

.praise-petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.petal {
  position: absolute;
  font-size: 1.2rem;
  animation: petalFall linear forwards;
  opacity: 0;
}

@keyframes petalFall {
  0%   { opacity: 1; transform: translateY(-20px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(120px) rotate(360deg); }
}

.praise-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  animation: iconPulse 1.5s ease infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.praise-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--deep-rose);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.praise-message {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.praise-close {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.45rem 1.4rem;
  cursor: pointer;
  transition: all var(--transition);
}
.praise-close:hover { background: var(--parchment); border-color: var(--dusty-rose); color: var(--deep-rose); }

/* Sparkles */
.sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparkleAnim 1s ease forwards;
}
.sparkle::before { content: '✦'; color: var(--gold); font-size: inherit; }

@keyframes sparkleAnim {
  0%   { opacity: 0; transform: scale(0) rotate(0deg); }
  50%  { opacity: 1; transform: scale(1.2) rotate(180deg); }
  100% { opacity: 0; transform: scale(0.8) rotate(360deg) translateY(-20px); }
}

/* =============================================
   RECENT POSTS
   ============================================= */
.section-label {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--deep-rose);
  font-weight: 400;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.posts-list { display: flex; flex-direction: column; gap: 1rem; }

.post-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
}

.post-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 16px var(--shadow);
  transform: translateY(-1px);
}

.post-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-card-date {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--deep-rose);
  font-weight: 500;
}

.post-card-body { padding: 1rem 1.25rem; }

.post-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .post-fields { grid-template-columns: 1fr; }
}

.post-field { }

.post-field-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.2rem;
}

.post-field-value {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-ratings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.75rem;
}

.post-rating-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.post-rating-stars {
  color: var(--gold);
  font-size: 0.7rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* =============================================
   JOURNAL PAGE
   ============================================= */
.journal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.journal-count {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.journal-filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-filter {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.btn-filter:hover,
.btn-filter.active {
  background: var(--parchment);
  border-color: var(--dusty-rose);
  color: var(--deep-rose);
}

.journal-post-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all var(--transition);
}

.journal-post-card:hover {
  border-color: var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.journal-post-card .post-card-header { cursor: pointer; }

.journal-post-card .post-card-header:hover .post-card-date {
  color: var(--deep-rose);
}

.post-expand-icon {
  font-size: 0.8rem;
  color: var(--ink-muted);
  transition: transform var(--transition);
}
.journal-post-card.expanded .post-expand-icon { transform: rotate(180deg); }

.journal-post-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.journal-post-card.expanded .journal-post-body { max-height: 3000px; }

.journal-post-content {
  padding: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

.journal-fields { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 1rem; }

.journal-field-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.2rem;
}

.journal-field-value {
  font-family: var(--font-serif);
  font-size: 0.97rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.journal-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border-top: 1px solid var(--border-soft);
  padding-top: 0.9rem;
  margin-top: 0.5rem;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2rem;
  padding-bottom: 3rem;
}

.page-btn {
  min-width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0 0.5rem;
}
.page-btn:hover { background: var(--parchment); border-color: var(--dusty-rose); }
.page-btn.active { background: var(--deep-rose); border-color: var(--deep-rose); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--ink-muted);
  opacity: 0.6;
}

/* =============================================
   LOADING STATE
   ============================================= */
.loading-dots {
  display: inline-flex;
  gap: 4px;
}
.loading-dots span {
  width: 5px; height: 5px;
  background: var(--dusty-rose);
  border-radius: 50%;
  animation: dotPulse 1.4s ease infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
  .form-card { padding: 1.5rem; }
  .ratings-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { padding: 0.75rem 1rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .praise-card { padding: 2rem 1.5rem; margin: 1rem; }
}

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

/* =============================================
   CHART CARD (journal page)
   ============================================= */
.chart-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem 1.75rem;
  box-shadow: 0 2px 20px var(--shadow), 0 1px 4px var(--shadow);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
}

.chart-period {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
}

.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.chart-svg {
  width: 100%;
  max-width: 340px;
  height: auto;
}

.chart-grid-poly {
  fill: none;
  stroke: rgba(196,163,90,0.2);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: rgba(196,163,90,0.15);
  stroke-width: 1;
}

.chart-data-poly {
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linejoin: round;
}

.chart-vertex {
  fill: var(--gold);
  stroke: #fff;
  stroke-width: 1.5;
}

.chart-axis-label {
  font-size: 1.05rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-soft);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.chart-legend-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.chart-legend-avg {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--gold-dark);
  min-width: 2rem;
}

/* =============================================
   NOTA DEL AMO
   ============================================= */
.master-note-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

.master-note-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.5rem;
}

.master-note-input {
  width: 100%;
  min-height: 70px;
  overflow: hidden;
  resize: none;
  font-family: var(--font-serif);
  font-size: 0.97rem;
  font-style: italic;
  color: var(--ink-soft);
  background: var(--parchment);
  border: none;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.6rem 0.9rem;
  outline: none;
  transition: border-left-color var(--transition), box-shadow var(--transition);
  line-height: 1.65;
}

.master-note-input:focus {
  border-left-color: var(--deep-rose);
  box-shadow: 0 0 0 3px rgba(196,163,90,0.1);
  background: #fff;
}

.master-note-input::placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

.master-note-saved {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-style: italic;
  color: var(--gold-dark);
  margin-top: 0.3rem;
  min-height: 1.1rem;
  transition: opacity 0.3s;
}

/* =============================================
   LOGIN PAGE
   ============================================= */

/* Reuse body background and grain — just center the content */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
}

.login-blossom {
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(196,163,90,0.25));
  animation: floatHero 4s ease-in-out infinite;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px var(--shadow);
  padding: 2rem 2rem 1.75rem;
  width: 100%;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.login-field {
  position: relative;
}

.login-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.login-input::placeholder {
  color: var(--ink-muted);
}

.login-input:focus {
  border-color: var(--dusty-rose);
  box-shadow: 0 0 0 3px rgba(201,164,154,0.18);
}

.login-btn {
  margin-top: 0.4rem;
  width: 100%;
  justify-content: center;
}

.login-error {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--deep-rose);
  text-align: center;
  background: rgba(122,79,78,0.07);
  border: 1px solid rgba(122,79,78,0.18);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.2rem;
}

/* ── Logout link in nav ──────────────────────────── */
.nav-logout {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  color: var(--ink-muted);
  opacity: 0.55;
  transition: opacity var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-logout svg {
  width: 1.1rem;
  height: 1.1rem;
}

.nav-logout:hover {
  opacity: 1;
  color: var(--deep-rose);
}
