*, *::before, *::after { box-sizing: border-box; }


.rgbptc-wrap {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #fff;
  margin:50px auto;
  border-radius: 20px;
  padding: 28px 32px 32px;
  max-width: 780px;
  width: 100%;
  box-shadow: 0 4px 32px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
}

.rgbptc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.rgbptc-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9c9690;
  margin: 0;
}

.rgbptc-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rgbptc-variant-toggle {
  display: flex;
  background: #eeece9;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.rgbptc-variant-btn {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #9c9690;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  letter-spacing: 0.03em;
}

.rgbptc-variant-btn.rgbptc-variant-active {
  background: #fff;
  color: #2c2a27;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.rgbptc-reset-btn {
  border: 1.5px solid #e0dcd7;
  background: transparent;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #9c9690;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rgbptc-reset-btn:hover {
  border-color: #b5aea6;
  color: #2c2a27;
  background: #f4f2ee;
}

.rgbptc-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
}

@media (max-width: 580px) {
  .rgbptc-grid {
    grid-template-columns: 1fr;
  }
  .rgbptc-wrap {
    padding: 20px;
  }
}

.rgbptc-input-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rgbptc-color-preview-box {
  border-radius: 12px;
  height: 140px;
  width: 100%;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 16px rgba(0,0,0,0.14);
}

.rgbptc-color-preview-box:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.rgbptc-color-picker-input {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: none;
  padding: 0;
}

.rgbptc-preview-label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  pointer-events: none;
}

.rgbptc-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e8e6e2;
  border-radius: 9px;
  padding: 0 10px;
  height: 40px;
  transition: border-color 0.15s;
}

.rgbptc-hex-row:focus-within {
  border-color: #b5aea6;
}

.rgbptc-hex-row.hex-error {
  border-color: #ef4444;
}

.rgbptc-hex-hash {
  font-size: 14px;
  color: #9c9690;
  font-weight: 500;
  user-select: none;
}

.rgbptc-hex-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  background: transparent;
  color: #2c2a27;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 0;
}

.rgbptc-hex-input::placeholder {
  color: #c5c0ba;
  font-weight: 400;
}

.rgbptc-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rgbptc-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rgbptc-channel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  width: 12px;
  flex-shrink: 0;
}

.rgbptc-channel-label.rgbptc-r { color: #dc3545; }
.rgbptc-channel-label.rgbptc-g { color: #28a745; }
.rgbptc-channel-label.rgbptc-b { color: #1a73e8; }

.rgbptc-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  min-width: 0;
}

.rgbptc-slider-r { background: linear-gradient(to right, #1a1a1a, #ff3333); }
.rgbptc-slider-g { background: linear-gradient(to right, #1a1a1a, #33cc33); }
.rgbptc-slider-b { background: linear-gradient(to right, #1a1a1a, #3366ff); }

.rgbptc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d0ccc7;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: border-color 0.15s;
}

.rgbptc-slider::-webkit-slider-thumb:hover {
  border-color: #9c9690;
}

.rgbptc-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d0ccc7;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.rgbptc-channel-val {
  width: 38px;
  text-align: right;
  background: #fff;
  border: 1.5px solid #e8e6e2;
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  color: #2c2a27;
  outline: none;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.rgbptc-channel-val:focus {
  border-color: #b5aea6;
}

.rgbptc-result-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.rgbptc-result-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #e8e6e2;
  overflow: hidden;
  animation: rgbptc-fadein 0.25s ease;
}

.rgbptc-result-card-top {
  display: flex;
  gap: 0;
}

.rgbptc-result-swatch {
  width: 80px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  min-height: 80px;
}

.rgbptc-result-swatch-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.5;
}

.rgbptc-result-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}

.rgbptc-rank-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b5aea6;
  margin-bottom: 3px;
}

.rgbptc-rank-badge.rgbptc-rank-1 {
  color: #c9a227;
}

.rgbptc-pantone-name {
  font-size: 14px;
  font-weight: 700;
  color: #2c2a27;
  margin: 0 0 2px 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rgbptc-pantone-hex {
  font-size: 11px;
  font-weight: 500;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  color: #9c9690;
  letter-spacing: 0.04em;
  margin: 0 0 8px 0;
}

.rgbptc-accuracy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rgbptc-accuracy-bar-bg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #f0ede9;
  overflow: hidden;
}

.rgbptc-accuracy-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rgbptc-accuracy-text {
  font-size: 11px;
  font-weight: 600;
  color: #6b6762;
  white-space: nowrap;
}

.rgbptc-delta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.rgbptc-delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f4f2ee;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #6b6762;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

.rgbptc-delta-badge span {
  color: #2c2a27;
}

.rgbptc-delta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #6b6762;
}

.rgbptc-delta-label.rgbptc-delta-great { color: #22c55e; }
.rgbptc-delta-label.rgbptc-delta-good  { color: #84cc16; }
.rgbptc-delta-label.rgbptc-delta-ok    { color: #f59e0b; }
.rgbptc-delta-label.rgbptc-delta-poor  { color: #ef4444; }

.rgbptc-more-card {
  background: #fff;
  border-radius: 10px;
  border: 1.5px solid #e8e6e2;
  overflow: hidden;
  animation: rgbptc-fadein 0.25s ease;
}

.rgbptc-more-toggle {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #6b6762;
  transition: background 0.12s;
}

.rgbptc-more-toggle:hover {
  background: #faf9f7;
}

.rgbptc-more-toggle svg {
  transition: transform 0.2s ease;
}

.rgbptc-more-toggle.rgbptc-more-open svg {
  transform: rotate(180deg);
}

.rgbptc-more-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #f0ede9;
}

.rgbptc-more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid #f4f2ee;
  transition: background 0.1s;
}

.rgbptc-more-item:last-child {
  border-bottom: none;
}

.rgbptc-more-item:hover {
  background: #faf9f7;
}

.rgbptc-more-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.rgbptc-more-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #2c2a27;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.rgbptc-more-hex {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  color: #9c9690;
}

.rgbptc-more-delta {
  font-size: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  color: #b5aea6;
  white-space: nowrap;
}

.rgbptc-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.rgbptc-compare-chip {
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rgbptc-compare-chip-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.5;
}

.rgbptc-compare-chip-val {
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  letter-spacing: 0.03em;
}

.rgbptc-placeholder-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px dashed #e0dcd7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
  min-height: 160px;
}

.rgbptc-placeholder-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f4f2ee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9c9690;
}

.rgbptc-placeholder-text {
  font-size: 12px;
  font-weight: 500;
  color: #b5aea6;
  line-height: 1.5;
  margin: 0;
}

@keyframes rgbptc-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
