/* Colours taken from marktupdate.kikker.nl */
:root {
    --brand: oklch(47.8% .115 152.5);
    --brand-foreground: oklch(99.5% 0 0);
    --ink: oklch(24.5% .045 152.5);
    --text: oklch(37.5% .021 152.5);
    --muted: oklch(55% .021 152.5);
    --tint: oklch(95.5% .021 152.5);
    --tint-2: oklch(92.5% .032 152.5);
    --border: oklch(92.5% .014 152.5);
    --card: oklch(100% 0 0);
    --shadow-card: 0 10px 30px 0 oklch(35% .09 152.5 / .1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card);
    color: var(--text);
    font-family: Poppins, ui-sans-serif, system-ui, sans-serif;
    font-size: 16.5px;
    line-height: 1.6;
}

.site-header { background: var(--brand); }
.site-header__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
}
.site-header img { display: block; height: 34px; width: auto; }

.hero {
    height: 56px;
    background: linear-gradient(to bottom, var(--tint), var(--card));
}

.content {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 20px 40px;
}
.content--wide { max-width: 1400px; }

h1 {
    margin: 0 0 24px;
    color: var(--ink);
    font-size: clamp(1.75rem, 4.6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
}

h2 {
    margin: 44px 0 12px;
    color: var(--ink);
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 600;
    line-height: 1.25;
}

.pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--tint-2);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
}

.meta {
    margin: 14px 0 6px;
    color: var(--muted);
    font-size: 13.5px;
}

.card {
    padding: 24px 20px;
    border: 1px solid var(--tint-2);
    border-radius: 26px;
    background: var(--tint);
}

.card--highlight { text-align: center; }
.card__label { margin: 0 0 4px; font-weight: 500; }
.card__amount {
    margin: 0;
    color: var(--brand);
    font-size: clamp(2rem, 6vw, 2.8rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.card__breakdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 40px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--tint-2);
}
.card__breakdown dt { font-size: 13.5px; }
.card__breakdown dd {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.lead { margin: 0 0 24px; }
.lead strong { color: var(--ink); font-weight: 600; }

.muted { color: var(--muted); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Splash (no / unknown uuid) --- */
body.is-splash {
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--tint), var(--card));
}
.splash {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    padding: 16px;
}
.splash__logo {
    width: min(420px, 70vw);
    height: auto;
}

/* --- Product icons --- */
.product-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow-card);
}
.product-icon--elk { color: oklch(72% .16 80); }
.product-icon--gas { color: oklch(58% .17 250); }

/* --- EAN list --- */
.ean-list { margin: 0; padding: 0; list-style: none; }
.ean-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
}
.ean-list li + li { border-top: 1px solid var(--tint-2); }
.ean-list__code {
    color: var(--ink);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.ean-list__product { margin-left: auto; color: var(--muted); font-size: 14px; }

/* --- Tables --- */
.card--flush { padding: 8px 12px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data { width: 100%; border-collapse: collapse; font-size: 15px; }
.data th {
    padding: 10px 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.data th.num { text-align: right; }
.data td { padding: 10px 8px; border-top: 1px solid var(--tint-2); vertical-align: top; }
.data tfoot td { color: var(--ink); font-weight: 600; border-top: 2px solid var(--tint-2); }
.data tr.is-projected td { color: var(--muted); font-style: italic; }
.data--compact { font-size: 13.5px; }
.data--compact th { font-size: 12px; }
.data--compact td { padding: 8px; }

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--card);
    color: var(--ink);
    font-size: 12px;
    font-weight: 600;
}
.bracket {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 6px;
    background: var(--tint-2);
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 600;
}

/* --- Usage totals --- */
.total {
    margin-bottom: 10px;
    border: 1px solid var(--tint-2);
    border-radius: 20px;
    background: var(--tint);
    overflow: hidden;
}
.total__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
}
.total__summary::-webkit-details-marker { display: none; }
.total__summary::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(-45deg);
    transition: transform .15s;
}
.total[open] > .total__summary::before { transform: rotate(45deg); }
.total[data-empty] > .total__summary { cursor: default; }
.total[data-empty] > .total__summary::before { visibility: hidden; }
.total__name { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.total__amounts, .period__amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-left: auto;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.total__amounts small, .period__amounts small { color: var(--muted); font-size: 11.5px; }
.total__incl { color: var(--ink); font-weight: 600; }

.period {
    margin: 0 10px 10px;
    padding: 12px 12px 6px;
    border-radius: 16px;
    background: var(--card);
}
.period__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 6px;
}
.period__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.period__title .product-icon { width: 26px; height: 26px; box-shadow: none; background: var(--tint); }
.period__dates { color: var(--ink); font-size: 14px; font-weight: 500; }

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: var(--tint);
}
.site-footer__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px;
    font-size: 14px;
}
.site-footer p { margin: 0; }

.link { color: var(--brand); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.link:hover { text-decoration: underline; }

/* --- Explanation (collapsible, closed by default) --- */
.explainer {
    margin-top: 24px;
    border: 1px solid var(--tint-2);
    border-radius: 26px;
    background: var(--tint);
}
.explainer__summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}
.explainer__summary::-webkit-details-marker { display: none; }
.explainer__summary::before {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(-45deg);
    transition: transform .15s;
}
.explainer[open] > .explainer__summary::before { transform: rotate(45deg); }
.explainer__summary h2 { margin: 0; font-size: clamp(1.1rem, 2.6vw, 1.35rem); }
.explainer__body { padding: 0 20px 20px; }
.explainer__body p { margin: 0 0 14px; }

.zoom {
    position: relative;
    display: block;
    margin-top: 24px;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    cursor: zoom-in;
}
.zoom img { display: block; width: 100%; height: auto; }
.zoom__hint {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    background: oklch(100% 0 0 / .9);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    opacity: 0;
    transition: opacity .15s;
}
.zoom:hover .zoom__hint, .zoom:focus-visible .zoom__hint { opacity: 1; }

.lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 16px;
    border: 0;
    background: transparent;
    cursor: zoom-out;
}
.lightbox::backdrop { background: oklch(20% .03 152.5 / .85); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 16px;
}
.lightbox__close {
    position: fixed;
    top: 12px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: var(--card);
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

/* --- Good to know (bottom) --- */
.card--info {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 44px;
}
.card--info h2 { margin: 0 0 8px; font-size: 1.25rem; }
.card--info p { margin: 0; }
.info-icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: oklch(80% .17 130);
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    font-family: Georgia, serif;
}

.pill--projected {
    margin-right: 6px;
    padding: 1px 10px;
    background: oklch(92% .07 85);
    color: oklch(38% .08 70);
    font-size: 11.5px;
    vertical-align: 1px;
}

/* --- Admin controls --- */
.admin-controls { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.admin-controls__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.admin-controls__row label, .admin-controls__columns legend { color: var(--ink); font-size: 14px; font-weight: 600; }
.admin-controls__columns { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; border: 0; }
.admin-controls__columns legend { margin-bottom: 8px; padding: 0; }
.select {
    min-width: min(100%, 360px);
    padding: 8px 12px;
    border: 1px solid var(--tint-2);
    border-radius: 12px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
}
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--brand); }
.check input:disabled + * , .check:has(input:disabled) { color: var(--muted); cursor: default; }
.button {
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: var(--brand-foreground);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
