/* Colour tools (js/color.js). Uses the tokens from app.css. */
/* A section with a rich view (.colrich) hides its plain rows/text, which stay for copy, pipelines and Node. */
.secbody:has(> .colrich) > .kv, .secbody:has(> .colrich) > pre.out-text { display: none; }
.colbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.colbar label { color: var(--muted); font-size: 12px; }
.colbar select, .colpanel select, .colname, .colpname { height: 28px; border: 1px solid var(--border2); background: var(--panel2); border-radius: 6px; padding: 0 8px; min-width: 0; }
.colpanel .btn.mini, .coltile .btn.mini, .colfmt .btn.mini, .coltbl .btn.mini { height: 24px; padding: 0 7px; font-size: 12px; }
.colcount, .colsub { color: var(--faint); font-size: 11.5px; }
.colcount { margin-left: auto; }
.colempty { color: var(--faint); padding: 14px 4px; }
/* swatch backgrounds sit on a checkerboard so transparency shows */
.colchip, .colbig, .colsq { --chk: linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%), linear-gradient(45deg, #ccc 25%, #fff 25%, #fff 75%, #ccc 75%);
  background: linear-gradient(var(--c), var(--c)), var(--chk); background-size: auto, 12px 12px, 12px 12px; background-position: 0 0, 0 0, 6px 6px; }
.colprev { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.colbig { width: 220px; max-width: 100%; height: 120px; border-radius: 10px; border: 1px solid var(--border); display: flex; align-items: flex-end; }
.colbig span, .coltile .colhex { font: 11.5px ui-monospace, Menlo, monospace; }
.colbig span { background: rgba(255,255,255,.85); color: #111; border-radius: 0 6px 0 9px; padding: 2px 7px; }
.colprevside { flex: 1 1 260px; min-width: 0; }
.colprevside .colbar:first-child { margin-top: 0; }
.colfmts { display: grid; gap: 2px; }
.colfmt { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 2px 4px; border-radius: 6px; }
.colfmt:hover { background: var(--hover); }
.colfmt .k { color: var(--muted); font-size: 12px; }
.colfmt code { overflow-wrap: anywhere; }
.colsw { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.coltile { width: 104px; display: flex; flex-direction: column; gap: 3px; }
.colchip { width: 100%; height: 56px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; padding: 0; }
.colchip:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.coltl { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.coltl > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coltile .btn.mini { align-self: flex-start; }
.colcts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.colct { width: 118px; height: 64px; border-radius: 8px; border: 1px solid var(--border); padding: 6px 9px; display: flex; flex-direction: column; justify-content: center; }
.colct b { font-size: 20px; line-height: 1.1; } .colct span { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colsq { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); vertical-align: middle; }
.coltbl td { white-space: nowrap; }
.colgrad { height: 200px; border-radius: 10px; border: 1px solid var(--border); }
.colpanel { border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px 8px; background: var(--panel); }
.colpname { width: 180px; }
.collist { display: flex; flex-direction: column; gap: 3px; }
.colrow { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; border: 1px solid transparent; }
.colrow:hover { background: var(--hover); }
.colrow.over { border-color: var(--accent); }
.colrow.dragging { opacity: .5; }
.colrow .colchip { width: 34px; height: 26px; flex: none; border-radius: 6px; }
.colrow .colname { flex: 0 1 180px; height: 26px; }
.colrow .colval { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.colrow .colmove { height: 24px; font-size: 12px; max-width: 120px; }
.colgrip { cursor: grab; color: var(--faint); font-size: 11px; letter-spacing: -2px; user-select: none; }
.colexport { width: 100%; min-height: 110px; }
.colimp { margin-top: 8px; } .colimp summary, .colsaved summary { cursor: pointer; color: var(--muted); }
.colimp textarea { width: 100%; margin-top: 6px; }
.colsaved { margin-top: 10px; } .colsaved .colpanel { margin-top: 6px; }
@media (max-width: 640px) {
  .colfmt { grid-template-columns: 84px minmax(0, 1fr) auto; }
  .colrow { flex-wrap: wrap; } .colrow .colname { flex: 1 1 120px; } .colrow .colval { flex-basis: 100%; order: 9; }
  .coltile { width: calc(33.3% - 6px); }
  .colpname { width: 100%; }
}
