:root {
    --bg: #24162f;
    --sidebar: #2e1c3d;
    --surface: #3a254d;
    --surface-2: #47305e;
    --surface-3: #553a70;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);
    --primary: #ffad0a;
    --primary-text: #2b1a3a;
    --text: #ffffff;
    --muted: #ad8dcd;
    --faint: #8a70a6;
    --danger: #ff6b81;
    --success: #4ade9b;
    --radius: 10px;
    --radius-sm: 7px;

    --type-link: #ad8dcd;
    --type-text: #ffad0a;
    --type-image: #34d399;
    --type-video: #ff5a5f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
[hidden] { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.ui-icon { width: 18px; height: 18px; flex-shrink: 0; }

kbd {
    padding: 1px 6px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg);
    font-family: inherit;
    font-size: 12px;
}

/* ---------- App shell ---------- */

.app {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px 14px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    text-decoration: none;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--primary);
}

.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.side-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

.side-nav a.active {
    color: var(--text);
    background: var(--surface-2);
    box-shadow: inset 3px 0 0 var(--primary);
}

.account {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 10px 10px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .15);
}

.account-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account form { margin: 0; }

.content {
    min-width: 0;
    padding: 32px 40px 64px;
}

/* ---------- Page header ---------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 15px; font-weight: 700; }
.subtitle { margin: 6px 0 0; color: var(--muted); }
.muted { color: var(--muted); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.back-link:hover { color: var(--text); }
.back-link .ui-icon { width: 16px; height: 16px; }

.stats { display: flex; gap: 10px; margin: 0; }

.stats div {
    min-width: 92px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.stats dt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; }

/* ---------- Cards ---------- */

.card {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.card-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }

.card-head .count {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.card--list { padding: 18px 18px 14px; }

.narrow { max-width: 780px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, filter .15s;
}

.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); color: var(--text); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.icon-btn:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.icon-btn--danger:hover { background: rgba(255, 107, 129, .12); color: var(--danger); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Switch ---------- */

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}

.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s;
}

.switch[aria-checked="true"],
.switch-field input:checked + .switch { background: var(--success); }

.switch[aria-checked="true"]::after,
.switch-field input:checked + .switch::after { transform: translateX(16px); }

.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-weight: 500;
    cursor: pointer;
}

.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-field input:focus-visible + .switch { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Type icons ---------- */

.type-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.type-link { color: var(--type-link); background: color-mix(in srgb, var(--type-link) 16%, transparent); }
.type-text { color: var(--type-text); background: color-mix(in srgb, var(--type-text) 16%, transparent); }
.type-image { color: var(--type-image); background: color-mix(in srgb, var(--type-image) 16%, transparent); }
.type-video { color: var(--type-video); background: color-mix(in srgb, var(--type-video) 16%, transparent); }

/* ---------- Add block tiles ---------- */

.add-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.add-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .12);
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}

.add-tile:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.add-tile strong { display: block; font-size: 13px; }
.add-tile small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }

/* ---------- Block list ---------- */

.with-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.block-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 58px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.block-list:not(:has(li)) {
    display: grid;
    place-items: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--faint);
}

.block-list:not(:has(li))::before { content: attr(data-empty); font-size: 13px; }

.block-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px 9px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: border-color .15s, background .15s, opacity .2s;
}

.block-row:hover { border-color: var(--border-strong); }
.block-row.is-hidden { opacity: .55; }
.block-row.is-hidden .info strong { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .35); }

.block-row.is-ghost { opacity: .35; border-style: dashed; }
.block-row.is-chosen { background: var(--surface-3); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

.drag-handle {
    display: grid;
    place-items: center;
    width: 26px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--faint);
    cursor: grab;
}

.drag-handle:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.drag-handle:active { cursor: grabbing; }

