/* ===========================================================================
   Members' own chart colours (2026-11-09; js/app/color-management/chartColorsPopup.js).
   The Colors button sits in a Dashboard chart's controls bar beside the "?"
   (styled like it); the popup is a fixed panel over a non-closing backdrop
   (a popup closes only from its X, Cancel or Done). Theme tokens only.
   Redesign 2026-11-10 (design canvas claude.ai/artifact/BX8KN9PJK8UWkcdzh4dGCv):
   600px panel, a preview of the chart under the title, rows with a 40px tile,
   the open row's palette as a card of round swatches. The --ccp-* names below
   are local aliases of theme tokens, so the dark theme follows on its own.
   ONE SCALE (Steve 2026-11-10, "scale down the whole popup by 15%"): every size
   in the popup is written at full size times --ccp-s (0.85); hairlines and focus
   rings (2px and under) stay as they are. TEXT IS NOT SCALED (Steve the same day:
   "now the fonts are too small"): font-size and line-height stay full size (the
   swatch pencil badge, an icon in a fixed box, is the one exception). Change
   --ccp-s to resize the popup; chartColorsPopup.js reads it for the panel's width.
   Not CSS zoom: the popup is placed and dragged in screen pixels.
   =========================================================================== */

.chart-colors-btn {
    width: 26px;
    height: 26px;
    margin-left: 6px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--color-gray-300);
    background: transparent;
    color: var(--ui-text-secondaryText);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}
.chart-colors-btn:hover { border-color: var(--color-blue-6); color: var(--color-blue-6); }
.chart-colors-btn:focus-visible { outline: 2px solid var(--color-blue-6); outline-offset: 2px; }

.ccp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(var(--color-ui-overlay-rgb), 0.12);
}

.ccp {
    --ccp-s: 0.85;
    --ccp-accent: var(--ui-text-linkText);
    --ccp-card: var(--ui-backgrounds-cardBg);
    --ccp-tint: color-mix(in srgb, var(--ui-backgrounds-hoverBg) 55%, var(--ui-backgrounds-cardBg));
    --ccp-chip: var(--ui-backgrounds-hoverBg);
    --ccp-line: var(--ui-borders-borderLight);
    --ccp-line-strong: var(--ui-borders-borderDefault);
    --ccp-edge: color-mix(in srgb, var(--ui-text-primaryText) 14%, transparent);
    --ccp-ring: var(--ui-text-primaryText);
    position: fixed;
    z-index: 10041;
    display: flex;
    flex-direction: column;
    background: var(--ccp-card);
    color: var(--ui-text-primaryText);
    border: 1px solid var(--ccp-line);
    border-radius: calc(16px * var(--ccp-s));
    box-shadow: 0 1px 2px rgba(var(--color-ui-overlay-rgb), 0.06), 0 calc(32px * var(--ccp-s)) calc(64px * var(--ccp-s)) calc(-16px * var(--ccp-s)) rgba(var(--color-ui-overlay-rgb), 0.32);
    overflow: hidden;
    font-size: var(--text-small, 14px);
    line-height: 1.45;
}
.ccp button { font-family: inherit; }

