@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap");

/* ============================================================
   Cognito — design system
   Warm lavender + mint, rounded & pillowy. Display: Fredoka,
   body: Plus Jakarta Sans, numerics: JetBrains Mono.
   ============================================================ */

:root {
    --bg: #faf7ff;
    --bg-soft: #f1ecfb;
    --surface: #ffffff;
    --surface-2: #f6f1ff;
    --border: #e8e3f4;
    --text: #1e1b3a;
    --text-soft: #5f5689;
    --text-faint: #9a93bd;
    --primary: #8a6fe0;
    --primary-soft: #ece2ff;
    --primary-strong: #6e51d1;
    /* mint — the playful secondary accent (sprout / hoodie) */
    --mint: #3fd2a0;
    --mint-soft: #cff7e8;
    --mint-strong: #21bc88;
    /* energy accents */
    --streak: #ff7a59;
    --streak-strong: #e55838;
    --reward: #ffc93e;
    --danger: #f1543f;
    --success: #21bc88;
    --warning: #ffc93e;
    --info: #3b8fea;
    --shadow: 0 6px 18px rgba(86, 56, 181, .10), 0 2px 4px rgba(40, 24, 98, .06);
    --shadow-lg: 0 18px 44px rgba(86, 56, 181, .18), 0 6px 14px rgba(40, 24, 98, .08);
    /* solid color band beneath buttons — the pillowy "press" depth */
    --press: 0 3px 0 var(--primary-strong);
    --radius: 18px;
    --radius-sm: 11px;
    --topbar-h: 50px;
    --font-display: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif;
    --font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
    --bg: #15132b;
    --bg-soft: #1e1b3a;
    --surface: #221f42;
    --surface-2: #2a2650;
    --border: #352e5e;
    --text: #ece2ff;
    --text-soft: #b7aedc;
    --text-faint: #9a93bd;
    --primary: #a98aec;
    --primary-soft: #2e2553;
    --primary-strong: #c5abf6;
    --mint: #3fd2a0;
    --mint-soft: #103a2c;
    --mint-strong: #66e0b6;
    --shadow: 0 6px 18px rgba(0,0,0,.42), 0 2px 4px rgba(0,0,0,.3);
    --shadow-lg: 0 18px 44px rgba(0,0,0,.55), 0 6px 14px rgba(0,0,0,.4);
    --press: 0 3px 0 #120f28;
}

/* ---------- app-stijlen (accentkleur voor de hele app) ---------- */

[data-style="ocean"] {
    --primary: #0891b2;
    --primary-soft: #e0f7fe;
    --primary-strong: #0e7490;
}
[data-theme="dark"][data-style="ocean"] {
    --primary: #38bdf8;
    --primary-soft: #16344a;
    --primary-strong: #7dd3fc;
}

[data-style="forest"] {
    --primary: #16a34a;
    --primary-soft: #dcfce7;
    --primary-strong: #15803d;
}
[data-theme="dark"][data-style="forest"] {
    --primary: #4ade80;
    --primary-soft: #143526;
    --primary-strong: #86efac;
}

[data-style="sunset"] {
    --primary: #ea580c;
    --primary-soft: #ffedd5;
    --primary-strong: #c2410c;
}
[data-theme="dark"][data-style="sunset"] {
    --primary: #fb923c;
    --primary-soft: #3c2415;
    --primary-strong: #fdba74;
}

[data-style="candy"] {
    --primary: #db2777;
    --primary-soft: #fce7f3;
    --primary-strong: #be185d;
}
[data-theme="dark"][data-style="candy"] {
    --primary: #f472b6;
    --primary-soft: #3d1c2e;
    --primary-strong: #f9a8d4;
}

