/* ============ DESIGN TOKENS ============ */
:root {
  --bg: #fdf6f0;
  --bg-soft: #fbeee2;
  --surface: #ffffff;
  --surface-alt: #fff7f0;

  --primary: #f4b8a0;
  --primary-soft: #fad9c8;
  --primary-deep: #d98a6b;

  --accent: #c9b6e4;
  --accent-soft: #e6dcf2;
  --accent-deep: #9678c2;

  --secondary: #f7c8c8;
  --secondary-soft: #fde4e4;

  --mint: #c5e1c8;
  --mint-soft: #e1f0e2;

  --sun: #f4d27a;
  --sun-soft: #fbecc2;

  --ink: #4a3a3a;
  --ink-soft: #7a6868;
  --ink-faint: #b3a59f;

  --line: #efe3d8;
  --line-soft: #f7eee5;

  --shadow-sm: 0 2px 8px rgba(217, 138, 107, 0.08);
  --shadow-md: 0 8px 24px rgba(217, 138, 107, 0.12);
  --shadow-lg: 0 20px 50px rgba(217, 138, 107, 0.18);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --font-title: "DM Serif Display", "Playfair Display", Georgia, serif;
  --font-body: "Nunito", system-ui, sans-serif;
  --font-hand: "Caveat", cursive;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html {
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #fbeee2 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, #e6dcf2 0%, transparent 50%),
              #efe6dc;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input, textarea, select {
  font-family: inherit;
  color: inherit;
}
h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }

/* ============ APP SHELL ============ */
.app-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
}
.app {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
.app.is-birthday {
  background: linear-gradient(180deg, #fff7ec 0%, #fde7f0 50%, #ece2f8 100%);
}
.app.is-birthday .navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============ BIRTHDAY BACKGROUND ============ */
.birthday-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  max-width: 540px;
}
.bday-balloon {
  position: absolute;
  bottom: -80px;
  width: 36px;
  height: 44px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  animation: bday-balloon-rise linear infinite;
  opacity: 0.55;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.06));
}
.bday-balloon::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 30px;
  background: rgba(74, 58, 58, 0.25);
}
@keyframes bday-balloon-rise {
  0%   { transform: translateY(0) translateX(0); }
  50%  { transform: translateY(-50vh) translateX(12px); }
  100% { transform: translateY(-110vh) translateX(0); }
}
.bday-confetti {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.6;
  animation: bday-confetti-fall linear infinite;
}
@keyframes bday-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(720deg); }
}

/* ============ NAVBAR ============ */
.navbar {
  flex-shrink: 0;
  padding: 12px 18px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}
.navbar-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: white;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.navbar-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.navbar-tab {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  text-decoration: none;
}
.navbar-tab.active {
  background: var(--surface);
  color: var(--primary-deep);
  box-shadow: var(--shadow-sm);
}
.navbar-tab:hover:not(.active) { color: var(--ink); }

.app-screen {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ============ HOME ============ */
.home {
  padding: 24px 20px 80px;
}
.home-photo-wrap {
  position: relative;
  margin: 8px auto 0;
  width: 220px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.home-photo-bg {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--primary-soft), transparent 60%),
              radial-gradient(circle at 70% 70%, var(--accent-soft), transparent 60%);
  animation: pulse-soft 6s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.05); opacity: 0.9; }
}
.home-photo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  border: 6px solid var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  place-items: center;
}
.home-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-photo-placeholder {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, var(--primary-soft) 0 10px, var(--secondary-soft) 10px 20px);
  display: grid;
  place-items: center;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: var(--ink-soft);
  text-align: center;
  padding: 12px;
  line-height: 1.5;
}
.home-deco {
  position: absolute;
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.home-deco.s1 { top: -10px; left: -8px;  animation: float 4s ease-in-out infinite; }
.home-deco.s2 { top: 10px; right: -16px; animation: float 5s ease-in-out infinite 0.5s; }
.home-deco.s3 { bottom: 0; left: -22px;  animation: float 4.5s ease-in-out infinite 1s; }
.home-deco.s4 { bottom: -8px; right: 8px; animation: float 5.5s ease-in-out infinite 1.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-8px) rotate(4deg); }
}

.home-greeting {
  text-align: center;
  margin-top: 28px;
}
.home-eyebrow {
  font-family: var(--font-hand);
  font-size: 22px;
  color: var(--primary-deep);
  margin-bottom: 4px;
}
.home-title {
  font-size: 32px;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 6px;
}
.home-title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--primary-deep), var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 320px;
  margin: 8px auto 0;
}

