/* Adapted from UniDoc css/app.css. */
.color-pop {
  position: fixed; z-index: 100050;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
  padding: 8px; width: max-content;
  font: 12px "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink);
}
.color-pop .cp-auto, .color-pop .cp-more {
  display: block; width: 100%; text-align: left;
  padding: 6px 8px; border: none; background: transparent;
  cursor: pointer; font: inherit; color: var(--ink);
}
.color-pop .cp-auto:hover, .color-pop .cp-more:hover { background: var(--surface-alt); }
.color-pop .cp-label { margin: 6px 2px 4px; font-size: 11px; color: #8b93a3; }
.color-pop .cp-grid { display: flex; gap: 3px; }
.color-pop .cp-col { display: flex; flex-direction: column; gap: 3px; }
.color-pop .cp-std { display: flex; gap: 3px; margin-bottom: 2px; }
.color-pop .cp-sw {
  width: 16px; height: 16px; padding: 0; border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 2px; cursor: pointer;
}
.color-pop .cp-sw:hover { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.color-swatch { width: 32px; height: 22px; border: 1px solid var(--border); cursor: pointer; padding: 0; vertical-align: middle; }
.color-swatch:hover { border-color: var(--primary); }
.color-pop.cp-advanced {
  box-sizing: border-box; padding: 14px; width: 356px; max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px); overflow: auto;
  border-color: #d9dde5; border-radius: 14px;
  box-shadow: 0 10px 34px rgba(32, 38, 50, .2);
}
.cp-adv { display: flex; flex-direction: column; gap: 10px; }
.cp-adv .cpa-sv {
  position: relative; width: 100%; height: 200px; border-radius: 7px; cursor: crosshair;
  background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.cp-adv .cpa-sv-thumb {
  position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); pointer-events: none;
}
.cp-adv .cpa-hue {
  position: relative; width: 100%; height: 24px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.cp-adv .cpa-hue-thumb {
  position: absolute; top: -2px; width: 10px; height: 28px; margin-left: -5px;
  background: #fff; border: 1px solid rgba(0, 0, 0, .38); border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); pointer-events: none;
}
.cp-adv .cpa-row { display: flex; align-items: center; gap: 10px; }
.cp-adv .cpa-preview { width: 44px; height: 36px; border: 1px solid #c3c9d2; border-radius: 5px; flex: none; }
.cp-adv .cpa-hexl { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 14px; color: #737b88; }
.cp-adv .cpa-hex { box-sizing: border-box; flex: 1; width: 100%; height: 36px; border: 1px solid #c3c9d2; border-radius: 5px; padding: 0 10px; font: inherit; color: #27303d; }
.cp-adv .cpa-rgb label { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 14px; color: #737b88; }
.cp-adv .cpa-rgb input { box-sizing: border-box; width: 100%; min-width: 0; height: 36px; border: 1px solid #c3c9d2; border-radius: 5px; padding: 0 6px; font: inherit; text-align: center; color: #27303d; }
.cp-adv input:focus { border-color: var(--primary); outline: 2px solid color-mix(in srgb, var(--primary) 18%, transparent); }
.cp-adv input.is-invalid { border-color: #d93025; }
.cp-adv .cpa-native { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cp-adv .cpa-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.cp-adv .cpa-actions button { height: 40px; min-width: 80px; padding: 0 18px; border: 1px solid #c3c9d2; border-radius: 6px; background: #fff; color: #2b3038; cursor: pointer; font: 14px "Segoe UI", "Microsoft YaHei", sans-serif; }
.cp-adv .cpa-actions .cpa-eyedropper { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; width: 40px; padding: 0; margin-right: auto; color: #3d4653; }
.cp-adv .cpa-eyedropper svg { width: 21px; height: 21px; fill: currentColor; }
.cp-adv .cpa-eyedropper:hover, .cp-adv .cpa-eyedropper.is-picking { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.cp-adv .cpa-eyedropper.is-picking { cursor: progress; }
.cp-adv .cpa-actions .cpa-ok { background: var(--primary); color: #fff; border-color: var(--primary); }
.cp-adv .cpa-actions .cpa-cancel:hover { background: #f6f8fb; border-color: var(--primary); }
.cp-adv .cpa-actions .cpa-ok:hover { filter: brightness(.94); }
.color-pop .cp-more { position: relative; }
.color-pop .cp-more-inp { position: absolute; left: 10px; bottom: 4px; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; pointer-events: none; }
.color-control .color-swatch { display:inline-flex; align-items:center; gap:5px; width:auto; height:30px; padding:4px; border:1px solid var(--border); border-radius:6px; background:#fff; }
.color-swatch > span { width:21px; height:21px; border:1px solid #0002; border-radius:2px; }
.color-swatch > i { color:var(--muted); font-size:12px; }
.color-pop { border-radius:8px; padding:12px; max-width:calc(100vw - 16px); max-height:calc(100vh - 16px); overflow:auto; }
.color-pop .cp-grid,.color-pop .cp-std { gap:4px; }
.color-pop .cp-col { gap:4px; }
.color-pop .cp-col > :first-child { margin-bottom:4px; }
.color-pop .cp-sw { width:20px; height:20px; flex-shrink:0; }
.color-pop .cp-sw[aria-pressed="true"] { outline:2px solid var(--primary); outline-offset:1px; }
.color-pop .cp-label { margin:6px 0 8px; color:var(--muted); }
.color-pop .cp-std { margin-bottom:10px; }
.color-pop .cp-more { border-top:1px solid var(--border); padding:10px 0 2px; color:var(--primary); }
.cp-adv .cpa-sv,.cp-adv .cpa-hue { touch-action:none; }
