:root {
  color: #2d211c;
  background: #241611;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
  --cream: rgba(255, 244, 222, 0.9);
  --cream-strong: rgba(255, 248, 235, 0.96);
  --rose: #c85f5f;
  --rose-dark: #93423b;
  --wood: #6f3c22;
  --ink: #2d211c;
  --muted: #6e5b52;
  --indigo: #2f446f;
  --shadow: rgba(39, 19, 10, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #21130f;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.app-shell.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.app-shell.is-entering {
  animation: page-enter 200ms ease both;
}

.page {
  position: relative;
  isolation: isolate;
  width: min(100%, 960px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 22px 96px;
  overflow: hidden;
  background-color: #3b2116;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.page::before,
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.page::before {
  background:
    linear-gradient(180deg, rgba(36, 19, 13, 0.24), rgba(36, 19, 13, 0.08) 36%, rgba(36, 19, 13, 0.34)),
    var(--ambient-overlay, rgba(255, 191, 112, 0.04));
}

.page::after {
  background: radial-gradient(circle at 50% 18%, rgba(255, 206, 136, 0.16), transparent 42%);
  mix-blend-mode: screen;
  opacity: 0.65;
}

.home-page {
  width: min(100%, 460px);
  padding: 0 0 126px;
  background-image: url("../assets/backgrounds/bg-home-bedroom-color-matched.webp");
}

.record-page {
  background-image: url("../assets/backgrounds/bg-record-room.webp");
}

.record-page::before {
  background:
    linear-gradient(180deg, rgba(18, 9, 6, 0.5), rgba(18, 9, 6, 0.28) 42%, rgba(18, 9, 6, 0.58)),
    radial-gradient(circle at 72% 9%, rgba(255, 189, 94, 0.18), transparent 26%);
}

.record-page::after {
  opacity: 0.22;
}

.ai-reply-page {
  background-image: url("../assets/backgrounds/bg-reply-lamp.webp");
  background-position: center top;
}

.ai-reply-page::before {
  background:
    linear-gradient(180deg, rgba(11, 5, 4, 0.36), rgba(11, 5, 4, 0.18) 30%, rgba(11, 5, 4, 0.62)),
    radial-gradient(circle at 67% 22%, rgba(255, 201, 104, 0.24), transparent 26%);
}

.ai-reply-page::after {
  opacity: 0.18;
}

.dashboard-page {
  width: min(100%, 1120px);
  background-image: url("../assets/backgrounds/bg-review-room.webp");
}

.review-page::before {
  background:
    linear-gradient(180deg, rgba(13, 7, 5, 0.48), rgba(13, 7, 5, 0.32) 44%, rgba(13, 7, 5, 0.58)),
    radial-gradient(circle at 70% 9%, rgba(255, 194, 101, 0.16), transparent 28%);
}

.review-page::after {
  opacity: 0.14;
}

.pixel-icon {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  image-rendering: auto;
}

.pixel-icon-sm {
  width: 30px;
  height: 30px;
}

.pixel-icon-lg {
  width: 68px;
  height: 68px;
}

.home-hero-banner {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 385px;
  padding: 64px 24px 54px;
  color: #fff4df;
  text-align: center;
}

.home-hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 14, 10, 0.28), transparent 62%);
  pointer-events: none;
}

.home-hero-icon,
.home-hero-banner h1,
.home-hero-banner .hero-copy {
  position: relative;
}

.home-hero-icon {
  margin: 0 0 8px;
  filter: drop-shadow(0 8px 16px rgba(33, 15, 8, 0.32));
}

h1 {
  max-width: 720px;
  margin: 0;
  color: #fff2d8;
  font-size: clamp(2.15rem, 8vw, 4.2rem);
  line-height: 1.06;
  text-shadow: 0 2px 14px rgba(30, 14, 7, 0.38);
}

.home-hero-banner h1 {
  font-size: clamp(2.35rem, 12vw, 3.2rem);
}

