:root {
  color-scheme: light;
  --paper: #f7f2e8;
  --white: #fffaf0;
  --ink: #33251c;
  --muted: #6f5c4d;
  --reds: #9d2d23;
  --dark-red: #782218;
  --line: #dac9b7;
  --wood: #efd3a8;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK JP", serif;
  --sans: system-ui, "Hiragino Sans", "Yu Gothic", sans-serif;
  font: 16px / 1.65 var(--sans);
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--dark-red); text-underline-offset: .24em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--reds); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
.shell { width: min(100% - 2rem, 67.5rem); margin-inline: auto; }
.skip { position: absolute; transform: translateY(-200%); background: var(--white); padding: .65rem 1rem; z-index: 1; }
.skip:focus { transform: none; }
.masthead { border-top: 4px solid var(--reds); border-bottom: 1px solid var(--line); }
.topbar { min-height: 4.6rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding-block: .45rem; }
.wordmark { font: 700 clamp(1.1rem, 3vw, 1.5rem) / 1.2 var(--serif); letter-spacing: .04em; text-decoration: none; color: var(--ink); display: flex; align-items: center; min-height: 44px; gap: .55rem; }
.mark { width: 22px; height: 20px; display: grid; place-items: center; background: var(--reds); clip-path: polygon(50% 0, 100% 35%, 100% 100%, 0 100%, 0 35%); }
.mark::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--paper); margin-top: -5px; }
nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; }
.topbar nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .83rem; white-space: nowrap; text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.topbar nav .write-link { padding-inline: .7rem; border: 1px solid var(--line); border-radius: .3rem; }
.hero { display: grid; gap: 2rem; padding-block: 2.2rem 2.7rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.3rem); letter-spacing: .055em; line-height: 1.29; }
.hero-copy > p { margin-top: 1rem; color: var(--muted); }
.hero-copy .daily { font-size: .87rem; margin-top: 1.25rem; }
.daily strong { color: var(--reds); font-size: 1.25rem; margin-inline: .15em; font-variant-numeric: tabular-nums; }
.write-panel { background: var(--white); border: 1px solid var(--line); border-radius: .55rem; padding: clamp(1rem, 3vw, 1.6rem); scroll-margin-top: 1rem; }
.write-panel h2 { margin-bottom: 1rem; }
.field-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
label, legend { font-weight: 600; font-size: .875rem; }
output { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
textarea, .signature input { width: 100%; color: var(--ink); border: 1px solid #ad9984; border-radius: .3rem; padding: .6rem .75rem; background: var(--white); }
textarea { display: block; resize: vertical; margin-top: .3rem; }
::placeholder { color: var(--muted); opacity: 1; }
.hint { font-size: .75rem; color: var(--muted); margin-top: .35rem; }
fieldset { padding: 0; margin: .85rem 0 0; border: 0; min-inline-size: 0; }
.category > div { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.category label { position: relative; }
.category input { position: absolute; opacity: 0; top: 50%; left: 50%; pointer-events: none; }
.category span { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .62rem; border: 1px solid #ad9984; border-radius: .3rem; cursor: pointer; font-size: .8rem; }
.category input:checked + span { color: var(--white); background: var(--reds); border-color: var(--reds); }
.category input:focus-visible + span { outline: 3px solid var(--reds); outline-offset: 2px; }
.form-end { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem .8rem; margin-top: .85rem; }
.signature { flex: 1 1 9rem; }
.signature span { color: var(--muted); font-weight: 400; margin-left: .35em; font-size: .75rem; }
.signature input { display: block; margin-top: .3rem; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; border-radius: .3rem; padding: .45rem .8rem; font-size: .875rem; font-weight: 650; text-decoration: none; }
.primary { background: var(--reds); color: var(--white); border: 1px solid var(--reds); }
.primary:hover { background: var(--dark-red); }
.secondary { color: var(--dark-red); background: var(--white); border: 1px solid var(--line); }
.secondary:hover:not(:disabled) { border-color: var(--reds); }
.primary:disabled, .secondary:disabled { opacity: .75; }
.feedback { color: var(--dark-red); font-size: .82rem; }
.feedback:not(:empty) { margin-top: .55rem; }
.board { padding-block: 1.25rem 2.1rem; border-top: 1px solid var(--line); scroll-margin-top: .75rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: 1.05rem; }
.section-heading h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
.section-heading p { color: var(--muted); font-size: .8rem; }
.empty { color: var(--muted); font-size: .9rem; padding-block: .75rem; }
.cards { display: grid; gap: 1.05rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.ema-card { min-width: 0; container-type: inline-size; }
.plaque { position: relative; isolation: isolate; display: flex; min-height: 12.2rem; flex-direction: column; padding: 2.25rem 1rem .9rem; }
.plaque::before, .plaque::after { content: ""; position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 21px, 100% 100%, 0 100%, 0 21px); z-index: -2; }
.plaque::before { background: #c69a6c; }
.plaque::after { inset: 1px; background: repeating-linear-gradient(2deg, transparent 0 16px, #9b633a10 16px 17px, transparent 17px 24px), var(--wood); z-index: -1; }
.tie { position: absolute; top: 8px; left: 50%; translate: -50% 0; width: 11px; height: 11px; border: 2px solid #d1a877; border-radius: 100%; background: #624129; }
.tie::before { content: ""; position: absolute; left: 3px; top: -11px; width: 3px; height: 14px; rotate: 19deg; border-radius: 3px; background: var(--reds); }
.card-top, .card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; color: #604229; font-size: .73rem; }
.card-top { min-height: 1.25rem; }
.category-label { font-weight: 750; }
.seed { border-left: 1px solid #a88765; padding-left: .55rem; }
.rank { color: var(--dark-red); font-weight: 700; }
.wish-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(1.06rem, 5.2cqi, 1.35rem); margin: .55rem 0 .8rem; line-height: 1.65; }
.wish-text a { display: block; color: inherit; text-decoration: none; min-height: 44px; }
.wish-text a:hover { text-decoration: underline; }
.card-meta { margin-top: auto; padding-right: 3.1rem; overflow-wrap: anywhere; }
.stamp { position: absolute; right: .8rem; bottom: .64rem; width: 2.65rem; height: 2.65rem; display: grid; place-content: center; text-align: center; rotate: -9deg; border: 2px solid currentColor; border-radius: .35rem; color: #952b22ce; font: 750 .69rem / 1.05 var(--serif); pointer-events: none; }
.stamp[data-tier="1"] { opacity: .82; }
.stamp[data-tier="50"], .stamp[data-tier="100"] { outline: 1px solid currentColor; outline-offset: 2px; inset-inline-end: .95rem; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .55rem; padding-top: .45rem; }
.tally, .weekly-count { font-size: .73rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.weekly-count { color: var(--dark-red); }
.quiet { border: 0; background: none; color: var(--dark-red); padding: 0 .2rem; font-size: .8rem; text-align: start; min-height: 44px; text-decoration: underline; text-underline-offset: .23em; }
.report-button { margin-left: auto; }
.after-bless { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .75rem; font-size: .8rem; }
.after-bless a, .pagination a, .back { display: inline-flex; align-items: center; min-height: 44px; }
.bless.just-blessed { animation: bless .4s ease both; }
@keyframes bless { 45% { transform: scale(1.045); background: var(--wood); } }
.pagination { justify-content: center; margin-top: 1.55rem; font-size: .88rem; }
.detail, .prose { max-width: 43rem; margin: 1.7rem auto 3rem; }
.detail .plaque { min-height: 15rem; padding: 3rem 1.35rem 1rem; }
.detail .wish-text { font-size: clamp(1.35rem, 4.5cqi, 2.05rem); }
.number { margin: 1rem 0 .75rem; font-size: .9rem; color: var(--muted); }
.posted { font: 700 clamp(1.35rem, 4vw, 2rem) / 1.5 var(--serif); margin-top: 1rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1.2rem; }
.share > a:not(.primary) { display: inline-flex; align-items: center; min-height: 44px; }
.prose h1 { font-size: clamp(1.7rem, 5vw, 2.45rem); padding-top: .75rem; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6rem; }
.prose p, .prose > a { margin-top: .8rem; }
.prose ul { padding-left: 1.4em; }
.contact-address { overflow-wrap: anywhere; }
.footer { padding-block: 1.35rem 2rem; border-top: 1px solid var(--line); }
.footer a, .footer p { font-size: .81rem; }
.footer a { display: inline-flex; align-items: center; min-height: 44px; }
.footer p { color: var(--muted); }
dialog { color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: .5rem; width: min(100% - 2rem, 27rem); padding: 1.25rem; }
dialog::backdrop { background: #33251c80; }
dialog label { display: flex; gap: .5rem; align-items: center; min-height: 44px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
@media (min-width: 48rem) {
  .shell { width: min(100% - 4rem, 67.5rem); }
  .hero { grid-template-columns: .88fr 1fr; gap: 2.5rem; padding-block: 3.5rem; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::after, *::before { animation-duration: .001ms !important; } }