/* eigen accentkleur — afgeleide tinten via color-mix */
[data-style="custom"] {
    --primary: var(--accent, #8a6fe0);
    --primary-soft: color-mix(in srgb, var(--accent, #8a6fe0) 14%, #ffffff);
    --primary-strong: color-mix(in srgb, var(--accent, #8a6fe0) 75%, #000000);
    --press: 0 3px 0 var(--primary-strong);
}
[data-theme="dark"][data-style="custom"] {
    --primary: color-mix(in srgb, var(--accent, #8a6fe0) 75%, #ffffff);
    --primary-soft: color-mix(in srgb, var(--accent, #8a6fe0) 28%, #221f42);
    --primary-strong: color-mix(in srgb, var(--accent, #8a6fe0) 50%, #ffffff);
}

/* per-style press band keeps the pillowy depth on the active accent */
[data-style="ocean"], [data-style="forest"],
[data-style="sunset"], [data-style="candy"] { --press: 0 3px 0 var(--primary-strong); }

/* hoekafronding */
[data-radius="sharp"] { --radius: 9px; --radius-sm: 6px; }
[data-radius="round"] { --radius: 26px; --radius-sm: 16px; }

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Fredoka carries the friendly display voice — headings & big numbers */
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.01em; }

button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* keyboard focus — visible ring for keyboard users, never for mouse/touch.
   Inputs keep their own focus halo (defined below); this covers buttons,
   links, and any element made focusable via tabindex/role. */
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: no-preference) {
    button:focus-visible, a:focus-visible { transition: outline-offset .1s; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- icon helper ---------- */

.icon { color: inherit; }
.icon svg { display: block; }

/* ---------- buttons & inputs ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    transition: background .14s var(--ease, ease), border-color .14s, transform .12s cubic-bezier(.34,1.56,.64,1);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--press);
    transition: background .14s, transform .1s cubic-bezier(.34,1.56,.64,1), box-shadow .1s;
}
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
/* press the pillow down onto its color band */
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--primary-strong); }
[data-theme="dark"] .btn-primary { color: #14122a; }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(241, 84, 63, .08); border-color: var(--danger); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    color: var(--text-soft);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"],
select, textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}
textarea { resize: vertical; min-height: 70px; }

input[type="color"] {
    width: 40px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }

.field { display: block; margin-bottom: 12px; }
.field > span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    letter-spacing: .2px;
}
.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

/* ---------- auth ---------- */

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60vw 60vw at 15% 10%, rgba(138, 111, 224, .20), transparent 60%),
        radial-gradient(50vw 50vw at 90% 30%, rgba(63, 210, 160, .14), transparent 60%),
        radial-gradient(55vw 55vw at 50% 100%, rgba(255, 122, 89, .10), transparent 60%),
        var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 410px;
    padding: 32px 30px 26px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--radius);
    background: rgba(255,255,255,.74);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .auth-card {
    background: rgba(27, 31, 48, .82);
    border-color: rgba(255,255,255,.07);
}

.auth-head { position: relative; text-align: center; margin-bottom: 20px; }
.auth-logo { font-size: 40px; line-height: 1; color: var(--primary); }
.auth-logo img { display: block; width: 52px; height: 52px; margin: 0 auto; }
.auth-head h1 { margin: 8px 0 2px; font-size: 24px; letter-spacing: -.4px; }
.auth-head p { margin: 0; color: var(--text-soft); font-size: 13px; }

.lang-toggle {
    position: absolute;
    top: -10px;
    right: -8px;
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-soft);
}
.lang-toggle:hover { color: var(--primary); border-color: var(--primary); }

.auth-panel h2 { margin: 0 0 14px; font-size: 17px; }
.auth-panel label { display: block; margin-bottom: 12px; }
.auth-panel label > span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
}
.auth-panel small { display: block; margin-top: 4px; color: var(--text-faint); font-size: 11.5px; }
.auth-sub { margin: -4px 0 12px; font-size: 13px; color: var(--text-soft); }

.auth-msg {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(241, 84, 63, .09);
    color: var(--danger);
    font-size: 13px;
}
.auth-msg.ok { background: rgba(29, 185, 84, .1); color: #157a3c; }
[data-theme="dark"] .auth-msg.ok { color: #4ade80; }

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    font-size: 13px;
}

/* ---------- OAuth (Google / Discord) ---------- */

.auth-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 14px;
    color: var(--text-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.btn-oauth:hover { background: var(--surface-2, rgba(0,0,0,.03)); }
[data-theme="dark"] .btn-oauth:hover { background: rgba(255,255,255,.05); }
.btn-oauth svg { width: 18px; height: 18px; flex: none; }
.btn-oauth.discord { background: #5865F2; border-color: #5865F2; color: #fff; }
.btn-oauth.discord:hover { background: #4853d4; }

/* ---------- topbar ---------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: var(--topbar-h);
    padding: 0 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.2px;
    white-space: nowrap;
    color: var(--primary);
}
.brand-logo { display: flex; align-items: center; }
.brand-logo img { display: block; width: 24px; height: 24px; }

.tabbar {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    align-self: flex-end;
    height: 38px;
}
.tabbar::-webkit-scrollbar { display: none; }

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 180px;
    min-width: 0;
    height: 34px;
    padding: 0 9px 0 11px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 9px 9px 0 0;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background .1s;
}
.tab:hover { background: var(--surface-2); }
.tab.active {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
    font-weight: 600;
}
.tab.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }

.tab-icon { display: flex; align-items: center; opacity: .75; }
.tab.active .tab-icon { opacity: 1; }
.tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    max-width: 120px;
}
.tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
}
.tab-close:hover { background: rgba(241, 84, 63, .14); color: var(--danger); }

.tab-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    flex-shrink: 0;
}
.tab-add:hover { background: var(--primary-soft); color: var(--primary); }

.topbar-actions { display: flex; align-items: center; gap: 6px; }

.btn-theme-toggle {
    width: 30px;
    height: 30px;
    color: var(--text-soft);
}
.btn-theme-toggle:hover { color: var(--primary); }

.btn-focus {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-soft);
}
.btn-focus:hover { border-color: var(--primary); color: var(--primary); }

.avatar {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.avatar:hover { filter: brightness(1.08); }
[data-theme="dark"] .avatar { color: #10142a; }

/* ---------- panels ---------- */

#panels { height: calc(100vh - var(--topbar-h)); }

.tab-panel {
    display: none;
    height: 100%;
    overflow: auto;
}
.tab-panel.active { display: block; }
.tab-panel.viewer-panel.active { display: flex; flex-direction: column; overflow: hidden; }
.tab-panel.no-scroll { overflow: hidden; }

/* ---------- menus ---------- */

.menu {
    position: fixed;
    z-index: 200;
    min-width: 200px;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.menu-title {
    padding: 6px 9px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-faint);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.menu-item:hover { background: var(--primary-soft); }
.menu-sep { height: 1px; margin: 4px 3px; background: var(--border); }

/* ---------- modals ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 12, 24, .42);
    backdrop-filter: blur(3px);
}

.modal {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: modal-in .14s ease-out;
}
@keyframes modal-in {
    from { transform: translateY(12px) scale(.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 18px 0;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 14px 18px; overflow-y: auto; }

/* widget picker */
.widget-picker { display: flex; flex-direction: column; gap: 10px; }
.widget-picker-search { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; outline: none; }
.widget-picker-search:focus { border-color: var(--primary); }
.widget-picker-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 6px 0 2px; }
.widget-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.widget-picker-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 12px; text-align: center; transition: background .12s, border-color .12s; }
.widget-picker-item:hover { background: var(--surface-3); border-color: var(--primary); color: var(--primary); }
.widget-picker-icon { color: var(--primary); }
.widget-picker-label { line-height: 1.2; }

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 18px 16px;
}
.modal-foot .left { margin-right: auto; }

/* ---------- toast ---------- */

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    z-index: 400;
    padding: 9px 18px;
    border-radius: 99px;
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- cards ---------- */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-soft);
}
.card-title .icon { color: var(--primary); }

.empty-hint { color: var(--text-faint); font-size: 13px; padding: 6px 0; }

/* ---------- task rows ---------- */

.task-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 7px;
    border-radius: var(--radius-sm);
}
.task-row:hover { background: var(--surface-2); }
.task-row .task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-row .task-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .task-title { text-decoration: line-through; color: var(--text-faint); }
.task-row .task-meta { display: flex; gap: 7px; font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.task-row .task-meta .overdue { color: var(--danger); font-weight: 600; }

.task-add-row { display: flex; gap: 6px; margin-bottom: 8px; }
.task-add-input { flex: 1; min-width: 0; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); outline: none; }
.task-add-input:focus { border-color: var(--primary); }
.task-add-btn { padding: 4px 10px; font-size: 15px; line-height: 1; }

.tab-rename-input { background: var(--surface); border: 1px solid var(--primary); border-radius: var(--radius-sm); color: var(--text); font-size: 12px; padding: 1px 5px; width: 100px; outline: none; }

.subject-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.prio {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
}
.prio-3 { background: rgba(241, 84, 63, .1); color: var(--danger); }
.prio-2 { background: rgba(138, 111, 224, .1); color: var(--primary); }
.prio-1 { background: rgba(148, 163, 184, .15); color: var(--text-soft); }

/* ---------- HOME (dashboard) ---------- */

.home { max-width: 1180px; margin: 0 auto; padding: 28px 32px 48px; }

/* shared simple page header (admin, layouts, …) */
.home-header { margin-bottom: 20px; }
.home-header h1 { margin: 0 0 3px; font-family: var(--font-display); font-size: 24px; letter-spacing: -.02em; }
.home-header p { margin: 0; color: var(--text-soft); font-size: 13px; }

/* greeting row */
.home-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.home-kicker { font-size: 14px; font-weight: 500; color: var(--text-soft); }
.home-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.05; letter-spacing: -.02em; }
.home-date { margin: 4px 0 0; color: var(--text-soft); font-size: 13px; text-transform: capitalize; }

/* hero stat row */
.home-heroes { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    min-height: 116px;
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-text { display: flex; flex-direction: column; gap: 2px; }
.hero-big { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 12.5px; font-weight: 600; opacity: .85; }
.hero-kicker { font-size: 12px; font-weight: 600; opacity: .78; }
.hero-icon { display: inline-flex; }
.hero-streak { background: var(--streak); color: #fff; flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; }
.hero-streak .hero-big { font-size: 40px; }
.hero-streak .hero-icon { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.22); align-items: center; justify-content: center; flex-shrink: 0; }
.hero-today { background: var(--reward); color: var(--color-ink-800, #14122a); }
.hero-week { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* two-column body */
.home-cols { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.home-main, .home-rail { display: flex; flex-direction: column; gap: 18px; }

/* design-style panel head: icon chip + title (not the scoped-caps label) */
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head-icon {
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    flex-shrink: 0;
}
.panel-head-title { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 16px; }

/* tip / motivation card */
.tip-card { background: var(--primary-soft); border-color: transparent; }
.tip-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--primary-strong); }

@media (max-width: 980px) {
    .home { padding: 22px 18px 44px; }
    .home-heroes { grid-template-columns: 1fr; }
    .home-cols { grid-template-columns: 1fr; }
}

.stat-pair { display: flex; gap: 14px; }
.stat-big { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: var(--text-soft); }

/* Big numbers wear Fredoka — the expressive moment of the type system */
.streak-num, .clock-time, .countdown-val, .weekgoal-pct,
.admin-stat-value, .sw-display, .focus-time-input, .focus-modal-title {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
}
.stat-cell { flex: 1; }

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
    text-align: center;
    transition: border-color .12s, transform .1s;
}
.quick-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.quick-item .qi-icon { color: var(--primary); display: flex; align-items: center; }
.quick-item .qi-label {
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    color: var(--text-soft);
}

.quote { font-size: 15px; font-style: italic; line-height: 1.55; margin: 0 0 5px; color: var(--text); }
.quote-author { color: var(--text-faint); font-size: 12.5px; }

/* ---------- DASHBOARD ---------- */

.dash { padding: 0 16px 60px; }

.dash-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 0 10px;
    background: var(--bg);
}

.dash-grid { position: relative; min-height: 300px; }

.widget {
    position: absolute;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: top .15s, left .15s, width .15s, height .15s;
}
.widget.dragging, .widget.resizing {
    transition: none;
    z-index: 20;
    box-shadow: var(--shadow-lg);
    opacity: .93;
}

.widget-head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    cursor: grab;
    user-select: none;
}
.widget-head:active { cursor: grabbing; }
.widget-icon { color: var(--text-soft); display: flex; align-items: center; }
.widget-title {
    flex: 1;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-soft);
}
.widget-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
}
.widget-remove:hover { background: rgba(241, 84, 63, .1); color: var(--danger); }

