/* Shared list-filter contract: separate 44px controls, no enclosing segmented track. */
body .page-shell :is(.tasks-filter, .family-member-filter).list-filter.segmented {
  position: relative;
  display: grid;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: auto;
  grid-auto-flow: initial;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body .page-shell :is(.tasks-filter, .family-member-filter).list-filter .list-filter__link,
body .page-shell :is(.tasks-filter, .family-member-filter).list-filter .list-filter__menu-trigger {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.72rem;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 0.9rem;
  font-weight: var(--font-weight-strong);
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
}


body .page-shell .list-filter__link > span,
body .page-shell .list-filter__menu-label {
  min-width: 0;
}
body .page-shell .list-filter__link > span {
  flex-shrink: 0;
  padding-inline: 1px;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
body .page-shell .list-filter .list-filter__link.is-selected,
body .page-shell .list-filter .list-filter__menu-trigger.is-selected {
  border-color: color-mix(in srgb, var(--app-primary) 24%, var(--app-line));
  background: var(--app-primary-soft);
  color: var(--app-primary-ink);
}
body .page-shell .list-filter__link:focus-visible,
body .page-shell .list-filter__menu-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--app-primary) 40%, transparent);
  outline-offset: 2px;
}
body .page-shell .list-filter__menu {
  position: relative;
  min-width: 0;
}
body .page-shell .list-filter__menu-trigger {
  cursor: pointer;
  list-style: none;
}
body .page-shell .list-filter__menu-trigger::marker {
  content: "";
}
body .page-shell .list-filter__menu-trigger::-webkit-details-marker {
  display: none;
}
body .page-shell .list-filter__menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body .page-shell .list-filter__expand-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  opacity: 0.58;
  transition: transform 150ms ease;
}
body .page-shell .list-filter__menu[open] .list-filter__expand-icon {
  transform: rotate(180deg);
}
body .page-shell .list-filter__menu-options {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.45rem);
  left: 50%;
  display: grid;
  width: max-content;
  min-width: 100%;
  max-width: min(22rem, calc(100vw - 2rem));
  max-height: min(24rem, calc(100dvh - 8rem));
  gap: 0.2rem;
  padding: 0.35rem;
  overflow-y: auto;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--app-surface);
  box-shadow: 0 10px 24px rgba(36, 49, 44, 0.14);
  transform: translateX(-50%);
}
body .page-shell .list-filter__menu-option {
  min-height: 44px;
  justify-content: flex-start;
  padding-inline: 0.75rem;
  border: 0;
  border-radius: 8px;
  text-align: left;
}
body .page-shell .family-member-filter.family-member-filter.list-filter.segmented {
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: none;
}
body .page-shell .family-member-filter .family-member-filter__menu {
  grid-column: 1;
}
body .page-shell .family-member-filter .list-filter__menu-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  justify-content: initial;
  text-align: left;
}
body .page-shell .family-member-filter .family-member-filter__static {
  cursor: default;
}
body .page-shell .family-member-filter .list-filter__menu-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}
body .page-shell .family-member-filter .list-filter__menu-options {
  left: 0;
  transform: none;
}
body .page-shell--tasks:not(.is-creating-task):not(.is-editing-task) .tasks-filter.list-filter.segmented {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 760px) {
  body .page-shell :is(.tasks-filter, .family-member-filter).list-filter .list-filter__link,
body .page-shell :is(.tasks-filter, .family-member-filter).list-filter .list-filter__menu-trigger {
    padding-inline: 0.42rem;
  }

body .page-shell .family-member-filter.family-member-filter.list-filter.segmented {
    flex-basis: auto;
    width: 100%;
    max-width: none;
  }
}
body .page-shell--family[data-bulk-selection-root]:not(.is-bulk-selecting) .family-list-titlebar__controls {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
}

