/* 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-height: 116px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  min-width: 0;
  color: var(--gl-ink);
}
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: var(--gl-panel);
  border: 1px solid var(--gl-line);
  border-radius: 12px;
  box-shadow: none;
}
.global-library-searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 16px;
}
.global-library-searchbar > label { flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--gl-ink); }
.global-library-searchbar > input { flex: 1; min-width: 80px; margin: 0; }
.global-library-workspace input:not([type="checkbox"]),
.global-library-workspace select {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--gl-line);
  border-radius: 7px;
  background: var(--gl-card);
  color: var(--gl-ink);
  font-size: 14px;
  box-shadow: none;
}
.global-library-workspace input::placeholder { color: var(--gl-muted); opacity: .85; }
.global-library-workspace button { min-height: 32px; font-size: 14px; white-space: nowrap; }
.global-library-workspace button.secondary,
.global-library-workspace button.ghost {
  border: 1px solid var(--gl-line);
  background: var(--gl-panel);
  color: var(--gl-ink);
  box-shadow: none;
}
.global-library-workspace button:focus-visible,
.global-library-workspace input:focus-visible,
.global-library-workspace select:focus-visible { outline: 2px solid var(--gl-accent); 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: var(--gl-ink); }
.global-library-result-head p { margin: 5px 0 0; font-size: 12px; line-height: 1.5; color: var(--gl-muted); }
.global-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 9px; align-content: start; overflow: auto; min-height: 0; padding: 2px; overscroll-behavior: contain; }
.global-library-workspace .global-library-char {
  display: grid;
  grid-template-rows: 17px minmax(0, 1fr) 17px;
  justify-items: center;
  align-items: center;
  gap: 7px;
  min-width: 0;
  box-sizing: border-box;
  height: var(--gl-card-height);
  min-height: var(--gl-card-height);
  max-height: var(--gl-card-height);
  padding: 10px 5px 8px;
  border: 1px solid var(--gl-line);
  border-radius: 9px;
  background: var(--gl-card);
  color: var(--gl-ink);
  box-shadow: none;
  transition: border-color .12s, background .12s;
}
.global-library-workspace .global-library-char:hover { border-color: var(--gl-accent); background: var(--gl-active); transform: none; }
.global-library-reading { display: block; width: 100%; min-width: 0; height: 17px; font-size: 12px; line-height: 1.4; color: var(--gl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.global-library-char > strong { font-size: 32px; line-height: 1.15; font-weight: 500; color: var(--gl-ink); }
.global-library-char > small { display: flex; justify-content: center; flex-wrap: nowrap; width: 100%; min-width: 0; height: 17px; gap: 8px; font-size: 12px; line-height: 1.4; color: var(--gl-muted); white-space: nowrap; }
.global-library-char > small > span { min-width: 0; max-width: calc((100% - 8px) / 2); overflow: hidden; text-overflow: ellipsis; }
.global-library-char > small > span:first-child { color: var(--gl-accent); }
.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 var(--gl-line); font-size: 12px; color: var(--gl-muted); }
.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: var(--gl-ink); }
.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: var(--gl-muted); 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 var(--gl-line); 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: var(--gl-ink); margin: 0 0 9px; }
.global-library-filter-group h3 small { font-size: 12px; color: var(--gl-muted); 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: var(--gl-ink); margin: 0; }
.global-library-element-checks input { accent-color: var(--gl-accent); 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: var(--gl-active); border-color: var(--gl-accent); color: var(--gl-accent); font-weight: 600; }
.global-library-filter-note { margin: 14px 0 0; color: var(--gl-muted); font-size: 12px; line-height: 1.65; }
.global-library-empty { grid-column: 1 / -1; padding: 55px 15px; text-align: center; color: var(--gl-muted); }
.global-library-empty strong { font-size: 16px; color: var(--gl-ink); }
.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; }
  .global-library-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; }
}
@media (max-width: 760px) {
  .global-library-workspace { min-height: 600px; grid-template-rows: auto auto; }
  .global-library-searchbar { flex-wrap: wrap; padding: 10px; gap: 7px; }
  .global-library-searchbar > label { flex-basis: 100%; }
  .global-library-searchbar > input { flex-basis: calc(100% - 140px); }
  .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; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}
