@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/golos-text-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/golos-text-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/golos-text-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/literata-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/literata-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/literata-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #fbf8f3;
  --paper-deep: #f1ece2;
  --surface: #fffdf9;
  --sheet: #ffffff;
  --white: #ffffff;
  --sage: #e4efe8;
  --sage-soft: #edf4ef;
  --blush: #fdf1eb;
  --ink: #24342e;
  --muted: #5f6f67;
  --green: #4a7c6f;
  --green-dark: #2f5c50;
  --green-tint: rgba(74, 124, 111, 0.14);
  --green-tint-strong: rgba(74, 124, 111, 0.3);
  --terracotta: #d98a6c;
  --terracotta-dark: #88492f;
  --pill-track: #f0ece3;
  --header-bg: rgba(255, 253, 249, 0.9);
  --bg-veil: rgba(251, 248, 243, 0.72);
  --rule: rgba(36, 52, 46, 0.1);
  --rule-strong: rgba(36, 52, 46, 0.18);
  --control: #8e9e93;
  --error: #9c3b30;
  --focus: #c46e50;
  --radius: 1.05rem;
  --shadow-sheet: 0 2px 6px rgba(36, 52, 46, 0.03), 0 20px 44px -26px rgba(36, 52, 46, 0.14);
  --shadow-card: 0 1px 3px rgba(36, 52, 46, 0.04), 0 10px 24px -18px rgba(36, 52, 46, 0.16);
  --shadow-focus: 0 0 0 4px rgba(74, 124, 111, 0.15);
  --display: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
}

:root[data-theme="lavender"] {
  --paper: #f7f5fa;
  --paper-deep: #ece8f4;
  --surface: #fcfbfe;
  --sheet: #ffffff;
  --sage: #e9e3f5;
  --sage-soft: #f2eef9;
  --blush: #fbf2ea;
  --ink: #2a2538;
  --muted: #6c647d;
  --green: #6b5b8e;
  --green-dark: #4f4170;
  --green-tint: rgba(107, 91, 142, 0.15);
  --green-tint-strong: rgba(107, 91, 142, 0.32);
  --terracotta: #df9b6d;
  --terracotta-dark: #844e31;
  --pill-track: #ece8f4;
  --header-bg: rgba(252, 251, 254, 0.92);
  --bg-veil: rgba(247, 245, 250, 0.8);
  --rule: rgba(42, 37, 56, 0.1);
  --rule-strong: rgba(42, 37, 56, 0.18);
  --control: #9a91ab;
  --focus: #6b5b8e;
  --shadow-sheet: 0 2px 6px rgba(42, 37, 56, 0.03), 0 20px 44px -26px rgba(42, 37, 56, 0.14);
  --shadow-card: 0 1px 3px rgba(42, 37, 56, 0.04), 0 10px 24px -18px rgba(42, 37, 56, 0.16);
  --shadow-focus: 0 0 0 4px rgba(107, 91, 142, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

::selection { background: var(--sage); color: var(--green-dark); }

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font: 1rem/1.55 var(--sans);
  background:
    linear-gradient(var(--bg-veil), var(--bg-veil)),
    url(assets/botanical-bg.jpg) center / cover no-repeat fixed,
    var(--paper);
  transition: background-color 280ms ease, color 280ms ease;
}

[data-screen], .work-screen, h1 { scroll-margin-top: 6.5rem; }

a { color: inherit; }

button, input, select, textarea {
  font: inherit;
  font-size: max(1rem, 1em);
  color: inherit;
}

button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1[tabindex="-1"]:focus { outline: none; }

h1, h2, p, figure, blockquote { margin: 0; overflow-wrap: anywhere; }

h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.22;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(1.75rem, 1.45rem + 1.25vw, 2.35rem); letter-spacing: -0.015em; }
h2 { font-size: 1.22rem; letter-spacing: -0.01em; }

.frame { width: min(68.75rem, calc(100% - 2 * clamp(1rem, 4vw, 2rem))); margin-inline: auto; }

/* Warm frosted sticky header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  min-height: 4.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}

.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  order: 2;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0.3rem 0.72rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--green-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 150ms var(--ease-out);
}

.theme-toggle:hover { border-color: var(--green-tint-strong); }
.theme-toggle:active { transform: scale(0.97); }
.theme-toggle svg { width: 0.95rem; height: 0.95rem; flex: none; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="lavender"] .theme-toggle .icon-leaf { display: none; }
:root[data-theme="lavender"] .theme-toggle .icon-moon { display: block; }

.brand {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-logo {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

/* Sliding Pill Tabs */
:where(header) nav {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 1 22.5rem;
  min-width: 0;
  padding: 0.25rem;
  border-radius: 0.9rem;
  background: var(--pill-track);
  border: 1px solid var(--rule);
}

:where(header) nav a {
  position: relative;
  z-index: 1;
  display: grid;
  place-content: center;
  min-height: 2.5rem;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 0.68rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 450;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 180ms ease;
}

:where(header) nav a[aria-current="page"] { color: var(--green-dark); font-weight: 550; }

:where(header) nav::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0.25rem auto 0.25rem 0.25rem;
  width: calc((100% - 0.5rem) / 3);
  border-radius: 0.68rem;
  background: var(--sheet);
  box-shadow: 0 1px 3px rgba(30, 51, 43, 0.1), 0 2px 8px -2px rgba(30, 51, 43, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateX(var(--tab-offset, 0));
  transition: transform 320ms var(--ease-out), opacity 150ms ease;
}

@media (prefers-reduced-motion: no-preference) {
  :where(header) nav::after {
    transition: transform 420ms var(--spring), opacity 150ms ease;
  }
}