/* ---- title bar (drag to move) ---- */
.ccp-head {
    cursor: grab;
    touch-action: none;
    user-select: none;
    /* The X sits beside the title only; the line under the title runs the full width (head-text is display: contents). */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: calc(12px * var(--ccp-s));
    align-items: start;
    padding: calc(18px * var(--ccp-s)) calc(14px * var(--ccp-s)) calc(14px * var(--ccp-s)) calc(24px * var(--ccp-s));
}
.ccp.is-dragging, .ccp.is-dragging .ccp-head { cursor: grabbing; }
.ccp-head-text { display: contents; }
.ccp-title { grid-column: 1; grid-row: 1; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.ccp-lede { grid-column: 1 / 3; grid-row: 2; color: var(--ui-text-secondaryText); margin-top: 2px; }
.ccp-x {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    width: calc(36px * var(--ccp-s));
    height: calc(36px * var(--ccp-s));
    margin-top: calc(-4px * var(--ccp-s));
    border: 0;
    border-radius: calc(10px * var(--ccp-s));
    background: transparent;
    color: var(--ui-text-secondaryText);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.ccp-x:hover { background: var(--ui-backgrounds-hoverBg); color: var(--ui-text-primaryText); }

/* ---- the preview: a small copy of the chart on screen ---- */
.ccp-preview { padding: 0 calc(24px * var(--ccp-s)) calc(16px * var(--ccp-s)); border-bottom: 1px solid var(--ccp-line); }
.ccp-preview[hidden] { display: none; }
.ccp-preview-card { padding: calc(12px * var(--ccp-s)) calc(14px * var(--ccp-s)); border-radius: calc(12px * var(--ccp-s)); background: var(--ccp-tint); border: 1px solid var(--ccp-line); }
.ccp-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: calc(12px * var(--ccp-s)); margin-bottom: calc(10px * var(--ccp-s)); }
.ccp-eyebrow {
    font-size: var(--text-2xs, 11px);
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-text-secondaryText);
}
.ccp-preview-hint { font-size: var(--text-xs, 12px); color: var(--ui-text-secondaryText); }
.ccp-pv { border-bottom: 1px solid var(--ccp-line-strong); }
.ccp-pv svg { display: block; width: 100%; height: calc(64px * var(--ccp-s)); overflow: visible; }
.ccp-pv rect, .ccp-pv polygon { stroke: var(--ccp-tint); stroke-width: 1px; vector-effect: non-scaling-stroke; transition: fill 0.18s ease; }
.ccp-pv polygon.is-loose { fill-opacity: 0.7; stroke: none; }
.ccp-pv polyline { fill: none; stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: stroke 0.18s ease; }
.ccp-pv-zero { stroke: var(--ccp-line-strong); stroke-width: 1px; vector-effect: non-scaling-stroke; }

/* ---- the list ---- */
.ccp-body {
    overflow-y: auto;
    flex: 1 1 auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--ui-sliders-scrollbars-scrollbarThumbBg) transparent;
}
.ccp-body::-webkit-scrollbar { width: calc(12px * var(--ccp-s)); }
.ccp-body::-webkit-scrollbar-thumb { background: var(--ui-sliders-scrollbars-scrollbarThumbBg); border-radius: calc(12px * var(--ccp-s)); border: calc(4px * var(--ccp-s)) solid var(--ccp-card); }

/* flow-root: the open card's bottom margin stays inside the row, so the row's tint runs under it. */
.ccp-row { display: flow-root; border-top: 1px solid var(--ccp-line); transition: background-color 0.2s; }
.ccp-row:first-child { border-top: 0; }
.ccp-row:not(.is-open):hover { background: color-mix(in srgb, var(--ccp-tint) 60%, var(--ccp-card)); }
.ccp-row.is-open { background: var(--ccp-tint); }
/* The tile and the buttons sit beside the name and its colour line only; the chips, warning and "Also on" below them
   run the full width (the info box is display: contents, so its children are the grid's items). */
