:root {
  --ink: #22332e;
  --muted: #718078;
  --paper: #f7f3ea;
  --surface: rgba(255, 255, 255, 0.72);
  --line: rgba(41, 66, 57, 0.11);
  --green: #356a55;
  --green-dark: #244b3c;
  --food: #d46f3f;
  --medicine: #a75973;
  --exercise: #3f7568;
  --sleep: #6573a5;
  --shadow: 0 22px 55px rgba(49, 61, 52, 0.12);
  --spring: cubic-bezier(0.2, 0.88, 0.24, 1.12);
}

* {
  box-sizing: border-box;
}

html {
  background: #e8e4da;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(255, 255, 255, 0.95), transparent 36rem),
    radial-gradient(circle at -15% 48%, rgba(224, 235, 223, 0.8), transparent 30rem),
    var(--paper);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(53, 106, 85, 0.28);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: rgba(247, 243, 234, 0.45);
}

.topbar {
  height: calc(72px + env(safe-area-inset-top));
  padding: calc(16px + env(safe-area-inset-top)) 20px 10px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 50;
}

.menu-button {
  width: 46px;
  height: 46px;
  margin-left: -8px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 0;
  border-radius: 15px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.menu-button span {
  width: 23px;
  height: 2px;
  display: block;
  border-radius: 10px;
  background: currentColor;
  transform-origin: center;
  transition: transform 220ms var(--spring), opacity 130ms ease, width 220ms ease;
}

.menu-button span:nth-child(2) {
  width: 16px;
}

body.menu-open .menu-button {
  color: #f8f3e9;
}

body.menu-open .menu-button span:first-child {
  transform: translateY(7px) rotate(45deg);
}

body.menu-open .menu-button span:nth-child(2) {
  opacity: 0;
  transform: translateX(-8px);
}

body.menu-open .menu-button span:last-child {
  transform: translateY(-7px) rotate(-45deg);
}

.wordmark {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.wordmark-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--paper);
  background: #9ecba7;
}

.zone-badge,
.date-pill {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.57);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #70aa79;
  box-shadow: 0 0 0 3px rgba(112, 170, 121, 0.15);
}

main {
  padding: 10px 18px calc(44px + env(safe-area-inset-bottom));
}

.view {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 190ms ease, transform 240ms var(--spring);
}

.view.is-active {
  opacity: 1;
  transform: translateY(0);
}

.welcome {
  padding: 20px 4px 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.welcome-row,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.042em;
}

h1 {
  max-width: 330px;
  font-size: clamp(31px, 9vw, 43px);
  line-height: 0.98;
  font-weight: 790;
}

h2 {
  font-size: 22px;
  line-height: 1.08;
}

