/* DB-P5-ASSET-COLOR-UI-FIX-07: compact two-column color panel. */

.asset-color-portal {
  position: fixed;
  z-index: 760;
  inset: 0;
  pointer-events: none;
}

.asset-color-portal > .asset-color-popover {
  position: fixed;
  pointer-events: auto;
}

.filter-bar .identity-filter-group {
  display: flex !important;
  flex: 0 1 auto;
  min-width: 0;
  gap: 3px;
  position: relative;
  z-index: 300;
}

.filter-bar,
.filter-bar .asset-filter-menu-row,
.filter-bar .identity-filter-group,
.filter-more-popover { overflow: visible; }

.filter-more-trigger { position: relative; z-index: 301; pointer-events: auto; }
.filter-more-popover { pointer-events: auto; }
.filter-more-popover .filter-popover { position: relative; }

.filter-type-menu { min-width: 220px; max-height: min(480px, calc(100vh - 180px)); overflow-y: auto; }
.filter-type-group { display: block; }
.filter-subgroup-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #53647E;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.filter-subgroup-trigger:hover,
.filter-subgroup-trigger[aria-expanded="true"] { color: #263044; background: #E9EEF7; }
.filter-subgroup-trigger i { color: #8A97AB; font-style: normal; font-size: 12px; }
.filter-type-submenu { display: grid; gap: 2px; padding: 2px 0 4px 10px; }
.filter-type-submenu[hidden] { display: none; }
.filter-type-submenu > button { padding-left: 12px; }

.filter-more-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #53647E;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.filter-more-trigger:hover,
.filter-more-trigger[aria-expanded="true"] { background: rgba(255,255,255,.58); color: #263044; }
.filter-more-trigger i { color: #8A97AB; font-style: normal; font-size: 12px; }
.filter-more-popover {
  position: absolute;
  z-index: 220;
  top: calc(100% + 7px);
  left: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(109,128,157,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 28px rgba(44,59,86,.12), 0 2px 7px rgba(44,59,86,.06);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}
.filter-more-popover[hidden] { display: none; }
.filter-more-popover .filter-popover-trigger { font-size: 13px; }
.filter-more-popover .filter-popover-menu { top: calc(100% + 7px); }

.filter-bar .asset-color-search {
  position: relative;
  z-index: 210;
  flex: 0 0 auto;
}

.asset-color-popover {
  top: calc(100% + 9px);
  right: 0;
  left: auto;
  z-index: 240;
  width: min(460px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  overflow: visible;
  padding: 18px;
  border: 1px solid rgba(111, 132, 168, .24);
  border-radius: 17px;
  background: #f8fafd;
  background: rgba(248, 250, 253, .97);
  box-shadow: 0 20px 48px rgba(48, 65, 96, .18), 0 3px 12px rgba(48, 65, 96, .10);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

.asset-color-popover > header {
  align-items: center;
  gap: 16px;
  margin-bottom: 2px;
}

.asset-color-popover > header > div {
  min-width: 0;
}

.asset-color-popover > header b {
  color: #3f4f68;
  font-size: 12px;
  font-weight: 650;
}

.asset-color-popover > header small {
  color: #77849a;
}

.asset-color-stage {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 190px;
  margin: 12px 0 14px;
}

.asset-color-wheel-label {
  display: grid;
  place-items: center;
}

.asset-color-wheel {
  position: relative;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  box-shadow: 0 4px 14px rgba(45, 66, 104, .16), inset 0 0 0 1px rgba(255, 255, 255, .78);
  cursor: crosshair;
  touch-action: none;
}

.asset-color-wheel::before {
  content: "";
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: var(--selected-color, #6f85b7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72);
}

#assetColorWheelMarker {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 5%;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 1px 4px rgba(31, 43, 64, .38);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.asset-color-wheel:focus-visible,
.asset-color-sv:focus-visible {
  outline: 2px solid rgba(82, 111, 170, .52);
  outline-offset: 3px;
}

.asset-color-sv-label {
  min-width: 0;
}

.asset-color-sv {
  position: relative;
  width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  border: 1px solid #DCE3EE;
  border-radius: 12px;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent), hsl(var(--sv-hue, 220), 100%, 50%);
  background-clip: padding-box;
  box-shadow: 0 3px 10px rgba(54, 72, 107, .10);
  cursor: crosshair;
  touch-action: none;
}

#assetColorSVMarker {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(31, 43, 64, .40), inset 0 0 0 1px rgba(31, 43, 64, .22);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.asset-color-controls {
  display: grid;
  gap: 10px;
}

.asset-color-mode {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 3px;
  border-radius: 10px;
  background: #E9EEF7;
}
.asset-color-mode span {
  margin: 0 5px 0 7px;
  color: #8A97AB;
  font-size: 12px;
}
.asset-color-mode button {
  min-height: 25px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: #53647E;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.asset-color-mode button.active { color: #263044; background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(48,65,96,.08); }

.filter-bar .asset-filter-menu-row { position: relative; }
.active-filter-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 8px; }
.active-filter-chips button,
.clear-all-filters {
  border: 1px solid rgba(155,171,198,.28);
  border-radius: 999px;
  padding: 3px 8px;
  color: #53647E;
  background: rgba(233,238,247,.58);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.active-filter-chips button:hover,
.clear-all-filters:hover { color: #263044; background: #fff; }
.clear-all-filters { margin-left: 8px; background: transparent; }

@media (max-width: 760px) {
  .filter-more-popover { max-width: calc(100vw - 40px); overflow-x: auto; }
  .filter-bar .asset-filter-menu-row { flex-wrap: wrap; }
  .active-filter-chips { margin-left: 0; }
}

.asset-color-hex-row,
.asset-color-preset-row,
.asset-color-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.asset-color-hex-row {
  gap: 8px;
}

.asset-color-panel-preview {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(48, 65, 96, .22), inset 0 0 0 1px rgba(73, 91, 123, .20);
}

#assetColorSwatch.is-empty,
.asset-color-panel-preview.is-empty {
  position: relative;
  overflow: hidden;
  background: transparent;
}
#assetColorSwatch {
  background-color: transparent;
}
#assetColorSwatch.is-empty {
  background-color: transparent;
}
#assetColorSwatch.is-empty::after,
.asset-color-panel-preview.is-empty::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 135%;
  height: 1.5px;
  background: #c8545f;
  transform: translate(-50%, -50%) rotate(-42deg);
  transform-origin: center;
}

.asset-color-hex {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #6f7e94;
  font-size: 10px;
}

.asset-color-hex input {
  width: 112px;
  height: 30px;
  background: rgba(255, 255, 255, .90);
}

.asset-color-preset-row {
  gap: 9px;
}

.asset-color-preset-label {
  flex: 0 0 auto;
  color: #6f7e94;
  font-size: 10px;
}

.asset-color-swatch-grid {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

.asset-color-swatch-grid button {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .90);
  border-radius: 50%;
  background: var(--preset) !important;
  box-shadow: 0 1px 4px rgba(48, 65, 96, .18), inset 0 0 0 1px rgba(45, 64, 94, .18);
}

.asset-color-swatch-grid button:hover,
.asset-color-swatch-grid button:focus-visible {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px rgba(82, 111, 170, .22), 0 2px 7px rgba(48, 65, 96, .22);
}

.asset-color-actions {
  justify-content: flex-end;
  gap: 8px;
}

.asset-color-apply {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(95, 119, 163, .42);
  border-radius: 10px;
  color: #405474;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .01em;
  min-height: 32px;
  flex: 1 1 auto;
  max-width: 220px;
  background: rgba(218, 228, 243, .94);
  box-shadow: inset 0 1px rgba(255, 255, 255, .80);
  cursor: pointer;
}

.asset-color-clear {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(111, 132, 168, .24);
  border-radius: 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 560;
  min-height: 32px;
  padding-inline: 11px;
  color: #71809a;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
}

.asset-color-apply:hover,
.asset-color-apply:focus-visible {
  border-color: rgba(82, 111, 170, .68);
  background: rgba(207, 221, 241, .98);
}

.asset-color-clear:hover,
.asset-color-clear:focus-visible {
  border-color: rgba(82, 111, 170, .36);
  color: #536987;
  background: rgba(255, 255, 255, .96);
}

.asset-color-apply:disabled,
.asset-color-clear:disabled {
  opacity: .54;
  cursor: default;
}

.asset-color-popover button {
  -webkit-tap-highlight-color: transparent;
}

.asset-color-popover button:focus-visible {
  outline: 2px solid rgba(82, 111, 170, .46);
  outline-offset: 2px;
}

#assetColorSearchStatus {
  display: block;
  min-height: 14px;
  color: #71809a;
}

.asset-color-index-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  color: #8A97AB;
  font-size: 10px;
  line-height: 1.4;
}
.asset-color-index-tools span { min-width: 0; }
.asset-color-index-tools button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #DCE3EE;
  border-radius: 9px;
  background: rgba(255,255,255,.7);
  color: #53647E;
  font: inherit;
  cursor: pointer;
}
.asset-color-index-tools button:hover,
.asset-color-index-tools button:focus-visible { border-color: #B8C8E3; color: #263044; background: #fff; }
.asset-color-index-tools button:disabled { cursor: not-allowed; opacity: .6; }

@media (max-width: 760px) {
  .asset-color-popover {
    right: -4px;
    width: min(440px, calc(100vw - 24px));
    padding: 14px;
  }

  .asset-color-stage {
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
  }

  .asset-color-wheel {
    width: 148px;
    height: 148px;
  }

  .asset-color-wheel::before {
    inset: 25px;
  }

  .asset-color-sv {
    min-height: 116px;
  }
}

@media (max-width: 390px) {
  .asset-color-stage {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
  }

  .asset-color-wheel {
    width: 112px;
    height: 112px;
  }

  .asset-color-wheel::before {
    inset: 19px;
  }

  .asset-color-sv {
    min-height: 104px;
  }

  .asset-color-preset-label {
    display: none;
  }

  .asset-color-swatch-grid {
    gap: 6px;
  }

  .asset-color-swatch-grid button {
    width: 17px;
    height: 17px;
  }
}