@media (max-width: 760px) {
body .page-shell--family[data-bulk-selection-root]:not(.is-bulk-selecting) .family-list-titlebar__controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
body .page-shell--family[data-bulk-selection-root].is-bulk-selecting .family-list-titlebar__controls {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 761px) {
  body .page-shell :is(.tasks-filter).list-filter.segmented {
    flex: 1 1 31rem;
    width: auto;
    max-width: none;
  }

body .page-shell--tasks:not(.is-creating-task):not(.is-editing-task) .tasks-filter.list-filter.segmented {
    flex: 1 1 31rem;
    width: auto;
    max-width: none;
  }
}
.list-titlebar-utility-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.list-search-toggle {
  display: inline-flex;
  width: auto;
  min-width: 7rem;
  height: 44px;
  padding: 0 0.9rem;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: var(--app-surface);
  color: var(--app-muted);
  cursor: pointer;
  touch-action: manipulation;
}
.list-search-toggle:hover,
.list-search-toggle[aria-expanded="true"],
.list-search-toggle.has-active-search {
  border-color: color-mix(in srgb, var(--app-primary) 24%, var(--app-line));
  background: var(--app-primary-soft);
  color: var(--app-primary-ink);
}
.list-search-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--app-primary) 40%, transparent);
  outline-offset: 2px;
}
.list-search-toggle__icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}
.list-search-toggle__label {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: var(--font-weight-strong);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* One focused search surface: phone sheet and desktop dialog. */
.list-search-panel {
  position: fixed;
  inset: 0;
  width: min(38rem, calc(100% - 3rem));
  height: min(42rem, calc(100dvh - 4rem));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 1.3rem;
  border: 1px solid var(--app-line);
  border-radius: 1.25rem;
  background: var(--app-surface);
  color: var(--app-text);
  box-sizing: border-box;
  overflow: hidden;
}
.list-search-panel[open] { display: flex; flex-direction: column; gap: 1rem; }
.list-search-panel[hidden] { display: none; }
.list-search-panel::backdrop { background: rgb(0 0 0 / 42%); }
body:has(.list-search-panel[open]) { overflow: hidden; }
.list-search-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.list-search-panel__header h2 { margin: 0; font-size: 1.5rem; }
.list-search__cancel { border: 0; background: transparent; color: var(--app-primary-ink); min-height: 44px; font: inherit; cursor: pointer; }
.list-search { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin: 0; }
.list-search input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; padding: .7rem; border: 1px solid var(--app-line); border-radius: .8rem; background: var(--app-surface); color: var(--app-text); font: inherit; }
.list-search__text-field { flex: 1 0 100%; min-width: 0; display: flex; align-items: center; gap: .6rem; border: 1px solid var(--app-line); border-radius: .8rem; padding: 0 .65rem; box-sizing: border-box; }
.list-search__text-field > svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; }
.list-search__text-field label { flex: 1; min-width: 0; }
.list-search__text-field input { border: 0; padding-inline: 0; }
.list-search__clear { text-decoration: none; font-size: 1.4rem; min-width: 44px; text-align: center; }
.list-search__clear[hidden] { display: none; }
.list-search__dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .7rem; }
.list-search__date-field { display: grid; min-width: 0; gap: .3rem; color: var(--app-muted); font-size: .85rem; }
.list-search__date-control { position: relative; display: flex; align-items: center; gap: .55rem; min-width: 0; min-height: 44px; padding: .65rem .7rem; box-sizing: border-box; border: 1px solid var(--app-line); border-radius: .75rem; background: var(--app-surface); color: var(--app-muted); }
.list-search__date-control.is-selected { background: var(--app-primary-soft); border-color: var(--app-primary); color: var(--app-primary-ink); }
.list-search__date-icon, .list-search__date-icon svg { display: block; width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.list-search__date-value { min-width: 0; overflow-wrap: anywhere; }
body .list-search__date-control input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: .65rem .5rem .65rem 2.2rem; border: 0; border-radius: inherit; opacity: 0; cursor: pointer; font: inherit; }
.list-search__date-control:has(input:focus-visible) { outline: 2px solid var(--app-primary); outline-offset: 2px; }
body .list-search__date-control input:focus-visible { opacity: 0; outline: 0; }
.list-search__date-row { display: flex; min-width: 0; }
.list-search__date-control { flex: 1; }
.list-search__date-row:has(.is-selected) { border: 1px solid var(--app-primary); border-radius: .75rem; background: var(--app-primary-soft); }
.list-search__date-row:has(.is-selected) .list-search__date-control { border: 0; background: transparent; }
.list-search__date-clear { flex: 0 0 44px; min-height: 44px; padding: 0; border: 0; border-left: 1px solid var(--app-line); border-radius: 0 .75rem .75rem 0; background: transparent; color: var(--app-primary-ink); font-size: 1.2rem; cursor: pointer; }
.list-search__date-clear[hidden] { display: none; }
.list-search__date-control input::-webkit-calendar-picker-indicator { display: none; }
.list-search__date-options { flex: 1 0 100%; }
.list-search__date-options summary { display: flex; align-items: center; gap: .6rem; width: fit-content; min-height: 44px; padding: 0 .85rem; border: 1px solid var(--app-line); border-radius: .75rem; background: var(--app-primary-soft); color: var(--app-primary-ink); cursor: pointer; list-style: none; }
.list-search__date-options summary::-webkit-details-marker { display: none; }
.list-search__date-options summary:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; }
.list-search__date-options summary svg { width: 1.1rem; height: 1.1rem; }
.list-search__date-options summary::after { content: ""; width: .4rem; height: .4rem; margin-left: .15rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.list-search__date-options[open] summary::after { transform: translateY(2px) rotate(225deg); }
.list-search__submit { min-height: 44px; }
.list-search__clear { color: var(--app-muted); min-height: 44px; align-content: center; }
.list-search__error { flex: 1 0 100%; margin: 0; color: var(--app-danger); }
.list-search__count { margin: 0; color: var(--app-muted); font-size: .85rem; }
.list-search__results { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1; }
.list-search__results :is(.task-section__header, .task-subtask-preview, .daily-task-subtask-preview, .daily-work-details, .task-row__url, .task-row__note, .chore-row-tags) { display: none; }
.list-search__results :is(.task-section, .task-list) { margin: 0; gap: 0; }
.list-search__results :is(.personal-task-row, .daily-timeline-row) { padding-block: .9rem; border: 0; border-bottom: 1px solid var(--app-line); border-radius: 0; background: transparent; }
.list-search__results [data-list-search-results] { display: block; }
@media (max-width: 760px) {
  .list-search-panel { inset: auto 0 0; margin: 0; border-radius: 1.4rem 1.4rem 0 0; padding: .6rem 1.1rem max(1rem, env(safe-area-inset-bottom)); }
  .list-search-panel::before { content: ""; flex: 0 0 5px; width: 2.6rem; margin: 0 auto .4rem; border-radius: 3px; background: var(--app-line); }
}
.list-search-status-heading {
  margin: 1rem 0 0.55rem;
}

@media (max-width: 760px) {
  body:has(.list-search-toggle):has(> .bottom-navigation)
  .page-shell:is([data-bulk-selection-root], [data-planning-search-root]):not(.page-shell--settings):not(.is-editing-task):not(.is-creating-task) {
    padding-bottom: calc(var(--bottom-navigation-mobile-height) + 4.7rem) !important;
  }

[data-phone-list-utilities-target][data-phone-search-dock] {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: calc(0.9rem + env(safe-area-inset-bottom));
    left: 0;
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    gap: 0.75rem;
    width: auto;
    align-items: center;
    box-sizing: border-box;
    margin: 0;
    overflow-anchor: none;
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-left: max(0.75rem, env(safe-area-inset-left));
    transform: none;
  }
[data-phone-list-utilities-target][data-phone-search-dock]:not(:has([data-responsive-list-create])) {
    grid-template-columns: 2.75rem minmax(0, 1fr);
  }
body:has(> .bottom-navigation) [data-phone-list-utilities-target][data-phone-search-dock] {
    bottom: calc(var(--bottom-navigation-mobile-height) + 0.65rem);
  }
[data-phone-search-dock] > [data-responsive-list-utilities] {
    display: contents;
  }
[data-phone-search-dock]:not(:has([data-bulk-selection-start])) {
    grid-template-columns: minmax(0, 1fr) 2.75rem;
  }
[data-phone-search-dock]:not(:has([data-bulk-selection-start])) .list-search-toggle {
    grid-column: 1;
  }
[data-phone-search-dock]:not(:has([data-bulk-selection-start])) [data-responsive-list-create] {
    grid-column: 2;
  }
[data-phone-search-dock] [data-bulk-selection-start] {
    grid-column: 1;
  }
[data-phone-search-dock] .list-search-toggle {
    position: static;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    height: 3.25rem;
    padding-inline: 1rem;
    border-radius: 999px;
    background: var(--app-surface);
    box-shadow: 0 0.8rem 2.2rem color-mix(in srgb, var(--app-ink) 14%, transparent);
    color: var(--app-muted);
    overflow-anchor: none;
    transform: none;
  }
[data-phone-search-dock] [data-responsive-list-create] {
    grid-column: 3;
    width: 2.75rem !important;
    min-width: 2.75rem !important;
    height: 2.75rem !important;
    min-height: 2.75rem !important;
    margin: 0;
    flex: 0 0 2.75rem;
  }
[data-phone-search-dock]:has(.list-search-toggle[aria-expanded="true"]) {
    grid-template-columns: minmax(0, 1fr);
  }
[data-phone-search-dock]:has(.list-search-toggle[aria-expanded="true"]) .list-search-toggle {
    grid-column: 1;
    border-color: color-mix(in srgb, var(--app-primary) 24%, var(--app-line));
    background: var(--app-primary-soft);
    color: var(--app-primary-ink);
  }
[data-phone-search-dock]:has(.list-search-toggle[aria-expanded="true"]) [data-bulk-selection-start],
[data-phone-search-dock]:has(.list-search-toggle[aria-expanded="true"]) [data-responsive-list-create] {
    display: none !important;
  }
.page-shell[data-bulk-selection-root].is-bulk-selecting [data-phone-search-dock],
.page-shell:has([data-canonical-editor-panel]) [data-phone-search-dock] {
    display: none;
  }
.list-search-toggle__label {
    flex: 1 1 auto;
    font-size: 1rem;
    text-align: left;
  }
}


body .list-search-panel .list-search__text-field input:focus {
  outline: none; box-shadow: none;
}
.list-search__text-field:focus-within { outline: 2px solid var(--app-primary); outline-offset: 2px; }
body .list-search-panel .list-search__results :is(.task-section__header, .task-subtask-preview, .task-row__note, .chore-row-tags) { display: none; }
body .list-search-panel .family-member-work-group { padding: 0; border: 0; background: transparent; }
#list-search-panel .task-section__header { display: none; }
#list-search-panel input[type="search"]::-webkit-search-cancel-button { display: none; }
/* Search results use the selected compact title-then-date hierarchy. */
#list-search-panel .daily-task-row__main {
  grid-template-columns: minmax(0, 1fr);
  row-gap: .3rem;
}
#list-search-panel .daily-task-due.schedule-row-status {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1;
  grid-row: auto;
  justify-content: flex-start;
  gap: .3rem;
  min-width: 0;
  margin-inline-start: 1.325rem;
  text-align: left;
}
#list-search-panel .task-row__title { font-size: 1rem; line-height: 1.35; }
#list-search-panel .task-creator-attribution { display: none; }

