:root {
  color-scheme: light;
  --canvas: #fbf7ec;
  --phone: #fffdf8;
  --ink: #151515;
  --muted: #6f6a63;
  --soft: #f7f1e8;
  --line: #eadfd2;
  --card: #ffffff;
  --mint: #5dbb84;
  --mint-soft: #e7f5eb;
  --sun: #e3a32d;
  --sun-soft: #fff1cf;
  --coral: #f16657;
  --coral-soft: #ffe4dd;
  --blue: #6ea3d8;
  --blue-soft: #e7f1fb;
  --violet: #8d73c8;
  --violet-soft: #eee8fb;
  --shadow: 0 10px 26px rgba(30, 24, 18, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 1.8rem 2rem, transparent 0 1.35rem, rgba(241, 102, 87, 0.55) 1.39rem 1.5rem, transparent 1.54rem),
    radial-gradient(circle at calc(100% - 2rem) 2.1rem, rgba(227, 163, 45, 0.18) 0 1.2rem, transparent 1.22rem),
    linear-gradient(180deg, #fffaf0 0%, var(--canvas) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  position: relative;
  width: min(100% - 24px, 390px);
  min-height: min(820px, calc(100vh - 24px));
  margin: 12px auto;
  padding: 12px 18px 130px;
  overflow: hidden;
  border: 9px solid #111;
  border-radius: 42px;
  background: var(--phone);
  box-shadow: 0 24px 70px rgba(28, 22, 16, 0.22);
}

.status-bar {
  height: 31px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: #111;
  font-size: 0.74rem;
  font-weight: 850;
}

.status-bar > :last-child {
  justify-self: end;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.dynamic-island {
  width: 78px;
  height: 22px;
  border-radius: 999px;
  background: #050505;
}

.hero-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  color: #181818;
  font-size: 1.34rem;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-subtitle {
  display: none;
}

.quick-summary {
  display: none;
}

.topbar h1::before {
  content: "";
  width: 27px;
  height: 27px;
  display: inline-block;
  margin-right: 10px;
  vertical-align: -6px;
  border-radius: 50%;
  background:
    linear-gradient(var(--sun), var(--sun)) center / 4px 100% no-repeat,
    linear-gradient(90deg, var(--sun), var(--sun)) center / 100% 4px no-repeat,
    radial-gradient(circle, transparent 0 7px, var(--sun) 7.5px 9.5px, transparent 10px);
}

.hero-card {
  position: relative;
}

.home-sticker {
  position: absolute;
  right: 22px;
  top: 18px;
  width: 48px;
  height: 38px;
  color: var(--coral);
  opacity: 0.62;
}

.home-sticker::before {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 4px;
  width: 27px;
  height: 22px;
  border: 2.5px solid currentColor;
  border-top: 0;
  border-radius: 3px 3px 7px 7px;
  background: linear-gradient(180deg, rgba(255, 240, 207, 0.8), rgba(255, 255, 255, 0.9));
}

.home-sticker::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 7px;
  width: 27px;
  height: 27px;
  border: 2.5px solid currentColor;
  border-right: 0;
  border-bottom: 0;
  border-radius: 3px;
  transform: rotate(45deg);
}

.icon-button {
  position: fixed;
  z-index: 8;
  right: max(28px, calc((100vw - 390px) / 2 + 28px));
  bottom: 91px;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff7d6f, var(--coral));
  color: white;
  box-shadow: 0 12px 24px rgba(241, 102, 87, 0.34);
  font-size: 2rem;
  line-height: 1;
}

