:root {
  color-scheme: light;
  --ink: #493424;
  --muted: #907865;
  --ivory: #fffaf0;
  --cream: #fff0cf;
  --card: rgba(255, 254, 249, 0.94);
  --line: #ead7b8;
  --orange: #f7952d;
  --orange-dark: #c9681f;
  --green: #42a857;
  --blue: #e1efff;
  --shadow: 0 14px 36px rgba(112, 75, 35, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-block: 76px 130px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  top: calc(68px + env(safe-area-inset-top));
  left: 50%;
  z-index: 10;
  display: grid;
  width: auto;
  min-width: 9rem;
  max-width: calc(100% - 36px);
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  place-items: center;
  overflow: visible;
  clip: auto;
  clip-path: none;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  white-space: normal;
  transform: translateX(-50%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 2%, #fff 0, transparent 35%),
    linear-gradient(165deg, #fffdf8 0%, #fff3d9 100%);
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
summary {
  scroll-margin-block: 76px 130px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #7b4218;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.preset-icon svg,
.item-icon svg,
.item-action-icon svg,
.item-learning svg,
.item-shopping-status svg,
.duplicate-edit-link svg,
.management-action svg,
.shopping-shortcut svg,
.watch-schedule-card svg,
.shopping-item-icon svg,
.shopping-actions svg,
.shopping-search svg,
.nav-item svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 68px 18px calc(118px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
}

.brand {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.header-action {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--orange-dark);
  font-size: 1.5rem;
}

.home {
  display: grid;
  min-height: calc(100vh - 172px);
  align-items: center;
  padding-top: 10px;
}

#home-state {
  width: 100%;
}

.shopping-shortcut {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 64px;
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid #edc98e;
  border-radius: 19px;
  background: rgba(255, 248, 232, 0.94);
  box-shadow: 0 7px 18px rgba(112, 75, 35, 0.07);
  color: var(--ink);
}

.shopping-shortcut-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: #ffe8bd;
  color: var(--orange-dark);
}

.shopping-shortcut-icon svg {
  width: 23px;
  height: 23px;
}

.shopping-shortcut-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.shopping-shortcut-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.shopping-shortcut-copy small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.shopping-shortcut-arrow {
  color: var(--orange-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.push-settings {
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(234, 217, 189, 0.8);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
}

.push-settings-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.push-status {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.push-button {
  min-height: 48px;
  margin-top: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.push-button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.push-button[hidden] {
  display: none;
}

.conversation {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: scene-in 220ms ease-out both;
}

.speech-bubble {
  position: relative;
  align-self: stretch;
  padding: 21px 24px 22px;
  border: 1px solid rgba(234, 217, 189, 0.9);
  border-radius: 30px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.speech-bubble::after {
  position: absolute;
  right: 76px;
  bottom: -15px;
  width: 30px;
  height: 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.eyebrow {
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.speech-bubble p {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  font-size: 1.12rem;
  font-weight: 650;
  line-height: 1.75;
}

.mascot-stage {
  position: relative;
  display: grid;
  width: min(54vw, 218px);
  height: 210px;
  margin: -2px 0 -12px;
  place-items: center;
}

.mascot-halo {
  position: absolute;
  inset: 30px 14px 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf8 8%, #ffe3a6 58%, transparent 69%);
  filter: blur(3px);
}

.mascot-image {
  position: relative;
  z-index: 1;
  display: block;
  width: min(50vw, 202px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 12px rgba(92, 61, 29, 0.16));
}

.mascot-nodding .mascot-image {
  animation: mascot-nod 700ms ease-in-out;
}

.mascot-celebrating .mascot-image {
  animation: mascot-celebrate 700ms ease-in-out;
}

.answer-card,
.form-card,
.empty-card {
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(234, 217, 189, 0.8);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.answer-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.answer-button,
.primary-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.answer-button:active,
.primary-button:active {
  transform: scale(0.98);
}

.answer-button {
  display: grid;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px 6px;
  color: var(--ink);
  font-size: 0.86rem;
}

.answer-button small {
  display: none;
}

.answer-still {
  background: var(--blue);
}

.answer-low {
  border: 2px solid var(--orange);
  background: #fff8eb;
}

.answer-bought {
  background: #dff3df;
  color: #247f3a;
}

.primary-button {
  display: grid;
  margin-top: 18px;
  place-items: center;
  background: linear-gradient(135deg, #ffa43d, var(--orange));
  box-shadow: 0 10px 22px rgba(231, 126, 27, 0.24);
  color: #fff;
}

.speech-bubble-calm {
  margin-top: 20px;
}

.mascot-resting {
  margin: 14px 0 6px;
}

.watch-schedule {
  width: 100%;
  padding: 17px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 9px 24px rgba(112, 75, 35, 0.08);
}

.watch-schedule-heading h2 {
  margin: 4px 0 0;
  font-size: 1rem;
  line-height: 1.45;
}

.watch-schedule-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.watch-schedule-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid rgba(234, 217, 189, 0.82);
  border-radius: 16px;
  background: #fffdf9;
}

.watch-schedule-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: #fff0d3;
  color: var(--orange-dark);
}

.watch-schedule-icon svg {
  width: 25px;
  height: 25px;
}

.watch-schedule-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.watch-schedule-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.4;
}

.watch-schedule-copy small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.45;
}

.watch-schedule-arrow {
  color: var(--orange-dark);
  font-size: 1.25rem;
  line-height: 1;
}

.watch-schedule-empty {
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  background: #fff9ee;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.home-first-item {
  width: 100%;
  padding: 17px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.home-first-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.home-first-item .primary-button {
  margin-top: 12px;
}

.page-content {
  padding-top: 22px;
}

.page-heading {
  padding: 0 2px;
}

.page-heading h1 {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.add-heading {
  margin: 8px 4px 22px;
  text-align: center;
}

.add-heading h1 {
  margin: 7px 0 4px;
  font-size: 1.75rem;
}

.add-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.preset-form {
  display: grid;
}

.preset-card {
  display: grid;
  min-height: 142px;
  padding: 14px 8px 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 7px 20px rgba(111, 76, 39, 0.08);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.preset-card:hover,
.preset-card:focus-visible {
  border-color: var(--orange);
  box-shadow: 0 10px 24px rgba(228, 127, 34, 0.16);
  transform: translateY(-2px);
}

.preset-card:focus-visible {
  outline: 3px solid #7b4218;
  outline-offset: 3px;
}

.preset-card:active {
  transform: scale(0.98);
}

.preset-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 20px;
  background: #fff5dd;
  color: var(--orange-dark);
  font-size: 2rem;
}

.preset-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.8;
}

.preset-name {
  align-self: end;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.preset-cycle {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.custom-entry {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.custom-entry summary {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 76px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.custom-entry summary::-webkit-details-marker {
  display: none;
}

.custom-entry summary > span:last-child {
  display: grid;
  gap: 2px;
}

.custom-entry summary small {
  color: var(--muted);
  font-size: 0.7rem;
}

.custom-chevron {
  margin-left: auto;
  color: var(--orange-dark);
  font-size: 1.15rem;
  font-weight: 800;
  transition: transform 140ms ease;
}

.custom-entry[open] .custom-chevron {
  transform: rotate(180deg);
}

.custom-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: #f0e8db;
  color: var(--muted);
  letter-spacing: 0.12em;
}

.custom-form {
  margin: 0 12px 12px;
  box-shadow: none;
}

.form-card {
  display: grid;
  gap: 20px;
}

.form-card label {
  display: grid;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 800;
}

.form-card label small,
.field-help {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.field-help {
  margin-top: -2px;
  line-height: 1.5;
}

.form-card input,
.form-card select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fffdf9;
  color: var(--ink);
}

.form-card input:focus,
.form-card select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(247, 148, 47, 0.14);
}

.number-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.page-heading h1 {
  margin: 6px 0;
  font-size: 1.7rem;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.item-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.item-card {
  padding: 16px;
  border: 1px solid rgba(234, 217, 189, 0.8);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(108, 75, 37, 0.07);
}

.item-summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
}

.item-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #efd5a8;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff8e9, #ffe7bb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--orange-dark);
}

.item-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 1.8;
}

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

.item-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.item-copy h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.45;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  margin-top: 7px;
}

.item-category {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8efe1;
  color: #806852;
  font-size: 0.68rem;
  font-weight: 750;
}

.item-next-check {
  color: var(--muted);
  font-size: 0.69rem;
}

.item-shopping-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8a5425;
  font-size: 0.69rem;
  font-weight: 800;
}

.item-shopping-status svg {
  width: 15px;
  height: 15px;
}

.item-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eff8eb;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.item-status.is-due {
  background: #fff0dc;
  color: var(--orange-dark);
}

.item-status.is-soon {
  background: #f1f8e9;
  color: #539544;
}

.item-status.is-paused {
  background: #fff1df;
  color: #9a642d;
}

.item-learning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 13px 0 0;
  padding: 9px 11px;
  border-radius: 13px;
  background: #fff9ee;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.item-learning svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--orange);
}

.quick-response {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(234, 217, 189, 0.7);
}

.quick-response > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.quick-response-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.quick-response-buttons form {
  display: grid;
}

.quick-button {
  min-height: 52px;
  padding: 8px 4px;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.quick-still {
  background: var(--blue);
}

.quick-low {
  border: 1px solid var(--orange);
  background: #fff8eb;
}

.quick-bought {
  background: #dff3df;
  color: #247f3a;
}

.item-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(234, 217, 189, 0.7);
}

.item-utility-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.item-action-link {
  display: flex;
  min-height: 44px;
  gap: 6px;
  padding: 8px 11px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(234, 217, 189, 0.9);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.86);
  color: var(--orange-dark);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.35;
}

.item-action-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: #fff1d8;
}

.item-action-icon svg {
  width: 14px;
  height: 14px;
}

.delete-link {
  display: flex;
  min-width: 54px;
  min-height: 44px;
  margin-left: auto;
  padding: 8px 10px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  text-decoration: underline;
  text-decoration-color: rgba(144, 120, 101, 0.45);
  text-underline-offset: 3px;
}

.edit-form {
  margin-top: 24px;
}

.edit-form .primary-button {
  min-height: 60px;
  font-size: 0.94rem;
}

.edit-form .cancel-button {
  border: 1px solid rgba(234, 217, 189, 0.9);
  background: rgba(255, 253, 249, 0.8);
}

.edit-schedule {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.edit-schedule-form {
  gap: 14px;
  border-radius: 22px;
  box-shadow: none;
}

.schedule-save {
  min-height: 50px;
  padding: 8px 14px;
  border: 1px solid #edc98e;
  border-radius: 14px;
  background: #fff4e1;
  color: #98602d;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.edit-management {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.edit-management strong {
  font-size: 0.86rem;
}

.edit-management p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.edit-management form {
  display: grid;
}

.management-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid #edc98e;
  border-radius: 14px;
  background: #fff4e1;
  color: #98602d;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.management-action svg {
  width: 18px;
  height: 18px;
}

.management-action.is-resume {
  border-color: #d7d5a8;
  background: #f7f5df;
  color: #66733b;
}

.edit-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.history-summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(112, 75, 35, 0.08);
}

.history-mascot {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid #f0d8ad;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff9eb, #ffe8bc);
}

.history-mascot img {
  display: block;
  width: 67px;
  height: 67px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(92, 61, 29, 0.12));
}

.history-summary-copy {
  min-width: 0;
}

.history-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
}

.history-summary-row span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.history-summary-row strong {
  font-size: 0.9rem;
}

.history-next-check {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.history-summary-row .history-next-check strong {
  color: var(--ink);
}

.history-summary-row .history-paused,
.history-summary-row .history-active {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.history-summary-row .history-active {
  color: #2e7b3b;
}

.history-learning {
  margin: 0;
  padding-top: 13px;
  border-top: 1px dashed rgba(234, 217, 189, 0.9);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.history-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 2px 10px;
}

.history-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.history-heading span {
  color: var(--muted);
  font-size: 0.7rem;
}

.history-list {
  display: grid;
  gap: 9px;
}

.history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  padding: 15px 16px;
  border: 1px solid rgba(234, 217, 189, 0.8);
  border-radius: 18px;
  background: var(--card);
}

.history-card time {
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.history-card strong {
  padding: 6px 10px;
  border-radius: 11px;
  background: var(--blue);
  font-size: 0.8rem;
  white-space: nowrap;
}

.history-card.history-running_low strong {
  border: 1px solid var(--orange);
  background: #fff8eb;
}

.history-card.history-purchased strong {
  background: #dff3df;
  color: #247f3a;
}

.history-empty {
  position: relative;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 245, 0.78);
  color: var(--muted);
  text-align: center;
}

.history-empty-bubble {
  position: relative;
  padding: 14px 16px;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(112, 75, 35, 0.07);
}

.history-empty p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.7;
}

.history-back {
  display: grid;
  min-height: 52px;
  margin-top: 18px;
  place-items: center;
  border: 1px solid rgba(234, 217, 189, 0.9);
  border-radius: 15px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.shopping-heading h1 {
  font-size: 1.6rem;
}

.shopping-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.shopping-card {
  padding: 17px;
  border: 1px solid rgba(234, 217, 189, 0.9);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(112, 75, 35, 0.08);
}

.shopping-item-summary {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.shopping-item-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid #efd5a8;
  border-radius: 19px;
  background: linear-gradient(145deg, #fff8e9, #ffe7bb);
  color: var(--orange-dark);
}

.shopping-item-icon svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.8;
}

.shopping-item-copy {
  min-width: 0;
}

.shopping-item-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.shopping-item-title h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.45;
}

.shopping-paused {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #fff1df;
  color: #9a642d;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.shopping-category {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f8efe1;
  color: #806852;
  font-size: 0.68rem;
  font-weight: 750;
}

.shopping-item-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.shopping-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(234, 217, 189, 0.75);
}