/* Tags and date filters are independent of the status controls. */
body .page-shell :is(.chore-tag-filter, .task-date-filter) > .list-filter__menu-trigger {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 44px; padding: 0 .75rem; border: 1px solid var(--app-line);
  border-radius: 12px; background: var(--app-surface); color: var(--app-muted);
  font: inherit; cursor: pointer;
}
body .page-shell .tasks-filter--shopping.list-filter.segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }

body .page-shell--tasks .tasks-list-titlebar__controls {
  display: flex; flex-wrap: wrap; width: 100%; gap: .4rem;
}
body .page-shell--tasks .tasks-filter.list-filter.segmented,
body .page-shell--tasks:not(.is-creating-task):not(.is-editing-task) .tasks-filter.list-filter.segmented {
  flex: 1 0 100%; width: 100%;
}
body .page-shell .chore-tag-filter { flex: 0 0 auto; min-width: 6rem; }
body .page-shell .chore-tag-filter .list-filter__menu-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  body .page-shell .tasks-filter.list-filter .list-filter__link { font-size: .84rem; padding-inline: .2rem; }
}

@media (max-width: 760px) {
  [data-phone-search-dock] [data-responsive-list-create]:not(:has(.phone-header-action__surface)) { background: var(--app-surface); color: var(--app-muted); border: 1px solid var(--app-line); }
  [data-phone-search-dock] [data-responsive-list-create] .phone-header-action__surface--primary { background: var(--app-surface); color: var(--app-muted); border-color: var(--app-line); }
}

body .page-shell .tasks-extra-filters .list-filter__menu-trigger.is-selected {
  background: var(--app-primary-soft); color: var(--app-primary-ink); border-color: color-mix(in srgb, var(--app-primary) 24%, var(--app-line));
}
