:root {
  font-family: system-ui, sans-serif;
  color: #252923;
  background: #f8f7f2;
  color-scheme: light;
  --green: #2c513e;
  --soft-green: #e8efe6;
  --muted: #596057;
  --line: #dbe0d6;
  --surface: #fffefa;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
a { color: var(--green); text-underline-offset: .2em; }
button, input { font: inherit; }
button, a, label:has(input) { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #2e6f50; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(71rem, calc(100% - 3rem)); margin-inline: auto; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .account { display: flex; align-items: center; gap: 1rem; }
.topbar-inner { justify-content: space-between; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: #fff; background: var(--green); }
.account { color: var(--muted); font-size: .875rem; }
.quiet { display: inline-flex; min-height: 2.5rem; align-items: center; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--green); background: var(--surface); cursor: pointer; text-decoration: none; }
.quiet:hover { background: var(--soft-green); }
.centered { display: grid; justify-items: center; padding-block: clamp(2rem, 10vh, 6rem); }
.login { width: min(100%, 26rem); }
.diary { display: grid; grid-template-columns: minmax(21rem, 24rem) minmax(0, 1fr); align-items: start; gap: clamp(1.5rem, 4vw, 3.25rem); padding-block: clamp(1.25rem, 5vw, 3.5rem); }
.panel { border: 1px solid var(--line); border-radius: 1.15rem; background: var(--surface); padding: clamp(1.1rem, 3vw, 1.75rem); box-shadow: 0 2px 6px #20392507; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-size: clamp(1.55rem, 3.5vw, 2rem); font-weight: 720; letter-spacing: -.045em; line-height: 1.12; }
h1 { margin-bottom: 1.35rem; }
h2 { margin-bottom: 1.25rem; }
h3 { font-size: 1rem; margin-bottom: .6rem; }
.stack { display: grid; gap: 1rem; }
.field { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.field, legend { font-size: .9375rem; font-weight: 650; }
.hint { color: var(--muted); font-size: .875rem; font-weight: 400; }
.field input { min-width: 0; width: 100%; padding: .65rem .75rem; min-height: 2.9rem; border: 1px solid #c6cdc3; border-radius: .55rem; background: white; color: inherit; font-size: 1rem; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: .4rem; padding: 0; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.choices label { position: relative; }
.choices input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.choices span { display: grid; place-items: center; padding: .6rem .2rem; min-height: 2.75rem; border: 1px solid var(--line); border-radius: .55rem; font-size: .9rem; font-weight: 600; }
.choices input:checked + span { border-color: #749582; background: var(--soft-green); color: var(--green); }
.choices input:focus-visible + span { outline: 2px solid #2e6f50; outline-offset: 2px; }
.upload { position: relative; display: grid; overflow: hidden; gap: .2rem; background: #f4f6ef; border: 1px dashed #9baa99; border-radius: .75rem; text-align: center; }
.upload:focus-within { outline: 2px solid #2e6f50; outline-offset: 2px; }
.upload:hover { background: var(--soft-green); }
.upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload img { width: 100%; height: 9rem; object-fit: cover; }
.upload-body { min-width: 0; display: grid; justify-items: center; gap: .25rem; padding: .75rem .5rem; }
.upload-icon { color: var(--green); font-size: 1.4rem; line-height: 1; }
.upload strong { max-width: 100%; color: var(--green); overflow-wrap: anywhere; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; line-height: 1.35; }
.check input { width: 1rem; height: 1rem; flex: none; margin: .1rem 0 0; accent-color: var(--green); }
.primary { min-height: 3rem; padding: .6rem .9rem; border: 1px solid transparent; border-radius: .6rem; color: #fff; background: var(--green); cursor: pointer; font-weight: 700; }
.primary:hover { background: #21412f; }
.error, .success { padding: .65rem .8rem; border-radius: .5rem; line-height: 1.35; font-size: .9rem; }
.error { color: #8d2820; background: #faf0ed; }
.success { color: #2c513e; background: var(--soft-green); }
.history-switch { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.history-switch [aria-current="page"] { border-color: #749582; background: var(--soft-green); font-weight: 650; }
.empty { display: grid; place-items: center; min-height: 9rem; color: var(--muted); border: 1px dashed #bcc7b9; border-radius: .8rem; background: #f3f4ed; }
.day + .day { margin-top: 1.4rem; }
.cards { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); align-items: start; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); }
.card a { display: block; text-decoration: none; color: inherit; border-radius: inherit; overflow: hidden; }
.card a:hover strong { text-decoration: underline; text-underline-offset: .2em; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--soft-green); }
.card-caption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem; padding: .65rem; font-size: .9rem; }
.card-caption time { color: var(--muted); font-variant-numeric: tabular-nums; }
.comments { display: grid; gap: .65rem; border-top: 1px solid var(--line); padding: .7rem; }
.comment-list { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.comment-list li + li { border-top: 1px solid var(--line); padding-top: .55rem; }
.comment-list li:target { scroll-margin-block: 1rem; background: var(--soft-green); }
.comment-list p { margin-top: .2rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .5rem; font-size: .875rem; }
.comment-meta time { color: var(--muted); }
.comment-form { display: grid; gap: .45rem; justify-items: start; }
.comment-form textarea { width: 100%; min-width: 0; padding: .5rem .6rem; resize: vertical; border: 1px solid #c6cdc3; border-radius: .5rem; font: inherit; }
.comment-form button { font-size: .875rem; }
.pagination { display: flex; gap: .65rem; margin-top: 1.25rem; }
@media (max-width: 720px) {
  .shell { width: min(35rem, calc(100% - 1.5rem)); }
  .diary { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .topbar-inner { min-height: 3.75rem; }
  .brand, .account { gap: .45rem; }
  .brand { font-size: .9rem; }
  .brand-mark { width: 1.65rem; height: 1.65rem; }
  .account span { display: none; }
}