.hero-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: rgba(255, 241, 215, 0.86);
  font-size: 1rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: #ffd99e;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 2px 10px rgba(37, 17, 9, 0.32);
}

.home-cards {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  margin: -54px 18px 0;
}

.today-card,
.home-tile,
.home-privacy-row,
.record-form,
.dashboard-card,
.empty-state,
.ai-message-card {
  border: 1px solid rgba(97, 55, 35, 0.18);
  background: var(--cream);
  box-shadow: 0 18px 40px var(--shadow);
  backdrop-filter: blur(12px);
}

.today-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: 8px;
}

.today-card-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: rgba(255, 232, 186, 0.74);
}

.today-card-body {
  display: grid;
  flex: 1;
  gap: 8px;
}

.today-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--rose-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.today-card-heading-date-only {
  justify-content: flex-end;
}

.today-card-mood {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.today-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #ffe4bf;
  color: #834129;
  font-weight: 800;
}

.home-cards-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-tile {
  position: relative;
  display: grid;
  min-height: 130px;
  gap: 7px;
  padding: 16px;
  border-radius: 8px;
  text-align: left;
}

.home-tile h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.home-tile p {
  margin: 0;
  padding-right: 34px;
  color: var(--muted);
  font-size: 0.84rem;
}

.home-tile-glyph {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.home-privacy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #4e3a33;
  font-weight: 800;
}

.home-privacy-row span:last-child {
  margin-left: auto;
  color: #8e766b;
  font-size: 0.82rem;
}

.home-privacy-row:disabled {
  cursor: default;
  opacity: 0.9;
}

.quick-entry-bar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px;
  border: 1px solid rgba(99, 58, 37, 0.2);
  border-radius: 8px;
  background: rgba(255, 246, 229, 0.9);
  box-shadow: 0 18px 42px rgba(35, 16, 8, 0.26);
  backdrop-filter: blur(14px);
}

.quick-entry {
  display: grid;
  gap: 4px;
  min-height: 62px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5a463e;
  font-size: 0.78rem;
  font-weight: 800;
}

.quick-entry:hover,
.quick-entry.is-active {
  background: rgba(200, 95, 95, 0.14);
  color: var(--rose-dark);
}

.quick-entry-icon {
  width: 34px;
  height: 34px;
}

.primary-action,
.secondary-action,
.ghost-button {
  border: 0;
  border-radius: 8px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-action {
  min-height: 52px;
  padding: 0 24px;
  background: linear-gradient(180deg, #d86f5d, #a84a3d);
  color: #fff8ef;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(96, 39, 25, 0.24);
}

.secondary-action {
  min-height: 48px;
  padding: 0 20px;
  background: rgba(255, 247, 231, 0.82);
  color: var(--indigo);
  border: 1px solid rgba(47, 68, 111, 0.22);
  font-weight: 800;
}

.primary-action:hover,
.secondary-action:hover,
.ghost-button:hover,
.home-tile:hover,
.today-card-action:hover {
  transform: translateY(-1px);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.ghost-button:focus-visible,
textarea:focus-visible,
input:focus-visible,
.quick-entry:focus-visible,
.home-tile:focus-visible {
  outline: 3px solid rgba(255, 208, 139, 0.5);
  outline-offset: 3px;
}

.page-header {
  display: grid;
  gap: 22px;
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
}

.ghost-button {
  width: fit-content;
  min-height: 40px;
  padding: 0 16px;
  background: rgba(255, 246, 229, 0.76);
  color: #5d3c2f;
  border: 1px solid rgba(97, 55, 35, 0.18);
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.record-form {
  display: grid;
  gap: 22px;
  max-width: 720px;
  padding: 24px;
  border-radius: 8px;
}

.field {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-weight: 800;
}

.field textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid rgba(97, 55, 35, 0.22);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 253, 247, 0.94);
  color: var(--ink);
  font-weight: 500;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-option {
  position: relative;
  display: inline-flex;
}

.tag-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.tag-option span {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid rgba(97, 55, 35, 0.2);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 253, 247, 0.88);
  color: #5c463d;
  font-weight: 700;
}

.tag-option input:checked + span {
  border-color: rgba(200, 95, 95, 0.65);
  background: rgba(200, 95, 95, 0.14);
  color: var(--rose-dark);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: center;
  gap: 16px;
}

.range-row input {
  accent-color: var(--rose);
}

.range-row output {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--indigo);
  color: #fff;
  font-weight: 900;
}

.form-action {
  justify-self: start;
}

.record-page {
  width: min(100%, 430px);
  padding: 34px 22px 28px;
  color: #fff2d8;
  background-position: center top;
}

.record-topbar {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr 54px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.record-topbar h1 {
  max-width: none;
  color: #fff5df;
  font-size: 1.45rem;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 2px 12px rgba(15, 7, 3, 0.7);
}

.record-back-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 8, 5, 0.18);
  color: #fff3db;
  font-size: 2rem;
  line-height: 1;
}

