/* Floating halftone settings panel (loaded by /js/halftone/panel.js). */

.ht-panel {
  position: fixed;
  top: 72px; right: 24px;
  width: 300px;
  background: #f4efe3;
  color: #141318;
  border: 1px solid rgba(20,19,24,.12);
  border-radius: 4px;
  padding: 16px 18px;
  z-index: 99998;
  font: 13px/1.4 ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.ht-title {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(20,19,24,.08);
  cursor: move; user-select: none;
}
.ht-title .ht-close { cursor: pointer; }
.ht-title strong { font-size: 14px; }
.ht-scope {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  opacity: .6; margin-left: auto;
}
.ht-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px; color: inherit;
}
.ht-row { margin-bottom: 10px; }
.ht-row-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; margin-bottom: 4px;
}
.ht-val {
  display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums; opacity: .75;
}
.ht-row input[type=range] { width: 100%; accent-color: #d83a7a; }
.ht-pin {
  width: 11px; height: 11px; padding: 0;
  border: 1.5px solid rgba(20,19,24,.3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}
.ht-pin:hover { border-color: rgba(20,19,24,.55); }
.ht-pin[aria-pressed="true"] {
  background: #d83a7a; border-color: #d83a7a;
  box-shadow: 0 0 0 2px rgba(216,58,122,.15);
}
.ht-section h3 {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  opacity: .55; margin: 16px 0 6px; font-weight: 500;
}
.ht-presets { display: flex; gap: 6px; }
.ht-preset {
  flex: 1; padding: 6px 4px; font-size: 11px;
  border: 1px solid rgba(20,19,24,.12); background: transparent;
  border-radius: 3px; cursor: pointer; color: inherit;
  text-transform: capitalize;
}
.ht-preset[aria-pressed="true"] {
  background: #141318; color: #f4efe3; border-color: #141318;
}
.ht-footer { display: flex; gap: 6px; margin-top: 14px; }
.ht-btn {
  flex: 1; padding: 6px 10px; font-size: 11.5px;
  border: 1px solid rgba(20,19,24,.18); background: transparent;
  border-radius: 3px; cursor: pointer; color: inherit;
}
.ht-btn:hover { background: rgba(0,0,0,.04); }

.halftone-canvas { display: block; image-rendering: auto; }

/* Global on/off — bigger, full-width button at the top of the panel. */
.ht-section--toggle { margin-top: 0; margin-bottom: 12px; }
.ht-global-toggle {
  display: block; width: 100%;
  padding: 8px 10px; font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid rgba(20,19,24,.18);
  background: transparent; color: inherit; cursor: pointer;
  border-radius: 4px;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.ht-global-toggle[aria-pressed="true"] {
  background: #d83a7a; color: #fff; border-color: #d83a7a;
}

/* CMYK channel toggles — 4 squarish swatches, one per ink. */
.ht-cmyk-row { display: flex; gap: 6px; }
.ht-cmyk {
  flex: 1; padding: 8px 0;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  border: 1px solid rgba(20,19,24,.2);
  background: transparent; color: inherit; cursor: pointer;
  border-radius: 3px;
  transition: background 120ms, color 120ms, border-color 120ms, opacity 120ms;
}
.ht-cmyk[aria-pressed="false"] { opacity: .35; }
.ht-cmyk[aria-pressed="true"] {
  background: var(--cmyk-color, #141318);
  color: #fff;
  border-color: var(--cmyk-color, #141318);
}
/* Yellow needs dark text for legibility against the swatch. */
.ht-cmyk[aria-pressed="true"][title^="Y"] { color: #141318; }
