:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ink: #f4f6f3;
  --ink-soft: rgba(244, 246, 243, 0.68);
  --ink-faint: rgba(244, 246, 243, 0.42);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --accent: #b7dfd6;
  --accent-ink: #10221f;
  --bg-a: #071319;
  --bg-b: #16343b;
  --glow: rgba(108, 180, 165, 0.31);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color-scheme: dark;
}

body[data-mood="bright"] {
  --accent: #ffd08b;
  --accent-ink: #2d1e0a;
  --bg-a: #201713;
  --bg-b: #553823;
  --glow: rgba(255, 177, 92, 0.36);
}

body[data-mood="anxious"] {
  --accent: #b9adff;
  --accent-ink: #181329;
  --bg-a: #0c1020;
  --bg-b: #29234b;
  --glow: rgba(130, 112, 255, 0.34);
}

body[data-mood="low"] {
  --accent: #9bc8ee;
  --accent-ink: #0d1b2a;
  --bg-a: #08131f;
  --bg-b: #1d334b;
  --glow: rgba(80, 142, 204, 0.32);
}

body[data-mood="tired"] {
  --accent: #d0d2f1;
  --accent-ink: #1b1d2c;
  --bg-a: #0b0f19;
  --bg-b: #292c45;
  --glow: rgba(132, 136, 192, 0.25);
}

body[data-mood="blank"] {
  --accent: #e3ebf4;
  --accent-ink: #1b2530;
  --bg-a: #0d1820;
  --bg-b: #344650;
  --glow: rgba(191, 214, 226, 0.27);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #071319;
  overscroll-behavior: none;
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 52% 18%, var(--glow), transparent 42%),
    linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 100%);
  transition: background 1.2s ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.app {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, var(--glow), transparent 43%),
    linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 100%);
  transition: background 1.2s ease;
}

@media (min-width: 620px) {
  body {
    display: grid;
    place-items: center;
    background: #03080b;
  }

  .app {
    min-height: min(900px, 100svh);
    height: min(900px, 100svh);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 34px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.62);
  }
}

.atmosphere,
.atmosphere canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.atmosphere {
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

#weatherCanvas {
  opacity: 0.96;
}

.aurora {
  position: absolute;
  width: 62vw;
  height: 62vw;
  max-width: 420px;
  max-height: 420px;
  border-radius: 50%;
  filter: blur(52px);
  opacity: 0.37;
  mix-blend-mode: screen;
  transition: background 1.2s ease, opacity 1.2s ease;
}

.aurora-one {
  top: -18%;
  right: -26%;
  background: var(--glow);
  animation: aurora-drift-one 13s ease-in-out infinite alternate;
}

.aurora-two {
  bottom: 12%;
  left: -36%;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  opacity: 0.18;
  animation: aurora-drift-two 17s ease-in-out infinite alternate;
}

.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.12;
  background-image:
    repeating-radial-gradient(circle at 17% 32%, rgba(255,255,255,.22) 0 0.45px, transparent 0.7px 3px),
    repeating-radial-gradient(circle at 77% 61%, rgba(255,255,255,.16) 0 0.35px, transparent 0.65px 4px);
  background-size: 13px 17px, 19px 23px;
  mix-blend-mode: soft-light;
  transform: rotate(8deg);
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.23), transparent 22%, transparent 70%, rgba(0,0,0,.28)),
    radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, 0.28) 100%);
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: calc(var(--safe-top) + 15px) 19px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.72;
}

.brand-mark::before {
  width: 15px;
  height: 15px;
}

.brand-mark::after {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border: 0;
}

