/* Shared palette from estimate closing, including native fields and editor toolbars. */
html body input.pakplan-color-input {
    position: absolute !important; width: 1px !important; min-width: 0 !important; max-width: 1px !important;
    height: 1px !important; min-height: 0 !important; margin: -1px !important; padding: 0 !important;
    border: 0 !important; opacity: 0 !important; overflow: hidden !important; clip-path: inset(50%) !important; pointer-events: none !important;
}
html body button.pakplan-color-trigger {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 42px; min-width: 0; max-width: 100%; height: 42px; margin: 0; padding: 6px;
    border: 1px solid var(--color-border-input, #d5d5d5); border-radius: 10px;
    background: var(--color-bg-primary, #fff); color: var(--color-text-primary, #222); cursor: pointer;
}
.pakplan-color-trigger-swatch { width: 100%; height: 100%; margin: 0; border: 1px solid #0002; border-radius: 6px; background: var(--pakplan-picked-color, #000); pointer-events: none; }
html body button.pakplan-color-trigger:disabled { opacity: .5; cursor: default; }
html body button.pakplan-color-trigger:focus-visible { outline: 2px solid var(--color-accent-primary, #1565c0); outline-offset: 2px; }
html body button.pakplan-color-trigger[hidden] { display: none !important; }
html body .pakplan-color-palette {
    position: fixed; inset: auto; z-index: 11000; box-sizing: border-box; width: 304px; max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px); overflow: auto; overscroll-behavior: contain;
    margin: 0; padding: 12px; border: 1px solid var(--color-border-input, #d5d5d5); border-radius: 10px;
    background: var(--color-bg-primary, #fff); color: var(--color-text-primary, #222); box-shadow: 0 6px 24px #0002; font: 14px/1.3 Arial, sans-serif; text-align: left;
}
.pakplan-color-palette::backdrop { background: transparent; }
html body .pakplan-color-palette[hidden], html body .pakplan-color-palette [hidden] { display: none !important; }
.pakplan-color-label { margin-bottom: 8px; }
.pakplan-color-empty { margin: 0; color: var(--color-text-secondary, #666); font-size: 12px; }
.pakplan-color-palette .pakplan-color-swatches { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.pakplan-color-palette .pakplan-color-swatches[data-standard-colors] { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
html body .pakplan-color-palette .pakplan-color-swatches button, html body .pakplan-color-palette button.pakplan-color-preview {
    box-sizing: border-box; display: block; width: 28px; min-width: 0; max-width: 100%; height: 28px; min-height: 0;
    margin: 0; padding: 0; border: 1px solid #0002; border-radius: 6px; cursor: pointer;
}
html body .pakplan-color-palette :is(button, input, [tabindex]):focus-visible { outline: 2px solid var(--color-accent-primary, #1565c0); outline-offset: 2px; }
.pakplan-color-palette .pakplan-color-field { position: relative; box-sizing: border-box; width: 100%; height: 140px; margin: 10px 0 14px; border-radius: 8px; background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); cursor: crosshair; touch-action: none; }
.pakplan-color-cursor { position: absolute; width: 12px; height: 12px; margin: 0; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #333; transform: translate(-50%, -50%); pointer-events: none; }
html body .pakplan-color-palette input.pakplan-color-hue { display: block; appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 100%; min-width: 0; max-width: none; height: 14px; min-height: 0; padding: 0; margin: 0 0 16px; border: 0; border-radius: 7px; background: linear-gradient(to right, red, #ff0, #0f0, #0ff, #00f, #f0f, red); cursor: pointer; }
.pakplan-color-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #777; box-shadow: 0 1px 3px #0004; }
.pakplan-color-hue::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #777; }
.pakplan-color-palette .pakplan-color-footer { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 6px; }
.pakplan-color-palette .pakplan-color-footer .pakplan-color-swatches { margin: 0; }
html body .pakplan-color-palette .pakplan-color-footer .pakplan-color-swatches button { width: 100%; }
html body .pakplan-color-palette button.pakplan-color-clear { width: 100%; max-width: none; height: 32px; min-height: 0; margin: 10px 0 0; padding: 5px 10px; border: 1px solid var(--color-border-input, #d5d5d5); border-radius: 6px; color: var(--color-text-primary, #222); background: var(--color-bg-secondary, #f5f5f7); font: inherit; cursor: pointer; }
@media print { .pakplan-color-palette, .pakplan-color-trigger { display: none !important; } }
