/*
 * German-VAT.com – EU VAT rates (/eu-vat-rates, /eu-vat-rates/search)
 * ===================================================================
 * Table, rate chips, search field and filters of the two pages. The page
 * frame (head, context column, cards, buttons, form fields) comes from
 * public.css; this sheet only uses its tokens — no colour of its own.
 */

/* — Rate chips: the four groups differ in ground and border, and every chip
     carries its group as text for screen readers — */
.vr-chips,
.vr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.vr-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--hp-mono);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.vr-chip--zero {
    background: var(--hp-bg-3);
    color: var(--hp-mute);
}

.vr-chip--super {
    background: var(--hp-acc-l);
    color: var(--hp-navy-2);
}

.vr-chip--reduced {
    border-color: var(--hp-line-2);
    background: #fff;
    color: var(--hp-ink);
}

.vr-chip--parking {
    background: rgba(14, 165, 233, .12);
    color: #0369a1;
}

.vr-chip--standard {
    background: var(--hp-navy);
    color: #fff;
}

.vr-chip--none {
    border-color: var(--hp-line);
    background: var(--hp-bg-2);
    color: var(--hp-mute);
}

.vr-legend .vr-chip {
    font-family: var(--hp-sans);
    font-size: 12.5px;
}

/* Legend, sort field and table of the overview. */
.vr-block {
    display: grid;
    gap: 18px;
}

/* — Search field with suggestions — */
.vr-search {
    display: grid;
    gap: 8px;
    max-width: 960px;
}

.vr-search-row {
    display: flex;
    gap: 10px;
}

.vr-combo {
    position: relative;
    flex: 1;
    min-width: 0;
}

.vr-combo .form-control {
    min-height: 48px;
}

.vr-suggest {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    max-height: min(420px, 60vh);
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--hp-line-2);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 32, 58, .09);
}

.vr-suggest-label {
    padding: 8px 10px 4px;
    font-family: var(--hp-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hp-mute);
}

.vr-suggest [role="option"] {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.35;
    color: var(--hp-ink);
    cursor: pointer;
}

.vr-suggest [role="option"][aria-selected="true"],
.vr-suggest [role="option"]:hover {
    background: var(--hp-bg-2);
}

/* A category can be a whole paragraph: two lines are enough to recognise it. */
.vr-suggest [role="option"] > span:last-child {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.vr-suggest .hp-mono {
    flex: none;
    font-size: 13px;
    color: var(--hp-navy-2);
}

.vr-search mark,
.vr-table mark {
    padding: 0 1px;
    border-radius: 2px;
    background: var(--hp-acc-l);
    color: inherit;
}

/* — Filters of the search page — */
.vr-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 24px;
    margin-top: 20px;
}

.vr-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vr-pick,
.vr-countries > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--hp-line-2);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-navy-2);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.vr-pick:hover,
.vr-countries > summary:hover {
    border-color: var(--hp-navy-2);
}

.vr-pick[aria-pressed="true"] {
    border-color: var(--hp-navy);
    background: var(--hp-navy);
    color: #fff;
}

.vr-countries {
    position: relative;
}

.vr-countries > summary {
    list-style: none;
}

.vr-countries > summary::-webkit-details-marker {
    display: none;
}

.vr-countries > summary::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: 2px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.vr-countries[open] > summary::after {
    transform: translateY(2px) rotate(-135deg);
}

.vr-countries-panel {
    position: absolute;
    z-index: 15;
    top: calc(100% + 6px);
    left: 0;
    width: min(680px, calc(100vw - 32px));
    padding: 16px 18px 18px;
    border: 1px solid var(--hp-line-2);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 32, 58, .09);
}

.vr-countries-tools {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.vr-text-btn {
    min-height: 32px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-navy-2);
    text-decoration: underline;
    text-decoration-color: var(--hp-line-2);
    text-underline-offset: 4px;
    cursor: pointer;
}

.vr-text-btn:hover {
    text-decoration-color: var(--hp-acc);
}

.vr-countries-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px 16px;
}

.vr-countries-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    font-size: 15px;
    color: var(--hp-ink);
    cursor: pointer;
}

