/* Contrast Checker — contrast.css */

.cc-tool { margin-bottom: 48px; }

/* Big, obvious color pickers: the whole swatch is the button */
.cc-pickers {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}
.cc-swatchbox {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.cc-swatchbox input[type="color"] {
  width: 100%; height: 150px;
  padding: 0; border: 1px solid var(--border); border-radius: 10px;
  background: none; cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.cc-swatchbox input[type="color"]:hover { border-color: var(--accent); transform: scale(1.01); }
.cc-swatchbox input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.cc-swatchbox input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
.cc-swatchbox input[type="text"] {
  width: 100%; padding: 12px 10px; text-align: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px; font-weight: 600; letter-spacing: .03em;
}
.cc-swatchbox input[type="text"]:focus { outline: none; border-color: var(--accent); }
.cc-swatchbox input[type="text"].invalid { border-color: #e5484d; }

.cc-swap-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.cc-swap-col .btn { font-size: 15px; padding: 11px 14px; width: 100%; white-space: nowrap; }

/* Ratio readout */
.cc-ratio {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin-bottom: 18px;
}
.cc-ratio-label { color: var(--text-muted); font-size: 14px; font-weight: 600; margin-right: 4px; }
.cc-ratio #cc-ratio-value { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.cc-ratio-unit { font-size: 20px; color: var(--text-muted); font-weight: 600; }
.cc-grade {
  margin-left: 8px; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  align-self: center;
}

.cc-preview {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px 30px; margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: background .15s, color .15s;
}
.cc-preview .cc-large { font-size: 24px; font-weight: 700; margin: 0 0 10px; }
.cc-preview .cc-normal { font-size: 16px; margin: 0; }

.cc-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.cc-badge {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.cc-badge strong { font-size: 13px; }
.cc-badge .cc-req { color: var(--text-muted); font-size: 12px; margin-left: auto; }
.cc-badge em {
  font-style: normal; font-weight: 700; font-size: 12px;
  padding: 2px 9px; border-radius: 999px;
}
.cc-badge.pass em { background: #06d6a022; color: #059f78; }
.cc-badge.pass em::after { content: "PASS"; }
.cc-badge.fail em { background: #ef476f22; color: #e5484d; }
.cc-badge.fail em::after { content: "FAIL"; }
.cc-badge.pass { border-color: #06d6a066; }
.cc-badge.fail { border-color: #ef476f55; }

@media (max-width: 640px) {
  .cc-pickers { grid-template-columns: 1fr; }
  .cc-swap-col { justify-content: center; }
  .cc-swatchbox input[type="color"] { height: 110px; }
}

/* Examples & history */
.cc-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 22px; }
.cc-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.cc-block h3 { margin: 0 0 12px; font-size: 14px; }
.cc-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cc-block-head h3 { margin: 0; }
.cc-block-head .btn { padding: 3px 10px; font-size: 12px; }
.cc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 5px 10px 5px 5px; cursor: pointer; font: inherit; color: var(--text);
  transition: border-color .12s;
}
.cc-chip:hover { border-color: var(--accent); }
.cc-chip .chip-preview {
  width: 46px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  border: 1px solid var(--border);
}
.cc-chip .chip-ratio { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.cc-chip .chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 13px; line-height: 1; color: var(--text-muted);
}
.cc-chip .chip-x:hover { background: #ef476f22; color: #e5484d; }
.cc-history-empty { font-size: 13px; margin: 0; }

@media (max-width: 640px) {
  .cc-extra { grid-template-columns: 1fr; }
}
