/*
 * einvoicing.pk — page-scoped styles for /tools/hs-code/ only.
 *
 * Package HS-REDESIGN (2026-09-12). Loaded after public/tools/tools.css.
 * It defines no .st-* class and changes no shared file. All selectors are
 * prefixed .hs- and can only reach this page (body[data-page-id]).
 *
 * World: The Compliance Register (DESIGN.md). Paper ground, hairline rules,
 * tabular numerals, left-aligned sections, no cards, no resting shadows.
 */

/* ---------------------------------------------------------- page head */

body[data-page-id='hs-code-finder'] .st-lead {
    margin-top: var(--space-3);
    max-width: 44rem;
}

/* ------------------------------------------------------------- search tool */

.hs-tool {
    margin-top: var(--space-5);
}

.hs-search {
    display: grid;
    gap: var(--space-3);
}

.hs-search__field,
.hs-search__year {
    min-width: 0;
}

.hs-search .st-input,
.hs-search .hs-select {
    width: 100%;
    max-width: none;
    padding: 0.8rem 0.9rem;
    font-size: 1rem;
}

.hs-search .st-input:hover {
    border-color: var(--accent);
}

.hs-search__submit {
    width: 100%;
}

.hs-privacy {
    margin: var(--space-3) 0 0;
    max-width: 62ch;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.hs-year-note {
    margin: var(--space-3) 0 0;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 112, 67, 0.5);
    border-radius: var(--radius-sm);
    background: rgba(255, 112, 67, 0.07);
    color: var(--text-1);
    font-size: var(--fs-sm);
}

.hs-edition {
    margin: var(--space-3) 0 0;
    max-width: 68ch;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

@media (min-width: 40rem) {
    .hs-search {
        grid-template-columns: minmax(0, 1fr) 9.5rem auto;
        align-items: end;
    }

    .hs-search__submit {
        width: auto;
        min-width: 7.5rem;
    }
}

/* ---------------------------------------------------------------- results */

.hs-results {
    margin-top: var(--space-6);
}

.hs-results[aria-busy='true'] {
    opacity: 0.65;
}

.hs-result-status {
    margin: var(--space-2) 0;
    font-weight: 600;
    color: var(--text-1);
}

.hs-copy-status {
    display: block;
    min-height: 1.25em;
    font-size: var(--fs-sm);
    color: var(--accent-strong);
}

.st-content .hs-rows {
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border-1);
}

.hs-result {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-1);
}

.hs-result--node {
    background: var(--bg-soft);
    padding-inline: var(--space-3);
}

.hs-result--unresolved {
    background: #fff8f6;
    padding-inline: var(--space-3);
}

.hs-result__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.hs-code {
    display: inline-block;
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.hs-code--static {
    color: var(--text-2);
}

.hs-result__desc {
    margin: var(--space-2) 0 0;
    max-width: 68ch;
    overflow-wrap: anywhere;
}

.hs-result__meta {
    margin: var(--space-2) 0 0;
    font-size: var(--fs-xs);
    color: var(--text-2);
}

.hs-locator {
    font-variant-numeric: tabular-nums;
    color: var(--text-3);
}

/* ---------------------------------------------------------- copy action */

.hs-copy {
    margin-left: var(--space-1);
    padding: 0.3rem 0.65rem;
    min-height: 2.25rem;
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--c-white);
    color: var(--accent-strong);
    cursor: pointer;
    transition: border-color var(--dur-2) ease, background-color var(--dur-2) ease, transform var(--dur-1) var(--ease-out);
}

.hs-copy:hover {
    border-color: var(--accent);
    background: var(--c-teal-ultra);
}

.hs-copy:active {
    transform: scale(0.97);
}

.hs-copy:focus-visible,
.hs-pagination a:focus-visible,
.hs-faq__question:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------- badges */

.hs-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.hs-badge--draft {
    background: rgba(255, 112, 67, 0.1);
    border: 1px solid rgba(255, 112, 67, 0.5);
    color: var(--text-1);
}

.hs-badge--context {
    background: var(--c-teal-ultra);
    border: 1px solid var(--c-teal-light);
    color: var(--accent-strong);
}

.hs-badge--unresolved {
    background: rgba(200, 80, 47, 0.08);
    border: 1px solid rgba(200, 80, 47, 0.4);
    color: var(--danger-ink);
}

/* ------------------------------------------------------------ pagination */

