:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --google-color: #10b981;
    --ai-color: #3b82f6;
    --border-color: #e2e8f0;
    --radius: 12px;

    /* Categorische kleuren per "Gebruik"-type (gevalideerd op CVD-toegankelijkheid) */
    --usecase-vraag: #3b82f6;
    --usecase-code: #eb6834;
    --usecase-afbeelding: #4a3aa7;
    --usecase-video: #e34948;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
}

body {
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

.page {
    max-width: 800px;
    width: 100%;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 0 4px;
}

.nav-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.nav-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--ai-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: underline;
}

.nav-link-active {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

select {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    background: #fff;
    color: var(--text-main);
}

select:focus {
    border-color: var(--ai-color);
}

.combobox {
    position: relative;
}

.combobox input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
}

.combobox input[type="text"]:focus {
    border-color: var(--ai-color);
}

.combobox-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.combobox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.88rem;
}

.combobox-option:hover {
    background: #f1f5f9;
}

.combobox-option-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.combobox-option-label {
    flex: 1;
}

.combobox-option-factor {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.total-row td {
    font-weight: 800;
    border-top: 2px solid var(--border-color);
}

.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 8px 0 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.legend-swatch.google {
    background: var(--google-color);
}

.legend-swatch.ai {
    background: var(--ai-color);
}

.legend-swatch.baseline {
    background: #cbd5e1;
}

.bar-chart {
    margin-top: 12px;
    margin-bottom: 4px;
}

.bar-chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.bar-mark {
    height: 100%;
    border-radius: 0 4px 4px 0;
    transition: width 0.3s ease;
}

.bar-mark.google {
    background: var(--google-color);
}

.bar-mark.ai {
    background: var(--ai-color);
}

.bar-value {
    min-width: 90px;
    text-align: right;
    font-weight: 700;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.stacked-bar-wrap {
    margin-top: 18px;
}

.stacked-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.stacked-bar-callout {
    font-weight: 800;
    color: var(--text-main);
}

.stacked-bar {
    display: flex;
    gap: 2px;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--card-bg);
}

.stacked-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.stacked-segment.baseline {
    background: #cbd5e1;
    border-radius: 4px 0 0 4px;
}

.stacked-segment.ai {
    background: var(--ai-color);
    border-radius: 0 4px 4px 0;
}

.usecase-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.usecase-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fafafa;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.usecase-btn:hover {
    background: #f1f5f9;
}

.usecase-btn.active {
    border-color: var(--ai-color);
    border-width: 2px;
    background: #eff6ff;
}

.usecase-btn-icon {
    font-size: 1.4rem;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.button-row .reveal-button {
    flex: 1;
    min-width: 160px;
}

.reveal-button {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ai-color);
    background: #eff6ff;
    border: 1px solid var(--ai-color);
    border-radius: var(--radius);
    cursor: pointer;
    margin: 4px 0 10px;
}

.reveal-button:hover {
    background: #dbeafe;
}

.entries-table .emoji-cell {
    text-align: center;
    font-size: 1.15rem;
    padding: 8px 6px;
}

.entries-table th,
.entries-table td {
    padding: 8px 8px;
}

.save-button {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--ai-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    margin: 4px 0 8px;
}

.save-button:hover {
    filter: brightness(0.95);
}

.entries-table td,
.entries-table th {
    white-space: normal;
}

.remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
}

.remove-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.bar-mark.usecase-vraag {
    background: var(--usecase-vraag);
}

.bar-mark.usecase-code {
    background: var(--usecase-code);
}

.bar-mark.usecase-afbeelding {
    background: var(--usecase-afbeelding);
}

.bar-mark.usecase-video {
    background: var(--usecase-video);
}

.legend-swatch.usecase-vraag {
    background: var(--usecase-vraag);
}

.legend-swatch.usecase-code {
    background: var(--usecase-code);
}

.legend-swatch.usecase-afbeelding {
    background: var(--usecase-afbeelding);
}

.legend-swatch.usecase-video {
    background: var(--usecase-video);
}

@media (max-width: 500px) {
    .usecase-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

.calculator-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 100%;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

h3.section-heading {
    font-size: 1rem;
    margin-top: 28px;
    margin-bottom: 4px;
}

.tile-group-heading {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 22px;
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--ai-color);
    border-bottom-color: var(--ai-color);
}

.tab-panel:first-of-type {
    margin-top: 0;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.control-group {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.value-badge {
    color: var(--ai-color);
    font-weight: 700;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #cbd5e1;
    border-radius: 3px;
    outline: none;
    accent-color: var(--ai-color);
}

.query-form {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.query-form input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
}

.query-form input[type="text"]:focus {
    border-color: var(--ai-color);
}

.query-form button {
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--ai-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}

.query-form button:disabled {
    background: #93c5fd;
    cursor: default;
}

.status-line {
    min-height: 1.4em;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 20px;
}

.metric-box {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    background: #fafafa;
    position: relative;
}

.metric-box.google {
    border-top: 4px solid var(--google-color);
}

.metric-box.ai {
    border-top: 4px solid var(--ai-color);
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.metric-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.metric-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.bar-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.google .bar-fill {
    background: var(--google-color);
}
.ai .bar-fill {
    background: var(--ai-color);
}

.savings-banner {
    margin-top: 20px;
    padding: 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    color: #065f46;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.fun-fact {
    margin-top: 20px;
    padding: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    color: #1e3a8a;
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
}

.equivalents-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.session-stats,
.world-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.world-stats {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

/* 12-koloms grid: elke tegel krijgt een span op basis van het aantal items
   in díe specifieke rij (12 / aantal), zodat de rij altijd precies opvult. */
.world-stats.grid-12 {
    grid-template-columns: repeat(12, 1fr);
}

.world-stats.grid-12 > .stat-tile {
    grid-column: span var(--tile-span, 3);
}

.world-stats.grid-12.items-2 {
    --tile-span: 6;
}

.world-stats.grid-12.items-3 {
    --tile-span: 4;
}

.world-stats.grid-12.items-4 {
    --tile-span: 3;
}

.world-stats.grid-12.items-6 {
    --tile-span: 2;
}

.stat-tile {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 12px;
    background: #fafafa;
    text-align: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.3;
}

.stat-icon {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-caption {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.25;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

table.scenario-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.scenario-table th,
.scenario-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    white-space: nowrap;
}

.scenario-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    font-weight: 700;
}

.scenario-table .row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.scenario-table .row-icon {
    font-size: 1.1rem;
}

.scenario-table .cell-value {
    font-weight: 700;
}

.scenario-table .cell-extra {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: normal;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
}

@media (max-width: 500px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .session-stats {
        grid-template-columns: 1fr;
    }

    .world-stats {
        grid-template-columns: 1fr;
    }

    .world-stats.grid-12 {
        grid-template-columns: 1fr;
    }

    .world-stats.grid-12 > .stat-tile {
        grid-column: span 1;
    }

    .query-form {
        flex-direction: column;
    }
}