.shopping-actions form {
  display: grid;
  min-width: 0;
}

.shopping-purchased,
.shopping-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 9px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.shopping-actions svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.shopping-purchased {
  border: 1px solid #b9dcb9;
  background: #dff3df;
  color: #247f3a;
}

.shopping-remove {
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--muted);
}

.shopping-search {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed rgba(234, 217, 189, 0.8);
}

.shopping-search > span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

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

.shopping-search-links a {
  display: flex;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(234, 217, 189, 0.92);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.78);
  color: #806852;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
}

.shopping-search-links svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.shopping-search-links.has-preferred-site {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
}

.shopping-search-links a.shopping-search-primary {
  min-height: 48px;
  border-color: #edc98e;
  background: #fff1d8;
  color: var(--orange-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.shopping-search-links a.shopping-search-secondary {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(144, 120, 101, 0.4);
  text-underline-offset: 3px;
}

.shopping-removed-notice {
  border-color: var(--line);
  background: #fff8eb;
  color: var(--orange-dark);
}

.shopping-empty {
  display: grid;
  justify-items: center;
  padding: 22px 18px 25px;
  border: 1px solid rgba(234, 217, 189, 0.9);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.shopping-empty img {
  display: block;
  width: 108px;
  height: 108px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(92, 61, 29, 0.13));
}

.shopping-empty-bubble {
  position: relative;
  width: 100%;
  margin-top: 3px;
  padding: 16px;
  border: 1px solid #eed6ae;
  border-radius: 19px;
  background: #fffaf0;
  text-align: center;
}

.shopping-empty-bubble::before {
  position: absolute;
  top: -7px;
  left: calc(50% - 7px);
  width: 13px;
  height: 13px;
  border-top: 1px solid #eed6ae;
  border-left: 1px solid #eed6ae;
  background: #fffaf0;
  content: "";
  transform: rotate(45deg);
}

.shopping-empty-bubble strong {
  font-size: 0.92rem;
}

.shopping-empty-bubble p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.duplicate-page {
  display: grid;
  gap: 16px;
}

.duplicate-card,
.duplicate-add-anyway {
  padding: 20px 18px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(112, 75, 35, 0.08);
}

.duplicate-mascot {
  display: grid;
  width: 92px;
  height: 92px;
  margin: -6px auto 4px;
  place-items: center;
}

.duplicate-mascot img {
  display: block;
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(92, 61, 29, 0.13));
}

.duplicate-bubble {
  position: relative;
  padding: 15px 16px;
  border: 1px solid #eed6ae;
  border-radius: 18px;
  background: #fffaf0;
}

.duplicate-bubble::before {
  position: absolute;
  top: -7px;
  left: calc(50% - 7px);
  width: 13px;
  height: 13px;
  border-top: 1px solid #eed6ae;
  border-left: 1px solid #eed6ae;
  background: #fffaf0;
  content: "";
  transform: rotate(45deg);
}

.duplicate-message,
.duplicate-paused {
  margin: 0;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.7;
}

.duplicate-message {
  font-size: 0.92rem;
}

.duplicate-paused {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.duplicate-existing-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.duplicate-edit-link,
.duplicate-list-link,
.duplicate-back {
  display: flex;
  min-height: 50px;
  padding: 9px 14px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf9;
  color: var(--orange-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.duplicate-edit-link {
  border-color: #f2c27d;
  background: #fff2dc;
}

.duplicate-edit-link svg {
  width: 17px;
  height: 17px;
}

.duplicate-add-anyway {
  box-shadow: none;
}

.duplicate-add-anyway p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
  text-align: center;
}

.duplicate-add-anyway form {
  display: grid;
}

.duplicate-add-button {
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f2e9;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.duplicate-back {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.success-notice {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid #cce5c8;
  border-radius: 18px;
  background: rgba(239, 250, 234, 0.9);
  color: #2e7b3b;
  font-size: 0.84rem;
  font-weight: 750;
}

.list-reaction {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px 16px 13px 10px;
  border: 1px solid #d6e3ee;
  border-radius: 22px;
  background: #f1f7ff;
  box-shadow: 0 8px 22px rgba(87, 103, 118, 0.1);
  animation: reaction-pop 360ms ease-out both;
}

.list-reaction.reaction-running_low {
  border-color: #efdbb4;
  background: #fff8e9;
}

.list-reaction.reaction-purchased {
  border-color: #cde3c8;
  background: #f0faec;
}

.list-reaction-mascot {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
}

.list-reaction-mascot img {
  display: block;
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 6px 7px rgba(92, 61, 29, 0.13));
}

.list-reaction-copy {
  min-width: 0;
}

.list-reaction-copy strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.list-reaction-copy p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.5;
}

.delete-confirmation {
  margin-top: 28px;
  padding: 24px 20px 20px;
  border: 1px solid rgba(234, 217, 189, 0.8);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.delete-confirmation p {
  margin: 0;
  line-height: 1.7;
}

.delete-note {
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 0.78rem;
}

.danger-button,
.cancel-button {
  display: grid;
  width: 100%;
  min-height: 54px;
  place-items: center;
  border-radius: 17px;
  font-weight: 800;
}

.danger-button {
  margin-top: 24px;
  border: 1px solid #d98676;
  background: #fff5f1;
  color: #a54635;
  cursor: pointer;
}

.cancel-button {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.reaction-scene {
  min-height: 520px;
  justify-content: center;
}

.reaction-bubble {
  border-color: #d9e8ca;
  background: rgba(250, 255, 245, 0.96);
}

.reaction-still_have .reaction-bubble {
  border-color: #cdddea;
  background: rgba(243, 249, 255, 0.96);
}

.reaction-running_low .reaction-bubble {
  border-color: #ead7b8;
  background: rgba(255, 249, 235, 0.96);
}

.reaction-bubble::after {
  background: #fbfff7;
}

.reaction-check {
  display: grid;
  width: 54px;
  height: 54px;
  margin-top: 5px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(66, 168, 87, 0.22);
  color: #fff;
  font-size: 1.55rem;
  font-weight: 900;
  animation: check-in 420ms 100ms ease-out both;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 430px);
  height: calc(76px + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(234, 217, 189, 0.9);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(16px);
}

.settings-page {
  display: grid;
  gap: 16px;
}

.settings-hero {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 2px;
}

.settings-mascot {
  display: block;
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(92, 61, 29, 0.13));
}

.settings-hero h1 {
  margin: 3px 0 4px;
  font-size: 1.55rem;
}

.settings-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.notification-readiness,
.schedule-card {
  padding: 20px 18px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(112, 75, 35, 0.08);
}

.notification-readiness strong {
  font-size: 0.94rem;
}

.notification-readiness .push-button {
  width: 100%;
}

.readiness-help {
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.readiness-help summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 800;
}

.readiness-help ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.readiness-help li + li {
  margin-top: 5px;
}

.schedule-lock-reason {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f5eee3;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.schedule-lock-reason.is-ready {
  background: #edf8e9;
  color: #2e7b3b;
}

.schedule-form fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.schedule-label {
  padding: 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.time-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 10px;
}

.time-select-group {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.time-select-group select {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 56px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.time-unit,
.time-zone-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.time-select-group select[aria-invalid="true"] {
  border-color: #b94f3d;
  box-shadow: 0 0 0 3px rgba(185, 79, 61, 0.12);
}

.schedule-error {
  margin: -2px 0 0;
  color: #9b3f32;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
}

.schedule-error[hidden] {
  display: none;
}

.compact-button {
  min-height: 56px;
  margin-top: 2px;
  font-size: 0.9rem;
}

.schedule-form fieldset:disabled {
  opacity: 0.58;
}

.pause-state {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: #2e7b3b;
  font-size: 0.8rem;
  font-weight: 800;
}

.pause-state.is-paused {
  color: var(--orange-dark);
}

.schedule-action {
  width: 100%;
  min-height: 52px;
}

.schedule-action:disabled,
.schedule-form button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.45);
  opacity: 0.55;
}

.logout-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(234, 217, 189, 0.85);
  border-radius: 24px;
  background: rgba(255, 254, 249, 0.76);
}

.logout-card h2 {
  margin: 0;
  font-size: 0.92rem;
}

.logout-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.logout-card form {
  display: grid;
}

.logout-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.auth-shell {
  display: grid;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 18px
    max(28px, env(safe-area-inset-bottom));
  place-items: center;
}

.login-card {
  width: 100%;
  padding: 24px 18px 20px;
  border: 1px solid rgba(234, 217, 189, 0.9);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.login-brand {
  display: block;
  color: var(--orange-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
}

.login-mascot {
  display: block;
  width: 116px;
  height: 116px;
  margin: 4px auto 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(92, 61, 29, 0.13));
}

.login-bubble {
  position: relative;
  margin-top: 2px;
  padding: 16px;
  border: 1px solid #eed6ae;
  border-radius: 19px;
  background: #fffaf0;
  text-align: center;
}

.login-bubble::before {
  position: absolute;
  top: -7px;
  left: calc(50% - 7px);
  width: 13px;
  height: 13px;
  border-top: 1px solid #eed6ae;
  border-left: 1px solid #eed6ae;
  background: #fffaf0;
  content: "";
  transform: rotate(45deg);
}

.login-bubble h1 {
  margin: 0;
  font-size: 1.18rem;
}

.login-bubble p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.login-error {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #e8b7a9;
  border-radius: 14px;
  background: #fff5f1;
  color: #934837;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.login-form label {
  font-size: 0.78rem;
  font-weight: 800;
}

.login-form input[type="password"] {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}

.login-form button {
  min-height: 52px;
  margin-top: 3px;
  border: 0;
  border-radius: 15px;
  background: var(--orange);
  box-shadow: 0 8px 18px rgba(201, 104, 31, 0.18);
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 850;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: var(--orange-dark);
}

.nav-item[aria-current="page"] {
  background: #fff1d8;
  color: #8a4515;
}

.nav-item svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.8;
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 750;
}

@media (max-width: 430px) {
  .item-title-row,
  .shopping-item-title {
    display: grid;
    justify-content: stretch;
  }

  .item-status,
  .shopping-paused {
    justify-self: start;
    white-space: normal;
  }

  .item-utility-actions {
    flex: 1 1 100%;
  }

  .delete-link {
    margin-left: 0;
  }

  .answer-button,
  .quick-button,
  .shopping-purchased,
  .shopping-remove,
  .shopping-search-links a,
  .nav-item span {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 360px) {
  .answer-grid,
  .quick-response-buttons,
  .shopping-actions,
  .shopping-search-links,
  .shopping-search-links.has-preferred-site {
    grid-template-columns: 1fr;
  }

  .settings-hero {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .settings-mascot {
    width: 64px;
    height: 64px;
  }
}

@keyframes scene-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mascot-nod {
  0%,
  100% {
    transform: rotate(0);
  }
  45% {
    transform: rotate(4deg) translateY(5px);
  }
}

@keyframes mascot-celebrate {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-9px) scale(1.03);
  }
}

@keyframes check-in {
  from {
    opacity: 0;
    transform: scale(0.65);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes reaction-pop {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@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;
  }
}

@media (min-width: 600px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    border: 1px solid rgba(218, 193, 153, 0.9);
    border-radius: 34px;
    box-shadow: 0 24px 70px rgba(89, 61, 32, 0.16);
  }

  .bottom-nav {
    bottom: 24px;
    border-radius: 0 0 34px 34px;
  }

  .auth-shell {
    min-height: calc(100vh - 48px);
  }
}
