:root {
  color-scheme: light;
  --ink: #492940;
  --muted: #765c71;
  --rose: #a43560;
  --rose-deep: #86254e;
  --blush: #fff2f5;
  --paper: #fffaff;
  --white: #fffdff;
  --border: #eedde9;
  --lavender: #f5efff;
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', system-ui, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #fff6f8; }
body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 16% 12%, #ffe5eebf, transparent 38%),
    radial-gradient(ellipse at 88% 52%, #ede8ffc9, transparent 43%),
    linear-gradient(135deg, #fff8f6, #fffafb 48%, #faf3ff);
  font-family: var(--font);
  line-height: 1.55;
}
button, input, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #c5699b; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }

.shell { width: min(100% - 44px, 990px); margin-inline: auto; }
.site-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-size: .93rem; font-weight: 800; letter-spacing: .06em; }
.brand-icon {
  width: 35px; height: 35px;
  display: grid; place-items: center;
  border: 1px solid #db789e; border-radius: 12px;
  background: linear-gradient(145deg, #ec8aae, #d4608e);
  box-shadow: 0 3px 0 #efc3d4;
}
.brand-icon .flower { width: 23px; height: 23px; }
.header-meta, .quiet-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 12px; min-height: 38px;
  border: 1px solid #e9d7e7; border-radius: 999px;
  background: #fffcffb8; color: #6d4b68;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.quiet-button { min-height: 44px; }
.quiet-button:hover { background: #fff; color: var(--rose); }
.private-icon { width: .73em; height: .62em; margin-top: .25em; border: 1.4px solid currentColor; border-radius: 1.5px; position: relative; }
.private-icon::before { content: ''; position: absolute; width: .46em; height: .36em; top: -.39em; left: calc(50% - .23em); border: 1.4px solid currentColor; border-bottom: 0; border-radius: .45em .45em 0 0; }
.flower {
  --petal: #fff8fd; --pollen: #e0a148;
  display: inline-block; flex: 0 0 auto; width: 1.35em; height: 1.35em;
  background:
    radial-gradient(circle at 50% 48%, var(--pollen) 0 10%, transparent 12%),
    radial-gradient(circle at 50% 27%, var(--petal) 0 20%, transparent 22%),
    radial-gradient(circle at 71% 43%, var(--petal) 0 20%, transparent 22%),
    radial-gradient(circle at 63% 68%, var(--petal) 0 20%, transparent 22%),
    radial-gradient(circle at 37% 68%, var(--petal) 0 20%, transparent 22%),
    radial-gradient(circle at 29% 43%, var(--petal) 0 20%, transparent 22%);
}
.flower-red { --petal: #d75b84; --pollen: #ffd67b; }
.flower-white { filter: drop-shadow(0 1px 1px #a670a054); }

.gate {
  isolation: isolate; position: relative;
  width: min(100%, 448px);
  margin: clamp(10px, 3vh, 36px) auto 18px;
  padding: 13px;
  border: 1px solid #ecd7e8;
  border-radius: 34px;
  background: var(--white);
  box-shadow: 0 26px 64px #8c527927, 0 4px 8px #986e8510;
}
.gate-art {
  position: relative; display: grid; place-items: center; overflow: hidden;
  height: 206px; border-radius: 24px;
  border: 1px solid #e9dbf4;
  background:
    radial-gradient(#9574b22d 1px, transparent 1.3px) 0 0 / 13px 13px,
    radial-gradient(ellipse at 50% 40%, #fffcff, #f3e9ff 60%, #f7dfee 100%);
}
.gate-art img { width: min(94%, 390px); height: 213px; object-fit: contain; transform: translateY(-7px) rotate(-3deg) scale(1.06); filter: drop-shadow(0 6px 9px #8f6eaf30); }
.art-flower { position: absolute; z-index: 1; width: 30px; height: 30px; }
.art-flower-red { left: 19px; top: 28px; transform: rotate(-15deg); }
.art-flower-white { right: 16px; bottom: 23px; transform: rotate(20deg); width: 33px; height: 33px; }
.pond-caption {
  position: absolute; right: 33px; bottom: 15px;
  border: 1px solid #e0ccec;
  border-radius: 5px; background: #fffbfd; color: #735380;
  padding: 4px 9px; font: 800 .63rem/1.3 var(--font); letter-spacing: .17em; transform: rotate(5deg);
}
.gate-copy { padding: 23px 23px 22px; }
.gate h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .16em; font-size: clamp(1.72rem, 5.8vw, 2.08rem); line-height: 1.24; font-weight: 900; letter-spacing: -.045em; }
.gate h1 span { color: var(--rose); }
.unlock-form { margin-top: 24px; }
.unlock-form label, .form-label { display: block; margin-bottom: 7px; font-size: .88rem; font-weight: 800; }
.unlock-form input, #mood {
  width: 100%; min-width: 0;
  border: 1px solid var(--border); border-radius: 14px;
  background: #fffbfe; padding: 11px 13px; font-size: 1rem;
}
.unlock-form input { min-height: 47px; background: #fff9fc; }
.unlock-form input::placeholder, #mood::placeholder, textarea::placeholder { color: #806177; }
.form-status:empty, .status:empty { display: none; }
.status { margin-top: 8px; color: #755369; font-size: .84rem; overflow-wrap: anywhere; }
.status[data-error='true'] { color: #a52555; font-weight: 650; }
.button {
  min-height: 47px; padding: .62rem .92rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 14px;
  font-size: .98rem; font-weight: 800; line-height: 1.35;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
.button.primary { background: linear-gradient(110deg, #ad3d6d, #983363); color: #fff; border-color: #96305c; box-shadow: 0 3px 0 #79214a, 0 6px 14px #a43c7038; }
.button.primary:hover:not(:disabled) { background: linear-gradient(110deg, #a03464, #852651); }
.button.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #79214a; }
.button.primary:disabled { opacity: .65; }
.button.secondary { background: #f9eff8; border-color: #ead9e8; color: var(--rose-deep); }
.button.secondary:hover { background: #f3e2f3; }
.unlock-form .button { width: 100%; margin-top: 14px; }

.pond { width: min(100%, 870px); margin: 9px auto 0; }
.pond-banner {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 124px;
  padding: 18px 29px;
  background:
    radial-gradient(#9d83b32c 1px, transparent 1.3px) 0 0 / 14px 14px,
    linear-gradient(115deg, #ffebf3, #faecfa 58%, #ece8ff);
  border: 1px solid #ebd9eb; border-radius: 26px;
}
.pond-banner-copy { position: relative; z-index: 1; min-width: 0; }
.pond-banner h1 { font-size: clamp(1.4rem, 4vw, 2.1rem); font-weight: 900; letter-spacing: -.045em; line-height: 1.22; }
.anniversary-stamp {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 9px; max-width: 100%;
  padding: 4px 8px; border: 1px dashed #d3a7c2; border-radius: 5px;
  color: #754969; background: #fffbfdd9; font-size: .73rem; font-weight: 750;
}
.banner-sticker { position: absolute; right: 12px; width: 235px; height: 150px; object-fit: contain; transform: rotate(8deg); filter: drop-shadow(0 4px 6px #9a78a740); }
.pond-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 17px 0 12px; }
.view-tabs { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border: 1px solid #eddae9; border-radius: 15px; background: #f8ebf4; }
.view-tab { min-height: 44px; color: #764e70; padding: 0 14px; border: 1px solid transparent; border-radius: 11px; background: transparent; font-size: .88rem; white-space: nowrap; font-weight: 750; }
.view-tab span { margin-right: 1px; font-family: system-ui, sans-serif; font-size: 1.02rem; }
.view-tab[aria-pressed='true'] { border-color: #efdde8; background: #fffaff; color: #962953; box-shadow: 0 1px 4px #a2708c23; }
.view-tab:hover:not([aria-pressed='true']) { background: #fffbffa8; }
.identity-row { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; }
.identity-label { color: #7b6076; font-size: .78rem; white-space: nowrap; }
.person-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.person-option, .mode-switch button { min-height: 44px; padding: 4px 10px; border: 1px solid #ead8e5; border-radius: 999px; background: #fffaff; color: #766075; font-size: .78rem; font-weight: 730; white-space: nowrap; }
.person-option[aria-pressed='true'], .mode-switch button[aria-pressed='true'] { border-color: #ca90af; color: #84365a; background: #f9ebf4; }
.person-option[data-person='tree'][aria-pressed='true'] { border-color: #8ead99; color: #355c4d; background: #eaf4ee; }
.person-option:disabled { opacity: .65; }
.feed-switch { margin-top: 10px; }
.mode-switch { display: flex; gap: 5px; flex: 0 0 auto; }
.mode-switch button { min-width: 52px; }
.mood-section-header { margin-bottom: 7px; }
.writer-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-bottom: 14px; padding: 3px; border: 1px solid #eddae9; border-radius: 14px; background: #f8ebf4; }
.writer-switch button { min-width: 0; min-height: 46px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #704768; font-size: .92rem; font-weight: 780; }
.writer-switch button span { margin-right: 3px; }
.writer-switch button[aria-pressed='true'] { border-color: #e9d2e2; color: var(--rose-deep); background: #fffaff; box-shadow: 0 1px 4px #a2708c24; }
[data-person='tree'] .writer-switch { border-color: #d9e6dd; background: #eef4ef; }
[data-person='tree'] .writer-switch button { color: #426654; }
[data-person='tree'] .writer-switch button[aria-pressed='true'] { border-color: #ccddd1; background: #fafffa; }
.mood-selection { margin: 6px 0 0; color: #7a5269; font-size: .76rem; }
.mood-selection:empty { display: none; }
[data-person='tree'] .mode-switch button[aria-pressed='true'] { border-color: #8ead99; color: #355c4d; background: #eaf4ee; }
.sync-status { font-size: .8rem; text-align: right; }
.sync-status:empty { display: none; }
.sync-status[data-error='true'] { color: #9e2d5e; }

.card { min-width: 0; padding: 20px; border: 1px solid #efdeeb; border-radius: 23px; background: #fffcff; box-shadow: 0 7px 20px #8c527912; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.025em; font-weight: 850; }
.section-intro { margin-top: 5px; font-size: .87rem; color: var(--muted); }
.mood-composer { max-width: 650px; margin-inline: auto; }
#mood-editor > .section-header { max-width: 650px; margin-inline: auto; }
.paper-section-header { margin-bottom: 10px; }
.paper-composer { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); gap: 22px; max-width: 710px; margin-inline: auto; }
.paper-controls, .paper-work { min-width: 0; }
.mood-presets { margin: 13px 0 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mood-choice {
  --tile: #fff0f4; --tile-line: #f2d9e6;
  position: relative; min-height: 88px; padding: 7px 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #5e4059; background: var(--tile); border: 1px solid var(--tile-line); border-radius: 15px;
  font-weight: 750; font-size: .87rem; line-height: 1.25;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.mood-choice:nth-child(2) { --tile: #fff7df; --tile-line: #f2e6bc; }
.mood-choice:nth-child(3) { --tile: #f4efff; --tile-line: #e6dbf8; }
.mood-choice:nth-child(4) { --tile: #eff0ff; --tile-line: #dfe2f9; }
.mood-choice:nth-child(5) { --tile: #ffefe9; --tile-line: #f1ddd2; }
.mood-choice:nth-child(6) { --tile: #f9edff; --tile-line: #ebd8f3; }
#record-panel[data-person='tree'] .mood-choice { --tile: #eaf4ed; --tile-line: #d9e7dd; color: #435f53; }
#record-panel[data-person='tree'] .mood-choice:nth-child(3n+2) { --tile: #eef1f9; --tile-line: #dce4ee; color: #526178; }
#record-panel[data-person='tree'] .mood-choice:nth-child(3n+3) { --tile: #faf2e5; --tile-line: #ede0d0; color: #725d44; }
#record-panel[data-person='tree'] .mood-choice[aria-pressed='true'] { border-color: #68907c; box-shadow: inset 0 0 0 1px #68907c, 0 2px 5px #678a7720; }
#record-panel[data-person='tree'] .mood-choice[aria-pressed='true']::after { background: #4f7864; }
.mood-choice:hover { transform: translateY(-2px); box-shadow: 0 4px 8px #a078981f; }
.mood-choice[aria-pressed='true'] { border-color: #b74b7d; box-shadow: inset 0 0 0 1px #b74b7d, 0 2px 5px #a0789821; }
.mood-choice[aria-pressed='true']::after {
  content: '✓'; position: absolute; right: 5px; top: 5px;
  width: 17px; height: 17px; display: grid; place-items: center;
  border-radius: 50%; background: var(--rose); color: #fff;
  font: 800 10px/1 system-ui, sans-serif;
}
.mood-icon { font: 2rem/1.12 var(--emoji); }
.mineral-water-icon { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.22em; }
.more-moods-heading { margin: 13px 0 6px; color: #684860; font-size: .92rem; }
.mood-chips { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.mood-chips .mood-choice { flex-direction: row; justify-content: flex-start; gap: 4px; min-height: 44px; padding: 4px 8px; border-radius: 999px; white-space: nowrap; font-size: .8rem; }
.mood-chips .mood-icon { font-size: 1.12rem; }
.mood-chips .mood-choice[aria-pressed='true']::after { content: none; }
#mood { min-height: 44px; padding-block: 8px; }
.form-label { margin-top: 12px; margin-bottom: 5px; }
.optional { color: var(--muted); font-size: .78rem; font-weight: 500; }
.paper-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-bottom: 12px; }
.paper-option { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; gap: 4px; min-height: 67px; padding: 5px 1px; border: 1px solid #eae1d6; border-radius: 10px; background: #fffcf6; color: #685240; font-size: .74rem; line-height: 1.25; }
.paper-option[aria-pressed='true'] { border-color: #b96678; box-shadow: inset 0 0 0 1px #b96678; color: #8c3855; background: #fff4f3; font-weight: 750; }
.paper-sample { width: 27px; aspect-ratio: 400 / 610; border: 1px solid #ded6c7; box-shadow: 1px 2px 2px #8b715227; }
[data-paper='double-lemon'] { background-image: url('/paper/double-lemon.svg'); }
[data-paper='lemon-slices'] { background-image: url('/paper/lemon-slices.svg'); }
[data-paper='lemon-grid'] { background-image: url('/paper/lemon-grid.svg'); }
[data-paper='lemon-lines'] { background-image: url('/paper/lemon-lines.svg'); }
.paper-sheet, .paper-sample { background-position: center; background-size: 100% 100%; background-repeat: no-repeat; background-color: #fffaf1; }
.paper-sheet { position: relative; width: min(100%, 300px); aspect-ratio: 400 / 610; margin: 0 auto; outline: 1px solid #efe6d7; box-shadow: 0 5px 14px #62482d22; }
.writing-paper { width: min(100%, 340px); cursor: text; }
.paper-text { position: absolute; inset: 28.5% 17% 29.7%; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #473a2c; font-size: 1rem; line-height: 1.55; overflow-y: auto; scrollbar-width: thin; white-space: pre-wrap; overflow-wrap: anywhere; }
textarea.paper-text { display: block; width: 66%; height: 41.8%; resize: none; }
[data-paper='lemon-lines'] .paper-text { top: 36%; left: 23%; }
[data-paper='lemon-lines'] textarea.paper-text { width: 60%; height: 34.3%; }
.paper-sheet[data-adjusted='true'] > .paper-text {
  inset: var(--writing-top) auto auto var(--writing-left);
  width: var(--writing-width);
  height: var(--writing-height);
  padding: 4px;
  border-radius: 5px;
  background: rgba(255, 251, 238, .58);
  font-size: var(--writing-font);
}
.writing-paper[data-adjusted='true'] > .paper-text { outline: 1px dashed #b38b7269; }
.writing-paper[data-adjusted='true'] > .paper-text:focus-visible { outline: 2px solid #b45d83; outline-offset: 2px; }
textarea.paper-text::placeholder { color: #7e6750; }
.paper-adjusters { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 5px 3px 10px; border: 1px solid #efe0db; border-radius: 11px; background: #fffbf6; color: #654637; font-size: .84rem; font-weight: 760; }
.font-stepper { display: inline-flex; align-items: center; gap: 4px; }
.font-stepper output { min-width: 47px; color: #6a4c41; text-align: center; font-variant-numeric: tabular-nums; }
.font-stepper button { width: 44px; min-height: 44px; padding: 0; border: 1px solid #eaddd4; border-radius: 8px; color: var(--rose-deep); background: #fff9f7; font-size: 1.22rem; line-height: 1; }
.font-stepper button:disabled { opacity: .4; }
.paper-sizing { margin: 3px 0 0; }
.paper-sizing summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 5px; color: #735749; font-size: .79rem; cursor: pointer; }
.paper-sizing summary::-webkit-details-marker { display: none; }
.paper-sizing summary::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.paper-sizing[open] summary::after { transform: rotate(225deg); }
.paper-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; min-width: 0; padding: 4px 8px; border: 1px solid #efe0db; border-radius: 10px; background: #fffbf6; }
.paper-settings label { display: block; min-width: 0; color: #654637; font-size: .73rem; }
.paper-settings label span { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 3px; }
.paper-settings output { font-variant-numeric: tabular-nums; }
.paper-settings input { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: #a6496b; }
.paper-count { margin: 6px auto 0; width: min(100%, 340px); text-align: right; color: #785a73; font-size: .74rem; }
.entry-actions { margin-top: 12px; }
.entry-actions .button { width: 100%; }
.post-actions { margin: 13px 0 0; padding: 10px 12px; border: 1px solid #e9d6e5; border-radius: 14px; background: #fbf1f9; font-size: .88rem; font-weight: 700; }
.state-empty { margin-top: 10px; padding: 13px; border: 1px dashed #e7cee3; border-radius: 13px; background: #fffbffb8; color: var(--muted); font-size: .87rem; }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 0 0; color: var(--rose-deep); border: 0; background: transparent; font-size: .87rem; font-weight: 800; text-underline-offset: 4px; }
.text-button:hover { text-decoration: underline; }

.timeline-card { margin-top: 10px; }
.timeline-list { position: relative; display: grid; gap: 12px; margin: 14px 0 0; padding: 0 0 0 18px; list-style: none; }
.timeline-list::before { content: ''; position: absolute; left: 3px; top: 21px; bottom: 18px; width: 1px; background: #eccbdd; }
.timeline-item { position: relative; min-width: 0; }
.timeline-item::before { content: ''; position: absolute; left: -18px; top: 21px; width: 7px; height: 7px; border-radius: 50%; background: #bc5582; outline: 3px solid #f6e3ed; }
.box-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); padding-left: 0; }
.box-list::before, .box-list .timeline-item::before { content: none; }
.mood-entry { min-width: 0; padding: 13px; border: 1px solid #edd9eb; border-radius: 16px; background: #fcf5ff; }
.timeline-item[data-needs-care='true'] .mood-entry { background: #fff0f5; border-color: #f1d6e3; }
.mood-entry-header { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px 9px; }
.mood-entry-header :is(h3, h5) { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 1rem; font-weight: 850; }
.mood-entry-header :is(h3, h5) span { display: inline-block; margin-right: 6px; font: 1.38rem/1 var(--emoji); }
.mood-entry-header time { font-size: .75rem; color: var(--muted); }
.entry-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 8px; }
.author-tag { display: inline-flex; align-items: center; min-height: 21px; padding: 1px 6px; color: #913c66; background: #f8e7f1; border-radius: 999px; font-size: .72rem; }
.entry-moods { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 8px 0 5px; padding: 0; }
.entry-moods li { padding: 3px 7px; border-radius: 999px; border: 1px solid #ecd8e6; background: #fff9ff; color: #734961; font-size: .76rem; overflow-wrap: anywhere; }
.chip-icon { margin-right: 4px; }
.timeline-item[data-person='tree'] .mood-entry { background: #f1f8f2; border-color: #d9e8de; }
.timeline-item[data-person='tree'] .entry-moods li, .timeline-item[data-person='tree'] .author-tag { color: #426451; border-color: #d5e3da; background: #eaf3eb; }
.entry-note { margin-top: 7px; font-size: .94rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-paper { margin: 12px auto; }
.entry-paper .entry-note { margin: 0; }
.entry-reactions { display: flex; flex-wrap: wrap; gap: 7px; }
.entry-reactions:not(:empty) { margin-top: 9px; }
.note-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.note-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 5px 9px; border: 1px solid #e8d6e3; border-radius: 999px; background: #fffaff; color: #7f3457; font-size: .78rem; font-weight: 750; }
.note-action.to-box { background: #f4e5f2; }
.note-action.in-box { background: #f9edf2; }
.note-action:hover:not(:disabled) { border-color: #c07d9c; background: #f8e8f3; }
.note-action:disabled { opacity: .68; }
.reaction-button { display: inline-flex; align-items: center; min-height: 44px; padding: 5px 9px; border: 1px solid #ebd4e5; border-radius: 11px; background: #fffaff; color: #922f5c; font-size: .8rem; font-weight: 750; }
.reaction-button[data-sent='true'] { background: #f8e7f0; }
button.reaction-button:hover:not(:disabled) { background: #fbe6f0; }
.remove-entry { margin-left: auto; color: #805970; }
.more-entries { margin-top: 13px; }
.history-card { --history-mood: #a83e6c; --history-paper: #986125; margin-top: 10px; }
.history-views { margin: 8px 0 0; }
.history-archive { padding: 4px 0 0; }
.history-scopes { display: inline-flex; flex-wrap: wrap; margin: 10px 0 14px; }
.history-scopes [data-history-author='tree'][aria-pressed='true'] { color: #366148; background: #f0f8ef; border-color: #dce9df; }
.history-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.history-month-pane, .history-day-pane, .history-breakdown { min-width: 0; }
.history-month-pane { padding: 12px; border: 1px solid #f0e1ee; border-radius: 18px; background: #fcf7fe; }
.history-day-pane { padding: 12px; border: 1px solid #f0e1ee; border-radius: 18px; background: #fffaff; }
.history-month-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 5px; }
.history-month-nav h3 { text-align: center; font-size: clamp(.95rem, 3.5vw, 1.12rem); line-height: 1.3; font-weight: 830; }
.history-month-arrow, .history-today { min-height: 44px; min-width: 44px; padding: 0 8px; border: 1px solid #ebdce9; border-radius: 12px; background: #fffaff; color: var(--rose-deep); font-size: .81rem; font-weight: 740; }
.history-month-arrow { padding: 0 4px; font-size: 1.42rem; line-height: 1; }
.history-month-arrow:disabled { opacity: .43; }
.history-month-arrow:not(:disabled):hover, .history-today:hover { border-color: #cf9bbb; background: #fff1f8; }
.history-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0 8px; }
.history-totals div { display: grid; align-content: center; justify-items: center; gap: 1px; padding: 7px 5px; border: 1px solid #efd9e6; border-radius: 11px; background: #fceef4; color: #813651; }
.history-totals div:last-child { border-color: #f1e1c7; background: #fff6e6; color: #784d21; }
.history-totals dt { font-size: .78rem; }
.history-totals dd { font-size: 1.23rem; font-weight: 830; line-height: 1.2; font-variant-numeric: tabular-nums; }
.history-week, .history-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.history-week { padding: 1px 0 4px; color: var(--muted); text-align: center; font-size: .74rem; }
.history-day, .history-calendar-blank { min-width: 0; min-height: 44px; }
.history-day { display: grid; grid-template-rows: auto 7px; align-content: center; justify-items: center; gap: 2px; padding: 1px 0; border: 1px solid #f1e5ef; border-radius: 9px; background: #fffaff; color: var(--ink); font-size: .87rem; font-weight: 690; font-variant-numeric: tabular-nums; }
.history-day:hover { border-color: #dbabc7; background: #fff2f8; }
.history-day[aria-current='date'] { border-color: #bf7ca6; }
.history-day[aria-pressed='true'] { border-color: #ab4f7d; box-shadow: inset 0 0 0 1px #ab4f7d; background: #f9e4f0; color: #79284f; }
.history-day-marks { display: flex; align-items: center; gap: 3px; }
.history-mark { display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 999px; }
.history-mark.is-mood { background: var(--history-mood); }
.history-mark.is-paper { background: var(--history-paper); }
.history-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 13px; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.history-key span { display: inline-flex; align-items: center; gap: 4px; }
.history-day-pane > h3, .history-breakdown > h3 { font-size: .98rem; font-weight: 820; }
.history-entry-group > h4 { margin: 8px 0 4px; color: #6d4965; font-size: .79rem; }
.history-entry-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.history-entry-list .timeline-item::before { content: none; }
.history-entry-list .mood-entry { padding: 8px; }
.history-entry-list .entry-paper { width: min(100%, 250px); margin-bottom: 4px; }
.history-entry-list .entry-note { font-size: .92rem; }
.history-entry-list .paper-sheet[data-adjusted='true'] > .paper-text { font-size: var(--writing-font); }
.history-retry { padding-top: 0; }
.history-breakdown { grid-column: 1 / -1; }
.history-breakdown ul { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 8px 0 0; padding: 0; }
.history-breakdown li, .history-mood-label { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.history-breakdown li { max-width: 100%; padding: 3px 7px; border: 1px solid #ead9e7; border-radius: 999px; background: #fff7fd; color: #724b67; font-size: .76rem; }
.history-mood-label { overflow-wrap: anywhere; }
.history-mood-icon { font-family: var(--emoji); }
.history-mood-icon img { width: 16px; height: 16px; vertical-align: middle; }
.history-mood-count { color: #803057; font-variant-numeric: tabular-nums; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 13px 0 max(23px, env(safe-area-inset-bottom)); color: #8d6985; }
.site-footer .flower { width: 16px; height: 16px; }

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 448px); }
  .site-header { min-height: 59px; }
  .wordmark { font-size: .85rem; gap: 7px; }
  .brand-icon { width: 30px; height: 30px; border-radius: 10px; }
  .brand-icon .flower { width: 20px; height: 20px; }
  .header-meta { min-height: 32px; }
  .gate { margin-top: 14px; padding: 10px; border-radius: 27px; }
  .gate-art { height: 192px; border-radius: 20px; }
  .gate-art img { height: 194px; }
  .gate-copy { padding: 19px 12px 17px; }
  .gate h1 { font-size: clamp(1.65rem, 7.6vw, 2rem); }
  .unlock-form { margin-top: 18px; }
  .pond { margin-top: 0; }
  .pond-banner { min-height: 90px; padding: 11px 13px; border-radius: 19px; }
  .pond-banner h1 { max-width: min(100%, 13rem); font-size: clamp(1.05rem, 5.2vw, 1.4rem); }
  .banner-sticker { right: -8px; width: 36%; height: 96px; }
  .anniversary-stamp { margin-top: 5px; padding: 3px 5px; font-size: .68rem; }
  .pond-toolbar { margin: 9px 0 8px; gap: 5px; }
  .view-tab { padding: 0 8px; font-size: .83rem; }
  .sync-status { font-size: .73rem; }
  .history-layout { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .history-month-pane, .history-day-pane { padding: 8px; border-radius: 13px; }
  .paper-composer { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .writer-switch { margin-bottom: 10px; }
  .paper-picker { margin-bottom: 7px; }
  .paper-option { min-height: 58px; }
  .paper-sample { width: 24px; }
  .writing-paper .paper-text { scroll-margin-block: 60px 24px; }
  .card { padding: 12px; border-radius: 18px; }
  .card h2 { font-size: 1.08rem; }
  .mood-presets { margin-top: 9px; gap: 6px; }
  .mood-choice { min-height: 75px; border-radius: 12px; }
  .mood-icon { font-size: 1.73rem; }
  .site-footer { padding-top: 11px; }
}

@media (max-width: 370px) {
  .shell { width: calc(100% - 19px); }
  .view-tab { padding: 0 5px; }
  .history-week, .history-calendar { gap: 3px; }
  .banner-sticker { right: -13px; }
  .mood-choice { min-height: 69px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
