/* Shared styles for the utility tools:
   converter, eyedropper, shades, harmony, duotone */

.tool-wrap { margin-bottom: 48px; }

/* --- Color input row (converter / shades / harmony / duotone) --- */
.ci-row {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.ci-row input[type="color"] {
  width: 220px; height: 112px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: none; cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.ci-row input[type="color"]:hover { border-color: var(--accent); transform: scale(1.01); }
.ci-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.ci-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
.ci-row input[type="text"] {
  flex: 1; min-width: 180px; max-width: 320px;
  padding: 13px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px; font-weight: 600;
}
.ci-row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.ci-row input[type="text"].invalid { border-color: #e5484d; }
.ci-row .ci-hint { color: var(--text-muted); font-size: 13px; }

/* --- Converter output rows --- */
.cv-rows { display: grid; gap: 10px; }
.cv-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
  box-shadow: var(--shadow);
}
.cv-row .cv-fmt { font-size: 12px; font-weight: 700; letter-spacing: .07em; color: var(--text-muted); width: 64px; }
.cv-row code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 600; flex: 1; word-break: break-all; }
.cv-row .btn { padding: 6px 13px; font-size: 13px; flex-shrink: 0; }

/* --- Eyedropper --- */
.ed-stage { display: grid; grid-template-columns: 1fr 240px; gap: 18px; align-items: start; }
.ed-canvas-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
#ed-canvas { max-width: 100%; height: auto; display: block; border-radius: 8px; cursor: crosshair; }
.ed-side { display: flex; flex-direction: column; gap: 14px; }
.ed-loupe-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  text-align: center;
}
#ed-loupe { width: 132px; height: 132px; border-radius: 10px; border: 1px solid var(--border); image-rendering: pixelated; }
.ed-current { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 15px; margin: 8px 0 0; }
.ed-picked {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.ed-picked h3 { margin: 0 0 10px; font-size: 14px; }
.ed-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow: auto; }
.ed-item { display: flex; align-items: center; gap: 10px; }
.ed-item .ed-chip { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); flex-shrink: 0; }
.ed-item code { font-size: 13px; font-weight: 600; flex: 1; }
.ed-item .btn { padding: 3px 9px; font-size: 11px; }
.ed-empty { color: var(--text-muted); font-size: 13px; margin: 0; }

/* --- Shades --- */
.sh-scale { display: grid; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 16px; }
.sh-step { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; cursor: pointer; border: none; width: 100%; font: inherit; text-align: left; }
.sh-step .sh-name { font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.sh-step code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 600; }

/* --- Harmony --- */
.hm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.hm-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.hm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.hm-head .btn { padding: 3px 10px; font-size: 11px; }
.hm-group h3 { margin: 0; font-size: 15px; }
.hm-group .hm-sub { color: var(--text-muted); font-size: 12px; margin: 0 0 12px; }
.hm-swatches { display: flex; border-radius: 10px; overflow: hidden; height: 76px; }
.hm-swatches button {
  flex: 1; border: none; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center; padding: 6px;
}
.hm-swatches code {
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; font-weight: 600;
  padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.35); color: #fff;
}
.hm-swatches button.light code { background: rgba(255,255,255,.6); color: #111; }

/* --- Duotone --- */
.dt-controls { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.dt-color { display: flex; flex-direction: column; gap: 8px; }
.dt-color input[type="color"] {
  width: 220px; height: 112px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px; background: none; cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.dt-color input[type="color"]:hover { border-color: var(--accent); transform: scale(1.01); }
.dt-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.dt-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
.dt-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.dt-preset { width: 52px; height: 34px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; padding: 0; overflow: hidden; display: flex; }
.dt-preset i { flex: 1; }
.dt-result {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-top: 18px;
}
#dt-canvas { max-width: 100%; height: auto; display: block; border-radius: 8px; margin: 0 auto; }
.dt-actions { margin-top: 12px; text-align: right; }

@media (max-width: 700px) {
  .ed-stage { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .ci-row input[type="color"], .dt-color input[type="color"] { width: 100%; height: 96px; }
}

/* Recent colors chips (converter) */
.color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.color-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 5px 10px 5px 5px; cursor: pointer; font: inherit; color: var(--text);
  transition: border-color .12s;
}
.color-chip:hover { border-color: var(--accent); }
.color-chip .chip-swatch { width: 30px; height: 26px; border-radius: 6px; border: 1px solid var(--border); }
.color-chip code { font-size: 12px; font-weight: 600; }
.cv-recent {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  margin-top: 18px;
}
.cv-recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cv-recent-head .btn { padding: 3px 10px; font-size: 12px; }
.cv-recent-empty { font-size: 13px; margin: 0; }
