:root {
  color-scheme: dark;
  --ink: #12120f;
  --ink-soft: #1d1c19;
  --paper: #fff9f3;
  --muted: #bdb5ac;
  --line: rgba(255, 249, 243, 0.17);
  --coral: #ff91a4;
  --mint: #a7efcc;
  --butter: #ffd98a;
  --sky: #9ed7ff;
  --panel: rgba(29, 28, 25, 0.9);
  --safe-top: max(20px, env(safe-area-inset-top));
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100svh;
  color: var(--paper);
  overflow-x: hidden;
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.background-photo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--ink);
  background-image: url("assets/river-background.jpg");
  background-repeat: no-repeat;
  background-position: center 68%;
  background-size: cover;
  pointer-events: none;
}

.background-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 13, 0.58);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  min-height: 100svh;
  margin: 0 auto;
  padding: var(--safe-top) clamp(20px, 5vw, 72px) var(--safe-bottom);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  position: relative;
  z-index: 2;
}

.profile-area {
  position: relative;
}

.time-area {
  position: relative;
}

.time-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.profile-prompt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.profile-prompt img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 2px solid var(--coral);
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(255, 145, 164, 0.12);
}

.profile-text {
  color: var(--coral);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.profile-text strong {
  margin-right: 0;
  color: inherit;
  font-weight: inherit;
}

.profile-prompt:hover .profile-text,
.profile-prompt[aria-expanded="true"] .profile-text {
  color: var(--paper);
}

.profile-note {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: min(250px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 145, 164, 0.35);
  border-radius: 8px;
  background: rgba(29, 28, 25, 0.97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
  animation: rise-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.profile-note::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 13px;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(255, 145, 164, 0.35);
  border-left: 1px solid rgba(255, 145, 164, 0.35);
  background: var(--ink-soft);
  transform: rotate(45deg);
}

.profile-note p {
  margin: 0 0 5px;
  color: var(--paper);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.profile-note span {
  color: var(--mint);
  font-size: 12px;
}

.profile-note-close {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(242, 240, 232, 0.07);
  color: var(--muted);
  cursor: pointer;
}

.profile-note-close:hover {
  color: var(--paper);
}

.profile-note-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.live-status {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.live-status:hover,
.live-status[aria-expanded="true"] {
  color: var(--paper);
}

.clock-entry {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 180ms ease;
}

.clock-entry:hover,
.clock-entry[aria-expanded="true"] {
  color: var(--mint);
}

.weather-current-icon {
  width: 20px;
  display: inline-grid;
  place-items: center;
  color: var(--butter);
  font-size: 15px;
  line-height: 1;
}

.weather-city-label,
#weather-temperature {
  color: var(--paper);
  font-size: 12px;
  font-weight: 650;
}

.status-separator {
  color: #71746c;
}

.time-greeting {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: min(340px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid rgba(255, 217, 138, 0.42);
  border-radius: 8px;
  background: rgba(29, 28, 25, 0.97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  animation: rise-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.time-greeting::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 24px;
  width: 8px;
  height: 8px;
  border-top: 1px solid rgba(255, 217, 138, 0.42);
  border-left: 1px solid rgba(255, 217, 138, 0.42);
  background: var(--ink-soft);
  transform: rotate(45deg);
}

.weather-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.weather-reminder-label {
  display: block;
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 700;
}

.time-greeting #time-greeting-text {
  margin: 0;
  color: var(--butter);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.weather-location {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.weather-refresh-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 249, 243, 0.07);
  color: var(--muted);
  cursor: pointer;
}

.weather-refresh-button:hover {
  color: var(--paper);
}

.weather-refresh-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.weather-refresh-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weather-refresh-button.is-loading svg {
  animation: weather-spin 900ms linear infinite;
}

.weather-now {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.weather-panel-icon {
  font-size: 36px;
  line-height: 1;
}

.weather-now-copy {
  display: grid;
  gap: 2px;
}

.weather-now-copy strong {
  color: var(--paper);
  font-size: 30px;
  line-height: 1;
}

.weather-now-copy span,
.weather-feels-like {
  color: var(--muted);
  font-size: 11px;
}

.weather-forecast {
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.weather-day {
  min-height: 42px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 249, 243, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.weather-day:last-child {
  border-bottom: 0;
}

.weather-day-condition {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper);
}

.weather-day-temperatures {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.weather-error {
  margin: 12px 0 0;
  color: #ff9787;
  font-size: 11px;
  line-height: 1.5;
}

.question-view,
.saved-view {
  width: 100%;
  display: grid;
  align-content: center;
  padding: 56px 0 40px;
}

.question-view {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  align-items: end;
  gap: clamp(48px, 9vw, 120px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 8em;
  font-family: "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(56px, 8vw, 112px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: 0;
}

.supporting-copy {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.answer-form {
  width: 100%;
}

.choice-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.quick-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0;
  background: transparent;
}

.quick-answer {
  min-width: 0;
  min-height: 112px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 243, 0.055);
  color: var(--paper);
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.quick-answer:hover {
  transform: translateY(-2px);
  border-color: transparent;
  color: var(--ink);
}

.quick-answer:nth-child(1):hover {
  background: var(--coral);
}

.quick-answer:nth-child(2):hover {
  background: var(--mint);
}

.quick-answer:nth-child(3):hover {
  background: var(--butter);
}

.quick-answer:nth-child(4):hover {
  background: var(--sky);
}

.quick-answer svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

.quick-answer:hover svg {
  transform: translateX(3px);
}

.choice-number {
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quick-answer:nth-child(2) .choice-number {
  color: var(--mint);
}

.quick-answer:nth-child(3) .choice-number {
  color: var(--butter);
}

.quick-answer:nth-child(4) .choice-number {
  color: var(--sky);
}

.quick-answer:hover .choice-number {
  color: var(--ink);
}

.home-secondary-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.mood-entry,
.message-board-entry,
.future-mail-entry {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(29, 28, 25, 0.58);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.mood-entry {
  border: 1px solid rgba(255, 217, 138, 0.35);
  color: var(--butter);
}

.message-board-entry {
  border: 1px solid rgba(158, 215, 255, 0.38);
  color: var(--sky);
}

.future-mail-entry {
  border: 1px solid rgba(167, 239, 204, 0.38);
  color: var(--mint);
}

.mood-entry:hover,
.message-board-entry:hover,
.future-mail-entry:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.mood-entry:hover {
  background: var(--butter);
}

.message-board-entry:hover {
  background: var(--sky);
}

.future-mail-entry:hover {
  background: var(--mint);
}

.mood-entry svg,
.message-board-entry svg,
.future-mail-entry svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mood-entry:hover,
.message-board-entry:hover,
.future-mail-entry:hover {
  color: var(--ink);
}

.send-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  cursor: pointer;
}

.send-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--ink);
  transition: transform 180ms ease, filter 180ms ease;
}

.send-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.send-button svg,
.icon-button svg,
.again-button svg,
.write-another-note-button svg,
.saved-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-note {
  margin: 10px 2px 0;
  color: #8f8981;
  font-size: 12px;
}

.meal-composer {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  padding: 9px 9px 9px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 243, 0.055);
  backdrop-filter: blur(18px);
}

.meal-composer:focus-within {
  border-color: rgba(169, 240, 200, 0.5);
  background: rgba(242, 240, 232, 0.09);
}

.meal-composer input {
  min-width: 0;
  height: 50px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--paper);
  font-size: 17px;
}

.meal-composer input::placeholder {
  color: #797c74;
}

.mood-composer {
  min-height: 300px;
  display: grid;
  grid-template-rows: auto;
  grid-auto-rows: auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 243, 0.055);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, background 180ms ease;
}

.mood-composer:focus-within {
  border-color: rgba(169, 240, 200, 0.5);
  background: rgba(242, 240, 232, 0.09);
}

.mood-composer.is-invalid {
  border-color: rgba(255, 145, 164, 0.72);
}

.mood-emoji-picker {
  min-width: 0;
  margin: 0;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.mood-emoji-picker legend {
  margin-bottom: 10px;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
}

.mood-emoji-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.mood-emoji-button {
  min-width: 0;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 249, 243, 0.045);
  font-size: 22px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mood-emoji-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 217, 138, 0.56);
  background: rgba(255, 217, 138, 0.12);
}

.mood-emoji-button[aria-pressed="true"] {
  transform: translateY(-1px);
  border-color: var(--butter);
  background: var(--butter);
}

.mood-composer textarea {
  width: 100%;
  min-height: 132px;
  padding: 0;
  border: 0;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--paper);
  font-size: 17px;
  line-height: 1.7;
}

.mood-composer textarea::placeholder {
  color: #797c74;
}

.mood-image-preview {
  position: relative;
  width: 100%;
  max-height: 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 15, 0.58);
}

.mood-image-preview img {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: contain;
}

.mood-image-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 18, 15, 0.82);
  color: var(--paper);
  cursor: pointer;
}

