:root {
  color-scheme: light;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  color: #151e2f;
  background: #cad4e3;
  --ink: #151e2f;
  --muted: #4d596b;
  --paper: #fff;
  --yellow: #ffdf8d;
  --line: #dbe2ed;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: default; opacity: .5; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #3565a1; outline-offset: 3px; }

.app {
  max-width: 650px;
  margin: auto;
  padding: calc(24px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(108px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.top, .brand, .actions { display: flex; align-items: center; }
.top { justify-content: space-between; gap: 8px; }
.brand { gap: 9px; font-weight: 750; white-space: nowrap; }
.brand img { border-radius: 12px; flex-shrink: 0; }
.actions { gap: 7px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 15px;
  font-size: .875rem;
  font-weight: 700;
}
.primary { background: var(--yellow); }
.secondary { background: #edf2f8; }
.icon { font-size: 1.3rem; line-height: 1; }
.icon.import { border-bottom: 1.5px solid; padding: 0 2px 2px; }

h1 {
  margin: 30px 0 21px;
  font-size: clamp(2.15rem, 8vw, 3.5rem);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -.055em;
}
h2, p { margin: 0; }
h2 { font-size: 1.14rem; line-height: 1.25; }
.stack { display: grid; gap: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: #e4ebf4; }
.chip[aria-pressed="true"], .day[aria-pressed="true"] { background: var(--ink); color: white; }
.days { display: flex; gap: 5px; }
.day {
  min-width: 0;
  flex: 1 1 0;
  padding: 8px 2px;
  min-height: 62px;
  border-radius: 17px;
  background: #e8edf5;
  font-size: .72rem;
  text-transform: capitalize;
}
.day strong { display: block; font-size: 1.1rem; }
.section-date { margin: 8px 0 1px; }
.section-date::first-letter { text-transform: uppercase; }
.card {
  min-width: 0;
  border-radius: 22px;
  background: var(--paper);
  padding: 18px;
  overflow-wrap: anywhere;
}
.empty { display: grid; gap: 13px; color: var(--muted); padding: 20px; }
.empty-icon {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 14px;
}
.entry { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; }
.entry-edit {
  min-width: 0;
  flex: 1;
  min-height: 44px;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 3px;
  background: transparent;
  padding: 3px 0;
  overflow-wrap: anywhere;
}
.entry-edit span { white-space: pre-wrap; }
.entry-edit .time { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--muted); }
.entry-edit .muted { font-size: .9rem; }
.toggle {
  flex: 0 0 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff3d5;
}
.toggle[aria-pressed="true"] { background: var(--yellow); }
.stat { display: grid; gap: 10px; }
.stat-number { font-size: 2.4rem; font-weight: 740; line-height: 1.1; }
progress { appearance: none; border: none; border-radius: 20px; height: 12px; width: 100%; overflow: hidden; background: #dee6f1; }
progress::-webkit-progress-bar { background: #dee6f1; }
progress::-webkit-progress-value { background: #eebf55; border-radius: 20px; }
progress::-moz-progress-bar { background: #eebf55; border-radius: 20px; }

.nav-wrap {
  position: fixed;
  inset: auto 0 0;
  padding: 15px max(12px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: linear-gradient(transparent, #cad4e3 31%);
}
.nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 610px;
  margin: auto;
  gap: 3px;
  border-radius: 25px;
  padding: 5px;
  background: white;
  box-shadow: 0 6px 22px #192b4420;
}
.nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-height: 53px;
  padding: 3px 0;
  background: transparent;
  border-radius: 21px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 680;
}
.nav button[aria-current="page"] { background: #e3eaf4; color: var(--ink); }
.nav-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; position: relative; flex: 0 0 auto; }
.calendar { border: 1.6px solid; border-radius: 4px; }
.calendar::before { content: ""; position: absolute; inset: 4px 0 auto; border-bottom: 1.6px solid; }
.book { width: 15px; border: 1.6px solid; border-radius: 3px; }
.book::before { content: ""; position: absolute; inset: 0 auto 0 3px; border-left: 1.6px solid; }
.circle { border: 1.6px solid; border-radius: 50%; font-size: .72rem; font-weight: 750; line-height: 1; }
.chart { background: linear-gradient(currentColor, currentColor) bottom left / 4px 7px, linear-gradient(currentColor, currentColor) bottom center / 4px 12px, linear-gradient(currentColor, currentColor) bottom right / 4px 17px; background-repeat: no-repeat; }

dialog {
  width: min(530px, calc(100% - 20px));
  max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  padding: 0;
  box-shadow: 0 18px 50px #192b443b;
}
dialog::backdrop { background: #151e2f70; }
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 11px 12px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.dialog-head h2 { font-size: .98rem; text-align: center; }
.quiet { background: transparent; font-size: .875rem; min-height: 44px; padding: 0 5px; }
.fields { display: grid; gap: 13px; padding: 15px; }
.fields label { display: grid; gap: 4px; font-size: .88rem; font-weight: 700; }
.fields input:not([type="checkbox"]), .fields textarea {
  width: 100%;
  min-width: 0;
  font-size: 1rem;
  font-weight: 400;
  border-radius: 12px;
  border: 1px solid #a7b5c8;
  padding: 10px;
  min-height: 44px;
  background: white;
}
.fields textarea { resize: vertical; }
.fields .check-field { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.check-field input { accent-color: var(--ink); height: 20px; width: 20px; }
.danger { color: #9e2424; }
.button.danger { background: #fae3e3; }
.confirm { border-radius: 14px; padding: 11px; background: #f5f6f9; }
.confirm p { margin-bottom: 8px; }
.example { margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .78rem; }
.muted { color: var(--muted); }
.notice { color: #8d2020; background: #fff0ed; padding: 8px 11px; border-radius: 10px; margin-bottom: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 385px) {
  .action-label { display: none; }
  .actions .secondary { min-width: 44px; padding: 0; }
  .app { padding-inline: max(15px, env(safe-area-inset-left)) max(15px, env(safe-area-inset-right)); }
  .dialog-head .button { padding-inline: 9px; }
}
