/* Color · estilos propios */

.top-hint { margin: 0 auto; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.top-hint kbd { margin: 0 1px; }
.topbar .top-actions { margin-left: 0; }

.layout { display: grid; grid-template-columns: 310px minmax(0, 1fr) 330px; gap: 12px; max-width: 1680px; margin: 0 auto; align-items: start; }
.col { display: grid; gap: 12px; min-width: 0; }

/* Selector */
.swatch-big { display: block; width: 100%; height: 168px; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: copy; }
.swatch-fill { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px; width: 100%; height: 100%; padding: 14px 16px; text-align: left; transition: background-color .08s linear; }
#bigHex { font: 600 22px/1.1 var(--mono); letter-spacing: -.01em; }
#bigSub { font-size: 12px; opacity: .75; }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; }
.native { position: relative; overflow: hidden; }
.native input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.native-dot { width: 12px; height: 12px; border-radius: 50%; background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); }
.sl-head { display: flex; align-items: center; justify-content: space-between; }
.sliders { display: grid; gap: 12px; }
.sl { display: grid; grid-template-columns: 18px minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
.sl-l { font: 600 11.5px var(--mono); color: var(--text-2); }
.sl .track { position: relative; height: 16px; border-radius: 8px; }
.sl .track.alpha { background-size: 10px 10px; }
.sl input[type="range"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 16px; margin: 0;
  border-radius: 8px; background: var(--grad);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
  cursor: pointer;
}
.sl input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--thumb, #fff); border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 2px 5px rgba(0, 0, 0, .25);
}
.sl input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--thumb, #fff); border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 2px 5px rgba(0, 0, 0, .25);
}
.sl .input { height: 28px; padding: 0 6px; text-align: right; font-family: var(--mono); font-size: 12px; }

/* Formatos */
.formats .kv-row { align-items: center; }
.formats .kv-k { width: 110px; flex: none; }
.formats .kv-v { flex: 1; font-family: var(--mono); font-size: 12.5px; font-weight: 400; text-align: left; }
.formats .kv-row .ic { width: 14px; height: 14px; color: var(--text-3); opacity: 0; transition: opacity .1s; }
.formats .kv-row:hover .ic { opacity: 1; }