.hs-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.hs-pagination__label {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.hs-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.hs-pagination a,
.hs-pagination__current {
    display: inline-block;
    min-width: 2.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    text-align: center;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.hs-pagination a:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.hs-pagination__current {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--c-white);
    font-weight: 600;
}

.hs-pagination__gap {
    align-self: center;
    color: var(--text-3);
}

/* -------------------------------------------------------- static content */

.hs-hierarchy {
    margin: var(--space-3) 0 var(--space-4);
}

.hs-hierarchy > div {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--border-1);
}

.hs-hierarchy dt {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hs-hierarchy dd {
    margin: 0;
    color: var(--text-2);
    overflow-wrap: anywhere;
}

.hs-guidance {
    margin: var(--space-3) 0;
}

.hs-guidance li + li {
    margin-top: var(--space-2);
}

.hs-note {
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

/* Common codes table: a real table that stacks into ruled rows on phones. */

.hs-common {
    width: 100%;
    margin-top: var(--space-4);
    border-collapse: collapse;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.hs-common th,
.hs-common td {
    padding: 0.6rem 0.7rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-1);
}

.hs-common th {
    background: var(--bg-soft);
    color: var(--text-2);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hs-common__code {
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 40rem) {
    .hs-common thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .hs-common tr {
        display: block;
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--border-1);
    }

    .hs-common td {
        display: block;
        padding: 0;
        border: 0;
    }

    .hs-common td + td {
        margin-top: var(--space-1);
    }
}

/* Steps: a numbered register list. */

.st-content .hs-steps {
    margin: var(--space-4) 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border-1);
}

.hs-steps li {
    display: grid;
    grid-template-columns: 2rem 1fr;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-1);
}

.hs-steps li::before {
    font-weight: 700;
    color: var(--accent-strong);
    font-variant-numeric: tabular-nums;
}

.hs-steps li:nth-child(1)::before { content: '1'; }
.hs-steps li:nth-child(2)::before { content: '2'; }
.hs-steps li:nth-child(3)::before { content: '3'; }
.hs-steps li:nth-child(4)::before { content: '4'; }
.hs-steps li:nth-child(5)::before { content: '5'; }
.hs-steps li:nth-child(6)::before { content: '6'; }
.hs-steps li:nth-child(7)::before { content: '7'; }

/* FAQ: ruled rows with the same chevron language as the shared site FAQ. */

.hs-faq {
    margin: var(--space-4) 0 0;
    border-top: 1px solid var(--border-1);
}

.hs-faq__item {
    border-bottom: 1px solid var(--border-1);
}

.hs-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    font-size: var(--fs-h3);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.012em;
    cursor: pointer;
    list-style: none;
}

.hs-faq__question::-webkit-details-marker {
    display: none;
}

.hs-faq__question::marker {
    content: '';
}

.hs-faq__question::after {
    content: '';
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    color: var(--text-2);
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform var(--dur-2) var(--ease-out), color var(--dur-2) ease;
}

.hs-faq__item[open] .hs-faq__question {
    color: var(--accent-strong);
}

.hs-faq__item[open] .hs-faq__question::after {
    transform: rotate(180deg);
    color: var(--accent-strong);
}

.hs-faq__question:active {
    color: var(--accent-press);
}

@media (hover: hover) and (pointer: fine) {
    .hs-faq__question:hover {
        color: var(--accent-ink);
    }

    .hs-faq__question:hover::after {
        color: var(--accent-ink);
    }
}

.hs-faq__answer {
    margin: 0;
    padding: 0 0 var(--space-4);
    max-width: 68ch;
    color: var(--text-2);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 40rem) {
    .hs-hierarchy > div {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }

    .st-content > section {
        padding-top: var(--space-5);
    }
}

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
    .hs-copy,
    .hs-results {
        transition: none;
    }
}

/* Search first: one calm work surface, with aligned controls. */
.st-content .hs-tool { padding: clamp(1.25rem, 3vw, 2rem); background: var(--c-teal-ultra); border: 0; border-radius: var(--radius); }
.hs-search { align-items: start; }
.hs-search__submit { margin-top: 1.65rem; min-height: 3.35rem; }
.hs-search :is(.st-input,.hs-select) { min-height: 3.35rem; }
.hs-search__field .st-help { font-size: .8125rem; margin-top: .5rem; }
.hs-edition { max-width: none; font-size: .8125rem; }
.st-content .hs-results { padding-top: 0; }
.st-content .hs-result { max-width: none; padding: 1.25rem 0; }
.hs-locator { color: var(--ink-2); }
.hs-copy { min-height: 2.75rem; }
@media (max-width: 40rem) {
    .hs-search__submit { margin-top: 0; }
}
.st-page--tool .st-content { margin-top: 2rem; }
.st-content > section.hs-tool:first-child { padding-top: clamp(1.25rem,3vw,2rem); }
