:root {
  color-scheme: light;
  --paper: #f4efe5;
  --paper-bright: #fbf8f1;
  --paper-deep: #e9e1d3;
  --ink: #2c3f41;
  --ink-soft: #506568;
  --muted: #7b8b8c;
  --line: rgba(53, 78, 81, 0.13);
  --sea: #77959d;
  --sea-light: #b8cdcf;
  --sea-deep: #355861;
  --future: #efe4d3;
  --future-line: #d2b790;
  --past: #dfe6e4;
  --past-line: #aab9b8;
  --rose: #aa7669;
  --danger: #9b5d54;
  --shadow: 0 28px 80px rgba(49, 70, 72, 0.13);
  --shadow-soft: 0 12px 38px rgba(58, 78, 79, 0.09);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #152427;
    --paper-bright: #1c2d30;
    --paper-deep: #102023;
    --ink: #edf1eb;
    --ink-soft: #c0ceca;
    --muted: #91a7a4;
    --line: rgba(209, 226, 219, 0.13);
    --sea: #55757e;
    --sea-light: #6f9299;
    --sea-deep: #102c33;
    --future: #2a3129;
    --future-line: #8f7961;
    --past: #253436;
    --past-line: #536867;
    --rose: #d4a69a;
    --danger: #d5988c;
    --shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button,
a,
input,
textarea,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

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

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

::selection {
  color: var(--paper-bright);
  background: var(--sea-deep);
}

[hidden] {
  display: none !important;
}

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

.atmosphere {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -15%, rgba(255, 255, 255, 0.92), transparent 44%),
    linear-gradient(172deg, var(--paper-bright) 0%, var(--paper) 48%, #dce7e4 100%);
}

.atmosphere::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 46vh;
  content: "";
  background:
    radial-gradient(ellipse at 50% 108%, rgba(88, 124, 130, 0.27), transparent 63%),
    linear-gradient(to top, rgba(108, 144, 148, 0.16), transparent);
}

.glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.44;
  animation: breathe 15s ease-in-out infinite alternate;
}

.glow-one {
  top: -24vw;
  left: -10vw;
  background: rgba(255, 240, 211, 0.7);
}

.glow-two {
  right: -22vw;
  bottom: -28vw;
  background: rgba(80, 126, 139, 0.25);
  animation-delay: -7s;
}

.horizon {
  position: absolute;
  right: -8%;
  bottom: -19%;
  left: -8%;
  height: 43%;
  border: 1px solid rgba(77, 110, 115, 0.11);
  border-radius: 50% 50% 0 0;
  transform: rotate(-1.4deg);
}

.horizon-one {
  bottom: -14%;
  background: rgba(120, 151, 155, 0.08);
}

.horizon-two {
  right: -16%;
  bottom: -24%;
  left: -16%;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(59, 95, 102, 0.035);
  transform: rotate(1deg);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  .atmosphere {
    background:
      radial-gradient(circle at 50% -10%, rgba(94, 131, 134, 0.16), transparent 44%),
      linear-gradient(172deg, #192c2f 0%, #122023 55%, #0e1c20 100%);
  }

  .grain {
    opacity: 0.09;
    mix-blend-mode: screen;
  }
}

@keyframes breathe {
  from {
    transform: translate3d(0, 0, 0) scale(0.96);
    opacity: 0.33;
  }
  to {
    transform: translate3d(2vw, 1vw, 0) scale(1.07);
    opacity: 0.52;
  }
}

.boot-screen {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  color: var(--ink-soft);
  background: var(--paper);
  transition:
    opacity 0.7s var(--ease),
    visibility 0.7s;
}

.boot-screen.is-leaving {
  visibility: hidden;
  opacity: 0;
}

.boot-screen p {
  margin: 0;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.22em;
}

.boot-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 24px;
  animation: mark-float 2.8s ease-in-out infinite;
}

@keyframes mark-float {
  50% {
    transform: translateY(-5px);
    box-shadow: 0 16px 28px rgba(57, 85, 89, 0.08);
  }
}

.entry-screen {
  display: grid;
  min-height: 100svh;
  padding: 32px 20px;
  place-items: center;
}

.entry-card {
  position: relative;
  width: min(100%, 440px);
  padding: 50px 42px 38px;
  overflow: hidden;
  border-radius: 4px 26px 5px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: card-arrive 0.8s var(--ease) both;
}

.entry-card::before,
.entry-card::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.entry-card::before {
  top: 12px;
  right: 12px;
  bottom: 12px;
  left: 12px;
  border: 1px solid var(--line);
  border-radius: 2px 18px 3px 16px;
}

.entry-card::after {
  top: -30px;
  left: 50%;
  width: 150px;
  height: 62px;
  background: rgba(212, 195, 165, 0.24);
  transform: translateX(-50%) rotate(-2deg);
}

@keyframes card-arrive {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
}

.paper-panel {
  border: 1px solid rgba(255, 255, 255, 0.43);
  background:
    linear-gradient(rgba(255, 255, 255, 0.33), rgba(255, 255, 255, 0.13)),
    var(--paper-bright);
}