.vr-countries-list input {
    width: 18px;
    height: 18px;
    accent-color: var(--hp-navy-2);
}

.vr-status {
    margin-top: 24px;
    font-size: 15px;
    color: var(--hp-mute);
}

.vr-status strong {
    font-weight: 600;
    color: var(--hp-ink);
}

/* — Tables — */
.vr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    line-height: 1.5;
    color: var(--hp-ink);
}

.vr-table thead th {
    padding: 0 16px 10px;
    border-bottom: 1px solid var(--hp-line-2);
    font-family: var(--hp-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--hp-mute);
}

.vr-table tbody th,
.vr-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--hp-line);
    font-weight: 400;
    text-align: left;
    vertical-align: top;
}

.vr-table thead th:first-child,
.vr-table tbody th:first-child {
    padding-left: 0;
}

.vr-table thead th:last-child,
.vr-table tbody td:last-child {
    padding-right: 0;
}

.vr-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
}

.vr-sort:hover {
    color: var(--hp-ink);
}

.vr-sort::after {
    content: '';
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: var(--hp-line-2);
    transform: translateY(2px);
}

[aria-sort="ascending"] > .vr-sort,
[aria-sort="descending"] > .vr-sort {
    color: var(--hp-ink);
}

[aria-sort="ascending"] > .vr-sort::after {
    border-top-color: transparent;
    border-bottom-color: var(--hp-acc-d);
    transform: translateY(-2px);
}

[aria-sort="descending"] > .vr-sort::after {
    border-top-color: var(--hp-acc-d);
}

.vr-sort-select {
    display: none;
}

.vr-country,
.vr-country:hover {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--hp-ink);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: text-decoration-color .25s ease;
}

a.vr-country:hover {
    text-decoration-color: var(--hp-acc);
}

.vr-code {
    flex: none;
    min-width: 24px;
    font-family: var(--hp-mono);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--hp-mute);
}

.vr-star,
.vr-star:hover {
    margin-left: 2px;
    padding: 0 4px;
    font-weight: 600;
    color: var(--hp-acc-d);
    text-decoration: none;
}

.vr-std {
    font-family: var(--hp-mono);
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--hp-ink);
}

.vr-rates tbody tr:hover {
    background: var(--hp-bg-2);
}

.vr-rates .hp-link {
    min-height: 26px;
    font-size: 14px;
    white-space: nowrap;
}

.vr-nowrap {
    white-space: nowrap;
}

.vr-sub {
    display: block;
    font-size: 13.5px;
    color: var(--hp-mute);
}

/* — Footnotes and special cases under the table — */
.vr-notes {
    display: grid;
    gap: 6px;
    max-width: 960px;
    font-size: 14.5px;
    color: var(--hp-mute);
}

.vr-notes h2,
.vr-cases h2 {
    margin-bottom: 6px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -.012em;
    color: var(--hp-ink);
}

.vr-notes strong {
    font-weight: 600;
    color: var(--hp-ink);
}

.vr-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 16px;
    max-width: 960px;
    margin-top: 10px;
}

.vr-case-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin-bottom: 10px;
}

.vr-case .vr-chips {
    margin-bottom: 10px;
}

/* — Search results: one block of rows per country — */
.vr-results tbody + tbody th,
.vr-results tbody + tbody td {
    border-top: 0;
}

.vr-results tbody tr:last-child > * {
    border-bottom-color: var(--hp-line-2);
}

.vr-results {
    table-layout: fixed;
}

.vr-results th:first-child {
    width: 216px;
}

.vr-results th:nth-child(2),
.vr-results .vr-rate {
    width: 148px;
}

.vr-results th:nth-child(3),
.vr-results .vr-cat {
    width: 34%;
}

.vr-results td {
    overflow-wrap: anywhere;
}

.vr-chapter {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vr-entry-code {
    display: block;
    font-family: var(--hp-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--hp-navy-2);
}

.vr-via {
    font-family: var(--hp-sans);
    font-weight: 400;
    color: var(--hp-mute);
}

.vr-none {
    color: var(--hp-mute);
}

.vr-added {
    display: flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 22px;
    margin-top: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--hp-acc-l);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--hp-navy-2);
}

