:root {
  --paper: #e7efe8;
  --ink: #17211d;
  --muted: #3e5149;
  --faint: #6a7d75;
  --line: #cddad2;
  --cobalt: #1d4ed8;
  --record: #d92d20;
  --shop: #1f7a4d;
  --meet: #1d4ed8;
  --errand: #a16207;
  --inverse: #f4faf6;
  --font: "Onest", "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #d3e0d8;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.35;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}

.app {
  width: min(430px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
}

.screen {
  padding: calc(22px + env(safe-area-inset-top)) 22px 220px;
}

button.hero {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.day {
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-day {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-clock {
  margin: 4px 0 10px;
  font-size: 64px;
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.hero h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 18ch;
}

.hero ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.hero li {
  padding: 4px 0;
  font-size: 18px;
}

.quiet {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 28ch;
}

.examples {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--faint);
}

.examples li + li { margin-top: 6px; }

.rows { margin-top: 28px; }

.row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  width: 100%;
  padding: 13px 0 13px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--line);
  background: transparent;
  text-align: left;
}

.row[data-kind="shopping"] { border-left-color: var(--shop); }
.row[data-kind="meeting"] { border-left-color: var(--meet); }
.row[data-kind="errand"] { border-left-color: var(--errand); }

.row b {
  font-weight: 500;
  letter-spacing: -0.02em;
}

.row small, .faint {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 14px;
}

.row[data-done="true"] { color: var(--faint); }

.confirm {
  margin: 0 0 22px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--inverse);
}

.confirm p { margin: 0 0 8px; }

.confirm .heard {
  color: #c5d4cc;
  font-size: 14px;
}

.confirm .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ghost, .text-action, .back {
  border: 0;
  background: transparent;
  padding: 0;
}

.confirm .ghost {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(244, 250, 246, 0.35);
  border-radius: 999px;
  color: var(--inverse);
}

.alert {
  margin: 0 0 16px;
  color: #8d1d14;
}

.dock {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100%);
  padding: 28px 18px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 62%, rgba(231, 239, 232, 0));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.listen {
  margin: 0 0 8px;
  min-height: 1.2em;
  color: var(--muted);
}

.record {
  width: 84px;
  height: 84px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 50%;
  background: var(--cobalt);
  color: white;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.28);
  position: relative;
  z-index: 1;
}

.record[data-state="recording"] { background: var(--record); }
.record[disabled] { opacity: 0.55; }

.record svg { display: block; margin: 0 auto; }

.nav {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding-top: 4px;
}

.nav a {
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--faint);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

.week-head, .detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.week-head h1, .detail-head h1, .settings h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.pager {
  display: flex;
  gap: 8px;
}

.pager button, .back {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 18px;
}

.week button {
  border: 0;
  background: transparent;
  padding: 6px 0 8px;
  border-radius: 16px;
}

.week span, .week b {
  display: block;
  text-align: center;
}

.week span {
  color: var(--faint);
  font-size: 12px;
  font-weight: 400;
}

.week b {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
}

.week button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--inverse);
}

.week button[aria-pressed="true"] span { color: #c5d4cc; }

.week button[data-today="true"] b {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.check, .setting {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.box {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid var(--shop);
  border-radius: 6px;
}

.check[aria-pressed="true"] .box { background: var(--shop); }
.check[aria-pressed="true"] span {
  color: var(--faint);
  text-decoration: line-through;
}

.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 22px; }

.text-action {
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger { color: #8d1d14; }

.phrase {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.phrase input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 16px;
}

.login {
  padding-top: calc(18vh + env(safe-area-inset-top));
}

.login input {
  width: 100%;
  min-height: 52px;
  margin: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  font-size: 16px;
}

.login button, .phrase button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--inverse);
}

.settings p { max-width: 34ch; }

@media (prefers-reduced-motion: no-preference) {
  .record[data-state="recording"] {
    animation: pulse 1.4s ease-out infinite;
  }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.45); }
  100% { box-shadow: 0 0 0 16px rgba(217, 45, 32, 0); }
}
