:root {
  color-scheme: light;
  --ink: #252722;
  --muted: #687064;
  --line: #d9ddd3;
  --line-strong: #aeb8ab;
  --panel: #ffffff;
  --canvas: #f6f7f1;
  --soft: #e9f2ec;
  --green: #3e6f58;
  --green-dark: #284b3d;
  --coral: #c85e4c;
  --gold: #d5a342;
  --blue: #4d6f8f;
  --shadow: 0 18px 50px rgba(48, 57, 47, 0.12);
  --wash-a: rgba(159, 201, 177, 0.78);
  --wash-b: rgba(185, 226, 216, 0.72);
  --wash-c: rgba(213, 232, 164, 0.7);
  --wash-d: rgba(249, 242, 205, 0.92);
}

body[data-theme="navy"] {
  --ink: #172434;
  --muted: #617080;
  --line: #ced7df;
  --line-strong: #8da1b2;
  --canvas: #f2f5f7;
  --soft: #e4edf3;
  --green: #285b7d;
  --green-dark: #173b5f;
  --blue: #406f91;
  --wash-a: rgba(88, 128, 204, 0.7);
  --wash-b: rgba(148, 220, 235, 0.66);
  --wash-c: rgba(193, 219, 239, 0.76);
  --wash-d: rgba(239, 241, 224, 0.94);
}

body[data-theme="soft"] {
  --ink: #352b34;
  --muted: #776872;
  --line: #e2d1da;
  --line-strong: #ba8fa7;
  --canvas: #fff8fb;
  --soft: #f5e8ef;
  --green: #9a5f7f;
  --green-dark: #653b55;
  --blue: #487b80;
  --wash-a: rgba(241, 174, 207, 0.68);
  --wash-b: rgba(196, 181, 235, 0.66);
  --wash-c: rgba(195, 231, 216, 0.7);
  --wash-d: rgba(253, 226, 207, 0.94);
}

body[data-theme="bold"] {
  --ink: #20282c;
  --muted: #636c6f;
  --line: #cfd4d2;
  --line-strong: #849294;
  --canvas: #f3f4f1;
  --soft: #e4ecea;
  --green: #3e6870;
  --green-dark: #263d43;
  --coral: #b6493d;
  --wash-a: rgba(63, 91, 105, 0.68);
  --wash-b: rgba(182, 106, 82, 0.5);
  --wash-c: rgba(218, 179, 93, 0.48);
  --wash-d: rgba(220, 232, 227, 0.94);
}