.widget-body { flex: 1; padding: 11px 13px; overflow: auto; min-height: 0; }

.widget-resize {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    color: var(--text-faint);
    font-size: 10px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    user-select: none;
    opacity: .4;
}
.widget-resize:hover { opacity: 1; }

.drop-ghost {
    position: absolute;
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    background: var(--primary-soft);
    opacity: .55;
    pointer-events: none;
    z-index: 10;
}

/* widget: timer */
.timer-modes { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.mode-btn {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-soft);
}
.mode-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .mode-btn.active { color: #10142a; }

.timer-display {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    margin: 6px 0 3px;
    color: var(--text);
}
.timer-display.break-mode { color: var(--success); }
.timer-sub { text-align: center; font-size: 11.5px; color: var(--text-soft); margin-bottom: 8px; }
.timer-controls { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.timer-extra { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.timer-extra select { flex: 1; }
.timer-extra input[type="number"] { width: 72px; }

/* widget: stats */
.stats-nums { display: flex; gap: 12px; margin-bottom: 8px; }
.stats-nums .stat-cell { flex: 1; }
.stats-canvas { width: 100%; height: 100px; display: block; }
.subject-bar { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-top: 5px; }
.subject-bar .bar-track { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.subject-bar .bar-fill { height: 100%; border-radius: 99px; }

/* widget: streak */
.streak-box { text-align: center; padding-top: 6px; }
.streak-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 4px; color: var(--streak); }
.streak-num { font-size: 38px; font-weight: 800; letter-spacing: -1px; }
.streak-label { color: var(--text-soft); font-size: 12px; }

/* widget: goals */
.goal-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }
.goal-row.done span { text-decoration: line-through; color: var(--text-faint); }
.goal-row span { flex: 1; font-size: 13.5px; }
.goal-del { border: none; background: none; color: var(--text-faint); cursor: pointer; display: flex; align-items: center; }
.goal-del:hover { color: var(--danger); }

/* widget: notes */
.notes-area {
    width: 100%;
    height: 100%;
    min-height: 100px;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    box-shadow: none;
    padding: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text);
}

/* widget: subject */
.subj-progress { margin-top: 8px; }
.progress-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .25s; }
.subj-counter { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 13px; }
.subj-counter .count-btns { display: flex; gap: 5px; }

/* widget: mini-calendar */
.mini-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 700; font-size: 12.5px; }
.mini-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 11px;
}
.mini-cal .dow { color: var(--text-faint); font-weight: 700; font-size: 9.5px; padding: 2px 0; }
.mini-day {
    position: relative;
    padding: 3px 0;
    border-radius: 6px;
    cursor: pointer;
}
.mini-day:hover { background: var(--surface-2); }
.mini-day.other { color: var(--text-faint); opacity: .4; }
.mini-day.today { background: var(--primary); color: #fff; font-weight: 700; }
[data-theme="dark"] .mini-day.today { color: #10142a; }
.mini-day .dot {
    position: absolute;
    left: 50%;
    bottom: 1px;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--warning);
}
.mini-day.today .dot { background: rgba(255,255,255,.75); }
.mini-day-list { margin-top: 7px; border-top: 1px solid var(--border); padding-top: 5px; }

/* widget: clock */
.clock-display { text-align: center; padding-top: 8px; }
.clock-time { font-size: 42px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; }
.clock-seconds { font-size: 22px; color: var(--text-faint); vertical-align: super; font-weight: 600; }

/* widget: water */
.water-track { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.water-glass {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    transition: background .12s, border-color .12s;
}
.water-glass.filled { background: #3b82f620; border-color: #3b82f6; color: #3b82f6; }
.water-glass:hover { border-color: #3b82f6; }
.water-label { font-size: 12px; color: var(--text-soft); margin-top: 6px; }

/* widget: countdown */
.countdown-display { text-align: center; padding: 8px 0; }
.countdown-event { font-size: 12.5px; font-weight: 700; color: var(--text-soft); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.countdown-nums { display: flex; gap: 10px; justify-content: center; }
.countdown-unit { display: flex; flex-direction: column; align-items: center; }
.countdown-val { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.countdown-unit-label { font-size: 10px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.countdown-setup { text-align: center; padding: 8px 0; }

/* widget: mood */
.mood-options { display: flex; justify-content: space-between; padding: 8px 0 4px; }
.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    flex: 1;
    margin: 0 2px;
    transition: border-color .1s, background .1s;
}
.mood-btn:hover { border-color: var(--primary); }
.mood-btn.selected { border-color: var(--primary); background: var(--primary-soft); }
.mood-icon { font-size: 20px; line-height: 1; }
.mood-label { font-size: 10px; font-weight: 600; color: var(--text-faint); }
.mood-btn.selected .mood-label { color: var(--primary); }
.mood-history { margin-top: 8px; }
.mood-bar-row { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-top: 4px; }
.mood-bar-row .bar-track { flex: 1; height: 5px; }

/* widget: quote */
.widget .quote { font-size: 13.5px; }

/* widget: links */
.links-list { margin-bottom: 4px; }
.link-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}
.link-row:hover { background: var(--surface-2); text-decoration: none; }
.link-row .icon { color: var(--text-faint); }
.link-row .link-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.links-form { display: flex; gap: 6px; margin-top: 8px; }
.links-form input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.links-form .btn { flex-shrink: 0; }

/* widget: habits */
.habit-grid { font-size: 12.5px; }
.habit-row { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.habit-head { color: var(--text-faint); font-weight: 700; font-size: 10px; }
.habit-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.habit-dow { width: 22px; text-align: center; text-transform: uppercase; }
.habit-dow.today { color: var(--primary); }
.habit-cell {
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--surface-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: background .1s, border-color .1s;
    padding: 0;
}
.habit-cell:hover { border-color: var(--primary); }
.habit-cell.today { border-color: var(--primary); }
.habit-cell.done { background: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .habit-cell.done { color: #10142a; }
.habit-del-col { width: 18px; flex-shrink: 0; justify-content: center; }

/* widget: breathing */
.breath-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px 0;
}
.breath-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--primary-soft), var(--primary));
    opacity: .85;
    transition: transform 4s ease-in-out;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.breath-label { font-size: 13px; font-weight: 600; color: var(--text-soft); min-height: 18px; }

/* widget: friends */
.friend-streak-widget { margin-top: 4px; }
.friend-streak-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
}
.friend-streak-item:hover { background: var(--surface-2); }
.friend-avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.friend-streak-name { flex: 1; font-size: 13px; font-weight: 500; }
/* home friends section */
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title-row .card-title { margin: 0; }
.home-friends-body { display: flex; flex-direction: column; gap: 4px; }
.home-friends-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 8px 0 2px; }
.home-friend-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.home-decline-btn { color: var(--danger) !important; }

.friend-streak-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-faint);
}
.friend-streak-badge.active { color: var(--streak); }

/* friends modal */
.friends-modal-body {}
.friends-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-faint);
    margin: 10px 0 6px;
}
.friend-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 4px;
    border-radius: var(--radius-sm);
}
.friend-row:hover { background: var(--surface-2); }
.friend-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-email { font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-streak {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-faint);
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--surface-2);
}
.friend-streak.active { color: var(--streak); background: rgba(255, 122, 89, .12); }