.ccp-row-main {
    display: grid;
    grid-template-columns: calc(40px * var(--ccp-s)) minmax(0, 1fr) auto;
    column-gap: calc(14px * var(--ccp-s));
    align-items: start;
    padding: calc(16px * var(--ccp-s)) calc(16px * var(--ccp-s)) calc(16px * var(--ccp-s)) calc(24px * var(--ccp-s));
}
.ccp-tile {
    grid-column: 1;
    grid-row: 1 / 3;
    width: calc(40px * var(--ccp-s));
    height: calc(40px * var(--ccp-s));
    border-radius: calc(11px * var(--ccp-s));
    box-shadow: inset 0 0 0 1px var(--ccp-edge);
    transition: background-color 0.18s ease;
}
.ccp-info { display: contents; }
.ccp-info > * { grid-column: 2 / 4; justify-self: start; min-width: 0; max-width: 100%; }
.ccp-info > .ccp-name-line, .ccp-info > .ccp-sub { grid-column: 2; }
.ccp-actions { grid-column: 3; grid-row: 1 / 3; }
.ccp-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: calc(8px * var(--ccp-s)); min-height: calc(22px * var(--ccp-s)); }
.ccp-name { font-size: var(--text-medium, 15px); line-height: 22px; font-weight: 600; }
.ccp-badge {
    font-size: var(--text-2xs, 11px);
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px calc(7px * var(--ccp-s));
    border-radius: calc(6px * var(--ccp-s));
    background: color-mix(in srgb, var(--ccp-accent) 12%, var(--ccp-card));
    color: var(--ccp-accent);
}
.ccp-sub { color: var(--ui-text-secondaryText); margin-top: 1px; }
.ccp-sub-color { color: var(--ui-text-primaryText); font-weight: 500; }

/* What the item is called on the chart on screen (Jean's round 2, 2026-11-10): the chart's own band labels. */
.ccp-onchart { display: flex; flex-wrap: wrap; align-items: center; gap: calc(6px * var(--ccp-s)); margin-top: calc(10px * var(--ccp-s)); max-width: 100%; }
.ccp-onchart-label { font-size: var(--text-xs, 12px); color: var(--ui-text-secondaryText); margin-right: 2px; }
.ccp-chip {
    display: inline-flex;
    align-items: center;
    gap: calc(7px * var(--ccp-s));
    height: calc(26px * var(--ccp-s));
    max-width: 100%;
    padding: 0 calc(10px * var(--ccp-s)) 0 calc(8px * var(--ccp-s));
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--ccp-chip);
    font-size: var(--text-xs, 12px);
    color: var(--ui-text-primaryText);
}
.ccp-chip i {
    flex: none;
    width: calc(10px * var(--ccp-s));
    height: calc(10px * var(--ccp-s));
    border-radius: calc(3px * var(--ccp-s));
    box-shadow: inset 0 0 0 1px var(--ccp-edge);
    transition: background-color 0.18s ease;
}
.ccp-chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccp-chip-more { background: transparent; padding: 0 calc(4px * var(--ccp-s)); color: var(--ui-text-secondaryText); }

.ccp-warn {
    display: flex;
    align-items: flex-start;
    gap: calc(8px * var(--ccp-s));
    margin-top: calc(10px * var(--ccp-s));
    padding: calc(8px * var(--ccp-s)) calc(12px * var(--ccp-s)) calc(8px * var(--ccp-s)) calc(10px * var(--ccp-s));
    border-radius: calc(9px * var(--ccp-s));
    background: var(--color-semantic-warning-soft);
    border: 1px solid color-mix(in srgb, var(--color-semantic-warning) 35%, var(--ccp-card));
    color: var(--color-semantic-warning-deep);
    font-size: var(--text-xs, 12px);
    line-height: 18px;
}
.ccp-warn svg { flex: none; margin-top: 1px; }
.ccp-warn strong { font-weight: 600; }

.ccp-also {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: calc(10px * var(--ccp-s));
    border: 0;
    background: none;
    padding: 0;
    color: var(--ccp-accent);
    font-size: var(--text-xs, 12px);
    font-weight: 500;
    line-height: 18px;
    cursor: pointer;
}
.ccp-also:hover { text-decoration: underline; text-underline-offset: calc(3px * var(--ccp-s)); }
.ccp-also svg { transition: transform 0.2s ease; }
.ccp-also[aria-expanded="true"] svg { transform: rotate(90deg); }
.ccp-also-list { margin-top: calc(4px * var(--ccp-s)); font-size: var(--text-xs, 12px); color: var(--ui-text-secondaryText); }
.ccp-actions { display: flex; align-items: center; gap: calc(4px * var(--ccp-s)); }

