/* Shared list filters: light triggers, removable chips, and a staged builder. */
.filter-navigation{display:flex;align-items:center;justify-content:space-between;gap:24px}
.compact-selects,.algorithm-view .compact-selects,.experience-view .compact-selects{display:flex;flex-wrap:wrap;align-items:center;gap:7px 18px;min-width:0}
.compact-filters{margin:0 0 18px;padding:0;background:transparent;border:0;box-shadow:none}
.filter-trigger{width:auto;min-width:0;height:36px;gap:8px;padding:0 8px;border:0;border-radius:6px;background:transparent;color:var(--text-secondary);font-size:13px;font-weight:500}
.filter-trigger>span{font-size:inherit;color:inherit}.filter-trigger>.ui-icon:last-child{margin-left:0;width:14px;height:14px;color:var(--text-muted)}
.filter-trigger:hover,.filter-trigger[aria-expanded=true]{background:var(--surface-subtle);border:0;box-shadow:none}
.filter-trigger.is-filtered{color:var(--primary);background:transparent;border:0}.filter-trigger.is-filtered .ui-icon{color:inherit}
.more-filters{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex:none;height:36px;padding:0 12px;border:1px solid var(--border-strong);background:var(--surface);border-radius:7px;color:var(--text-secondary);font-size:12px;white-space:nowrap}
.more-filters>.ui-icon{width:16px;height:16px}.more-filters>b{min-width:20px;height:20px;line-height:20px;padding:0 5px;border-radius:10px;background:var(--primary);color:#fff;font-size:11px;font-weight:600}
.more-filters:hover,.more-filters[aria-expanded=true]{border-color:var(--primary-border);color:var(--primary);background:var(--primary-soft)}
.applied-filters,.saved-filter-presets{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:14px;min-width:0}
.applied-filters[hidden],.saved-filter-presets[hidden],.more-filters[hidden]{display:none!important}
.filter-caption{font-size:11px;color:var(--text-muted);margin-right:3px;flex:none}
.filter-chip,.filter-preset{display:inline-flex;align-items:center;max-width:min(100%,320px);border-radius:6px;overflow:hidden;background:var(--primary-soft);color:var(--primary)}
.filter-chip>button,.filter-preset>button{background:transparent;border:0;font-size:12px;color:inherit;min-width:0;padding:7px 9px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.filter-chip>button:last-child,.filter-preset>button:last-child{padding:6px;flex:none;display:flex;align-items:center;justify-content:center}
.filter-chip .ui-icon,.filter-preset .ui-icon{width:12px;height:12px}.filter-chip>button:hover{background:#2563eb0b}
.filter-preset{border:1px solid var(--border);background:var(--surface);color:var(--text-secondary)}.filter-preset>button:hover{background:var(--surface-subtle);color:var(--primary)}
.applied-filters .reset-filters{font-size:12px;padding:5px 8px;color:var(--text-muted)}.applied-filters .reset-filters:hover{color:var(--primary)}
.heading-actions .study-progress{display:flex;justify-content:flex-end;align-items:baseline;gap:7px;flex-wrap:wrap;font-size:15px;color:var(--text-secondary)}
.heading-actions .study-progress strong{font-size:23px;color:var(--primary);font-weight:650;line-height:1.2}.heading-actions .study-progress>span{color:var(--text-secondary)}
.study-progress-track{flex-basis:100%;width:138px;max-width:138px;height:3px;border-radius:3px;background:var(--border);overflow:hidden;display:block;margin-top:3px;margin-left:auto}.study-progress-track i{height:100%;display:block;background:var(--primary);border-radius:inherit;transition:width .2s}
.algorithm-view .heading-actions #account-summary{display:none}.algorithm-view .page-heading h1{font-size:32px;letter-spacing:-.6px}.algorithm-view .page-heading p{font-size:13px}.algorithm-view .page-heading .eyebrow{display:none}
.algorithm-view .heading-actions{gap:12px}.algorithm-view #algorithm-share{font-size:11px;padding:7px 10px;background:transparent;color:var(--primary);border:1px solid var(--primary-border)}
.algorithm-view .search-box{height:48px;border-radius:9px}.algorithm-view .list-controls{margin-top:14px}
.algorithm-view #question-list{border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface);box-shadow:0 3px 12px #172b4d03}
.algorithm-table-heading,article.algorithm-row{grid-template-columns:minmax(0,1fr) 74px 150px 320px;padding:20px 22px;column-gap:22px}
.algorithm-table-heading{background:var(--surface-subtle);font-size:11px;color:var(--text-muted);padding-top:14px;padding-bottom:14px}
article.algorithm-row{border:0;border-bottom:1px solid var(--border);border-radius:0;box-shadow:none;min-height:102px}.algorithm-row:last-child{border-bottom:0}
.algorithm-row .question-title{font-size:15px;font-weight:650;margin:0 0 7px}.algorithm-question>div{gap:8px 12px;font-size:11px}.algorithm-row .algorithm-date{font-size:12px;gap:8px}
.algorithm-row .encounter-count{padding:3px 0;font-size:10px;background:transparent;border:0;align-self:flex-start;color:var(--text-muted)}
.algorithm-row .algorithm-actions{gap:16px;justify-content:flex-end}.algorithm-actions .review-button,.algorithm-actions .note-button{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;padding:7px 0;background:transparent;border:0;color:var(--primary);font-size:12px;font-weight:500;border-radius:5px}
.algorithm-actions .review-button.reviewed{background:transparent;color:var(--primary)}.algorithm-actions .review-button:not(.reviewed){font-size:0}.algorithm-actions .review-button:not(.reviewed)::after{content:'标记复习';font-size:12px}
.algorithm-actions .review-button>.ui-icon,.algorithm-actions .note-button>.ui-icon{width:16px;height:16px}.algorithm-actions .review-button:not(.reviewed)>.ui-icon{display:none}.algorithm-actions .review-button:not(.reviewed)::before{content:'';display:inline-block;width:13px;height:13px;border:1.5px solid currentColor;border-radius:3px}
.algorithm-actions .discussion-link{display:inline-flex;align-items:center;gap:6px;color:var(--text-muted);font-size:12px}.algorithm-actions .discussion-link>.ui-icon{width:17px;height:17px}.algorithm-actions .save-button{font-size:22px;line-height:1;padding:4px;color:var(--text-muted)}.algorithm-actions .save-button.saved{color:var(--primary)}
.algorithm-actions button:hover{color:var(--primary-strong);text-decoration:underline;text-underline-offset:3px}
@media(max-width:1100px){.compact-selects,.algorithm-view .compact-selects,.experience-view .compact-selects{gap:5px 8px}.algorithm-table-heading,article.algorithm-row{grid-template-columns:minmax(0,1fr) 60px 116px 274px;gap:14px}.algorithm-actions{gap:12px!important}}
@media(max-width:900px) and (min-width:701px){.algorithm-table-heading,article.algorithm-row{grid-template-columns:minmax(0,1fr) 60px 240px}.algorithm-row .algorithm-actions{grid-column:3;grid-row:1 / span 2}.algorithm-row .algorithm-date{grid-column:1;grid-row:2}}
@media(max-width:700px){
 .filter-navigation{gap:8px;align-items:flex-start;flex-wrap:wrap}.compact-selects,.algorithm-view .compact-selects,.experience-view .compact-selects{display:flex;flex:1 1 100%;gap:3px 4px}.filter-trigger{height:32px;width:auto;min-width:0;font-size:12px;padding:0 6px;gap:5px}.filter-trigger>span{font-size:12px}.filter-trigger>.ui-icon:last-child{margin-left:0;width:12px}.more-filters{height:32px;margin-left:auto;font-size:11px;padding:0 9px;gap:6px}.compact-filters{margin-bottom:12px}.applied-filters,.saved-filter-presets{gap:6px;margin-top:10px}.filter-chip{max-width:100%}.filter-chip>button,.filter-preset>button{font-size:11px;padding:6px 8px}.filter-caption{font-size:10px}
 .heading-actions .study-progress{font-size:11px;gap:5px;white-space:nowrap}.heading-actions .study-progress strong{font-size:19px}.study-progress-track{width:90px;max-width:90px;margin-top:1px}.algorithm-view .page-heading h1{font-size:24px}.algorithm-view .page-heading{align-items:center}.algorithm-view .heading-actions{width:auto;flex:none;gap:8px}.algorithm-view #algorithm-share{font-size:10px;padding:5px 7px}.algorithm-view .search-box{height:43px}.algorithm-view .list-controls{margin-top:10px}
 article.algorithm-row{grid-template-columns:minmax(0,1fr) 44px;gap:12px 10px;padding:18px 16px;min-height:0}.algorithm-row .question-title{font-size:14px}.algorithm-question>div{font-size:10px;gap:6px 10px}.algorithm-row .algorithm-date{font-size:11px}.algorithm-row .algorithm-actions{gap:14px!important}.algorithm-actions .review-button,.algorithm-actions .review-button:not(.reviewed)::after,.algorithm-actions .note-button{font-size:11px}.algorithm-actions .discussion-link{margin-left:auto;font-size:11px}.algorithm-actions .save-button{font-size:21px}.algorithm-table-heading{display:none}
 .forum-view .compact-selects{flex-wrap:nowrap;overflow:auto}
}
@media(prefers-reduced-motion:reduce){.study-progress-track i{transition:none}}
@media(max-width:380px){.topbar{column-gap:6px}.topbar .top-right{gap:4px}.topbar .top-right .button{padding:7px 5px;font-size:10px}.topbar .brand strong{font-size:17px}#logout-button{font-size:9px;white-space:nowrap}}
@media(max-width:420px){#profile-name{display:none}#logout-button{white-space:nowrap}}

/* Staged filter panel: persistent fields, grouped lists and one explicit apply. */
body.filter-panel-open{overflow:hidden}
#advanced-filters{--filter-font:14px;position:fixed;inset:auto;max-width:none;margin:0;padding:0;border:1px solid var(--border);border-radius:16px;overflow:hidden;background:var(--surface);color:var(--text-primary);box-shadow:0 20px 70px #172b4d24;box-sizing:border-box;font-size:var(--filter-font);line-height:1.5}
#advanced-filters *{box-sizing:border-box}
#advanced-filters[open]{display:flex;flex-direction:column}
#advanced-filters::backdrop{background:#152a4a38;backdrop-filter:blur(2px)}
#advanced-filters [hidden]{display:none!important}
#advanced-filters button{min-height:44px;border:0;background:transparent;color:var(--text-secondary);font:inherit;border-radius:4px;padding:10px 8px;cursor:pointer}
#advanced-filters button:hover{color:var(--primary)}
#advanced-filters button:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
#advanced-filters button:disabled{opacity:.45;cursor:default}
#advanced-filters button.primary{background:var(--primary);color:#fff;font-weight:600;border-radius:8px}
#advanced-filters button.primary:hover{background:var(--primary-strong)}
#advanced-filters .ui-icon{width:18px;height:18px;flex:none}
#advanced-filters .advanced-filter-heading{display:flex;align-items:center;flex:none;gap:12px;padding:12px 24px 4px}
#advanced-filters .advanced-filter-heading h2{margin:0 auto 0 0;font-size:18px;font-weight:650;line-height:1.5}
#advanced-filters [data-draft-clear]{color:var(--text-muted);padding:8px 0}
#advanced-filters .filter-panel-close{display:grid;place-items:center;width:44px;height:44px;flex:none;padding:0;color:var(--text-muted)}
#advanced-filters .filter-field-nav{display:flex;flex:none;gap:28px;padding:0 24px;border-bottom:1px solid var(--border);margin:0 0 8px;min-width:0}
#advanced-filters .filter-field-nav button{display:flex;align-items:center;gap:6px;position:relative;border-radius:0;padding:8px 2px 10px;white-space:nowrap;font-weight:500;color:var(--text-muted)}
#advanced-filters .filter-field-nav button[aria-pressed=true]{color:var(--primary)}
#advanced-filters .filter-field-nav button[aria-pressed=true]:after{content:'';position:absolute;height:2px;left:0;right:0;bottom:-1px;background:var(--primary);border-radius:2px}
#advanced-filters .filter-field-check{display:flex;align-items:center;width:12px;color:var(--primary)}
#advanced-filters .filter-field-check .ui-icon{width:12px;height:12px}
#advanced-filters .filter-form-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding:12px}
#advanced-filters .filter-picker-workspace{display:flex;flex-direction:column;flex:1;min-height:210px}
#advanced-filters .filter-picker-tools{flex:none;padding:0 24px}
#advanced-filters .filter-option-search{display:flex;align-items:center;gap:9px;min-height:44px;padding:0 12px;margin:0;border:1px solid transparent;background:var(--surface-subtle);border-radius:8px;color:var(--text-muted)}
#advanced-filters .filter-option-search:focus-within{border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-soft)}
#advanced-filters .filter-option-search input{display:block;flex:1;min-width:0;width:100%;height:44px;border:0;box-shadow:none;outline:0;background:transparent;margin:0;padding:0;font-size:16px;color:var(--text-primary);font-weight:400}
#advanced-filters .filter-option-search input::-webkit-search-cancel-button{display:none}
#advanced-filters input::placeholder{color:var(--text-muted)}
#advanced-filters .filter-option-search button{display:grid;place-items:center;width:44px;flex:none;padding:8px;margin-right:-10px}
#advanced-filters .filter-picker-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:28px;color:var(--text-muted);font-size:12px;line-height:1.5}
#advanced-filters .filter-browser{display:grid;grid-template-columns:160px minmax(0,1fr);flex:1;min-height:0;padding:0 24px 12px;gap:22px}
#advanced-filters .filter-groups{display:flex;flex-direction:column;align-items:stretch;gap:0;min-width:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;border-right:1px solid var(--border);padding-right:12px}
#advanced-filters .filter-groups button{flex:none;width:100%;min-height:44px;display:flex;align-items:center;position:relative;text-align:left;padding:10px 8px 10px 12px;color:var(--text-muted);overflow-wrap:anywhere}
#advanced-filters .filter-groups button[aria-pressed=true]{color:var(--primary);font-weight:500}
#advanced-filters .filter-groups button[aria-pressed=true]:before{content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);width:2px;height:16px;background:var(--primary);border-radius:2px}
#advanced-filters .filter-option-results{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scroll-padding:28px}
#advanced-filters .filter-value-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:10px 0;text-align:left;overflow-wrap:anywhere;min-width:0}
#advanced-filters .filter-value-option>span:first-child{min-width:0}
#advanced-filters .filter-value-option[aria-pressed=true]{color:var(--primary);font-weight:500}
#advanced-filters .filter-option-check{display:flex;width:16px;flex:none}
#advanced-filters .filter-option-check .ui-icon{width:16px;height:16px}
#advanced-filters .filter-value-option small{display:block;color:var(--text-muted);font-weight:400;font-size:12px;margin-top:2px}
#advanced-filters .filter-option-heading{position:sticky;top:0;z-index:1;margin:0;background:var(--surface);font-size:12px;line-height:1.5;color:var(--text-muted);font-weight:400;padding:5px 0}
#advanced-filters .filter-picker-empty{margin:12px 0;padding:12px 0;color:var(--text-muted);font-size:14px}
#advanced-filters .filter-browser.is-company{grid-template-columns:minmax(0,1fr) 44px;gap:14px}
#advanced-filters .filter-browser.is-company:has(.filter-alphabet[hidden]){grid-template-columns:minmax(0,1fr)}
#advanced-filters .filter-company-list section{margin-bottom:8px}
#advanced-filters .filter-company-list .filter-option-heading{border-bottom:1px solid var(--border)}
#advanced-filters .filter-company-list:after{content:'';display:block;height:calc(100% - 100px);min-height:50px}
#advanced-filters .filter-alphabet{display:flex;flex-direction:column;align-items:center;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;touch-action:pan-y;user-select:none;padding:2px 0}
#advanced-filters .filter-alphabet button{flex:0 0 36px;min-height:36px;width:100%;padding:0;display:grid;place-items:center;position:relative;isolation:isolate;color:var(--text-muted)}
#advanced-filters .filter-alphabet button[aria-current=true]{color:var(--primary);font-weight:600}
#advanced-filters .filter-alphabet button[aria-current=true]:before{content:'';position:absolute;width:26px;height:26px;background:var(--primary-soft);border-radius:50%;z-index:-1}
#advanced-filters .filter-quick{flex:none;border-top:1px solid var(--border);margin:0 24px;padding:7px 0 4px}
#advanced-filters .filter-section{min-width:0;margin:0 0 18px;padding:0;border:0}
#advanced-filters .filter-label{display:block;padding:0;margin:0 0 7px;color:var(--text-muted);font-size:14px;line-height:21px}
#advanced-filters .filter-segments{display:flex;align-items:center;flex-wrap:wrap;gap:4px}
#advanced-filters .filter-segments button{min-width:44px;padding:10px 10px;white-space:nowrap}
#advanced-filters .filter-segments button[aria-pressed=true]{color:var(--primary);font-weight:500}
#advanced-filters .filter-quick-row{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:6px;min-height:44px;margin:0}
#advanced-filters .filter-quick-row .filter-label{margin:0}
#advanced-filters .filter-quick-row .filter-segments{gap:0;flex-wrap:nowrap}
#advanced-filters .filter-extra-toggle{display:flex;align-items:center;gap:5px;width:auto;padding:8px 0;color:var(--text-muted);min-height:44px}
#advanced-filters .filter-extra-toggle .ui-icon{width:14px;height:14px}
#advanced-filters .filter-extra-toggle[aria-expanded=true]{color:var(--primary)}
#advanced-filters .filter-extra-fields{flex:1;min-height:140px;overflow:auto;padding:0 24px 12px;overscroll-behavior:contain;scrollbar-width:thin}
#advanced-filters .filter-extra-fields>h3{font-size:14px;font-weight:500;margin:4px 0 16px}
#advanced-filters .filter-text-field{display:block;font-size:14px;color:var(--text-muted);margin:0 0 20px}
#advanced-filters .filter-text-field input,#advanced-filters .filter-save-form input{display:block;width:100%;min-width:0;min-height:44px;margin:8px 0 0;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:16px;color:var(--text-primary);font-weight:400}
#advanced-filters .filter-field-help{margin:8px 0;color:var(--text-muted);font-size:12px;line-height:1.5}
#advanced-filters .filter-presets{border-top:1px solid var(--border);padding-top:8px}
#advanced-filters .filter-presets summary{display:flex;align-items:center;gap:8px;cursor:pointer;min-height:44px;font-size:14px;color:var(--text-secondary);list-style:none}
#advanced-filters .filter-presets summary::-webkit-details-marker{display:none}
#advanced-filters .filter-presets summary span{font-size:12px;color:var(--text-muted)}
#advanced-filters .filter-presets summary .ui-icon{margin-left:auto}
body.browse-v9.content-v6 #advanced-filters .saved-filter-presets{display:grid;gap:6px;margin:4px 0}
#advanced-filters .filter-preset{max-width:100%;display:flex;border:0;background:var(--surface-subtle)}
#advanced-filters .filter-preset>button:first-child{flex:1;display:grid;gap:4px;white-space:normal;min-width:0;overflow-wrap:anywhere}
#advanced-filters .filter-preset small{font-size:12px;color:var(--text-muted)}
#advanced-filters .filter-preset>button:last-child{width:44px;flex:none}
#advanced-filters .filter-preset-entry{padding-left:0;color:var(--text-muted)}
#advanced-filters .filter-save-form{padding:12px 0}
#advanced-filters .filter-save-form>label{display:block;font-size:14px;margin:0 0 8px;color:var(--text-secondary)}
#advanced-filters .filter-save-form small{font-size:12px;margin-left:6px;color:var(--text-muted)}
#advanced-filters .filter-save-form>div{display:flex;gap:8px}
#advanced-filters .filter-save-form input{flex:1;margin:0}
#advanced-filters .filter-save-form button{flex:none;color:var(--primary)}
#advanced-filters .filter-panel-messages{flex:none;padding:0 24px}
#advanced-filters .filter-panel-messages p:empty{display:none}
#advanced-filters .filter-panel-messages p{margin:6px 0;font-size:12px;line-height:1.5;color:var(--text-muted);overflow-wrap:anywhere}
#advanced-filters .filter-panel-messages .filter-panel-notice{color:var(--primary)}
#advanced-filters .filter-panel-messages .filter-error{color:#b42318}
#advanced-filters .advanced-filter-footer{display:block;margin:0;font-size:14px;line-height:1.5;flex:none;padding:8px 24px 16px;border-top:1px solid var(--border);background:var(--surface)}
#advanced-filters .filter-draft-summary{display:flex;flex-wrap:nowrap;align-items:center;gap:6px;min-height:40px;max-height:54px;overflow-x:auto;overflow-y:hidden;overscroll-behavior:contain;scrollbar-width:thin;margin-bottom:6px}
#advanced-filters .filter-draft-chip{display:inline-flex;align-items:center;max-width:100%;border:1px solid var(--border);border-radius:6px;flex:none;overflow:hidden}
#advanced-filters .filter-draft-chip button{font-size:13px;min-height:34px;padding:4px 0 4px 9px;display:flex;align-items:center;gap:5px;min-width:0}
#advanced-filters .filter-draft-chip button:first-child{flex:1}
#advanced-filters .filter-draft-chip small{font-size:12px;color:var(--text-muted);flex:none}
#advanced-filters .filter-draft-chip button span{min-width:0;max-width:220px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#advanced-filters .filter-draft-chip [data-draft-remove]{flex:none;justify-content:center;min-width:34px;padding:0;color:var(--text-muted)}
#advanced-filters .filter-draft-chip .ui-icon{width:14px;height:14px}
#advanced-filters .filter-footer-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}
#advanced-filters .filter-draft-status{display:flex;align-items:center;gap:6px;color:var(--text-muted);font-size:12px}
#advanced-filters [data-draft-undo]{font-size:12px;padding:0 4px;color:var(--primary)}
#advanced-filters .advanced-filter-footer .primary{min-width:144px;min-height:44px;padding:10px 24px}
@media(min-width:701px){
 #advanced-filters .filter-quick{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:20px;padding-top:4px;padding-bottom:0}
 #advanced-filters .filter-extra-toggle{grid-column:1/-1}
}
@media(max-width:700px){
 #advanced-filters{border:0;border-radius:18px 18px 0 0;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -12px 50px #172b4d18}
 #advanced-filters .advanced-filter-heading{padding:20px 18px 2px}
 #advanced-filters .advanced-filter-heading:before{content:'';position:absolute;left:calc(50% - 15px);top:8px;height:4px;width:30px;background:var(--border);border-radius:4px}
 #advanced-filters .filter-field-nav{padding:0 18px;gap:26px}
 #advanced-filters .filter-picker-tools,#advanced-filters .filter-extra-fields,#advanced-filters .filter-panel-messages{padding-left:18px;padding-right:18px}
 #advanced-filters .filter-browser{grid-template-columns:106px minmax(0,1fr);padding-left:18px;padding-right:18px;gap:16px}
 #advanced-filters .filter-groups{padding-right:8px}
 #advanced-filters .filter-groups button{padding-right:2px;padding-left:9px}
 #advanced-filters .filter-quick{margin-left:18px;margin-right:18px}
 #advanced-filters .filter-alphabet button{min-height:44px;flex-basis:44px}
 #advanced-filters .advanced-filter-footer{padding:8px 18px 16px}
 #advanced-filters .filter-draft-chip button{min-height:44px}
 #advanced-filters .filter-draft-chip [data-draft-remove]{min-width:44px}
 #advanced-filters .filter-draft-summary{max-height:54px}
}
@media(max-width:360px){
 #advanced-filters .advanced-filter-heading,#advanced-filters .filter-field-nav,#advanced-filters .filter-picker-tools,#advanced-filters .filter-extra-fields,#advanced-filters .filter-browser,#advanced-filters .advanced-filter-footer,#advanced-filters .filter-panel-messages{padding-left:14px;padding-right:14px}
 #advanced-filters .filter-field-nav{gap:18px}
 #advanced-filters .filter-browser{grid-template-columns:94px minmax(0,1fr);gap:12px}
 #advanced-filters .filter-quick{margin-left:14px;margin-right:14px}
 #advanced-filters .filter-quick-row{grid-template-columns:38px minmax(0,1fr);gap:2px}
 #advanced-filters .filter-quick-row .filter-segments button{padding-left:8px;padding-right:8px}
 #advanced-filters .filter-draft-chip button span{max-width:165px}
}

/* A single range trigger replaces the two native date inputs. */
#advanced-filters .filter-date-range{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;margin-top:12px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;text-align:left;color:var(--text-primary);background:var(--surface)}
#advanced-filters .filter-date-range>span{display:flex;flex:1;align-items:center;gap:12px;font-variant-numeric:tabular-nums}
#advanced-filters .filter-date-range i{font-style:normal;color:var(--text-muted)}
#advanced-filters .filter-date-range>.ui-icon{color:var(--text-muted);width:16px;height:16px}
#advanced-filters .filter-date-range[aria-expanded=true]{border-color:var(--primary);box-shadow:0 0 0 2px var(--primary-soft)}
#control-popover.date-range-picker{position:fixed;inset:auto;margin:0;padding:0;min-width:0;max-width:calc(100vw - 16px);overflow:hidden;border:1px solid var(--border);border-radius:16px;box-shadow:0 16px 64px #172b4d33;background:var(--surface);color:var(--text-primary);font-size:14px;line-height:1.5;box-sizing:border-box}
#control-popover.date-range-picker:popover-open{display:flex;flex-direction:column}
#control-popover.date-range-picker *{box-sizing:border-box}
#control-popover.date-range-picker button{font:inherit;min-width:0;min-height:44px;padding:8px;border:0;border-radius:6px;background:transparent;color:var(--text-secondary);cursor:pointer}
#control-popover.date-range-picker button:hover:not(:disabled){color:var(--primary);background:var(--primary-soft)}
#control-popover.date-range-picker button:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
#control-popover.date-range-picker button:disabled{cursor:default;opacity:.4}
#control-popover.date-range-picker .ui-icon{width:18px;height:18px;flex:none}
#control-popover.date-range-picker .range-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;padding:8px 12px 4px 20px}
#control-popover.date-range-picker .range-heading h3{margin:0;font-size:16px;font-weight:600}
#control-popover.date-range-picker .range-heading button{width:44px;display:grid;place-items:center;color:var(--text-muted)}
#control-popover.date-range-picker .range-summary{display:grid;grid-template-columns:minmax(0,1fr) 20px minmax(0,1fr);align-items:center;gap:8px;margin:0 20px;flex:none}
#control-popover.date-range-picker .range-summary>span{text-align:center;color:var(--text-muted)}
#control-popover.date-range-picker .range-summary button{display:grid;gap:3px;padding:8px 10px;text-align:left;border-bottom:2px solid var(--border);border-radius:0;min-height:62px}
#control-popover.date-range-picker .range-summary button[aria-pressed=true]{border-color:var(--primary)}
#control-popover.date-range-picker .range-summary small{font-size:12px;color:var(--text-muted);font-weight:400}
#control-popover.date-range-picker .range-summary strong{font-size:15px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}
#control-popover.date-range-picker .range-summary button[aria-pressed=true] strong{color:var(--primary)}
#control-popover.date-range-picker .range-hint{flex:none;margin:10px 20px 4px;min-height:18px;font-size:12px;color:var(--text-muted);line-height:1.5}
#control-popover.date-range-picker .range-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 16px 12px;scrollbar-width:thin}
#control-popover.date-range-picker .range-navigation{display:flex;align-items:center;justify-content:space-between;gap:4px;margin:0 0 6px}
#control-popover.date-range-picker .range-navigation>button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:44px}
#control-popover.date-range-picker [data-range-heading]{font-weight:600;color:var(--text-primary)}
#control-popover.date-range-picker [data-range-heading]:disabled{opacity:1}
#control-popover.date-range-picker [data-range-heading] .ui-icon{width:14px;height:14px;color:var(--text-muted)}
#control-popover.date-range-picker [data-range-move="-1"] .ui-icon{transform:rotate(90deg)}
#control-popover.date-range-picker [data-range-move="1"] .ui-icon{transform:rotate(-90deg)}
#control-popover.date-range-picker .range-week,#control-popover.date-range-picker .range-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center}
#control-popover.date-range-picker .range-week{font-size:12px;line-height:24px;color:var(--text-muted);margin:0 0 4px}
#control-popover.date-range-picker .range-days{grid-auto-rows:40px;row-gap:3px}
#control-popover.date-range-picker .range-days button{display:grid;place-items:center;min-height:40px;height:40px;padding:0;border-radius:0;font-variant-numeric:tabular-nums}
#control-popover.date-range-picker .range-days button>span{display:grid;place-items:center;position:relative;width:36px;height:36px;border-radius:50%}
#control-popover.date-range-picker .range-days button:hover:not(:disabled){background:transparent}
#control-popover.date-range-picker .range-days button:hover:not(:disabled):not(.is-endpoint)>span{background:var(--primary-soft)}
#control-popover.date-range-picker .range-days button.is-between{background:var(--primary-soft);color:var(--primary)}
#control-popover.date-range-picker .range-days.has-range button.is-start{background:linear-gradient(to right,transparent 50%,var(--primary-soft) 50%)}
#control-popover.date-range-picker .range-days.has-range button.is-end{background:linear-gradient(to left,transparent 50%,var(--primary-soft) 50%)}
#control-popover.date-range-picker .range-days button.is-endpoint>span{background:var(--primary);color:#fff;font-weight:600}
#control-popover.date-range-picker .range-days button[aria-current=date]>span:after{content:'';position:absolute;bottom:3px;width:3px;height:3px;border-radius:50%;background:currentColor}
#control-popover.date-range-picker .range-months,#control-popover.date-range-picker .range-years{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;min-height:282px;align-content:center}
#control-popover.date-range-picker :is(.range-months,.range-years) button{min-height:52px}
#control-popover.date-range-picker :is(.range-months,.range-years) button[aria-pressed=true]{color:var(--primary);background:var(--primary-soft)}
#control-popover.date-range-picker .range-footer{display:flex;align-items:center;justify-content:space-between;flex:none;gap:8px;margin:0;padding:12px 16px;border-top:1px solid var(--border);font-size:14px;line-height:1.5}
#control-popover.date-range-picker .range-footer>div{display:flex;gap:8px}
#control-popover.date-range-picker [data-range-clear]{padding-left:4px;color:var(--text-muted)}
#control-popover.date-range-picker [data-range-confirm]{min-width:88px;background:var(--primary);color:#fff;font-weight:500}
#control-popover.date-range-picker [data-range-confirm]:hover:not(:disabled){background:var(--primary-strong);color:#fff}
@media(max-width:700px){
 #control-popover.date-range-picker .range-days{grid-auto-rows:44px}
 #control-popover.date-range-picker .range-days button{height:44px;min-height:44px}
 #control-popover.date-range-picker .range-days button>span{width:38px;height:38px}
}
@media(max-width:360px){
 #control-popover.date-range-picker .range-summary{margin:0 14px;gap:2px}
 #control-popover.date-range-picker .range-summary button{padding-left:6px;padding-right:6px}
 #control-popover.date-range-picker .range-content{padding-left:8px;padding-right:8px}
 #advanced-filters .filter-date-range{gap:6px;font-size:13px;padding-left:8px;padding-right:8px}
 #advanced-filters .filter-date-range>span{gap:6px}
}

/* Sort changes are staged alongside filters and applied together. */
#advanced-filters .filter-field-nav{gap:28px;overflow-x:auto;scrollbar-width:thin}
#advanced-filters .filter-sort-section{min-height:0;flex:1;overflow:auto;padding:20px 24px}
#advanced-filters .filter-sort-section h3,#advanced-filters .filter-forum-fields h3{margin:0 0 12px;font-size:13px;font-weight:500;color:var(--text-muted)}
#advanced-filters .filter-sort-options{display:grid;gap:6px}
#advanced-filters .filter-sort-options>button{display:flex;align-items:center;gap:12px;width:100%;min-height:66px;padding:12px;border-radius:9px;text-align:left;color:var(--text-secondary)}
#advanced-filters .filter-sort-options>button:hover{background:var(--surface-subtle)}
#advanced-filters .filter-sort-options>button[aria-pressed=true]{background:var(--primary-soft);color:var(--primary)}
#advanced-filters .filter-sort-options>button>.ui-icon{width:18px;height:18px;flex:none}
#advanced-filters .filter-sort-options>button>span:not(.filter-sort-check){display:grid;gap:3px;flex:1}
#advanced-filters .filter-sort-options strong{font-size:14px;font-weight:500}
#advanced-filters .filter-sort-options small{font-size:12px;color:var(--text-muted)}
#advanced-filters .filter-sort-check{width:18px;flex:none}
#advanced-filters .filter-forum-fields{overflow:auto;min-height:0;padding:4px 20px 16px;overscroll-behavior:contain}
#advanced-filters.filter-forum-panel{border-radius:14px}
#advanced-filters.filter-forum-panel .advanced-filter-heading{padding:18px 20px 12px}
#advanced-filters.filter-forum-panel .advanced-filter-heading h2{font-size:18px}
#advanced-filters.filter-forum-panel .filter-form-body{flex:0 1 auto}
#advanced-filters.filter-forum-panel .filter-section{margin:0 0 18px}
#advanced-filters.filter-forum-panel .filter-segments{gap:6px}
#advanced-filters.filter-forum-panel .filter-segments button{min-height:36px;padding:6px 10px;border-radius:6px;font-size:13px;background:var(--surface-subtle)}
#advanced-filters.filter-forum-panel .filter-segments button[aria-pressed=true]{color:var(--primary);background:var(--primary-soft)}
#advanced-filters.filter-forum-panel .filter-sort-section{padding:16px 0 0;border-top:1px solid var(--border);overflow:visible}
#advanced-filters.filter-forum-panel .advanced-filter-footer{padding:12px 20px 16px}
#advanced-filters.filter-forum-panel [data-filter-apply]{min-width:116px}
@media(max-width:700px){
 #advanced-filters .filter-field-nav{gap:18px}
 #advanced-filters .filter-sort-section{padding:16px 18px}
 #advanced-filters.filter-forum-panel{border-radius:20px 20px 0 0}
 #advanced-filters.filter-forum-panel .filter-segments button{min-height:44px}
}
@media(max-width:360px){
 #advanced-filters .filter-field-nav{gap:12px}
 #advanced-filters .filter-field-nav button{font-size:14px}
}