/* style swatches (instellingen) */
.style-swatches { display: flex; gap: 8px; padding: 2px 0; }
.style-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--swatch);
    cursor: pointer;
    transition: transform .1s;
}
.style-swatch:hover { transform: scale(1.12); }
.style-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }

.style-swatch-custom {
    background:
        conic-gradient(#f87171, #fbbf24, #4ade80, #38bdf8, #a78bfa, #f87171);
    position: relative;
    overflow: hidden;
    display: inline-flex;
}
.style-swatch-custom.selected { background: var(--swatch); }
.style-swatch-color {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    cursor: pointer;
    padding: 0;
    border: none;
}
.radius-options { display: flex; gap: 6px; }
.radius-option {
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-soft);
}
.radius-option.radius-sharp { border-radius: 3px; }
.radius-option.radius-normal { border-radius: 8px; }
.radius-option.radius-round { border-radius: 99px; }
.radius-option.selected { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* dashboard zoom */
.dash-zoomwrap { overflow: hidden; }
.dash-zoom-label { min-width: 52px; font-variant-numeric: tabular-nums; padding: 4px 6px; }
.dash-toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* geminimaliseerde widget */
.widget.minimized .widget-body,
.widget.minimized .widget-resize { display: none; }
.widget.minimized .widget-head { border-bottom: none; }
.widget-min { margin-right: -2px; }

/* widget: calculator */
.calc-display {
    text-align: right;
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 6px 8px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
    white-space: nowrap;
    min-height: 40px;
}
.calc-display.calc-long { font-size: 16px; }
.calc-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}
.calc-key {
    padding: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}
.calc-key:hover { background: var(--surface-2); }
.calc-key.calc-op { color: var(--primary); }
.calc-key.calc-clear { color: var(--danger); }
.calc-key.calc-eq { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .calc-key.calc-eq { color: #10142a; }

/* widget: sketch */
.sketch-body { display: flex; flex-direction: column; gap: 8px; }
.sketch-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sketch-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--swatch);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.sketch-swatch.selected { border-color: var(--text); }
.sketch-eraser { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }
.sketch-size { flex: 1; min-width: 40px; width: auto; padding: 0; }
.sketch-canvas {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    touch-action: none;
    cursor: crosshair;
}

/* widget: embed (mini-browser) */
.embed-body { display: flex; flex-direction: column; gap: 6px; }
.embed-form { padding-top: 6px; }
.embed-hint { font-size: 11.5px; color: var(--text-faint); margin: 8px 0 0; }
.embed-bar { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.embed-url { flex: 1; font-size: 11.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-frame {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}

/* widget: formulas */
.formula-display {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    padding: 8px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
}
.formula-inputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.formula-field { flex: 1; min-width: 80px; }
.formula-field > span { display: block; font-size: 11px; font-weight: 600; color: var(--text-soft); margin-bottom: 3px; }
.formula-result {
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    margin-top: 10px;
    min-height: 22px;
    color: var(--success);
}

.formula-custom { display: flex; gap: 6px; margin-top: 10px; }
.formula-custom input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.formula-hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.formula-display + select, .formula-inputs + select { margin-top: 6px; }

/* widget: converter */
.conv-row { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.conv-row input { flex: 1; min-width: 0; }
.conv-row select { width: 84px; flex-shrink: 0; }
.conv-arrow { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 6px; }
.conv-result {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 34px;
}

/* widget: random */
.random-result {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    padding: 8px 0;
    min-height: 52px;
}
.random-result.pop { animation: random-pop .25s ease; }
@keyframes random-pop {
    0% { transform: scale(.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.random-btns { display: flex; gap: 6px; justify-content: center; }
.random-range { display: flex; gap: 5px; align-items: center; margin-top: 10px; }
.random-range input { width: 56px; padding: 5px 6px; font-size: 12.5px; }
.random-dash { color: var(--text-faint); }

/* widget: noise */
.noise-types { display: flex; gap: 5px; flex-wrap: wrap; }

/* school directory */
.friends-school-sub { font-size: 12px; color: var(--text-soft); margin-bottom: 4px; }
.friends-year-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--primary);
    margin: 8px 0 2px;
}

/* widget: grades */
.grades-avg { min-height: 26px; margin-bottom: 4px; }
.grade-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; }
.grade-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grade-score { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.grade-pct { font-weight: 700; font-variant-numeric: tabular-nums; }
.grade-pct.good { color: var(--success); }
.grade-pct.ok { color: var(--warning); }
.grade-pct.bad { color: var(--danger); }
.grades-form { display: flex; gap: 5px; align-items: center; margin-top: 8px; }
.grades-form input[type="text"] { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.grades-form input[type="number"] { width: 52px; padding: 5px 6px; font-size: 12.5px; }
.grades-slash { color: var(--text-faint); }

/* help-modal */
.help-topic { display: flex; gap: 11px; padding: 8px 0; }
.help-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.help-topic-title { font-weight: 700; font-size: 13.5px; }
.help-topic-text { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; line-height: 1.45; }

/* rondleiding (tour) */
.tour-backdrop {
    position: fixed;
    inset: 0;
    z-index: 600;
    pointer-events: none; /* blokkeer de app nooit — enkel de popover is klikbaar */
}
.tour-backdrop.dim { background: rgba(8, 12, 24, .55); }
.tour-ring {
    position: fixed;
    border: 2px solid var(--primary);
    border-radius: 10px;
    box-shadow: 0 0 0 6px rgba(138, 111, 224, .25), 0 0 0 9999px rgba(8, 12, 24, .55);
    pointer-events: none;
    transition: all .25s ease;
}
.tour-pop {
    position: fixed;
    width: 300px;
    max-width: calc(100vw - 20px);
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    line-height: 1.5;
    transition: left .25s ease, top .25s ease;
    pointer-events: auto;
}
.tour-pop-foot {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
}
.tour-counter { flex: 1; font-size: 11.5px; color: var(--text-faint); }

/* layouts hub */
.layouts-page { max-width: 1020px; margin: 0 auto; padding: 24px 22px 48px; }
.layouts-section {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 22px 0 12px;
    font-size: 14px;
    font-weight: 700;
}
.layouts-section .icon { color: var(--primary); }
.layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.layout-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.layout-card-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 13.5px;
}
.layout-card-head .icon { color: var(--primary); }
.layout-card-head span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    overflow: hidden;
}
.layout-preview-block {
    position: absolute;
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    border-radius: 3px;
    opacity: .75;
}
.layout-card-desc { margin: 0; font-size: 12px; color: var(--text-soft); flex: 1; }
.layout-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.layout-card-meta { font-size: 11.5px; color: var(--text-faint); }
.layouts-upload-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 26px;
    padding: 14px 16px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.layouts-upload-bar p { margin: 0; font-size: 13px; color: var(--text-soft); }

/* friend search */
.friend-search { position: relative; margin-bottom: 6px; }
.friend-search input { padding-left: 34px; }
.friend-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    display: flex;
    align-items: center;
    pointer-events: none;
}
.friend-search-results { margin-bottom: 8px; }
.friend-chip {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-faint);
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--surface-2);
    white-space: nowrap;
}

/* widget: study pet */
.pet-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4px 0;
}
.pet-icon { width: 76px; height: 76px; user-select: none; }
.pet-icon svg { width: 100%; height: 100%; display: block; }
.pet-icon.happy { animation: pet-bounce 1.6s ease-in-out infinite; }
.pet-icon.sad { animation: pet-droop 3s ease-in-out infinite; }
@keyframes pet-droop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px) rotate(-1.5deg); }
}
@media (prefers-reduced-motion: reduce) {
    .pet-icon.happy, .pet-icon.sad { animation: none; }
    /* global safety net: neutralize motion app-wide for users who ask for it.
       State changes still read as instant crossfades rather than movement. */
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
@keyframes pet-bounce {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px) rotate(-3deg); }
    60% { transform: translateY(0) rotate(2deg); }
}
.pet-name {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 1px dashed transparent;
}
.pet-name:hover { border-bottom-color: var(--text-faint); }
.pet-stage { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--primary); margin-top: 1px; }
.pet-msg { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.pet-msg.hungry { color: var(--warning); }
.pet-wrap .progress-track { width: 100%; }
.pet-next { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

/* widget: deadlines */
.deadline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    border-radius: var(--radius-sm);
}
.deadline-row:hover { background: var(--surface-2); }
.deadline-main { flex: 1; min-width: 0; }
.deadline-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deadline-date { font-size: 11px; color: var(--text-faint); }
.deadline-chip {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--surface-2);
    color: var(--text-soft);
    white-space: nowrap;
}
.deadline-chip.soon { background: rgba(245, 158, 11, .14); color: var(--warning); }
.deadline-chip.overdue { background: rgba(241, 84, 63, .12); color: var(--danger); }

