/*
 * "Statni kasa 2027" infographic (/rozpocet2027).
 * The page is built from Bootstrap 5 components and utilities plus hlidac.css (.hs-tags, .tag, .btn);
 * only the charts, the receipt and a few layout grids live here, scoped under .hs-kasa with the hsk- prefix.
 * Tokens mirror the Hlidac statu design system (colors_and_type.css of the design project).
 */
.hs-kasa {
    --hsk-ink: #28313B;
    --hsk-ink-2: #3D4651;
    --hsk-muted: #6F6F6F;
    --hsk-line: #E0E6ED;
    --hsk-line-strong: #C5CFDB;
    --hsk-gap: #E5323C;
    --hsk-gap-soft: #FFC2C5;
    --hsk-s1: #0074E4;
    --hsk-s1-soft: #A9CFF5;
    --hsk-s2: #FFA82F;
    --hsk-s3: #38CAAA;
    --hsk-s4: #003688;
    --hsk-s5: #8EC3F5;
    --hsk-s6: #8A94A3;
    --hsk-free: #FFA82F;
    --hsk-saved: #38CAAA;
    --hsk-tip-bg: #28313B;
    --hsk-band-bg: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), #003688;
    --hsk-band-surface: rgba(0, 0, 0, .15);
    --hsk-radius: 12px;
    --hsk-dur: .35s;
    /* Bootstrap tokens re-pointed at the design system so utilities (.bg-body-tertiary, .text-body-secondary,
       .border, .rounded-3, .progress) render in Hlidac statu colors inside the page. */
    --bs-body-color: #28313B;
    --bs-body-color-rgb: 40, 49, 59;
    --bs-secondary-color: #6F6F6F;
    --bs-border-color: #E0E6ED;
    --bs-tertiary-bg: #F0F3F7;
    --bs-tertiary-bg-rgb: 240, 243, 247;
    --bs-border-radius-lg: 12px;
    font-family: 'Cabin', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: .3px;
    color: var(--hsk-ink);
}

.hs-kasa h1, .hs-kasa h2, .hs-kasa h3, .hs-kasa h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: .6px;
    text-wrap: balance;
    color: inherit;
}

.hs-kasa p {
    margin: 0;
    max-width: 68ch;
}

.hs-kasa .lead {
    color: var(--hsk-ink-2);
}

.hs-kasa [tabindex]:focus-visible {
    outline: 2px solid var(--hsk-s1);
    outline-offset: 2px;
}

.hsk-h1 {
    max-width: 20ch;
    line-height: 1.05;
}

.hsk-stat {
    font-weight: 700;
    font-size: clamp(24px, 2.6vw, 34px);
    line-height: 1.1;
    letter-spacing: .6px;
    font-variant-numeric: tabular-nums;
}

.hsk-num {
    font-variant-numeric: tabular-nums;
}

.hsk-gap {
    color: var(--hsk-gap);
}

.hsk-ink-2 {
    color: var(--hsk-ink-2);
}

.hsk-border-strong {
    border-top-color: var(--hsk-line-strong) !important;
}

.hsk-dim {
    opacity: .2;
}

.hsk-fade, .hsk-cell, .hsk-seg, .hs-kasa .list-group-item, .hsk-strip-labels span {
    transition: opacity var(--hsk-dur) ease, background var(--hsk-dur) ease;
}

.hsk-hover:hover {
    background: var(--bs-tertiary-bg);
}

.hsk-sw {
    display: inline-block;
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: var(--c);
}

/* ---------- sections ---------- */
.hsk-sec {
    padding-block: clamp(16px, 3vw, 36px);
}

.hsk-sec + .hsk-sec {
    border-top: 1px solid var(--hsk-line);
}

/* Full-width dark band (debt section). */
.hsk-band {
    background: var(--hsk-band-bg);
    color: #fff;
    --hsk-ink: #fff;
    --hsk-ink-2: #E0E6ED;
    --hsk-muted: #B8C7DC;
    --hsk-line: rgba(255, 255, 255, .14);
    --hsk-line-strong: rgba(255, 255, 255, .32);
    --hsk-s1: #369CFF;
    --hsk-s1-soft: rgba(54, 156, 255, .45);
    --hsk-s4: #FFA82F;
    --hsk-gap: #FF7A81;
    --hsk-gap-soft: rgba(255, 122, 129, .4);
    --bs-body-color: #fff;
    --bs-secondary-color: #B8C7DC;
    --bs-border-color: rgba(255, 255, 255, .14);
}

.hsk-band .text-primary {
    color: #369CFF !important;
}

.hsk-band .bg-body-tertiary {
    background-color: var(--hsk-band-surface) !important;
}

/* Mosaic grids: tiles touch with a 4px gap and share one rounded outline (HS data-grid). */
.hsk-tiles, .hsk-cards, .hsk-charts {
    grid-template-columns: minmax(0, 1fr);
}