.thumb {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.info {
    flex: 1;
    min-width: 0;
    text-decoration: none;
}

.info strong,
.info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info strong { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.info span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.info:hover strong { color: var(--primary); }


.row-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.row-actions form { display: flex; margin: 0; }
.row-actions .switch { margin-right: 8px; }

/* ---------- Live preview ---------- */

.preview {
    position: sticky;
    top: 24px;
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.preview-head span { display: flex; align-items: center; gap: 8px; }

.phone {
    width: 320px;
    height: 640px;
    margin: 0 auto;
    overflow: hidden;
    border: 10px solid #1d1226;
    border-radius: 38px;
    background: #3a254d;
    box-shadow: 0 0 0 1px var(--border-strong), 0 24px 60px rgba(0, 0, 0, .45);
}

.phone iframe {
    display: block;
    width: 375px;
    height: 755px;
    border: 0;
    transform: scale(.8);
    transform-origin: 0 0;
}

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field > label,
.field > .label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
}

.field .hint { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.field .error { margin-top: 7px; color: var(--danger); font-size: 12px; font-weight: 500; }

.field input[type=text],
.field input[type=email],
.field input[type=url],
.field input[type=password],
.field input[type=date],
.field input[type=time],
.field select,
.field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .2);
    color: var(--text);
    font: inherit;
    transition: border-color .15s, background .15s;
}

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, .26); }

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, .28);
    box-shadow: 0 0 0 3px rgba(255, 173, 10, .15);
}

.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field select option, .field select optgroup { background: var(--surface); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-2 > .field { margin-bottom: 18px; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

.form-actions--sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 0 0 24px;
    padding: 14px 0;
    background: linear-gradient(transparent, var(--bg) 35%);
}

/* Type picker (block form) */

.type-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.type-option:hover { background: rgba(255, 255, 255, .03); }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option:has(input:checked) { border-color: var(--primary); background: rgba(255, 173, 10, .08); box-shadow: inset 0 0 0 1px var(--primary); }
.type-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Upload box */

.upload {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.upload:hover { border-color: var(--primary); background: rgba(255, 173, 10, .05); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.upload img.round { border-radius: 50%; }
.upload img.wide { width: 110px; }
.upload strong { display: block; font-size: 13px; }
.upload small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.upload .upload-name { color: var(--primary); }
.upload .upload-name:empty { display: none; }

/* Social fields */

.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.social-grid .field { margin: 0; }
.social-field label { color: var(--muted); }
.social-field.is-filled label { color: var(--text); }
.social-field .icon { display: inline-flex; }
.social-field .icon svg { width: 16px; height: 16px; fill: currentColor; }
.social-field .icon .play { fill: var(--surface); }

/* ---------- Toast ---------- */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(74, 222, 155, .35);
    border-radius: var(--radius);
    background: #0f3a2c;
    color: #d6ffea;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
    animation: toast-in .3s ease;
    transition: opacity .4s, transform .4s;
}

.toast .ui-icon { color: var(--success); }
.toast.is-leaving { opacity: 0; transform: translateY(10px); pointer-events: none; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
}

/* ---------- Login ---------- */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: radial-gradient(circle at 50% 0%, #47305e, var(--bg) 60%);
}

.auth .card { width: 100%; max-width: 400px; margin: 0; padding: 30px; }
.auth .avatar { display: block; width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--primary); }
.auth h1 { margin-bottom: 4px; text-align: center; }
.auth .muted { margin: 0 0 24px; text-align: center; }
.auth .btn-primary { width: 100%; padding: 12px; }
.auth .back { display: block; margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
    .with-preview { grid-template-columns: minmax(0, 1fr); }
    .preview { display: none; }
}

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

@media (max-width: 860px) {
    .app { grid-template-columns: minmax(0, 1fr); }

    .sidebar {
        position: sticky;
        z-index: 10;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .brand span, .account-email { display: none; }
    .brand img { width: 34px; height: 34px; }
    .side-nav { flex-direction: row; flex: 1; gap: 2px; }
    .side-nav a { padding: 8px 10px; font-size: 13px; }
    .side-nav a.active { box-shadow: inset 0 -2px 0 var(--primary); }
    .account { margin: 0; padding: 0; border: 0; background: none; }
    .content { padding: 24px 16px 48px; }
}

@media (max-width: 640px) {
    .side-nav a { gap: 0; font-size: 0; }
    .side-nav a .ui-icon { width: 20px; height: 20px; }
    .grid-2, .social-grid { grid-template-columns: 1fr; }
    .type-picker { grid-template-columns: 1fr 1fr; }
    .add-grid { grid-template-columns: 1fr; }
    .stats { width: 100%; }
    .stats div { flex: 1; min-width: 0; }
    .block-row { flex-wrap: wrap; }
    .info { flex-basis: calc(100% - 90px); }
    .row-actions { width: 100%; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--border); }
}

/* Brand icon or emoji inside a type tile */
.type-icon .icon { display: inline-flex; }
.type-icon .icon svg { width: 18px; height: 18px; fill: currentColor; }
.type-icon .icon .play { fill: var(--surface-2); }
.type-icon .icon--emoji { font-size: 18px; line-height: 1; }

/* "Jouw pagina" card under the brand */
.site-link {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: -10px;
    padding: 4px 4px 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .15);
    transition: border-color .15s;
}