/* widget: weekgoal */
.weekgoal-pct { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.weekgoal-pct.done { color: var(--success); }
.weekgoal-sub { font-size: 12.5px; color: var(--text-soft); }

/* admin panel */
.admin-page { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.admin-stat-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-align: center; }
.admin-stat-value { font-size: 26px; font-weight: 700; color: var(--primary); }
.admin-stat-label { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.admin-search { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 13px; outline: none; margin: 10px 0 8px; }
.admin-search:focus { border-color: var(--primary); }
.admin-user-list, .admin-layout-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.admin-user-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.admin-user-row.is-admin { border-color: var(--primary); }
.admin-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.admin-user-meta { font-size: 11.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-actions { display: flex; gap: 4px; flex-shrink: 0; }
.admin-badge { font-size: 10px; background: var(--primary); color: #fff; border-radius: 4px; padding: 1px 6px; font-weight: 600; letter-spacing: .03em; }
.admin-layout-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.admin-layout-info { flex: 1; min-width: 0; }
.admin-layout-name { font-weight: 600; font-size: 13px; }
.admin-layout-meta { font-size: 11.5px; color: var(--text-faint); }

/* friends page tab */
.friends-page { max-width: 560px; margin: 0 auto; padding: 28px 20px; }
.friends-invite-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 24px; }
.friends-invite-bar input { flex: 1; }
.friends-empty { font-size: 13.5px; color: var(--text-faint); padding: 12px 4px; }
.friends-section-title:first-child { margin-top: 0; }

/* layout save/share */
.layout-list { max-height: 200px; overflow-y: auto; margin-bottom: 10px; }
.layout-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.layout-item:hover { background: var(--surface-2); }
.layout-item-name { flex: 1; font-weight: 500; font-size: 13.5px; }
.layout-item-date { font-size: 11.5px; color: var(--text-faint); }

/* ---------- PLANNER ---------- */

/* ---------- planner: design overview (week-strip + timeline + rail) ---------- */

.planner-page { max-width: 1180px; margin: 0 auto; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 22px; }

.planner-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.planner-hero-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.05; letter-spacing: -.02em; }
.planner-hero-sub { margin-top: 2px; font-size: 14px; font-weight: 500; color: var(--text-soft); text-transform: capitalize; }

.planner-weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.wk-day {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 14px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .12s, border-color .12s;
}
.wk-day:hover { transform: translateY(-2px); border-color: var(--primary); }
.wk-day.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow); }
.wk-dow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.wk-date { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.wk-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.wk-dot.on { background: var(--mint-strong); }
.wk-day.active .wk-dot.on { background: rgba(255,255,255,.85); }

.planner-overview { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.planner-section-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 2px; text-transform: capitalize; }
.planner-timeline-wrap { display: flex; flex-direction: column; gap: 12px; }
.planner-timeline { display: flex; flex-direction: column; gap: 12px; }

.tl-row { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: stretch; }
.tl-time { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text-soft); padding-top: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--task-color, var(--primary));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
}
.tl-row.done .tl-card { opacity: .62; }
.tl-main { flex: 1; min-width: 0; }
.tl-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.tl-row.done .tl-title { text-decoration: line-through; }
.tl-meta { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

.planner-rail { display: flex; flex-direction: column; gap: 18px; }
.planner-rail-card { padding: 18px 20px; }
.pl-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pl-bar-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width .3s var(--ease, ease); }
.pl-goal-label { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text-soft); }

.dl-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.dl-row + .dl-row { border-top: 1px solid var(--border); }
.dl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dl-info { flex: 1; min-width: 0; }
.dl-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-date { font-size: 12px; color: var(--text-soft); }
.dl-rel { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text-soft); flex-shrink: 0; }

