/* Hux asset filter rail v92: fast vertical discovery with hover/focus branches. */

.asset-browser-shell {
  min-width: 0;
}

.asset-filter-rail-head,
.asset-category-flyout-head {
  display: none;
}

.asset-category-flyout[hidden] {
  display: none !important;
}

@media (min-width: 901px) {
  .asset-browser-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .asset-filter-rail {
    position: sticky;
    top: 88px;
    z-index: 24;
    min-width: 0;
    border: 1px solid var(--hux-tab-line, #303033);
    background: #0d0d0e;
    box-shadow: 0 18px 48px rgb(0 0 0 / 22%);
  }

  .asset-filter-rail-head {
    display: grid;
    gap: 4px;
    min-height: 78px;
    padding: 17px 16px 14px;
    border-bottom: 1px solid var(--hux-tab-line, #303033);
    background:
      linear-gradient(135deg, rgb(255 77 77 / 8%), transparent 52%),
      #111112;
  }

  .asset-filter-rail-head .section-kicker {
    color: var(--brand, #ff4d4d);
  }

  .asset-filter-rail-head strong {
    color: #ededee;
    font-size: 15px;
    font-weight: 680;
    letter-spacing: -0.01em;
  }

  .asset-filter-rail-head small {
    color: #68686d;
    font-size: 10px;
    line-height: 1.45;
  }

  #assets-view .asset-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    margin: 0;
    border: 0;
    background: transparent;
  }

  #assets-view .asset-toolbar .search-wrap {
    grid-template-columns: 18px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 9px;
    width: 100%;
    height: 55px;
    padding: 0 13px 0 15px;
    border: 0;
    border-bottom: 1px solid var(--hux-tab-line, #303033);
    border-radius: 0;
    background: #0f0f10;
    box-shadow: none;
    cursor: text;
  }

  #assets-view .asset-toolbar .search-wrap:hover {
    background: #121213;
    box-shadow: none;
  }

  #assets-view .asset-toolbar .search-wrap:focus-within {
    background: #141415;
    box-shadow: inset 3px 0 0 var(--brand, #ff4d4d);
  }

  #assets-view .asset-toolbar .search-wrap input {
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0 !important;
    font-size: 14px;
    font-weight: 680;
    letter-spacing: 0.02em;
    line-height: 1.2;
  }

  #assets-view .asset-toolbar .search-wrap .ui-icon {
    width: 16px;
    height: 16px;
    color: #68686d;
  }

  #assets-view .asset-toolbar .search-wrap:focus-within .ui-icon {
    color: #a8a8ac;
  }

  #assets-view .asset-toolbar .search-wrap kbd {
    display: inline-grid;
    width: 32px;
    min-width: 32px;
    height: 20px;
    place-items: center;
    justify-self: end;
    padding: 0;
    border: 1px solid #343438;
    border-radius: 3px;
    color: #66666b;
    font-size: 8px;
    line-height: 1;
  }

  #assets-view .asset-toolbar:has(.search-wrap:focus-within) #category-pills > .pill.active,
  #assets-view .asset-toolbar:has(#asset-search:not(:placeholder-shown)) #category-pills > .pill.active {
    background: transparent;
    color: var(--hux-tab-text, #8b8b90);
  }

  #assets-view .asset-toolbar:has(.search-wrap:focus-within) #category-pills > .pill.active::before,
  #assets-view .asset-toolbar:has(#asset-search:not(:placeholder-shown)) #category-pills > .pill.active::before {
    background: transparent;
  }

  #assets-view .asset-toolbar:has(.search-wrap:focus-within) #category-pills > .pill.active .ui-icon,
  #assets-view .asset-toolbar:has(#asset-search:not(:placeholder-shown)) #category-pills > .pill.active .ui-icon {
    color: #636368;
  }

  #assets-view .asset-toolbar:has(.search-wrap:focus-within) #category-pills > .pill.active .pill-count,
  #assets-view .asset-toolbar:has(#asset-search:not(:placeholder-shown)) #category-pills > .pill.active .pill-count {
    color: #69696e;
  }

  #assets-view .filter-type-group,
  #assets-view #category-pills {
    width: 100%;
  }

  #assets-view #category-pills {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 230px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: #3c3c40 transparent;
    scrollbar-width: thin;
  }

  #category-pills > .pill {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto 14px;
    gap: 9px;
    width: 100%;
    min-height: 55px;
    padding: 8px 13px 8px 15px;
    border: 0;
    border-right: 0;
    border-bottom: 1px solid var(--hux-tab-line-soft, #27272a);
    border-radius: 0;
    background: transparent;
    text-align: left;
  }

  #category-pills > .pill:last-child {
    border-bottom: 0;
  }

  #category-pills > .pill::before {
    position: absolute;
    inset: 10px auto 10px 0;
    width: 2px;
    background: transparent;
    content: "";
    transition: background 120ms ease, inset 120ms ease;
  }

  #category-pills > .pill::after,
  #subcategory-pills > .secondary-pill::after {
    display: none;
  }

  #category-pills > .pill:hover,
  #category-pills > .pill:focus-visible {
    background: #171718;
    color: #f0f0f1;
  }

  #category-pills > .pill.active {
    border-right: 0;
    background: #171718;
    color: #f5f5f5;
  }

  #category-pills > .pill.active::before {
    inset-block: 0;
    background: var(--brand, #ff4d4d);
  }

  #category-pills > .pill:focus-visible {
    outline: 1px solid #68686d;
    outline-offset: -4px;
  }

  #category-pills > .pill .ui-icon {
    width: 16px;
    height: 16px;
  }

  #category-pills > .pill .pill-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  #category-pills > .pill .pill-copy > span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #category-pills > .pill .pill-copy small {
    overflow: hidden;
    color: #747479;
    font-size: 9px;
    font-weight: 520;
    line-height: 1.25;
    text-overflow: ellipsis;
  }

  #category-pills > .pill .pill-count {
    justify-self: end;
    min-width: 22px;
    padding-inline: 4px;
    background: transparent;
    color: #69696e;
  }

  #category-pills > .pill.active .pill-count {
    color: #8b8b90;
  }

  #category-pills > .pill.active .ui-icon {
    color: #c5c5c8;
  }

  #category-pills > .pill .pill-branch-indicator {
    display: grid;
    place-items: center;
    color: #55555a;
    transition: color 120ms ease, transform 120ms ease;
  }

  #category-pills > .pill:hover .pill-branch-indicator,
  #category-pills > .pill:focus-visible .pill-branch-indicator,
  #category-pills > .pill[aria-expanded="true"] .pill-branch-indicator {
    color: #b8b8bc;
    transform: translateX(2px);
  }

  #category-pills > .pill[data-has-branches="false"] .pill-branch-indicator {
    visibility: hidden;
  }

  #category-pills > .pill:disabled,
  #category-pills > .pill.empty {
    background: transparent;
    color: var(--hux-tab-text, #8b8b90);
    opacity: 1;
  }

  #category-pills > .pill:disabled .ui-icon,
  #category-pills > .pill.empty .ui-icon {
    color: #636368;
  }

  #category-pills > .pill:disabled .pill-count,
  #category-pills > .pill.empty .pill-count {
    color: #69696e;
  }

  #subcategory-group.asset-category-flyout {
    position: fixed;
    top: var(--asset-flyout-top, 96px);
    left: var(--asset-flyout-left, 280px);
    z-index: 80;
    display: block;
    width: 258px;
    max-height: min(530px, calc(100vh - 24px));
    margin: 0;
    padding: 0;
    overflow: auto;
    border: 1px solid #3a3a3e;
    background: rgb(17 17 18 / 98%);
    box-shadow: 0 24px 70px rgb(0 0 0 / 54%), 0 0 0 1px rgb(255 255 255 / 2%);
    backdrop-filter: blur(18px) saturate(115%);
    animation: asset-branch-in 130ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .asset-category-flyout-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    gap: 3px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid #343438;
    background: rgb(17 17 18 / 96%);
    backdrop-filter: blur(16px);
  }

  .asset-category-flyout-head .section-kicker {
    color: var(--brand, #ff4d4d);
  }

  .asset-category-flyout-head strong {
    color: #f0f0f1;
    font-size: 14px;
  }

  .asset-category-flyout-head small {
    color: #68686d;
    font-size: 9px;
  }

  #subcategory-pills {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 0;
  }

  #subcategory-pills > .secondary-pill {
    position: relative;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    gap: 9px;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    border-right: 0;
    border-bottom: 1px solid #29292c;
    border-radius: 0;
    background: transparent;
    text-align: left;
  }

  #subcategory-pills > .secondary-pill:last-child {
    border-bottom: 0;
  }

  #subcategory-pills > .secondary-pill:hover,
  #subcategory-pills > .secondary-pill:focus-visible {
    background: #1a1a1c;
    color: #f1f1f2;
  }

  #subcategory-pills > .secondary-pill.active {
    border-right: 0;
    background: #1a1a1c;
    color: #fff;
    box-shadow: inset 2px 0 0 var(--brand, #ff4d4d);
  }

  #subcategory-pills > .secondary-pill .pill-count {
    justify-self: end;
    background: transparent;
    color: #6d6d72;
  }

  #subcategory-pills > .secondary-pill.active .pill-count {
    color: #8b8b90;
  }

  #subcategory-pills > .secondary-pill.active .ui-icon {
    color: #c5c5c8;
  }

  #subcategory-pills > .secondary-pill:disabled,
  #subcategory-pills > .secondary-pill.empty {
    color: #7d7d82;
    opacity: 1;
  }

  #subcategory-pills > .secondary-pill:disabled .ui-icon,
  #subcategory-pills > .secondary-pill.empty .ui-icon {
    color: #636368;
  }

  #subcategory-pills > .secondary-pill:disabled .pill-count,
  #subcategory-pills > .secondary-pill.empty .pill-count {
    color: #6d6d72;
  }

  #assets-view .asset-results-pane {
    min-width: 0;
  }

  #assets-view .asset-results-pane .asset-grid,
  #assets-view .asset-results-pane .skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(282px, 100%), 1fr));
    margin-top: 0;
  }

  @keyframes asset-branch-in {
    from {
      opacity: 0;
      transform: translateX(-5px) scale(0.99);
    }
    to {
      opacity: 1;
      transform: translateX(0) scale(1);
    }
  }
}

@media (min-width: 901px) and (max-width: 1020px) {
  .asset-browser-shell {
    grid-template-columns: 218px minmax(0, 1fr);
    gap: 14px;
  }

  .asset-filter-rail {
    top: 132px;
  }

  #assets-view #category-pills {
    max-height: calc(100vh - 274px);
  }
}

@media (max-width: 900px) {
  .asset-results-pane {
    min-width: 0;
  }

  .asset-category-flyout-head {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #subcategory-group.asset-category-flyout {
    animation: none !important;
  }

  #category-pills > .pill::before,
  #category-pills > .pill .pill-branch-indicator {
    transition: none !important;
  }
}