:where(header) nav:has([aria-current])::after { opacity: 1; }
:where(header) nav:has([data-nav="entries"][aria-current]) { --tab-offset: 100%; }
:where(header) nav:has(:is([data-nav="phrases"], [data-nav="support"])[aria-current]) { --tab-offset: 200%; }
:where(header) nav:has(:focus-visible)::after { transition: none; }

/* One-shot feedback for interactive controls. */
@media (prefers-reduced-motion: no-preference) {
  .theme-toggle:hover svg { transform: rotate(-14deg) scale(1.1); }
  .theme-toggle svg { transition: transform 260ms var(--spring); }

  .start-action:hover .write-pen { animation: pen-nudge 520ms var(--ease-out); transform-origin: 10px 16px; }
  .start-action:hover .write-line { stroke-dasharray: 1; animation: line-draw 480ms var(--ease-out); }
  .start-action:hover .reflect-glass { animation: glass-tilt 560ms var(--ease-out); transform-origin: 11px 11px; }
  .start-action:hover .good-heart { animation: heart-beat 560ms var(--ease-out); transform-origin: 12px 13px; }
  .start-action:hover .good-spark { animation: spark-pop 560ms var(--ease-out); transform-origin: 19px 4.5px; }
}

@keyframes pen-nudge {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  35% { transform: translate(1.5px, -2px) rotate(-8deg); }
  70% { transform: translate(2px, 0) rotate(4deg); }
}
@keyframes line-draw {
  from { stroke-dashoffset: 1; opacity: 0.2; }
  to { stroke-dashoffset: 0; opacity: 0.75; }
}
@keyframes glass-tilt {
  0%, 100% { transform: rotate(0deg) scale(1); }
  45% { transform: rotate(-12deg) scale(1.08); }
  75% { transform: rotate(6deg) scale(1.03); }
}
@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.18); }
  65% { transform: scale(0.96); }
}
@keyframes spark-pop {
  0% { transform: scale(0.5) rotate(0deg); opacity: 0.4; }
  50% { transform: scale(1.25) rotate(25deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
}

.skip {
  position: absolute;
  z-index: 30;
  top: 0.5rem;
  left: 1rem;
  padding: 0.625rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.skip:not(:focus) { transform: translateY(calc(-100% - 1rem)); box-shadow: none; }

.main {
  flex: 1 0 auto;
  padding-block: clamp(1rem, 3vw, 2.75rem) clamp(2.25rem, 5vw, 4rem);
}

[data-screen]:not([hidden]) {
  @media (prefers-reduced-motion: no-preference) {
    animation: screen-reveal 340ms var(--ease-out) both;
  }
}

@keyframes screen-reveal {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-grid {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  grid-template-areas:
    "garden garden"
    "intro art"
    "start art"
    "phrases phrases";
  gap: 1.35rem clamp(1.5rem, 3.8vw, 3rem);
  align-items: start;
  border: 1px solid var(--rule);
  border-radius: 1.75rem;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--sheet);
  transition: background-color 420ms ease;
}

.intro { position: relative; z-index: 1; grid-area: intro; align-self: start; }
.intro h1 { font-size: clamp(1.8rem, 1.5rem + 1.3vw, 2.4rem); text-wrap: balance; }
.start { position: relative; z-index: 1; grid-area: start; }
.home-grid > .phrase-panel { position: relative; z-index: 1; grid-area: phrases; box-shadow: none; }
.home-grid.has-phrase {
  grid-template-areas:
    "garden garden"
    "intro art"
    "start art"
    "phrases phrases";
}

/* Soft morphing ambient aura blobs */
.ambient-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.aura-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  transition: background-color 600ms ease, transform 800ms var(--ease-out);
}
.aura-blob-1 {
  width: 22rem;
  height: 22rem;
  top: -7rem;
  left: -5rem;
  background: var(--aura-1, #e5f2ea);
}
.aura-blob-2 {
  width: 20rem;
  height: 20rem;
  bottom: -6rem;
  right: -4rem;
  background: var(--aura-2, #fbe9de);
}
:root[data-theme="lavender"] .aura-blob-1 { --aura-1: #eae3f7; }
:root[data-theme="lavender"] .aura-blob-2 { --aura-2: #f9e8df; }

.home-grid[data-mood-aura="Тревожусь"] { --aura-1: #e4ddf5; --aura-2: #dde8f6; }
.home-grid[data-mood-aura="Злюсь"] { --aura-1: #fadcd4; --aura-2: #fcebd9; }
.home-grid[data-mood-aura="Грущу"] { --aura-1: #daeaf5; --aura-2: #e7e4f5; }
.home-grid[data-mood-aura="Нет сил"] { --aura-1: #efe9dc; --aura-2: #e5ece6; }
.home-grid[data-mood-aura="Спокойно"] { --aura-1: #dbf0e3; --aura-2: #e6f3ee; }
.home-grid[data-mood-aura="Радуюсь"] { --aura-1: #fdf0c4; --aura-2: #fde3d3; }


/* Cozy Self-Care Week Garden */
.cozy-garden {
  position: relative;
  z-index: 1;
  grid-area: garden;
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem 1.15rem;
  border-radius: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--green-tint);
}
.garden-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.garden-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.garden-sprout {
  width: 2.35rem;
  height: 2.35rem;
  flex: none;
  border-radius: 0.85rem;
  background: var(--sage-soft);
  color: var(--green);
  display: grid;
  place-items: center;
}
.garden-sprout svg { width: 1.3rem; height: 1.3rem; }
.garden-title { font-family: var(--display); font-size: 1.02rem; color: var(--ink); }
.garden-sub { font-size: 0.78rem; color: var(--muted); }
.garden-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.garden-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  border: 1px solid var(--green-tint);
}
.garden-pill-warm {
  background: var(--blush);
  color: var(--terracotta-dark);
  border-color: rgba(217, 138, 108, 0.25);
}
.garden-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}
.garden-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.42rem 0.2rem;
  border-radius: 0.95rem;
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  font-size: 0.72rem;
  color: var(--muted);
  transition: transform 280ms var(--spring), background-color 240ms ease, border-color 240ms ease;
}
.garden-day.is-today {
  border-style: solid;
  border-color: var(--green);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
}
.garden-day.is-bloomed {
  border-style: solid;
  border-color: var(--green-tint-strong);
  background: var(--sage-soft);
  color: var(--green-dark);
}
.garden-flower {
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
}
@media (prefers-reduced-motion: no-preference) {
  .garden-day.just-bloomed { animation: bloom-pop 560ms var(--spring); }
}
@keyframes bloom-pop {
  0% { transform: scale(0.75); }
  55% { transform: scale(1.16) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Interactive floating quick-mood bubbles on Home */
.quick-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.quick-bubble {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  gap: 0.42rem;
  padding: 0.46rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(36, 52, 46, 0.12);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 260ms var(--spring), box-shadow 220ms ease, border-color 200ms ease;
}
.quick-bubble .qb-icon { width: 1.15rem; height: 1.15rem; display: grid; place-items: center; }
.quick-bubble .qb-icon svg { width: 100%; height: 100%; }
.qb-worried { background: #eee9f7; color: #3f3257; }
.qb-angry { background: #fbe5df; color: #693127; }
.qb-sad { background: #e5f0f7; color: #2a495e; }
.qb-tired { background: #f3ede2; color: #524635; }
.qb-calm { background: #e5f2ea; color: #20493a; }
.qb-happy { background: #fdf3d7; color: #5e4916; }

.quick-bubble:hover { transform: translateY(-2px) scale(1.03); }
.quick-bubble[aria-pressed="true"] {
  transform: translateY(-2px) scale(1.05);
  border-color: currentColor;
  box-shadow: 0 8px 18px -10px rgba(36, 52, 46, 0.32), 0 0 0 3px rgba(74, 124, 111, 0.14);
}

/* Companion reply bubble */
.companion-reply {
  margin-top: 0.95rem;
  padding: 0.95rem 1.1rem;
  border-radius: 1.25rem;
  background: var(--sage-soft);
  border: 1px solid var(--green-tint-strong);
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 0.75rem;
}
@media (prefers-reduced-motion: no-preference) {
  .companion-reply:not([hidden]) { animation: companion-in 380ms var(--spring) both; }
}
@keyframes companion-in {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.companion-head { display: flex; align-items: flex-start; gap: 0.65rem; }
.companion-bird { flex: none; margin-top: 0.1rem; }
@media (prefers-reduced-motion: no-preference) {
  .companion-bird { animation: bird-flutter 700ms ease-in-out 1; }
}
@keyframes bird-flutter {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-5deg); }
}
.companion-text { font-size: 0.9rem; line-height: 1.45; color: var(--ink); }
.companion-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.companion-btn { min-height: 2.35rem; padding: 0.38rem 0.85rem; font-size: 0.82rem; border-radius: 999px; }

.oracle-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.35rem;
}
.oracle-header h2 { margin-bottom: 0; }
.oracle-shuffle {
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--green-tint-strong);
  background: rgba(255, 255, 255, 0.8);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 200ms var(--spring), background-color 160ms ease;
}
.oracle-shuffle:hover { background: var(--sheet); transform: scale(1.03); }
.oracle-shuffle:active { transform: scale(0.96); }
.lede {
  max-width: 44ch;
  margin-top: 0.7rem;
  color: var(--muted);
}

.cat-scene {
  grid-area: art;
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(100%, 26rem);
  margin: 0;
  pointer-events: none;
}
.cat-scene img { display: block; width: 100%; height: auto; }
.cat-scene::after {
  content: "";
  position: absolute;
  left: 13.3%;
  bottom: 49%;
  width: 7%;
  aspect-ratio: 60 / 96;
  background: url("assets/tea-steam.svg") center / contain no-repeat;
  opacity: .63;
}
@media (prefers-reduced-motion: no-preference) {
  .cat-scene::after { animation: tea-steam-rise 1.15s ease-out both; }
}
@keyframes tea-steam-rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: .63; transform: translateY(0); }
}
@media (max-width: 40rem) {
  .cat-scene { width: min(80%, 15rem); }
  #home-surface { grid-template-areas: "intro" "art"; }
}

.start-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
}

.start-action, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.65rem 1.1rem;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 550;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 180ms ease, transform 160ms var(--ease-out);
}

.start-action {
  justify-content: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.05rem;
  border-color: var(--rule);
  background: var(--surface);
  text-align: start;
}

.start-action.start-primary {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  box-shadow: none;
}

.start-action.start-primary .action-title { color: #ffffff; font-weight: 500; }
.start-action.start-primary .action-sub { color: #fff; }
.start-action.start-primary .action-arrow { color: rgba(255, 255, 255, 0.85); }
.start-action.start-primary .action-badge {
  color: #ffffff;
}

.action-badge {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 2.35rem;
  flex: 0 0 1.7rem;
  color: var(--green);
}

.action-badge-warm {
  color: var(--terracotta-dark);
}

.action-svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  color: currentColor;
}

.action-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}

.action-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink);
}

.action-sub {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.32;
  color: var(--muted);
}

.action-arrow {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 600;
  transition: transform 180ms var(--ease-out);
}

.start-action:active:not(:focus-visible), .button:active:not(:focus-visible, :disabled) {
  transform: scale(0.985);
}

.button.primary {
  position: relative;
  overflow: hidden;
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  box-shadow: 0 6px 16px -8px var(--green-tint-strong), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.button.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-110%);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .button.primary::before {
    transition: transform 600ms var(--ease-out);
  }
}

.button:disabled {
  background: var(--paper-deep);
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--green-dark);
  font-weight: 550;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--green-tint-strong);
  transition: text-decoration-color 160ms ease;
}

.home-links { display: flex; flex-wrap: wrap; column-gap: 1.15rem; row-gap: 0.1rem; margin-top: 0.5rem; }
.home-links .text-link { min-height: 2.5rem; font-size: 0.92rem; }

/* Paper-bookmark phrase card */
.phrase-panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: clamp(1.15rem, 2.2vw, 1.65rem) clamp(2.4rem, 5vw, 3.25rem) clamp(1.15rem, 2.2vw, 1.65rem) clamp(1.2rem, 2.2vw, 1.7rem);
  border-radius: 1.2rem;
  background: var(--sage-soft);
  border: 1px solid var(--green-tint);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.phrase-panel::after {
  content: "";
  position: absolute;
  inset: -1px clamp(0.95rem, 2.4vw, 1.6rem) auto auto;
  width: 0.92rem;
  height: 1.6rem;
  background: var(--terracotta);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.phrase-support-bar {
  position: relative;
  z-index: 1;
  flex-basis: 100%;
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--green-tint);
}

.support-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--terracotta-dark);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms var(--ease-out);
}

.support-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.screen-header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
}

.export-button {
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

.prompt-chips, .outcome-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.prompt-chips { margin-bottom: 0.25rem; }
.support-topic { margin-top: 1.15rem; max-width: 27rem; }

.prompt-chip, .filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.prompt-chip:hover, .filter-chip:hover {
  background: var(--sage-soft);
  border-color: rgba(25, 83, 70, 0.35);
}

.filter-chip[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.support-card {
  margin-top: 1.1rem;
  padding-block: clamp(1.35rem, 3vw, 2rem);
}

.support-card-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.support-save-status {
  flex-basis: 100%;
  font-size: 0.9rem;
  color: var(--green-dark);
}

.support-own {
  margin-top: 1.75rem;
}

.specialist-notice {
  margin-top: 1.75rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--blush);
  border: 1px solid rgba(184, 93, 67, 0.2);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.specialist-notice h2 {
  font-size: 1.1rem;
  color: #7d3623;
  margin-bottom: 0.45rem;
}

.specialist-notice p + p {
  margin-top: 0.55rem;
}

.outcome-block {
  margin-top: 1.35rem;
  padding: 1.05rem 1.15rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--rule);
  display: grid;
  gap: 0.65rem;
}

.outcome-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.outcome-status {
  font-size: 0.875rem;
  color: var(--green-dark);
}

.phrase-panel-copy { position: relative; z-index: 1; flex: 1 1 22rem; min-width: 0; }
.phrase-panel h2 { margin-bottom: 0.45rem; }

.return-step {
  position: relative;
  z-index: 1;
  flex-basis: 100%;
  border-top: 1px solid var(--rule-strong);
  padding-top: 0.85rem;
}
.return-step p {
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.return-step .text-link { min-height: 2.75rem; }
.step-text { white-space: pre-wrap; }
.step-usefulness { display: grid; gap: 0.45rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); }
#entry-step .filter-chip { min-height: 2.75rem; }

.phrase-actions, .action-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.latest-phrase, .full-phrase {
  font: italic 400 1.25rem/1.55 var(--display);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--green-dark);
}

.full-phrase { width: 100%; font-size: 1.55rem; }
.checkin-support { display: grid; justify-items: start; gap: .7rem; }
.checkin-support h2 { margin: 0; font-size: 1.15rem; }
.muted { color: var(--muted); }
.back-link { margin-bottom: 0.75rem; }

.work-screen { max-width: 44rem; margin-inline: auto; }

.card-screen {
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--rule);
  border-radius: 1.35rem;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-sheet);
}