.record-top-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(20, 8, 2, 0.5));
}

.record-pixel-form {
  display: grid;
  gap: 18px;
  max-width: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.record-note-field {
  position: relative;
  display: block;
}

.record-note-field textarea {
  width: 100%;
  min-height: 268px;
  resize: none;
  padding: 16px 18px 38px;
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 249, 235, 0.68) 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(315deg, rgba(244, 211, 158, 0.2) 25%, transparent 25%) 0 0 / 6px 6px,
    #fff0cd;
  color: #4d382e;
  box-shadow:
    0 0 0 2px #ffdfa1 inset,
    0 0 0 4px rgba(255, 238, 197, 0.9),
    0 8px 0 rgba(55, 24, 10, 0.35);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.7;
}

.record-note-field textarea::placeholder {
  color: rgba(88, 64, 51, 0.72);
}

.note-counter {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: #5e4639;
  font-weight: 900;
}

.record-section {
  display: grid;
  gap: 10px;
}

.record-section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #fff1d5;
  text-shadow: 0 2px 10px rgba(13, 6, 3, 0.7);
}

.record-section-heading h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.record-section-heading p {
  margin: 0;
  color: rgba(255, 230, 187, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.record-choice-grid {
  display: grid;
  gap: 10px;
}

.emotion-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.record-choice {
  position: relative;
  display: block;
  min-width: 0;
}

.record-choice input,
.intensity-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.record-choice > span {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid #673314;
  border-radius: 7px;
  background: #ffe9bd;
  color: #4d3529;
  box-shadow:
    0 0 0 2px #fff3d3 inset,
    0 4px 0 rgba(46, 21, 9, 0.55);
  font-size: 0.85rem;
  font-weight: 900;
  white-space: nowrap;
}

.record-choice .choice-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #935643;
  font-size: 1rem;
  line-height: 1;
  box-shadow: none;
}

.scene-grid .record-choice > span {
  border-color: transparent;
}

.record-choice input:checked + span {
  background: #f3c982;
  color: #3c241a;
  transform: translateY(2px);
  box-shadow:
    0 0 0 2px rgba(255, 244, 213, 0.75) inset,
    0 2px 0 rgba(46, 21, 9, 0.55);
}

.record-choice input:focus-visible + span,
.intensity-option input:focus-visible + span {
  outline: 3px solid rgba(255, 226, 159, 0.82);
  outline-offset: 3px;
}

.intensity-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 10px 12px 8px;
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background: #ffedc5;
  box-shadow:
    0 0 0 2px #fff4d1 inset,
    0 5px 0 rgba(46, 21, 9, 0.48);
}

.intensity-option {
  position: relative;
  display: grid;
  min-width: 0;
}

