:root {
  color-scheme: light;
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  color: #49352f;
  background: #f7efe7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #49352f;
  --muted: #927e73;
  --rose: #b86655;
  --rose-dark: #965141;
  --paper: #fffdfa;
  --cream: #f4e7da;
  --line: #eee2d7;
  --shadow: 0 16px 42px rgb(92 58 43 / 9%);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 80% 0%, rgb(235 204 182 / 32%), transparent 30rem), #f7efe7;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.site-shell {
  width: min(100%, 680px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 18px 28px;
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: #f0d9ca;
  color: var(--rose);
  font-size: 23px;
}

.header-note,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-note {
  letter-spacing: 0;
  text-transform: none;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 27px 25px 23px;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 26px;
  background:
    radial-gradient(circle at 93% 12%, rgb(255 255 255 / 45%) 0 54px, transparent 55px),
    linear-gradient(140deg, #e9c4ae, #f0d8c4 57%, #f5e5d5);
  box-shadow: var(--shadow);
}

.hero::after {
  position: absolute;
  right: 26px;
  bottom: 0;
  color: rgb(184 102 85 / 16%);
  content: '♡';
  font-size: 132px;
  line-height: 0.9;
  pointer-events: none;
  transform: rotate(-13deg);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  margin: 0 0 13px;
  color: #805b4e;
}

.day-count {
  margin: 0;
  color: #50362e;
  font-size: clamp(48px, 13vw, 76px);
  font-weight: 760;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.day-caption {
  margin: 7px 0 20px;
  color: #78594e;
  font-size: 15px;
}

.start-date {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgb(128 91 78 / 20%);
  border-radius: 13px;
  background: rgb(255 253 250 / 62%);
  color: #69483d;
  font-size: 12px;
}

.start-date-value {
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 2px 13px;
}

.section-heading h1,
.section-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -0.045em;
}

.section-heading .eyebrow {
  margin: 0;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
}

.selected-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 88px));
  gap: 8px;
}

.selected-image-preview:empty {
  display: none;
}

.selected-image-preview img {
  width: 88px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  object-fit: cover;
}

.field input:focus,
.field textarea:focus {
  border-color: #d3a08a;
  box-shadow: 0 0 0 3px rgb(184 102 85 / 12%);
}

.channel-section {
  margin-top: 28px;
}

.year-list {
  display: grid;
  gap: 10px;
  padding-bottom: 84px;
}

.year-group {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 7px 20px rgb(92 58 43 / 5%);
}

.year-heading {
  display: flex;
  min-height: 59px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  list-style: none;
}

.year-heading::-webkit-details-marker {
  display: none;
}

.year-chevron {
  color: var(--rose);
  font-size: 21px;
  transition: transform 160ms ease;
}

.year-group[open] .year-chevron {
  transform: rotate(180deg);
}

.year-count,
.channel-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.channel-list {
  display: grid;
  gap: 4px;
  padding: 0 9px 9px;
}

.month-channel {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #715b50;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.month-channel:hover,
.month-channel:focus-visible {
  outline: none;
  background: #f5e9df;
  color: var(--rose-dark);
}

.channel-icon,
.channel-header-icon {
  color: #bd9985;
  font-size: 21px;
  font-weight: 500;
}

.channel-view {
  margin-top: 20px;
}

.channel-header {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid #e5d6ca;
}

.channel-header .eyebrow {
  margin: 0 0 4px;
}

.channel-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  letter-spacing: -0.04em;
}

.channel-header-icon {
  font-size: 31px;
}

.channel-header .header-note {
  margin-left: auto;
  white-space: nowrap;
}

.post-list {
  display: grid;
  gap: 12px;
  padding-bottom: 84px;
}

.memory-card {
  display: grid;
  width: 100%;
  min-height: 132px;
  grid-template-columns: minmax(0, 1fr) 98px;
  gap: 14px;
  padding: 13px;
  border: 1px solid rgb(255 255 255 / 88%);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgb(92 58 43 / 5%);
  cursor: pointer;
  text-align: left;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.memory-card:not(.has-image) {
  grid-template-columns: minmax(0, 1fr);
}

.memory-card:hover {
  box-shadow: 0 12px 28px rgb(92 58 43 / 9%);
  transform: translateY(-2px);
}

.memory-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.memory-date {
  margin: 2px 0 8px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
}

.memory-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memory-preview {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.memory-cover {
  width: 98px;
  height: 104px;
  align-self: center;
  border-radius: 14px;
  background: #f1e3d8;
  object-fit: cover;
}

.empty-state,
.status-message {
  padding: 22px 18px;
  border: 1px dashed #dfcbbd;
  border-radius: 18px;
  background: rgb(255 253 250 / 72%);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.status-message[role='alert'] {
  border-color: #e6b4a4;
  color: #914f40;
}

.empty-heart {
  display: block;
  margin-bottom: 7px;
  color: var(--rose);
  font-size: 25px;
}

.fab {
  position: fixed;
  z-index: 5;
  right: max(22px, calc((100vw - 640px) / 2 + 20px));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 20px;
  background: var(--rose);
  box-shadow: 0 10px 24px rgb(150 81 65 / 30%);
  color: #fffaf6;
  cursor: pointer;
  font-size: 31px;
  line-height: 1;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.fab:hover {
  background: var(--rose-dark);
  transform: translateY(-2px);
}

.back-button,
.text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}

.detail-card,
.form-card {
  margin-top: 19px;
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgb(92 58 43 / 6%);
}

.detail-date {
  margin: 0 0 7px;
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
}

.detail-title {
  margin: 0 0 17px;
  font-size: 25px;
  letter-spacing: -0.05em;
  line-height: 1.22;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 19px;
}

.detail-gallery img {
  width: 100%;
  max-height: 380px;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--cream);
  object-fit: cover;
}

.detail-video {
  display: block;
  width: 100%;
  max-height: 480px;
  margin-bottom: 19px;
  border-radius: 14px;
  background: #1d1715;
}

.detail-content {
  margin: 0;
  color: #69564c;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.update-post-button {
  width: 100%;
  margin-top: 24px;
}

.danger-button {
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  background: #a83f3f;
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.danger-button:hover {
  background: #873232;
}

.danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.form-card {
  display: grid;
  gap: 16px;
  margin-top: 15px;
  padding: 19px;
}

.field {
  display: grid;
  gap: 7px;
  color: #715b50;
  font-size: 13px;
  font-weight: 650;
}

.field input,
.field textarea {
  min-height: 46px;
  padding: 11px 12px;
  font-weight: 400;
}

.field textarea {
  min-height: 145px;
  resize: vertical;
  line-height: 1.55;
}

.field input[type='file'] {
  height: auto;
  padding: 10px;
  font-size: 12px;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.primary-button {
  min-height: 49px;
  border: 0;
  border-radius: 15px;
  background: var(--rose);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--rose-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.site-footer {
  padding: 4px 0 8px;
  color: #a38f83;
  font-size: 11px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (min-width: 600px) {
  .site-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .hero {
    padding: 34px 34px 27px;
  }

  .memory-card {
    min-height: 152px;
    grid-template-columns: minmax(0, 1fr) 122px;
    gap: 20px;
    padding: 15px;
  }

  .memory-cover {
    width: 122px;
    height: 122px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
