/*
 * One bottom sheet (bottom-sheet.js; the Founder, 24 October 2026): Agent colour and Appearance in the filter sheets' own
 * language. On a phone it rises from the bottom: a grab handle, the title with ✕ at the right, sections each under a small
 * heading, choices as pills, a footer with the primary button. On a computer a card in the middle.
 */
dialog.bsheet{position:fixed;inset:auto 0 0;width:100vw;max-width:100vw;height:auto;max-height:100dvh;margin:0;padding:0;border:0;background:transparent;overflow:visible;color:var(--ink,#24212d)}
dialog.bsheet::backdrop{background:rgba(20,14,32,.38)}
.bsheet-panel{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-height:calc(100dvh - 40px - env(safe-area-inset-top,0px));background:var(--surface,#fff);border-radius:20px 20px 0 0;box-shadow:0 -10px 40px #1c142b33;transition:transform .2s ease-out}
[data-theme=dark] .bsheet-panel{background:#1d1e24;color:#f0f1f5}
@media (max-width:700px){dialog.bsheet[open]>.bsheet-panel{animation:sc-rise .24s cubic-bezier(.2,.8,.2,1)}}
@media (prefers-reduced-motion:reduce){dialog.bsheet[open]>.bsheet-panel{animation:none;transition:none}}
@keyframes sc-rise{from{transform:translateY(100%)}to{transform:none}}
.bsheet-handle{display:grid;place-items:center;flex:none;height:20px;touch-action:none;cursor:grab}
.bsheet-handle span{width:40px;height:5px;border-radius:3px;background:var(--line,#d9d6e2)}
.bsheet-head{display:flex;align-items:center;gap:12px;flex:none;min-height:48px;padding:0 8px 6px 20px;border-bottom:1px solid var(--line,#e7e5ee);touch-action:none}
.bsheet-head h2{flex:1;min-width:0;margin:0;font-size:1.15rem;font-weight:700;line-height:1.3}
.bsheet-head h2:focus{outline:none}
.bsheet-close{display:inline-grid;place-items:center;width:44px;min-width:44px;height:44px;border:0;border-radius:50%;background:none;color:inherit;cursor:pointer}
.bsheet-close .icon{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.bsheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:4px 20px 16px}
.bsheet-foot{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex:none;padding:12px 20px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line,#e7e5ee)}
.bsheet-foot .btn.primary{flex:1 1 auto;min-height:48px;border-radius:12px;background:var(--ink,#24212d);border-color:var(--ink,#24212d);color:#fff;font-weight:600}
[data-theme=dark] .bsheet-foot .btn.primary{background:#f0f1f5;border-color:#f0f1f5;color:#15161b}
.bsheet-foot .btn.primary:disabled{opacity:.35}
@media (min-width:701px){
 dialog.bsheet{inset:0;margin:auto;width:min(460px,calc(100vw - 32px));height:fit-content}
 .bsheet-panel{border-radius:18px;max-height:min(760px,88dvh);box-shadow:0 24px 60px #0004}
 .bsheet-handle{display:none}
 .bsheet-head{padding-top:10px}
}

/* A section: a small heading, then its choices. */
.bs-group{margin:0;padding:18px 0 16px;border:0;border-bottom:1px solid var(--line,#e7e5ee);min-width:0}
.bs-group:last-child{border-bottom:0}
.bs-group>legend,.bs-group>.bs-legend{float:left;width:100%;margin:0 0 12px;padding:0;font-size:1rem;font-weight:600;line-height:1.3;color:var(--ink,#24212d)}
[data-theme=dark] .bs-group>:is(legend,.bs-legend){color:#f0f1f5}
.bs-options{clear:both;display:flex;flex-wrap:wrap;gap:10px;min-width:0}
/* A pill: the input is hidden and still the form's; the chosen one outlined in ink, as the filters' are. */
.bs-chip{position:relative;display:inline-flex;min-width:0;cursor:pointer}
.bs-input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.bs-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;color:var(--ink,#24212d)}
.bs-chip:has(.bs-input:checked) .bs-chip-in{border:2px solid var(--ink,#24212d);padding:0 15px;background:var(--soft,#f6f3fb);font-weight:600}
.bs-chip:has(.bs-input:focus-visible) .bs-chip-in{outline:2px solid var(--purple,#6d28b5);outline-offset:2px}
[data-theme=dark] .bs-chip-in{background:transparent;border-color:#3a3c46;color:#f0f1f5}
[data-theme=dark] .bs-chip:has(.bs-input:checked) .bs-chip-in{border-color:#f0f1f5;background:#2a2b33}

/* A row that opens or chooses one thing: its words, a quiet line under them, and a check or › at the end. */
.bs-rows{display:grid;margin:12px 0 4px;border:1px solid var(--line,#e7e5ee);border-radius:14px;overflow:hidden}
.bs-row{display:flex;align-items:center;gap:14px;width:100%;min-height:60px;padding:10px 16px;border:0;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer;box-sizing:border-box}
.bs-row+.bs-row{border-top:1px solid var(--line,#e7e5ee)}
.bs-row:hover{background:var(--soft,#f6f3fb)}
[data-theme=dark] .bs-row:hover{background:#2a2b33}
.bs-row-words{display:grid;gap:2px;flex:1;min-width:0}
.bs-row-words strong{font-weight:600;font-size:1rem}
.bs-row-words small{font-size:.875rem;line-height:1.35;color:var(--muted,#686577)}
.bs-row-end{display:inline-flex;align-items:center;gap:6px;flex:none;color:var(--muted,#686577)}
.bs-row-end .icon{width:20px;height:20px}
.bs-row[aria-pressed=true] .bs-row-check{color:var(--ink,#24212d)}
[data-theme=dark] .bs-row[aria-pressed=true] .bs-row-check{color:#f0f1f5}
.bs-row-lead{flex:none}
/* A choice with nothing behind it (Appearance's "Claude Code has no face to share"): still pressable, its words a quiet note. */
.bs-row-quiet .bs-row-words strong{font-weight:500;color:var(--muted,#686577)}
.bs-row-quiet .bs-row-words small{font-style:italic}
.bs-row-go{display:inline-flex}
[dir=rtl] .bs-row-go .icon{transform:scaleX(-1)}
.bsheet-body:last-child{padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