.site-link:hover { border-color: var(--border-strong); }

.site-link a {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    text-decoration: none;
}

.site-link small {
    grid-column: 1 / -1;
    color: var(--faint);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.site-link span {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-link a .ui-icon { width: 14px; height: 14px; color: var(--muted); }
.site-link a:hover span { color: var(--primary); }
.site-link a:hover .ui-icon { color: var(--primary); }
.site-link .icon-btn .ui-icon { width: 16px; height: 16px; }

.icon-btn.is-copied { color: var(--success); background: rgba(74, 222, 155, .12); }

.preview-actions { display: flex; gap: 2px; }

@media (max-width: 860px) {
    .site-link { order: 3; margin: 0; padding: 0; border: 0; background: none; }
    .site-link a { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; grid-template-columns: 1fr; }
    .site-link a small, .site-link a span { display: none; }
    .site-link a .ui-icon { width: 18px; height: 18px; }
    .account { order: 4; }
}

/* ---------- Profile page ---------- */

.card--flush { padding: 0; overflow: hidden; }
.card-body { padding: 20px 22px 22px; }
.optional { margin-left: 4px; color: var(--faint); font-weight: 500; font-size: 11px; }

.profile-hero { position: relative; padding-bottom: 52px; }

.hero-banner,
.hero-avatar { position: relative; display: block; cursor: pointer; }
.hero-banner input,
.hero-avatar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.hero-banner img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: var(--surface-2);
}

.hero-avatar {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 104px;
    height: 104px;
    margin-left: -52px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    overflow: hidden;
}

.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-edit {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}

.hero-banner .hero-edit {
    right: 12px;
    top: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(29, 18, 38, .7);
    backdrop-filter: blur(4px);
}

.hero-avatar .hero-edit {
    inset: 0;
    justify-content: center;
    background: rgba(29, 18, 38, .55);
}

.hero-avatar .hero-edit .ui-icon { width: 24px; height: 24px; }
.hero-banner:hover .hero-edit,
.hero-avatar:hover .hero-edit,
.hero-banner:focus-within .hero-edit,
.hero-avatar:focus-within .hero-edit { opacity: 1; }
.hero-banner:focus-within,
.hero-avatar:focus-within { outline: 2px solid var(--primary); outline-offset: -2px; }

/* Always show the banner button subtly so it is discoverable */
.hero-banner .hero-edit { opacity: .85; }

.hero-hint {
    margin-top: 12px;
    padding: 0 22px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.hero-hint span { display: block; margin-top: 2px; color: var(--faint); }
.hero-error { padding: 0 22px; text-align: center; }

/* Social list */

.social-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px 10px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: border-color .15s;
}

.social-row:hover { border-color: var(--border-strong); }
.social-row.is-ghost { opacity: .35; border-style: dashed; }
.social-row.is-chosen { background: var(--surface-3); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }

.brand-tile {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    color: var(--brand);
    flex-shrink: 0;
}

.brand-tile .icon { display: inline-flex; }
.brand-tile .icon svg { width: 20px; height: 20px; fill: currentColor; }
.brand-tile .icon .play { fill: var(--surface-2); }

.social-input { flex: 1; min-width: 0; }

.social-input label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
}

.social-input input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.social-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 173, 10, .15);
}