/* A long text shows its beginning; "more" opens the rest. */
.vr-long > summary {
    list-style: none;
    cursor: pointer;
}

.vr-long > summary::-webkit-details-marker {
    display: none;
}

.vr-long[open] .vr-short {
    display: none;
}

.vr-toggle::after {
    content: 'more';
}

.vr-long[open] .vr-toggle::after {
    content: 'Show less';
}

.vr-toggle,
.vr-comment > summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-navy-2);
    text-decoration: underline;
    text-decoration-color: var(--hp-line-2);
    text-underline-offset: 3px;
}

.vr-long > summary:hover .vr-toggle,
.vr-comment > summary:hover {
    text-decoration-color: var(--hp-acc);
}

.vr-long > p,
.vr-comment > p {
    margin: 4px 0 0;
}

.vr-comment {
    margin-top: 8px;
}

.vr-comment > summary {
    cursor: pointer;
}

.vr-comment > p {
    font-size: 14px;
    color: var(--hp-mute);
}

.vr-more td {
    padding-block: 6px 12px;
}

.vr-empty {
    max-width: 720px;
    margin-top: 24px;
}

.vr-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 12px;
}

.vr-source {
    max-width: 960px;
}

/* — Cards instead of a table. The results need four columns and switch
     early (next to the context column there is no room for them below
     1200 px); the overview only on phones — */
@media (max-width: 1199.98px) {
    .vr-results,
    .vr-results tbody,
    .vr-results tr,
    .vr-results th,
    .vr-results td {
        display: block;
    }

    .vr-results thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .vr-results tbody th,
    .vr-results tbody td,
    .vr-results .vr-rate,
    .vr-results .vr-cat {
        width: auto;
        padding: 0;
        border: 0;
    }

    .vr-results tbody {
        margin-bottom: 12px;
        padding: 16px;
        border: 1px solid var(--hp-line);
        border-radius: 10px;
        background: #fff;
    }

    .vr-results tbody tr {
        display: grid;
        gap: 10px;
    }

    .vr-results tbody tr + tr {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--hp-line);
    }

    .vr-results tbody tr > :empty {
        display: none;
    }

    .vr-results td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-family: var(--hp-mono);
        font-size: 11.5px;
        font-weight: 500;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--hp-mute);
    }

    /* The rate needs no label: chip and group side by side. */
    .vr-results td.vr-rate::before {
        content: none;
    }

    .vr-results td.vr-rate {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 10px;
    }

    .vr-chapter {
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    .vr-search-row {
        flex-direction: column;
    }

    .vr-sort-select {
        display: grid;
        gap: 6px;
        max-width: 280px;
    }

    .vr-rates,
    .vr-rates tbody,
    .vr-rates tr,
    .vr-rates th,
    .vr-rates td {
        display: block;
    }

    .vr-rates thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .vr-rates tbody th,
    .vr-rates tbody td {
        padding: 0;
        border: 0;
    }

    .vr-rates tbody {
        display: grid;
        gap: 12px;
    }

    .vr-rates tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px 16px;
        align-items: center;
        padding: 16px;
        border: 1px solid var(--hp-line);
        border-radius: 10px;
        background: #fff;
    }

    .vr-rates tbody tr:hover {
        background: #fff;
    }

    .vr-rates td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-family: var(--hp-mono);
        font-size: 11.5px;
        font-weight: 500;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: var(--hp-mute);
    }

    .vr-rates td.vr-std-cell {
        text-align: right;
    }

    .vr-rates td.vr-wide {
        grid-column: 1 / -1;
    }

    .vr-pick,
    .vr-countries > summary {
        min-height: 44px;
    }

    .vr-comment > summary,
    .vr-long > summary {
        padding-block: 6px;
    }

    .vr-countries {
        position: static;
    }

    .vr-countries-panel {
        position: static;
        width: auto;
        margin-top: 8px;
        box-shadow: none;
    }
}
