:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: #222923;
  background: #eeeee9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(100%, 49rem); margin: auto; padding: clamp(1rem, 5vw, 2.5rem); }
header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); letter-spacing: -.045em; line-height: 1.05; margin: .3rem 0; }
h2 { font-size: 1.25rem; margin: 0; }
summary { cursor: pointer; font-weight: 600; }
details form, #earlier { margin-top: 1rem; }
#password p { margin: 0; }
.journal-date { color: #4d5b51; font-size: .875rem; justify-self: end; }
.mode, .muted, .stats span { color: #4d5b51; }
.mode { margin: 0; font-size: .875rem; }
.panel { background: #fff; padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid #dce1d8; border-radius: 1.2rem; margin-bottom: 1rem; }
form, label { display: grid; gap: .55rem; }
form { gap: 1rem; }
label { font-weight: 600; }
input, textarea, select, button { font: inherit; }
input:not([type=checkbox]), textarea, select {
  width: 100%; min-height: 2.8rem; border: 1px solid #a1afa3; border-radius: .65rem; padding: .55rem .75rem; background: #fff;
}
textarea { resize: vertical; }
button { justify-self: start; border: 1px solid #20583e; background: #20583e; color: white; border-radius: .7rem; padding: .6rem 1rem; min-height: 2.75rem; cursor: pointer; }
button.quiet { background: transparent; color: #20583e; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #426cca; outline-offset: 2px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.stats strong { display: block; font-size: clamp(1rem, 4vw, 1.4rem); }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.toggle { display: flex; align-items: baseline; }
#messages { display: grid; gap: .75rem; max-height: 54vh; overflow: auto; margin: 1rem 0; overflow-wrap: anywhere; }
.bubble { white-space: pre-wrap; margin: 0; border-radius: .8rem; padding: .65rem .85rem; background: #f0f1ee; justify-self: start; max-width: 95%; }
.question { background: #dfefe2; justify-self: end; }
#notice { min-height: 1.5rem; font-weight: 600; }