.entry-symbol {
  display: flex;
  width: 72px;
  height: 34px;
  margin: 0 auto 25px;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.entry-symbol span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--sea);
}

.entry-symbol span:first-child::after,
.entry-symbol span:last-child::before {
  display: block;
  width: 5px;
  height: 5px;
  margin: -2px auto 0;
  border-radius: 50%;
  background: var(--sea);
  content: "";
}

.entry-symbol span:first-child {
  transform: rotate(8deg);
}

.entry-symbol span:last-child {
  transform: rotate(-8deg);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.entry-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 13vw, 70px);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.15;
}

.entry-copy {
  margin: 13px 0 34px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.045em;
}

.entry-form {
  position: relative;
  z-index: 1;
  text-align: left;
}

.field {
  display: grid;
  gap: 9px;
}

.field + .field {
  margin-top: 18px;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.field-label small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  background: rgba(255, 255, 255, 0.42);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

input,
select {
  height: 48px;
  padding: 0 15px;
}

textarea {
  min-height: 120px;
  padding: 13px 15px;
  line-height: 1.8;
  resize: vertical;
}

select {
  padding-right: 34px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 13px) 21px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

input:focus,
textarea:focus,
select:focus {
  border-color: color-mix(in srgb, var(--sea) 62%, transparent);
  background-color: var(--paper-bright);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sea) 10%, transparent);
}

.field-quiet input,
.field-quiet textarea {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.field-quiet input:focus,
.field-quiet textarea:focus {
  border-color: var(--sea);
  box-shadow: none;
}

.form-error {
  min-height: 21px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.035em;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s ease,
    background 0.2s ease,
    opacity 0.2s;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  color: #f9f7ee;
  background: var(--sea-deep);
  box-shadow: 0 8px 22px rgba(52, 87, 94, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--sea-deep) 88%, #000);
  box-shadow: 0 10px 28px rgba(52, 87, 94, 0.24);
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
}

.button-quiet:hover:not(:disabled) {
  background: color-mix(in srgb, var(--paper-deep) 50%, transparent);
}

.button-danger {
  color: #fff7f2;
  background: var(--danger);
}

.button-wide {
  width: 100%;
  justify-content: space-between;
  padding-inline: 22px;
}

.entry-form .button {
  margin-top: 9px;
}

.local-hint,
.privacy-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.local-hint code {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--ink-soft);
  background: var(--paper-deep);
  font-size: 10px;
}

.privacy-note {
  position: relative;
  z-index: 1;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.identity-card {
  width: min(100%, 520px);
  padding: 46px;
  border-radius: 24px 4px 20px 5px;
  box-shadow: var(--shadow);
  animation: card-arrive 0.7s var(--ease) both;
}

.identity-card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 500;
}

.identity-copy {
  margin: 11px 0 30px;
  color: var(--ink-soft);
  font-size: 13px;
}

.identity-options {
  display: grid;
  gap: 12px;
}

.identity-option,
.settings-identity button {
  display: flex;
  width: 100%;
  min-height: 78px;
  padding: 13px 17px;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
  background: rgba(255, 255, 255, 0.25);
  transition:
    transform 0.25s var(--ease),
    border-color 0.2s,
    background 0.2s;
}

.identity-option:hover,
.settings-identity button:hover {
  border-color: color-mix(in srgb, var(--sea) 55%, transparent);
  background: var(--paper-bright);
  transform: translateY(-2px);
}

.identity-option > span:last-child,
.settings-identity button > span:last-child {
  display: grid;
  gap: 2px;
}

.identity-option strong,
.settings-identity strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.identity-option small,
.settings-identity small {
  color: var(--muted);
  font-size: 11px;
}

.person-seal {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50% 48% 52% 46%;
  font-family: var(--serif);
  font-size: 17px;
  transform: rotate(-4deg);
}

.seal-xiaoxu {
  color: #7d8f7c;
  background: rgba(209, 224, 205, 0.4);
}

.seal-tongtong {
  color: #866f64;
  background: rgba(232, 211, 197, 0.4);
  transform: rotate(4deg);
}

.text-button {
  padding: 7px 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 32%, transparent);
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--ink);
}

#identity-back {
  margin-top: 22px;
}

.app {
  min-height: 100vh;
  padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  width: min(100% - 40px, 1220px);
  min-height: 82px;
  margin: 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition:
    background 0.3s,
    border-color 0.3s,
    backdrop-filter 0.3s;
}

.site-header.is-scrolled,
body:not(.is-cover) .site-header {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--paper-bright) 78%, transparent);
  backdrop-filter: blur(18px);
}

.brand-button {
  display: inline-flex;
  width: max-content;
  padding: 5px;
  align-items: center;
  gap: 10px;
  background: transparent;
}

.brand-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 13px;
}

.brand-text {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.12em;
}

.desktop-nav {
  display: flex;
  padding: 4px;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper-bright) 58%, transparent);
}

.desktop-nav button {
  min-width: 70px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  transition:
    color 0.2s,
    background 0.2s;
}