.work-screen > :is(.action-row, .button, .phrase-panel, .entry-fields, .entries-search) {
  margin-top: 1.35rem;
}

.work-screen > p:not(.lede) { margin-top: 0.8rem; }

.compose-screen { max-width: none; }

.compose-top-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.9rem;
}

.compose-top-bar .back-link { margin-bottom: 0; }

/* Clean single-row segmented control (solid pill track, never bleeds background) */
.mode-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  width: min(100%, 23rem);
  padding: 0.25rem;
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  background: var(--pill-track);
  box-shadow: var(--shadow-card);
}

.mode-pill {
  display: grid;
  place-content: center;
  min-height: 2.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0.68rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.mode-pill[aria-current="true"] {
  background: var(--sheet);
  color: var(--green-dark);
  box-shadow: 0 1px 3px rgba(36, 52, 46, 0.1);
}

.compose-spread {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  border: 1px solid var(--rule);
  border-radius: 1.5rem;
  background: var(--sheet);
  box-shadow: var(--shadow-sheet);
}

.compose-cover {
  position: sticky;
  top: 5.5rem;
  display: grid;
  align-content: start;
  gap: 0.85rem;
  padding: clamp(1.35rem, 3.1vw, 2.5rem);
  margin: clamp(0.75rem, 1.6vw, 1.15rem);
  border-radius: 1.15rem;
  background: var(--sage-soft);
  border: 1px solid var(--green-tint);
  transition: background 260ms ease, border-color 260ms ease;
}

.compose-spread.is-good .compose-cover {
  background: var(--blush);
  border-color: rgba(217, 138, 108, 0.22);
}

.compose-cover h1 { font-size: clamp(1.65rem, 1.35rem + 1.15vw, 2.15rem); font-weight: 400; text-wrap: balance; }
.compose-cover .lede { max-width: 30ch; }
.compose-copy { min-width: 0; }
.compose-art { display: none; }

.jump-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  min-height: 2.75rem;
  margin-top: 1.15rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--green-tint-strong);
  border-radius: 0.85rem;
  background: var(--sheet);
  color: var(--green-dark);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: start;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(36, 52, 46, 0.05);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}

