/* Final Chores root header: no reserved back-button column. */
@media (max-width: 760px) {
  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-app-header .app-header__copy {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Final Chores desktop list: reuse the canonical Habits title/filter/add composition. */
.chores-list-titlebar__copy,
.chores-list-titlebar__add {
  display: none;
}

.chores-list-titlebar__controls {
  display: grid;
  min-width: 0;
}

@media (min-width: 761px) {
  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) {
    padding-top: calc(var(--app-desktop-header-top) + var(--app-desktop-header-height) + 1.9rem);
  }

  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-app-header {
    display: none;
  }

  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-layout,
  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-workspace {
    width: min(100%, 72rem);
    max-width: 72rem;
    margin-inline: auto;
  }

  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-list-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-list-titlebar {
    display: flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.05rem;
  }

  .chores-list-titlebar__copy {
    display: block;
    min-width: 0;
  }

  .chores-list-titlebar__copy h2 {
    margin: 0;
    color: var(--app-ink);
    font-size: 1.65rem;
    font-weight: 860;
    line-height: 1.05;
  }

  .chores-list-titlebar__controls {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
  }

  .page-shell--chores:not(.is-creating-chore):not(.is-editing-chore) .chores-filter.segmented {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-height: auto;
    padding: 0.18rem;
    border-radius: var(--radius-md);
  }

  .chores-list-titlebar__add {
    display: inline-flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    padding: 0 1.1rem;
    border: 1px solid var(--app-primary);
    border-radius: 12px;
    background: var(--app-primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
  }
}

/* Final Chores canonical edit-sheet parity: same chrome and controls as Tasks. */
.page-shell--chores.is-editing-chore .sheet-backdrop-cancel--chore,
.page-shell--chores.is-creating-chore .sheet-backdrop-cancel--chore {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: block;
  background: rgba(36, 49, 44, 0.38);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.page-shell--chores .chore-edit-panel {
  z-index: 57;
}

.page-shell--chores .chore-edit-mobile-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
}

.page-shell--chores .chore-edit-mobile-header h2 {
  min-width: 0;
}

.page-shell--chores .chore-sheet-cancel-link {
  justify-self: end;
  color: var(--app-muted-2, var(--color-muted));
  font-size: 0.88rem;
  font-weight: 760;
  text-decoration: none;
}

.page-shell--chores .chore-form {
  display: grid;
  gap: 0.72rem;
}

.page-shell--chores .chore-form .task-form__grid--chore {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.72rem 0.86rem;
}

.page-shell--chores .chore-form__identity,
.page-shell--chores .chore-form .chore-priority-options,
.page-shell--chores .chore-form .field--chore-schedule,
.page-shell--chores .chore-form .field--assignee,
.page-shell--chores .chore-form .field--recurrence-frequency,
.page-shell--chores .chore-form .chore-cadence-fields {
  grid-column: 1 / -1;
}

.page-shell--chores .chore-form__identity-fields {
  grid-template-columns: 3.55rem minmax(0, 1fr);
}

.page-shell--chores .chore-form__identity-fields .field--emoji {
  grid-column: 1;
}

.page-shell--chores .chore-form__identity-fields .field--title {
  grid-column: 2;
}

.page-shell--chores .chore-form .field input,
.page-shell--chores .chore-form .field select,
.page-shell--chores .chore-form .field textarea {
  min-height: 3.05rem;
  border-radius: 11px;
  font-size: 16px;
}

.page-shell--chores .chore-form .task-form-chip {
  min-height: 2.35rem;
  padding: 0.5rem 0.82rem;
  font-size: 0.88rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

.page-shell--chores .chore-form .field--chore-schedule label.task-form-chip {
  color: var(--color-ink);
}

@media (min-width: 761px) {
  .page-shell--chores.is-editing-chore .chore-edit-panel,
  .page-shell--chores.is-creating-chore .chore-create-page {
    width: min(620px, calc(100vw - 2rem));
    max-height: min(86dvh, 44rem);
    padding: 1.25rem 1.35rem;
    border-radius: 20px;
  }

  .page-shell--chores .chore-edit-mobile-header {
    z-index: 3;
    margin: 0 0 0.78rem;
  }

  .page-shell--chores .chore-edit-mobile-header h2 {
    font-size: 1.28rem;
    font-weight: 820;
    line-height: 1.08;
  }

  .page-shell--chores .chore-delete-icon-form {
    display: none;
  }

  .page-shell--chores .chore-form > .form-actions--with-delete {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.8rem;
  }
}

@media (max-width: 760px) {
  .page-shell--chores.is-editing-chore .chore-edit-panel,
  .page-shell--chores.is-creating-chore .chore-create-page {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 0.95rem 1.35rem calc(7.55rem + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    overscroll-behavior: contain;
  }

  .page-shell--chores .chore-form .task-form__grid--chore {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-shell--chores .chore-edit-mobile-header {
    position: sticky;
    top: -0.95rem;
    z-index: 14;
    margin: -0.95rem -1.35rem 0.85rem;
    padding: 1rem 1.35rem 0.8rem;
    background: var(--color-card);
  }

  .page-shell--chores .chore-form__identity-fields {
    grid-template-columns: 4.8rem minmax(0, 1fr);
  }

}
