/* One search and filter on every list (the Founder, 4 October 2026): an icon, a bar, a panel of checkboxes. list-search.js */

/* The icon sits beside the page title; on a phone, at the end of the title's line. */
.list-title{display:flex;align-items:center;gap:10px;min-width:0}
.list-title h1{min-width:0;overflow-wrap:anywhere}
.list-search-toggle{width:44px;min-width:44px;height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);color:var(--ink,#24212d);cursor:pointer}
.list-search-toggle[aria-expanded=true]{background:var(--soft,#f2ecfa);color:var(--purple,#6d28b5);border-color:#cdb4ec}
.list-search-toggle .icon{width:20px;height:20px}
@media(max-width:700px){.list-title .list-search-toggle{margin-inline-start:auto}}
/* The top bar is the same on every page, its search included (the Founder, 5 October 2026: "I'm in the Agent Crew page and I can't search"). */

/* The bar */
.list-search{display:grid;gap:10px;margin:0 0 16px;min-width:0}
.list-search-row{display:flex;align-items:center;gap:8px;min-width:0;max-width:760px}
.list-search-field{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:46px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);cursor:text}
.list-search-field:focus-within{border-color:var(--purple,#6d28b5);box-shadow:inset 0 0 0 1px var(--purple,#6d28b5)}
.list-search-field .icon{flex:none;width:19px;height:19px;color:var(--muted)}
.list-search-field .input{flex:1;min-width:0;width:100%;max-width:none;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;font-size:1rem;outline:0;box-shadow:none}
.list-search-field .input::-webkit-search-cancel-button{display:none}
.list-filter-open,.list-search-close{flex:none;width:46px;min-width:46px;height:46px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);color:var(--ink,#24212d);cursor:pointer}
.list-search-close{border-color:transparent;background:none;color:var(--muted)}
.list-filter-open.on{background:var(--soft,#f2ecfa);color:var(--purple,#6d28b5);border-color:#cdb4ec}
.list-filter-open .icon,.list-search-close .icon{width:20px;height:20px}
.list-filter-count{position:absolute;top:-6px;inset-inline-end:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--purple,#6d28b5);color:#fff;font-size:.72rem;font-weight:700;line-height:20px;text-align:center}

/* The filter beside the search in the heading (Tasks, the Founder 5 Oct): the same 44px square as the search icon. */
.list-title .list-filter-heading{position:relative;flex:none;width:44px;min-width:44px;height:44px}
/* Its chips sit under the heading, left-aligned and wrapping, with Clear once there are two. */
.list-chips-under{margin:0 0 16px;align-items:center}
.list-chips-clear{min-height:32px;padding:4px 10px;border:0;border-radius:999px;background:none;color:var(--purple,#6d28b5);font:inherit;font-size:.82rem;font-weight:600;cursor:pointer}
.list-chips-clear:hover{text-decoration:underline}
[data-theme=dark] .list-chips-clear{color:var(--ink)}

/* Chips: what is chosen, each removable */
.list-chips{display:flex;flex-wrap:wrap;gap:6px;min-width:0}
.list-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:32px;padding:4px 8px 4px 12px;border:1px solid #cdb4ec;border-radius:999px;background:var(--soft,#f2ecfa);color:var(--purple-dark,#541c91);font-size:.82rem;font-weight:600;cursor:pointer}
.list-chip span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.list-chip .icon{flex:none;width:14px;height:14px}
.list-chip:hover{border-color:var(--purple,#6d28b5)}
[data-theme=dark] .list-chip{color:var(--ink)}

/* The filter is a sheet over the page, never a page (the Founder, 23 October 2026), as Shortcuts' (shortcuts.css): on a
   phone it rises from the bottom, rounded on top, with a grab handle; on a computer it is a card in the middle. At most
   85% of the screen tall: the headings scroll inside it, the title and Clear all / Show results stay. */
html:has(dialog.list-filter-panel[open]){overflow:hidden}
.list-filter-panel{position:fixed;inset:auto 0 0;width:100vw;max-width:100vw;height:auto;max-height:85dvh;margin:0;padding:0;border:0;border-radius:20px 20px 0 0;overflow:hidden;background:var(--surface,#fff);color:var(--ink,#24212d);box-shadow:0 -10px 40px #1c142b33;outline:0;transition:transform .15s ease-out}
[data-theme=dark] .list-filter-panel{background:#1d1926;color:#f1eff7}
.list-filter-panel::backdrop{background:#0005}
.list-filter-form{display:flex;flex-direction:column;max-height:85dvh;min-height:0}
.list-filter-handle{display:grid;place-items:center;flex:none;height:18px;touch-action:none;cursor:grab}
.list-filter-handle span{width:40px;height:4px;border-radius:2px;background:var(--line,#d9d6e2)}
.list-filter-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 10px 8px 20px;border-bottom:1px solid var(--line);touch-action:none}
.list-filter-head h2{margin:0;font-size:1.15rem}
.list-filter-head .icon-button{width:44px;min-width:44px;height:44px;border:0;border-radius:50%;background:none;color:inherit;cursor:pointer}
.list-filter-groups{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 20px 16px}
.list-filter-group{margin:0;padding:16px 0 10px;border:0;border-bottom:1px solid var(--line);min-width:0}
.list-filter-group:last-child{border-bottom:0}
.list-filter-group legend{float:inline-start;width:100%;margin:0 0 6px;padding:0;font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.list-filter-option{clear:both;display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;font-size:.95rem}
.list-filter-option input{flex:none;width:20px;height:20px;margin:0;accent-color:var(--purple,#6d28b5)}
.list-filter-option span{min-width:0;overflow-wrap:anywhere}
.list-filter-foot{flex:none;display:flex;gap:10px;padding:14px 20px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:inherit}
.list-filter-foot .btn{flex:1;min-height:46px}
@media (max-width:700px){dialog.list-filter-panel[open]{animation:lf-rise .24s cubic-bezier(.2,.8,.2,1)}}
@media (prefers-reduced-motion:reduce){dialog.list-filter-panel[open]{animation:none}}
@keyframes lf-rise{from{transform:translateY(100%)}to{transform:none}}
@media (min-width:701px){
 .list-filter-panel{inset:0;margin:auto;width:min(520px,calc(100vw - 32px));border-radius:18px;box-shadow:0 24px 60px #0004}
 .list-filter-form{max-height:min(760px,85dvh)}
 .list-filter-panel .list-filter-handle{display:none}
 .list-filter-head{padding-top:12px}
}
/* Choices you can see (the Founder, 23 October 2026, beside Airbnb's filters): a title per heading, then pills, segments
   or tiles; the chosen one outlined in ink. The input is hidden and still the form's. */
.list-filter-groups{padding:4px 20px 20px}
.list-filter-group{padding:22px 0 20px}
.list-filter-group legend{float:left;width:100%;margin:0 0 12px;font-size:1.15rem;font-weight:600;letter-spacing:0;text-transform:none;color:var(--ink,#24212d)}
.lf-options{clear:both;display:flex;flex-wrap:wrap;gap:10px;min-width:0}
.list-filter-option.lf-chip,.list-filter-option.lf-tile,.list-filter-option.lf-seg{position:relative;min-height:0;gap:0;clear:none;font-size:inherit}
.lf-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.lf-chip-in{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--line,#dcd9e3);border-radius:999px;background:var(--surface,#fff);font-size:.95rem;line-height:1.2}
.lf-chip-art{display:inline-flex}
.lf-chip-art :is(svg,.task-state-icon,.task-priority-icon){width:18px;height:18px}
.lf-chip:has(.lf-input:checked) .lf-chip-in{border:2px solid var(--ink,#24212d);padding:0 15px;background:var(--soft,#f6f3fb);font-weight:600}
.lf-tiles .lf-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.lf-tile{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 8px 10px;border:1px solid var(--line,#dcd9e3);border-radius:14px;background:var(--surface,#fff);text-align:center;cursor:pointer;min-width:0}
.lf-tile-art{display:grid;place-items:center;width:100%;min-width:0}
.lf-tile-art .portrait-box{width:56px;height:56px;min-width:56px;border-radius:24%}
/* A tile cover sits on the tile, not under it: collections.css puts .ws-cover at z-index -1 behind a card's words. */
.lf-tile-art .ws-cover{position:relative;z-index:0;display:block;width:100%;aspect-ratio:4/3;border-radius:10px;overflow:hidden}
.lf-tile-art .ws-cover img{width:100%;height:100%;object-fit:cover}
.lf-tile-name{max-width:100%;font-size:.88rem;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lf-tile:has(.lf-input:checked){border:2px solid var(--ink,#24212d);padding:11px 7px 9px;background:var(--soft,#f6f3fb)}
.lf-tile:has(.lf-input:checked) .lf-tile-name{font-weight:600}
.lf-segments .lf-options{gap:8px}
.lf-seg>span{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1px solid var(--line,#dcd9e3);border-radius:999px;background:var(--surface,#fff);font-size:.95rem}
.lf-seg:has(.lf-input:checked)>span{border:2px solid var(--ink,#24212d);padding:0 15px;font-weight:600;background:var(--soft,#f6f3fb)}
/* The ring is the keyboard's only, on the choice's own outline: never on the icon or the word inside it (the Founder's
   "To do", 23 October 2026: a box round each inside the chip), and never after a tap. */
.list-filter-panel .lf-input:is(:focus,:focus-visible){outline:none}
.lf-chip:has(.lf-input:focus-visible) .lf-chip-in,.lf-seg:has(.lf-input:focus-visible)>span,.lf-tile:has(.lf-input:focus-visible){outline:2px solid var(--accent,var(--purple,#6d28b5));outline-offset:2px}
.list-filter-panel:focus,.list-filter-panel:focus-visible{outline:none}
.list-filter-foot :is(button):focus:not(:focus-visible),.list-filter-head .icon-button:focus:not(:focus-visible){outline:none}
.list-filter-foot{align-items:center;justify-content:space-between}
.list-filter-foot .lf-clear{flex:none;min-height:44px;padding:0 4px;border:0;background:none;color:var(--ink,#24212d);font:inherit;font-weight:600;text-decoration:underline;cursor:pointer}
.list-filter-foot .btn.lf-show{flex:0 1 auto;min-width:56%;background:var(--ink,#24212d);border-color:var(--ink,#24212d);color:#fff}
[data-theme=dark] .list-filter-foot .btn.lf-show{background:#f0f1f5;border-color:#f0f1f5;color:#15161b}
[data-theme=dark] :is(.lf-chip:has(.lf-input:checked) .lf-chip-in,.lf-tile:has(.lf-input:checked),.lf-seg:has(.lf-input:checked)>span){border-color:#f0f1f5}
.lf-chip-art .icon{width:18px;height:18px;fill:none;stroke:currentColor}
.lf-seg>span{gap:8px}
.lf-initial{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--soft,#f2ecfa);color:var(--accent,var(--purple,#6d28b5));font-size:.75rem;font-weight:700}
.lf-cover-icon{display:grid!important;place-items:center}
.lf-cover-icon .icon{width:26px;height:26px;opacity:.7}