.mood-image-remove svg,
.mood-image-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mood-composer-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mood-composer-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mood-image-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(158, 215, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: var(--sky);
  font-size: 12px;
  cursor: pointer;
}

.mood-image-button:hover {
  background: var(--sky);
  color: var(--ink);
}

.mood-image-status {
  margin: -4px 0 0;
  color: #ff9787;
  font-size: 11px;
  line-height: 1.5;
}

.mood-image-status.is-success {
  color: var(--sky);
}

.mood-character-count {
  color: #8f8981;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.mood-save-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--butter);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.mood-save-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.mood-save-button:disabled,
.mood-image-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.mood-save-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.back-button svg,
.wechat-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  color: #71746c;
  font-size: 12px;
}

.site-footer button {
  padding: 8px 0 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

#entry-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 5px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
}

.saved-view {
  max-width: 720px;
}

.saved-content {
  animation: rise-in 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.saved-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--butter);
  color: var(--ink);
}

.saved-content h2 {
  margin: 0;
  font-family: "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: 0;
}

.saved-content h2.is-note {
  max-width: 18em;
  white-space: pre-wrap;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.4;
}

.saved-image {
  width: min(100%, 680px);
  max-height: 440px;
  display: block;
  margin: 24px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: rgba(18, 18, 15, 0.42);
}