.clock {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.quick-card {
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.category-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.selection-indicator {
  width: 0;
  height: 0;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  border-radius: 23px;
  opacity: 0;
  background: var(--food);
  box-shadow: 0 16px 30px rgba(73, 72, 60, 0.2);
  transform: translate3d(0, 0, 0);
  transition:
    transform 260ms var(--spring),
    width 260ms var(--spring),
    height 260ms var(--spring),
    opacity 120ms ease,
    background-color 180ms ease;
}

.selection-indicator.is-visible {
  opacity: 1;
}

.selection-indicator[data-category="food"] {
  background: linear-gradient(145deg, #e68a55, #bf5937);
}

.selection-indicator[data-category="medicine"] {
  background: linear-gradient(145deg, #bb6b84, #93475f);
}

.selection-indicator[data-category="exercise"] {
  background: linear-gradient(145deg, #5e9483, #356a5e);
}

.selection-indicator[data-category="sleep"] {
  background: linear-gradient(145deg, #7d89bc, #596697);
}

.category-button {
  min-height: 128px;
  padding: 17px 14px 14px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 23px;
  color: var(--ink);
  background: rgba(248, 247, 242, 0.76);
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    transform 150ms ease,
    background-color 140ms ease;
}

.category-button:active {
  transform: scale(0.975);
}

.category-button.is-selected {
  color: #fffdf7;
  border-color: transparent;
  background: transparent;
}

.category-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--food);
  background: #f9e4d6;
  font-size: 20px;
  font-weight: 900;
  transition: color 140ms ease, background-color 140ms ease;
}

.medicine-icon {
  color: var(--medicine);
  background: #f1dce3;
}

.exercise-icon {
  color: var(--exercise);
  background: #dcebe6;
}

.sleep-icon {
  color: var(--sleep);
  background: #e1e4f2;
}

.category-button.is-selected .category-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.category-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-copy strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.category-copy small {
  color: var(--muted);
  font-size: 11px;
  transition: color 140ms ease;
}

.category-button.is-selected .category-copy small {
  color: rgba(255, 255, 255, 0.72);
}

.category-arrow {
  position: absolute;
  top: 17px;
  right: 15px;
  color: rgba(34, 51, 46, 0.35);
  font-size: 17px;
}

.category-button.is-selected .category-arrow {
  color: rgba(255, 255, 255, 0.72);
}

.today-section {
  padding: 18px 3px 0;
}

.voice-center {
  margin: 19px 0 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 13px;
}

.voice-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(53, 106, 85, 0.18));
}

.voice-line:nth-of-type(2) {
  background: linear-gradient(90deg, rgba(53, 106, 85, 0.18), transparent);
}

.voice-launch {
  width: 74px;
  height: 74px;
  position: relative;
  display: grid;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(150deg, #497a66, #285543);
  box-shadow:
    0 15px 30px rgba(42, 82, 65, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 180ms var(--spring), box-shadow 180ms ease;
}

.voice-launch:active {
  transform: scale(0.93);
  box-shadow: 0 8px 18px rgba(42, 82, 65, 0.22);
}

.voice-halo {
  width: 84px;
  height: 84px;
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(53, 106, 85, 0.16);
  border-radius: 50%;
  animation: voice-breathe 2.6s ease-in-out infinite;
}

@keyframes voice-breathe {
  50% { transform: scale(1.08); opacity: 0.35; }
}

.mic-glyph {
  width: 17px;
  height: 25px;
  position: relative;
  display: block;
  border: 2px solid currentColor;
  border-radius: 10px;
}

.mic-glyph::before {
  content: "";
  width: 25px;
  height: 15px;
  position: absolute;
  top: 9px;
  left: 50%;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transform: translateX(-50%);
}

.mic-glyph::after {
  content: "";
  width: 2px;
  height: 7px;
  position: absolute;
  top: 22px;
  left: 50%;
  border-radius: 9px;
  background: currentColor;
  box-shadow: -6px 7px 0 -0.5px currentColor, 6px 7px 0 -0.5px currentColor;
  transform: translateX(-50%);
}

.voice-caption {
  grid-column: 2;
  margin-top: 10px;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
}

.section-heading {
  align-items: center;
}

.date-pill {
  min-height: 32px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-grid {
  margin: 19px 0 9px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.summary-item {
  min-width: 0;
  padding: 12px 5px 11px;
  display: grid;
  justify-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.46);
}

.summary-item > span {
  color: var(--green);
  font-size: 14px;
}

.summary-item strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.summary-item small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline {
  display: grid;
  gap: 7px;
}

.timeline-day {
  margin: 18px 2px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-item {
  min-height: 72px;
  padding: 12px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(45, 66, 58, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
}

.timeline-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-size: 19px;
}

.timeline-symbol.food {
  color: var(--food);
  background: #f9e5d8;
}

.timeline-symbol.medicine {
  color: var(--medicine);
  background: #f1dce3;
}

.timeline-symbol.exercise {
  color: var(--exercise);
  background: #dceae5;
}

.timeline-symbol.sleep {
  color: var(--sleep);
  background: #e2e5f3;
}

.timeline-copy {
  min-width: 0;
}

.timeline-copy strong,
.timeline-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-copy strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.timeline-copy small {
  color: var(--muted);
  font-size: 11px;
}

.timeline-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 30px 18px;
  text-align: center;
  border: 1px dashed rgba(53, 106, 85, 0.2);
  border-radius: 23px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 15px;
}

.loading-state {
  padding: 25px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.loading-state span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: bounce 900ms infinite alternate;
}

.loading-state span:nth-child(2) {
  animation-delay: 150ms;
}

.loading-state span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes bounce {
  to { transform: translateY(-7px); opacity: 0.35; }
}

.entry-view {
  min-height: calc(100dvh - 100px);
  padding: 10px 4px calc(20px + env(safe-area-inset-bottom));
}

.back-button {
  min-width: 76px;
  min-height: 44px;
  margin-left: -7px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 720;
  cursor: pointer;
}

.back-button span {
  font-size: 21px;
  transition: transform 160ms ease;
}

.back-button:active span {
  transform: translateX(-4px);
}

.entry-heading {
  padding: 18px 4px 20px;
}

.entry-heading .entry-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: var(--active-color, var(--food));
  box-shadow: 0 14px 28px color-mix(in srgb, var(--active-color, var(--food)) 28%, transparent);
  font-size: 25px;
}

.entry-heading h1 {
  font-size: 37px;
}

.entry-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.entry-form {
  padding: 2px 4px 0;
}

.field-label {
  margin: 0 0 9px;
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.big-input {
  width: 100%;
  height: 70px;
  padding: 0 18px;
  border: 1px solid rgba(44, 69, 60, 0.13);
  border-radius: 21px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 34px rgba(49, 61, 52, 0.08);
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.02em;
  caret-color: var(--active-color, var(--green));
}

.big-input::placeholder {
  color: #a5aea8;
  font-weight: 560;
}

.quick-picks {
  margin-top: 13px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.quick-picks::-webkit-scrollbar {
  display: none;
}

.pick-chip {
  min-height: 39px;
  padding: 0 14px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.pick-chip.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--active-color, var(--green));
}

.primary-button {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  border: 0;
  border-radius: 19px;
  color: #fff;
  background: var(--active-color, var(--green));
  box-shadow: 0 16px 28px color-mix(in srgb, var(--active-color, var(--green)) 25%, transparent);
  font-size: 15px;
  font-weight: 820;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 160ms ease;
}

.primary-button:active {
  transform: scale(0.985);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--active-color, var(--green)) 20%, transparent);
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.medicine-picker {
  margin-bottom: 18px;
  display: grid;
  gap: 8px;
}

.medicine-option {
  width: 100%;
  min-height: 55px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  font-weight: 700;
  cursor: pointer;
}

.medicine-option span:last-child {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1.5px solid #b6bdb9;
  border-radius: 50%;
  color: transparent;
  font-size: 12px;
}

.medicine-option.is-active {
  border-color: color-mix(in srgb, var(--medicine) 45%, transparent);
  background: #f6e8ed;
}

.medicine-option.is-active span:last-child {
  color: #fff;
  border-color: var(--medicine);
  background: var(--medicine);
}

.counter-card,
.timer-card,
.sleep-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.61);
  box-shadow: 0 18px 38px rgba(49, 61, 52, 0.08);
}

.counter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.counter-card > div:first-child strong {
  display: block;
  font-size: 17px;
}

.counter-card > div:first-child small {
  color: var(--muted);
  font-size: 12px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 13px;
}

.stepper button,
.minute-nudge {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: #fff;
  font-size: 23px;
  cursor: pointer;
}

.stepper output {
  min-width: 24px;
  text-align: center;
  font-size: 27px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.timer-card {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.timer-ring {
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(var(--active-color, var(--exercise)) var(--timer-progress, 25%), rgba(63, 117, 104, 0.11) 0);
}

.timer-ring::after {
  content: "";
  width: 103px;
  height: 103px;
  position: absolute;
  border-radius: inherit;
  background: #faf9f5;
}

.timer-value {
  position: relative;
  z-index: 1;
  text-align: center;
}

.timer-value strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.timer-value small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.timer-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.duration-chip {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.duration-chip.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--exercise);
}

.no-medicine {
  padding: 23px;
  text-align: center;
  border: 1px dashed rgba(167, 89, 115, 0.3);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.5);
}

.no-medicine strong,
.no-medicine p {
  display: block;
}

.no-medicine p {
  margin: 7px 0 15px;
  color: var(--muted);
  font-size: 13px;
}

.no-medicine button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--medicine);
  font-weight: 750;
}

