/* HTML Color Codes — стили только этой страницы */
.hc { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; padding: 16px; }
.hc-left, .hc-right { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hc-preview { height: 104px; border-radius: var(--r-ctl); border: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.hc-sample { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; font-size: 18px; font-weight: 600; }
.hc-sample small { font-size: 13px; font-weight: 500; opacity: .9; }
.hc-sample-w { color: #fff; }
.hc-sample-b { color: #000; }
.hc-sv {
  position: relative; height: 240px; border-radius: var(--r-ctl); cursor: crosshair; touch-action: none;
  background-image: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.hc-hue {
  position: relative; height: 24px; border-radius: 12px; cursor: pointer; touch-action: none;
  background: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
}
.hc-sv:focus-visible, .hc-hue:focus-visible { outline: none; box-shadow: var(--focus); }
.hc-sv-marker, .hc-hue-marker {
  position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .4); transform: translate(-50%, -50%); pointer-events: none;
}
.hc-sv-marker::after, .hc-hue-marker::after { content: ""; position: absolute; inset: -12px; } /* тач-зона 44 px */
.hc-hue-marker { top: 50%; width: 22px; height: 30px; border-radius: 8px; background: transparent; }

.hc-label, .hc-flabel { font-weight: 600; font-size: 14px; }
.hc-any { display: flex; gap: 8px; }
.hc-any input, .hc-field input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; font: 400 15px var(--mono); color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.hc-any input:focus, .hc-field input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.hc-any input.invalid, .hc-field input.invalid { border-color: var(--danger); }
.hc-any .btn { height: 40px; }
.hc-msg { font-size: 13px; min-height: 0; }
.hc-msg.error { color: var(--danger); }
.hc-msg.error::before { content: "⚠ "; }
.hc-msg.info { color: var(--muted); }
.hc-fields { display: flex; flex-direction: column; gap: 8px; }
.hc-field { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hc-field label { font-weight: 600; font-size: 14px; }
.hc-ferr { grid-column: 2 / 4; font-size: 13px; color: var(--danger); }
.hc-ferr:empty { display: none; }
.hc-nameval { display: flex; align-items: center; gap: 8px; min-width: 0; height: 40px; font-weight: 600; flex-wrap: wrap; }
.hc-sw { display: inline-block; width: 20px; height: 20px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .15); vertical-align: middle; flex: none; }
.hc-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-badge); background: var(--ok-tint); color: var(--teal-dark); }
.hc-badge[hidden] { display: none; }
.hc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }
.hc-case { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-left: auto; }
.hc-case label { font: 400 13px var(--mono); cursor: pointer; display: inline-flex; }
.hc-actions .btn svg { width: 16px; height: 16px; }

.hc-block { border-top: 1px solid var(--border); padding: 14px 16px; }
.hc-h { font-size: 16px; margin: 0 0 10px; }
.hc-contrast { display: flex; flex-direction: column; gap: 8px; }
.hc-crow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.hc-cswatch { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border); flex: none; }
.hc-cname { min-width: 240px; display: inline-flex; align-items: center; gap: 6px; }
input.hc-cmp { padding: 0; background: none; cursor: pointer; overflow: hidden; }
input.hc-cmp::-webkit-color-swatch-wrapper { padding: 0; }
input.hc-cmp::-webkit-color-swatch { border: 0; border-radius: 5px; }
input.hc-cmp::-moz-color-swatch { border: 0; border-radius: 5px; }
.hc-crow b { min-width: 64px; font-variant-numeric: tabular-nums; }
.hc-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.hc-b { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-badge); }
.hc-b.ok { background: var(--ok-tint); color: var(--teal-dark); }
.hc-b.no { background: var(--canvas); color: var(--muted); border: 1px solid var(--border); }
.hc-best { margin: 10px 0 0; color: var(--muted); }

.hc-row-label { margin: 4px 0 6px; }
.hc-swatches { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.hc-swb { position: relative; min-width: 0; }
.hc-swatch { display: block; width: 100%; height: 40px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .12); cursor: pointer; padding: 0; }
.hc-swb.cur .hc-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue); }
.hc-swhex { display: block; font: 400 11px var(--mono); color: var(--muted); text-align: center; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-swcopy {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px;
  border: 0; background: rgba(255, 255, 255, .85); color: #172033; cursor: pointer; opacity: 0; padding: 0;
}
.hc-swcopy svg { width: 14px; height: 14px; }
.hc-swb:hover .hc-swcopy, .hc-swcopy:focus-visible { opacity: 1; }
@media (hover: none) { .hc-swcopy { opacity: .9; } }
.hc-comp { display: flex; align-items: center; gap: 12px; }
.hc-comp .hc-swatches { grid-template-columns: 80px; margin: 0; }
.hc-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font: 400 12px var(--mono); cursor: pointer; }
.hc-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 50; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.hc-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* таблица имён */
.content .hc-names { max-width: none; }
.hc-tctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 8px; }
.hc-filter { max-width: 280px; height: 40px; }
.hc-tctl .segmented label { font-size: 14px; cursor: pointer; display: inline-flex; }
.hc-empty { color: var(--muted); }
.hc-fam h3 { margin: 22px 0 8px; font-size: 18px; }
.hc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hc-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.hc-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.hc-table tbody tr { cursor: pointer; }
.hc-table tbody tr:hover { background: var(--canvas); }
.hc-table tbody tr:focus-visible { outline: none; box-shadow: inset var(--focus); }
.hc-table .hc-sw { width: 44px; height: 22px; }
.hc-table .c-hex, .hc-table .c-rgb { font-family: var(--mono); font-size: 13px; cursor: copy; }
.hc-table .c-hex:hover, .hc-table .c-rgb:hover { color: var(--blue); text-decoration: underline; }
.hc-table tr[hidden], .hc-fam[hidden] { display: none; }

@media (max-width: 900px) {
  .hc { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .hc { padding: 12px; gap: 14px; }
  .hc-sv { height: 220px; }
  .hc-hue { height: 28px; border-radius: 14px; }
  .hc-any input, .hc-field input, .hc-any .btn { height: 44px; }
  .hc-field .btn span { display: none; }
  .hc-case { margin-left: 0; }
  .hc-block { padding: 12px; }
  .hc-cname { min-width: 0; }
  .hc-swatches { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .hc-swb { flex: 0 0 64px; }
  .hc-swatch { height: 44px; }
  .hc-filter { max-width: none; flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .hc-table .c-rgb { display: none; }
}