.intensity-option span {
  position: relative;
  display: grid;
  min-height: 54px;
  justify-items: center;
  align-content: center;
  gap: 2px;
  color: #51382e;
  font-weight: 900;
}

.intensity-option img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(80, 37, 13, 0.25));
}

.intensity-option strong {
  display: grid;
  min-width: 28px;
  min-height: 19px;
  place-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1;
}

.intensity-option input:checked + span strong {
  background: #c95d62;
  color: #fff9ef;
  box-shadow:
    0 0 0 2px #9d3c3f inset,
    0 2px 0 rgba(72, 25, 20, 0.38);
}

.record-submit {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 3px solid #8f3e36;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 164, 139, 0.28), transparent),
    #c95959;
  color: #fff8ee;
  box-shadow:
    0 0 0 2px rgba(255, 213, 188, 0.46) inset,
    0 7px 0 rgba(68, 24, 16, 0.52);
  font-size: 1.05rem;
  font-weight: 900;
}

.record-submit:hover {
  transform: translateY(-1px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-grid > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid rgba(97, 55, 35, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 231, 0.86);
  color: var(--ink);
  box-shadow: 0 18px 40px var(--shadow);
  backdrop-filter: blur(12px);
  font-weight: 800;
}

.dashboard-card {
  min-height: 250px;
  padding: 22px;
  border-radius: 8px;
  background: rgba(255, 247, 231, 0.84);
}

.card-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.card-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1.25;
}

.chart-placeholder {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed rgba(47, 68, 111, 0.38);
  border-radius: 8px;
  background: rgba(47, 68, 111, 0.08);
  color: var(--indigo);
  font-weight: 900;
}

.trend-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.trend-list li {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  color: var(--muted);
}

.trend-list strong {
  color: var(--rose-dark);
  font-size: 1.25rem;
}

.dashboard-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-tag {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(47, 68, 111, calc(0.07 + var(--weight) * 0.018));
  color: var(--indigo);
  font-size: calc(0.92rem + var(--weight) * 0.035rem);
  font-weight: 900;
}

.dashboard-tag small {
  color: var(--muted);
  font-size: 0.78rem;
}

.moment-list {
  display: grid;
  gap: 12px;
}

.moment-item {
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(97, 55, 35, 0.12);
}

.moment-item h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1rem;
}

.moment-item p,
.summary-card p,
.status-message {
  margin: 0;
  color: var(--muted);
}

.summary-card {
  background: rgba(255, 232, 214, 0.88);
}

.review-page {
  width: min(100%, 430px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 36px 22px 104px;
  color: #fff2d8;
  background-position: center top;
}

.review-topbar {
  display: grid;
  grid-template-columns: 42px 1fr 46px;
  align-items: center;
  gap: 10px;
  flex: 0 0 54px;
  min-height: 54px;
  margin-bottom: 10px;
}

.review-topbar h1 {
  max-width: none;
  margin: 0;
  color: #fff4df;
  font-size: 1.55rem;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 3px 14px rgba(14, 6, 3, 0.78);
}

.review-back-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(9, 4, 3, 0.16);
  color: #fff2d8;
  font-size: 2rem;
  line-height: 1;
}

.review-top-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(18, 7, 2, 0.4));
}

.review-calendar-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 246, 229, 0.16);
  padding: 0;
}

.review-calendar-button:hover {
  background: rgba(255, 246, 229, 0.28);
  transform: translateY(-1px);
}

.review-calendar-button .review-top-icon {
  pointer-events: none;
}

.review-scroll {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 2px 2px 92px;
  scrollbar-width: none;
}

.review-scroll::-webkit-scrollbar {
  display: none;
}

.review-card {
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 249, 235, 0.62) 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(315deg, rgba(244, 211, 158, 0.18) 25%, transparent 25%) 0 0 / 6px 6px,
    #ffeec8;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 5px 0 rgba(46, 20, 8, 0.46);
  color: #3c2a20;
}

