/**
 * color-lab.css — Shared design for Color List Lab & Color Overview
 * Scope: .ax-lab  (used on both color-list and color-overview pages)
 * Depends on: /css/main.css (design tokens), /assets/css/analyzer.css (.anz-*)
 */

/* ══════════════════════════════════════════════════════════════════════════
   UTILITY — MISSING FROM BASE STACK (used throughout lab pages)
══════════════════════════════════════════════════════════════════════════ */
.lh-1-6 {
    line-height: 1.6;
}

.lh-1-7 {
    line-height: 1.7;
}

.lh-1-8 {
    line-height: 1.8;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-4 {
    margin-top: 4px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.p-12 {
    padding: 12px;
}

.p-6 {
    padding: 6px;
}

.ml-12 {
    margin-left: 12px;
}

.w-60 {
    width: 60px;
}

.w-80 {
    width: 80px;
}

.w-100p {
    width: 100%;
}

.fs-11 {
    font-size: 11px;
}

.fs-12 {
    font-size: 12px;
}

.ls-16 {
    letter-spacing: .16em;
}

.justify-center {
    justify-content: center;
}

.align-stretch {
    align-items: stretch;
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-auto {
    overflow: auto;
}

/* ══════════════════════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════════════════════ */
.cl-hero {
    text-align: center;
    padding: 60px 20px 36px;
    max-width: 900px;
    margin: 0 auto;
}

.cl-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--color-heading, #0f172a);
    line-height: 1.1;
    margin: 0 0 12px;
}

.cl-hero .cl-subtitle {
    font-size: .95rem;
    color: var(--color-text-secondary, #64748b);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto 20px;
}

.cl-hero .cl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.cl-badge {
    display: inline-flex;
    align-items: center;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
}

.cl-badge--gold {
    background: rgba(211, 175, 55, .12);
    color: var(--color-gold, #d3af37);
    border: 1px solid rgba(211, 175, 55, .3);
}

.cl-badge--blue {
    background: rgba(59, 130, 246, .1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, .25);
}

.cl-badge--green {
    background: rgba(34, 197, 94, .1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, .25);
}

.cl-badge--muted {
    background: rgba(100, 116, 139, .08);
    color: var(--color-text-secondary, #64748b);
    border: 1px solid rgba(100, 116, 139, .2);
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL UTILITY (shared with color-science-lab.css via lab scope)
══════════════════════════════════════════════════════════════════════════ */
.ax-lab .panel {
    background: var(--color-surface, #fff);
}

.ax-lab .panel-btn {
    font-size: .78rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-gold, #d3af37);
    color: #fff;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
}

.ax-lab .panel-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.ax-lab .panel-btn:active {
    transform: translateY(0);
}

.ax-lab .panel-btn-ghost {
    background: transparent;
    color: var(--color-text, #1e293b);
    border: 1px solid var(--color-border, #e5e7eb);
}

.ax-lab .panel-btn-ghost:hover {
    border-color: var(--color-gold, #d3af37);
    color: var(--color-gold, #d3af37);
}

.ax-lab .panel-btn-pill {
    border-radius: 999px;
}

.ax-lab .panel-btn:focus-visible {
    outline: 2px solid var(--color-gold, #d3af37);
    outline-offset: 2px;
}

.ax-lab .panel-field {
    font-size: .82rem;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 7px 12px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #1e293b);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.ax-lab .panel-field:focus {
    border-color: var(--color-gold, #d3af37);
    box-shadow: 0 0 0 3px rgba(211, 175, 55, .12);
}

.ax-lab .panel-color {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.ax-lab .panel-hex {
    font-family: var(--font-mono, monospace);
    font-size: .8rem;
    background: transparent;
    border: none;
    outline: none;
    width: 90px;
    color: inherit;
}

.ax-lab .panel-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-secondary, #64748b);
    margin-bottom: 6px;
    display: block;
}

.ax-lab .panel-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ax-lab .bg-gray-50 {
    background: var(--color-surface, #f8fafc) !important;
    border: 1px solid var(--color-border, #e5e7eb);
}

.ax-lab .collapsible-panel {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
}

.ax-lab .collapsible-panel summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: .83rem;
    list-style: none;
    user-select: none;
}

.ax-lab .collapsible-panel summary::-webkit-details-marker {
    display: none;
}

.ax-lab .collapsible-panel summary:hover {
    color: var(--color-gold, #d3af37);
}

.ax-lab .collapsible-icon {
    font-size: .65rem;
    transition: transform .18s;
    color: var(--color-gold, #d3af37);
}

.ax-lab .collapsible-panel[open] .collapsible-icon {
    transform: rotate(90deg);
}

.ax-lab .collapsible-content {
    padding: 0 12px 12px;
    font-size: .8rem;
    line-height: 1.7;
    color: var(--color-text-secondary, #64748b);
}

.ax-lab .tabs {
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    display: flex;
    flex-wrap: wrap;
}

.ax-lab .tab-btn {
    font-family: var(--font-mono, monospace);
    font-size: .72rem;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-secondary, #64748b);
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}

.ax-lab .tab-btn:hover {
    color: var(--color-gold, #d3af37);
}

.ax-lab .tab-btn.active,
.ax-lab .tab-btn[aria-selected="true"] {
    color: var(--color-gold, #d3af37);
    border-bottom-color: var(--color-gold, #d3af37);
}

/* ══════════════════════════════════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════════════════════════════════ */
.cl-search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--color-surface, #fff);
    border-radius: 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.cl-search-input {
    flex: 1;
    min-width: 180px;
    font-size: .87rem;
    padding: 8px 14px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-bg-muted, #f3f4f6);
    color: var(--color-text, #1e293b);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.cl-search-input:focus {
    border-color: var(--color-gold, #d3af37);
    box-shadow: 0 0 0 3px rgba(211, 175, 55, .1);
}

.cl-search-input::placeholder {
    color: var(--color-text-secondary, #94a3b8);
}

.cl-sort-select {
    font-size: .78rem;
    padding: 7px 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #1e293b);
    cursor: pointer;
    outline: none;
}

.cl-view-toggle {
    display: flex;
    gap: 4px;
}

.cl-view-btn {
    padding: 7px 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: .82rem;
    color: var(--color-text-secondary, #94a3b8);
    transition: all .15s;
}

.cl-view-btn.active,
.cl-view-btn:hover {
    background: var(--color-gold, #d3af37);
    color: #fff;
    border-color: var(--color-gold, #d3af37);
}

/* ══════════════════════════════════════════════════════════════════════════
   CATEGORY FILTER CHIPS
══════════════════════════════════════════════════════════════════════════ */
.cl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
}

.cl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--color-border, #e5e7eb);
    background: var(--color-surface, #fff);
    color: var(--color-text-secondary, #64748b);
    cursor: pointer;
    transition: all .15s;
    text-transform: capitalize;
    letter-spacing: .03em;
    user-select: none;
}

.cl-chip:hover {
    border-color: var(--color-gold, #d3af37);
    color: var(--color-gold, #d3af37);
}

.cl-chip.active {
    background: var(--color-gold, #d3af37);
    border-color: var(--color-gold, #d3af37);
    color: #fff;
}

.cl-chip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cl-chip-count {
    font-size: .65rem;
    opacity: .7;
}

/* ══════════════════════════════════════════════════════════════════════════
   COLOR GRID
══════════════════════════════════════════════════════════════════════════ */
.cl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.cl-grid--list {
    grid-template-columns: 1fr;
}

.cl-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   COLOR CARD
══════════════════════════════════════════════════════════════════════════ */
.cl-card {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    overflow: hidden;
    background: var(--color-surface, #fff);
    cursor: pointer;
    transition: box-shadow .2s, transform .15s, border-color .15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cl-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    transform: translateY(-2px);
    border-color: var(--color-gold, #d3af37);
}

.cl-card:focus-visible {
    outline: 2px solid var(--color-gold, #d3af37);
}

.cl-card__swatch {
    height: 80px;
    width: 100%;
    flex-shrink: 0;
    transition: height .2s;
}

.cl-card__body {
    padding: 8px 10px 10px;
}

.cl-card__name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-heading, #0f172a);
    margin: 0 0 3px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-card__hex {
    font-family: var(--font-mono, monospace);
    font-size: .7rem;
    color: var(--color-text-secondary, #64748b);
    display: block;
}

.cl-card__cat {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .6;
    margin-top: 4px;
}

.cl-card__actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.cl-card__action {
    font-size: .62rem;
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-bg-muted, #f3f4f6);
    color: var(--color-text-secondary, #64748b);
    cursor: pointer;
    font-weight: 600;
    transition: all .12s;
}

.cl-card__action:hover {
    background: var(--color-gold, #d3af37);
    color: #fff;
    border-color: var(--color-gold, #d3af37);
}

/* Compact card */
.cl-grid--compact .cl-card__swatch {
    height: 50px;
}

.cl-grid--compact .cl-card__body {
    padding: 4px 6px;
}

.cl-grid--compact .cl-card__name {
    font-size: .65rem;
}

.cl-grid--compact .cl-card__hex {
    display: none;
}

.cl-grid--compact .cl-card__actions {
    display: none;
}

/* List layout */
.cl-grid--list .cl-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px;
    border-radius: 8px;
}

.cl-grid--list .cl-card__swatch {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.cl-grid--list .cl-card__body {
    flex: 1;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cl-grid--list .cl-card__name {
    font-size: .85rem;
    margin: 0;
    white-space: nowrap;
    min-width: 140px;
}

.cl-grid--list .cl-card__hex {
    font-size: .75rem;
    min-width: 80px;
}

.cl-grid--list .cl-card__cat {
    margin-top: 0;
    min-width: 60px;
}

.cl-grid--list .cl-card__hsl {
    font-size: .7rem;
    font-family: var(--font-mono, monospace);
    color: var(--color-text-secondary, #64748b);
    min-width: 130px;
}

.cl-grid--list .cl-card__actions {
    margin-top: 0;
    margin-left: auto;
    flex-wrap: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   COUNTER / STATUS BAR
══════════════════════════════════════════════════════════════════════════ */
.cl-status {
    font-size: .75rem;
    color: var(--color-text-secondary, #64748b);
    font-family: var(--font-mono, monospace);
    padding: 6px 0;
}

.cl-status strong {
    color: var(--color-text, #1e293b);
}

/* ══════════════════════════════════════════════════════════════════════════
   ADVANCED SEARCH PANEL
══════════════════════════════════════════════════════════════════════════ */
.cl-range-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cl-range-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    display: flex;
    justify-content: space-between;
}

.cl-range-label span {
    font-family: var(--font-mono, monospace);
    color: var(--color-gold, #d3af37);
}

.cl-range {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border, #e5e7eb);
    outline: none;
    cursor: pointer;
    width: 100%;
}

.cl-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-gold, #d3af37);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.cl-range:focus-visible {
    outline: 2px solid var(--color-gold, #d3af37);
}

/* ══════════════════════════════════════════════════════════════════════════
   COLOR SPACE TABLE
══════════════════════════════════════════════════════════════════════════ */
.cl-spaces-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

.cl-spaces-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-secondary, #64748b);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.cl-spaces-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .04);
    vertical-align: middle;
}

.cl-spaces-table tr:last-child td {
    border-bottom: none;
}

.cl-spaces-table tr:hover td {
    background: rgba(211, 175, 55, .04);
}

.cl-spaces-table .cl-space-name {
    font-weight: 700;
    color: var(--color-heading, #0f172a);
    white-space: nowrap;
}

.cl-spaces-table .cl-space-val {
    font-family: var(--font-mono, monospace);
    color: var(--color-text, #1e293b);
}

.cl-space-copy {
    font-size: .62rem;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: transparent;
    color: var(--color-text-secondary, #64748b);
    cursor: pointer;
    font-weight: 600;
    transition: all .12s;
    white-space: nowrap;
}

.cl-space-copy:hover {
    background: var(--color-gold, #d3af37);
    color: #fff;
    border-color: var(--color-gold, #d3af37);
}

/* ══════════════════════════════════════════════════════════════════════════
   COLOR OVERVIEW HERO (wide color swatch at top)
══════════════════════════════════════════════════════════════════════════ */
.covw-swatch-hero {
    width: 100%;
    height: 220px;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .15);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.covw-swatch-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.covw-color-name {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}

.covw-color-hex {
    font-family: var(--font-mono, monospace);
    font-size: .85rem;
    color: rgba(255, 255, 255, .85);
    font-weight: 700;
}

/* Quick copy chips */
.covw-quick-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.covw-chip {
    font-family: var(--font-mono, monospace);
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .3);
    transition: background .15s;
    backdrop-filter: blur(4px);
}

.covw-chip:hover {
    background: rgba(255, 255, 255, .3);
}

.covw-chip.copied {
    background: rgba(34, 197, 94, .4);
}

/* Overview stats row */
.covw-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.covw-stat {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
}

.covw-stat__label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-secondary, #64748b);
    margin-bottom: 4px;
}

.covw-stat__value,
.covw-stat__val {
    font-family: var(--font-mono, monospace);
    font-size: .85rem;
    font-weight: 700;
    color: var(--color-heading, #0f172a);
}

/* ══════════════════════════════════════════════════════════════════════════
   HARMONY GRID (shared with compare tab)
══════════════════════════════════════════════════════════════════════════ */
.cl-harmony-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.cl-harmony-card {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .15s;
}

.cl-harmony-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    border-color: var(--color-gold, #d3af37);
}

.cl-harmony-card__title {
    padding: 8px 12px 6px;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.cl-harmony-card__title small {
    font-size: .62rem;
    opacity: .6;
    font-weight: 400;
    font-family: var(--font-mono, monospace);
}

.cl-harmony-card__swatches {
    display: flex;
    height: 52px;
}

.cl-harmony-card__swatches span {
    flex: 1;
    display: block;
}

.cl-harmony-card__hexes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 10px;
}

.cl-harmony-chip {
    font-family: var(--font-mono, monospace);
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-bg-muted, #f3f4f6);
    cursor: pointer;
    transition: all .12s;
}

.cl-harmony-chip:hover {
    border-color: var(--color-gold, #d3af37);
    background: rgba(211, 175, 55, .08);
}

/* ══════════════════════════════════════════════════════════════════════════
   CVD SIMULATION SWATCHES
══════════════════════════════════════════════════════════════════════════ */
.cl-cvd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.cl-cvd-card {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-surface, #fff);
}

.cl-cvd-card__swatch {
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.cl-cvd-card__swatch span {
    flex: 1;
}

.cl-cvd-card__body {
    padding: 8px 12px;
}

.cl-cvd-card__title {
    font-size: .76rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.cl-cvd-card__label {
    font-size: .72rem;
    font-weight: 700;
    padding: 6px 10px 2px;
}

.cl-cvd-card__delta {
    font-size: .65rem;
    color: var(--color-text-secondary, #64748b);
    font-family: var(--font-mono, monospace);
    padding: 0 10px 8px;
}

.cl-cvd-card__desc {
    font-size: .67rem;
    color: var(--color-text-secondary, #64748b);
    line-height: 1.5;
}

.cl-cvd-card__hex {
    font-family: var(--font-mono, monospace);
    font-size: .68rem;
    color: var(--color-text-secondary, #64748b);
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   SIMILAR COLORS GRID
══════════════════════════════════════════════════════════════════════════ */
.cl-similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.cl-similar-card {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--color-border, #e5e7eb);
    transition: box-shadow .2s, transform .15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.cl-similar-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .09);
    transform: translateY(-2px);
}

.cl-similar-card__swatch {
    height: 60px;
    width: 100%;
}

.cl-similar-card__body {
    padding: 6px 8px;
}

.cl-similar-card__name {
    font-size: .72rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-similar-card__hex {
    font-family: var(--font-mono, monospace);
    font-size: .65rem;
    color: var(--color-text-secondary, #64748b);
}

.cl-similar-card__de,
.cl-similar-card__delta {
    font-size: .62rem;
    color: var(--color-text-secondary, #94a3b8);
    font-family: var(--font-mono, monospace);
}

/* ══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY MINI PANEL (color-overview/accessibility tab)
══════════════════════════════════════════════════════════════════════════ */
.cl-access-pair {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cl-access-swatch {
    flex: 1;
    min-width: 140px;
    height: 100px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.cl-access-ratios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.cl-access-ratio {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    text-align: center;
}

.cl-access-ratio__label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text-secondary, #64748b);
}

.cl-access-ratio__value {
    font-family: var(--font-mono, monospace);
    font-size: .95rem;
    font-weight: 900;
    margin: 4px 0 2px;
}

.cl-pass {
    background: rgba(34, 197, 94, .08);
    border-color: rgba(34, 197, 94, .3);
    color: #16a34a;
}

.cl-fail {
    background: rgba(239, 68, 68, .08);
    border-color: rgba(239, 68, 68, .3);
    color: #dc2626;
}

.cl-warn {
    background: rgba(245, 158, 11, .08);
    border-color: rgba(245, 158, 11, .3);
    color: #d97706;
}

/* Badge variant used in overview accessibility tab */
.cl-access-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    border: 1px solid;
}

.cl-access-badge.cl-pass {
    background: rgba(34, 197, 94, .1);
    border-color: rgba(34, 197, 94, .3);
    color: #15803d;
}

.cl-access-badge.cl-fail {
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .3);
    color: #b91c1c;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESEARCH PANEL (deep analysis — mirrors accessibility lab)
══════════════════════════════════════════════════════════════════════════ */
.cl-research-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .7rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: var(--color-gold, #d3af37);
}

.cl-research-status.offline {
    color: var(--color-text-muted, #aaaaaa);
}

.cl-info-box {
    font-size: .75rem;
    line-height: 1.6;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--color-bg-muted, rgba(0, 0, 0, .04));
    border: 1px solid var(--color-border, #e5e7eb);
    color: var(--color-text, #1e293b);
    min-height: 44px;
    font-family: var(--font-mono, monospace);
}

.cl-info-box.empty {
    color: var(--color-text-muted, #aaaaaa);
}

/* ══════════════════════════════════════════════════════════════════════════
   TOAST (copy feedback)
══════════════════════════════════════════════════════════════════════════ */
.cl-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--color-heading, #0f172a);
    color: #fff;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: .83rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    z-index: 99999;
    pointer-events: none;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), opacity .25s;
    opacity: 0;
    white-space: nowrap;
}

.cl-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
   COV BREADCRUMB (color-overview back link)
══════════════════════════════════════════════════════════════════════════ */
.cov-breadcrumb {
    font-size: .75rem;
    color: var(--color-text-secondary, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 12px;
}

.cov-breadcrumb a {
    color: var(--color-gold, #d3af37);
    text-decoration: none;
    font-weight: 600;
}

.cov-breadcrumb a:hover {
    text-decoration: underline;
}

.cov-breadcrumb__sep {
    opacity: .5;
}

/* ══════════════════════════════════════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════════════════════════════════════ */
body.dark-mode .cl-hero h1,
body.dark-mode-pending .cl-hero h1 {
    color: var(--color-text);
}

body.dark-mode .cl-hero .cl-subtitle,
body.dark-mode-pending .cl-hero .cl-subtitle {
    color: var(--color-text-muted);
}

body.dark-mode .cl-search-bar,
body.dark-mode-pending .cl-search-bar {
    background: var(--color-surface);
    border-color: var(--color-border);
}

body.dark-mode .cl-search-input,
body.dark-mode-pending .cl-search-input {
    background: var(--color-bg-muted);
    color: var(--color-text);
    border-color: var(--color-border);
}

body.dark-mode .cl-search-input::placeholder,
body.dark-mode-pending .cl-search-input::placeholder {
    color: var(--color-text-muted);
}

body.dark-mode .cl-sort-select,
body.dark-mode-pending .cl-sort-select {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

body.dark-mode .cl-chip,
body.dark-mode-pending .cl-chip {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

body.dark-mode .cl-chip.active,
body.dark-mode-pending .cl-chip.active {
    background: var(--color-gold, #d3af37);
    color: #fff;
}

body.dark-mode .cl-card,
body.dark-mode-pending .cl-card {
    background: var(--color-surface);
    border-color: var(--color-border);
}

body.dark-mode .cl-card__name,
body.dark-mode-pending .cl-card__name {
    color: var(--color-text);
}

body.dark-mode .cl-card__hex,
body.dark-mode-pending .cl-card__hex {
    color: var(--color-text-muted);
}

body.dark-mode .cl-card__action,
body.dark-mode-pending .cl-card__action {
    background: var(--color-bg-muted);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

/* .ax-lab .panel-btn-ghost, .panel-field, .tab-btn: handled by color-science-lab.css dark mode — no override here */
body.dark-mode .cl-spaces-table tr:hover td,
body.dark-mode-pending .cl-spaces-table tr:hover td {
    background: rgba(211, 175, 55, .06);
}

body.dark-mode .cl-spaces-table th,
body.dark-mode-pending .cl-spaces-table th {
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

body.dark-mode .cl-spaces-table td,
body.dark-mode-pending .cl-spaces-table td {
    border-color: rgba(255, 255, 255, .04);
}

body.dark-mode .cl-spaces-table .cl-space-name,
body.dark-mode-pending .cl-spaces-table .cl-space-name {
    color: var(--color-text);
}

body.dark-mode .cl-harmony-card,
body.dark-mode-pending .cl-harmony-card {
    border-color: var(--color-border);
}

body.dark-mode .cl-harmony-card__title,
body.dark-mode-pending .cl-harmony-card__title {
    border-color: var(--color-border);
}

body.dark-mode .cl-harmony-chip,
body.dark-mode-pending .cl-harmony-chip {
    background: var(--color-bg-muted);
    border-color: var(--color-border);
    color: var(--color-text);
}

body.dark-mode .cl-cvd-card,
body.dark-mode-pending .cl-cvd-card {
    background: var(--color-surface);
    border-color: var(--color-border);
}

body.dark-mode .cl-similar-card,
body.dark-mode-pending .cl-similar-card {
    border-color: var(--color-border);
}

body.dark-mode .covw-stat,
body.dark-mode-pending .covw-stat {
    background: var(--color-surface);
    border-color: var(--color-border);
}

body.dark-mode .covw-stat__label,
body.dark-mode-pending .covw-stat__label {
    color: var(--color-text-muted);
}

body.dark-mode .covw-stat__value,
body.dark-mode .covw-stat__val,
body.dark-mode-pending .covw-stat__value,
body.dark-mode-pending .covw-stat__val {
    color: var(--color-text);
}

body.dark-mode .cl-info-box,
body.dark-mode-pending .cl-info-box {
    background: var(--color-bg-muted);
    border-color: var(--color-border);
    color: var(--color-text);
}

body.dark-mode .cl-access-ratio,
body.dark-mode-pending .cl-access-ratio {
    border-color: var(--color-border);
}

/* .ax-lab .collapsible-panel, .bg-gray-50: handled by color-science-lab.css — no override here */

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .cl-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .cl-grid--list .cl-card__hsl,
    .cl-grid--list .cl-card__cat {
        display: none;
    }

    .covw-swatch-hero {
        height: 160px;
    }

    .covw-color-name {
        font-size: 1.2rem;
    }

    .cl-harmony-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cl-cvd-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .cl-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .cl-harmony-grid {
        grid-template-columns: 1fr;
    }
}