/* laogamut.css — laoGamut-specific styles. Tokens, buttons, bar and fields come from lao.css. */

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-left, 0px)) 80px;
}
.wrap.layout-2c,
.wrap.layout-c2 {
  max-width: 1600px;
  display: grid;
  --split: 50;
  grid-template-columns: calc((100% - 14px) * var(--split) / 100) 14px calc(
      (100% - 14px) * (100 - var(--split)) / 100
    );
  align-items: start;
}
/* a grid track's default minimum is its content's min-content width: without this the Valspar grid
   would refuse to shrink with its column and shove the other column out of the layout */
.wrap.layout-2c #gamut-section,
.wrap.layout-2c #valspar-section,
.wrap.layout-c2 #gamut-section,
.wrap.layout-c2 #valspar-section {
  min-width: 0;
}
.wrap.layout-2c #gamut-section {
  order: 1;
  padding-right: 20px;
}
.wrap.layout-2c #valspar-section {
  order: 3;
  padding-left: 20px;
}
.wrap.layout-c2 #gamut-section {
  order: 3;
  padding-left: 20px;
}
.wrap.layout-c2 #valspar-section {
  order: 1;
  padding-right: 20px;
}
.wrap.layout-2c footer,
.wrap.layout-c2 footer {
  grid-column: 1 / -1;
  order: 4;
}
.col-resizer {
  display: none;
  order: 2;
  align-self: stretch;
  width: 14px;
}
.wrap.layout-2c .col-resizer,
.wrap.layout-c2 .col-resizer {
  display: block;
}
@media (max-width: 860px) {
  .wrap.layout-2c,
  .wrap.layout-c2 {
    display: block;
    max-width: 920px;
  }
  .wrap.layout-2c #gamut-section,
  .wrap.layout-2c #valspar-section,
  .wrap.layout-c2 #gamut-section,
  .wrap.layout-c2 #valspar-section {
    padding-left: 0;
    padding-right: 0;
  }
  .wrap.layout-2c .col-resizer,
  .wrap.layout-c2 .col-resizer {
    display: none;
  }
}
section + section {
  margin-top: 28px;
}
.wrap.layout-2c section + section,
.wrap.layout-c2 section + section {
  margin-top: 0;
}
h2 {
  font: 600 14px var(--f-cond);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* ---------- 3D viewer ---------- */
.viewer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
}
.canvas-wrap {
  position: relative;
}
#gamutCanvas {
  display: block;
  width: 100%;
  height: 480px;
  border-radius: 8px;
  touch-action: none;
  cursor: grab;
  background: var(--bg);
}
#gamutCanvas:active {
  cursor: grabbing;
}
#gamutCanvas:focus-visible {
  outline-offset: -2px;
}
.viewer-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.viewer-controls button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--raise);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer-controls button:hover {
  border-color: var(--ink);
}
.viewer-controls #rotateBtn {
  font-size: 11px;
}
#probeInfo {
  font-size: 13px;
  padding: 0 14px 12px;
  min-height: 18px;
}
#probeInfo b {
  font-weight: 600;
}
.legend-hint {
  padding: 0 14px;
  margin-top: -4px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  cursor: pointer;
}
.legend-item:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.legend-item[aria-pressed='true'] {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--accent-soft);
}
.legend-item.editing {
  box-shadow: 0 0 0 2px var(--ink);
}
.lock-toggle {
  border-color: var(--line);
  color: var(--ink);
  font-weight: 500;
}
.lock-toggle input[type='checkbox'] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.swatch-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid var(--shadow);
  flex: none;
}

/* markers for colours the screen or the pigments cannot reproduce: a small grey circle (outside the
   screen gamut) or square (outside the painter gamut) on the swatch */
.oog,
.hull-out {
  position: relative;
}
body.no-oog-disp .oog::after {
  display: none;
}
body.no-oog-gamut .hull-out::before {
  display: none;
}
.hull-out::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  min-width: 3px;
  max-width: 10px;
  transform: translate(-50%, -50%);
  background: #d4d4d4;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.hull-out.oog::after {
  width: 13%;
  min-width: 2px;
  max-width: 5px;
  background: #6b6b6b;
  box-shadow: none;
}
body.no-oog-gamut .hull-out.oog::after {
  width: 26%;
  min-width: 3px;
  max-width: 10px;
  background: #d4d4d4;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3);
}
.oog::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  min-width: 3px;
  max-width: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #d4d4d4;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* ---------- blend between two pigments ---------- */