.planner-cal-section { display: flex; flex-direction: column; gap: 12px; }
.planner--embedded { height: 660px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }

@media (max-width: 980px) {
    .planner-page { padding: 22px 18px 44px; }
    .planner-overview { grid-template-columns: 1fr; }
    .planner--embedded { height: 560px; }
}

.planner { display: flex; height: 100%; min-height: 0; }

.planner-side {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
    min-height: 0;
}
.planner-side-head { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.planner-filters { display: flex; gap: 7px; align-items: center; }
.planner-filters select { flex: 1; }
.planner-list { flex: 1; overflow-y: auto; padding: 0 6px 20px; }

.group-title {
    margin: 12px 7px 3px;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-faint);
}
.group-title.overdue { color: var(--danger); }

/* subject color as a leading dot, not a side-stripe */
.task-item > .task-color-dot {
    flex: none;
    align-self: center;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--task-color, var(--primary));
}
.task-item.done > .task-color-dot { opacity: .4; }
.subtask-list { margin-left: 28px; }
.subtask-list .task-row { padding: 2px 7px; font-size: 12.5px; }

.planner-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.planner-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-wrap: wrap;
}
.planner-toolbar .cal-title { font-weight: 700; font-size: 15px; flex: 1; text-transform: capitalize; }

.view-switch { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-switch button {
    padding: 5px 12px;
    border: none;
    background: var(--surface);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
}
.view-switch button.active { background: var(--primary); color: #fff; }
[data-theme="dark"] .view-switch button.active { color: #10142a; }

.cal-wrap { flex: 1; overflow: auto; padding: 12px 14px 30px; }

.cal-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}
.cal-dow {
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 3px 0;
}
.cal-cell {
    min-height: 90px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cal-cell.other { opacity: .5; background: transparent; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cal-cell.drag-over { background: var(--primary-soft); border-color: var(--primary); }
.cal-cell-date { font-size: 11.5px; font-weight: 700; color: var(--text-soft); }
.cal-cell.today .cal-cell-date { color: var(--primary); }

.task-chip {
    padding: 2px 6px 2px 16px;
    border-radius: 5px;
    background: var(--primary-soft);
    position: relative;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
}
.task-chip::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--task-color, var(--primary));
}
.task-chip.done { opacity: .45; text-decoration: line-through; }
.task-chip:hover { filter: brightness(.96); }
.chip-more { font-size: 10.5px; color: var(--text-faint); cursor: pointer; }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-week.one-day { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
.day-col {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    min-height: 200px;
    display: flex;
    flex-direction: column;
}
.day-col.today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.day-col.drag-over { background: var(--primary-soft); }
.day-col-head {
    padding: 7px 9px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}
.day-col.today .day-col-head { color: var(--primary); }
.day-col-body { padding: 6px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.day-task-time { font-size: 10px; opacity: .7; font-weight: 700; margin-right: 3px; }

/* ---------- WEBSITE TAB ---------- */

.web-setup { max-width: 620px; margin: 0 auto; padding: 36px 22px; }
.web-setup h2 { margin: 0 0 16px; }
.web-url-row { display: flex; gap: 8px; margin-bottom: 26px; }
.web-url-row input { flex: 1; }

.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.fav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color .12s;
}
.fav-item:hover { border-color: var(--primary); }
.fav-item .fav-title { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-item .fav-url { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-del {
    position: absolute;
    top: 5px;
    right: 5px;
    border: none;
    background: none;
    color: var(--text-faint);
    cursor: pointer;
    display: flex;
    align-items: center;
}
.fav-del:hover { color: var(--danger); }

.web-view { display: flex; flex-direction: column; height: 100%; }
.web-toolbar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.web-toolbar .web-url {
    flex: 1;
    font-size: 12px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
}
.web-frame-wrap { flex: 1; position: relative; background: #fff; }
.web-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.web-hint {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 13px;
    background: rgba(245, 158, 11, .1);
    color: var(--text-soft);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

/* ---------- KANBAN WIDGET ---------- */
.kb-col { flex: 1; display: flex; flex-direction: column; border-right: 1px solid var(--border); padding: 8px 6px; min-width: 0; }
.kb-col:last-child { border-right: none; }
.kb-col-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 6px; padding: 0 2px; }
.kb-cards { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.kb-card { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 6px; font-size: 12px; position: relative; }
.kb-card-text { display: block; word-break: break-word; margin-right: 16px; }
.kb-card-del { position: absolute; top: 3px; right: 4px; background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.kb-card-del:hover { color: var(--danger); }
.kb-move-row { display: flex; gap: 3px; margin-top: 3px; }
.kb-move-btn { background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; font-size: 10px; cursor: pointer; padding: 1px 5px; color: var(--text-soft); }
.kb-move-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.kb-add-input { width: 100%; margin-top: 4px; padding: 3px 5px; font-size: 11.5px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); outline: none; }
.kb-add-input:focus { border-color: var(--primary); border-style: solid; }

/* ---------- STOPWATCH WIDGET ---------- */
.sw-display { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; color: var(--primary); padding: 8px 0 6px; letter-spacing: .02em; }
.sw-btns { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.sw-btn { font-size: 12px; padding: 4px 12px; }
.sw-laps { overflow-y: auto; max-height: 120px; display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.sw-lap { display: flex; justify-content: space-between; font-size: 11.5px; padding: 2px 4px; border-radius: 3px; background: var(--surface-2); }
.sw-lap-num { color: var(--text-faint); }

/* ---------- FOCUS MODE ---------- */

.focus-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    height: 38px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.focus-bar-left {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    opacity: .9;
}
.focus-bar-label { letter-spacing: .1px; }
.focus-bar-timer {
    font-size: 18px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    flex: 1;
    text-align: center;
}
.focus-bar-timer.focus-bar-urgent { animation: focus-pulse 1s ease-in-out infinite; }
@keyframes focus-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
.focus-bar-exit {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 5px;
    padding: 3px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    transition: background .15s;
    font-family: inherit;
}
.focus-bar-exit:hover { background: rgba(255,255,255,.28); }
body.focus-active { padding-top: 38px; }
body.focus-active .topbar { top: 38px; }

/* ---------- profile modal ---------- */

.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 5px 0 3px; }
.profile-stat {
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.profile-stat .stat-big { font-size: 22px; }

.settings-sep { height: 1px; background: var(--border); margin: 16px 0 14px; }

/* ---------- avatar button & preview ---------- */

.avatar { position: relative; overflow: hidden; background-size: cover; background-position: center; }
.avatar-letter { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}
.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--border);
}
[data-theme="dark"] .avatar-preview { color: #10142a; }

/* ---------- settings tabs ---------- */

.stab-bar {
    display: flex;
    gap: 4px;
    padding: 2px 2px 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
}
.stab {
    padding: 7px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-soft);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin-bottom: -2px;
    transition: color .12s, border-color .12s;
}
.stab:hover { color: var(--text); background: var(--surface-2); }
.stab.active { color: var(--primary); border-bottom-color: var(--primary); }

.stab-panel { animation: stab-in .12s ease-out; }
@keyframes stab-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.stab-msg {
    margin: 8px 0 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(241, 84, 63, .09);
    color: var(--danger);
    font-size: 13px;
}
.stab-msg.ok { background: rgba(29, 185, 84, .1); color: var(--success); }

.settings-security-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 13px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 14px;
}
.settings-security-info .security-icon { font-size: 20px; flex-shrink: 0; }
.settings-security-info p { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.5; }

/* ---------- onboarding ---------- */

.ob-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.ob-wrap {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* progress bar */
.ob-progress-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 44px;
}
.ob-progress-track {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.ob-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}
.ob-step-counter {
    font-size: 13px;
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* step panels */
.ob-step {
    display: none;
}
.ob-step.active {
    display: block;
    animation: ob-enter-fwd 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.ob-step.active.ob-rev {
    animation-name: ob-enter-rev;
}
@keyframes ob-enter-fwd {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes ob-enter-rev {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* step typography */
.ob-step-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
    letter-spacing: -.5px;
}
.ob-step-sub {
    font-size: 15px;
    color: var(--text-soft);
    margin: 0 0 28px;
    line-height: 1.55;
}

/* navigation row */
.ob-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
}
.ob-back-link {
    background: none;
    border: none;
    color: var(--text-soft);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color .15s, text-decoration-color .15s;
}
.ob-back-link:hover { color: var(--text); text-decoration-color: var(--border); }
.ob-back-link[hidden] { display: none; }
.ob-skip-btn {
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color .15s, text-decoration-color .15s;
    font-family: inherit;
}
.ob-skip-btn:hover { color: var(--text-soft); text-decoration-color: var(--border); }
.ob-skip-btn[hidden] { display: none; }

/* lang selection (step 0) */
.ob-lang-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 4px;
}
.ob-lang-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    color: var(--text);
}
.ob-lang-btn:hover { border-color: var(--primary); }
.ob-lang-btn.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* country search + grid */
.ob-country-search {
    width: 100%;
    margin-bottom: 14px;
    /* inherits .field input styles */
    display: block;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    box-sizing: border-box;
}
.ob-country-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(138,111,224,.14);
}
.ob-country-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 2px;
}
.ob-country-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ob-country-btn:hover { border-color: var(--primary); color: var(--primary); }
.ob-country-btn.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* school autocomplete */
.ob-school-wrap { position: relative; }
.ob-ac-list {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 260px;
    overflow-y: auto;
}
.ob-ac-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.ob-ac-item:last-child { border-bottom: none; }
.ob-ac-item:hover { background: var(--bg-soft); }
.ob-ac-name {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* flashcard widget */
.fc-card {
    perspective: 600px;
    cursor: pointer;
    height: 100px;
    position: relative;
    margin: 4px 0;
}
.fc-card .fc-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--surface-2);
    font-size: 14px;
    text-align: center;
    backface-visibility: hidden;
    transition: transform .4s ease;
    overflow: hidden;
}
.fc-card .fc-back {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--primary);
    transform: rotateY(180deg);
}
.fc-card.flipped .fc-front { transform: rotateY(-180deg); }
.fc-card.flipped .fc-back  { transform: rotateY(0deg); }
.ob-ac-badge {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-soft);
    flex-shrink: 0;
    letter-spacing: .5px;
}
.ob-ac-city {
    font-size: 12px;
    color: var(--text-faint);
    flex-shrink: 0;
    white-space: nowrap;
}
.ob-ac-loading, .ob-ac-empty {
    padding: 12px 14px;
    font-size: 13.5px;
    color: var(--text-faint);
}

/* year grid */
.ob-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 8px;
}
.ob-year-btn {
    padding: 14px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-soft);
    transition: border-color .12s, background .12s, color .12s, transform .08s;
    text-align: center;
}
.ob-year-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.ob-year-btn.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