.desktop-nav button:hover,
.desktop-nav button.is-active {
  color: var(--ink);
  background: var(--paper-bright);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.now-capsule {
  display: flex;
  min-height: 36px;
  max-width: 310px;
  padding: 7px 13px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper-bright) 60%, transparent);
  transition:
    background 0.2s,
    border-color 0.2s;
}

.now-capsule:hover {
  border-color: color-mix(in srgb, var(--sea) 52%, transparent);
  background: var(--paper-bright);
}

.now-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #91a780;
}

.now-pulse::after {
  position: absolute;
  inset: -4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #91a780;
  content: "";
  opacity: 0.3;
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  65%,
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.now-summary {
  overflow: hidden;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper-bright) 58%, transparent);
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

#page-root {
  position: relative;
}

.page {
  width: min(100% - 40px, 1120px);
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  animation: page-in 0.55s var(--ease) both;
}

@keyframes page-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.cover-page {
  display: grid;
  width: 100%;
  min-height: calc(100svh - 82px);
  padding: 2vh max(24px, calc((100vw - 1120px) / 2)) 30px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.94fr);
  align-items: center;
  gap: clamp(38px, 8vw, 120px);
}

.cover-content {
  position: relative;
  padding: 60px 0;
}

.cover-content::before {
  position: absolute;
  top: 50%;
  left: -86px;
  width: 290px;
  height: 290px;
  border: 1px solid color-mix(in srgb, var(--sea) 14%, transparent);
  border-radius: 50%;
  content: "";
  transform: translateY(-48%);
}

.cover-names {
  margin: 0 0 22px 5px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.24em;
}

.cover-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(82px, 11vw, 148px);
  font-weight: 400;
  letter-spacing: 0.11em;
  line-height: 0.94;
}

.cover-rule {
  display: flex;
  width: min(320px, 70%);
  margin: 32px 0 26px;
  align-items: center;
  gap: 12px;
}

.cover-rule span {
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--sea) 55%, transparent));
}

.cover-rule span:last-child {
  background: linear-gradient(to left, transparent, color-mix(in srgb, var(--sea) 55%, transparent));
}

.cover-rule i {
  width: 6px;
  height: 6px;
  border: 1px solid var(--sea);
  border-radius: 50%;
}

.cover-main {
  max-width: 450px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(16px, 1.7vw, 21px);
  letter-spacing: 0.06em;
  line-height: 1.9;
}

.cover-season {
  margin: 42px 0 0 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.22em;
  writing-mode: vertical-rl;
}

.cover-modules {
  padding: 20px 0;
}

.cover-lead {
  margin: 0 0 18px 3px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.025em;
}

.cover-cards {
  display: grid;
  gap: 15px;
}

.cover-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 144px;
  padding: 25px 27px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 4px 24px 4px 18px;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s ease;
}

.cover-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px) rotate(-0.3deg);
}

.cover-card-letter {
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.41), transparent 56%),
    #ebe3d6;
}

.cover-card-time {
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.3), transparent 56%),
    #dbe5e3;
}