.household-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 12px 0 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.household-switch a {
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: color-mix(in srgb, var(--switch-color, var(--coral)), #302821 22%);
  font-size: 0.78rem;
  font-weight: 850;
}

.household-switch a:first-child {
  color: var(--coral);
}

.household-switch a.active {
  background: var(--coral);
  color: #fff;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

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

.summary-grid article,
.panel,
.task-card,
.shopping-row,
.task-dialog form,
.setup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.stat-card {
  position: relative;
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px auto;
  grid-template-rows: auto auto;
  gap: 1px 10px;
  align-items: center;
  padding: 10px;
  box-shadow: 0 7px 18px rgba(41, 32, 23, 0.06);
}

.stat-tasks {
  background: var(--mint-soft);
}

.stat-shopping {
  background: var(--coral-soft);
}

.stat-icon {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.stat-icon-task {
  color: #4f9d6d;
}

.stat-icon-task::before {
  content: "";
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 6px 0 rgba(79, 157, 109, 0.12);
}

.stat-icon-shopping {
  color: var(--coral);
}

.stat-icon-shopping::before {
  content: "";
  width: 19px;
  height: 15px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px 2px 5px 5px;
  box-shadow: 0 -7px 0 -4px currentColor;
}

.stat-card small {
  display: none;
}

.summary-grid span:not(.stat-icon) {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 900;
  line-height: 1;
}

.summary-grid p {
  margin: 0;
  color: #4d4945;
  font-size: 0.74rem;
  font-weight: 700;
}

.panel {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  font-weight: 900;
}

.section-title a,
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 750;
}

.section-title a::after {
  content: " ›";
}

.stack,
.shopping-list,
.shopping-preview {
  display: grid;
  gap: 10px;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 48px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 78px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(35, 26, 18, 0.07);
}

.task-card::before {
  display: none;
}

.task-card.is-done {
  opacity: 0.55;
}

.task-card.is-done h3 {
  text-decoration: line-through;
}

.check-form {
  margin: 0;
}

.check-button,
.mini-check {
  display: grid;
  place-items: center;
  border: 1.5px solid #cfc7bd;
  border-radius: 4px;
  background: #fff;
  color: var(--coral);
  font-weight: 900;
}

.check-button {
  width: 20px;
  height: 20px;
}

.task-illustration {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tag-color), white 82%);
  color: color-mix(in srgb, var(--tag-color), #1f1f1f 34%);
}

.task-illustration::before {
  content: "";
  width: 23px;
  height: 25px;
  border: 3px solid currentColor;
  border-radius: 6px 6px 4px 4px;
}

.task-icon-trash::before {
  border-top: 7px solid currentColor;
  box-shadow: inset 6px 0 0 rgba(255, 255, 255, 0.4), inset -6px 0 0 rgba(255, 255, 255, 0.4);
}

.task-icon-doc::before {
  border-radius: 4px;
  box-shadow: inset 0 7px 0 rgba(255, 255, 255, 0.56);
}

.task-icon-bag::before {
  border-radius: 6px 6px 8px 8px;
  box-shadow: 0 -7px 0 -4px currentColor;
}

.task-icon-home::before {
  width: 24px;
  height: 20px;
  transform: rotate(45deg);
  border-radius: 3px;
}

.task-body {
  min-width: 0;
}

.task-topline {
  display: contents;
}

.household-tag {
  position: absolute;
  right: 52px;
  bottom: 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color), white 80%);
  color: color-mix(in srgb, var(--tag-color), #1f1f1f 34%);
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 850;
}

.due-pill {
  position: absolute;
  right: 10px;
  bottom: 14px;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 850;
}

.task-card h3 {
  margin: 0 0 5px;
  padding-right: 46px;
  font-size: 0.88rem;
  line-height: 1.18;
  font-weight: 900;
}

.meta-row {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #403d39;
  font-size: 0.74rem;
  font-weight: 650;
}

.avatar-chip {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #2f251f;
  color: white;
  font-size: 0.5rem;
  font-weight: 900;
}

.badge-row {
  position: absolute;
  right: 10px;
  top: 11px;
  display: flex;
  gap: 4px;
  color: var(--muted);
  font-size: 0;
}

.badge-row span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: transparent;
}

.badge-row span:first-child::before {
  content: "↻";
  color: var(--muted);
  font-size: 1rem;
}

.badge-row span:nth-child(2)::before {
  content: "•";
  color: var(--coral);
  font-size: 1.1rem;
}

.empty {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 12px;
  padding-bottom: 2px;
}

.filter-row span {
  min-width: 56px;
  border-radius: 8px;
  background: var(--mint-soft);
  padding: 8px 11px;
  color: #31744f;
  text-align: center;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 850;
}

.filter-row span:nth-child(2) {
  background: var(--sun-soft);
  color: #9b6a10;
}

.filter-row span:nth-child(3) {
  background: var(--coral-soft);
  color: #b83f33;
}

.filter-row span:nth-child(4) {
  background: var(--violet-soft);
  color: #64509d;
}

.shopping-row {
  display: grid;
  grid-template-columns: 20px 1fr 32px 26px;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 0;
  border-width: 0 0 1px;
  background: #fff;
  box-shadow: none;
}

.shopping-list,
.shopping-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(35, 26, 18, 0.07);
}

.shopping-row:last-child {
  border-bottom: 0;
}

.shopping-row.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}

.mini-check {
  width: 18px;
  height: 18px;
}

.row-action-form {
  margin: 0;
}

.delete-item-button {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b8aaa0;
}

.delete-item-button::before {
  content: "";
  width: 11px;
  height: 12px;
  margin-top: 4px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 1px 1px 4px 4px;
  box-shadow: inset 4px 0 0 rgba(184, 170, 160, 0.18), inset -4px 0 0 rgba(184, 170, 160, 0.18);
}

.delete-item-button::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  margin-top: -12px;
  border-radius: 2px;
  background: currentColor;
}

.delete-item-button:hover,
.delete-item-button:focus-visible {
  background: var(--coral-soft);
  color: var(--coral);
}