.hsk-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hsk-quant {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 576px) {
    .hsk-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hsk-quant {
        grid-template-columns: repeat(9, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .hsk-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hsk-cards, .hsk-charts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ---------- hero chart ---------- */
.hsk-hc-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.hsk-hc-label {
    display: grid;
    gap: 2px;
}

.hsk-hc-track {
    position: relative;
    height: 46px;
}

.hsk-hc-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 0 4px 4px 0;
}

.hsk-hc-gapbar {
    position: absolute;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(135deg, var(--hsk-gap) 0 2px, transparent 2px 7px);
    border-radius: 0 4px 4px 0;
    box-shadow: inset 0 0 0 1.5px var(--hsk-gap);
}

.hsk-hc-note {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--hsk-gap);
    white-space: nowrap;
    text-align: right;
}

.hsk-hc-axis-row {
    align-items: start;
}

.hsk-hc-axis {
    position: relative;
    height: 22px;
    margin-top: 30px;
}

.hsk-hc-axis::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -6px;
    border-top: 1px solid var(--hsk-line-strong);
}

.hsk-hc-axis span {
    position: absolute;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--hsk-muted);
    white-space: nowrap;
}

.hsk-hc-axis span:first-child {
    transform: none;
}

@media (max-width: 575.98px) {
    .hsk-hc-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .hsk-hc-axis-row > :first-child,
    .hsk-hc-axis span:nth-child(even) {
        display: none;
    }

    .hsk-hc-label {
        grid-template-columns: auto auto;
        justify-content: start;
        align-items: baseline;
        gap: 10px;
    }
}

/* ---------- revenue waffle ---------- */
.hsk-waffle {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1;
}

.hsk-cell {
    border-radius: 2px;
    background: var(--c);
}

/* Horizontal bar lists (excise taxes, ministries) built on Bootstrap .progress, drawn without a track. */
.hsk-bar {
    --bs-progress-bg: transparent;
    --bs-progress-border-radius: 0 2px 2px 0;
    --bs-progress-height: 10px;
    --bs-progress-bar-bg: var(--hsk-s1);
}

.hsk-bar--lg {
    --bs-progress-height: 12px;
}

.hsk-bar--other {
    --bs-progress-bar-bg: var(--hsk-line-strong);
}

.hsk-val {
    min-width: 7.5em;
}

/* ---------- segmented strips (spending areas, mandatory spending) ---------- */
.hsk-strip, .hsk-strip-labels {
    display: flex;
    gap: 2px;
}

.hsk-strip {
    height: 64px;
}

.hsk-seg {
    flex: var(--w) 1 0;
    min-width: 0;
    background: var(--c);
}

.hsk-seg:first-child {
    border-radius: 4px 0 0 4px;
}

.hsk-seg:last-child {
    border-radius: 0 4px 4px 0;
}

.hsk-strip-labels {
    margin-bottom: -8px;
}

.hsk-strip-labels span {
    flex: var(--w) 1 0;
    min-width: 0;
    padding-left: 2px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.hsk-mand {
    display: flex;
    align-items: flex-end;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    color: #fff;
}

.hsk-mand--law {
    --c: var(--hsk-s4);
}

.hsk-mand--quasi {
    --c: var(--hsk-s1);
}

.hsk-mand--free {
    background: repeating-linear-gradient(135deg, var(--hsk-free) 0 2px, transparent 2px 7px);
    box-shadow: inset 0 0 0 2px var(--hsk-free);
    color: var(--hsk-ink);
}

.hsk-mand--free span {
    background: #fff;
    padding: 1px 6px;
    border-radius: 2px;
}

/* ---------- receipt ---------- */
.hsk-receipt {
    --tooth: 14px;
    display: grid;
    gap: 14px;
    padding: 28px 24px calc(28px + var(--tooth));
    background: var(--bs-tertiary-bg);
    font-family: var(--bs-font-monospace);
    font-size: 13.5px;
    letter-spacing: 0;
    -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
    mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
}

.hsk-rc-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .2em;
}

.hsk-rc-meta {
    font-size: 12px;
    color: var(--hsk-muted);
}

.hsk-rc-rule {
    border-top: 1.5px dashed var(--hsk-line-strong);
}

.hsk-rc-line {
    display: flex;
    align-items: baseline;
}

.hsk-rc-name {
    display: inline-flex;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
}

.hsk-rc-name .hsk-sw {
    width: 9px;
    height: 9px;
    transform: translateY(-1px);
}

.hsk-rc-dots {
    flex: 1 1 auto;
    min-width: 16px;
    margin: 0 8px;
    border-bottom: 1.5px dotted var(--hsk-line-strong);
    transform: translateY(-4px);
}