/* Counter card */
.counter-card {
  margin: 24px 0 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.counter-card::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent 70%);
}
.counter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.85;
  font-weight: 700;
}
.counter-value {
  font-family: var(--font-title);
  font-size: 36px;
  margin: 4px 0 0;
  position: relative;
  z-index: 1;
}
.counter-value.celebrating { font-size: 28px; }
.counter-sub {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
}
.counter-units {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}
.counter-unit {
  flex: 1;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  text-align: center;
}
.counter-unit-num {
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1;
}
.counter-unit-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-top: 3px;
}

/* Quote card */
.quote-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.quote-mark {
  position: absolute;
  top: -10px;
  left: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1;
}
.quote-text {
  font-family: var(--font-title);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  font-style: italic;
  margin: 4px 0 0;
}
.quote-author {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  font-weight: 600;
}

/* Quick actions */
.quick-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
}
.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.quick-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.quick-card-icon.peach    { background: var(--primary-soft); }
.quick-card-icon.lavender { background: var(--accent-soft); }
.quick-card-icon.mint     { background: var(--mint-soft); }
.quick-card-icon.sun      { background: var(--sun-soft); }
.quick-card-title {
  font-family: var(--font-title);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.1;
}
.quick-card-sub {
  font-size: 11px;
  color: var(--ink-soft);
}

/* Section heading */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 12px;
}
.section-title { font-size: 22px; color: var(--ink); }
.section-link {
  font-size: 12px;
  color: var(--primary-deep);
  font-weight: 600;
  text-decoration: none;
}

/* ============ CALENDAR ============ */
.cal { padding: 18px 18px 80px; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cal-title { font-size: 26px; color: var(--ink); text-transform: capitalize; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
}
.cal-nav-btn:hover { background: var(--primary-soft); color: var(--primary-deep); }
.cal-grid {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 4px 0;
}
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 13px;
  color: var(--ink);
  position: relative;
  transition: all 0.15s ease;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  padding: 2px;
}
.cal-day:hover { background: var(--bg-soft); }
.cal-day.muted { color: var(--ink-faint); cursor: default; }
.cal-day.today { background: var(--accent-soft); font-weight: 700; color: var(--accent-deep); }
.cal-day.has-event { background: var(--primary-soft); color: var(--primary-deep); font-weight: 700; }
.cal-day.has-event.surprise {
  background: var(--sun-soft);
  color: #a47820;
  border: 1px dashed var(--sun);
}
.cal-day.has-letter { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.cal-day-letter-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 9px;
  line-height: 1;
}
.cal-day-num { line-height: 1; }
.cal-day-icon { font-size: 11px; margin-top: 2px; line-height: 1; }

.cal-legend {
  display: flex;
  gap: 12px;
  margin: 12px 4px 4px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-soft);
}
.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: -1px;
}

/* ============ EVENTS LIST ============ */
.event-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.event-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.event-item:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.event-date {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 6px 0;
}
.event-date-day {
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1;
  color: var(--primary-deep);
}
.event-date-month {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-top: 2px;
}
.event-body { flex: 1; min-width: 0; }
.event-title { font-family: var(--font-title); font-size: 16px; color: var(--ink); line-height: 1.2; }
.event-meta {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.event-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.event-tag.surprise { background: var(--sun-soft); color: #a47820; }
.event-tag.activity { background: var(--mint-soft); color: #5a8a5d; }
.event-tag.message  { background: var(--accent-soft); color: var(--accent-deep); }

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 58, 58, 0.4);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 20px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  border: none;
}
.modal-close:hover { background: var(--primary-soft); }
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 12px;
}
.modal-title { font-size: 22px; margin-bottom: 4px; }
.modal-meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }
.modal-body { font-size: 14px; line-height: 1.6; color: var(--ink); }
.modal-locked { text-align: center; padding: 20px 10px 10px; }
.modal-locked-icon { font-size: 48px; margin-bottom: 8px; }

/* Countdown inside modal */
.countdown-block {
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-soft), var(--primary-soft));
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
}
.countdown-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
  margin-bottom: 6px;
}
.countdown-units {
  display: flex;
  gap: 6px;
}
.countdown-unit {
  flex: 1;
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.countdown-unit-num {
  font-family: var(--font-title);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}
.countdown-unit-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-top: 3px;
  font-weight: 700;
}