.brand-mark i {
  width: 21px;
  height: 8px;
  border-width: 1px 0 0;
  border-radius: 50%;
  transform: rotate(-18deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.brand-copy small {
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.round-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.round-action:active {
  transform: scale(0.92);
}

.round-action[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
}

.sound-glyph {
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  transform: translateX(-2px);
}

.sound-waves {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 1.5px;
  height: 13px;
}

.sound-waves i {
  display: block;
  width: 1px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transition: opacity 200ms ease;
}

.sound-action[aria-pressed="true"] .sound-waves i {
  opacity: 0.9;
  animation: sound-wave 900ms ease-in-out infinite alternate;
}

.sound-waves i:nth-child(2) {
  animation-delay: 140ms !important;
}

.sound-waves i:nth-child(3) {
  animation-delay: 280ms !important;
}

.journal-glyph {
  position: relative;
  width: 15px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 2px 5px 2px 2px;
}

.journal-glyph::before,
.journal-glyph::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 6px;
  height: 1px;
  background: currentColor;
  opacity: 0.78;
}

.journal-glyph::before {
  top: 5px;
}

.journal-glyph::after {
  top: 9px;
}

.history-count {
  position: absolute;
  top: -3px;
  right: -2px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid var(--bg-a);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 8px;
  font-weight: 800;
}

.home-view {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.hero {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 310px;
  padding: 16px 22px 0;
}

.hero-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  animation: rise-in 700ms 80ms both;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.date-label,
.saved-badge {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.live-weather {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 180ms ease, opacity 180ms ease;
}

.live-weather:active {
  opacity: 0.65;
}

.live-weather.has-data {
  color: var(--ink-soft);
}

.live-weather.is-loading {
  animation: soft-blink 1.2s ease-in-out infinite;
}

.live-weather-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
}

.live-weather.has-data .live-weather-dot {
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent);
}

.saved-badge {
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  color: var(--accent);
}

.weather-copy {
  position: relative;
  z-index: 3;
  margin: auto 0;
  pointer-events: none;
  animation: rise-in 850ms 120ms both;
}

.eyebrow {
  margin: 0 0 9px;
  color: color-mix(in srgb, var(--accent) 82%, white);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.weather-copy h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(64px, 19vw, 92px);
  font-weight: 500;
  letter-spacing: 0.055em;
  line-height: 0.98;
  text-shadow: 0 15px 55px rgba(0, 0, 0, 0.22);
  transition: color 500ms ease;
}

.weather-poem {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 14px;
  letter-spacing: 0.03em;
  line-height: 1.7;
}

.sky-touch {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: none;
  cursor: crosshair;
}

.sky-touch:focus-visible {
  outline-offset: -6px;
  border-radius: 30px;
}

.touch-orbit {
  position: absolute;
  top: 50%;
  right: -18%;
  width: 58vw;
  max-width: 310px;
  aspect-ratio: 1;
  transform: translateY(-50%);
  opacity: 0.35;
  pointer-events: none;
}

.touch-orbit i {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.touch-orbit i:nth-child(1) {
  transform: scale(0.42);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  animation: orbit-pulse 4.8s ease-in-out infinite;
}

.touch-orbit i:nth-child(2) {
  transform: scale(0.69);
  animation: orbit-pulse 4.8s 0.8s ease-in-out infinite;
}

.touch-orbit i:nth-child(3) {
  animation: orbit-pulse 4.8s 1.6s ease-in-out infinite;
}

.touch-prompt {
  position: absolute;
  right: 7px;
  bottom: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  pointer-events: none;
}

.touch-line {
  display: block;
  width: 1px;
  height: 25px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.4));
}

.dock {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  margin: 0 10px calc(10px + var(--safe-bottom));
  padding: 16px 14px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.06) 52%, rgba(255,255,255,.04));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(32px) saturate(135%);
  -webkit-backdrop-filter: blur(32px) saturate(135%);
  animation: rise-in 900ms 200ms both;
}

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
}