/* Armonías */
.harmonies { gap: 10px; }
.harm { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; }
.harm-l { font-size: 12.5px; color: var(--text-2); }
.harm-l small { display: block; color: var(--text-3); font-size: 11px; }
.sw-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sw {
  display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; text-align: left; min-width: 0;
}
.sw b { display: block; height: 34px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s var(--ease); }
.sw:hover b { transform: translateY(-1px); }
.sw.cur b { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 0 0 2px var(--panel), 0 0 0 3.5px var(--text-3); }
.sw span { font: 400 11px var(--mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Escala */
.scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.step { display: flex; flex-direction: column; justify-content: space-between; height: 92px; padding: 7px 6px; border: 0; text-align: left; cursor: pointer; min-width: 0; }
.step strong { font-size: 11.5px; font-weight: 600; }
.step span { font: 400 10px var(--mono); opacity: .8; overflow: hidden; text-overflow: ellipsis; }
.step.base { box-shadow: inset 0 -3px 0 currentColor; }
.export-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.code { position: relative; }
.code pre {
  margin: 0; max-height: 220px; overflow: auto; padding: 12px 14px;
  background: var(--sunken); border: 1px solid var(--border); border-radius: 8px;
  font: 400 12px/1.6 var(--mono); color: var(--text-2);
}
.code .btn { position: absolute; top: 8px; right: 8px; }

/* Contraste */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.color-in { position: relative; display: block; }
.color-in i { position: absolute; left: 8px; top: 8px; width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.color-in input { padding-left: 29px !important; }
.preview { padding: 16px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--border); }
.pv-big { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.pv-small { margin-top: 6px; font-size: 13px; line-height: 1.5; }
.ratio-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.badge { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 10px; border-radius: 8px; background: var(--sunken); font-size: 12px; }
.badge b { font-weight: 600; font-size: 11px; padding: 1px 7px; border-radius: 99px; }
.badge.ok b { background: var(--ok-soft); color: var(--ok); }
.badge.bad b { background: var(--danger-soft); color: var(--danger); }
.badge small { color: var(--text-3); }

/* Paleta */
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pchip { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pchip button.c { height: 44px; border: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); cursor: pointer; }
.pchip span { font: 400 10.5px var(--mono); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip .x {
  position: absolute; top: -6px; right: -6px; display: grid; place-items: center;
  width: 20px; height: 20px; padding: 0; border: 1px solid var(--border-2); border-radius: 50%;
  background: var(--panel); color: var(--text-2); opacity: 0; transition: opacity .1s;
}
.pchip .x .ic { width: 11px; height: 11px; }
.pchip:hover .x, .pchip .x:focus-visible { opacity: 1; }
.palette .empty { grid-column: 1 / -1; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 310px minmax(0, 1fr); }
  .layout > .col:last-child { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .top-hint { display: none; }
  .topbar .top-actions { margin-left: auto; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout > .col:last-child { grid-template-columns: minmax(0, 1fr); }
  .harm { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .export-row { grid-template-columns: minmax(0, 1fr); }
  .seg.block { flex-wrap: wrap; }
}

/* ───────── Herramientas extra ───────── */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 12px; max-width: 1680px; margin: 12px auto 0; align-items: start; }
.tools .card-b { display: grid; gap: 12px; }
.tools .row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.field.slim { display: grid; gap: 4px; min-width: 150px; }
.field.slim b { color: var(--text); font-variant-numeric: tabular-nums; }
.tsw { display: grid; place-items: end start; min-height: 54px; padding: 6px 7px; border: 0; border-radius: 9px; font: 600 11px var(--mono); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); cursor: pointer; transition: transform .12s; }
.tsw:hover { transform: translateY(-2px); }
.gen-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: 150px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.gcol { position: relative; display: grid; align-content: space-between; justify-items: center; padding: 10px 4px; }
.glock, .gcopy, .ghex { border: 0; background: none; color: inherit; cursor: pointer; }
.glock { width: 34px; height: 34px; border-radius: 50%; font-size: 15px; opacity: .55; }
.glock[aria-pressed="true"] { opacity: 1; background: rgba(0, 0, 0, .12); }
.gcol:hover .glock { opacity: 1; }
.ghex { font: 600 12px var(--mono); padding: 4px 6px; border-radius: 6px; }
.ghex:hover { background: rgba(0, 0, 0, .1); }
.gcopy { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; opacity: .6; }
.gcopy .ic { width: 15px; height: 15px; }
.gcopy:hover { opacity: 1; background: rgba(0, 0, 0, .1); }
.ex-drop { position: relative; display: grid; place-items: center; min-height: 130px; border: 1.5px dashed var(--border-2); border-radius: 12px; overflow: hidden; }
.ex-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.ex-drop img { width: 100%; max-height: 220px; object-fit: contain; }
.ex-drop.has { border-style: solid; }
.ex-drop.has .ex-msg { position: absolute; right: 8px; bottom: 8px; }
.ex-drop.has .ex-msg .mouse-only { display: none; }
.ex-msg { color: var(--text-2); font-size: 13px; }
.ex-row, .mx-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.exc { display: grid; gap: 2px; text-align: center; }
.exc small { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.mx-ends { display: flex; align-items: center; gap: 8px; }
.mx-dot { width: 34px; height: 34px; flex: none; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.mx-arrow { color: var(--text-3); }
.mx-ends .color-in { flex: 1; }
.matrix { overflow: auto; }
.mx { border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.mx th { padding: 2px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.mx th i { display: block; width: 26px; height: 26px; margin: auto; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.mx td { width: 58px; height: 46px; border-radius: 8px; text-align: center; vertical-align: middle; }
.mx-c b { display: block; font-size: 15px; line-height: 1.1; }
.mx-c small { font-size: 10px; opacity: .9; }
.mx-c.no { opacity: .5; }
.mx-same, .mx-no { background: var(--sunken); }
.cvd { display: grid; gap: 8px; }
.cvd-row { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.cvd-sw { display: flex; height: 34px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.cvd-sw i { flex: 1; }
@media (max-width: 700px) {
  .gen-row { height: 120px; }
  .cvd-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tools .row .field.slim { flex: 1 1 100%; }
}
:root[data-input="touch"] .glock { opacity: 1; }
:root[data-input="touch"] .tsw { min-height: 60px; }