.cover-card-no {
  position: absolute;
  top: 18px;
  right: 22px;
  color: color-mix(in srgb, var(--ink) 35%, transparent);
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.cover-card-kind {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.cover-card strong {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: 0.045em;
}

.cover-card-arrow {
  position: absolute;
  right: 25px;
  bottom: 22px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  border-radius: 50%;
  font-size: 13px;
  transition: transform 0.3s var(--ease);
}

.cover-card:hover .cover-card-arrow {
  transform: translate(2px, -2px);
}

.cover-card-wave {
  position: absolute;
  right: -16%;
  bottom: -64%;
  width: 95%;
  height: 92%;
  border: 1px solid rgba(89, 124, 127, 0.12);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.cover-now {
  display: flex;
  width: 100%;
  margin-top: 20px;
  padding: 12px 5px 4px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.cover-now strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.015em;
}

.reveal {
  animation: reveal-up 0.8s var(--ease) both;
}

.reveal:nth-child(2) {
  animation-delay: 0.07s;
}

.reveal:nth-child(3) {
  animation-delay: 0.13s;
}

.reveal:nth-child(4) {
  animation-delay: 0.18s;
}

.reveal:nth-child(5) {
  animation-delay: 0.23s;
}

@keyframes reveal-up {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}

.page-heading {
  display: flex;
  min-height: 210px;
  padding: 56px 2px 39px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 74px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.page-heading > div > p:last-child {
  max-width: 540px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.035em;
}

.page-heading .button {
  margin-bottom: 4px;
  flex: 0 0 auto;
}

.section-meta {
  display: flex;
  padding: 23px 2px;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.meta-tide {
  width: 80px;
  height: 1px;
  background: linear-gradient(to right, var(--line), transparent);
}

.letter-grid {
  display: grid;
  padding-bottom: 70px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.letter-card {
  position: relative;
  display: flex;
  min-height: 300px;
  padding: 34px 32px 27px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3px 21px 4px 16px;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent 55%),
    var(--paper-bright);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s ease;
}

.letter-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 1px;
  background: color-mix(in srgb, var(--rose) 13%, transparent);
  content: "";
}

.letter-card:nth-child(3n + 2) {
  transform: translateY(18px);
}

.letter-card:nth-child(3n + 2):hover {
  transform: translateY(13px);
}

.letter-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.letter-card.is-mine {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.38), transparent 55%),
    color-mix(in srgb, var(--paper-bright) 92%, #d9e7dc);
}

.letter-card-top {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.letter-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.letter-author .person-seal {
  width: 33px;
  height: 33px;
  flex-basis: 33px;
  font-size: 12px;
}

.letter-author-copy {
  display: grid;
  gap: 0;
}

.letter-author-copy strong {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.letter-author-copy time {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.letter-stamp {
  display: grid;
  width: 42px;
  height: 48px;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--sea) 38%, transparent);
  color: color-mix(in srgb, var(--sea) 68%, transparent);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.8;
  transform: rotate(2deg);
}

.letter-title {
  margin: 27px 0 10px;
  font-family: var(--serif);
  font-size: clamp(21px, 2.3vw, 27px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

.letter-excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.03em;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.letter-photo-stack {
  display: grid;
  margin-top: 20px;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.letter-photo-stack img {
  width: 100%;
  height: 78px;
  border-radius: 4px 11px 4px 8px;
  object-fit: cover;
  filter: saturate(0.84);
}

.letter-card-footer {
  display: flex;
  margin-top: auto;
  padding-top: 24px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.comment-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comment-count svg {
  width: 13px;
  height: 13px;
}

.letter-open-hint {
  display: flex;
  align-items: center;
  gap: 5px;
}

.empty-state {
  display: grid;
  min-height: 310px;
  padding: 50px 20px;
  place-content: center;
  justify-items: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: var(--radius-xl);
  text-align: center;
  background: color-mix(in srgb, var(--paper-bright) 32%, transparent);
}

.empty-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--sea);
  font-family: var(--serif);
  font-size: 18px;
}

.empty-state h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.empty-state p {
  margin: 7px 0 21px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-heading {
  min-height: 210px;
}

.timeline-filters {
  position: sticky;
  z-index: 8;
  top: 82px;
  display: flex;
  padding: 16px 0;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}

.filter-group {
  display: flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.filter-chip {
  min-height: 31px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  transition:
    color 0.2s,
    background 0.2s;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: var(--ink);
  background: var(--paper-bright);
}

.select-wrap select {
  width: auto;
  min-width: 114px;
  height: 39px;
  padding: 0 34px 0 13px;
  border-radius: 999px;
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  font-size: 10px;
}

.filter-reset {
  margin-left: auto;
  white-space: nowrap;
}

.timeline-sections {
  padding: 40px 0 110px;
}

.timeline-section + .timeline-section {
  margin-top: 10px;
}

.timeline-section-head {
  display: flex;
  margin-bottom: 24px;
  padding-left: 92px;
  align-items: baseline;
  gap: 13px;
}

.timeline-section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.timeline-section-head p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 11px;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 20px;
}

.timeline-list::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 58px;
  width: 1px;
  background: linear-gradient(to bottom, var(--line), color-mix(in srgb, var(--sea) 30%, transparent), var(--line));
  content: "";
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  animation: reveal-up 0.5s var(--ease) both;
}

.timeline-entry::before {
  position: absolute;
  z-index: 1;
  top: 31px;
  left: 54px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--sea);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sea) 45%, transparent);
  content: "";
}

.timeline-date {
  padding-top: 21px;
  color: var(--muted);
  text-align: right;
}

.timeline-date strong {
  display: block;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
}

.timeline-date span {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.timeline-card {
  position: relative;
  padding: 27px 31px 26px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 3px 18px 4px 13px;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.24), transparent 56%),
    var(--past);
  box-shadow: var(--shadow-soft);
}

.timeline-section.future .timeline-card {
  border-color: color-mix(in srgb, var(--future-line) 25%, transparent);
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.3), transparent 56%),
    var(--future);
}

.timeline-section.future .timeline-entry::before {
  background: var(--future-line);
}

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

.tag-pill {
  display: inline-flex;
  min-height: 26px;
  padding: 4px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.22);
  font-size: 9px;
  letter-spacing: 0.045em;
}

