/* HEX to CMYK – mobile-first, sleek */

:root {
    --h2c-bg: #ffffff;
    --h2c-bg-soft: #f6f7f9;
    --h2c-border: #e2e6ea;
    --h2c-text: #1a1d21;
    --h2c-muted: #5c636a;
    --h2c-accent: #2563eb;
    --h2c-accent-hover: #1d4ed8;
    --h2c-radius: 14px;
    --h2c-radius-sm: 10px;
    --h2c-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --h2c-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* Tool panel */
.h2c-tool {
    background: var(--h2c-bg);
    border: 1px solid var(--h2c-border);
    border-radius: var(--h2c-radius);
    box-shadow: var(--h2c-shadow);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 480px) {
    .h2c-tool {
        padding: 1.5rem;
        gap: 1.75rem;
    }
}

/* Input row */
.h2c-input-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.h2c-input-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--h2c-text);
    letter-spacing: 0.02em;
}

.h2c-input-wrap {
    display: flex;
    align-items: center;
    background: var(--h2c-bg-soft);
    border: 1px solid var(--h2c-border);
    border-radius: var(--h2c-radius-sm);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.h2c-input-wrap:focus-within {
    border-color: var(--h2c-accent);
    box-shadow: var(--h2c-focus-ring);
}

.h2c-hex-prefix {
    padding: 0.75rem 0 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--h2c-muted);
}

.h2c-hex-input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.5rem 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    border: 0;
    background: transparent;
    color: var(--h2c-text);
}

.h2c-hex-input::placeholder {
    color: var(--h2c-muted);
    opacity: 0.8;
}

.h2c-hex-input:focus {
    outline: none;
}

.h2c-picker-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
    border-left: 1px solid var(--h2c-border);
}

.h2c-color-picker {
    position: absolute;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0;
}

.h2c-picker-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--h2c-border);
    pointer-events: none;
}

.h2c-picker-wrap:has(.h2c-color-picker:focus) {
    outline: 2px solid var(--h2c-accent);
    outline-offset: 2px;
}

.h2c-hint {
    font-size: 0.75rem;
    color: var(--h2c-muted);
    margin: 0;
}

.h2c-error {
    font-size: 0.8125rem;
    color: #b91c1c;
    margin: 0;
}

.h2c-error[hidden] {
    display: none;
}

/* Swatch */
.h2c-swatch-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.h2c-swatch {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 16 / 9;
    border-radius: var(--h2c-radius);
    border: 1px solid var(--h2c-border);
    box-shadow: var(--h2c-shadow);
    transition: background-color 0.15s ease;
}

.h2c-hex-display {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--h2c-text);
    margin: 0;
    letter-spacing: 0.04em;
}

@media (min-width: 480px) {
    .h2c-hex-display {
        font-size: 1.25rem;
    }
}

/* CMYK block */
.h2c-cmyk-block {
    background: var(--h2c-bg-soft);
    border-radius: var(--h2c-radius-sm);
    padding: 1rem;
    border: 1px solid var(--h2c-border);
}

.h2c-cmyk-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--h2c-muted);
    margin-bottom: 0.75rem;
}

.h2c-cmyk-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.h2c-cmyk-cell {
    text-align: center;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    background: var(--h2c-bg);
    border: 1px solid var(--h2c-border);
}

.h2c-cmyk-name {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--h2c-muted);
    margin-bottom: 0.25rem;
}

.h2c-cmyk-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--h2c-text);
}

@media (min-width: 360px) {
    .h2c-cmyk-value {
        font-size: 1.125rem;
    }
}

.h2c-cmyk-cyan .h2c-cmyk-value { color: #0891b2; }
.h2c-cmyk-magenta .h2c-cmyk-value { color: #be185d; }
.h2c-cmyk-yellow .h2c-cmyk-value { color: #b45309; }
.h2c-cmyk-black .h2c-cmyk-value { color: #1f2937; }

/* Copy chips */
.h2c-copy-block {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.h2c-copy-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--h2c-muted);
}

.h2c-copy-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.h2c-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
    background: var(--h2c-bg-soft);
    border: 1px solid var(--h2c-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    text-align: left;
    min-width: 0;
}

.h2c-chip:hover {
    background: var(--h2c-accent);
    border-color: var(--h2c-accent);
    color: #fff;
}

.h2c-chip:focus-visible {
    outline: none;
    box-shadow: var(--h2c-focus-ring);
}

.h2c-chip-tag {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.h2c-chip-code {
    font-size: 0.75rem;
    font-weight: 500;
    word-break: break-all;
}

@media (min-width: 480px) {
    .h2c-chip-code {
        font-size: 0.8125rem;
    }
}

.h2c-chip.h2c-chip-copied {
    background: #059669;
    border-color: #059669;
    color: #fff;
}

/* Samples strip */
.h2c-samples {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.h2c-samples-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--h2c-muted);
}

.h2c-samples-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.h2c-sample {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 2px solid var(--h2c-border);
    border-radius: 10px;
    background: var(--h2c-sample-bg, #ccc);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.h2c-sample:hover {
    transform: scale(1.08);
    border-color: var(--h2c-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.h2c-sample:focus-visible {
    outline: none;
    box-shadow: var(--h2c-focus-ring);
}

@media (min-width: 480px) {
    .h2c-sample {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* Educational block */
.h2c-edu {
    max-width: 52rem;
    padding: 1.5rem 0;
}

.h2c-edu-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--h2c-text);
}

.h2c-edu-sub {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
    color: var(--h2c-text);
}

.h2c-edu-p {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--h2c-muted);
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
