/* V10 scope: 12 confirmed V9 follow-ups. Keep shelf graphics and R17 semantics untouched. */
#studentLibrary[data-view="list"] .stage-word-list .stage-heading-center h2 {
  white-space:nowrap;
}
/* Current effective conditions: one clear line, above the compact shortcuts. */
#studentLibrary[data-view="list"] .stage-word-list .stage-active-filters {
  display:block;box-sizing:border-box;flex:0 0 auto;width:100%;min-width:0;
  margin:0;padding:2px 5px 1px;min-height:19px;
  font:500 10.5px/16px -apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;
  color:#856c7f;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
/* 5 visible of 7 presets; all seven remain selectable from advanced quick picker. */
#studentLibrary[data-view="list"] .stage-word-list .stage-quick-set {
  display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:0!important;padding:0!important;width:100%;align-items:stretch;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-quick-line {
  min-height:26px!important;height:26px;max-height:26px;padding:0!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-quick {
  min-height:26px!important;height:26px!important;padding:2px 0 1px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-quick>b {
  font-size:clamp(10.4px,2.66vw,12px)!important;letter-spacing:-.16px;
}
/* No more nested scrolling in the filters. Let the results be the scroll region. */
#studentLibrary[data-view="list"] .stage-word-list .stage-advanced[open] {
  display:block!important;overflow:visible!important;
  max-height:none!important;height:auto!important;min-height:0!important;
  margin:0!important;padding:0!important;border:0!important;
  scrollbar-width:none!important;overscroll-behavior:auto!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-filter-body {
  padding:1px 2px 3px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-unified-filters {gap:0!important;}
#studentLibrary[data-view="list"] .stage-word-list .stage-legacy-line {
  min-height:27px!important;height:27px!important;margin:0 0 1px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-legacy-line .stage-source-set button {
  min-height:25px!important;padding-block:2px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-original-grid {
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0 9px!important;align-items:stretch;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-original-grid>label {
  min-width:0!important;height:27px!important;min-height:27px!important;
  gap:3px!important;font-size:10.5px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-original-grid>label>.stage-picker {
  flex:1 1 0!important;max-width:none!important;min-width:0!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-original-grid .stage-picker-trigger {
  height:26px!important;min-height:26px!important;padding:1px 2px 1px 3px!important;
  box-sizing:border-box;font-size:10.5px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-date-field input {
  height:25px!important;min-height:25px!important;font-size:10.5px!important;
}
/* The six existing feature filters still have independent checkboxes. */
#studentLibrary[data-view="list"] .stage-word-list .stage-feature-group {
  margin:2px 0 0!important;padding:0!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-feature-group legend {
  padding:0 0 1px!important;min-height:25px;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-feature-mode-label {
  min-height:24px!important;gap:4px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-feature-mode-label>.stage-picker {
  flex:0 0 108px!important;width:108px!important;max-width:108px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-feature-mode-label .stage-picker-trigger {
  height:23px!important;min-height:23px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .sl-features {
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,22px)!important;
  gap:1px 4px!important;margin:0!important;
}
#studentLibrary[data-view="list"] .stage-word-list .sl-features label {
  min-height:22px!important;height:22px!important;font-size:10px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .sl-features label input {
  flex:0 0 13px!important;width:13px!important;height:13px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-filter-actions {
  min-height:27px!important;height:27px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-filter-actions button {
  min-height:27px!important;height:27px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-result-head {
  min-height:30px!important;padding:2px 0 2px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-result-head>b {
  flex:1 1 auto;min-width:0;
}
/* Only one sorting control remains, and it now lives next to the results. */
#studentLibrary[data-view="list"] .stage-word-list .stage-result-head .stage-sort-picker {
  flex:0 1 108px;min-width:0;max-width:125px;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-result-head .stage-sort-picker .stage-picker-trigger {
  height:27px;min-height:27px;width:100%;gap:2px;
  padding:2px 0 2px 1px!important;font-size:10.5px;
  border:0!important;background:transparent;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-result-head .stage-sort-picker .stage-picker-trigger>span {
  flex:1 1 0;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* The trigger never forces its parent grid over-width; popup menu uses measured width instead. */
#studentLibrary[data-view="list"] .stage-word-list .stage-original-grid .stage-picker-menu {
  min-width:0!important;max-width:none!important;
}
/* A document-level portal is mandatory: position:fixed inside a clipped parent is not enough. */
body > .stage-picker-menu.stage-picker-popup {
  position:fixed!important;z-index:2147483000!important;
  box-sizing:border-box;min-width:0!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  margin:0!important;padding:4px!important;
  border:1px solid #c8a575!important;border-radius:10px!important;
  background:#fff0d4!important;box-shadow:0 5px 15px #2c183b38!important;
  overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;
}
body > .stage-picker-menu.stage-picker-popup[hidden] {display:none!important;}
body > .stage-picker-menu.stage-picker-popup button {
  box-sizing:border-box;display:block;width:100%;min-height:32px;
  padding:6px 8px;border:0!important;border-radius:6px;
  background:transparent;color:#563b60;font:500 12px/18px -apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif;
  text-align:left;white-space:nowrap;box-shadow:none;
}
body > .stage-picker-menu.stage-picker-popup button[hidden] {display:none!important;}
body > .stage-picker-menu.stage-picker-popup button:focus-visible,
body > .stage-picker-menu.stage-picker-popup button:active {background:#ead8ed;outline:none;}
/* Move the meaningful art markers 4px left; preserve sound button and tap target. */
#studentLibrary[data-view="list"] .stage-word-list .stage-aid-markers {
  transform:translateX(-4px);
}
@media(max-height:780px){
  #studentLibrary[data-view="list"] .stage-word-list .stage-quick {min-height:25px!important;height:25px!important;}
  #studentLibrary[data-view="list"] .stage-word-list .stage-active-filters {min-height:18px;font-size:10px;}
  #studentLibrary[data-view="list"] .stage-word-list .stage-advanced[open] {max-height:none!important;}
}
@media(max-width:370px){
  #studentLibrary[data-view="list"] .stage-word-list .stage-quick>b {font-size:10px!important;}
  #studentLibrary[data-view="list"] .stage-word-list .stage-original-grid {column-gap:5px!important;}
  #studentLibrary[data-view="list"] .stage-word-list .stage-original-grid>label {font-size:10px!important;gap:2px!important;}
}

/* V11: let five full labels keep their natural width; distribute only free space. */
#studentLibrary[data-view="list"] .stage-word-list .stage-quick-set {
  display:flex!important;flex-flow:row nowrap!important;
  grid-template-columns:none!important;justify-content:space-between!important;
  align-items:center!important;gap:0!important;width:100%;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-quick {
  display:inline-flex!important;flex:0 0 auto!important;width:auto!important;
  min-width:0!important;padding:2px 4px 1px!important;
}
#studentLibrary[data-view="list"] .stage-word-list .stage-quick>b {
  white-space:nowrap;font-size:clamp(11px,2.85vw,12.2px)!important;
  letter-spacing:0!important;
}
@media(max-width:350px){
 #studentLibrary[data-view="list"] .stage-word-list .stage-quick {padding-inline:1px!important;}
 #studentLibrary[data-view="list"] .stage-word-list .stage-quick>b {font-size:10.7px!important;}
}
/* V11 popup: six-CJK-glyph base; all finite options visible without scroll. */
body > .stage-picker-menu.stage-picker-popup {
 min-width:0!important;max-height:none;
 overflow-x:hidden!important;overscroll-behavior:contain;
}
body > .stage-picker-menu.stage-picker-popup button {
 min-height:34px;height:34px;line-height:20px;padding:6px 10px;
 white-space:nowrap;
}

/* Extra-narrow preview: preserve course picker label and trigger readability. */
@media(max-width:355px){
 #studentLibrary[data-view="list"] .stage-word-list .stage-original-grid>label.stage-section-field {font-size:9.2px!important;gap:1px!important;}
 #studentLibrary[data-view="list"] .stage-word-list .stage-original-grid>label.stage-section-field .stage-picker-trigger {font-size:9.6px!important;padding-left:1px!important;}
}