.review-card h2 {
  margin: 0;
  color: #3b2a20;
  font-size: 1rem;
  line-height: 1.25;
}

.review-card p {
  margin: 0;
  color: #4e382d;
  font-weight: 500;
  line-height: 1.55;
}

.growth-card {
  display: grid;
  grid-template-columns: 1fr 118px;
  gap: 10px;
  min-height: 142px;
  padding: 16px 16px 12px;
}

.growth-card p {
  margin-top: 8px;
  font-size: 0.88rem;
}

.growth-illustration {
  position: relative;
  display: grid;
  align-content: end;
  justify-items: center;
}

.growth-illustration span {
  color: #d88448;
  font-size: 2.4rem;
  line-height: 1;
  text-shadow: 18px 8px 0 rgba(216, 132, 72, 0.45);
}

.growth-illustration img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-top: -4px;
}

.moment-summary-card {
  display: grid;
  grid-template-columns: 1fr 112px;
  align-items: center;
  gap: 10px;
  min-height: 112px;
  padding: 15px 16px;
}

.review-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.review-card-heading strong {
  color: #bf4c4f;
  font-size: 0.98rem;
}

.moment-summary-card p {
  margin-top: 10px;
  font-size: 0.9rem;
}

.moment-cup {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #3c2a20;
  font-size: 2rem;
}

.moment-cup img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.trend-summary-card {
  padding: 14px 14px 12px;
}

.trend-summary-card h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.trend-summary-card h2 span,
.list-card h2 span {
  color: #765341;
  font-size: 0.72rem;
  font-weight: 800;
}

.review-chart {
  display: block;
  width: 100%;
  height: 132px;
}

.chart-grid line {
  stroke: rgba(157, 92, 55, 0.24);
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

.chart-moods text {
  font-size: 12px;
}

.chart-line {
  fill: none;
  stroke: #c74f62;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: #fff1d0;
  stroke: #c74f62;
  stroke-width: 3;
}

.chart-label {
  fill: #654536;
  font-size: 11px;
  text-anchor: middle;
}

.review-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.list-card {
  min-height: 174px;
  padding: 12px 12px 10px;
}

.list-card h2 {
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.list-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-card li {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 7px;
  border-radius: 6px;
  background: rgba(255, 238, 200, 0.74);
  color: #553b30;
  font-size: 0.72rem;
  font-weight: 700;
}

.list-card li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-card li strong {
  flex: 0 0 auto;
  color: #8d4438;
  font-weight: 900;
}

.review-loading-card {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 18px;
  color: #4e382d;
  font-weight: 800;
}

.review-bottom-nav {
  position: absolute;
  right: 22px;
  bottom: 18px;
  left: 22px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  min-height: 74px;
  padding: 7px 8px;
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background: #ffe9bd;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 5px 0 rgba(46, 20, 8, 0.46);
}

.review-bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4d3529;
  font-size: 0.78rem;
  font-weight: 800;
}

.review-bottom-nav button.is-active {
  color: #bf4c4f;
}

.review-bottom-nav img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.calendar-page {
  background-position: center top;
}

.calendar-panel {
  display: grid;
  flex: 1 1 auto;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 2px 2px 92px;
  scrollbar-width: none;
}

.calendar-panel::-webkit-scrollbar {
  display: none;
}

.calendar-search-field {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background: #ffe9bd;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 5px 0 rgba(46, 20, 8, 0.46);
  color: #3c2a20;
  font-weight: 900;
}

.calendar-search-field input {
  width: 100%;
  min-height: 44px;
  border: 2px solid rgba(122, 61, 32, 0.36);
  border-radius: 8px;
  background: #fff8e8;
  color: #3c2a20;
  font: inherit;
  font-weight: 800;
  padding: 0 12px;
}

.calendar-record-list {
  display: grid;
  gap: 12px;
}

.calendar-record-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 249, 235, 0.62) 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(315deg, rgba(244, 211, 158, 0.18) 25%, transparent 25%) 0 0 / 6px 6px,
    #ffeec8;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 5px 0 rgba(46, 20, 8, 0.46);
  color: #3c2a20;
}