.social-input .error { margin-top: 6px; color: var(--danger); font-size: 12px; font-weight: 500; }

.badge-front {
    display: none;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 173, 10, .15);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.social-row.is-front .badge-front { display: inline-block; }

.social-empty {
    margin: 0;
    padding: 18px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--faint);
    text-align: center;
}

.social-add {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.social-add .label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}

.chip .icon { display: inline-flex; }
.chip .icon svg { width: 14px; height: 14px; fill: currentColor; }
.chip .icon .play { fill: var(--surface); }
.chip:hover .icon .play { fill: var(--surface-2); }

.chip:hover {
    color: var(--text);
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.chip:hover .icon { color: var(--brand); }

/* Save bar */

.save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 10px 10px 10px 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: rgba(46, 28, 61, .92);
    backdrop-filter: blur(8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.save-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.save-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.is-dirty .save-status { color: var(--text); }
.is-dirty .save-status::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(255, 173, 10, .2); }

/* Collapsible card */

.collapse summary {
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    cursor: pointer;
}

.collapse summary::-webkit-details-marker { display: none; }
.collapse summary strong { display: block; font-size: 15px; }
.collapse summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.collapse summary > span:nth-child(2) { flex: 1; }
.collapse summary > .ui-icon { color: var(--muted); transition: transform .2s; }
.collapse[open] summary > .ui-icon { transform: rotate(180deg); }
.collapse-body { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
    .hero-banner img { height: 140px; }
    .save-status { font-size: 12px; }
    .social-row { gap: 8px; }
    .brand-tile { width: 36px; height: 36px; }
}

/* ---------- Sharing & SEO ---------- */

.seo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
}

.seo-grid .label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
}

.counter {
    margin-left: auto;
    color: var(--faint);
    font-size: 11px;
    font-weight: 600;
}

.counter.is-over { color: var(--danger); }

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

/* Discord-style embed */
.embed-preview {
    margin-bottom: 20px;
    padding: 12px 14px 14px;
    border-left: 4px solid #ffad0a;
    border-radius: 4px;
    background: #2b2d31;
    font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
}

.embed-site { display: block; color: #b5bac1; font-size: 12px; }

.embed-title {
    display: block;
    margin-top: 6px;
    color: #00a8fc;
    font-size: 15px;
    font-weight: 600;
    cursor: default;
}

.embed-description {
    display: -webkit-box;
    margin: 6px 0 0;
    overflow: hidden;
    color: #dbdee1;
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.embed-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 1200 / 630;
    margin-top: 12px;
    border-radius: 4px;
    object-fit: cover;
}

/* Google search result */
.google-preview {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    font-family: Arial, sans-serif;
}

.google-preview small { display: block; color: #4d5156; font-size: 12px; }

.google-preview strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: #1a0dab;
    font-size: 18px;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.google-preview p {
    display: -webkit-box;
    margin: 4px 0 0;
    overflow: hidden;
    color: #4d5156;
    font-size: 13px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 1000px) {
    .seo-grid { grid-template-columns: 1fr; }
}
.upload img.hero-thumb { object-position: 50% 30%; }

/* ---------- Website page ---------- */

.card--highlight { border-color: rgba(255, 173, 10, .45); box-shadow: inset 3px 0 0 var(--primary); }
.card-head--toggle { align-items: center; }
.card-head--toggle .switch-field { margin: 0 0 0 auto; font-size: 13px; }

.announcement-preview {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--primary-text);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.feature-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.feature-edit-head { display: flex; align-items: center; gap: 10px; }
.feature-edit .type-icon .icon svg { width: 18px; height: 18px; fill: currentColor; }
.feature-edit .type-icon .icon .play { fill: var(--surface-2); }

.feature-edit select,
.feature-edit input,
.feature-edit textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.feature-edit textarea { resize: vertical; line-height: 1.45; }
.feature-edit input { font-weight: 600; }
.feature-edit select option { background: var(--surface); }

.feature-edit select:focus,
.feature-edit input:focus,
.feature-edit textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 173, 10, .15); }

.feature-edit .error { color: var(--danger); font-size: 12px; }