.sleep-card {
  padding: 22px;
  text-align: center;
}

.sleep-orbit {
  width: 154px;
  height: 154px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  position: relative;
  border: 2px solid rgba(101, 115, 165, 0.17);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 59%, transparent 60%);
}

.sleep-orbit::before {
  content: "☾";
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  position: absolute;
  top: 6px;
  right: 17px;
  border-radius: 50%;
  color: #fff;
  background: var(--sleep);
  box-shadow: 0 7px 18px rgba(101, 115, 165, 0.28);
}

.sleep-duration strong {
  display: block;
  font-size: 34px;
  letter-spacing: -0.05em;
}

.sleep-duration small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.sleep-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.sleep-time {
  padding: 12px;
  border-radius: 16px;
  background: rgba(101, 115, 165, 0.075);
}

.sleep-time label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sleep-time input,
.sleep-time output {
  width: 100%;
  height: 30px;
  display: block;
  border: 0;
  text-align: center;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.sleep-adjust {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sleep-adjust button {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--sleep);
  background: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 780;
}

.sleep-note {
  margin: 12px 5px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.scrim,
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  opacity: 0;
  background: rgba(26, 39, 35, 0.34);
  backdrop-filter: blur(3px);
  transition: opacity 180ms ease;
}

.scrim.is-visible,
.sheet-backdrop.is-visible {
  opacity: 1;
}

.menu-drawer {
  width: min(83vw, 360px);
  height: 100dvh;
  padding: calc(94px + env(safe-area-inset-top)) 22px calc(26px + env(safe-area-inset-bottom));
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  color: #f7f3e9;
  background:
    radial-gradient(circle at 0 0, rgba(117, 159, 134, 0.35), transparent 42%),
    #24483b;
  transform: translateX(-105%);
  transition: transform 280ms var(--spring);
  box-shadow: 25px 0 70px rgba(29, 45, 39, 0.25);
}

.menu-drawer.is-open {
  transform: translateX(0);
}

.drawer-top {
  margin-bottom: 28px;
}

.drawer-top .eyebrow {
  color: #a9d0b5;
}

.drawer-top h2 {
  max-width: 240px;
  color: #fffdf7;
  font-size: 29px;
}

.drawer-top p:last-child {
  max-width: 270px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.55;
}

.menu-drawer nav {
  display: grid;
  gap: 8px;
}

.menu-drawer nav button {
  min-height: 70px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 19px;
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
}

.menu-drawer nav strong,
.menu-drawer nav small {
  display: block;
}

.menu-drawer nav strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.menu-drawer nav small {
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
}

.nav-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.drawer-foot {
  margin: auto 5px 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  line-height: 1.5;
}

.settings-sheet {
  width: min(100%, 520px);
  max-height: 88dvh;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  margin: auto;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 30px 30px 0 0;
  background: #f9f6ef;
  box-shadow: 0 -25px 70px rgba(28, 45, 38, 0.2);
  transform: translateY(105%);
  transition: transform 300ms var(--spring);
}

.settings-sheet.is-open {
  transform: translateY(0);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 18px;
  border-radius: 99px;
  background: #d8d9d2;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.round-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: #eeece6;
  font-size: 25px;
}

.setting-block {
  margin-top: 25px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.setting-block label {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.setting-block > p,
.setting-block > div > p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.add-medicine {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
}

.add-medicine input {
  min-width: 0;
  height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}

.add-medicine button {
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--medicine);
  font-size: 24px;
}

.medicine-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.medicine-tag {
  min-height: 37px;
  padding: 0 8px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #f1e1e6;
  color: #6f3d4e;
  font-size: 11px;
  font-weight: 750;
}

.medicine-tag button {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  color: #875064;
  background: rgba(255, 255, 255, 0.55);
}

.sleep-default-block {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.sleep-default-block select {
  height: 45px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  font-weight: 750;
}

.settings-save {
  --active-color: var(--green);
}

.voice-connection-block {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.voice-connection-copy {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.voice-connection-copy p {
  margin-bottom: 0 !important;
}

.connection-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #c8a278;
  box-shadow: 0 0 0 4px rgba(200, 162, 120, 0.14);
}

.connection-dot.is-connected {
  background: #6baa78;
  box-shadow: 0 0 0 4px rgba(107, 170, 120, 0.14);
}

.voice-connection-block code,
.voice-key-notice code {
  padding: 6px 8px;
  border-radius: 9px;
  color: var(--green-dark);
  background: #e9eee8;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.voice-backdrop {
  z-index: 88;
}

.voice-sheet {
  width: min(100%, 520px);
  min-height: 440px;
  max-height: 92dvh;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  margin: auto;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 31px 31px 0 0;
  background:
    radial-gradient(circle at 85% 0, rgba(225, 236, 226, 0.9), transparent 20rem),
    #faf7f0;
  box-shadow: 0 -28px 80px rgba(27, 43, 37, 0.23);
  transform: translateY(105%);
  transition: transform 310ms var(--spring);
}

.voice-sheet.is-open {
  transform: translateY(0);
}

.voice-close {
  position: absolute;
  top: 23px;
  right: 19px;
  z-index: 20;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
}

.voice-stage {
  padding: 12px 2px 2px;
  animation: voice-stage-in 230ms var(--spring);
}

@keyframes voice-stage-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.voice-stage > h2 {
  max-width: calc(100% - 52px);
  font-size: 29px;
}

.voice-subtitle {
  max-width: 370px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.voice-types {
  margin-top: 23px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.voice-types button {
  min-height: 78px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  font-size: 14px;
  font-weight: 790;
  cursor: pointer;
  transition: transform 130ms ease, border-color 140ms ease, background-color 140ms ease;
}

.voice-types button:active {
  transform: scale(0.975);
}

.voice-types button span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--green);
  background: #e2ede5;
  font-size: 19px;
}

.voice-types button:nth-child(1) span {
  color: var(--food);
  background: #f8e2d5;
}

.voice-types button:nth-child(2) span {
  color: var(--medicine);
  background: #f1dce3;
}

.voice-types button:nth-child(3) span {
  color: var(--exercise);
  background: #dceae5;
}

.voice-types button:nth-child(4) span {
  color: var(--sleep);
  background: #e2e5f3;
}

.voice-key-notice {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(192, 135, 78, 0.16);
  border-radius: 17px;
  background: #f6eadc;
}

.voice-key-notice strong {
  display: block;
  color: #734f30;
  font-size: 12px;
}

.voice-key-notice p {
  margin: 5px 0 0;
  color: #876a50;
  font-size: 11px;
  line-height: 1.45;
}

.voice-medicine-list {
  margin-top: 21px;
  display: grid;
  gap: 8px;
}

.voice-medicine-choice {
  min-height: 55px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  font-weight: 750;
}

.voice-medicine-choice::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 1.5px solid #b7beba;
  border-radius: 50%;
}

.voice-medicine-choice.is-active {
  border-color: rgba(167, 89, 115, 0.35);
  background: #f6e7ec;
}

.voice-medicine-choice.is-active::after {
  border: 6px solid var(--medicine);
  background: #fff;
}

.voice-start-button {
  --active-color: var(--medicine);
}

.voice-recording-stage,
.voice-processing-stage,
.voice-error-stage {
  text-align: center;
}

.voice-recording-stage > h2,
.voice-processing-stage > h2,
.voice-error-stage > h2 {
  max-width: none;
}

.voice-recording-stage .voice-subtitle,
.voice-processing-stage .voice-subtitle,
.voice-error-stage .voice-subtitle {
  margin-right: auto;
  margin-left: auto;
}

.recording-orbit {
  width: 190px;
  height: 190px;
  margin: 25px auto 12px;
  position: relative;
  display: grid;
  place-items: center;
}

.recording-ring {
  position: absolute;
  inset: 14px;
  border: 1px solid color-mix(in srgb, var(--voice-color, var(--green)) 35%, transparent);
  border-radius: 50%;
  animation: recording-pulse 1.6s ease-out infinite;
}

.recording-ring.ring-two {
  inset: 2px;
  animation-delay: 0.45s;
}

@keyframes recording-pulse {
  from { transform: scale(0.8); opacity: 0.85; }
  to { transform: scale(1.15); opacity: 0; }
}

.recording-stop {
  width: 108px;
  height: 108px;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 7px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  color: #fff;
  background: var(--voice-color, var(--green));
  box-shadow: 0 20px 42px color-mix(in srgb, var(--voice-color, var(--green)) 28%, transparent);
}

.recording-stop .mic-glyph {
  transform: scale(1.17);
}

.voice-wave {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.voice-wave span {
  width: 3px;
  height: 7px;
  border-radius: 9px;
  background: var(--voice-color, var(--green));
  animation: voice-wave 650ms ease-in-out infinite alternate;
}

.voice-wave span:nth-child(2),
.voice-wave span:nth-child(6) { animation-delay: 100ms; }
.voice-wave span:nth-child(3),
.voice-wave span:nth-child(5) { animation-delay: 200ms; }
.voice-wave span:nth-child(4) { animation-delay: 300ms; }

@keyframes voice-wave {
  to { height: 25px; }
}

.recording-time {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.recording-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.processing-mark {
  width: 110px;
  height: 110px;
  margin: 31px auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 36px;
  color: #fff;
  background: linear-gradient(145deg, #477763, #2b5846);
  box-shadow: 0 22px 45px rgba(43, 88, 70, 0.22);
}

.processing-mark span {
  width: 7px;
  height: 22px;
  border-radius: 9px;
  background: #fff;
  animation: processing-bars 800ms ease-in-out infinite alternate;
}

.processing-mark span:nth-child(2) {
  height: 38px;
  animation-delay: 160ms;
}

.processing-mark span:nth-child(3) {
  animation-delay: 320ms;
}

@keyframes processing-bars {
  to { transform: scaleY(0.42); opacity: 0.55; }
}

.processing-steps {
  max-width: 310px;
  margin: 25px auto 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.processing-steps span {
  min-height: 31px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #9a9f9b;
  background: #edece6;
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 160ms ease, background-color 160ms ease;
}

.processing-steps span.is-done {
  color: var(--green-dark);
  background: #dfeae2;
}

.voice-review-form {
  margin-top: 20px;
}

.review-field {
  margin-bottom: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.review-label-row {
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.review-label-row label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-chip {
  min-height: 23px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #596e62;
  background: #e5ece7;
  font-size: 8px;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-chip.spoken {
  color: #754b35;
  background: #f6e7dd;
}

.source-chip.calculated {
  color: #515d89;
  background: #e6e8f3;
}

.review-field input {
  width: 100%;
  min-height: 39px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
  font-weight: 740;
}

.review-field input[readonly] {
  color: var(--muted);
}

.review-field.is-missing {
  border-color: rgba(190, 104, 74, 0.35);
  background: #f9ebe5;
}

.review-field.is-missing input::placeholder {
  color: #a65f49;
}

.review-note {
  margin: 0 2px 13px;
  padding: 11px 12px;
  border-radius: 14px;
  color: #7d563b;
  background: #f7e8da;
  font-size: 11px;
  line-height: 1.45;
}

.review-actions {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 9px;
}

.review-actions .primary-button {
  margin-top: 0;
  --active-color: var(--green);
}

.secondary-button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 19px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 780;
}

.voice-error-mark {
  width: 74px;
  height: 74px;
  margin: 24px auto 20px;
  display: grid;
  place-items: center;
  border-radius: 25px;
  color: #a35d49;
  background: #f6dfd7;
  font-size: 32px;
  font-weight: 850;
}

.voice-error-stage .review-actions {
  margin-top: 25px;
}

.toast {
  width: min(calc(100% - 32px), 470px);
  min-height: 58px;
  padding: 9px 12px;
  position: fixed;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 0;
  z-index: 100;
  margin: auto;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 9px;
  color: #fff;
  border-radius: 19px;
  background: #253f35;
  box-shadow: 0 20px 45px rgba(25, 42, 35, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.98);
  transition: opacity 180ms ease, transform 250ms var(--spring);
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.toast-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #24483b;
  background: #a9d0b5;
  font-weight: 900;
}

.toast button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  color: #bfe0c8;
  background: rgba(255, 255, 255, 0.09);
  font-size: 11px;
  font-weight: 800;
}

.error-banner {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 16px;
  color: #7b3f31;
  background: #f5ddd5;
  font-size: 12px;
  line-height: 1.45;
}

@media (min-width: 560px) {
  body {
    padding: 18px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 36px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 38px;
    box-shadow: 0 40px 90px rgba(55, 66, 59, 0.16);
  }
}

@media (max-width: 370px) {
  main {
    padding-right: 13px;
    padding-left: 13px;
  }

  .category-button {
    min-height: 118px;
    padding: 14px 11px 12px;
  }

  .category-copy strong {
    font-size: 13px;
  }

  .timer-card {
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
  }

  .timer-ring {
    width: 108px;
    height: 108px;
  }

  .timer-ring::after {
    width: 87px;
    height: 87px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
