/* ── HTTP Status Codes Tool ─────────────────────────────────────── */
.hsc-section {
    --tool-accent: #6366F1;
    --hsc-1xx: #3B82F6;
    --hsc-2xx: #10B981;
    --hsc-3xx: #F59E0B;
    --hsc-4xx: #F97316;
    --hsc-5xx: #EF4444;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Controls row */
.hsc-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Search input */
.hsc-search-wrap {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
}

.hsc-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: var(--text-light, #64748B);
    pointer-events: none;
}

.hsc-search-input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.4rem;
    background: var(--input-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--text-primary, #0F172A);
    font-size: 0.9375rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.hsc-search-input::placeholder {
    color: var(--text-light, #64748B);
}

.hsc-search-input:focus {
    outline: none;
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Category tabs */
.hsc-tabs {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.hsc-tab {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: transparent;
    color: var(--text-light, #64748B);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hsc-tab-label {
    font-weight: 400;
    font-size: 0.9375rem;
    opacity: 0.75;
}

.hsc-tab:hover {
    border-color: var(--tool-accent);
    color: var(--text-primary, #0F172A);
}

.hsc-tab.active {
    background: var(--tool-accent);
    border-color: var(--tool-accent);
    color: #fff;
}

.hsc-tab[data-cat="1"].active {
    background: var(--hsc-1xx);
    border-color: var(--hsc-1xx);
    color: #fff;
}

.hsc-tab[data-cat="2"].active {
    background: var(--hsc-2xx);
    border-color: var(--hsc-2xx);
    color: #fff;
}

.hsc-tab[data-cat="3"].active {
    background: var(--hsc-3xx);
    border-color: var(--hsc-3xx);
    color: #0F172A;
}

.hsc-tab[data-cat="4"].active {
    background: var(--hsc-4xx);
    border-color: var(--hsc-4xx);
    color: #fff;
}

.hsc-tab[data-cat="5"].active {
    background: var(--hsc-5xx);
    border-color: var(--hsc-5xx);
    color: #fff;
}

/* Meta count */
.hsc-meta {
    font-size: 0.9375rem;
    color: var(--text-light, #64748B);
}

/* Cards grid */
.hsc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    align-items: start;
}

/* Single card */
.hsc-card {
    background: var(--bg-muted, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    align-self: start;
}

.hsc-card:hover {
    box-shadow: 0 4px 16px var(--shadow-color, rgba(0, 0, 0, 0.08));
}

/* Card header (visible row) */
.hsc-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}

.hsc-code {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 3.2rem;
}

.hsc-name-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
}

.hsc-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #0F172A);
    line-height: 1.3;
}

.hsc-copy-btn {
    background: transparent;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    color: var(--text-light, #64748B);
    font-size: 0.9375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.hsc-copy-btn:hover {
    border-color: var(--tool-accent);
    color: var(--tool-accent);
}

.hsc-copy-btn.copied {
    border-color: var(--hsc-2xx);
    color: var(--hsc-2xx);
}

.hsc-chevron {
    font-size: 0.9375rem;
    color: var(--text-light, #64748B);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.hsc-card.open .hsc-chevron {
    transform: rotate(180deg);
}

/* Card body (expandable) */
.hsc-card-body {
    display: none;
    padding: 0.75rem 1rem 1rem 3.95rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.hsc-card.open .hsc-card-body {
    display: block;
}

.hsc-desc {
    font-size: 1rem;
    color: var(--text-secondary, #334155);
    line-height: 1.65;
    margin: 0;
}

/* Color per category */
.hsc-card[data-cat="1"] {
    border-left: 3px solid var(--hsc-1xx);
}

.hsc-card[data-cat="2"] {
    border-left: 3px solid var(--hsc-2xx);
}

.hsc-card[data-cat="3"] {
    border-left: 3px solid var(--hsc-3xx);
}

.hsc-card[data-cat="4"] {
    border-left: 3px solid var(--hsc-4xx);
}

.hsc-card[data-cat="5"] {
    border-left: 3px solid var(--hsc-5xx);
}

.hsc-card[data-cat="1"] .hsc-code {
    color: var(--hsc-1xx);
}

.hsc-card[data-cat="2"] .hsc-code {
    color: var(--hsc-2xx);
}

.hsc-card[data-cat="3"] .hsc-code {
    color: var(--hsc-3xx);
}

.hsc-card[data-cat="4"] .hsc-code {
    color: var(--hsc-4xx);
}

.hsc-card[data-cat="5"] .hsc-code {
    color: var(--hsc-5xx);
}

/* Empty state */
.hsc-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light, #64748B);
}

.hsc-empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* Badges */
.hsc-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.4rem;
    border-radius: 4px;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.hsc-badge--webdav {
    background: rgba(59, 130, 246, 0.12);
    color: #2563EB;
}

.hsc-badge--deprecated {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

.hsc-badge--experimental {
    background: rgba(168, 85, 247, 0.12);
    color: #7C3AED;
}

.hsc-badge--fun {
    background: rgba(245, 158, 11, 0.12);
    color: #D97706;
}

.hsc-badge--unofficial {
    background: rgba(107, 114, 128, 0.12);
    color: #64748B;
}

/* Cause / Fix sections */
.hsc-detail {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.hsc-detail-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.hsc-detail--cause .hsc-detail-label {
    color: #F97316;
}

.hsc-detail--fix .hsc-detail-label {
    color: #10B981;
}

.hsc-detail-text {
    font-size: 0.9375rem;
    color: var(--text-secondary, #334155);
    line-height: 1.6;
    margin: 0;
}

/* MDN link */
.hsc-mdn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.875rem;
    font-size: 0.875rem;
    color: var(--tool-accent);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.hsc-mdn-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .hsc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .hsc-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .hsc-tabs {
        justify-content: flex-start;
    }

    .hsc-tab-label {
        display: none;
    }

    .hsc-grid {
        grid-template-columns: 1fr;
    }
}