/* Layout shell reused from Image Scaler style */
.tool-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* Hero */
.tool-hero h1 {
  font-size: clamp(2.1rem, 3vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.tool-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.4rem;
}

.tool-lede {
  max-width: 40rem;
  opacity: 0.9;
}

.tool-copy {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Grid */
.contrast-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.contrast-panel {
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: 1rem;
  padding: 1.4rem 1.5rem 1.6rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.75);
}

.contrast-panel h2 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.contrast-panel-wide {
  grid-column: 1 / -1;
}

/* Fields */
.contrast-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}

.contrast-field label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.contrast-field-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.contrast-field input[type="text"] {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.contrast-field input[type="color"] {
  width: 3rem;
  min-width: 3rem;
  height: 2.1rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0;
  background: transparent;
}

.contrast-field-note {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 0.2rem;
}

/* Meta */
.contrast-meta {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.contrast-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.contrast-label {
  opacity: 0.8;
}

.contrast-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.contrast-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
}

/* Status colors */
.contrast-badge--pass {
  border-color: rgba(34, 197, 94, 0.7);
  background: rgba(22, 101, 52, 0.7);
  color: #bbf7d0;
}

.contrast-badge--partial {
  border-color: rgba(234, 179, 8, 0.7);
  background: rgba(113, 63, 18, 0.7);
  color: #fef3c7;
}

.contrast-badge--fail {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(127, 29, 29, 0.7);
  color: #fee2e2;
}

/* Preview */
.contrast-preview-controls {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.contrast-preview-controls textarea {
  resize: vertical;
  min-height: 70px;
  border-radius: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  padding: 0.6rem 0.7rem;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 0.9rem;
}

.contrast-slider-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.contrast-slider-row input[type="range"] {
  flex: 1;
}

.contrast-size-label {
  font-size: 0.8rem;
  opacity: 0.75;
}

.contrast-preview-box {
  margin-top: 1.1rem;
  border-radius: 0.9rem;
  padding: 1.1rem 1.2rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: #0f172a;
}

.contrast-preview-text {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.contrast-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Tokens */
.contrast-token-fields {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.contrast-export {
  margin-top: 1.1rem;
}

.contrast-export-tabs {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.15rem;
  margin-bottom: 0.8rem;
}

.contrast-export-tab {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
    color: #e5e7eb;              /* NEW: make text bright */
  opacity: 0.75;               /* slight fade but still readable */
}

.contrast-export-tab.is-active {
  background: rgba(15, 23, 42, 0.9);
  opacity: 1;                  /* full opacity for active tab */
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.7); /* subtle ring */
}

.contrast-export-tab:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.contrast-code-block {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 0.7rem;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

.tool-button {
  margin-top: 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #f9fafb;                        /* ensure high-contrast text */
  font-weight: 500;                      /* a little bolder helps too */
}


.tool-button:hover {
  filter: brightness(1.05);
}

.contrast-copy-status {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 880px) {
  .contrast-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
