@font-face {
  font-family: Inter;
  src: url("/fonts/inter-latin-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --card: #fffdf9;
  --ink: #191817;
  --muted: #625951;
  --line: #d8cfc3;
  --red: #b9232c;
  --blush: #f5e5df;
  --sage: #dee7d8;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font: 1rem/1.55 Inter, system-ui, sans-serif; }
button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.shell { width: min(100% - 2.25rem, 42rem); margin-inline: auto; }
.top { padding-top: env(safe-area-inset-top); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 3.75rem; gap: .75rem; }
.brand { text-decoration: none; font-weight: 900; letter-spacing: -.04em; }
.brand span, .red { color: var(--red); }
.top button, .views button, .text-button { min-height: 44px; background: transparent; border: 0; font-weight: 650; }
.top button { color: var(--muted); padding-inline: .5rem; font-size: .875rem; }
main { min-height: calc(100vh - 9rem); padding-block: 1.1rem 2rem; }
.views { display: flex; gap: .25rem; margin-bottom: 2rem; padding: .22rem; background: #ede8e0; border-radius: .8rem; }
.views button { flex: 1; border-radius: .63rem; font-size: .9rem; color: var(--muted); }
.views button[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: 0 1px 3px #20180c15; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.65rem, 10vw, 4.65rem); line-height: 1.02; letter-spacing: -.065em; font-weight: 780; margin-bottom: .72rem; }
h2 { font-size: 1.25rem; line-height: 1.27; letter-spacing: -.035em; }
h3 { font-size: 1rem; margin-top: 1.25rem; margin-bottom: .2rem; }
.label { font-size: .73rem; font-weight: 700; letter-spacing: .085em; text-transform: uppercase; color: var(--muted); }
#today-date { margin-bottom: .48rem; }
.intro { color: var(--muted); font-size: 1.12rem; margin-bottom: 1.2rem; }
#capture-form, .panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--card); padding: clamp(.85rem, 4vw, 1.35rem); }
form label { display: block; margin: .6rem 0 .3rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
textarea, select, input { border: 1px solid #bdb3a8; border-radius: .55rem; padding: .55rem .7rem; background: var(--card); min-height: 44px; min-width: 0; }
textarea { display: block; width: 100%; resize: vertical; min-height: 5.6rem; }
select { width: 100%; }
.controls { display: grid; grid-template-columns: 1fr 1.4fr; gap: .5rem; margin-top: .8rem; }
.primary, .secondary { border: 1px solid var(--line); border-radius: .58rem; min-height: 44px; padding: .55rem .77rem; background: var(--card); font-size: .875rem; font-weight: 700; }
.primary { background: var(--ink); border-color: var(--ink); color: white; }
.secondary:hover, .secondary[aria-pressed="true"], .recording { background: var(--blush); }
.link-button { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.muted { color: var(--muted); font-size: .875rem; }
.form-status:not(:empty), .feedback:not(:empty) { margin-top: .65rem; color: var(--muted); }
.today-entries, .year-review, #timeline { margin-top: 1.35rem; }
.entry-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; align-items: start; border-bottom: 1px solid var(--line); padding: .75rem 0; }
.entry-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .2rem; }
.text-button { min-width: 44px; padding: .45rem .55rem; color: var(--red); font-size: .85rem; }
.timeline-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.timeline-heading h2 { flex: 1 0 min(100%, 12rem); }
.date-nav { display: grid; grid-template-columns: 2.75rem 1fr 2.75rem; gap: .3rem; align-items: center; text-align: center; margin-bottom: .6rem; }
.arrow, .day { min-height: 44px; border: 0; border-radius: .5rem; background: transparent; font-weight: 600; }
.arrow { background: var(--paper); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; gap: .16rem; }
.weekday { color: var(--muted); font-size: .75rem; font-weight: 650; }
.day { position: relative; padding: 0; }
.day:not(:disabled):hover, .day[aria-pressed="true"] { background: var(--blush); }
.day[aria-current="date"] { box-shadow: inset 0 0 0 1px #ab9987; }
.day.recorded::after { content: ""; position: absolute; left: calc(50% - 2.5px); bottom: 4px; background: var(--red); border-radius: 50%; width: 5px; height: 5px; }
.calendar-key { margin-top: .5rem; }
.period-tabs { display: flex; gap: .45rem; margin: .9rem 0; }
.chart { list-style: none; padding: 0; margin: .75rem 0 0; }
.chart li { display: grid; grid-template-columns: 5.15rem minmax(1rem, 1fr) 2rem; gap: .45rem; align-items: center; padding-block: .24rem; font-size: .875rem; }
.chart li span:last-child { text-align: end; font-variant-numeric: tabular-nums; }
meter { width: 100%; height: 1.2rem; }
meter::-webkit-meter-bar { background: #ece6de; border: 0; }
meter::-webkit-meter-optimum-value { background: #587057; }
meter::-moz-meter-bar { background: #587057; }
.year-review > p { margin: .35rem 0 .65rem; }
.year-review details { border-top: 1px solid var(--line); }
summary { cursor: pointer; min-height: 44px; padding: .6rem 0; font-weight: 650; }
dialog { width: min(calc(100% - 1.5rem), 32rem); max-height: calc(100dvh - 2rem); padding: 1.2rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); color: var(--ink); }
dialog::backdrop { background: #211a175e; }
.close { float: right; border: 0; min-height: 44px; padding: 0 .5rem; background: transparent; color: var(--muted); font-size: .85rem; }
dialog h2 { margin: .6rem 0 1.05rem; }
#edit-form textarea { margin-top: .6rem; }
#settings-dialog .secondary { margin-top: .4rem; }
#install-help { margin-top: .45rem; }
.delete-entry .secondary { margin-left: .25rem; }
.teaser { padding-block: clamp(3.5rem, 16vw, 8rem); max-width: 38rem; }
.teaser .label { margin-bottom: .65rem; }
.teaser .intro { font-size: clamp(1.3rem, 5vw, 1.85rem); font-weight: 620; color: var(--ink); letter-spacing: -.045em; }
.teaser p:not(.label):not(.intro) { margin-bottom: 1rem; max-width: 31rem; color: var(--muted); }
.footer { display: flex; justify-content: space-between; gap: .4rem; border-top: 1px solid var(--line); padding-block: .9rem max(.9rem, env(safe-area-inset-bottom)); font-size: .77rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
