/* Stijlen, uit base.html gehaald */

            @font-face {
                font-family: "PPPalma";
                src: url("/static/fonts/PPPalma-FizzyHeavy.woff2")
                    format("woff2");
                font-weight: 900;
                font-style: normal;
                font-display: swap;
            }

            :root {
                --bg: #c3ddff; /* near black */
                --surface: #eaf3ff; /* light gray cards */
                --surface2: #cdcec9; /* medium gray — table headers */
                --border: #b8b9b4; /* subtle card border */
                --border2: #d0d1cb; /* even subtler */
                --gold: #c8c040; /* muted yellow — primary accent */
                --gold-lt: #fff35f; /* bright yellow — headings on dark */
                --gold-dim: #9a9b96; /* medium gray — secondary text */
                --gold-pale: #111111; /* near black — text inside light cards */
                --muted: #9a9b96; /* medium gray — visible on dark + light */
                --green: #1dbc00; /* bright green */
                --red: #ff6161;
                /* Merk- & UI-tokens — pas hier centraal de kernkleuren aan */
                --brand: #fff35f; /* helder geel — accent/merk (knoppen, hero) */
                --table-head: #a6ccff; /* blauw — tabelkoppen */
                --ink: #111111; /* bijna zwart — donkere vlakken & tekst */
            }
            /* PPPalma for headings and big numbers */
            h1,
            h2,
            .fizzy {
                font-family:
                    "PPPalma",
                    -apple-system,
                    sans-serif;
            }
            h1 {
                color: #111111 !important;
                font-size: 38px !important;
                line-height: 1 !important;
                margin: 0;
            }
            .card-title {
                font-family:
                    "PPPalma",
                    -apple-system,
                    sans-serif;
                font-size: 19px !important;
                color: #111111 !important;
                font-weight: 900;
            }

            * {
                box-sizing: border-box;
            }
            body {
                background: var(--bg);
                color: #e5e6e1;
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
                min-height: 100vh;
                overflow-x: clip; /* prevent page-level horizontal scroll; keeps fixed nav in place */
            }
            /* Dark text inside light cards */
            .surface,
            .surface * {
                color: var(--gold-pale);
            }
            /* But let colored elements (pos/neg) override */
            .surface .pos {
                color: var(--green) !important;
            }
            .surface .neg {
                color: var(--red) !important;
            }
            .surface {
                background: var(--surface);
                border: none;
            }
            .surface2 {
                background: var(--surface2);
                border: 1px solid var(--border2);
            }

            /* Inputs */
            input,
            select,
            textarea {
                background: #ffffff !important;
                border: none !important;
                color: var(--gold-pale) !important;
                border-radius: 10px;
                padding: 10px 14px;
                font-size: 14px;
                width: 100%;
                appearance: none;
                -webkit-appearance: none;
                transition:
                    box-shadow 0.15s,
                    background 0.15s;
            }
            input:hover,
            select:hover,
            textarea:hover {
                background: #f8f8f8 !important;
            }
            input:focus,
            select:focus,
            textarea:focus {
                outline: none !important;
                background: #ffffff !important;
                box-shadow: 0 0 0 3px rgba(168, 114, 32, 0.2) !important;
            }

            /* Hide number spinners */
            input[type="number"]::-webkit-inner-spin-button,
            input[type="number"]::-webkit-outer-spin-button {
                -webkit-appearance: none;
                margin: 0;
            }
            input[type="number"] {
                -moz-appearance: textfield;
            }

            /* Custom select arrow */
            select {
                background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A87220' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E") !important;
                background-repeat: no-repeat !important;
                background-position: right 12px center !important;
                padding-right: 36px !important;
                cursor: pointer;
            }

            input[type="color"] {
                padding: 3px !important;
                width: 48px !important;
                height: 40px !important;
                cursor: pointer;
                border-radius: 8px !important;
            }
            input[type="checkbox"] {
                width: 16px !important;
                height: 16px !important;
                padding: 0 !important;
                border-radius: 4px !important;
                accent-color: var(--gold);
                appearance: auto !important;
                -webkit-appearance: auto !important;
            }

            /* Scrollbar: geen eigen styling — zo gebruikt de browser de
               native scrollbalk (op macOS de dunne, zelf-verbergende overlay).
               Zodra je ::-webkit-scrollbar globaal styelt, dwing je juist een
               permanente, brede 'eigen' balk af. Losse scroll-containers
               (grafieken) verbergen hun balk apart via scrollbar-width/none. */

            /* ── Invoertabel: flush (geen kaart-bg), luchtige rijen ──────────
               Geen achtergrondvlak; rijen gescheiden door een lichte haarlijn,
               met een zachte afgeronde hover-pill. */
            .surface.table-flush {
                background: transparent;
            }
            /* Rustige, muted tabelkop (blauwe band weg); de ruimte tussen kop en rijen
               komt van border-spacing op de tabel. */
            .table-flush thead th {
                padding-bottom: 4px !important;
            }
            /* Elke rij als lichtblauwe balk met ronde uiteinden; de verticale ruimte
               ertussen komt van border-spacing (0 10px) op .entry-table. */
            .table-flush .trow td {
                background: #d2e5ff;
                transition: background 0.14s ease;
            }
            .table-flush .trow td:first-child {
                border-radius: 14px 0 0 14px;
            }
            .table-flush .trow td:last-child {
                border-radius: 0 14px 14px 0;
            }
            /* Hover: rij iets donkerder — de witte invoervelden blijven zo goed leesbaar. */
            .table-flush .trow:hover td {
                background: #bcd6fb;
            }

            /* Buttons */
            /* ── Buttons: één uniforme maat (font-size, padding, radius) ──── */
            .btn-primary {
                background: var(--gold-lt);
                color: #111111;
                font-weight: 700;
                padding: 9px 18px;
                border-radius: 999px;
                font-size: 13px;
                line-height: 1.4;
                border: none;
                cursor: pointer;
                display: inline-block;
                transition: background 0.15s;
            }
            .btn-primary:hover {
                background: var(--gold);
            }
            .btn-secondary {
                background: #222222;
                color: #9a9b96;
                font-weight: 600;
                padding: 9px 18px;
                border-radius: 999px;
                font-size: 13px;
                line-height: 1.4;
                border: none;
                cursor: pointer;
                text-decoration: none;
                display: inline-block;
                transition:
                    background 0.15s,
                    color 0.15s;
            }
            .btn-secondary:hover {
                background: #2a2a2a;
                color: #e5e6e1;
            }
            .btn-danger {
                background: #2a1414;
                color: #c08080;
                font-weight: 600;
                padding: 9px 16px;
                border-radius: 9px;
                font-size: 13px;
                line-height: 1.4;
                border: none;
                cursor: pointer;
                display: inline-block;
            }
            /* Knop met icoon ervoor */
            .btn-ico {
                display: inline-flex !important;
                align-items: center;
                gap: 7px;
            }
            .btn-ico svg { flex-shrink: 0; display: block; }

            /* ── Pagina-header met logo ─────────────────────────────────── */
            .page-header {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 20px;
                margin-bottom: 28px;
                flex-wrap: wrap;
            }
            .page-header .brand {
                display: flex;
                align-items: center;
                gap: 20px;
                min-width: 0;
            }
            .brand-logo {
                height: 72px;
                display: block;
                flex-shrink: 0;
                transition: transform 0.2s ease;
            }
            a:hover > .brand-logo {
                transform: rotate(-2deg) scale(1.04);
            }
            .brand-divider {
                width: 1px;
                height: 48px;
                background: rgba(0, 0, 0, 0.18);
                flex-shrink: 0;
            }
            .page-header h1 {
                margin: 0;
            }
            .page-header .page-sub {
                color: #111111;
                font-size: 13px;
                margin: 0;
            }
            @media (max-width: 640px) {
                .brand-logo { height: 50px; }
                .brand-divider { display: none; }
                .page-header { gap: 12px; }
            }
            /* Sticky logo linksboven in de viewport-hoek (dashboard) */
            .corner-logo {
                position: fixed;
                top: 18px;
                left: 22px;
                z-index: 120;
                display: block;
            }
            .corner-logo .brand-logo { height: 70px; }
            @media (max-width: 640px) {
                .corner-logo { top: 14px; left: 16px; }
                .corner-logo .brand-logo { height: 46px; }
            }

            /* ── Merk-hoek: tekst-lockup met speels zwevende nullen (alle pagina's) ── */
            .corner-brand {
                display: inline-flex; align-items: flex-start;
                text-decoration: none; padding: 4px 6px;
                animation: cb-in .9s cubic-bezier(.25,1,.4,1) both;
            }
            @keyframes cb-in { from { opacity: 0; transform: translateY(-8px); } }
            .corner-brand .cb-zeros {
                position: absolute; inset: 0; z-index: 0; pointer-events: none;
            }
            .corner-brand .cb-zero {
                position: absolute;
                font-family: "PPPalma", sans-serif;
                font-size: var(--s, 90px); line-height: 1;
                background: linear-gradient(135deg, #fff35f 0%, #a9c0ff 52%, #2145e6 100%);
                -webkit-background-clip: text; background-clip: text;
                color: transparent; opacity: .2;
                transform: rotate(var(--rot, 0deg));
                animation: cb-drift var(--d, 7s) ease-in-out var(--dl, 0s) infinite;
                will-change: transform;
                transition: opacity .3s ease;
            }
            @keyframes cb-drift {
                0%, 100% { transform: translateY(0)    rotate(var(--rot, 0deg)); }
                50%      { transform: translateY(-9px) rotate(calc(var(--rot, 0deg) + 4deg)); }
            }
            .corner-brand .cb-text {
                position: relative; z-index: 1;
                display: flex; flex-direction: column; gap: 3px;
            }
            .corner-brand .cb-title {
                font-size: 23px; line-height: 1; color: #111111;
                letter-spacing: -.5px; white-space: nowrap;
            }
            .corner-brand .cb-sub {
                font-size: 11.5px; font-weight: 600; color: var(--muted);
                letter-spacing: .2px; white-space: nowrap;
            }
            .corner-brand:hover .cb-title { color: #000; }
            .corner-brand:hover .cb-zero { opacity: .28; }
            @media (prefers-reduced-motion: reduce) {
                .corner-brand, .corner-brand .cb-zero { animation: none; }
            }
            @media (max-width: 640px) {
                .corner-brand .cb-title { font-size: 17px; }
                .corner-brand .cb-sub { font-size: 10px; }
                .corner-brand .cb-zero { opacity: .15; }
                .corner-brand .cb-zero:nth-child(1),
                .corner-brand .cb-zero:nth-child(3) { display: none; }
            }

            /* ── Gecentreerde paginatitel (o.a. Invoer, Vaste lasten) ──
               Witruimte boven de titel gelijk aan die boven het hoofdbedrag op
               het dashboard: main-padding (32px) + 40px, net als #hero. */
            .page-title { margin: 40px 0 24px; }
            .page-title h1 { margin: 0; }
            .page-title .page-sub { color: #111111; font-size: 13px; margin: 4px 0 0; }
            .page-title--center { text-align: center; }

            /* Nav active */
            .nav-active {
                color: var(--gold) !important;
            }
            .nav-active::after {
                content: "";
                display: block;
                height: 2px;
                background: var(--gold);
                border-radius: 1px;
                margin-top: 2px;
            }

            /* Positive / Negative */
            .pos { color: var(--green); }
            .neg { color: var(--red); }

            /* Currency input wrapper */
            .currency-input {
                display: flex;
                align-items: center;
                background: #ffffff;
                border-radius: 10px;
                padding: 12px 14px;
                gap: 4px;
                transition: box-shadow 0.15s;
            }
            .currency-input:focus-within {
                box-shadow: 0 0 0 3px rgba(168,114,32,.2);
            }
            .currency-input .symbol {
                color: var(--muted);
                font-size: 15px;
                flex-shrink: 0;
                user-select: none;
            }
            .currency-input input {
                flex: 1;
                min-width: 60px;
                text-align: right;
                background: transparent !important;
                border: none !important;
                border-radius: 0 !important;
                padding: 0 !important;
                box-shadow: none !important;
                font-size: 15px;
                width: auto;
            }

            /* Chart scroll wrapper */
            .chart-scroll {
                display: block;
                width: 100%;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }
            .chart-scroll::-webkit-scrollbar { display: none; }
            /* chart-inner geeft Chart.js een vaste breedte; de parent scrollt */
            .chart-inner {
                position: relative;
                min-width: 480px;
            }
            .chart-inner--donut {
                position: relative;
                min-width: 280px;
                max-width: 420px;
                margin: 0 auto;
            }
            /* Compacte secundaire grafieken: passen in een smalle kolom */
            .chart-inner--sm {
                min-width: 300px;
            }
            /* Grid-items mogen NIET breder worden dan hun kolom */
            #grid-charts2 > *,
            #grid-bottom > *,
            #stat-cards > * { min-width: 0; }

            /* Schuld peil wave */
            @keyframes schuld-wave {
              0%, 100% { transform: scaleX(1) translateY(0px); opacity: .35; }
              50%       { transform: scaleX(1.06) translateY(-3px); opacity: .55; }
            }
            .schuld-wave-surface {
              position: absolute; top: -5px; left: -10%; width: 120%; height: 10px;
              background: rgba(255,255,255,.5); border-radius: 50%;
              animation: schuld-wave 2.8s ease-in-out infinite;
            }

            /* Dashboard-secties */
            .drag-section { position: relative; margin-bottom: 24px; }

            /* ── Overzicht (desktop) ─────────────────────────────────────────────
               Twee secties ONDER elkaar: 'Deze maand' en daaronder 'Doelen'.
               Binnen elke sectie staan de kaarten naast elkaar. */
            #overview-row { display: block; margin-bottom: 28px; }
            #overview-left { position: relative; margin-bottom: 28px; }
            #goalsCard { position: relative; }

            /* Deze maand: 3 kaarten naast elkaar (past altijd) */
            #stat-cards {
              display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
              padding: 2px;   /* ruimte voor de kaart-schaduw */
            }

            /* Doelen: kaarten naast elkaar; horizontaal scrollen als er meer
               mijlpalen zijn dan er passen. Scrollbalk verborgen, hint-pijl aan. */
            #goalsCard .goals-list {
              flex-direction: row; gap: 20px;
              overflow-x: auto; overflow-y: hidden;
              scrollbar-width: none; scroll-snap-type: x proximity;
              padding: 2px;
            }
            #goalsCard .goals-list::-webkit-scrollbar { display: none; }
            /* flex-shrink:0 — anders persen de kaarten zich samen en ontstaat
               er nooit overflow (dus ook geen scroll/hint). */
            #goalsCard .goals-list > .goal-card {
              flex: 0 0 calc((100% - 40px) / 3);
              scroll-snap-align: start; flex-shrink: 0;
            }

            /* Hint-pijltje: verschijnt alleen als er nog te scrollen valt */
            .scroll-hint {
              position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
              width: 30px; height: 30px; border-radius: 50%;
              background: #ffffff; color: #2145e6;
              display: none; align-items: center; justify-content: center;
              box-shadow: 0 4px 14px rgba(0,0,0,.16);
              pointer-events: none; z-index: 6;
            }
            .scroll-hint.on { display: flex; }
            .scroll-hint svg { animation: hint-bob 1.8s ease-in-out infinite; }
            @keyframes hint-bob {
              0%, 100% { transform: translateY(0); }
              50%      { transform: translateY(3px); }
            }
            /* Horizontale variant (mobiel): pijl naar rechts, midden-rechts */
            .scroll-hint.horiz {
              left: auto; right: -4px; top: 50%; bottom: auto; transform: translateY(-50%);
            }
            .scroll-hint.horiz svg { animation: hint-bob-h 1.8s ease-in-out infinite; }
            @keyframes hint-bob-h {
              0%, 100% { transform: rotate(-90deg) translateY(0); }
              50%      { transform: rotate(-90deg) translateY(3px); }
            }

            /* ── Responsive ──────────────────────────────────────────────────── */
            @media (max-width: 900px) {
              /* Mobiel/tablet: stat-cards als full-width horizontale swipe-
                 carousel (scroll-snap, zonder zichtbaar scrollbalkje); Doelen
                 eronder. Extra ruimte boven, tussen de voortgangsbalk en de
                 swipe-blokken. */
              #overview-row { display: block; margin-top: 26px; margin-bottom: 12px; }
              #overview-left { margin-bottom: 12px; }
              #stat-cards {
                display: flex !important; flex-direction: row; flex-wrap: nowrap;
                gap: 12px; overflow-x: auto; overflow-y: hidden;
                max-height: none;
                scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
                margin-bottom: 12px;
              }
              #stat-cards::-webkit-scrollbar { display: none; }
              #stat-cards > * {
                flex: 0 0 100%; scroll-snap-align: start; min-width: 0;
              }
              #goalsCard { margin-bottom: 0; }

              /* Doelen op mobiel: door je mijlpalen swipen — zelfde
                 full-width carousel als de stat-cards hierboven. */
              #goalsCard .goals-list {
                flex-direction: row; flex-wrap: nowrap; gap: 12px;
                overflow-x: auto; overflow-y: hidden; max-height: none;
                scroll-snap-type: x mandatory;
                -webkit-overflow-scrolling: touch; scrollbar-width: none;
              }
              #goalsCard .goals-list::-webkit-scrollbar { display: none; }
              #goalsCard .goals-list > .goal-card {
                flex: 0 0 100%; scroll-snap-align: start; min-width: 0;
              }

              #grid-charts2,
              #grid-bottom                      { grid-template-columns: 1fr !important; }
            }

            @media (max-width: 640px) {
              main { padding: 16px 12px 80px !important; }
              h1   { font-size: 26px !important; }

              /* Gelijke verticale ruimte tussen ÁLLE dashboard-blokken op
                 mobiel: zowel de gaps binnen de grids/carousel als de marges
                 tussen hero, overzicht-rij en de secties zijn even groot. */
              #stat-cards, #grid-charts1, #grid-charts2,
              #grid-bottom                      { gap: 12px !important; }
              #hero, #hero-chart, #stat-cards,
              #overview-row,
              .drag-section                     { margin-bottom: 12px !important; }
              /* De doel-voortgangsbalk zit als laatste in #hero-chart; z'n
                 onder-marge 'collapse't' er doorheen. Gelijktrekken op 12px. */
              #goalProgress                     { margin-bottom: 12px !important; }

              /* Secundaire grafieken passen binnen de kolom i.p.v. een nutteloze
                 paar-pixel horizontale scroll te veroorzaken op mobiel */
              .chart-inner--sm { min-width: 0 !important; }

              /* Na/Voor-toggle: volle breedte op mobiel */
              .schuld-toggle {
                width: 100% !important;
                margin-left: 0 !important;
                box-sizing: border-box;
              }
              .schuld-toggle button { flex: 1; }

              /* Floating nav */
              #periodBtns {
                max-width: calc(100vw - 24px) !important;
              }

              /* Entry month nav */
              .month-nav-row { flex-wrap: wrap !important; gap: 8px !important; }

              .card-title { font-size: 15px !important; }
            }

            @media (max-width: 420px) {
              h1 { font-size: 22px !important; }
            }

            /* ── Toast meldingen ── */
            .flash-toast {
                display: inline-flex;
                align-items: center;
                gap: 9px;
                background: #111111;
                color: #ffffff;
                padding: 11px 18px;
                border-radius: 12px;
                font-size: 13px;
                font-weight: 600;
                box-shadow: 0 8px 24px rgba(0,0,0,.25);
                animation: toast-in .25s ease;
            }
            @keyframes toast-in {
                from { opacity: 0; transform: translateY(-10px); }
                to   { opacity: 1; transform: none; }
            }


            /* ── Account-knop in de onderbalk: alleen de foto/initiaal ── */
            #navUser { position: relative; display: flex; align-items: center; margin-left: 4px; }
            #navUserBtn {
                position: relative; z-index: 1;
                border: none; background: transparent; padding: 2px;
                border-radius: 50%; cursor: pointer; line-height: 0;
                display: inline-flex; transition: transform .15s;
            }
            #navUserBtn:hover { transform: scale(1.06); }
            #navUserBtn .u-avatar {
                width: 30px; height: 30px; border-radius: 50%;
                background: #fff35f; display: flex; align-items: center;
                justify-content: center; font-weight: 800; font-size: 13px;
                color: #111; flex-shrink: 0; overflow: hidden;
                box-shadow: 0 0 0 2px rgba(255,255,255,.22);
            }
            /* Profielfoto vult de cirkel; dan geen gele achtergrond meer */
            #navUserBtn .u-avatar.has-photo { background: transparent; }
            #navUserBtn .u-avatar img {
                width: 100%; height: 100%; object-fit: cover; display: block;
            }
            #navUser.open #navUserBtn .u-avatar { box-shadow: 0 0 0 2px var(--brand); }

            /* ── Menu: klapt omhoog, want de balk staat onderaan ── */
            #userDropdown {
                display: none; position: absolute; bottom: calc(100% + 12px); right: 0;
                min-width: 180px; background: #ffffff; border-radius: 12px; padding: 6px;
                box-shadow: 0 10px 30px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.10);
                z-index: 60; opacity: 0; transform: translateY(6px) scale(.98);
                pointer-events: none; transition: opacity .15s ease, transform .15s ease;
            }
            #navUser.open #userDropdown {
                display: block; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
            }
            .u-dd-item {
                display: flex; align-items: center; gap: 10px; width: 100%;
                padding: 9px 12px; border: none; border-radius: 8px;
                background: transparent; color: #111111;
                font-size: 13px; font-weight: 600; cursor: pointer;
                text-align: left; text-decoration: none; transition: background .1s;
            }
            .u-dd-item:hover { background: #f5f5f5; }
            .u-dd-item.danger { color: #e03c3c; }
            .u-dd-sep { height: 1px; background: #f0f0f0; margin: 4px 0; }

            /* ── Modal overlay ── */
            #settingsOverlay {
                display: none; position: fixed; inset: 0;
                background: rgba(0,0,0,.32);
                z-index: 500; align-items: center; justify-content: center; padding: 16px;
            }
            #settingsOverlay.open { display: flex; }

            /* ── Modal shell ── */
            #settingsModal {
                background: #eaf3ff; border-radius: 16px;
                border: 1px solid #cfe0f7;
                width: 680px; max-width: calc(100vw - 32px);
                height: 500px; max-height: calc(100vh - 64px);
                display: flex; flex-direction: column; overflow: hidden;
                box-shadow: 0 8px 40px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
                animation: smIn .15s ease;
            }
            @keyframes smIn {
                from { opacity: 0; transform: translateY(6px); }
                to   { opacity: 1; transform: translateY(0); }
            }

            /* Modal header */
            #smHeader {
                display: flex; align-items: center; justify-content: space-between;
                padding: 14px 18px 13px; border-bottom: 1px solid #cfe0f7;
                background: #eaf3ff; flex-shrink: 0;
            }
            #smHeader h2 {
                font-size: 15px !important; font-weight: 700; color: #111 !important;
                letter-spacing: -.2px; margin: 0;
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
            }
            #smCloseBtn {
                width: 26px; height: 26px; border-radius: 7px;
                border: none; background: #d9e8fb; color: #5a6b83;
                cursor: pointer; display: flex; align-items: center; justify-content: center;
                transition: background .12s, color .12s; flex-shrink: 0;
            }
            #smCloseBtn:hover { background: #c7dcf8; color: #111; }

            /* Two-column body */
            #smBody { display: flex; flex: 1; overflow: hidden; }

            /* Left sidebar */
            #smNav {
                width: 172px; flex-shrink: 0; background: #eaf3ff;
                border-right: 1px solid #cfe0f7; padding: 8px; overflow-y: auto;
            }
            .sm-nav-group {
                font-size: 10px; font-weight: 600; text-transform: uppercase;
                letter-spacing: .5px; color: #bbb; padding: 12px 8px 4px;
            }
            .sm-nav-group:first-child { padding-top: 6px; }
            .sm-nav-btn {
                display: flex; align-items: center; gap: 8px; width: 100%;
                padding: 7px 9px; border: none; border-radius: 7px;
                background: transparent; color: #666;
                font-size: 13px; font-weight: 500;
                cursor: pointer; text-align: left;
                transition: background .1s, color .1s;
                margin-bottom: 1px;
            }
            .sm-nav-btn svg { flex-shrink: 0; opacity: .7; }
            .sm-nav-btn:hover { background: #dceafc; color: #222; }
            .sm-nav-btn.active {
                background: #ffffff; color: #111; font-weight: 600;
                box-shadow: 0 1px 4px rgba(0,0,0,.10);
            }
            .sm-nav-btn.active svg { opacity: 1; }

            /* Right content */
            #smContent { flex: 1; overflow-y: auto; padding: 20px 22px 0; min-width: 0; background: #eaf3ff; }
            .sm-pane { display: none; }
            .sm-pane.active { display: block; }

            .sm-pane-title { font-size: 14px; font-weight: 700; color: #111; margin: 0 0 2px; letter-spacing: -.1px; }
            .sm-pane-desc  { font-size: 12px; color: #999; margin: 0 0 18px; line-height: 1.5; }
            .sm-sep        { height: 1px; background: #cfe0f7; margin: 16px 0; }
            .sm-section-label {
                font-size: 10px; font-weight: 600; text-transform: uppercase;
                letter-spacing: .5px; color: #bbb; margin: 0 0 8px;
            }
            .sm-badge {
                font-size: 10px; font-weight: 500; background: #d9e8fb; color: #7d8aa0;
                border-radius: 5px; padding: 1px 7px; vertical-align: middle;
            }

            /* Form */
            .sm-field { margin-bottom: 16px; }
            .sm-label {
                font-size: 11px; font-weight: 600; text-transform: uppercase;
                letter-spacing: .4px; color: #888; display: block; margin-bottom: 6px;
            }
            .sm-field-note { font-size: 11px; color: #aaa; margin: 5px 0 0; }
            /* Duidelijke invoervelden: zichtbare rand + lichte vulling, zodat ze
               opvallen op de witte modal-achtergrond (waren eerst wit-op-wit). */
            .sm-field input {
                background: #f7fbff !important;
                border: 1.5px solid #cfe0f7 !important;
                border-radius: 10px;
                padding: 11px 14px; font-size: 14px; color: #111 !important;
            }
            .sm-field input::placeholder { color: #b4b8bf; }
            .sm-field input:hover:not(:disabled) {
                background: #eef5ff !important; border-color: #b9d2f2 !important;
            }
            .sm-field input:focus {
                background: #ffffff !important; border-color: #111 !important;
                box-shadow: 0 0 0 3px rgba(17,17,17,.08) !important;
            }
            .sm-field input:disabled {
                background: #e3ecf8 !important; border-color: #d8e4f4 !important;
                opacity: .55; cursor: not-allowed;
            }

            /* Profielfoto-veld */
            .sm-avatar-row { display: flex; align-items: center; gap: 14px; }
            .sm-avatar-preview {
                width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
                background: #fff35f; color: #111;
                display: flex; align-items: center; justify-content: center;
                font-size: 22px; font-weight: 800; overflow: hidden;
                border: 1.5px solid #cfe0f7;
            }
            .sm-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
            .sm-avatar-preview.has-photo { background: #f7fbff; }
            .sm-avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
            .sm-avatar-btn {
                border: 1.5px solid #cfe0f7; background: #f7fbff; color: #111;
                border-radius: 9px; padding: 8px 14px;
                font-size: 13px; font-weight: 600; cursor: pointer;
                transition: background .12s, border-color .12s, color .12s;
            }
            .sm-avatar-btn:hover { background: #e2edfc; border-color: #b9d2f2; }
            .sm-avatar-btn.ghost { background: transparent; color: #999; }
            .sm-avatar-btn.ghost:hover { color: var(--red); border-color: #f0c9c9; background: #fff5f5; }
            .sm-avatar-btn.ghost[hidden] { display: none; }

            /* Footer met Opslaan-knop: sticky onderin, dus altijd in beeld —
               ook als de inhoud (bijv. Voorkeuren) langer is dan het venster. */
            .sm-footer {
                position: sticky; bottom: 0; z-index: 3;
                display: flex; align-items: center; justify-content: flex-end;
                margin-top: 16px; padding: 12px 0 16px;
                background: #eaf3ff; border-top: 1px solid #cfe0f7;
                box-shadow: 0 -8px 12px -8px rgba(0,0,0,.12);
            }
            .sm-save-btn {
                background: #111; color: #fff; border: none; border-radius: 8px;
                padding: 8px 18px; font-size: 13px; font-weight: 600;
                cursor: pointer; transition: background .12s; letter-spacing: -.1px;
            }
            .sm-save-btn:hover { background: #333; }
            .sm-save-btn.saved { background: var(--green); }

            /* Toggle */
            .sm-toggle-group {
                display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%;
                background: #d9e8fb; border-radius: 8px; padding: 3px;
            }
            .sm-toggle-opt {
                padding: 6px 16px; border: none; border-radius: 6px;
                background: transparent; font-size: 13px; font-weight: 500;
                color: #999; cursor: pointer; transition: background .12s, color .12s;
            }
            .sm-toggle-opt.active {
                background: #ffffff; color: #111; font-weight: 600;
                box-shadow: 0 1px 4px rgba(0,0,0,.12);
            }

            /* Action cards */
            .sm-action-card {
                display: flex; align-items: center; gap: 12px;
                padding: 11px 13px; border-radius: 10px;
                background: #f7fbff; border: 1px solid #cfe0f7;
                margin-bottom: 7px; cursor: default; transition: border-color .12s;
            }
            .sm-action-card.clickable { cursor: pointer; }
            .sm-action-card.clickable:hover { border-color: #b9d2f2; background: #eef5ff; }
            .sm-action-ico {
                width: 34px; height: 34px; border-radius: 8px;
                background: #111; color: rgba(255,255,255,.7);
                display: flex; align-items: center; justify-content: center;
                flex-shrink: 0;
            }
            .sm-action-body { flex: 1; min-width: 0; }
            .sm-action-title { font-size: 13px; font-weight: 600; color: #222; margin: 0 0 1px; }
            .sm-action-sub   { font-size: 11px; color: #aaa; margin: 0; }
            .sm-action-pill {
                font-size: 10px; color: #bbb; border-radius: 5px;
                padding: 2px 7px; white-space: nowrap; flex-shrink: 0;
                border: 1px solid #cfe0f7; font-weight: 500;
            }
            .sm-action-btn {
                font-size: 12px; font-weight: 600; border: none; border-radius: 7px;
                padding: 6px 13px; cursor: pointer; flex-shrink: 0; transition: background .12s;
                display: inline-flex; align-items: center; gap: 6px;
            }
            .sm-action-btn.primary { background: #111; color: #fff; }
            .sm-action-btn.primary:hover { background: #333; }
            .sm-action-btn[disabled] { opacity: .35; cursor: not-allowed; }

            /* Abonnement: twee blokken naast elkaar (proefperiode + plan) */
            .sm-plan-grid {
                display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
            }
            .sm-plan {
                display: flex; flex-direction: column;
                padding: 15px 15px 16px; border-radius: 12px;
                background: #f7fbff; border: 1px solid #cfe0f7;
            }
            .sm-plan.is-current { border-color: #b9d2f2; background: #eef5ff; }
            .sm-plan-head {
                display: flex; align-items: center; justify-content: space-between;
                gap: 8px; margin-bottom: 10px;
            }
            .sm-plan-name { font-size: 13px; font-weight: 600; color: #222; margin: 0; }
            .sm-plan-tag {
                font-size: 10px; font-weight: 500; border-radius: 5px; padding: 1px 7px;
                background: #d9e8fb; color: #7d8aa0;
            }
            .sm-plan-tag.on { background: rgba(29,188,0,.16); color: #4a7a3f; }
            .sm-plan-price {
                font-size: 24px; font-weight: 700; color: #111; margin: 0 0 10px;
                letter-spacing: -.5px; line-height: 1.1;
            }
            .sm-plan-price span {
                display: block; font-size: 11px; font-weight: 400; color: #999;
                letter-spacing: 0; margin-top: 3px;
            }
            .sm-plan-track {
                height: 5px; border-radius: 999px; background: #d9e8fb; overflow: hidden;
            }
            .sm-plan-fill {
                display: block; height: 100%; border-radius: 999px; background: #111;
            }
            .sm-plan-note { font-size: 11px; color: #888; margin: 7px 0 0; }
            .sm-plan-sub  { font-size: 11px; color: #aaa; margin: auto 0 0; padding-top: 10px; }
            .sm-plan-list {
                list-style: none; margin: 0 0 14px; padding: 0;
                display: flex; flex-direction: column; gap: 6px;
            }
            .sm-plan-list li {
                display: flex; align-items: center; gap: 7px;
                font-size: 12px; color: #555;
            }
            .sm-plan-list li svg { color: #4a7a3f; flex-shrink: 0; }
            .sm-plan-btn { margin: auto 0 0; align-self: flex-start; }

            @media (max-width: 560px) {
                .sm-plan-grid { grid-template-columns: 1fr; }
            }

            /* Cloud tile grid */
            .sm-cloud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
            .sm-cloud-tile {
                display: flex; flex-direction: column; align-items: center;
                gap: 7px; padding: 14px 10px; border-radius: 10px;
                background: #f7fbff; border: 1px solid #cfe0f7; text-align: center;
            }
            .sm-cloud-tile-ico {
                width: 36px; height: 36px; border-radius: 9px;
                background: #111; color: rgba(255,255,255,.65);
                display: flex; align-items: center; justify-content: center;
            }
            .sm-cloud-tile-name { font-size: 12px; font-weight: 600; color: #333; }
            .sm-cloud-tile-badge { font-size: 10px; color: #bbb; }

            /* Help cards */
            .sm-help-card {
                display: flex; align-items: center; gap: 11px;
                padding: 11px 13px; border-radius: 10px;
                background: #f7fbff; border: 1px solid #cfe0f7;
                text-decoration: none; margin-bottom: 7px;
                transition: border-color .12s, background .12s;
            }
            .sm-help-card:hover { border-color: #b9d2f2; background: #eef5ff; }
            .sm-help-ico {
                width: 32px; height: 32px; border-radius: 8px;
                background: #111; color: rgba(255,255,255,.7);
                display: flex; align-items: center; justify-content: center;
                flex-shrink: 0;
            }
            .sm-help-body { flex: 1; }
            .sm-help-title { font-size: 13px; font-weight: 600; color: #222; margin: 0 0 1px; }
            .sm-help-sub   { font-size: 11px; color: #aaa; margin: 0; }

            /* Over */
            .sm-version-chip {
                display: inline-flex; align-items: center; gap: 7px;
                margin-bottom: 14px; font-size: 12px; color: #aaa;
            }
            .sm-version-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
            .sm-over-info { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
            .sm-over-item {
                background: #f7fbff; border: 1px solid #cfe0f7;
                border-radius: 9px; padding: 11px 13px;
            }
            .sm-over-item-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #bbb; margin: 0 0 2px; }
            .sm-over-item-value { font-size: 13px; font-weight: 600; color: #222; margin: 0; }

            /* Responsive */
            @media (max-width: 600px) {
                #settingsOverlay { padding: 16px; align-items: center; }
                /* Gecentreerde dialoog met een stabiele hoogte: groeit NIET mee
                   met de inhoud (geen gespring bij tabwissel) en zit niet
                   vastgeplakt onderaan. De inhoud scrollt intern en de
                   Opslaan-knop blijft onderaan staan. */
                #settingsModal {
                    width: 100%; max-width: 100%;
                    height: min(600px, calc(100dvh - 32px));
                    max-height: calc(100dvh - 32px);
                    border-radius: 16px;
                }
                #smBody { min-height: 0; }
                #smBody { flex-direction: column; }
                /* Tabs als terugloopbare (wrap) rij, elk op contentbreedte —
                   geen horizontale scroll met full-width tabs meer. */
                #smNav {
                    width: 100%; border-right: none; border-bottom: 1px solid #cfe0f7;
                    padding: 8px; display: flex; flex-wrap: wrap; gap: 4px;
                    background: #eaf3ff; flex-shrink: 0; overflow: visible;
                }
                .sm-nav-btn { white-space: nowrap; flex: 0 0 auto; width: auto; }
                .sm-nav-group { display: none; }
                #smContent { padding: 16px 16px 0; }
            }