.dock-head p {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.dock-head > span {
  color: var(--ink-faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
}

.mood-scroller {
  display: flex;
  gap: 7px;
  margin: 12px -4px 0;
  padding: 2px 4px 7px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.mood-scroller::-webkit-scrollbar {
  display: none;
}

.mood-option {
  position: relative;
  display: flex;
  flex: 0 0 70px;
  flex-direction: column;
  align-items: flex-start;
  min-height: 73px;
  padding: 9px 10px 8px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.mood-option::after {
  content: "";
  position: absolute;
  right: -14px;
  bottom: -18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mood-color);
  filter: blur(12px);
  opacity: 0.13;
  transition: opacity 220ms ease;
}

.mood-option:active {
  transform: scale(0.95);
}

.mood-option.is-active {
  border-color: color-mix(in srgb, var(--mood-color) 55%, transparent);
  background: color-mix(in srgb, var(--mood-color) 15%, rgba(255,255,255,.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.mood-option.is-active::after {
  opacity: 0.3;
}

.mood-symbol {
  display: block;
  height: 18px;
  color: var(--mood-color);
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  line-height: 1;
}

.mood-name {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.mood-weather {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.compose {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.note-field {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.note-field input {
  width: 100%;
  height: 47px;
  padding: 0 43px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.13);
  color: var(--ink);
  font-size: 12px;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 180ms ease, background 180ms ease;
}

.note-field input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.note-field input:focus {
  border-color: color-mix(in srgb, var(--accent) 54%, transparent);
  background: rgba(0, 0, 0, 0.2);
}

.note-count {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--ink-faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
}

.save-button {
  display: flex;
  flex: 0 0 112px;
  align-items: center;
  justify-content: space-between;
  height: 47px;
  padding: 0 15px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.save-button i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  font-size: 13px;
  font-style: normal;
}

.save-button:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}

.save-button.is-saving {
  pointer-events: none;
  opacity: 0.75;
}

.journal-view {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(circle at 82% 8%, var(--glow), transparent 35%),
    linear-gradient(165deg, color-mix(in srgb, var(--bg-a) 94%, black), color-mix(in srgb, var(--bg-b) 90%, black));
  opacity: 0;
  visibility: hidden;
  transform: translateX(7%);
  transition: transform 420ms cubic-bezier(.2,.8,.2,1), opacity 320ms ease, visibility 420ms;
}

.journal-view.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.page-header {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: calc(var(--safe-top) + 18px) 18px 15px;
}

.back-button,
.sheet-close {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.back-button span {
  font-size: 17px;
  transform: translateY(-1px);
}

.page-kicker {
  margin: 0 0 3px;
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.page-header h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.journal-scroll {
  min-height: 0;
  padding: 0 14px calc(28px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.week-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.035));
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.week-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.week-card-head p,
.entries-head p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.week-card-head h3 {
  margin: 7px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.streak {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.streak strong {
  color: var(--accent);
  font-family: "Songti SC", "STSong", serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
}

.streak span {
  color: var(--ink-faint);
  font-size: 8px;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 20px;
}

.day-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.day-cell > span:first-child {
  color: var(--ink-faint);
  font-size: 8px;
}

.day-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-faint);
  font-family: "Songti SC", "STSong", serif;
  font-size: 10px;
}

.day-cell.has-entry .day-orb {
  border-color: color-mix(in srgb, var(--day-color) 58%, transparent);
  background: color-mix(in srgb, var(--day-color) 18%, rgba(255,255,255,.04));
  color: var(--day-color);
  box-shadow: 0 0 20px color-mix(in srgb, var(--day-color) 18%, transparent);
}

.day-cell.is-today .day-orb::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.entries-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 5px 11px;
}

.entries-head span {
  color: var(--ink-faint);
  font-size: 8px;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.entry-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 180ms ease, background 180ms ease;
}

.entry-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -38px;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: var(--entry-color);
  filter: blur(30px);
  opacity: 0.12;
}

.entry-card:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.07);
}

.entry-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--entry-color) 36%, transparent);
  border-radius: 17px;
  background: color-mix(in srgb, var(--entry-color) 9%, transparent);
}

.entry-date strong {
  color: var(--entry-color);
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.entry-date span {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.entry-copy {
  min-width: 0;
}

.entry-mood {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.entry-mood strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 500;
}

.entry-mood span {
  color: var(--entry-color);
  font-size: 8px;
}

.entry-note {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-arrow {
  color: rgba(255, 255, 255, 0.3);
  font-size: 17px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 42px 25px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  text-align: center;
}

.empty-orb {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 17px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}

.empty-orb::before,
.empty-orb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.empty-orb::before {
  inset: 12px;
  background: var(--accent);
  filter: blur(12px);
  opacity: 0.22;
}

.empty-orb::after {
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.empty-state strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 500;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.7;
}

.sheet-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: max(18px, var(--safe-top));
  background: rgba(2, 6, 9, 0.54);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.card-sheet {
  position: relative;
  width: min(100%, 540px);
  max-height: 95svh;
  padding: 24px 17px calc(17px + var(--safe-bottom));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
  border-radius: 32px 32px 0 0;
  background:
    radial-gradient(circle at 50% 0, var(--glow), transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-b) 88%, #111), var(--bg-a));
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.42);
  transform: translateY(102%);
  transition: transform 440ms cubic-bezier(.18,.78,.2,1);
  overscroll-behavior: contain;
}

.sheet-backdrop.is-open .card-sheet {
  transform: translateY(0);
}

.sheet-close {
  position: absolute;
  z-index: 2;
  top: 15px;
  right: 15px;
  font-size: 22px;
  line-height: 1;
}

.sheet-heading {
  padding: 0 50px 16px 4px;
}

.sheet-heading p {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.sheet-heading h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.34;
}

.card-preview-wrap {
  position: relative;
  width: min(79%, 340px);
  margin: 2px auto 17px;
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.34));
}

.card-preview-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 17px;
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
}

.long-press-hint {
  position: absolute;
  right: 0;
  bottom: -15px;
  left: 0;
  color: var(--ink-faint);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-align: center;
}

.ai-response {
  position: relative;
  width: 100%;
  margin: 16px auto 0;
  padding: 13px 14px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.ai-response::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -35px;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(35px);
  opacity: 0.1;
  pointer-events: none;
}

.ai-response-head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--accent) 88%, white);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.ai-orb {
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.ai-response.is-loading .ai-orb {
  animation: ai-orb-pulse 1s ease-in-out infinite;
}

.ai-status {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.ai-response p {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-response.is-error p {
  color: rgba(255, 255, 255, 0.44);
}

.ai-retry {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 8px;
  cursor: pointer;
}

.card-actions {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.primary-action,
.secondary-action {
  height: 49px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.primary-action {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
}

.delete-entry {
  display: block;
  margin: 13px auto 0;
  padding: 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  font-size: 8px;
  cursor: pointer;
}

.delete-entry[hidden] {
  display: none;
}

.install-tip {
  position: absolute;
  z-index: 40;
  right: 12px;
  bottom: calc(11px + var(--safe-bottom));
  left: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 34px 12px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(9, 17, 22, 0.91);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: tip-in 500ms 1.5s both;
}

.install-tip[hidden] {
  display: none;
}

.tip-icon {
  display: grid;
  place-items: center;
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  color: var(--accent);
  font-size: 18px;
}

.install-tip p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.install-tip strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.tip-close {
  position: absolute;
  top: 4px;
  right: 7px;
  width: 25px;
  height: 25px;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 17px;
  cursor: pointer;
}

.toast {
  position: absolute;
  z-index: 80;
  bottom: calc(29px + var(--safe-bottom));
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 14, 18, 0.9);
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes orbit-pulse {
  0%, 100% {
    opacity: 0.17;
  }
  50% {
    opacity: 0.48;
  }
}

@keyframes aurora-drift-one {
  from { transform: translate3d(-5%, -2%, 0) scale(0.95); }
  to { transform: translate3d(6%, 8%, 0) scale(1.08); }
}

@keyframes aurora-drift-two {
  from { transform: translate3d(-3%, 5%, 0) scale(1.05); }
  to { transform: translate3d(8%, -6%, 0) scale(0.9); }
}

@keyframes sound-wave {
  from { height: 4px; }
  to { height: 12px; }
}

@keyframes soft-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

@keyframes ai-orb-pulse {
  0%, 100% { transform: scale(0.82); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (max-height: 720px) {
  .hero {
    min-height: 250px;
    padding-top: 5px;
  }

  .weather-copy h1 {
    font-size: 60px;
  }

  .weather-poem {
    margin-top: 12px;
    font-size: 12px;
  }

  .dock {
    padding-top: 13px;
  }

  .mood-option {
    min-height: 66px;
  }

  .mood-symbol {
    height: 15px;
  }

  .mood-name {
    margin-top: 4px;
  }
}

@media (max-width: 360px) {
  .topbar,
  .page-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero {
    padding-right: 18px;
    padding-left: 18px;
  }

  .dock {
    margin-right: 7px;
    margin-left: 7px;
    padding-right: 11px;
    padding-left: 11px;
  }

  .mood-option {
    flex-basis: 65px;
  }

  .save-button {
    flex-basis: 102px;
    padding: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-date-row,
  .weather-copy,
  .dock,
  .install-tip {
    animation: none !important;
  }
}



/* iPad A16: use the extra canvas instead of stretching the phone layout. */
@media (min-width: 700px) {
  body {
    display: block;
    background: #03080b;
  }

  .app {
    width: 100%;
    max-width: 1100px;
    height: 100svh;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .topbar {
    padding: calc(var(--safe-top) + 20px) 30px 9px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .brand-copy small {
    font-size: 8px;
  }

  .round-action {
    width: 43px;
    height: 43px;
  }

  .home-view {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(350px, .78fr);
    align-items: stretch;
    gap: 24px;
    padding: 10px 24px calc(24px + var(--safe-bottom));
  }

  .hero {
    min-height: 0;
    padding: 26px 28px 0;
  }

  .weather-copy {
    max-width: 660px;
  }

  .weather-copy h1 {
    font-size: clamp(88px, 10.5vw, 126px);
  }

  .weather-poem {
    margin-top: 24px;
    font-size: 17px;
  }

  .touch-orbit {
    right: -6%;
    width: 35vw;
    max-width: 390px;
    opacity: .42;
  }

  .touch-prompt {
    right: 11px;
    bottom: 26px;
    font-size: 10px;
  }

  .dock {
    align-self: center;
    width: 100%;
    margin: 0;
    padding: 20px 17px 16px;
    border-radius: 34px;
  }

  .dock-head p {
    font-size: 15px;
  }

  .mood-option {
    flex-basis: 74px;
    min-height: 78px;
  }

  .mood-name {
    font-size: 13px;
  }

  .mood-weather {
    font-size: 9px;
  }

  .note-field input {
    height: 52px;
    font-size: 13px;
  }

  .save-button {
    height: 52px;
    flex-basis: 119px;
    font-size: 13px;
  }

  .page-header {
    padding-right: 30px;
    padding-left: 30px;
  }

  .journal-scroll {
    width: min(100%, 760px);
    margin: 0 auto;
    padding-right: 10px;
    padding-left: 10px;
  }

  .week-card {
    padding: 22px;
  }

  .day-orb {
    width: 36px;
    height: 36px;
  }

  .entry-card {
    padding: 16px;
  }

  .install-tip {
    right: 0;
    left: 0;
    width: min(470px, calc(100% - 40px));
    margin: 0 auto;
  }

  .sheet-backdrop {
    align-items: center;
    padding: 34px 24px;
  }

  .card-sheet {
    max-height: calc(100svh - 68px);
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    border-radius: 32px;
  }
}

@media (min-width: 1000px) and (orientation: landscape) {
  .home-view {
    grid-template-columns: minmax(0, 1.55fr) minmax(380px, .72fr);
    gap: 32px;
    padding-right: 34px;
    padding-left: 34px;
  }

  .weather-copy h1 {
    font-size: 126px;
  }

  .touch-orbit {
    width: 31vw;
  }
}