.saved-time,
.saved-note {
  color: var(--muted);
}

.saved-time {
  margin: 18px 0 0;
  font-size: 13px;
}

.saved-note {
  margin: 48px 0 20px;
  line-height: 1.7;
}

.saved-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.wechat-button {
  width: fit-content;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0 18px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.wechat-fallback {
  margin: -8px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.again-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
}

.again-button svg,
.write-another-note-button svg {
  width: 18px;
  height: 18px;
}

.write-another-note-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--butter);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.write-another-note-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.history-panel,
.message-board-panel,
.future-mail-panel,
.timeline-panel {
  position: fixed;
  z-index: 4;
  top: 0;
  right: 0;
  width: min(440px, 100%);
  height: 100dvh;
  padding: var(--safe-top) 24px var(--safe-bottom);
  background: var(--panel);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(24px);
  animation: slide-in 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.message-board-panel,
.future-mail-panel {
  width: min(520px, 100%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.timeline-panel {
  width: min(620px, 100%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.message-board-gate,
.future-mail-gate,
.admin-delete-dialog {
  position: fixed;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(380px, calc(100% - 40px));
  padding: 22px;
  border: 1px solid rgba(158, 215, 255, 0.38);
  border-radius: 8px;
  background: rgba(29, 28, 25, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  transform: translate(-50%, -50%);
  animation: gate-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.future-mail-gate {
  border-color: rgba(167, 239, 204, 0.4);
}

.admin-delete-dialog {
  border-color: rgba(255, 145, 164, 0.42);
}

.message-board-gate-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.message-board-gate-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
}

.message-board-gate-form {
  display: grid;
  gap: 10px;
  padding-top: 18px;
}

.message-board-gate-form label {
  color: var(--muted);
  font-size: 11px;
}

.message-board-gate-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: rgba(255, 249, 243, 0.055);
  color: var(--paper);
}

.message-board-gate-form input:focus {
  border-color: rgba(169, 240, 200, 0.5);
}

.message-board-gate-form input::placeholder {
  color: #797c74;
}

.message-board-gate-form button[type="submit"] {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--sky);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.message-board-gate-form button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-board-gate-status {
  min-height: 18px;
  margin: 0;
  color: #ff9787;
  font-size: 11px;
  line-height: 1.5;
}

.history-header,
.message-board-header,
.admin-delete-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.history-header h2,
.message-board-header h2,
.admin-delete-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 550;
  letter-spacing: 0;
}

.message-board-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.message-board-header-actions .icon-button.is-loading svg {
  animation: weather-spin 900ms linear infinite;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(242, 240, 232, 0.08);
}

.history-list {
  height: calc(100% - 154px);
  overflow-y: auto;
  padding: 8px 0;
}

.history-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.history-item p {
  margin: 0 0 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.history-item-image {
  width: 100%;
  max-height: 200px;
  display: block;
  margin: 12px 0;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 249, 243, 0.05);
}

.history-item time,
.empty-history {
  color: var(--muted);
  font-size: 12px;
}

.empty-history {
  padding-top: 24px;
}

.clear-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 114, 92, 0.35);
  border-radius: 6px;
  background: transparent;
  color: #ff9787;
  cursor: pointer;
}

.message-board-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.message-board-list {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 0;
}

.message-board-state {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.message-board-message {
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 6px;
  color: #1b211f;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.message-board-message.is-yellow {
  background: #f3d77c;
}

.message-board-message.is-blue {
  background: #9ed7ff;
}

.message-board-message p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
}

.message-board-message-image {
  width: 100%;
  max-height: 260px;
  display: block;
  margin-top: 12px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(27, 33, 31, 0.08);
}

.message-board-message-audio {
  width: 100%;
  min-width: 0;
  display: block;
  margin-top: 12px;
}

.message-board-message time {
  color: rgba(27, 33, 31, 0.62);
  font-size: 10px;
}

.message-item-meta,
.future-letter-meta {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.content-delete-button {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(27, 33, 31, 0.08);
  color: rgba(27, 33, 31, 0.55);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.content-delete-button:hover {
  background: rgba(160, 40, 55, 0.14);
  color: #7a1f2c;
}

.content-delete-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-board-form {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.message-board-form > textarea {
  width: 100%;
  min-height: 110px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  resize: vertical;
  background: rgba(255, 249, 243, 0.055);
  color: var(--paper);
  line-height: 1.65;
}

.message-board-form > textarea:focus {
  border-color: rgba(169, 240, 200, 0.5);
}

.message-board-form textarea::placeholder,
.message-board-password input::placeholder {
  color: #797c74;
}

.message-board-attachments {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.message-board-image-preview,
.message-board-audio-preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 15, 0.45);
}

.message-board-image-preview {
  max-height: 220px;
  overflow: hidden;
}

.message-board-image-preview img {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
}

.message-board-audio-preview {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
}

.message-board-audio-preview audio {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.message-board-remove-media {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 18, 15, 0.82);
  color: var(--paper);
  cursor: pointer;
}

.message-board-audio-preview .message-board-remove-media {
  position: static;
}

.message-board-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.message-board-tool-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(158, 215, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: var(--sky);
  font-size: 12px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.message-board-tool-button:hover {
  background: var(--sky);
  color: var(--ink);
}

.message-board-tool-button.is-recording {
  border-color: rgba(255, 145, 164, 0.65);
  background: rgba(255, 145, 164, 0.16);
  color: var(--coral);
}

.message-board-tool-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.message-board-tool-button svg,
.message-board-remove-media svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-board-publish-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}

.message-board-password {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.message-board-password input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: rgba(255, 249, 243, 0.055);
  color: var(--paper);
}

.message-board-password input:focus {
  border-color: rgba(169, 240, 200, 0.5);
}

.message-board-submit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--mint);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.message-board-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.message-board-submit svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-board-form-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.message-board-form-status.is-error {
  color: #ff9787;
}

.message-board-form-status.is-success {
  color: var(--mint);
}

.future-mail-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.future-letter-list,
.timeline-list {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 0;
}

.future-letter {
  margin-bottom: 12px;
  border-radius: 6px;
  color: #1b211f;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.future-letter.is-yellow {
  background: #f3d77c;
}

.future-letter.is-blue {
  background: #9ed7ff;
}

.future-letter-sealed,
.future-letter-details {
  padding: 16px;
}

.future-letter-details summary,
.future-letter-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.future-letter-details summary {
  list-style: none;
  cursor: pointer;
}

.future-letter-details summary::-webkit-details-marker {
  display: none;
}

.future-letter-envelope {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(27, 33, 31, 0.09);
}

.future-letter-envelope svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.future-letter-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.future-letter-heading strong {
  font-size: 14px;
}

.future-letter-heading span,
.future-letter-sealed > p,
.future-letter-meta time {
  color: rgba(27, 33, 31, 0.62);
  font-size: 10px;
  line-height: 1.5;
}

.future-letter-countdown {
  color: rgba(27, 33, 31, 0.72);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.future-letter-content {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(27, 33, 31, 0.14);
  white-space: pre-wrap;
  line-height: 1.7;
}

.future-letter-form {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.future-letter-form > textarea,
.timeline-form textarea,
.timeline-form input,
.future-letter-fields input,
.admin-delete-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: rgba(255, 249, 243, 0.055);
  color: var(--paper);
}

.future-letter-form > textarea,
.timeline-form textarea {
  min-height: 104px;
  padding: 13px;
  resize: vertical;
  line-height: 1.65;
}

.future-letter-form > textarea:focus,
.timeline-form textarea:focus,
.timeline-form input:focus,
.future-letter-fields input:focus,
.admin-delete-form input:focus {
  border-color: rgba(167, 239, 204, 0.55);
}

.future-letter-fields,
.timeline-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.future-letter-fields label,
.timeline-form label,
.admin-delete-form label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.future-letter-fields input,
.timeline-form input,
.admin-delete-form input {
  height: 44px;
  padding: 0 12px;
}

.future-letter-submit,
.timeline-submit,
.admin-delete-form button[type="submit"] {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--mint);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.future-letter-submit {
  width: 100%;
  margin-top: 12px;
}

.future-letter-submit:disabled,
.timeline-submit:disabled,
.admin-delete-form button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.6;
}

.future-letter-submit svg,
.timeline-submit svg,
.admin-delete-form button[type="submit"] svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-form {
  max-height: 58dvh;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(167, 239, 204, 0.28);
  border-radius: 8px;
  background: rgba(18, 18, 15, 0.45);
}

.timeline-form-row {
  margin-top: 0;
}

.timeline-image-preview {
  position: relative;
  max-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.timeline-image-preview img {
  width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
}

.timeline-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timeline-list {
  position: relative;
  padding-left: 30px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 8px;
  width: 1px;
  background: var(--line);
}

.timeline-event {
  position: relative;
  padding: 8px 0 26px;
}

.timeline-event::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -27px;
  width: 11px;
  height: 11px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 1px rgba(255, 249, 243, 0.28);
}

.timeline-event:nth-child(3n + 2)::before {
  background: var(--mint);
}

.timeline-event:nth-child(3n + 3)::before {
  background: var(--sky);
}

.timeline-event-date {
  display: block;
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
}

.timeline-event h3 {
  margin: 7px 0 0;
  color: var(--paper);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
}

.timeline-event p {
  margin: 9px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.7;
}

.timeline-event-image {
  width: 100%;
  max-height: 300px;
  display: block;
  margin-top: 14px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(255, 249, 243, 0.05);
}

.timeline-event-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.timeline-event .content-delete-button {
  background: rgba(255, 249, 243, 0.07);
  color: var(--muted);
}

.timeline-event .content-delete-button:hover {
  background: rgba(255, 145, 164, 0.14);
  color: var(--coral);
}

.admin-delete-copy {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.admin-delete-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-delete-form button[type="submit"] {
  background: var(--coral);
}

.backdrop {
  position: fixed;
  z-index: 3;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
}

.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;
}

[hidden] {
  display: none !important;
}

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

@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes weather-spin {
  to { transform: rotate(360deg); }
}

@keyframes gate-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (max-width: 760px) {
  .background-photo {
    background-position: center center;
  }

  .page-shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .profile-prompt {
    gap: 7px;
  }

  .profile-prompt img {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .profile-text {
    font-size: 11px;
  }

  .question-view {
    grid-template-columns: 1fr;
    align-content: space-between;
    align-items: initial;
    gap: 48px;
    padding: 72px 0 32px;
  }

  h1 {
    max-width: none;
    font-size: 52px;
  }

  .supporting-copy {
    margin-top: 18px;
  }

  .quick-answer {
    min-height: 104px;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
  }

  .mood-emoji-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .home-secondary-actions button {
    justify-content: center;
  }

  .home-secondary-actions .future-mail-entry {
    grid-column: 1 / -1;
  }

  .message-board-panel,
  .future-mail-panel,
  .timeline-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .choice-number {
    grid-column: 1 / -1;
  }

  .saved-view {
    padding-top: 72px;
  }
}

@media (max-width: 420px) {
  .mood-composer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mood-composer-meta {
    justify-content: space-between;
  }

  .mood-save-button {
    justify-content: center;
  }

  .message-board-publish-row {
    grid-template-columns: 1fr;
  }

  .message-board-submit {
    justify-content: center;
  }

  .future-letter-fields,
  .timeline-form-row {
    grid-template-columns: 1fr;
  }

  .timeline-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .timeline-form-actions button {
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .weather-city-label,
  .status-separator {
    display: none;
  }
}

@media (max-height: 660px) and (max-width: 760px) {
  .question-view {
    gap: 24px;
    padding-top: 32px;
  }

  h1 {
    font-size: 44px;
  }

  .supporting-copy {
    margin-top: 12px;
  }
}

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