/* ============ POSTS ============ */
.posts { padding: 18px 18px 80px; }
.posts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.posts-title { font-size: 26px; color: var(--ink); }
.btn {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--ink); color: white; }
.btn-primary:hover { background: var(--primary-deep); }

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
.post-card:hover { transform: translateY(-2px); }
.post-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(135deg, var(--primary-soft) 0 12px, var(--secondary-soft) 12px 24px);
  display: grid;
  place-items: center;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-soft);
  position: relative;
  overflow: hidden;
}
.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.post-img.lavender {
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 12px, var(--primary-soft) 12px 24px);
}
.post-img.mint {
  background: repeating-linear-gradient(135deg, var(--mint-soft) 0 12px, var(--sun-soft) 12px 24px);
}
.post-img-tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255,255,255,0.85);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--ink);
  font-weight: 700;
  backdrop-filter: blur(4px);
  z-index: 1;
}
.post-body { padding: 14px 16px 16px; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.post-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.post-title { font-family: var(--font-title); font-size: 18px; line-height: 1.2; margin-bottom: 6px; }
.post-text { font-size: 13px; line-height: 1.55; color: var(--ink-soft); }

/* New post form */
.new-post-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.input, .textarea {
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  color: var(--ink);
  width: 100%;
}
.input:focus, .textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.image-picker {
  background: var(--bg-soft);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
}
.image-picker:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-deep); }
.image-picker-emoji { font-size: 28px; margin-bottom: 6px; }
.style-picker { display: flex; gap: 6px; }
.style-btn {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}
.style-btn.active { background: var(--ink); color: white; border-color: var(--ink); }

/* ============ MESSAGES (cartas) ============ */
.msgs { padding: 18px 18px 80px; }
.msgs-intro {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 4px 0 16px;
}
.envelope {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}
.envelope:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.envelope.locked { background: linear-gradient(135deg, var(--surface), var(--bg-soft)); }
.envelope.unlocked {
  background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  border-color: var(--primary);
}
.envelope-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
}
.envelope-body { flex: 1; min-width: 0; }
.envelope-from { font-family: var(--font-hand); font-size: 18px; color: var(--primary-deep); line-height: 1; }
.envelope-when { font-size: 11px; color: var(--ink-soft); margin-top: 4px; font-weight: 600; }
.envelope-status { font-size: 18px; flex-shrink: 0; }

/* ============ LOGIN ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #fbeee2 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, #e6dcf2 0%, transparent 50%),
              #fdf6f0;
  position: relative;
  overflow: hidden;
}
.login-page.celebrating {
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--accent-soft) 100%);
}
.login-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear infinite;
  opacity: 0.85;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-50px) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(720deg); }
}
.login-balloon {
  position: absolute;
  width: 36px;
  height: 44px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  animation: balloon-float linear infinite;
  opacity: 0.9;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
}
.login-balloon::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 50%;
  width: 1px;
  height: 30px;
  background: rgba(74, 58, 58, 0.3);
}
@keyframes balloon-float {
  0%   { transform: translateY(100vh) translateX(0); }
  50%  { transform: translateY(50vh) translateX(15px); }
  100% { transform: translateY(-100px) translateX(0); }
}
.deco-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.5;
  pointer-events: none;
}
.login-box {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px 32px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 32px;
}
.login-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  color: white;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.login-eyebrow {
  font-family: var(--font-hand);
  font-size: 26px;
  color: var(--primary-deep);
  line-height: 1;
}
.login-title {
  font-size: 34px;
  line-height: 1.05;
  margin: 6px 0 8px;
  color: var(--ink);
}
.login-title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--primary-deep), var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-btn {
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: white;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.login-btn:hover { background: var(--primary-deep); transform: translateY(-1px); }
.login-hint { font-size: 11px; color: var(--ink-faint); text-align: center; margin-top: 14px; }
.login-error {
  background: #fde8e8;
  color: #c53030;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid #f5c6cb;
}
.login-footer {
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 24px;
}
.login-footer-hand { font-family: var(--font-hand); font-size: 16px; color: var(--primary-deep); }

/* Locked home notice */
.locked-notice {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}
.locked-notice-icon { font-size: 28px; margin-bottom: 6px; }
.locked-notice-title {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 13px;
}
.empty-state-icon { font-size: 36px; margin-bottom: 8px; }