.mixer-panel {
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
}
.mixer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
.mixer-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.mixer-slider-row input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}
#stepsValue {
  font: 12px var(--f-mono);
  color: var(--ink);
  min-width: 1.4em;
}
.mix-swatches {
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
}
.mix-swatch {
  flex: 1 0 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid var(--shadow);
}
.mix-swatch.pickable {
  cursor: pointer;
}
.mix-swatch.pickable:hover,
.mix-swatch.pickable.editing {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.mix-swatch.endpoint {
  flex: 0 0 60px;
  position: relative;
}
.mix-swatch.endpoint span {
  position: absolute;
  bottom: 3px;
  left: 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  font-weight: 600;
}

/* ---------- L C H editor ---------- */
.lch-panel,
.basket-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.lch-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}
.lch-panel-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.lch-sliders {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.lch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lch-label {
  width: 16px;
  font: 600 14px var(--f-mono);
  color: var(--muted);
  flex: none;
}
.lch-row input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 12px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--shadow);
}
.lch-row input[type='range']::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: transparent;
}
.lch-row input[type='range']::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: transparent;
  border: none;
}
.lch-row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1c1c1c;
  box-shadow: 0 1px 3px var(--shadow);
}
.lch-row input[type='range']::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #1c1c1c;
  box-shadow: 0 1px 3px var(--shadow);
}
.lch-row input[type='number'] {
  width: 72px;
  flex: none;
  font: 13px var(--f-mono);
  padding: 4px 7px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: var(--raise);
  color: var(--ink);
}
.lch-preview {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  border: 1px solid var(--shadow);
  flex: none;
}
.lch-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mode-btn {
  min-width: 70px;
  justify-content: center;
}
.export-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.export-panel .lao-hint {
  margin: 0 0 8px;
}
.export-panel code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font: 12px var(--f-mono);
}
#exportOutput,
#basketExportOutput {
  width: 100%;
  min-height: 220px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 10px;
}
#basketExportOutput {
  min-height: 120px;
}

/* ---------- colour basket ---------- */
.basket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.basket-head h2 {
  margin: 0;
}
.basket-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.selected-preview {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid var(--shadow);
  background: var(--bg);
  flex: none;
}
.basket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.basket-footer {
  margin-top: 14px;
}
.basket-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.basket-item.hidden-color {
  opacity: 0.45;
}
.basket-item.editing {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.basket-reorder {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.basket-reorder button,
.basket-actions button {
  width: 22px;
  height: 18px;
  font-size: 10px;
  line-height: 1;
  border: 1px solid var(--line-strong);
  background: var(--raise);
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.basket-reorder button:disabled {
  opacity: 0.3;
  cursor: default;
}
.basket-edit-trigger {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: none;
  padding: 4px;
  margin: -4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.basket-edit-trigger:hover {
  background: var(--bg);
}
.basket-swatch {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  border: 1px solid var(--shadow);
  flex: none;
  display: block;
}
.basket-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.basket-info .bname {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bname-input {
  font: 500 13px var(--f-ui);
  color: var(--ink);
  background: var(--raise);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 1px 5px;
  width: 100%;
  max-width: 220px;
}
.basket-info .blch {
  font: 11.5px var(--f-mono);
  color: var(--muted);
}
.basket-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.basket-actions button {
  width: 52px;
}

/* ---------- Valspar ---------- */
.selected-color-card {
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  min-height: 130px;
}
.selected-color-card .chip {
  flex: 1 1 62%;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--shadow);
}
.selected-color-card .info {
  flex: 1 1 38%;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.selected-color-card .cname {
  font-size: 16px;
  font-weight: 600;
}
.selected-color-card .cmeta {
  font-size: 12.5px;
  color: var(--muted);
}
.selected-color-card .lao-link {
  align-self: flex-start;
  margin-top: 6px;
}
.lao-btn .arrow {
  transition: transform 0.2s ease;
  font-size: 11px;
}
.lao-btn[aria-expanded='true'] .arrow {
  transform: rotate(180deg);
}
#valsparPanel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.panel-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
#searchInput {
  flex: 1;
}
#matchCount {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.panel-note {
  margin: 0;
  padding: 8px 14px 10px;
  font-size: 12px;
  color: var(--muted);
}
.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  flex: none;
  font: 12.5px var(--f-ui);
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.tab-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.tab-btn[aria-selected='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
#colorGrid {
  max-height: 560px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
}
.category-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg);
  font: 600 13px var(--f-cond);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
}
.category-head .cat-count {
  font: 400 12px var(--f-ui);
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.color-cell {
  background: var(--surface);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  border: none;
  text-align: left;
}
.color-cell:hover {
  background: var(--bg);
}
.color-cell:focus-visible {
  outline-offset: -2px;
}
.color-cell .chip {
  width: 100%;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--shadow);
}
.color-cell .cname {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}
.color-cell .cmeta {
  font-size: 11px;
  color: var(--muted);
}
footer {
  margin-top: 40px;
  font-size: 12.5px;
  color: var(--muted);
}

.canvas-wrap.full{position:fixed;inset:0;z-index:1000;background:var(--bg,#fff)}
.canvas-wrap.full #gamutCanvas{height:100vh!important;height:100dvh!important;border-radius:0}

/* selected states: soft grey for a current state, outline for an action (see lao.css --sel-*) */
.tab-btn[aria-selected='true'] { background: var(--sel-bg); color: var(--ink); border-color: var(--sel-line); font-weight: 500; }