.section-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

.section-toggle {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

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

/* ---------- Website page: sections ---------- */

.step {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 173, 10, .15);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.card.is-off > :not(.card-head) { opacity: .45; }
.card.is-off .card-head h2 { color: var(--muted); }

.hint-line { margin: 0; color: var(--muted); font-size: 12px; }
.card-head a { color: var(--primary); }

.setup-edit {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.upload--photo {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    text-align: center;
}

.upload--photo img { width: 100%; height: 140px; border-radius: var(--radius-sm); }

/* Button rows (links & gear) */

.button-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.button-list:empty { display: none; }

.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.button-row.is-ghost { opacity: .35; border-style: dashed; }
.button-row.is-chosen { background: var(--surface-3); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.button-row .type-icon .icon svg { width: 18px; height: 18px; fill: currentColor; }
.button-row .type-icon .icon .play { fill: var(--surface-2); }
.button-row .type-icon .icon--emoji { font-size: 17px; }

.button-fields {
    display: grid;
    grid-template-columns: 1fr 1.3fr 170px;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.button-fields input,
.button-fields select {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .2);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.button-fields input:first-child { font-weight: 600; }
.button-fields select option { background: var(--surface); }

.button-fields input:focus,
.button-fields select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 173, 10, .15); }

.button-fields .error { grid-column: 1 / -1; color: var(--danger); font-size: 12px; }

.btn-add {
    padding: 8px 14px;
    border-style: dashed;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
}

.btn-add:hover { color: var(--text); border-color: var(--primary); background: rgba(255, 173, 10, .06); }
.btn-add .ui-icon { width: 16px; height: 16px; }

/* Desktop preview in a browser frame */

.with-preview--wide { grid-template-columns: minmax(0, 1fr) 400px; }

.browser {
    overflow: hidden;
    border-radius: 12px;
    background: #1d1226;
    box-shadow: 0 0 0 1px var(--border-strong), 0 24px 60px rgba(0, 0, 0, .45);
}

.browser-bar { display: flex; gap: 6px; padding: 10px 12px; }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .18); }

.browser-view { width: 400px; height: 600px; overflow: hidden; background: #3a254d; }

.browser-view iframe {
    display: block;
    width: 1280px;
    height: 1920px;
    border: 0;
    transform: scale(.3125);
    transform-origin: 0 0;
}

.preview-note { margin: 10px 0 0; color: var(--faint); font-size: 12px; text-align: center; }

@media (max-width: 1400px) {
    .with-preview--wide { grid-template-columns: minmax(0, 1fr); }
    .preview--desktop { display: none; }
}

@media (max-width: 760px) {
    .setup-edit { grid-template-columns: 1fr; }
    .button-row { align-items: flex-start; }
    .button-fields { grid-template-columns: 1fr; }
}

/* Spec rows: component + product */
.spec-fields { grid-template-columns: 1fr 1.6fr; }
.spec-row { padding-left: 4px; }
.label--spaced { margin-top: 24px; }

@media (max-width: 760px) {
    .spec-fields { grid-template-columns: 1fr; }
}

/* Twitch connection status */
.twitch-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.twitch-status strong { display: block; font-size: 13px; }
.twitch-status small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.twitch-status-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--faint);
}

