:root {
  --journal-bg: #fffdfb;
  --journal-cream: #fdf6f3;
  --journal-blush: #fbedf2;
  --journal-ink: #3b1730;
  --journal-muted: #765b68;
  --journal-accent: #b5306f;
  --journal-accent-dark: #9d285f;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--journal-bg); overflow-x: hidden; }
body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--journal-ink);
  background:
    radial-gradient(circle at 90% 4%, rgba(181,48,111,.10), transparent 27rem),
    radial-gradient(circle at 0 32%, rgba(248,220,232,.7), transparent 22rem),
    linear-gradient(180deg, #fffdfb 0%, #fdf6f3 100%);
  font-family: "Montserrat", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button { color: inherit; }
button, textarea { -webkit-tap-highlight-color: transparent; }
.journal-ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.journal-ambient span { position: absolute; border: 1px solid rgba(181,48,111,.09); border-radius: 50%; }
.journal-ambient span:first-child { width: 28rem; height: 28rem; top: 5rem; right: -17rem; }
.journal-ambient span:last-child { width: 19rem; height: 19rem; top: 10rem; right: -9rem; }
.journal-shell { width: min(100%, 720px); margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
.journal-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.journal-brand { display: inline-flex; flex-direction: column; color: inherit; text-decoration: none; line-height: 1; }
.journal-brand strong { font-size: 17px; font-weight: 900; letter-spacing: .13em; }
.journal-brand span { margin-top: 5px; color: var(--journal-muted); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.save-state { flex: 0 0 auto; min-height: 34px; padding: 8px 12px; border: 1px solid rgba(72,39,55,.1); border-radius: 999px; background: rgba(255,255,255,.82); color: var(--journal-muted); font-size: 11px; font-weight: 700; box-shadow: 0 8px 24px rgba(68,35,51,.05); }
.save-state[data-status="saving"]::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #d697b4; animation: pulse 1s infinite; }
.save-state[data-status="error"] { color: #9c3150; background: #fff6f8; }
@keyframes pulse { 50% { opacity: .35; } }

.state-card, .activation { padding: clamp(30px, 8vw, 58px) clamp(22px, 7vw, 52px); border: 1px solid rgba(72,39,55,.1); border-radius: 32px; background: rgba(255,255,255,.88); box-shadow: 0 24px 64px rgba(68,35,51,.10); text-align: center; }
.state-card h1, .activation h1 { margin: 12px 0 16px; font-size: clamp(34px, 10vw, 56px); line-height: 1.04; letter-spacing: -.04em; }
.state-card p, .activation__lead { color: var(--journal-muted); font-size: 15px; line-height: 1.65; }
.loading-heart, .activation__ornament { display: block; color: var(--journal-accent); font-size: 38px; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px) scale(1.04); } }
.eyebrow, .section-label { margin: 0; color: var(--journal-accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.support-note { display: flex; align-items: flex-start; gap: 12px; margin: 28px 0; padding: 18px; border-radius: 22px; background: var(--journal-blush); text-align: left; }
.support-note p { margin: 0; color: var(--journal-ink); font-size: 13px; line-height: 1.6; }
.button { width: 100%; min-height: 54px; border: 0; border-radius: 999px; padding: 14px 22px; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .16s ease, background .16s ease, opacity .16s ease; }
.button:active { transform: scale(.985); }
.button:disabled { cursor: wait; opacity: .55; }
.button--primary { color: #fff; background: var(--journal-accent); box-shadow: 0 16px 34px rgba(181,48,111,.22); }
.button--primary:hover { background: var(--journal-accent-dark); }
.button--soft { color: var(--journal-accent); background: var(--journal-blush); }

.daily { min-width: 0; display: grid; gap: 18px; }
.daily > *, .journal-card, .writing-card { min-width: 0; }
.daily-intro { padding: 12px 4px 2px; }
.daily-intro h1 { margin: 9px 0 18px; font-size: clamp(31px, 9vw, 50px); line-height: 1.04; letter-spacing: -.04em; }
.day-progress { display: flex; align-items: center; gap: 14px; color: var(--journal-muted); font-size: 11px; font-weight: 700; }
.day-progress__track { flex: 1; height: 4px; overflow: hidden; border-radius: 999px; background: #eadfe3; }
.day-progress__track i { display: block; width: 3.333%; height: 100%; border-radius: inherit; background: var(--journal-accent); }
.opening-card { display: flex; gap: 14px; margin-top: 24px; padding: 20px; border-radius: 26px; background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(251,237,242,.85)); box-shadow: 0 16px 42px rgba(68,35,51,.07); }
.opening-card strong { display: block; margin: 1px 0 7px; font-size: 15px; }
.opening-card p { margin: 0; color: var(--journal-muted); font-size: 12px; line-height: 1.55; }
.journal-card { padding: clamp(21px, 6vw, 30px); border: 1px solid rgba(72,39,55,.10); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 18px 48px rgba(68,35,51,.07); }
.section-kicker { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.section-help { margin: 7px 0 18px; color: var(--journal-muted); font-size: 12px; line-height: 1.5; }
.mood-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.mood-grid button { min-width: 0; min-height: 68px; padding: 9px 4px; border: 1px solid rgba(72,39,55,.09); border-radius: 20px; background: var(--journal-cream); font-size: 10px; font-weight: 700; cursor: pointer; }
.mood-grid button span { display: block; margin-bottom: 6px; font-size: 20px; }
.mood-grid button.is-selected { border-color: rgba(181,48,111,.42); color: var(--journal-accent-dark); background: var(--journal-blush); box-shadow: 0 0 0 3px rgba(181,48,111,.08); }
.adaptive-copy { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid rgba(72,39,55,.08); color: var(--journal-muted); font-size: 13px; line-height: 1.6; }
.short-toggle { width: 100%; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 19px; border: 1px solid rgba(72,39,55,.09); border-radius: 24px; background: rgba(253,246,243,.86); text-align: left; cursor: pointer; }
.short-toggle strong, .short-toggle small { display: block; }
.short-toggle strong { font-size: 13px; }
.short-toggle small { margin-top: 4px; color: var(--journal-accent); font-size: 12px; font-weight: 700; }
.short-toggle i { color: var(--journal-accent); font-size: 20px; font-style: normal; transition: transform .2s ease; }
.short-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
[data-full-flow], .short-flow { display: grid; gap: 18px; }
.writing-card h2 { margin: 9px 0 18px; font-size: clamp(20px, 5vw, 25px); line-height: 1.25; letter-spacing: -.025em; }
textarea { width: 100%; min-height: 112px; resize: vertical; border: 1px solid rgba(72,39,55,.12); border-radius: 20px; outline: none; padding: 16px; color: var(--journal-ink); background: #fffdfb; font-size: 15px; line-height: 1.6; transition: border .15s ease, box-shadow .15s ease; }
textarea::placeholder { color: #aa939e; }
textarea:focus { border-color: rgba(181,48,111,.5); box-shadow: 0 0 0 4px rgba(181,48,111,.09); }
.gratitude-entry { position: relative; margin-top: 12px; }
.gratitude-entry:first-child { margin-top: 0; }
.gratitude-entry__number { display: block; margin: 0 0 7px 4px; color: var(--journal-muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gratitude-entry__remove { position: absolute; top: 28px; right: 9px; z-index: 1; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--journal-muted); background: rgba(253,246,243,.95); cursor: pointer; }
.starter-row { display: flex; gap: 8px; margin-top: 13px; overflow-x: auto; padding: 1px 1px 7px; scrollbar-width: none; }
.starter-row::-webkit-scrollbar { display: none; }
.starter-row button { flex: 0 0 auto; min-height: 42px; padding: 10px 13px; border: 1px solid rgba(181,48,111,.13); border-radius: 999px; color: var(--journal-muted); background: var(--journal-blush); font-size: 11px; font-weight: 600; cursor: pointer; }
.text-action { min-height: 44px; margin-top: 7px; padding: 8px 0; border: 0; color: var(--journal-accent); background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.text-action--add { display: block; margin-top: 2px; }
.reflection-card { background: rgba(253,246,243,.9); }
.save-day { padding: 12px 0 6px; }
.save-day p { margin: 0 0 18px; text-align: center; }
.save-day p strong, .save-day p span { display: block; }
.save-day p strong { font-size: 22px; }
.save-day p span { margin-top: 7px; color: var(--journal-muted); font-size: 13px; }

[hidden] { display: none !important; }
@media (max-width: 430px) {
  .journal-shell { padding-inline: 12px; }
  .mood-grid { grid-template-columns: repeat(3, 1fr); }
  .mood-grid button { min-height: 64px; }
  .journal-card { border-radius: 24px; }
}
@media (min-width: 768px) {
  .journal-shell { padding-top: 28px; }
  .daily { gap: 22px; }
  .journal-card { padding: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