body[data-theme="natural"] {
  --wash-a: rgba(159, 201, 177, 0.78);
  --wash-b: rgba(185, 226, 216, 0.72);
  --wash-c: rgba(213, 232, 164, 0.7);
  --wash-d: rgba(249, 242, 205, 0.92);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(118deg, var(--wash-a) 0%, transparent 48%),
    linear-gradient(238deg, var(--wash-b) 0%, transparent 52%),
    linear-gradient(145deg, var(--wash-c) 0%, var(--wash-d) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-bottom: 22px;
  text-align: center;
}

.auth-brand p {
  margin: 0;
}

.auth-brand p {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.auth-logo {
  width: min(230px, 78%);
  height: 120px;
  object-fit: contain;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.auth-tab {
  min-height: 42px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.auth-tab.is-active {
  border-color: var(--green-dark);
  background: var(--soft);
  color: var(--green-dark);
}

.auth-form {
  display: none;
  gap: 10px;
}

.auth-form.is-visible {
  display: grid;
}

.auth-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--coral);
  font-size: 0.86rem;
}

.onboarding-gate {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.onboarding-panel {
  width: min(100%, 620px);
  padding: 26px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.onboarding-heading {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.onboarding-heading img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.onboarding-heading h1,
.onboarding-step h2,
.onboarding-step p {
  margin: 0;
}

.onboarding-heading h1 {
  font-size: 1.55rem;
}

.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 22px 0;
}

.onboarding-progress span {
  height: 6px;
  border-radius: 8px;
  background: var(--line);
}

.onboarding-progress span.is-active {
  background: var(--green-dark);
}

.onboarding-step {
  display: none;
  gap: 12px;
}

.onboarding-step.is-active {
  display: grid;
}

.onboarding-step > p {
  color: var(--muted);
}

.onboarding-field {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.onboarding-field small {
  color: var(--muted);
  font-weight: 500;
}

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

.theme-choice {
  position: relative;
  display: grid;
  min-height: 76px;
  padding: 12px;
  align-content: end;
  border: 3px solid transparent;
  border-radius: 8px;
  color: #172434;
  font-weight: 850;
  cursor: pointer;
}

.theme-choice:has(input:checked) {
  border-color: var(--green-dark);
}

.theme-choice input {
  position: absolute;
  opacity: 0;
}

.theme-navy { background: linear-gradient(135deg, #8ba8dd, #c9edf1); }
.theme-soft { background: linear-gradient(135deg, #e7b8d0, #f4dfc9); }
.theme-bold { background: linear-gradient(135deg, #ba796a, #dec77d); }
.theme-natural { background: linear-gradient(135deg, #a7cfb7, #e6e7ad); }

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.onboarding-actions button {
  min-width: 130px;
}

.onboarding-note {
  font-size: 0.82rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.section-heading h3,
.panel h4 {
  margin: 0;
}

.brand h1 {
  font-size: 1.35rem;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
}

.eyebrow {
  color: var(--green-dark);
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: capitalize;
}

.tabs {
  display: grid;
  gap: 8px;
}

.mobile-more-button {
  display: none;
}

.tab {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--muted);
  text-align: left;
}

.tab span {
  text-align: center;
}

.tab.is-active {
  border-color: var(--line);
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 700;
}

.secondary-button,
.primary-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 2px solid var(--line-strong);
}

.workspace {
  min-width: 0;
  padding: 30px clamp(18px, 4vw, 46px) 44px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.topbar-actions {
  display: grid;
  gap: 8px;
  min-width: min(100%, 470px);
}

.profile-switch {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-switch select {
  min-height: 38px;
  border: 2px solid var(--line-strong);
}

.topbar h2 {
  margin-top: 4px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 850;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 8px;
  min-width: min(100%, 470px);
}

.status-card {
  text-align: left;
  min-height: 72px;
  padding: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.status-card:hover,
.status-card:focus-visible {
  border-color: var(--green);
  background: white;
  transform: translateY(-1px);
}

.status-card:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(62, 111, 88, 0.22);
  outline-offset: 2px;
}

.status-strip strong,
.status-strip span {
  display: block;
}

.status-strip strong {
  font-size: 1.55rem;
}

.status-strip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h3 {
  font-size: 1.35rem;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.today-heading {
  min-height: 78px;
}

.profile-caption {
  margin: 5px 0 0;
  color: var(--muted);
}

.profile-photo {
  display: grid;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  overflow: hidden;
  place-items: center;
  border: 3px solid var(--green-dark);
  border-radius: 50%;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 1.25rem;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(35, 46, 42, 0.16);
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.birthday-panel {
  min-height: 220px;
}

.celebration-icon,
.celebration-row .check {
  color: var(--gold);
}

.celebration-row {
  border-color: rgba(213, 163, 66, 0.55);
}

.shopping-preview {
  grid-column: 1 / -1;
}

.planning-stack {
  display: grid;
  gap: 16px;
}

.task-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.task-create-details {
  margin-bottom: 16px;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.task-create-details summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--green-dark);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.task-create-details summary::-webkit-details-marker {
  display: none;
}

.task-create-details summary::after {
  content: "+";
  font-size: 1.3rem;
}

.task-create-details[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.task-create-details[open] summary::after {
  content: "−";
}

.task-create-details .entry-form {
  margin: 0;
  padding: 12px;
}

.overview-task-row {
  grid-template-columns: 36px minmax(0, 1fr);
}

.task-panel {
  min-height: 220px;
}

.routine-section,
.recipe-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid var(--line);
}

.routine-form,
.birthday-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px minmax(190px, 0.7fr) 130px;
  gap: 10px;
  margin-bottom: 18px;
}

.birthday-form {
  grid-template-columns: minmax(170px, 1fr) 160px 130px minmax(180px, 1fr) 120px;
}

.routine-groups {
  display: grid;
  gap: 22px;
}

.routine-group {
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.routine-group summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: var(--green-dark);
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.routine-group summary::-webkit-details-marker {
  display: none;
}

.routine-group summary::after {
  content: "+";
  font-size: 1.35rem;
  line-height: 1;
}

.routine-group[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.routine-group[open] summary::after {
  content: "−";
}

.routine-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.routine-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 160px 100px 36px;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.routine-row input,
.routine-row select {
  min-height: 38px;
}

.profile-page-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-heading-actions select {
  min-width: 180px;
  border: 2px solid var(--line-strong);
}

.profile-identity {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  padding: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  text-align: center;
}

.profile-identity h4 {
  margin: 16px 0 4px;
  font-size: 1.35rem;
}

.profile-identity p {
  margin: 0;
  color: var(--muted);
}

.profile-page-photo {
  display: grid;
  width: 150px;
  height: 150px;
  overflow: hidden;
  place-items: center;
  border: 4px solid var(--green-dark);
  border-radius: 50%;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 2rem;
  font-weight: 850;
}

.profile-page-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 18px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.profile-workdays,
.profile-form > .primary-button {
  grid-column: 1 / -1;
}

.profile-work-schedule {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.schedule-field {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.panel {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h4 {
  font-size: 1.05rem;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

#taskTitle {
  grid-column: span 2;
}

.meal-form {
  grid-template-columns: 130px minmax(180px, 1fr) 140px 150px;
}

#mealIngredients {
  grid-column: span 3;
}

.toggle-field {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 750;
}

.toggle-field input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green-dark);
}

.compact-form {
  grid-template-columns: minmax(180px, 1fr) 120px;
  max-width: 680px;
}

.member-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 130px 150px 180px 150px;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.member-form .weekday-picker {
  grid-column: span 4;
}

.member-field-editor {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.member-field-editor input {
  width: min(220px, 100%);
  min-height: 36px;
}

.file-picker,
.small-button {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.profile-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.save-member-button {
  min-height: 40px;
  padding-inline: 16px;
}

.save-member-button:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: default;
}

.take-over-button {
  margin-top: 9px;
  border-color: var(--green-dark);
  background: var(--soft);
}

.inline-workdays {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.work-schedule-editor {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.work-schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.work-schedule-toolbar > select {
  width: auto;
  min-width: 180px;
  min-height: 38px;
}

.cycle-start-field {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.cycle-start-field input {
  width: auto;
  min-height: 38px;
}

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

.cycle-week-grid .inline-workdays {
  margin: 0;
  padding: 9px;
  border: 2px solid var(--line);
  border-radius: 8px;
}

.cycle-week-grid .inline-workdays.is-current-week {
  border-color: var(--green-dark);
  background: var(--soft);
}

.cycle-week-grid .inline-workdays.is-current-week legend {
  color: var(--green-dark);
  font-weight: 850;
}

.inline-workdays legend {
  width: 100%;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.inline-workdays label {
  position: relative;
  display: grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.inline-workdays label:has(input:checked) {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: white;
}

.inline-workdays label:focus-within {
  outline: 3px solid rgba(62, 111, 88, 0.22);
  outline-offset: 2px;
}

.inline-workdays input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.member-tasks-button {
  border-color: var(--green-dark);
  background: var(--soft);
}

.profile-tools select,
.compact-picker,
.small-button {
  width: auto;
  min-height: 36px;
}

.profile-tools select {
  min-width: 160px;
}

.compact-picker,
.small-button {
  padding: 0 12px;
}

.member-avatar {
  overflow: hidden;
  border: 2px solid var(--green);
  background: var(--soft);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 1;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

#recipeIngredients {
  grid-column: span 2;
}

.recipe-photo-preview {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 64px minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: var(--soft);
}

.recipe-photo-preview img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.recipe-photo-preview strong,
.recipe-photo-preview span {
  display: block;
  overflow-wrap: anywhere;
}

.recipe-photo-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.recipe-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.recipe-visual {
  display: grid;
  width: 96px;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 850;
}

.recipe-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-content {
  min-width: 0;
}

.recipe-content strong,
.recipe-content p {
  overflow-wrap: anywhere;
}

.recipe-content p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.recipe-link {
  color: var(--green-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.recipe-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(120px, 1fr) auto 36px;
  gap: 8px;
}

.recipe-actions select {
  min-height: 36px;
}

.leftover-item {
  border-color: rgba(213, 163, 66, 0.6);
}

.leftover-item .check {
  color: #705321;
  background: rgba(213, 163, 66, 0.18);
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.weekday-picker legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.2;
}

.weekday-picker label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-size: 0.88rem;
}

.weekday-picker input {
  width: 16px;
  min-height: auto;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0 12px;
}

.primary-button {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: white;
  font-weight: 700;
}

.secondary-button {
  background: white;
  color: var(--green-dark);
  font-weight: 700;
}

.secondary-button:hover,
.icon-button:hover,
.small-button:hover,
.file-picker:hover {
  border-color: var(--green-dark);
  background: var(--soft);
}

.icon-button {
  display: grid;
  width: 42px;
  padding: 0;
  place-items: center;
  background: white;
  color: var(--green-dark);
  font-size: 1.2rem;
}

.list {
  display: grid;
  gap: 10px;
}

.roomy {
  gap: 12px;
}

.item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.item.is-done .item-title {
  color: var(--muted);
  text-decoration: line-through;
}

.check {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--canvas);
  color: transparent;
}

.item.is-done .check,
.shopping-item.is-bought .check {
  background: var(--green);
  color: white;
}

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

.item-title {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
}

.delete-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--coral);
  font-size: 1.15rem;
}

.empty-state {
  display: grid;
  gap: 4px;
  min-height: 110px;
  place-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.shopping-item.is-bought .item-title {
  color: var(--muted);
  text-decoration: line-through;
}

.source-menu {
  background: rgba(213, 163, 66, 0.16);
}

.day-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.day-button {
  min-height: 44px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-weight: 700;
}

.day-button.is-active {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: white;
}

.week-grid,
.week-mini {
  display: grid;
  gap: 10px;
}

.week-grid {
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  overflow-x: auto;
  padding-bottom: 4px;
}

.week-mini {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.day-card {
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  min-height: 132px;
  padding: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  text-align: left;
}

.day-card:hover,
.day-card:focus-visible,
.day-card.is-selected {
  border-color: var(--green);
  background: white;
}

.day-card strong {
  font-size: 0.92rem;
}

.day-count {
  color: var(--muted);
  font-size: 0.8rem;
}

.mini-task {
  overflow-wrap: anywhere;
  padding: 6px 7px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--green-dark);
  font-size: 0.78rem;
  line-height: 1.25;
}

.meal-mini {
  background: rgba(213, 163, 66, 0.18);
  color: #705321;
}

.assignee-badge {
  background: rgba(77, 111, 143, 0.14);
  color: var(--blue);
}

.workday-badge {
  background: rgba(200, 94, 76, 0.12);
  color: var(--coral);
}

.repeat-badge {
  background: rgba(213, 163, 66, 0.18);
  color: #705321;
}

.notification-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
}

.account-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 2px solid var(--line);
}

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

.account-detail,
.account-profile-link {
  display: grid;
  gap: 5px;
  min-height: 76px;
  align-content: center;
  padding: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.account-detail span,
.account-profile-link span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.invite-detail strong {
  letter-spacing: 0.12em;
  color: var(--green-dark);
  font-size: 1.25rem;
}

.account-profile-link select {
  min-height: 38px;
}

.account-profile-link strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.account-members {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.account-member {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.account-member span {
  color: var(--muted);
  font-size: 0.82rem;
}

.notification-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  align-items: center;
}

.setting-field,
.month-filter {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.setting-field input,
.month-filter input {
  border: 2px solid var(--line-strong);
}

.month-filter {
  width: fit-content;
}

.month-filter input {
  width: 170px;
}

.notification-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.finance-total {
  display: grid;
  gap: 6px;
  min-height: 100px;
  align-content: center;
  padding: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.finance-total span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.finance-total strong {
  overflow-wrap: anywhere;
  font-size: 1.55rem;
}

.income-total {
  border-color: rgba(62, 111, 88, 0.65);
}

.expense-total {
  border-color: rgba(200, 94, 76, 0.65);
}

.balance-total {
  border-color: rgba(77, 111, 143, 0.65);
}

.is-negative {
  color: var(--coral);
}

.transaction-form {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr) 130px 150px 150px 110px;
  gap: 10px;
  margin-bottom: 16px;
}

.form-message {
  min-height: 22px;
  margin: -6px 0 16px;
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 750;
}

.form-message.is-error {
  color: var(--coral);
}

.finance-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.finance-panel {
  min-height: 280px;
}

.category-breakdown {
  display: grid;
  gap: 14px;
}

.category-row {
  display: grid;
  gap: 6px;
}

.category-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
}

.category-track {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.category-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
}

.transaction-item.is-income .check {
  background: var(--soft);
  color: var(--green-dark);
}

.transaction-item.is-expense .check {
  background: rgba(200, 94, 76, 0.12);
  color: var(--coral);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    align-self: start;
  }

  .brand {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-logo {
    width: 48px;
    height: 48px;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tab {
    flex: 0 0 118px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    min-height: 58px;
    padding: 8px 4px;
    text-align: center;
    font-size: 0.82rem;
  }

  .quiet-button {
    display: none;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    width: 100%;
  }

  .status-strip {
    width: 100%;
  }

  .overview-grid,
  .task-columns,
  .entry-form,
  .meal-form,
  .member-form,
  .recipe-form,
  .routine-form,
  .birthday-form,
  .profile-page-layout,
  .profile-form,
  .transaction-form,
  .finance-layout {
    grid-template-columns: 1fr;
  }

  .notification-settings {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .notification-status {
    grid-column: auto;
  }

  #taskTitle {
    grid-column: auto;
  }

  #mealIngredients,
  #recipeIngredients {
    grid-column: auto;
  }

  .member-form .weekday-picker {
    grid-column: auto;
  }

  .profile-workdays,
  .profile-work-schedule,
  .profile-form > .primary-button {
    grid-column: auto;
  }

  .routine-row {
    grid-template-columns: minmax(160px, 1fr) 130px 140px 92px 36px;
    overflow-x: auto;
  }

  .day-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .week-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }

  .cycle-week-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: 0;
  }

  .app-shell,
  .workspace,
  .view,
  .panel,
  .list,
  .item,
  form {
    max-width: 100%;
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    overflow: visible;
    padding: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
  }

  .brand {
    display: none;
  }

  .workspace {
    overflow: hidden;
    padding: 18px 14px 24px;
  }

  .auth-gate {
    padding: 12px;
  }

  .onboarding-gate {
    padding: 12px;
  }

  .onboarding-panel {
    padding: 18px;
  }

  .onboarding-heading {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .onboarding-heading img {
    width: 58px;
    height: 58px;
  }

  .onboarding-heading h1 {
    font-size: 1.25rem;
  }

  .theme-choices {
    grid-template-columns: 1fr 1fr;
  }

  .onboarding-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboarding-actions button {
    min-width: 0;
  }

  .auth-panel {
    padding: 18px;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .account-member {
    align-items: flex-start;
    flex-direction: column;
  }

  .save-member-button {
    width: 100%;
  }

  .tabs {
    position: relative;
    z-index: 31;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    overflow: visible;
    width: 100%;
    padding: 7px 6px;
    background: transparent;
    box-shadow: 0 8px 22px rgba(35, 46, 42, 0.1);
  }

  .tab {
    display: none;
    min-width: 0;
    min-height: 52px;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    font-size: 0.7rem;
  }

  .tab[data-view="overview"],
  .tab[data-view="planning"],
  .tab[data-view="tasks"],
  .tab[data-view="meals"],
  .mobile-more-button {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    gap: 1px;
  }

  .tab.is-active {
    background: var(--soft);
  }

  .mobile-more-button {
    min-height: 52px;
    padding: 5px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 0.7rem;
  }

  .mobile-more-open .mobile-more-button {
    background: var(--soft);
    color: var(--green-dark);
    font-weight: 800;
  }

  .mobile-more-open .tab[data-view="profile"],
  .mobile-more-open .tab[data-view="family"],
  .mobile-more-open .tab[data-view="birthdays"],
  .mobile-more-open .tab[data-view="shopping"],
  .mobile-more-open .tab[data-view="finance"] {
    position: absolute;
    right: 6px;
    z-index: 32;
    display: grid;
    width: min(250px, calc(100vw - 24px));
    min-height: 48px;
    grid-template-columns: 30px 1fr;
    justify-items: start;
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: white;
    text-align: left;
    font-size: 0.88rem;
    box-shadow: 0 10px 24px rgba(35, 46, 42, 0.13);
  }

  .mobile-more-open .tab[data-view="profile"] { top: calc(100% + 6px); }
  .mobile-more-open .tab[data-view="family"] { top: calc(100% + 54px); }
  .mobile-more-open .tab[data-view="birthdays"] { top: calc(100% + 102px); }
  .mobile-more-open .tab[data-view="shopping"] { top: calc(100% + 150px); }
  .mobile-more-open .tab[data-view="finance"] { top: calc(100% + 198px); }

  .topbar {
    gap: 12px;
    margin-bottom: 18px;
  }

  .topbar h2 {
    font-size: 1.55rem;
  }

  .eyebrow {
    font-size: 1.1rem;
  }

  .topbar-actions,
  .status-strip {
    min-width: 0;
  }

  .status-strip {
    display: none;
  }

  .profile-switch {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .section-heading {
    gap: 10px;
  }

  .section-heading h3 {
    font-size: 1.25rem;
  }

  .today-heading {
    min-height: 64px;
  }

  .profile-photo {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .overview-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .overview-grid > .panel:nth-child(1) { order: 1; }
  .overview-grid > .panel:nth-child(3) { order: 2; }
  .overview-grid > .panel:nth-child(2),
  .overview-grid > .panel:nth-child(4) { display: none; }

  .panel,
  .task-panel,
  .birthday-panel {
    min-height: 0;
    padding: 14px;
  }

  .week-grid,
  .week-mini {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .day-card {
    min-height: 106px;
  }

  .day-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .day-button {
    flex: 0 0 52px;
  }

  .planning-stack .panel:first-child {
    order: 2;
  }

  .planning-stack .task-panel {
    order: 1;
  }

  .entry-form,
  .meal-form,
  .member-form,
  .routine-form,
  .birthday-form,
  .profile-form,
  .transaction-form {
    grid-template-columns: 1fr;
  }

  #taskTitle,
  #mealIngredients,
  #recipeIngredients,
  .member-form .weekday-picker,
  .profile-workdays,
  .profile-form > .primary-button {
    grid-column: auto;
  }

  .routine-row {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .routine-row > :first-child {
    grid-column: auto;
  }

  .item {
    gap: 9px;
  }

  .overview-task-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .schedule-field {
    grid-template-columns: 1fr;
  }

  .item-meta {
    font-size: 0.78rem;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-summary {
    grid-template-columns: 1fr;
  }

  .finance-total {
    min-height: 82px;
  }

  .section-heading.with-action {
    align-items: stretch;
    flex-direction: column;
  }

  #finance .section-heading.with-action {
    align-items: flex-start;
  }

  #finance .month-filter {
    grid-template-columns: auto 150px;
    width: auto;
  }

  #finance .month-filter input {
    width: 150px;
  }

  .heading-actions,
  .heading-actions button {
    width: 100%;
  }

  .item {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .item.overview-task-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .day-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weekday-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 12px;
  }

  .weekday-picker legend {
    transform: translateY(-3px);
  }


  .recipe-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .recipe-visual {
    width: 76px;
  }

  .routine-row {
    grid-template-columns: 1fr 1fr;
  }

  .routine-row > :first-child {
    grid-column: 1 / -1;
  }

  .routine-row .delete-button {
    justify-self: end;
  }
}
