.color-section {
  margin: 30px 0;
}

.color-section h2 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #2c3e50;
}

.color-button, .color-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 2px solid;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 162px;
  gap: 8px;
}

.color-button {
  background-color: #1376B3;
  color: #ffffff;
  border: 2px solid #d1d5db;
}

.color-button:hover {
  background-color: #005583;
  border-color: #1f2937;
}

.color-button-secondary {
  background-color: #ffffff;
  color: #333333;
  border: 2px solid #d1d5db;
}

.color-button-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.copy-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.picker-row {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.picker-control { display: flex; flex-direction: column; align-items: center; }

.color-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
  text-align: center;
}

.color-input {
  width: 200px;
  height: 56px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.picker-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 24px; }
.picker-actions .color-button,
.picker-actions .color-button-secondary {
  flex: 1;
  min-width: 162px;
  max-width: 200px;
}
@media (max-width: 600px) {
  .picker-actions .color-button,
  .picker-actions .color-button-secondary {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* New layout for custom picker */
.cp-left { display: grid; gap: 12px; }
.cp-top { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
@media (max-width: 900px) { .cp-top { grid-template-columns: 1fr; } }

.cp-preview { display: grid; gap: 4px; }

.sv-panel {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  height: 200px;
  border: 2px solid #d1d5db;
  background: red;
}

.sv-panel::before { /* saturation */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0));
}

.sv-panel::after { /* value */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, #000, rgba(0,0,0,0));
}

.sv-cursor {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6);
  border-radius: 50%; transform: translate(-9px, -9px);
  pointer-events: none;
}

.hue-row { display: flex; align-items: center; }
.hue-bar {
  position: relative; height: 16px; border-radius: 8px; flex: 1;
  border: 2px solid #d1d5db; overflow: hidden;
  background: linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);
}
.hue-cursor { position: absolute; top: 50%; transform: translate(-7px, -50%); width: 14px; height: 14px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); border-radius: 50%; pointer-events: none; }

.options-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
@media (max-width: 980px) { .options-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px) { .options-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .options-grid { grid-template-columns: 1fr; } }

.io-item { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.color-text-input {
  width: 100%;
  font-family: Consolas, 'Courier New', monospace;
  padding: 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  box-sizing: border-box;
  text-align: center;
}

.color-text-input:focus { outline: none; border-color: #1376B3; }

@media (max-width: 560px) {
  .color-text-input {
    font-size: 16px;
  }
}

.output-display {
  width: 100%;
  font-family: Consolas, 'Courier New', monospace;
  padding: 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  box-sizing: border-box;
  text-align: center;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-row { margin: 24px 0; display: none; }

.color-preview-box {
  border: 2px solid #d1d5db;
  border-radius: 8px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-text { font-weight: 700; font-size: 14px; line-height: 1.2; }

.contrast-note { font-size: 10px; color: #6b7280; text-align: center; margin-top: 0; }

@media (max-width: 900px) { .sv-panel { height: 180px; } }
@media (max-width: 600px) { .sv-panel { height: 160px; } }
@media (max-width: 400px) { .sv-panel { height: 140px; } }

/* Desktop: match preview height to SV panel height */
@media (min-width: 901px) {
  .color-preview-box { height: 200px; }
  .cp-preview { gap: 12px; }
}

.swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.swatch {
  height: 56px;
  border-radius: 8px;
  border: 2px solid #d1d5db;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.swatch:hover { filter: brightness(0.95); }

.with-button { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.input-with-copy { position: relative; }
.input-with-copy .color-text-input { padding-right: 16px; }
.input-with-copy .copy-inline-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; z-index: 2; }

.copy-inline-btn {
  background: transparent;
  border: none;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity .18s ease;
  padding: 0; margin: 0;
}
.copy-inline-btn:hover { opacity: 0.8; }

/* Override success state for inline buttons */
.copy-inline-btn.disabled[style*="background-color: rgb(76, 175, 80)"] {
  background-color: transparent !important;
  border-color: transparent !important;
}