.countdown {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.timeline-card h3 {
  margin: 16px 0 7px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 27px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.timeline-content {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.025em;
  white-space: pre-wrap;
}

.timeline-content.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.expand-content {
  margin-top: 6px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.entry-images {
  display: grid;
  margin-top: 19px;
  overflow: hidden;
  border-radius: 3px 12px 3px 9px;
  gap: 5px;
}

.entry-images.count-1 {
  grid-template-columns: 1fr;
}

.entry-images.count-2,
.entry-images.count-3 {
  grid-template-columns: repeat(2, 1fr);
}

.entry-images button {
  position: relative;
  min-height: 120px;
  padding: 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.entry-images.count-1 button {
  max-height: 340px;
}

.entry-images.count-3 button:first-child {
  grid-row: span 2;
}

.entry-images img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  max-height: 340px;
  object-fit: cover;
  filter: saturate(0.86);
  transition:
    transform 0.45s var(--ease),
    filter 0.3s;
}

.entry-images button:hover img {
  filter: saturate(0.96);
  transform: scale(1.025);
}

.timeline-footer {
  display: flex;
  margin-top: 20px;
  padding-top: 14px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.entry-author {
  display: flex;
  align-items: center;
  gap: 7px;
}

.entry-author .person-seal {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  font-size: 8px;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 11px;
}

.entry-action {
  padding: 2px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
}

.entry-action:hover {
  color: var(--ink);
}

.entry-action.danger:hover {
  color: var(--danger);
}

.mobile-add {
  position: fixed;
  z-index: 18;
  right: 22px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: none;
  min-width: 74px;
  height: 46px;
  padding: 0 15px;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  color: #f8f6ee;
  background: var(--sea-deep);
  box-shadow: 0 12px 30px rgba(39, 66, 71, 0.24);
}

.mobile-add span {
  font-size: 19px;
}

.mobile-add small {
  font-size: 10px;
}

.bottom-nav {
  display: none;
}

.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px;
  border: 0;
  background: transparent;
}

.modal[open] {
  display: grid;
  place-items: center;
}

.modal::backdrop,
.lightbox::backdrop {
  background: rgba(23, 36, 38, 0.46);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(100%, 680px);
  max-height: min(880px, calc(100svh - 48px));
  padding: 32px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 5px 25px 4px 19px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.25), transparent 50%),
    var(--paper-bright);
  box-shadow: var(--shadow);
  animation: modal-in 0.4s var(--ease) both;
  overscroll-behavior: contain;
}

@keyframes modal-in {
  from {
    transform: translateY(16px) scale(0.985);
    opacity: 0;
  }
}

.modal-head {
  display: flex;
  margin-bottom: 25px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.35;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

.composer-card {
  width: min(100%, 800px);
}

.composer-paper {
  position: relative;
  padding: 4px 26px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 36px,
      color-mix(in srgb, var(--line) 50%, transparent) 37px
    );
}

.letter-body-field textarea {
  min-height: 290px;
  padding-top: 14px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.035em;
  line-height: 2.35;
}

.image-uploader {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
}

.image-add-button {
  display: flex;
  min-height: 46px;
  padding: 9px 14px;
  align-items: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--sea) 36%, transparent);
  border-radius: 10px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper-deep) 28%, transparent);
  font-size: 11px;
}

.image-add-button:hover {
  border-color: var(--sea);
  background: color-mix(in srgb, var(--sea) 7%, transparent);
}

.image-add-button span {
  font-size: 17px;
}

.image-add-button small {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.image-previews {
  display: grid;
  margin-top: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.image-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px 12px 4px 9px;
  background: var(--paper-deep);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(30, 42, 43, 0.7);
  font-size: 14px;
}

.modal-actions {
  display: flex;
  padding-top: 22px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.draft-state {
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid + .field {
  margin-top: 18px;
}

.letter-detail-card {
  width: min(100%, 800px);
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.letter-detail-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-color: color-mix(in srgb, var(--sea) 62%, transparent) transparent;
  scrollbar-width: thin;
}

.letter-detail-head {
  padding: 30px 42px 28px;
  border-bottom: 1px solid var(--line);
}

.letter-detail-toolbar {
  display: flex;
  padding: 20px 42px 17px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-bright) 94%, transparent);
}

.letter-detail-toolbar .letter-author {
  font-size: 12px;
}

.letter-detail-toolbar .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.letter-detail-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.42;
}

.letter-detail-date {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.letter-detail-body {
  padding: 34px 42px;
}

.letter-copy {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.035em;
  line-height: 2.25;
  white-space: pre-wrap;
}

.letter-detail-images {
  margin: 26px 0 0;
}

.letter-comments {
  padding: 29px 42px 34px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-deep) 35%, transparent);
}

.letter-comments h3 {
  margin: 0 0 21px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.comment-list {
  display: grid;
  gap: 16px;
}

.comment {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}

.comment .person-seal {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 9px;
}

.comment-bubble {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 2px 11px 11px 11px;
  background: color-mix(in srgb, var(--paper-bright) 68%, transparent);
}

.comment-meta {
  display: flex;
  margin-bottom: 4px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.comment-meta strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.comment-content {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.comment-actions {
  display: flex;
  margin-top: 5px;
  gap: 10px;
}

.comment-actions button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
}

.comment-form {
  display: flex;
  margin: 0;
  align-items: flex-end;
  gap: 8px;
}

.letter-comment-dock {
  padding: 14px 42px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-bright) 97%, transparent);
  box-shadow: 0 -12px 28px rgba(49, 70, 72, 0.06);
}

.comment-form textarea {
  min-height: 48px;
  max-height: 130px;
  padding: 11px 13px;
  resize: none;
  flex: 1;
}

.comment-form .button {
  min-height: 46px;
  padding-inline: 17px;
}