/* avatar (step 6) */
.ob-avatar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 4px 0 20px;
}
.ob-avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--primary);
    background-size: cover;
    background-position: center;
    color: #fff;
    font-weight: 800;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border);
    flex-shrink: 0;
}
[data-theme="dark"] .ob-avatar-preview { color: #10142a; }
.ob-skip-hint { font-size: 12.5px; color: var(--text-faint); margin: 0; text-align: center; }
.ob-msg {
    font-size: 13px;
    color: var(--danger);
    margin: 8px 0 0;
    min-height: 20px;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
    .brand-name { display: none; }
    .btn-focus span { display: none; }
    .planner { flex-direction: column; }
    .planner-side { width: 100%; max-height: 38vh; border-right: none; border-bottom: 1px solid var(--border); }
    .home { padding: 16px 12px 36px; }
}

@media (max-width: 520px) {
    .ob-country-grid { grid-template-columns: repeat(2, 1fr); }
    .ob-year-grid { grid-template-columns: repeat(2, 1fr); }
    .ob-lang-btns { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ob-step-title { font-size: 22px; }
}

/* widget-dropdown (replaces widget-picker modal) */
.widget-dropdown {
    position: fixed;
    z-index: 300;
    width: 340px;
    max-height: 480px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.widget-dropdown-search {
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.widget-dropdown-search input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font-size: 13px;
    outline: none;
}
.widget-dropdown-search input:focus { border-color: var(--primary); }
.widget-dropdown-body {
    overflow-y: auto;
    flex: 1;
    padding: 6px 0;
}
.widget-dd-cat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 4px;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-faint);
}
.widget-dd-cat-header:hover { color: var(--text-soft); }
.widget-dd-cat-toggle { font-size: 10px; transition: transform .15s; }
.widget-dd-cat.collapsed .widget-dd-cat-toggle { transform: rotate(-90deg); }
.widget-dd-cat-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 2px 8px 6px;
    max-height: 400px;
    transition: max-height .18s ease, padding .18s ease;
}
.widget-dd-cat.collapsed .widget-dd-cat-items { max-height: 0 !important; padding-bottom: 0; overflow: hidden; }
.widget-dd-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    transition: background .12s, border-color .12s;
}
.widget-dd-item:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.widget-dd-item-icon { color: var(--primary); }
.widget-dd-no-results { padding: 16px 12px; text-align: center; color: var(--text-faint); font-size: 13px; }
.widget-dd-item { display: flex; align-items: center; gap: 8px; width: 100%; }
.widget-dd-item-label { flex: 1; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-dd-item-label mark { background: var(--primary-soft); color: var(--primary); border-radius: 3px; padding: 0 1px; }
.widget-dd-item-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); flex-shrink: 0; }
.widget-dd-item.is-active { background: var(--primary-soft); }

/* schedule widget */
.schedule-table { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.schedule-row { display: grid; grid-template-columns: 38px repeat(5, 1fr); gap: 2px; }
.schedule-time { display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; color: var(--text-faint); font-size: 10px; }
.schedule-cell { padding: 4px 2px; border-radius: 4px; background: var(--surface-2); text-align: center; min-height: 22px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.schedule-cell-head { background: transparent; font-weight: 700; color: var(--text-soft); }
.schedule-today { background: var(--primary-soft); color: var(--primary); }

/* ---------- tab-contextmenu, icoonkiezer & dashboard-kiezer ---------- */

.menu-label {
    padding: 8px 9px 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-faint);
}

.tab-color-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 9px 8px;
}
.tab-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .1s;
}
.tab-color-swatch:hover { transform: scale(1.12); }
.tab-color-swatch.selected { border-color: var(--text); }
.tab-color-none {
    background: var(--surface-2);
    color: var(--text-faint);
    border-color: var(--border);
}