.twitch-status.is-ok .twitch-status-dot { background: var(--success); }
.twitch-status.is-warning { border-color: rgba(255, 173, 10, .4); }
.twitch-status.is-warning .twitch-status-dot { background: var(--primary); }
.twitch-status.is-live { border-color: rgba(255, 59, 92, .5); background: rgba(255, 59, 92, .1); }
.twitch-status.is-live .twitch-status-dot { background: #ff3b5c; box-shadow: 0 0 0 4px rgba(255, 59, 92, .25); }

/* ---------- Settings → Thema's ---------- */

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-sm .ui-icon { width: 16px; height: 16px; }
.btn-danger-soft { background: rgba(255, 107, 129, .12); border-color: rgba(255, 107, 129, .45); color: #ffb3c0; }
.btn-danger-soft:hover { background: rgba(255, 107, 129, .2); }

.side-nav-group {
    margin: 14px 12px 4px;
    color: var(--faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.breadcrumb { color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.theme-now {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 780px;
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.theme-now-emoji { font-size: 32px; line-height: 1; }
.theme-now small { display: block; color: var(--muted); font-size: 12px; }
.theme-now strong { font-size: 18px; }
.theme-now-note { margin-left: 8px; color: var(--primary); font-size: 12px; font-weight: 600; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; max-width: 1100px; margin-bottom: 18px; }

.theme-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.theme-card.is-active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.theme-card-head { display: flex; align-items: center; gap: 14px; }
.theme-card-head h2 { margin-bottom: 4px; font-size: 17px; }
.theme-emoji { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); font-size: 28px; }
.theme-card-text { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.theme-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.theme-badge--active { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.theme-badge--scheduled { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); }

.theme-swatches { display: flex; gap: 6px; }
.theme-swatches span { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }

.theme-schedule,
.theme-schedule-inline { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--primary); font-size: 13px; font-weight: 600; }
.theme-schedule-inline { display: inline-flex; margin-left: 10px; }
.theme-schedule .ui-icon { width: 16px; height: 16px; }

.theme-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; }
.theme-actions form { margin: 0; }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }

.color-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
}

.color-field input[type=color] {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: none;
    cursor: pointer;
}

.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 2px solid rgba(255, 255, 255, .2); border-radius: 10px; }
.color-field strong { display: block; font-size: 13px; }
.color-field small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-family: ui-monospace, monospace; }
.color-field .color-default { color: var(--faint); }

.form-actions--left { justify-content: flex-start; margin-top: 14px; }

.segmented {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(0, 0, 0, .2);
}

.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 18px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--primary); color: var(--primary-text); }
.segmented input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.schedule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.schedule-grid .field input { color-scheme: dark; }


@media (max-width: 760px) {
    .schedule-grid { grid-template-columns: 1fr 1fr; }
    .segmented { display: flex; }
    .segmented label { flex: 1; text-align: center; }
    .segmented span { padding: 8px 6px; }
    .theme-schedule-inline { margin: 6px 0 0; }
}
.upload img.logo-thumb { padding: 4px; object-fit: contain; background: var(--surface-2); }

/* ---------- Handleiding ---------- */

.guide-layout { display: grid; grid-template-columns: minmax(0, 820px) 240px; gap: 28px; align-items: start; }

.guide { padding: 28px 34px; font-size: 15px; line-height: 1.7; }
.guide > :first-child { margin-top: 0; }
.guide h2 { margin: 38px 0 12px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 21px; scroll-margin-top: 20px; }
.guide h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.guide h3 { margin: 26px 0 8px; color: var(--primary); font-size: 16px; scroll-margin-top: 20px; }
.guide p { margin: 0 0 12px; }
.guide ul, .guide ol { margin: 0 0 14px; padding-left: 22px; }
.guide li { margin-bottom: 6px; }
.guide li::marker { color: var(--primary); font-weight: 700; }
.guide strong { color: #fff; }
.guide em { color: var(--muted); }
.guide a { color: var(--primary); }
.guide code { padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .25); font-size: 13px; }

.guide table { width: 100%; margin: 6px 0 18px; border-collapse: collapse; font-size: 14px; }
.guide th, .guide td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.guide th { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.guide tr:hover td { background: rgba(255, 255, 255, .02); }

/* "Wat is er nieuw" stands out */
.guide h2#wat-is-er-nieuw + ul {
    padding: 14px 18px 14px 36px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.guide-toc {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.guide-toc-title { display: block; margin-bottom: 8px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.guide-toc ul { margin: 0; padding: 0; list-style: none; }
.guide-toc li a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: 13px; text-decoration: none; }
.guide-toc li a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.guide-toc li.is-sub a { padding-left: 20px; font-size: 12px; }

@media (max-width: 1100px) {
    .guide-layout { grid-template-columns: minmax(0, 1fr); }
    .guide-toc { position: static; order: -1; max-height: none; }
}

@media (max-width: 640px) {
    .guide { padding: 20px; }
    .guide table { display: block; overflow-x: auto; }
}