/* ---- buttons ---- */
.ccp-btn {
    font: inherit;
    font-weight: 500;
    line-height: 20px;
    height: calc(36px * var(--ccp-s));
    padding: 0 calc(14px * var(--ccp-s));
    border-radius: calc(10px * var(--ccp-s));
    border: 1px solid var(--ccp-line-strong);
    background: var(--ccp-card);
    color: var(--ui-text-primaryText);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: calc(6px * var(--ccp-s));
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
.ccp-btn:hover { background: var(--ui-backgrounds-hoverBg); }
.ccp-btn-lg { height: calc(40px * var(--ccp-s)); padding: 0 calc(16px * var(--ccp-s)); }
.ccp-btn-sm { height: calc(32px * var(--ccp-s)); padding: 0 calc(10px * var(--ccp-s)); }
.ccp-btn-ghost { border-color: transparent; background: transparent; color: var(--ccp-accent); }
.ccp-btn-ghost:hover { background: color-mix(in srgb, var(--ccp-accent) 9%, transparent); }
.ccp-btn-toggle .ccp-chev { color: var(--ui-text-secondaryText); transition: transform 0.2s ease; }
.ccp-btn-toggle.is-on {
    border-color: color-mix(in srgb, var(--ccp-accent) 60%, var(--ccp-line-strong));
    box-shadow: 0 0 0 calc(3px * var(--ccp-s)) color-mix(in srgb, var(--ccp-accent) 15%, transparent);
    color: var(--ccp-accent);
}
.ccp-btn-toggle.is-on .ccp-chev { transform: rotate(180deg); color: var(--ccp-accent); }
/* The Contrast-pairs rule: a filled button is linkText with cardBg text (AA in every theme). */
.ccp-primary {
    background: var(--ccp-accent);
    border-color: var(--ccp-accent);
    color: var(--ccp-card);
    font-weight: 600;
}
.ccp-primary:hover {
    background: color-mix(in srgb, var(--ccp-accent) 86%, var(--ui-text-primaryText));
    border-color: color-mix(in srgb, var(--ccp-accent) 86%, var(--ui-text-primaryText));
}
/* Full-size text in the scaled footer: Reset all takes a tighter side padding so the four buttons keep one line. */
.ccp-foot .ccp-btn-ghost { padding: 0 calc(10px * var(--ccp-s)); }
.ccp-btn:disabled, .ccp-link:disabled { opacity: 0.45; cursor: default; }
.ccp-link {
    font: inherit;
    font-weight: 500;
    height: calc(32px * var(--ccp-s));
    padding: 0 calc(10px * var(--ccp-s));
    border: 0;
    border-radius: calc(8px * var(--ccp-s));
    background: none;
    color: var(--ccp-accent);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.ccp-link:hover { background: color-mix(in srgb, var(--ccp-accent) 9%, transparent); }
.ccp-danger-link { color: var(--color-semantic-danger); }
.ccp-danger-link:hover { background: color-mix(in srgb, var(--color-semantic-danger) 9%, transparent); }
.ccp-btn:focus-visible, .ccp-link:focus-visible, .ccp-choice:focus-visible, .ccp-also:focus-visible, .ccp-x:focus-visible {
    outline: 2px solid var(--ccp-accent);
    outline-offset: 2px;
}

/* ---- the open row's card: the colour and its shades, My colors, the palette ---- */
.ccp-picker {
    /* Narrow side padding: the palette row of 12 swatches must fit beside the full-size labels. */
    margin: calc(-4px * var(--ccp-s)) calc(12px * var(--ccp-s)) calc(20px * var(--ccp-s)) calc(24px * var(--ccp-s));
    padding: calc(16px * var(--ccp-s)) calc(12px * var(--ccp-s));
    border-radius: calc(14px * var(--ccp-s));
    background: var(--ccp-card);
    border: 1px solid var(--ccp-line);
    box-shadow: 0 1px 2px rgba(var(--color-ui-overlay-rgb), 0.05);
}
.ccp-sel { display: flex; align-items: center; gap: calc(16px * var(--ccp-s)); padding-bottom: calc(16px * var(--ccp-s)); border-bottom: 1px solid var(--ccp-line); }
.ccp-sel-tiles { display: flex; gap: calc(8px * var(--ccp-s)); flex: none; }
.ccp-sel-tile {
    min-width: 42px; /* the widest caption (full-size text), so the three tiles sit evenly apart */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(4px * var(--ccp-s));
    font-size: var(--text-2xs, 11px);
    line-height: 14px;
    color: var(--ui-text-secondaryText);
}
.ccp-sel-tile i {
    display: block;
    width: calc(40px * var(--ccp-s));
    height: calc(40px * var(--ccp-s));
    border-radius: calc(11px * var(--ccp-s));
    box-shadow: inset 0 0 0 1px var(--ccp-edge);
    transition: background-color 0.18s ease;
}
.ccp-sel-text { flex: 1; min-width: 0; }
.ccp-sel-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: calc(4px * var(--ccp-s)) calc(8px * var(--ccp-s)); }
.ccp-sel-label { font-size: var(--text-medium, 15px); line-height: 22px; font-weight: 600; }
.ccp-sel-hex { font-family: var(--font-mono); font-size: var(--text-xs, 12px); color: var(--ui-text-secondaryText); }
.ccp-tag {
    font-size: var(--text-2xs, 11px);
    line-height: 16px;
    font-weight: 600;
    padding: 1px calc(7px * var(--ccp-s));
    border-radius: calc(6px * var(--ccp-s));
    background: var(--ccp-chip);
    color: var(--ui-text-secondaryText);
}
.ccp-tag[hidden] { display: none; }
.ccp-sel-note { margin-top: calc(4px * var(--ccp-s)); font-size: var(--text-xs, 12px); line-height: 18px; color: var(--ui-text-secondaryText); }

/* The label column holds full-size text ("Oranges and golds" on one line), so it is not on the scale. */
.ccp-group { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: calc(8px * var(--ccp-s)); align-items: center; }
.ccp-group-label { font-size: var(--text-xs, 12px); line-height: 18px; color: var(--ui-text-secondaryText); }
.ccp-mine-block { padding: calc(14px * var(--ccp-s)) 0; border-bottom: 1px solid var(--ccp-line); }
.ccp-mine .ccp-group-label { color: var(--ui-text-primaryText); font-weight: 500; }
.ccp-families { display: flex; flex-direction: column; gap: calc(10px * var(--ccp-s)); padding-top: calc(14px * var(--ccp-s)); }
.ccp-grid { display: flex; flex-wrap: wrap; align-items: center; gap: calc(5px * var(--ccp-s)); min-height: calc(32px * var(--ccp-s)); }

/* A swatch: round, a ring and a check when chosen, a dot when another item on this chart wears it. */
.ccp-choice {
    position: relative;
    flex: none;
    width: calc(28px * var(--ccp-s));
    height: calc(28px * var(--ccp-s));
    border: 0;
    padding: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
}
.ccp-choice > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(28px * var(--ccp-s));
    height: calc(28px * var(--ccp-s));
    box-sizing: border-box;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px var(--ccp-edge);
    color: var(--color-ui-header-text);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ccp-choice.is-light > span { color: rgba(var(--color-ui-overlay-rgb), 0.82); }
.ccp-choice:hover > span { transform: scale(1.14); }
.ccp-choice.is-selected > span { box-shadow: inset 0 0 0 1px var(--ccp-edge), 0 0 0 2px var(--ccp-card), 0 0 0 calc(4px * var(--ccp-s)) var(--ccp-ring); }
.ccp-choice.is-selected:hover > span { transform: none; }
.ccp-used-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: calc(9px * var(--ccp-s));
    height: calc(9px * var(--ccp-s));
    border-radius: 50%;
    background: var(--ui-text-primaryText);
    box-shadow: 0 0 0 2px var(--ccp-card);
    pointer-events: none;
}
.ccp-used-key {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ccp-s));
    margin-top: calc(14px * var(--ccp-s));
    padding-top: calc(12px * var(--ccp-s));
    border-top: 1px solid var(--ccp-line);
    font-size: var(--text-xs, 12px);
    color: var(--ui-text-secondaryText);
}
.ccp-used-key .ccp-used-dot { position: static; flex: none; box-shadow: none; }

