/* Only the universal-library condition search; other workspaces keep their styles. */
.global-library-workspace {
  --gl-panel: #fff;
  --gl-card: #f8fbfa;
  --gl-ink: #263c37;
  --gl-muted: #687b75;
  --gl-line: #d9e6e0;
  --gl-accent: #277768;
  --gl-active: #e4f3ed;
  --gl-card-edge: 84px;
  --gl-card-gap: 8px;
  --gl-card-columns: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  min-width: 0;
  color: rgba(var(--ui-source-b0f0f85d9b66ff-rgb, 38, 60, 55), var(--ui-source-b0f0f85d9b66ff-alpha, 1));
}
body[data-theme="tech"] .global-library-workspace {
  --gl-panel: #101f31;
  --gl-card: #132a3b;
  --gl-ink: #e4f2f4;
  --gl-muted: #a3b9c5;
  --gl-line: #2c465c;
  --gl-accent: #67d1c1;
  --gl-active: #214a50;
}
.global-library-workspace .panel {
  background: rgba(var(--ui-source-d89cb5294cfef4-rgb, 255, 255, 255), var(--ui-source-d89cb5294cfef4-alpha, 1));
  border: 1px solid rgba(var(--ui-source-daa0de2c0bed07-rgb, 217, 230, 224), var(--ui-source-daa0de2c0bed07-alpha, 1));
  border-radius: 12px;
  box-shadow: none;
}
.global-library-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  min-width: 0;
}
.global-library-topline > .global-search-mode-tabs { flex: 0 1 auto; }
.global-library-searchbar {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 7px;
  margin: 0;
  padding: 0;
}
.global-library-searchbar > label { flex-shrink: 0; font-size: 14px; font-weight: 600; color: rgba(var(--ui-source-f22b2ec2948484-rgb, 38, 60, 55), var(--ui-source-f22b2ec2948484-alpha, 1)); }
.global-library-searchbar > input { flex: 0 1 260px; width: 260px; min-width: 160px; margin: 0; }
.global-library-searchbar > button { min-height: 36px; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
.global-library-searchbar > input,
.global-library-workspace input:not([type="checkbox"]),
.global-library-workspace select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(var(--ui-source-4288f0b4c8336b-rgb, 217, 230, 224), var(--ui-source-4288f0b4c8336b-alpha, 1));
  border-radius: 7px;
  background: rgba(var(--ui-source-beb0fed8c23279-rgb, 248, 251, 250), var(--ui-source-beb0fed8c23279-alpha, 1));
  color: rgba(var(--ui-source-ca2c496fbb25fc-rgb, 38, 60, 55), var(--ui-source-ca2c496fbb25fc-alpha, 1));
  font-size: 14px;
  box-shadow: none;
}
.global-library-searchbar input::placeholder,
.global-library-workspace input::placeholder { color: rgba(var(--ui-source-61752dea5684f3-rgb, 104, 123, 117), var(--ui-source-61752dea5684f3-alpha, 1)); opacity: .85; }
.global-library-workspace button { min-height: 32px; font-size: 14px; white-space: nowrap; }
.global-library-searchbar button.secondary,
.global-library-workspace button.secondary,
.global-library-workspace button.ghost {
  border: 1px solid rgba(var(--ui-source-cdc73215df9655-rgb, 217, 230, 224), var(--ui-source-cdc73215df9655-alpha, 1));
  background: rgba(var(--ui-source-9e0a6a32fe966e-rgb, 255, 255, 255), var(--ui-source-9e0a6a32fe966e-alpha, 1));
  color: rgba(var(--ui-source-2a7b20b19b6462-rgb, 38, 60, 55), var(--ui-source-2a7b20b19b6462-alpha, 1));
  box-shadow: none;
}
.global-library-searchbar button:focus-visible,
.global-library-searchbar input:focus-visible,
.global-library-workspace button:focus-visible,
.global-library-workspace input:focus-visible,
.global-library-workspace select:focus-visible { outline: 2px solid rgba(var(--ui-source-c856bf404ab67d-rgb, 39, 119, 104), var(--ui-source-c856bf404ab67d-alpha, 1)); outline-offset: 2px; }
.global-library-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; min-width: 0; min-height: 0; }
.global-library-results { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding: 14px; min-width: 0; min-height: 0; }
.global-library-result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 0 1px 12px; }
.global-library-result-head strong { font-size: 17px; color: rgba(var(--ui-source-c9cd43e60716f4-rgb, 38, 60, 55), var(--ui-source-c9cd43e60716f4-alpha, 1)); }
.global-library-result-head p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: rgba(var(--ui-source-f5e84ec283ce4b-rgb, 104, 123, 117), var(--ui-source-f5e84ec283ce4b-alpha, 1)); }
.global-library-grid { display: grid; grid-template-columns: repeat(var(--gl-card-columns), var(--gl-card-edge)); grid-auto-rows: var(--gl-card-edge); gap: var(--gl-card-gap); justify-content: center; align-content: start; overflow: auto; min-width: 0; min-height: 0; padding: 2px; overscroll-behavior: contain; }
.global-library-grid[data-filled="true"] { align-content: center; }
.global-library-workspace .global-library-char {
  display: grid;
  grid-template-rows: 16px minmax(0, 1fr) 16px;
  justify-items: center;
  align-items: center;
  gap: 2px;
  min-width: 0;
  box-sizing: border-box;
  width: var(--gl-card-edge);
  height: var(--gl-card-edge);
  min-height: var(--gl-card-edge);
  max-height: var(--gl-card-edge);
  padding: 4px;
  border: 1px solid rgba(var(--ui-source-319fa133fad300-rgb, 217, 230, 224), var(--ui-source-319fa133fad300-alpha, 1));
  border-radius: 9px;
  background: rgba(var(--ui-source-691c3e29b3f1a2-rgb, 248, 251, 250), var(--ui-source-691c3e29b3f1a2-alpha, 1));
  color: rgba(var(--ui-source-b0f0f85d9b66ff-rgb, 38, 60, 55), var(--ui-source-b0f0f85d9b66ff-alpha, 1));
  box-shadow: none;
  transition: border-color .12s, background .12s;
}
.global-library-workspace .global-library-char:hover { border-color: rgba(var(--ui-source-7ac45db835f31a-rgb, 39, 119, 104), var(--ui-source-7ac45db835f31a-alpha, 1)); background: rgba(var(--ui-source-eee1fccde8b3c6-rgb, 228, 243, 237), var(--ui-source-eee1fccde8b3c6-alpha, 1)); transform: none; }
.global-library-reading { display: block; width: 100%; min-width: 0; height: 16px; font-size: 12px; line-height: 1.3; color: rgba(var(--ui-source-10509906f8f094-rgb, 104, 123, 117), var(--ui-source-10509906f8f094-alpha, 1)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.global-library-char > strong { font-size: 30px; line-height: 1.05; font-weight: 500; color: rgba(var(--ui-source-b0f0f85d9b66ff-rgb, 38, 60, 55), var(--ui-source-b0f0f85d9b66ff-alpha, 1)); }
.global-library-char > small { display: flex; justify-content: center; align-items: center; flex-wrap: nowrap; width: 100%; min-width: 0; height: 16px; gap: 5px; font-size: 12px; line-height: 1.3; color: rgba(var(--ui-source-527fc8e8d81143-rgb, 104, 123, 117), var(--ui-source-527fc8e8d81143-alpha, 1)); white-space: nowrap; }
.global-library-char > small > span { min-width: 0; }
.global-library-char > small > span:last-child { flex: 0 0 auto; }
.global-library-elements { display: inline-flex; flex-wrap: nowrap; justify-content: center; gap: 2px; }
.global-library-element--metal { color: var(--ui-color-status-category-wuxing-metal-fg, #86621b); }
.global-library-element--wood { color: var(--ui-color-status-category-wuxing-wood-fg, #3f7658); }
.global-library-element--water { color: var(--ui-color-status-category-wuxing-water-fg, #3f6f9f); }
.global-library-element--fire { color: var(--ui-color-status-category-wuxing-fire-fg, #b74732); }
.global-library-element--earth { color: var(--ui-color-status-category-wuxing-earth-fg, #89612f); }
.global-library-char:has(.global-library-element:nth-child(3), .global-library-element-unknown, .global-library-stroke-unknown) { grid-template-rows: 16px minmax(0, 1fr) 30px; gap: 0; padding: 2px 4px; }
.global-library-char:has(.global-library-element:nth-child(3), .global-library-element-unknown, .global-library-stroke-unknown) > strong { font-size: 26px; line-height: 1; }
.global-library-char:has(.global-library-element:nth-child(3), .global-library-element-unknown, .global-library-stroke-unknown) > small { flex-wrap: wrap; gap: 0; height: 30px; font-size: 12px; line-height: 1.25; }
.global-library-char:has(.global-library-element:nth-child(3), .global-library-element-unknown, .global-library-stroke-unknown) .global-library-elements { flex-basis: 100%; }
.global-library-pagination { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; margin-top: 12px; border-top: 1px solid rgba(var(--ui-source-daa0de2c0bed07-rgb, 217, 230, 224), var(--ui-source-daa0de2c0bed07-alpha, 1)); font-size: 12px; color: rgba(var(--ui-source-10509906f8f094-rgb, 104, 123, 117), var(--ui-source-10509906f8f094-alpha, 1)); }
.global-library-pagination > div { display: flex; gap: 8px; }
.global-library-pagination button { padding: 5px 12px; }
.global-library-filters { padding: 14px; overflow-y: auto; min-height: 0; }
.global-library-filters > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.global-library-filters > header > strong { font-size: 16px; color: rgba(var(--ui-source-b0f0f85d9b66ff-rgb, 38, 60, 55), var(--ui-source-b0f0f85d9b66ff-alpha, 1)); }
.global-library-filters > header > button { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.global-library-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
.global-library-selects label { display: grid; gap: 6px; margin: 0; font-size: 14px; color: rgba(var(--ui-source-527fc8e8d81143-rgb, 104, 123, 117), var(--ui-source-527fc8e8d81143-alpha, 1)); min-width: 0; }
.global-library-selects select { width: 100%; min-width: 0; }
.global-library-wide { grid-column: 1 / -1; }
.global-library-filter-group { border-top: 1px solid rgba(var(--ui-source-daa0de2c0bed07-rgb, 217, 230, 224), var(--ui-source-daa0de2c0bed07-alpha, 1)); padding-top: 12px; margin-top: 14px; }
.global-library-filter-group h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 14px; color: rgba(var(--ui-source-5437d3997545b9-rgb, 38, 60, 55), var(--ui-source-5437d3997545b9-alpha, 1)); margin: 0 0 9px; }
.global-library-filter-group h3 small { font-size: 12px; color: rgba(var(--ui-source-527fc8e8d81143-rgb, 104, 123, 117), var(--ui-source-527fc8e8d81143-alpha, 1)); font-weight: 400; }
.global-library-element-checks { display: flex; justify-content: space-between; gap: 5px; }
.global-library-element-checks label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: rgba(var(--ui-source-f22b2ec2948484-rgb, 38, 60, 55), var(--ui-source-f22b2ec2948484-alpha, 1)); margin: 0; }
.global-library-element-checks input { accent-color: rgba(var(--ui-source-5b948bcbe30b80-rgb, 39, 119, 104), var(--ui-source-5b948bcbe30b80-alpha, 1)); width: 14px; height: 14px; min-height: 0; margin: 0; }
.global-library-shortcuts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.global-library-shortcuts button { padding: 4px; min-width: 0; min-height: 29px; font-size: 12px; border-radius: 5px; }
.global-library-initials, .global-library-strokes { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.global-library-workspace .global-library-shortcuts button.active { background: rgba(var(--ui-source-e5fdcfe2a48544-rgb, 228, 243, 237), var(--ui-source-e5fdcfe2a48544-alpha, 1)); border-color: rgba(var(--ui-source-c856bf404ab67d-rgb, 39, 119, 104), var(--ui-source-c856bf404ab67d-alpha, 1)); color: rgba(var(--ui-source-bfe690fbf54ec1-rgb, 39, 119, 104), var(--ui-source-bfe690fbf54ec1-alpha, 1)); font-weight: 600; }
.global-library-filter-note { margin: 14px 0 0; color: rgba(var(--ui-source-10509906f8f094-rgb, 104, 123, 117), var(--ui-source-10509906f8f094-alpha, 1)); font-size: 12px; line-height: 1.65; }
.global-library-empty { grid-column: 1 / -1; padding: 55px 15px; text-align: center; color: rgba(var(--ui-source-10509906f8f094-rgb, 104, 123, 117), var(--ui-source-10509906f8f094-alpha, 1)); }
.global-library-empty strong { font-size: 16px; color: rgba(var(--ui-source-b0f0f85d9b66ff-rgb, 38, 60, 55), var(--ui-source-b0f0f85d9b66ff-alpha, 1)); }
.global-library-empty p { font-size: 13px; line-height: 1.6; }
.global-library-workspace [hidden] { display: none !important; }
@media (max-width: 1100px) {
  .global-library-body { grid-template-columns: minmax(0, 1fr) 260px; gap: 8px; }
  .global-library-filters, .global-library-results { padding: 11px; }
}
@media (max-width: 760px) {
  .global-library-workspace { min-height: 600px; }
  .global-library-searchbar { flex-wrap: wrap; }
  .global-library-searchbar > input { flex: 1 1 160px; width: auto; }
  .global-library-body { display: flex; flex-direction: column; }
  .global-library-filters { order: 0; max-height: 390px; }
  .global-library-results { order: 1; min-height: 500px; }
  .global-library-grid { max-height: 600px; }
}
