/* Shared mobile preference sheet. Overview stays short; one group per screen. */
.sw-settings{position:fixed;inset:auto 0 0;display:flex;flex-direction:column;width:min(100%,480px);max-width:100%;max-height:calc(100dvh - 16px);margin:0 auto;border:0;border-radius:24px 24px 0 0;padding:0;background:#fff;color:#342b38;font:400 16px/1.4 'Swipe Work','NS Work',sans-serif;box-shadow:0 -8px 50px #342b3826}.sw-settings[hidden]{display:none!important}.sw-settings::backdrop{background:#342b3866;backdrop-filter:blur(3px)}.sw-settings *{box-sizing:border-box}.sw-settings button,.sw-settings input{font:inherit}.sw-settings button{cursor:pointer}.sw-settings svg{width:21px;height:21px;flex:none;fill:none;stroke:currentColor}.sw-settings button:focus-visible,.sw-settings input:focus-visible{outline:2px solid #8c3654;outline-offset:2px}.sw-settings-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid #eadce2;flex:none;min-height:68px}.sw-settings-head h2{flex:1;font-size:21px;font-weight:600;line-height:1.2;margin:0;letter-spacing:-.5px}.sw-settings-icon{width:44px;height:44px;display:grid;place-items:center;border:1px solid #eadce2;border-radius:50%;background:#fff;color:#8c3654}.sw-settings-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 16px;flex:1}.sw-settings-row{display:flex;align-items:center;gap:10px;min-height:52px;width:100%;border:0;border-bottom:1px solid #f0e8ec;background:#fff;padding:8px 0;color:#8c3654;text-align:left}.sw-settings-row-label{font-weight:600;color:#342b38;flex:1;white-space:nowrap}.sw-settings-summary{color:#776772;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px}.sw-settings-row>svg:last-child{width:16px;height:16px;color:#aa8998}.sw-settings-favorites{display:flex;align-items:center;gap:10px;min-height:52px;width:100%;border:0;background:#fff;color:#8c3654;text-align:left;padding:8px 0}.sw-settings-favorites>span{flex:1}.sw-settings-favorites>svg:last-child{width:16px;height:16px}.sw-settings-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px max(12px,env(safe-area-inset-bottom));border-top:1px solid #eadce2;flex:none;min-height:76px}.sw-settings-count{font-size:16px;color:#776772}.sw-settings-count:empty{display:none}.sw-settings-apply{margin-left:auto;border:0;background:#8c3654;color:#fff;border-radius:28px;min-height:52px;padding:12px 22px;font-weight:600}.sw-settings-detail{padding:16px}.sw-settings-hint{font-size:16px;line-height:1.45;color:#776772;margin:0 0 14px}.sw-settings-options{display:flex;flex-wrap:wrap;gap:8px}.sw-setting-option{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:46px;padding:10px 14px;border:1px solid #e2d4db;border-radius:14px;background:#fff;color:#776772;text-align:left}.sw-setting-option[aria-pressed=true]{border-color:#a4647d;background:#fff4f6;color:#79314e}.sw-option-check{width:16px;flex:none;text-align:center}.sw-setting-option:only-child{min-width:150px}.sw-settings-letters{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.sw-settings-letters .sw-setting-option{padding:8px 5px;justify-content:center;min-width:0}.sw-settings-letters .sw-option-check{display:none}.sw-settings-letters .sw-setting-option:first-child{grid-column:span 5}.sw-settings-reset{display:flex;align-items:center;min-height:44px;padding:8px 0;border:0;background:none;color:#8c3654;text-decoration:underline;text-underline-offset:4px;margin-top:12px}.sw-settings-search,.sw-settings-text{display:block;width:100%;height:50px;padding:12px;border:1px solid #d5bfca;border-radius:12px;background:#fff;color:#342b38;font-size:16px;margin-bottom:14px}.sw-settings-text{margin:0}.sw-settings-search{position:sticky;top:0;z-index:1}.sw-settings-body::-webkit-scrollbar{width:4px}.sw-settings-body::-webkit-scrollbar-thumb{background:#d9c1cd;border-radius:4px}
@media(min-width:700px){.sw-settings{inset:0;margin:auto;max-height:min(680px,calc(100dvh - 48px));height:max-content;border-radius:24px}.sw-settings-body{max-height:490px}}
@media(prefers-reduced-motion:reduce){.sw-settings::backdrop{backdrop-filter:none}}
.sw-settings-info{display:flex;align-items:center;min-height:44px;padding:8px 0;border:0;background:#fff;color:#776772;font-size:16px;text-decoration:underline;text-underline-offset:4px}
/* Mobile preferences enter and leave as one layer anchored to the bottom edge. */
.sw-settings:not([open]){display:none}.sw-settings-handle{display:none}
@keyframes sw-settings-in{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}
@keyframes sw-settings-out{from{transform:var(--sw-settings-exit-from,translate3d(0,0,0))}to{transform:translate3d(0,calc(100% + 32px),0)}}
@keyframes sw-settings-dim-in{from{opacity:0}to{opacity:1}}
@keyframes sw-settings-dim-out{from{opacity:1}to{opacity:0}}
@media(max-width:699px){
 .sw-settings{inset:auto 0 0;width:100%;max-width:100%;height:max-content;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);margin:0;border-radius:28px 28px 0 0;overflow:hidden}
 .sw-settings.sw-settings-entering{animation:sw-settings-in 420ms cubic-bezier(.22,1,.36,1) both}
 .sw-settings::backdrop{animation:sw-settings-dim-in 300ms ease-out both}
 .sw-settings-handle{height:20px;flex:none;display:flex;align-items:center;justify-content:center}
 .sw-settings-handle span{display:block;width:36px;height:4px;border-radius:4px;background:#d9c4ce}
 .sw-settings-head{padding-top:4px;min-height:60px}
 .sw-settings.sw-settings-closing{pointer-events:none;animation:sw-settings-out 300ms cubic-bezier(.4,0,.6,1) both}
 .sw-settings.sw-settings-closing::backdrop{animation:sw-settings-dim-out 300ms ease-in both}
}
/* Let the content establish the dialog height before shrinking to its viewport
   limit. A zero flex basis can collapse this region in iPhone modal dialogs. */
.sw-settings-body{flex:1 1 auto}
@media(prefers-reduced-motion:reduce){.sw-settings,.sw-settings::backdrop{animation:none!important}}
/* Quick selection and search stay together above a long list of options. */
.sw-settings-tools{position:sticky;top:-16px;z-index:2;background:#fff;padding-top:8px;margin-bottom:14px}
.sw-settings-tools .sw-settings-search{position:static;margin:0;padding-block:10px}
.sw-settings-bulk{display:flex;gap:8px;padding-bottom:10px}
.sw-settings-bulk button{flex:1;min-height:44px;border:1px solid #d5bfca;border-radius:12px;background:#fff4f6;color:#79314e;padding:8px 12px}
.sw-settings-bulk button:active{background:#ecd5de}

/* Empty selections explain the next step inside the same sheet. */
.sw-settings-head h2:focus,.sw-settings-notice:focus{outline:none}
.sw-settings-close:focus:not(:focus-visible){outline:none;box-shadow:none}
.sw-settings-notice{display:flex;align-items:flex-start;gap:12px;flex:none;margin:8px 16px 12px;padding:14px;border-radius:16px;background:#fff4f6;color:#79314e;animation:sw-settings-notice-in 240ms ease-out both}
.sw-settings-notice[hidden]{display:none}
.sw-settings-notice>svg{width:28px;height:28px;margin-top:2px;transform:rotate(-8deg)}
.sw-settings-notice strong{display:block;font-size:16px;font-weight:600}
.sw-settings-notice p{margin:4px 0 0;font-size:16px;line-height:1.4;color:#776772}
.sw-settings-retry{min-height:44px;padding:8px 0;border:0;background:transparent;color:#79314e;text-decoration:underline;text-underline-offset:3px}
.sw-settings-apply[aria-disabled=true]{background:#eadce2;color:#705563}
@keyframes sw-settings-notice-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.sw-settings-notice{animation:none}}
