.library-tools { margin: 0 0 22px; }
.library-tool-buttons { display: flex; align-items: center; flex-wrap: wrap; }
.library-tool-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
  padding: 9px 13px; border: 1px solid #484848; border-radius: 5px;
  background: #202020; color: #eee; font: inherit; font-size: 15px; line-height: 20px;
  cursor: pointer; letter-spacing: 0;
}
.library-tool-buttons > button { margin: 0 10px 6px 0; }
.library-tool-button svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.library-tool-button svg + span { margin-left: 8px; }
.library-tool-button:hover, .library-tool-button:focus, .library-tool-button[data-active="true"] { border-color: #ec0014; outline: none; background: #301416; }
.library-filter-count { margin-left: 8px; color: #fff; font-weight: 700; }
.library-tool-button.library-clear { background: transparent; border-color: transparent; color: #bbb; }
.library-tool-button.library-clear:hover, .library-tool-button.library-clear:focus { border-color: #ec0014; color: #fff; }
.library-query-overlay { position: fixed; z-index: 300; top: 0; right: 0; bottom: 0; left: 0; padding: 24px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.78); }
.library-query-dialog { display: flex; flex-direction: column; width: 640px; max-width: 100%; max-height: 100%; margin: 0; border: 1px solid #484848; border-radius: 8px; background: #141414; color: #eee; box-shadow: 0 16px 60px #000; }
.library-query-dialog header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #383838; }
.library-query-dialog h2 { margin: 0 16px 0 0; font-size: 22px; line-height: 1.3; }
.library-query-dialog header button { width: 42px; padding: 8px; flex: 0 0 42px; }
.library-query-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 20px 4px; -webkit-overflow-scrolling: touch; }
.library-query-body fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 24px; }
.library-query-body legend { padding: 0; margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.library-query-options { display: flex; flex-wrap: wrap; }
.library-query-options label { display: inline-flex; align-items: center; min-height: 42px; max-width: 100%; padding: 6px 10px; margin: 0 8px 8px 0; border: 1px solid #383838; border-radius: 4px; font-size: 15px; cursor: pointer; }
.library-query-options label:hover { border-color: #b30918; }
.library-query-options input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0 9px 0 0; accent-color: #e60012; }
.library-query-options span { min-width: 0; overflow-wrap: break-word; }
.library-query-options input:focus { outline: 2px solid #e60012; outline-offset: 3px; }
.library-query-body fieldset:disabled { opacity: .4; }
.library-query-minimum { display: flex; align-items: center; justify-content: space-between; margin: 0 0 20px; font-size: 16px; font-weight: 700; }
.library-query-minimum input { width: 82px; margin-left: 16px; padding: 10px; border: 1px solid #555; border-radius: 4px; background: #242424; color: #fff; font: inherit; }
.library-query-minimum input:focus { outline: 0; border-color: #ec0014; }
.library-query-dialog footer { display: flex; flex: 0 0 auto; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid #383838; }
.library-query-dialog footer button + button { margin-left: 12px; }
.library-tool-button.library-query-apply { background: #e60012; border-color: #e60012; color: #fff; font-weight: 700; }
.library-query-apply:hover, .library-query-apply:focus { box-shadow: 0 0 0 2px #ff5160; }
.tv-library .library-tools { margin-bottom: 22px; }
.tv-library .library-tool-button, .library-query-tv .library-tool-button { min-height: 48px; font-size: 18px; }
.library-query-tv .library-query-dialog { width: 780px; }
.library-query-tv .library-query-dialog h2 { font-size: 26px; }
.library-query-tv .library-query-options label { min-height: 48px; font-size: 19px; }
.library-query-tv legend, .library-query-tv .library-query-minimum { font-size: 20px; }
.library-query-tv .library-query-options input { width: 22px; height: 22px; flex-basis: 22px; }
.library-tools [hidden], .library-query-overlay[hidden] { display: none !important; }
@media (max-width: 600px) {
  .library-query-overlay { padding: 12px; }
  .library-query-dialog header { padding: 12px 14px; }
  .library-query-dialog h2 { font-size: 20px; }
  .library-query-body { padding: 16px 14px 0; }
  .library-query-dialog footer { padding: 12px 14px; }
  .library-query-minimum { font-size: 15px; }
  .library-tool-button { font-size: 14px; }
}