/* "My colors": the member's own colours, the "+" that makes one, Edit mode and the picker inside the popup. */
.ccp-add > span {
    box-shadow: none;
    border: 1.5px dashed var(--ccp-line-strong);
    color: var(--ui-text-secondaryText);
}
.ccp-add:hover > span {
    transform: none;
    border-style: solid;
    border-color: var(--ccp-accent);
    color: var(--ccp-accent);
    background: color-mix(in srgb, var(--ccp-accent) 8%, transparent);
}
.ccp-mine-empty { font-size: var(--text-xs, 12px); color: var(--ui-text-secondaryText); margin-left: calc(4px * var(--ccp-s)); }
.ccp-mine-mode { margin-left: auto; }
/* My colors' Edit mode (Steve 2026-11-10): a pencil badge on each swatch, which then opens that colour. */
.ccp-choice.is-editable::after {
    content: '\270E';
    position: absolute;
    right: calc(-6px * var(--ccp-s));
    bottom: calc(-6px * var(--ccp-s));
    width: calc(16px * var(--ccp-s));
    height: calc(16px * var(--ccp-s));
    border-radius: 50%;
    background: var(--ccp-card);
    color: var(--ui-text-primaryText);
    box-shadow: 0 0 0 1px var(--ccp-line-strong), 0 1px 2px rgba(var(--color-ui-overlay-rgb), 0.15);
    font-size: calc(var(--text-2xs, 11px) * var(--ccp-s));
    line-height: calc(16px * var(--ccp-s));
    text-align: center;
    pointer-events: none;
}
.ccp-mine-hint { font-size: var(--text-xs, 12px); line-height: 18px; color: var(--ui-text-secondaryText); }
.ccp-mine-edit-hint { margin-top: calc(8px * var(--ccp-s)); padding-left: calc(112px + 8px * var(--ccp-s)); }
.ccp-mine-editor {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: calc(10px * var(--ccp-s));
    margin-top: calc(12px * var(--ccp-s));
    padding: calc(14px * var(--ccp-s));
    border-radius: calc(12px * var(--ccp-s));
    background: var(--ccp-tint);
    border: 1px solid var(--ccp-line);
}
.ccp-mine-title { font-weight: 600; color: var(--ui-text-primaryText); }
/* The picker inside the popup (Steve 2026-11-10): a shade square and a colour strip, drawn on canvases. */
.ccp-sv, .ccp-hue { position: relative; cursor: crosshair; touch-action: none; }
.ccp-sv { height: calc(150px * var(--ccp-s)); border-radius: calc(10px * var(--ccp-s)); }
.ccp-hue { height: calc(14px * var(--ccp-s)); margin: 2px 0; border-radius: 999px; }
.ccp-sv-canvas, .ccp-hue-canvas { display: block; width: 100%; height: 100%; box-shadow: inset 0 0 0 1px var(--ccp-edge); }
.ccp-sv-canvas { border-radius: calc(10px * var(--ccp-s)); }
.ccp-hue-canvas { border-radius: 999px; }
.ccp-sv:focus-visible, .ccp-hue:focus-visible { outline: 2px solid var(--ccp-accent); outline-offset: 2px; }
.ccp-sv-knob, .ccp-hue-knob {
    position: absolute;
    width: calc(18px * var(--ccp-s));
    height: calc(18px * var(--ccp-s));
    border-radius: 50%;
    border: 2px solid var(--color-ui-header-text);
    box-shadow: 0 0 0 1px rgba(var(--color-ui-overlay-rgb), 0.45), 0 2px calc(6px * var(--ccp-s)) rgba(var(--color-ui-overlay-rgb), 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.ccp-hue-knob { top: 50%; width: calc(20px * var(--ccp-s)); height: calc(20px * var(--ccp-s)); }
.ccp-mine-row { display: flex; align-items: center; flex-wrap: wrap; gap: calc(8px * var(--ccp-s)); }
.ccp-mine-preview {
    flex: none;
    width: calc(36px * var(--ccp-s));
    height: calc(36px * var(--ccp-s));
    border-radius: calc(10px * var(--ccp-s));
    box-shadow: inset 0 0 0 1px var(--ccp-edge);
}
.ccp-mine-hex {
    width: calc(104px * var(--ccp-s));
    height: calc(36px * var(--ccp-s));
    box-sizing: border-box;
    padding: 0 calc(10px * var(--ccp-s));
    border: 1px solid var(--ccp-line-strong);
    border-radius: calc(10px * var(--ccp-s));
    background: var(--ccp-card);
    color: var(--ui-text-primaryText);
    font: inherit;
    font-family: var(--font-mono);
    text-transform: uppercase;
}
.ccp-mine-hex.is-bad { border-color: var(--color-semantic-danger); }
.ccp-mine-hex:focus-visible { outline: 2px solid var(--ccp-accent); outline-offset: 1px; }
.ccp-mine-editor .ccp-primary { height: calc(36px * var(--ccp-s)); }

/* ---- footer ---- */
.ccp-error { padding: calc(10px * var(--ccp-s)) calc(24px * var(--ccp-s)); color: var(--color-semantic-danger); border-top: 1px solid var(--ccp-line); }
.ccp-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: calc(8px * var(--ccp-s));
    padding: calc(14px * var(--ccp-s)) calc(20px * var(--ccp-s));
    border-top: 1px solid var(--ccp-line);
    background: var(--ccp-card);
}
.ccp-preset { padding: 0 calc(14px * var(--ccp-s)) 0 calc(10px * var(--ccp-s)); color: var(--ui-text-secondaryText); }
.ccp-preset:hover { color: var(--ui-text-primaryText); }
.ccp-preset-dots { display: inline-flex; margin-right: 2px; }
.ccp-preset-dots i { width: calc(12px * var(--ccp-s)); height: calc(12px * var(--ccp-s)); border-radius: 50%; box-shadow: 0 0 0 2px var(--ccp-card); }
.ccp-preset-dots i:first-child { background: var(--color-green-4); }
.ccp-preset-dots i + i { margin-left: calc(-4px * var(--ccp-s)); background: var(--color-chart-red-1); }
.ccp-grow { flex: 1; }

@media (max-width: 640px) {
    .ccp-head { padding-left: calc(16px * var(--ccp-s)); }
    .ccp-preview { padding: 0 calc(16px * var(--ccp-s)) calc(14px * var(--ccp-s)); }
    .ccp-row-main { grid-template-columns: calc(32px * var(--ccp-s)) minmax(0, 1fr); padding: calc(14px * var(--ccp-s)) calc(14px * var(--ccp-s)) calc(14px * var(--ccp-s)) calc(16px * var(--ccp-s)); }
    .ccp-tile { width: calc(32px * var(--ccp-s)); height: calc(32px * var(--ccp-s)); border-radius: calc(9px * var(--ccp-s)); }
    .ccp-info > * { grid-column: 2; }
    .ccp-actions { grid-column: 2; grid-row: auto; margin-top: calc(10px * var(--ccp-s)); }
    .ccp-picker { margin: calc(-4px * var(--ccp-s)) calc(12px * var(--ccp-s)) calc(16px * var(--ccp-s)); padding: calc(12px * var(--ccp-s)); }
    .ccp-group { grid-template-columns: minmax(0, 1fr); row-gap: calc(4px * var(--ccp-s)); }
    .ccp-mine-edit-hint { padding-left: 0; }
    .ccp-foot { padding: calc(12px * var(--ccp-s)) calc(14px * var(--ccp-s)); }
}