.mood-card {
  width: min(100%, 620px);
}

.mood-current-grid {
  display: grid;
  margin-bottom: 26px;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mood-current {
  position: relative;
  min-height: 141px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px 17px 4px 13px;
  background: var(--paper-deep);
}

.mood-current::after {
  position: absolute;
  right: -22px;
  bottom: -43px;
  width: 115px;
  height: 115px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  content: "";
}

.mood-current[data-mood="miss"] {
  background: color-mix(in srgb, var(--paper-bright) 75%, #c9d9e4);
}

.mood-current[data-mood="happy"] {
  background: color-mix(in srgb, var(--paper-bright) 75%, #eadcb6);
}

.mood-current[data-mood="calm"] {
  background: color-mix(in srgb, var(--paper-bright) 75%, #cfdfd5);
}

.mood-current[data-mood="tired"] {
  background: color-mix(in srgb, var(--paper-bright) 75%, #d9d5cd);
}

.mood-current[data-mood="low"] {
  background: color-mix(in srgb, var(--paper-bright) 75%, #cbd4de);
}

.mood-current[data-mood="hug"] {
  background: color-mix(in srgb, var(--paper-bright) 75%, #ead5d0);
}

.mood-person {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.mood-person .person-seal {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  font-size: 9px;
}

.mood-main {
  display: flex;
  margin-top: 18px;
  align-items: baseline;
  gap: 8px;
}

.mood-main i {
  color: var(--sea);
  font-family: var(--serif);
  font-size: 19px;
  font-style: normal;
}

.mood-main strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

.mood-note {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 11px;
}

.mood-empty {
  display: grid;
  min-height: 141px;
  padding: 20px;
  place-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  font-family: var(--serif);
  font-size: 12px;
}

.mood-editor {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--paper-deep) 48%, transparent);
}

.mood-editor-head {
  display: flex;
  margin-bottom: 17px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mood-editor-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.mood-editor-head span {
  color: var(--muted);
  font-size: 9px;
}

.mood-options {
  display: flex;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 7px;
}

.mood-options label {
  cursor: pointer;
}

.mood-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mood-options span {
  display: inline-flex;
  min-height: 35px;
  padding: 0 12px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper-bright) 50%, transparent);
  font-size: 10px;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}

.mood-options i {
  font-family: var(--serif);
  font-size: 13px;
  font-style: normal;
}

.mood-options input:checked + span {
  border-color: color-mix(in srgb, var(--sea) 48%, transparent);
  color: var(--ink);
  background: var(--paper-bright);
}

.mood-options input:focus-visible + span {
  outline: 2px solid var(--sea);
  outline-offset: 2px;
}

.mood-history {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.mood-history summary {
  padding: 15px 0 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}

.mood-history summary::-webkit-details-marker {
  display: none;
}

.mood-history summary::after {
  float: right;
  content: "＋";
}

.mood-history[open] summary::after {
  content: "−";
}

.mood-history-row {
  display: flex;
  padding: 10px 0;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  color: var(--ink-soft);
  font-size: 10px;
}

.mood-history-row time {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

.mood-history-row button {
  padding: 2px 4px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
}

.settings-card {
  width: min(100%, 580px);
}

.settings-section {
  padding: 23px 0;
  border-top: 1px solid var(--line);
}

.settings-section h3 {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.settings-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.settings-identity {
  display: grid;
  margin-top: 16px;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.settings-identity button {
  min-height: 66px;
  padding: 10px 12px;
}

.settings-identity button.is-current {
  border-color: color-mix(in srgb, var(--sea) 55%, transparent);
  background: color-mix(in srgb, var(--sea) 8%, var(--paper-bright));
}

.settings-identity .person-seal {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  font-size: 13px;
}

.settings-footer {
  display: flex;
  padding-top: 18px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.confirm-card {
  width: min(100%, 430px);
  text-align: center;
}

.confirm-card h2 {
  margin: 0 0 9px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
}

.confirm-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.confirm-card .modal-actions {
  margin-top: 13px;
  justify-content: center;
}

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 4vh 5vw;
  border: 0;
  color: #f7f2e8;
  background: rgba(14, 22, 24, 0.94);
}

.lightbox[open] {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
}

.lightbox figure {
  display: grid;
  height: 100%;
  margin: 0;
  place-content: center;
  justify-items: center;
}

.lightbox img {
  max-width: min(100%, 1300px);
  max-height: 82vh;
  border-radius: 3px 14px 3px 10px;
  object-fit: contain;
  box-shadow: 0 25px 90px rgba(0, 0, 0, 0.34);
}

.lightbox figcaption {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 20px;
  right: 24px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 25px;
}

.lightbox-nav {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--serif);
  font-size: 31px;
}

.lightbox-nav[hidden] {
  visibility: hidden;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  min-height: 50px;
  padding: 12px 16px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 3px 13px 3px 10px;
  color: #f8f4eb;
  background: color-mix(in srgb, var(--sea-deep) 92%, #16292c);
  box-shadow: 0 16px 48px rgba(22, 41, 44, 0.24);
  font-size: 11px;
  animation: toast-in 0.4s var(--ease) both;
}

.toast.is-error {
  background: color-mix(in srgb, var(--danger) 92%, #4c2925);
}

.toast.is-leaving {
  animation: toast-out 0.3s ease both;
}

@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(6px);
    opacity: 0;
  }
}

.saving .button-primary {
  pointer-events: none;
}

.saving .button-primary::after {
  width: 12px;
  height: 12px;
  border: 1px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 0.7s linear infinite;
}

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

@media (max-width: 980px) {
  .cover-page {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
    gap: 45px;
  }

  .cover-title {
    font-size: clamp(72px, 12vw, 112px);
  }

  .letter-grid {
    gap: 17px;
  }

  .letter-card {
    padding: 30px 27px 24px;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .site-header {
    position: sticky;
    width: calc(100% - 28px);
    min-height: 62px;
    grid-template-columns: auto 1fr;
  }

  .desktop-nav {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .brand-symbol {
    width: 29px;
    height: 29px;
    font-size: 12px;
  }

  .brand-text {
    font-size: 15px;
  }

  .now-capsule {
    max-width: min(49vw, 210px);
    min-height: 32px;
    padding: 6px 10px;
  }

  .now-summary {
    font-size: 9px;
  }

  .icon-button {
    width: 32px;
    height: 32px;
  }

  .page {
    width: calc(100% - 28px);
  }

  .cover-page {
    display: block;
    min-height: calc(100svh - 62px);
    padding: clamp(35px, 8vh, 72px) 14px 110px;
  }

  .cover-content {
    padding: 0;
  }

  .cover-content::before {
    top: 45%;
    left: 50%;
    width: 230px;
    height: 230px;
    transform: translate(-50%, -50%);
  }

  .cover-names {
    margin-bottom: 17px;
    font-size: 11px;
    text-align: center;
  }

  .cover-title {
    font-size: clamp(68px, 25vw, 104px);
    text-align: center;
  }

  .cover-rule {
    display: none;
  }

  .cover-main {
    max-width: 330px;
    margin: 22px auto 0;
    font-size: 14px;
    text-align: center;
  }

  .cover-season {
    position: absolute;
    top: 31%;
    right: 2px;
    margin: 0;
    font-size: 8px;
  }

  .cover-modules {
    padding: 39px 0 0;
  }

  .cover-lead {
    margin-bottom: 13px;
    text-align: center;
    font-size: 10px;
  }

  .cover-cards {
    gap: 10px;
  }

  .cover-card {
    min-height: 110px;
    padding: 20px 21px;
  }

  .cover-card strong {
    font-size: 19px;
  }

  .cover-card-kind {
    margin-bottom: 8px;
  }

  .cover-card-arrow {
    right: 19px;
    bottom: 17px;
    width: 27px;
    height: 27px;
  }

  .cover-now {
    flex-direction: column;
    margin-top: 14px;
    gap: 2px;
  }

  .page-heading {
    min-height: 164px;
    padding: 36px 2px 28px;
    align-items: flex-end;
  }

  .page-heading h1 {
    font-size: 46px;
  }

  .page-heading > div > p:last-child {
    max-width: 290px;
    margin-top: 7px;
    font-size: 11px;
  }

  .page-heading .button {
    display: none;
  }

  .section-meta {
    padding: 16px 2px;
  }

  .letter-grid {
    padding-bottom: 105px;
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .letter-card {
    min-height: 0;
    padding: 25px 23px 21px;
  }

  .letter-card:nth-child(3n + 2),
  .letter-card:nth-child(3n + 2):hover {
    transform: none;
  }

  .letter-title {
    margin-top: 22px;
    font-size: 22px;
  }

  .letter-excerpt {
    -webkit-line-clamp: 3;
  }

  .letter-photo-stack img {
    height: 76px;
  }

  .letter-card-footer {
    padding-top: 18px;
  }

  .timeline-filters {
    top: 62px;
    margin-inline: -14px;
    padding: 12px 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .timeline-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-group,
  .select-wrap select {
    flex: 0 0 auto;
  }

  .select-wrap select {
    height: 38px;
  }

  .filter-reset {
    margin-left: 0;
    flex: 0 0 auto;
  }

  .timeline-sections {
    padding-top: 30px;
    padding-bottom: 130px;
  }

  .timeline-section-head {
    margin-bottom: 15px;
    padding-left: 0;
  }

  .timeline-section-head h2 {
    font-size: 20px;
  }

  .timeline-section-head p {
    font-size: 9px;
  }

  .timeline-list {
    gap: 13px;
  }

  .timeline-list::before {
    left: 7px;
  }

  .timeline-entry {
    display: block;
    padding-left: 23px;
  }

  .timeline-entry::before {
    top: 28px;
    left: 3px;
  }

  .timeline-date {
    display: flex;
    padding: 0 0 7px;
    align-items: baseline;
    gap: 7px;
    text-align: left;
  }

  .timeline-date strong {
    font-size: 14px;
  }

  .timeline-date span {
    margin: 0;
    font-size: 8px;
  }

  .timeline-card {
    padding: 21px 20px 19px;
  }

  .timeline-card h3 {
    margin-top: 13px;
    font-size: 21px;
  }

  .timeline-content {
    font-size: 12px;
  }

  .entry-images button {
    min-height: 92px;
  }

  .mobile-add {
    display: flex;
  }

  .bottom-nav {
    position: fixed;
    z-index: 19;
    right: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 14px;
    display: grid;
    height: 57px;
    padding: 5px;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 19px;
    background: color-mix(in srgb, var(--paper-bright) 87%, transparent);
    box-shadow: 0 14px 40px rgba(44, 65, 67, 0.15);
    backdrop-filter: blur(18px);
  }

  .bottom-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 14px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
  }

  .bottom-nav button.is-active {
    color: var(--ink);
    background: color-mix(in srgb, var(--sea) 8%, var(--paper-bright));
  }

  .bottom-nav svg {
    width: 17px;
    height: 17px;
  }

  .modal {
    padding: 12px;
    align-items: end;
  }

  .modal[open] {
    align-items: end;
  }

  .modal-card {
    width: 100%;
    max-height: calc(94svh - env(safe-area-inset-bottom));
    padding: 25px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 4px 4px;
  }

  .modal-head {
    margin-bottom: 20px;
  }

  .modal-head h2 {
    font-size: 25px;
  }

  .composer-paper {
    margin-inline: -20px;
    padding: 0 20px 14px;
  }

  .letter-body-field textarea {
    min-height: 230px;
    font-size: 15px;
    line-height: 2.15;
  }

  .modal-actions {
    position: sticky;
    bottom: calc(-20px - env(safe-area-inset-bottom));
    margin-inline: -20px;
    padding: 15px 20px calc(15px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--paper-bright) 94%, transparent);
    backdrop-filter: blur(12px);
  }

  .draft-state {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .letter-detail-card {
    max-height: calc(97svh - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    padding: 0;
  }

  .letter-detail-toolbar {
    padding: 15px 18px 13px;
  }

  .letter-detail-toolbar .dialog-close {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .letter-detail-scroll {
    scrollbar-gutter: auto;
  }

  .letter-detail-head {
    padding: 21px 22px 20px;
  }

  .letter-detail-title {
    font-size: 27px;
  }

  .letter-detail-body {
    padding: 24px 22px;
  }

  .letter-copy {
    font-size: 15px;
    line-height: 2.1;
  }

  .letter-comments {
    padding: 24px 22px 28px;
  }

  .letter-detail-images button {
    min-height: 0;
  }

  .letter-detail-images.count-1 button,
  .letter-detail-images.count-1 img {
    max-height: 240px;
  }

  .letter-detail-images.count-2 button,
  .letter-detail-images.count-3 button {
    aspect-ratio: 1;
  }

  .letter-detail-images.count-3 button:first-child {
    aspect-ratio: auto;
    height: 100%;
  }

  .letter-detail-images img {
    min-height: 0;
    max-height: none;
  }

  .letter-comment-dock {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
  }

  .comment-form textarea {
    min-height: 48px;
    font-size: 16px;
  }

  .comment-form .button {
    min-height: 48px;
    padding-inline: 15px;
  }

  .mood-current-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .mood-current {
    min-height: 128px;
    padding: 15px;
  }

  .mood-main strong {
    font-size: 18px;
  }

  .mood-editor {
    padding: 18px;
  }

  .mood-editor-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .mood-options {
    gap: 5px;
  }

  .mood-options span {
    padding-inline: 10px;
  }

  .settings-identity {
    grid-template-columns: 1fr;
  }

  .lightbox {
    padding: max(70px, env(safe-area-inset-top)) 12px max(90px, env(safe-area-inset-bottom));
  }

  .lightbox[open] {
    grid-template-columns: 1fr;
  }

  .lightbox figure {
    align-content: center;
  }

  .lightbox img {
    max-height: 76svh;
  }

  .lightbox-nav {
    position: absolute;
    bottom: calc(25px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
  }

  .lightbox-prev {
    left: calc(50% - 54px);
  }

  .lightbox-next {
    right: calc(50% - 54px);
  }

  .toast-region {
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 16px;
    width: auto;
  }
}

@media (max-width: 440px) {
  .entry-screen {
    padding: 16px;
  }

  .entry-card {
    padding: 43px 24px 29px;
  }

  .identity-card {
    padding: 35px 22px;
  }

  .site-header {
    width: calc(100% - 20px);
  }

  .now-capsule {
    max-width: 138px;
  }

  .now-summary {
    max-width: 108px;
  }

  .now-capsule .now-pulse {
    display: none;
  }

  .page {
    width: calc(100% - 24px);
  }

  .timeline-filters {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .timeline-section-head p {
    display: none;
  }

  .timeline-card-top {
    align-items: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .mood-current-grid {
    grid-template-columns: 1fr;
  }

  .mood-current {
    min-height: 108px;
  }

  .modal-actions .button {
    flex: 1;
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