.hsk-rc-val {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.hsk-rc-bar {
    height: 4px;
    margin-left: 17px;
}

.hsk-rc-bar span {
    display: block;
    height: 100%;
    min-width: 2px;
    background: var(--c);
    border-radius: 0 2px 2px 0;
}

.hsk-rc-hint {
    margin-left: 17px;
    font-family: 'Cabin', system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: .3px;
    color: var(--hsk-muted);
}

.hsk-rc-total {
    font-weight: 700;
    font-size: 15px;
}

.hsk-rc-sub {
    font-size: 13px;
    color: var(--hsk-ink-2);
}

.hsk-rc-sub--gap .hsk-rc-val, .hsk-rc-sub--gap .hsk-rc-label {
    color: var(--hsk-gap);
}

@media (max-width: 575.98px) {
    .hsk-receipt {
        padding-inline: 14px;
        font-size: 12.5px;
    }
}

/* ---------- column charts ---------- */
.hsk-cc {
    --axis: 46px;
    display: grid;
    gap: 6px;
}

.hsk-cc-plot {
    position: relative;
    height: 210px;
    margin-left: var(--axis);
}

.hsk-cc-tick {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px solid var(--hsk-line);
}

.hsk-cc-tick--zero {
    border-top-color: var(--hsk-line-strong);
}

.hsk-cc-tick span {
    position: absolute;
    right: calc(100% + 6px);
    top: 0;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--hsk-muted);
    white-space: nowrap;
}

.hsk-cc-bars, .hsk-cc-x {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    gap: 4px;
}

.hsk-cc-bars {
    position: absolute;
    inset: 0;
}

.hsk-cc-col {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.hsk-cc--inv .hsk-cc-col {
    justify-content: flex-start;
}

.hsk-cc-bar {
    width: min(100%, 40px);
    height: calc(var(--h) * 100%);
    background: var(--c);
    border-radius: 4px 4px 0 0;
}

.hsk-cc--inv .hsk-cc-bar {
    border-radius: 0 0 4px 4px;
}

.hsk-cc-val {
    position: absolute;
    left: 50%;
    bottom: calc(var(--h) * 100% + 4px);
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--hsk-ink);
}

.hsk-cc--inv .hsk-cc-val {
    bottom: auto;
    top: calc(var(--h) * 100% + 4px);
}

.hsk-cc-col:first-child .hsk-cc-val {
    left: 0;
    transform: none;
}

.hsk-cc-col:last-child .hsk-cc-val {
    left: auto;
    right: 0;
    transform: none;
}

.hsk-cc-x {
    margin-left: var(--axis);
}

.hsk-cc-x span {
    text-align: center;
    font-size: 11px;
    color: var(--hsk-muted);
    white-space: nowrap;
}

.hsk-cc-x span.is-hl {
    color: var(--hsk-ink);
    font-weight: 700;
}

.hsk-cc--thin .hsk-cc-x span:nth-child(odd) {
    visibility: hidden;
}

.hsk-unit {
    font-size: 13px;
    color: var(--hsk-muted);
}

/* ---------- pension deciles ---------- */
.hsk-q {
    font-size: 11px;
}

.hsk-q-num {
    font-size: 12.5px;
}

/* Valorization table header in the HS label style. */
.hsk-table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bs-secondary-color);
    border-bottom: 2px solid var(--hsk-line-strong);
}

.hsk-table td, .hsk-table th {
    white-space: nowrap;
    vertical-align: top;
}

/* ---------- simulator ---------- */
.hsk-simbar {
    --bs-progress-height: 18px;
    --bs-progress-bg: var(--hsk-gap-soft);
    --bs-progress-bar-bg: var(--hsk-saved);
    --bs-progress-border-radius: 4px;
}

/* ---------- approval steps ---------- */
.hsk-steps {
    counter-reset: step;
}

.hsk-step {
    counter-increment: step;
    position: relative;
    display: grid;
    gap: 6px;
    align-content: start;
}

.hsk-step::before {
    content: counter(step);
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hsk-s1);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.hsk-step-when {
    font-size: 12px;
    font-weight: 700;
    color: var(--hsk-s1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (min-width: 992px) {
    .hsk-step::after {
        content: "";
        position: absolute;
        /* From this circle to the next one, across the column gutter. */
        left: calc(36px + var(--bs-gutter-x) * .5);
        right: calc(var(--bs-gutter-x) * -.5);
        top: 18px;
        border-top: 2px solid var(--hsk-line);
    }

    .hsk-step:last-child::after {
        display: none;
    }

    .hsk-step-when {
        margin-top: 6px;
    }
}

@media (max-width: 991.98px) {
    .hsk-step {
        grid-template-columns: 36px minmax(0, 1fr);
        column-gap: 14px;
    }

    .hsk-step::before {
        grid-row: 1 / span 3;
    }
}

/* ---------- tooltip ---------- */
.hsk-tip {
    position: fixed;
    z-index: 1080;
    pointer-events: none;
    max-width: 270px;
    padding: 8px 12px;
    border-radius: 4px;
    background: var(--hsk-tip-bg);
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.hsk-tip .t-num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .hs-kasa * {
        transition: none !important;
    }
}
