/* Color Lab styles. Scoped under .color-lab and .terminal-lab so the modules can be embedded elsewhere. */
.color-lab, .terminal-lab { display: grid; gap: 1.75rem; }
.cl-editor { border: 1px solid var(--border, #d1d9e0); border-radius: 10px; padding: 1.25rem 1.5rem 1.5rem; margin: 0; display: grid; gap: 1rem; }
.cl-editor legend { font-weight: 700; color: var(--heading, #0b3d5c); padding: 0 0.4rem; font-size: 1.1rem; }
.cl-swatches { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cl-swatch { display: grid; grid-template-columns: 2rem 1fr 7.5rem 2rem; gap: 0.5rem; align-items: center; }
.cl-swatch input, .cl-add input { font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--input-border, #9aa7b8); border-radius: 6px; min-width: 0; }
.cl-hex { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cl-chip { display: inline-block; width: 2rem; height: 2rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.15); vertical-align: middle; }
.cl-chip-sm { width: 1rem; height: 1rem; margin-right: 0.35rem; border-radius: 3px; }
.cl-remove { font: inherit; font-size: 1.2rem; line-height: 1; background: none; border: 1px solid var(--input-border, #9aa7b8); border-radius: 6px; width: 2rem; height: 2rem; cursor: pointer; color: var(--ink, #1f2937); }
.cl-remove:hover { background: #fde8e6; border-color: var(--danger, #b3261e); color: var(--danger, #b3261e); }
.cl-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.cl-add input[type="text"]:first-child { flex: 1 1 8rem; }
.cl-add .cl-hex { width: 8.5ch; }
.cl-editor-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cl-view { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.cl-view-row { display: grid; gap: 0.25rem; }
.cl-view-row label { font-weight: 600; }
.cl-view-row select { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--input-border, #9aa7b8); border-radius: 6px; background: var(--bg, #fff); }
.cl-summary { background: var(--bg-soft, #e8f2f7); border-left: 4px solid var(--navy, #0b3d5c); border-radius: 10px; padding: 1rem 1.25rem; }
.cl-summary p { margin: 0 0 0.4rem; }
.cl-summary p:last-child { margin-bottom: 0; }
.cl-matrix-wrap { overflow-x: auto; }
.cl-matrix { border-collapse: separate; border-spacing: 3px; font-size: 0.85rem; }
.cl-matrix caption { text-align: left; color: var(--muted, #4b5563); margin-bottom: 0.5rem; caption-side: top; }
.cl-matrix th { text-align: left; font-weight: 600; padding: 0.3rem 0.4rem; white-space: nowrap; color: var(--ink, #1f2937); background: var(--bg, #fff); }
.cl-matrix thead th { vertical-align: bottom; }
.cl-cell { width: 4.6rem; height: 3.4rem; border-radius: 6px; text-align: center; vertical-align: middle; padding: 0.25rem; position: relative; }
.cl-cell-sample { display: block; font-weight: 700; font-size: 1rem; line-height: 1.1; }
.cl-cell-value { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; }
.cl-cell::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0 0 6px 6px; }
.cl-AAA::after { background: #1f6f43; }
.cl-AA::after { background: #7fb069; }
.cl-ui::after { background: #d7a35b; }
.cl-fail::after { background: #b3261e; }
.cl-fail { outline: 2px dashed #b3261e; outline-offset: -2px; }
.cl-self { color: #9aa7b8; background: var(--bg-soft, #f3f4f6); }
.cl-legend { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; font-size: 0.85rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.cl-legend li::before { content: ""; display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 3px; margin-right: 0.35rem; vertical-align: -0.1rem; }
.cl-legend .lg-AAA::before { background: #1f6f43; }
.cl-legend .lg-AA::before { background: #7fb069; }
.cl-legend .lg-ui::before { background: #d7a35b; }
.cl-legend .lg-fail::before { background: #b3261e; }
.cl-export h3 { margin-bottom: 0.5rem; }
.cl-export textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; padding: 0.75rem; border: 1px solid var(--input-border, #9aa7b8); border-radius: 10px; background: var(--bg-warm, #f8fafb); resize: vertical; }
.cl-export-actions { display: flex; gap: 1rem; align-items: center; margin-top: 0.75rem; }
.cl-copy-status { font-weight: 600; color: var(--success, #1f6f43); }

/* Terminal mode */
.tl-inputs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tl-input { display: grid; gap: 0.35rem; }
.tl-input label { font-weight: 600; }
.tl-input textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; padding: 0.6rem 0.75rem; border: 1px solid var(--input-border, #9aa7b8); border-radius: 10px; resize: vertical; }
.tl-hint { margin: 0; }
.tl-hint code { background: var(--bg-soft, #e8f2f7); padding: 0.1em 0.35em; border-radius: 4px; }
.tl-reports { display: grid; gap: 2rem; }
.tl-report h3 { margin-bottom: 0.5rem; }
.tl-bg { font-weight: 400; font-size: 0.95rem; color: var(--muted, #4b5563); }
.tl-bg code { background: var(--bg-soft, #e8f2f7); padding: 0.1em 0.35em; border-radius: 4px; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tl-table caption { text-align: left; color: var(--muted, #4b5563); margin-bottom: 0.5rem; caption-side: top; }
.tl-table th, .tl-table td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border, #d1d9e0); vertical-align: middle; }
.tl-table th[scope="row"] { font-weight: 600; white-space: nowrap; }
.tl-sample { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; border-radius: 4px; }
.tl-table tr.tl-fail td:last-child, .tl-table tr.tl-ui td:last-child { color: var(--danger, #b3261e); font-weight: 700; }
.tl-table tr.tl-AA td:last-child, .tl-table tr.tl-AAA td:last-child { color: var(--success, #1f6f43); font-weight: 700; }
.tl-missing { color: var(--danger, #b3261e); font-weight: 600; }
.tl-missing-cell { color: var(--muted, #4b5563); font-style: italic; }
@media (max-width: 600px) {
  .cl-swatch { grid-template-columns: 2rem 1fr 2rem; }
  .cl-swatch .cl-hex { grid-column: 2; }
}
.cl-swatch input, .cl-add input, .cl-view-row select, .cl-export textarea, .tl-input textarea { background: var(--input-bg, #fff); color: var(--ink, #1f2937); }