.jump-button .action-svg { width: 1rem; height: 1rem; flex-basis: 1rem; }
.jump-button:disabled { cursor: wait; color: var(--muted); }

.journal-form {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 1.45rem;
  min-width: 0;
  padding: clamp(1.2rem, 3.1vw, 2.6rem);
}
.journal-form > :not(.button) { width: 100%; }

.feelings {
  min-inline-size: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

legend, .field label, .field > span { font-weight: 500; }
legend { padding: 0 0 0.85rem; font: 400 1.2rem/1.3 var(--display); }

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

/* Editorial tactile mood tiles with botanical/weather orbs (How We Feel / Headspace spirit) */
.mood {
  --mood-bg: #e5f0e7;
  --mood-border: var(--green);
  --orb-bg: radial-gradient(circle at 30% 25%, #f5faf6 0%, #d4e8d9 100%);
  --orb-ink: #1f5948;
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 6.15rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.75rem 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms var(--ease-out);
}

.mood-worried {
  --mood-bg: #ebeef6;
  --mood-border: #5a6d91;
  --orb-bg: radial-gradient(circle at 30% 25%, #f6f8fc 0%, #d5dced 100%);
  --orb-ink: #3e5278;
}

.mood-angry {
  --mood-bg: #f9eae4;
  --mood-border: #b3553d;
  --orb-bg: radial-gradient(circle at 30% 25%, #fef6f3 0%, #f0cfc3 100%);
  --orb-ink: #943d27;
}

.mood-sad {
  --mood-bg: #e7f0f5;
  --mood-border: #4b748a;
  --orb-bg: radial-gradient(circle at 30% 25%, #f4f9fc 0%, #cfe1ec 100%);
  --orb-ink: #335c73;
}

.mood-tired {
  --mood-bg: #f2ede3;
  --mood-border: #87765b;
  --orb-bg: radial-gradient(circle at 30% 25%, #faf8f2 0%, #e4dac7 100%);
  --orb-ink: #63543d;
}

.mood-calm {
  --mood-bg: #e3f0e7;
  --mood-border: #256b56;
  --orb-bg: radial-gradient(circle at 30% 25%, #f4fbf6 0%, #cce4d3 100%);
  --orb-ink: #1b5946;
}

.mood-happy {
  --mood-bg: #fbf2da;
  --mood-border: #b38928;
  --orb-bg: radial-gradient(circle at 30% 25%, #fffcf0 0%, #f3dfaa 100%);
  --orb-ink: #8a6412;
}

.mood:active { transform: scale(0.97); }

.mood:has(input:checked) {
  background: var(--mood-bg);
  border-color: var(--mood-border);
  box-shadow: 0 6px 16px -10px rgba(30, 51, 43, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.sample-option[aria-pressed="true"] {
  background: var(--sage);
  border-color: var(--green);
}

.mood:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.mood input, .plain-check input {
  accent-color: var(--green);
  appearance: none;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 1px solid var(--control);
  border-radius: 0.3rem;
  background: var(--white);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.mood input { position: absolute; z-index: 1; inset: 0.5rem 0.5rem auto auto; border-radius: 999px; }
.mood input:not(:checked) { background: transparent; border-color: transparent; }

.mood input:checked, .plain-check input:checked {
  border-color: var(--mood-border, var(--green));
  background: var(--mood-border, var(--green));
}

:is(.mood, .plain-check) input::before {
  content: "";
  width: 0.54rem;
  height: 0.32rem;
  border: solid white;
  border-width: 0 0 0.13rem 0.13rem;
  transform: translateY(-0.04rem) rotate(-45deg);
  clip-path: inset(100% 0 0 100%);
  transition: clip-path 180ms var(--ease-out);
}

:is(.mood, .plain-check) input:checked::before { clip-path: inset(0); }
:is(.mood, .plain-check) input:focus-visible::before { transition: none; }

.mood-orb {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 2.65rem;
  border-radius: 50%;
  background: var(--orb-bg);
  color: var(--orb-ink);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 3px 8px -4px rgba(30, 51, 43, 0.22);
  transition: transform 240ms var(--ease-out);
}

@media (prefers-reduced-motion: no-preference) {
  .mood-orb {
    transition: transform 380ms var(--spring);
  }
}

.mood-orb svg {
  width: 1.3rem;
  height: 1.3rem;
  display: block;
}

.mood:has(input:checked:not(:focus-visible)) .mood-orb {
  transform: translateY(-0.15rem) scale(1.08);
}

@media (prefers-reduced-motion: no-preference) {
  .mood-worried:has(input:checked) .mood-orb svg { animation: mood-wave 320ms ease-out; }
  .mood-angry:has(input:checked) .mood-orb svg { animation: mood-pulse 650ms var(--ease-out); }
  .mood-sad:has(input:checked) .mood-orb svg { animation: mood-drop 320ms ease-out; }
  .mood-tired:has(input:checked) .mood-orb svg { animation: mood-rock 320ms ease-out; }
  .mood-calm:has(input:checked) .mood-orb svg { animation: mood-sway 320ms ease-out; }
  .mood-happy:has(input:checked) .mood-orb svg { animation: mood-spin 700ms var(--ease-out) both; }
}

@keyframes mood-wave { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
@keyframes mood-pulse { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.22); } 75% { transform: scale(0.95); } }
@keyframes mood-drop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2.5px); } }
@keyframes mood-rock { 0%, 100% { transform: rotate(0deg); } 35% { transform: rotate(-12deg); } 70% { transform: rotate(8deg); } }
@keyframes mood-sway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(10deg); } }
@keyframes mood-spin { 0% { transform: rotate(0deg) scale(0.92); } 60% { transform: rotate(45deg) scale(1.12); } 100% { transform: rotate(45deg) scale(1); } }

/* Breathing grounding flower on #support */
.breathing-card {
  margin-top: 1.15rem;
  padding: 1.15rem 1.35rem;
  border-radius: 1.2rem;
  background: var(--sage-soft);
  border: 1px solid var(--green-tint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.35rem;
}

.breathing-visual {
  position: relative;
  width: 6.75rem;
  height: 6.75rem;
  flex: none;
  display: grid;
  place-items: center;
}

.breathing-svg { width: 100%; height: 100%; overflow: visible; }
.breathing-svg .petal-outer { fill: var(--green); transform-origin: 100px 100px; opacity: 0.25; }
.breathing-svg .petal-mid { fill: var(--terracotta); transform-origin: 100px 100px; opacity: 0.32; }
.breathing-svg .petal-core { fill: var(--sheet); transform-origin: 100px 100px; }

@media (prefers-reduced-motion: no-preference) {
  .breathing-card.is-started .petal-outer { animation: breathe-outer 10s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
  .breathing-card.is-started .petal-mid { animation: breathe-mid 10s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
  .breathing-card.is-started .petal-core { animation: breathe-core 10s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
  .breathing-card.is-paused .breathing-svg g { animation-play-state: paused; }
}

@keyframes breathe-outer {
  0%, 100% { transform: scale(0.76) rotate(0deg); opacity: 0.22; }
  40%, 48% { transform: scale(1.12) rotate(22deg); opacity: 0.42; }
}
@keyframes breathe-mid {
  0%, 100% { transform: scale(0.82) rotate(0deg); opacity: 0.28; }
  40%, 48% { transform: scale(1.06) rotate(-18deg); opacity: 0.48; }
}
@keyframes breathe-core {
  0%, 100% { transform: scale(0.88); }
  40%, 48% { transform: scale(1.08); }
}

.breathing-phase {
  position: absolute;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--green-dark);
  pointer-events: none;
}

.breathing-copy { flex: 1 1 14rem; min-width: 0; display: grid; gap: 0.35rem; }
.breathing-copy h2 { font-size: 1.12rem; }
.breathing-copy p { font-size: 0.9rem; color: var(--muted); }
.breathing-toggle { justify-self: start; min-height: 2.25rem; padding: 0.3rem 0.75rem; font-size: 0.84rem; margin-top: 0.2rem; }

/* Empty state sketch block */
.empty-state {
  margin-top: 1.35rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 1.35rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.9rem;
}

.empty-sketch {
  width: min(12rem, 56vw);
  height: auto;
  display: block;
}

/* Pastel tag pill */
.entry-link-meta {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.feeling-alternatives {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

.plain-check {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--ink);
  cursor: pointer;
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 0.35rem;
  overflow-wrap: anywhere;
}
.field-note { font-size: 0.875rem; margin-bottom: 0.1rem; }

input[type="text"], input[type="search"], input[type="email"], select, textarea {
  min-width: 0;
  min-height: 3rem;
  width: 100%;
  border: 1px solid var(--rule-strong);
  border-radius: 0.85rem;
  background: var(--white);
  caret-color: var(--green-dark);
  padding: 0.72rem 0.95rem;
  box-shadow: inset 0 1px 2px rgba(30, 51, 43, 0.04);
  transition: border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

input[type="text"]:focus, input[type="search"]:focus, input[type="email"]:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: var(--shadow-focus);
  outline: none;
}

input[type="text"]:focus-visible, input[type="search"]:focus-visible, input[type="email"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

textarea {
  field-sizing: content;
  height: auto;
  min-block-size: 4.5rem;
  max-block-size: 16rem;
  resize: vertical;
}

::placeholder { color: #7a867e; opacity: 1; }

.phrase-field {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}

.phrase-field label { font: 500 1.28rem/1.35 var(--display); text-wrap: pretty; }
.phrase-field textarea { background: #f6faf6; scroll-margin: 1rem; }
.phrase-field textarea:focus { background: var(--white); }

.entry-optional { padding-block: 0.25rem; border-bottom: 1px solid var(--rule); }
.entry-optional summary {
  min-height: 2.75rem;
  padding-block: 0.54rem;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 600;
}
.entry-optional > .field { margin-bottom: 0.85rem; }

.entry-fields {
  margin: 0;
  border-top: 1px solid var(--rule);
}

.entry-fields > div {
  display: grid;
  grid-template-columns: minmax(7em, 0.34fr) minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.entry-fields dt { font-weight: 650; color: var(--muted); }
.entry-fields dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.entries-search { display: grid; gap: 0.65rem 1rem; align-items: end; }
.entries-search input, .entries-search select { background: var(--sheet); }
.entries-search:has(#entries-tag-wrap:not([hidden])) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
#entries-tag-wrap label { font-size: 0.875rem; }
.auth-form { display: grid; gap: 1rem; justify-items: start; margin-top: 1.25rem; }
.auth-form > .field { width: 100%; max-width: 26rem; }
.auth-form .button.primary { background: var(--green); box-shadow: none; }
.auth-form .button.primary::before { content: none; }
.account-button { order: 2; }
#delete-account { margin-top: 0.9rem; }

.entry-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.65rem; }
.entry-list:empty { display: none; }
.entry-list li {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 1px 2px rgba(30, 51, 43, 0.04);
  transition: transform 180ms var(--ease-out), border-color 180ms ease, box-shadow 180ms ease;
}

@media (prefers-reduced-motion: no-preference) {
  .entry-list li {
    animation: item-fade 300ms var(--ease-out) both;
  }
  .entry-list li:nth-child(2) { animation-delay: 35ms; }
  .entry-list li:nth-child(3) { animation-delay: 70ms; }
  .entry-list li:nth-child(4) { animation-delay: 105ms; }
  .entry-list li:nth-child(5) { animation-delay: 140ms; }
}

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

.entry-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding: 1.05rem 1.15rem;
  text-decoration: none;
  border-radius: var(--radius);
}

.entry-link-body {
  flex: 1 1 16rem;
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.entry-link-feelings, .entry-link-meta {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--green);
}

.entry-link-title {
  color: var(--green-dark);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.entry-link-phrase {
  font-size: 0.88rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.entry-link time { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.phrase-list .entry-link-title { font: 1.25rem/1.45 var(--display); }

.sample-task { margin-top: 1.35rem; }
.options { display: grid; gap: 0.55rem; margin-top: 0.75rem; }
.options button { justify-content: flex-start; text-align: left; }

.sample-feedback {
  margin-top: 0.7rem;
  padding: 0.85rem 1rem;
  background: var(--sage);
  border: 1px solid rgba(25, 83, 70, 0.16);
  border-radius: var(--radius);
}

.sample-feedback:empty { margin: 0; padding: 0; border: 0; }

.notice {
  padding: 0.7rem 0.9rem;
  background: #faeee8;
  color: var(--error);
  border: 1px solid #e6cac0;
  border-radius: var(--radius);
}
.main > .notice, .main > noscript .notice { margin-bottom: 1rem; }
.delete-button { color: var(--error); border-color: #d8b5a9; }

/* Stateful Button: https://ui.aceternity.com/components/stateful-button */
.save-button {
  position: relative;
  min-width: min(100%, 16rem);
  padding-inline: 2.25rem;
}

.save-button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset-inline-end: 0.85rem;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  @media (prefers-reduced-motion: no-preference) {
    animation: save-spin 700ms linear infinite;
  }
}

@keyframes save-spin { to { transform: rotate(1turn); } }

/* Saved screen with illustrated journal sticker */
.saved-screen {
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid var(--rule);
  border-radius: 1.35rem;
  padding: clamp(1.35rem, 4vw, 2.6rem);
  box-shadow: var(--shadow-sheet);
}

.saved-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.saved-sticker {
  width: 5.25rem;
  height: 5.45rem;
  flex: 0 0 5.25rem;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 1rem;
  border-top: 1px solid var(--rule);
  padding-block: 0.85rem 1.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p { display: flex; align-items: center; gap: 0.625rem; }
.footer-links { display: flex; flex-wrap: wrap; column-gap: 1rem; }

.privacy-mark {
  position: relative;
  width: 0.75rem;
  height: 0.56rem;
  margin-top: 0.22rem;
  flex: 0 0 0.75rem;
  border: 1.5px solid currentColor;
  border-radius: 0.15rem;
}

.privacy-mark::before {
  content: "";
  position: absolute;
  inset: -0.38rem 0.08rem auto;
  height: 0.35rem;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 0.25rem 0.25rem 0 0;
}

@media (hover: hover) and (pointer: fine) {
  :where(header) nav a:hover { color: var(--ink); }
  .start-action:hover, .button.secondary:hover:not(:disabled) {
    background: var(--sage-soft);
    border-color: var(--green-tint-strong);
    box-shadow: 0 8px 18px -12px var(--green-tint-strong);
    transform: translateY(-1px);
  }
  .start-action.start-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
  }
  .start-action:hover .action-arrow { transform: translateX(0.24rem); }
  .button.primary:hover:not(:disabled) {
    background: var(--green-dark);
    border-color: var(--green-dark);
    box-shadow: 0 8px 20px -8px var(--green-tint-strong);
  }
  .button.primary:hover:not(:disabled)::before {
    transform: translateX(110%);
  }
  .mood:hover:not(:has(input:checked)) {
    background: #fff;
    border-color: var(--rule-strong);
    box-shadow: 0 6px 14px -10px rgba(36, 52, 46, 0.2);
    transform: translateY(-1px);
  }
  .jump-button:hover:enabled {
    background: var(--white);
    border-color: var(--green);
    transform: translateY(-1px);
  }
  .mode-pill:hover:not([aria-current="true"]) {
    color: var(--ink);
  }
  .text-link:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
  .entry-list li:hover {
    border-color: var(--green-tint-strong);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
  }
  .entry-list li:hover .entry-link-title { text-decoration: underline; text-underline-offset: 0.18em; }
}

@media (max-width: 52rem) {
  .compose-spread { grid-template-columns: minmax(0, 1fr); }
  .compose-cover {
    position: static;
    margin: 0.75rem 0.75rem 0;
  }
  .compose-cover h1 { text-wrap: wrap; }
}

@media (max-width: 40rem) {
  .header-inner { justify-content: space-between; padding-block: 0.45rem; }
  .header-tools { order: 0; }
  :where(header) nav { flex-basis: 100%; order: 3; }
  :where(header) nav a { min-height: 2.5rem; }
  .theme-toggle-label { display: none; }
  .mode-pills { width: 100%; }
  .home-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "start" "garden" "phrases" "art";
    gap: 1.15rem;
  }
  .home-grid.has-phrase { grid-template-areas: "intro" "phrases" "start" "garden" "art"; }
  .phrase-panel-copy { flex-basis: 100%; }
  .journal-form > .button { width: 100%; }
  .entries-search:has(#entries-tag-wrap:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 24rem) {
  h1, .intro h1, .compose-cover h1 { font-size: 1.78rem; }
  .entry-fields > div { grid-template-columns: 1fr; }
}

@media (max-width: 22.5rem) {
  .mood-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compose-cover { grid-template-columns: minmax(0, 1fr); }
  .compose-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .quick-bubble, .quick-bubble:hover, .quick-bubble[aria-pressed="true"] { transition: none; transform: none; }
  :where(header) nav::after, .start-action, .action-arrow, .button, .mood, .mood-orb, .mode-pill, .jump-button, .filter-chip,
  .entry-list li, :is(.mood, .plain-check) input, :is(.mood, .plain-check) input::before { transition: none; }
  .start-action:active:not(:focus-visible), .button:active:not(:focus-visible, :disabled), .mood:active { transform: none; }
  .mood:has(input:checked:not(:focus-visible)) .mood-orb { transform: none; }
}

@media (forced-colors: active) {
  :is(.mood, .plain-check) input { appearance: auto; display: block; }
  :is(.mood, .plain-check) input::before { content: none; }
  :where(header) nav a[aria-current="page"], .mode-pill[aria-current="true"] { text-decoration: underline; }
}

.entry-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, var(--surface));
  border-radius: 1.05rem;
  background: var(--surface);
}

.entry-page-copy {
  align-self: center;
  min-width: 0;
  padding: clamp(1.4rem, 4vw, 3.25rem);
}

.entry-page h1 { font-size: clamp(1.65rem, 3vw, 2rem); }
.entry-page .lede { margin-top: 0.65rem; }
.entry-page-art { display: block; width: 100%; height: 100%; min-height: 17rem; object-fit: cover; }
.not-found-page .entry-page-art { object-position: 50% 42%; }
.entry-page .button, .entry-page .button:hover { box-shadow: none; }
.entry-page .button.primary::before { content: none; }
.entry-page .auth-form { align-items: start; justify-items: stretch; }
.entry-page .auth-form > .field { max-width: none; }
.entry-page .auth-form .button, .entry-page-alternate .button { min-height: 2.75rem; width: 100%; }
.entry-page-alternate { margin-block: 0.9rem 0; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.entry-page-detail { margin: 0.45rem 0 0; font-size: 0.85rem; }
.entry-page-back { display: inline-block; width: fit-content; margin-top: 1.15rem; }
button.entry-page-back { padding: 0; border: 0; background: none; text-align: left; }
.entry-page .auth-form .entry-page-back { margin-top: 0; }
.identity-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.75rem; }
.identity-buttons .button { flex: 1 1 9rem; display: grid; gap: 0.125rem; white-space: normal; }
.identity-buttons small { color: var(--muted); font-size: 0.77rem; font-weight: 400; }
.entry-page-copy > .entry-page-back { margin-right: 1rem; }
.header-login { padding-inline: 0.45rem; }
.welcome-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.96fr);
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
}
.welcome-copy { padding: clamp(1.5rem, 4vw, 3.5rem); }
.welcome-copy h1 { max-width: 17ch; font-size: clamp(2rem, 4.1vw, 3.55rem); line-height: 1.12; text-wrap: balance; }
.welcome-copy .lede { margin: 1rem 0 1.5rem; }
.welcome-copy .button { box-shadow: none; }
.welcome-detail { margin: 0.8rem 0 0.25rem; max-width: 43ch; font-size: 0.9rem; color: var(--muted); }
.welcome-art { width: 100%; height: 100%; max-height: 34rem; object-fit: cover; }
.welcome-routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 4rem; padding: clamp(1.5rem, 4vw, 3.5rem); }
.welcome-routes p { max-width: 44ch; margin-top: 0.5rem; color: var(--muted); }
.identity-settings { margin-block: 1.5rem; padding-block: 1.2rem; border-block: 1px solid var(--rule); }
.identity-settings h2 { margin-bottom: 0.35rem; }
.not-found-page .entry-page .action-row { margin-top: 1rem; }

@media (min-width: 44rem) {
  .not-found-page .main { display: grid; align-items: center; }
  .not-found-page .entry-page-art { min-height: 23rem; }
}

@media (max-width: 43rem) {
  .welcome-spread, .welcome-routes { grid-template-columns: minmax(0, 1fr); }
  .welcome-art { height: clamp(8rem, 42vw, 13rem); object-position: center 63%; }
  .entry-page { grid-template-columns: minmax(0, 1fr); }
  .entry-page-art { height: clamp(9.5rem, 48vw, 16rem); min-height: 0; }
}

#home-surface {
  grid-template-areas: "intro art";
  align-items: center;
}
#home-surface .intro { align-self: center; }
#home-surface .quick-bubbles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 23rem;
}
#home-surface .quick-bubble { border-radius: .72rem; }
.quick-write {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: .6rem;
}
#quick-status:empty { display: none; }
#quick-undo { background: transparent; border: 0; cursor: pointer; padding: .5rem 0; }
.personal-habit { margin-block: 1.5rem; padding-block: 1.2rem; border-block: 1px solid var(--rule); }
.personal-habit p { margin-block: .4rem; overflow-wrap: anywhere; }
#note-form { margin-top: 1.2rem; }
#note-form .button { margin-top: 1rem; }
#entries .cozy-garden { margin-block: 1.6rem; }
#repeat-step, #repeat-phrase { margin-top: .65rem; }
@media (max-width: 40rem) {
  #home-surface { grid-template-areas: "intro" "art"; }
}