.calendar-record-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #3b2a20;
  font-size: 0.92rem;
  font-weight: 900;
}

.calendar-record-meta span {
  color: #9a4b42;
  font-size: 0.8rem;
  text-align: right;
}

.calendar-record-item p {
  margin: 0;
  color: #4e382d;
  font-weight: 600;
  line-height: 1.55;
}

.calendar-record-item small {
  color: #7b5a4a;
  font-weight: 700;
  line-height: 1.45;
}

.calendar-empty {
  margin: 0;
  padding: 18px;
  border: 3px solid #7a3d20;
  border-radius: 8px;
  background: #ffe9bd;
  color: #4e382d;
  font-weight: 900;
  text-align: center;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 5px 0 rgba(46, 20, 8, 0.46);
}

.ai-reply-layout {
  display: grid;
  gap: 24px;
  max-width: 820px;
  margin: 0 auto;
}

.empty-state,
.ai-message-card {
  border-radius: 8px;
  padding: 24px;
}

.ai-message-card {
  display: grid;
  gap: 16px;
  min-height: 360px;
  margin-top: 26vh;
  background: rgba(255, 247, 231, 0.88);
}

.loading-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--indigo);
  font-weight: 900;
}

.loading-dots {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--indigo);
  box-shadow:
    16px 0 0 rgba(47, 68, 111, 0.5),
    32px 0 0 rgba(47, 68, 111, 0.22);
}

.ai-message {
  overflow: auto;
  max-height: 52vh;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.75;
}

.ai-message h3 {
  margin: 20px 0 8px;
  color: var(--rose-dark);
  font-size: 1.08rem;
}

.ai-message p {
  margin: 0 0 12px;
}

.ai-message ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding-left: 20px;
}

.error-state {
  gap: 12px;
  color: #8a2f20;
}

.error-state p {
  margin: 0;
}

.ai-reply-page {
  width: min(100%, 430px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 42px 22px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff2d8;
}

.ai-topbar {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  flex: 0 0 54px;
  min-height: 54px;
  margin-bottom: clamp(68px, 14vh, 120px);
}

.ai-topbar h1 {
  max-width: none;
  color: #fff4df;
  font-size: 1.7rem;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 3px 14px rgba(14, 6, 3, 0.78);
}

.ai-back-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(9, 4, 3, 0.16);
  color: #fff2d8;
  font-size: 2rem;
  line-height: 1;
}

.ai-status-icons {
  color: rgba(255, 241, 212, 0.82);
  font-size: 1.4rem;
  text-align: right;
}

.ai-reply-layout {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: minmax(0, 1.25fr) 172px 58px;
  gap: 14px;
  width: min(100%, 520px);
  max-width: none;
  min-height: 0;
  margin: 0 auto;
}

.ai-pixel-card {
  border: 3px solid #7a3d20;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 249, 235, 0.62) 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(315deg, rgba(244, 211, 158, 0.18) 25%, transparent 25%) 0 0 / 6px 6px,
    #ffeec8;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 0 0 4px rgba(255, 238, 197, 0.78),
    0 8px 0 rgba(46, 20, 8, 0.46);
  backdrop-filter: none;
}

.ai-message-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 0;
  margin-top: 0;
  padding: 36px 34px 38px;
  overflow: hidden;
}

.ai-card-heart {
  position: absolute;
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(82, 34, 18, 0.22));
}

.ai-card-heart-start {
  top: 18px;
  left: 18px;
}

.ai-card-heart-end {
  right: 18px;
  bottom: 18px;
}

.loading-row {
  align-items: center;
  gap: 10px;
  color: #6f442e;
  font-weight: 900;
}

