.conv { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; margin: 0 0 18px; box-shadow: var(--shadow-sm); }
.conv h3 { margin: 0 0 16px; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.conv h3::before { content: ""; width: 6px; height: 18px; border-radius: 3px; background: var(--accent); }

/* Color input row with swatch preview */
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input { flex: 1; min-width: 160px; }
.swatch-preview { width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--border); flex-shrink: 0; background: transparent; transition: background 0.15s; }

/* Copy button, small inline */
.copy-btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* Contrast checker */
.contrast-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.contrast-row .field { flex: 1; min-width: 140px; }
.contrast-row .field label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--muted); }
.contrast-result { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.contrast-ratio { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wcag-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--border); color: var(--text); }
.wcag-badge { --wcag-aaa: #1a7a2a; --wcag-aa: #2d6fa8; --wcag-aa-large: #8a6200; --wcag-fail: #b0211f; --wcag-on: #fff; }
.wcag-badge.aaa { background: var(--wcag-aaa); color: var(--wcag-on); }
.wcag-badge.aa { background: var(--wcag-aa); color: var(--wcag-on); }
.wcag-badge.aa-large { background: var(--wcag-aa-large); color: var(--wcag-on); }
.wcag-badge.fail { background: var(--wcag-fail); color: var(--wcag-on); }
.contrast-preview { padding: 14px 18px; border-radius: var(--r); border: 1px solid var(--border); font-size: 15px; line-height: 1.5; min-height: 52px; transition: background 0.15s, color 0.15s; }

/* Material palette strip */
.palette-strip { display: flex; gap: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); margin-top: 14px; }
.swatch-item { flex: 1; min-width: 0; padding: 10px 4px 8px; text-align: center; cursor: pointer; transition: filter 0.12s; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.swatch-item:hover { filter: brightness(1.12); }
.swatch-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.swatch-stop { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); text-shadow: 0 1px 2px rgba(0,0,0,0.5); line-height: 1; }
.swatch-hex { font-size: 10px; color: rgba(255,255,255,0.75); text-shadow: 0 1px 2px rgba(0,0,0,0.5); font-family: monospace; word-break: break-all; line-height: 1; }
/* Lighter swatches need dark text */
.swatch-item[data-color="#FFFFFF"] .swatch-stop,
.swatch-item[data-color="#FFFFFF"] .swatch-hex,
.palette-strip .swatch-item:nth-child(-n+3) .swatch-stop,
.palette-strip .swatch-item:nth-child(-n+3) .swatch-hex { color: rgba(0,0,0,0.7); text-shadow: none; }

@media (max-width: 520px) {
  .swatch-hex { display: none; }
  .swatch-stop { font-size: 10px; }
  .palette-strip { gap: 1px; }
}

/* Output field layout */
.out-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.out-row output, .out-row input[readonly] { flex: 1; min-width: 160px; background: var(--surface-alt, var(--surface)); cursor: default; }

/* Color swatch pair for contrast */
.color-swatches { display: flex; gap: 6px; margin-bottom: 10px; }
.color-swatch-sm { width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0; }