.shopping-row small {
  position: relative;
  width: 27px;
  height: 27px;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--tag-color), white 78%);
  color: transparent;
}

.shopping-row small::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 5px;
  width: 12px;
  height: 11px;
  border: 2px solid color-mix(in srgb, var(--tag-color), #1f1f1f 36%);
  border-top: 0;
  border-radius: 2px 2px 4px 4px;
}

.shopping-row small::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 11px;
  height: 11px;
  border: 2px solid color-mix(in srgb, var(--tag-color), #1f1f1f 36%);
  border-right: 0;
  border-bottom: 0;
  border-radius: 3px;
  transform: rotate(45deg);
}

.shopping-category {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.shopping-category-title {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 8px;
  align-items: center;
}

.shopping-category-title h3 {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1;
}

.shopping-category-title small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.category-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--mint-soft);
  color: #438963;
}

.category-icon::before {
  content: "";
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 5px 0 rgba(67, 137, 99, 0.16);
}

.category-other {
  background: var(--sun-soft);
  color: #a87516;
}

.category-other::before {
  width: 17px;
  height: 13px;
  border-radius: 4px;
  box-shadow: 0 -6px 0 -4px currentColor;
}

.empty-list {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.quick-add {
  display: grid;
  grid-template-columns: 78px 76px 1fr 38px;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-add input,
.quick-add select,
.quick-add button,
.task-dialog input,
.task-dialog select,
.task-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.quick-add input,
.quick-add select,
.task-dialog input,
.task-dialog select,
.task-dialog textarea {
  padding: 10px 11px;
  font-size: 0.84rem;
}

.quick-add button,
.primary-button {
  border: 0;
  background: var(--coral);
  color: white;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 12px;
  left: 0;
  z-index: 7;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: min(calc(100% - 60px), 348px);
  margin: 0 auto;
  padding: 7px 0 9px;
  border: 0;
  border-radius: 0;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 -8px 18px rgba(35, 26, 18, 0.06);
}

.bottom-nav a {
  min-height: 44px;
  display: grid;
  grid-template-rows: 22px auto;
  gap: 1px;
  place-items: center;
  color: #3d3832;
  font-size: 0.62rem;
  font-weight: 750;
}

.bottom-nav a.active {
  color: var(--coral);
}

.nav-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 0;
  box-shadow: none;
}

.nav-icon::before {
  content: "";
  width: 18px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.bottom-nav a:nth-child(1) .nav-icon::before {
  transform: rotate(45deg);
  border-radius: 3px;
}

.bottom-nav a:nth-child(2) .nav-icon::before {
  width: 17px;
  height: 2px;
  border-width: 2px 0;
  border-radius: 0;
  box-shadow: 0 7px 0 currentColor, 0 -7px 0 currentColor;
}

.bottom-nav a:nth-child(3) .nav-icon::before {
  height: 13px;
  border-top: 0;
  border-radius: 2px 2px 5px 5px;
}

.bottom-nav a:nth-child(4) .nav-icon::before {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  box-shadow: inset 0 5px 0 rgba(241, 102, 87, 0.16);
}

.bottom-nav a:nth-child(5) .nav-icon::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 9px 3px 0 -5px currentColor, -9px 3px 0 -5px currentColor;
}

.task-dialog {
  width: min(calc(100% - 34px), 352px);
  max-height: calc(100dvh - 40px);
  border: 0;
  padding: 0;
  background: transparent;
}

.task-dialog::backdrop {
  background: rgba(12, 10, 8, 0.34);
  backdrop-filter: blur(4px);
}

.task-dialog form {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--phone);
  box-shadow: var(--shadow);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.close-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 1.1rem;
}

.task-dialog label {
  display: grid;
  gap: 6px;
  color: #2d2925;
  font-size: 0.8rem;
  font-weight: 750;
}

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

.toggle-line {
  display: flex !important;
  flex-direction: row;
  align-items: center;
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

.primary-button {
  min-height: 44px;
  border-radius: 8px;
}

.setup-card {
  padding: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.setup-card p {
  color: var(--muted);
  line-height: 1.5;
}

.setup-error {
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.family-grid {
  display: grid;
  gap: 10px;
}

.family-grid article {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 3px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 12px;
  box-shadow: 0 8px 18px rgba(35, 26, 18, 0.07);
}

.family-grid span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--avatar-color);
  color: white;
  font-weight: 900;
}

.family-grid small {
  color: var(--muted);
  font-weight: 650;
}

@media (max-width: 430px) {
  body {
    background: var(--phone);
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 136px;
  }

  .bottom-nav {
    bottom: 0;
    width: 100%;
    padding-bottom: max(9px, env(safe-area-inset-bottom));
  }

  .icon-button {
    right: 18px;
    bottom: 82px;
  }
}