.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.icon-picker-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s, color .12s;
}
.icon-picker-btn:hover { color: var(--text); border-color: var(--primary); }
.icon-picker-btn.selected {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
}

.dash-chooser { display: flex; flex-direction: column; }
.dash-chooser-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    padding: 2px 0 4px;
}
.dash-chooser-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: background .12s, border-color .12s;
}
.dash-chooser-card:hover { background: var(--primary-soft); border-color: var(--primary); }
.dash-chooser-card-icon { color: var(--primary); display: flex; flex-shrink: 0; }
.dash-chooser-del {
    margin-left: auto;
    color: var(--text-faint);
    display: flex;
    padding: 2px;
    border-radius: 4px;
}
.dash-chooser-del:hover { color: var(--danger); background: rgba(241, 84, 63, .12); }

.layout-item-icon { display: inline-flex; vertical-align: middle; margin-right: 6px; color: var(--primary); }

/* nieuw-dashboard: drie grote keuzes */
.dash-choices { display: flex; flex-direction: column; gap: 10px; }
.dash-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .08s;
}
.dash-choice:hover { background: var(--primary-soft); border-color: var(--primary); }
.dash-choice:active { transform: scale(.99); }
.dash-choice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary);
}
.dash-choice-title { font-size: 14px; font-weight: 700; color: var(--text); }
.dash-choice-desc { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

/* Pre-focus setup dialog */
.focus-setup-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 0; }
.focus-setup-row { display: flex; flex-direction: column; gap: 0; }
.focus-setup-label { display: flex; flex-direction: column; gap: 6px; }
.focus-setup-label > span { font-size: 12px; font-weight: 700; color: var(--text-soft); letter-spacing: .2px; text-transform: uppercase; }
.focus-setup-field { display: flex; align-items: center; gap: 8px; }
.focus-time-input { width: 90px; font-size: 22px; font-weight: 800; text-align: center; padding: 8px 10px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); outline: none; }
.focus-time-input:focus { border-color: var(--primary); }
.focus-time-unit { font-size: 13px; color: var(--text-soft); }
.focus-setup-hint { margin: 0; font-size: 12.5px; color: var(--text-faint); padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* ---------- Focus-modals (gecentreerd) ---------- */
.focus-modal-backdrop { display: flex; align-items: center; justify-content: center; }
.focus-modal {
    width: min(440px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    padding: 32px 28px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: focus-modal-in .18s ease;
}
@keyframes focus-modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.focus-modal-title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.4px; color: var(--text); }
.focus-modal-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-soft); }
.focus-modal-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4px; }
.focus-modal-primary { width: 100%; max-width: 280px; padding: 12px 18px; font-size: 15px; font-weight: 700; }
.focus-modal-secondary { background: none; border: none; padding: 2px 6px; font-size: 12.5px; color: var(--text-faint); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.focus-modal-secondary:hover { color: var(--text-soft); }

/* Pre-focus velden (gecentreerd) */
.focus-setup-body { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.focus-field { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.focus-field-label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.focus-warning { margin: 0; font-size: 12.5px; line-height: 1.45; color: #92610a; background: #fff6da; border: 1px solid #f3d98a; border-radius: var(--radius-sm); padding: 9px 12px; }
.focus-warning[hidden] { display: none; }
.focus-penalty-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.focus-penalty-text { font-size: 13px; color: var(--text-soft); }
.focus-gear { color: var(--text-soft); }
.focus-gear:hover, .focus-gear.active { color: var(--primary); background: var(--primary-soft); }
.focus-advanced { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: left; }
.focus-advanced[hidden] { display: none; }
.focus-adv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.focus-adv-toggle { cursor: pointer; }
.focus-adv-texts { display: flex; flex-direction: column; gap: 2px; }
.focus-adv-label { font-size: 13px; font-weight: 600; color: var(--text); }
.focus-adv-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.4; max-width: 280px; }
.focus-mini-input { width: 64px; font-size: 15px; font-weight: 700; text-align: center; padding: 5px 6px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); outline: none; }
.focus-mini-input:focus { border-color: var(--primary); }

/* Aan/uit-schakelaar */
.focus-switch { position: relative; width: 42px; height: 24px; border-radius: 999px; border: none; background: var(--border); cursor: pointer; flex-shrink: 0; transition: background .15s; padding: 0; }
.focus-switch.on { background: var(--primary); }
.focus-switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.focus-switch.on .focus-switch-knob { transform: translateX(18px); }

.focus-bar-timer.focus-bar-paused { opacity: .6; }

/* already-added in picker */
.widget-picker-item.already-added { opacity: .45; cursor: default; }

/* ---------- FILE VIEWER WIDGET ---------- */

.viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    flex-shrink: 0;
}
.viewer-filename {
    flex: 1;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-frame { flex: 1; min-height: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); display: flex; flex-direction: column; }

.viewer-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 14px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.viewer-drop.drag-active { border-color: var(--primary); background: var(--primary-soft); }
.viewer-drop-icon { color: var(--primary); }
.viewer-drop-text { font-size: 14px; font-weight: 600; }
.viewer-drop-sub { font-size: 12px; color: var(--text-faint); }
.viewer-url-row { display: flex; gap: 6px; }
.viewer-url-input { flex: 1; min-width: 0; }

/* ---------- FILE VIEWER TAB ---------- */

.viewer-tab-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}
.viewer-tab-filename {
    flex: 1;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewer-tab-main { flex: 1; overflow: auto; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }

.viewer-home {
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 22px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}
.viewer-big-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 28px;
    border: 2px dashed var(--border-strong, var(--border));
    border-radius: var(--radius);
    background:
        repeating-linear-gradient(135deg, var(--surface-2) 0 14px, transparent 14px 28px),
        var(--surface);
    text-align: center;
    transition: border-color .15s, background .15s, transform .15s;
    cursor: pointer;
}
.viewer-big-drop:hover { transform: translateY(-2px); border-color: var(--primary); }
.viewer-big-drop.drag-active { border-color: var(--primary); background: var(--primary-soft); }
.viewer-big-icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-strong);
}
.viewer-big-drop h3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.viewer-big-drop p { margin: 0; color: var(--text-soft); font-size: 13px; }
.viewer-url-section { display: flex; flex-direction: column; gap: 8px; }

/* ---------- ANNOTATOR ---------- */
.annot-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.annot-toolbar .annot-tool.is-active { background: var(--primary-soft); color: var(--primary); }
.annot-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.annot-color { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.annot-color.is-active { border-color: var(--text); transform: scale(1.15); }
.annot-canvas { position: absolute; top: 0; left: 0; z-index: 2; touch-action: none; }
.annot-text-input { position: absolute; z-index: 3; background: transparent; border: 1px dashed var(--primary); font: 28px system-ui, sans-serif; padding: 0 2px; outline: none; min-width: 40px; }

/* UX: smoother transitions & micro-interactions */
.tab { transition: background .1s, color .1s; }
.card { transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow-lg); }
.btn { transition: background .12s, border-color .12s, transform .05s, box-shadow .12s; }
.btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.widget { transition: box-shadow .15s, opacity .15s; }
.widget:hover { box-shadow: var(--shadow-lg); }