.loading-dots {
  background: #a64d45;
  box-shadow:
    16px 0 0 rgba(166, 77, 69, 0.5),
    32px 0 0 rgba(166, 77, 69, 0.22);
}

.ai-message {
  overflow: auto;
  min-height: 0;
  max-height: 100%;
  color: #39291f;
  padding: 18px 22px;
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
}

.ai-message p {
  margin: 0 0 14px;
}

.ai-care-card {
  min-height: 0;
  padding: 18px 22px;
  overflow: hidden;
}

.ai-care-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: #3d2a20;
  font-size: 1.2rem;
  line-height: 1.2;
}

.ai-care-card h2 img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.ai-care-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  max-height: 110px;
  overflow: auto;
  list-style: none;
}

.ai-care-card li {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  color: #46342a;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.38;
}

.care-bullet {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8b4a35;
  font-size: 1rem;
  line-height: 1;
}

.ai-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding-top: 2px;
}

.ai-action-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.ai-action-button img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ai-action-light {
  border: 3px solid #7a3d20;
  background: #ffe9bd;
  color: #3f2a20;
  box-shadow:
    0 0 0 2px #fff5d6 inset,
    0 5px 0 rgba(46, 20, 8, 0.45);
}

.ai-action-red {
  border: 3px solid #8f3e36;
  background:
    linear-gradient(180deg, rgba(255, 164, 139, 0.28), transparent),
    #c95959;
  color: #fff8ee;
  box-shadow:
    0 0 0 2px rgba(255, 213, 188, 0.46) inset,
    0 5px 0 rgba(68, 24, 16, 0.52);
}

.ai-empty-state {
  margin-top: 0;
  padding: 24px;
  color: #3d2a20;
}

.error-state {
  gap: 12px;
  color: #8a2f20;
  font-size: 1rem;
  font-weight: 800;
}

.sound-picker {
  position: fixed;
  right: 24px;
  bottom: 112px;
  z-index: 10;
}

.sound-picker-overlay {
  position: fixed;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.sound-picker-menu {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: grid;
  gap: 10px;
  width: min(260px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(97, 55, 35, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 231, 0.95);
  box-shadow: 0 18px 42px rgba(35, 16, 8, 0.24);
  backdrop-filter: blur(14px);
}

.sound-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(97, 55, 35, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.sound-option.is-active {
  border-color: rgba(200, 95, 95, 0.62);
  background: rgba(200, 95, 95, 0.13);
}

.sound-toggle {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(97, 55, 35, 0.2);
  border-radius: 999px;
  background: rgba(255, 247, 231, 0.9);
  box-shadow: 0 14px 28px rgba(35, 16, 8, 0.26);
  font-size: 1.35rem;
  backdrop-filter: blur(12px);
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 36px 18px 108px;
  }

  .home-page {
    padding: 0 0 112px;
  }

  .home-hero-banner {
    min-height: 370px;
    padding-top: 58px;
  }

  .record-form {
    padding: 20px;
  }

  .record-page {
    padding: 34px 22px 28px;
  }

  .record-pixel-form {
    padding: 0;
  }

  .record-note-field textarea {
    min-height: 260px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .dashboard-grid,
  .trend-list {
    grid-template-columns: 1fr;
  }

  .review-page {
    padding: 36px 22px 104px;
  }

  .review-lists {
    grid-template-columns: 1fr 1fr;
  }

  .ai-message-card {
    margin-top: 0;
    min-height: 0;
    padding: 36px 30px 38px;
  }

  .ai-reply-page {
    padding: 42px 22px 28px;
  }

  .ai-topbar {
    margin-bottom: clamp(68px, 14vh, 120px);
  }

  .ai-message {
    font-size: 0.94rem;
  }

  .ai-care-card {
    padding: 18px 22px;
  }

  .quick-entry-bar {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: calc(100% - 28px);
  }

  .sound-picker {
    right: 18px;
    bottom: 104px;
  }
}
