/* =========================
   THEME TOKENS
   ========================= */
:root {
    --sl-bg: #0b1020;
    --sl-bg2: #0e172f;
    --sl-text: #dbe3ff;
    --sl-text-dim: #9fb0d9;
    --sl-panel: #11182b;
    --sl-border: rgba(255,255,255,.14);
    --sl-ring: #6aa6ff;
    --sl-chip: #0f1629;
    --sl-chip-border: #1f2a46;
    --sl-chip-hover: #162142;
    --sl-count-bg: #202b47;
    /* gradient (Aktiv chip / knappar) */
    --sl-a: #5bd7ff;
    --sl-b: #6a7dff;
}

/* =========================
   PAGE BACKGROUND
   ========================= */
html {
    min-height: 100%;
    background-image: linear-gradient(180deg, var(--sl-bg) 0%, var(--sl-bg2) 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: 100% 100%;
    background-color: var(--sl-bg2);
}

body {
    margin: 0;
    min-height: 100vh;
    background: transparent;
    color: var(--sl-text);
    font-family: "Inter", system-ui, sans-serif;
}

/* =========================
   HEADER / BRAND / HERO
   ========================= */
.sl-header {
    max-width: 1200px;
    margin: 18px auto 0;
    padding: 0 16px;
}

.sl-header__brand {
    margin-bottom: 2px;
}

    .sl-header__brand img {
        height: 90px; /* ändra vid behov (t.ex. 72–110px) */
        width: auto;
        display: block;
        border-radius: 12px;
    }

/* “Pill”-hero */
.sl-hero {
    margin-top: 14px;
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
    border: 1px solid var(--sl-border);
    box-shadow: 0 1px 2px rgba(2,6,23,.18), 0 10px 32px rgba(2,6,23,.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

    .sl-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(700px 220px at 110% 0%, rgba(34,211,238,.22), transparent 60%), radial-gradient(600px 240px at -10% -10%, rgba(124,92,255,.28), transparent 60%);
    }

.sl-hero__left h1 {
    margin: 0;
    font-weight: 800;
    letter-spacing: -.01em;
    font-size: clamp(24px,4.2vw,36px);
    color: #dfe7ff;
}

.sl-hero__left p {
    margin: 6px 0 0;
    color: #cbd5e1;
    font-size: clamp(13px,2.1vw,15px);
}

.sl-hero__right {
    display: flex;
    gap: 12px;
}

/* Icon buttons (cart / grid / list) */
.sl-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--sl-border);
    height: 44px;
    min-width: 60px;
    padding: 0 14px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: rgba(255,255,255,.06);
    color: #e5e7eb;
    transition: transform .06s ease, background .2s ease, box-shadow .2s ease;
}

    .sl-btn svg {
        width: 20px;
        height: 20px;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .sl-btn:active {
        transform: translateY(1px);
    }

.sl-btn--ghost {
    background: rgba(255,255,255,.06);
}

.sl-btn--active {
    background: linear-gradient(90deg, var(--sl-a), var(--sl-b));
    color: #0b0f1d;
    border-color: transparent;
    box-shadow: 0 8px 26px rgba(124,92,255,.28);
}

.sl-btn:focus-visible {
    outline: 3px solid var(--sl-ring);
    outline-offset: 2px;
}

/* =========================
   CATEGORY CHIPS (Bild 2)
   ========================= */
.catbar {
    display: flex;
    gap: 12px;
    padding: 14px 0 0;
    overflow: auto hidden;
}

    .catbar::-webkit-scrollbar {
        height: 8px;
    }

    .catbar::-webkit-scrollbar-thumb {
        background: #1b2645;
        border-radius: 8px;
    }

    /* Reset av länkstil i chip */
    .catbar a.chip {
        text-decoration: none;
        color: var(--sl-text);
    }

    /* PILL */
    .catbar .chip {
        --pad-x: 14px;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 8px var(--pad-x);
        background: var(--sl-chip);
        border: 1px solid var(--sl-chip-border);
        border-radius: 999px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        transition: background .18s ease, border-color .18s ease, transform .08s ease;
    }

        .catbar .chip:hover {
            background: var(--sl-chip-hover);
            border-color: #2a3a63;
        }

        .catbar .chip:active {
            transform: translateY(1px);
        }

        .catbar .chip:focus-visible {
            outline: 3px solid var(--sl-ring);
            outline-offset: 2px;
        }

        /* Färgad dot */
        .catbar .chip .dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            box-shadow: 0 0 0 3px rgba(255,255,255,.04) inset, 0 0 12px rgba(255,255,255,.05);
            flex: 0 0 9px;
        }
        /* Räknare */
        .catbar .chip .count {
            min-width: 22px;
            height: 22px;
            padding: 0 6px;
            display: inline-grid;
            place-items: center;
            background: var(--sl-count-bg);
            border-radius: 999px;
            font-size: 12px;
            font-weight: 700;
            color: #cfe0ff;
        }
        /* Aktiv */
        .catbar .chip.active {
            background: linear-gradient(135deg, var(--sl-a), var(--sl-b));
            border-color: transparent;
            color: #0a1022;
            box-shadow: 0 10px 28px rgba(86,125,255,.25);
        }

            .catbar .chip.active .count {
                background: rgba(0,0,0,.12);
                color: #0a1022;
            }

            .catbar .chip.active .dot {
                box-shadow: none;
            }

/* =========================
   GRID / CARD
   ========================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
    gap: 16px;
    margin-top: 16px;
}

.card {
    background: var(--sl-panel);
    border: 1px solid var(--sl-chip-border);
    border-radius: 16px;
    overflow: hidden;
}

    .card .media {
        position: relative;
        aspect-ratio: 16/9;
        background: #0a0f1f;
    }

        .card .media img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

    .card .badge {
        position: absolute;
        left: 10px;
        bottom: 10px;
        background: rgba(0,0,0,.55);
        color: #fff;
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 999px;
        backdrop-filter: blur(6px);
    }

    .card .content {
        padding: 14px;
    }

    .card .title {
        margin: 0 0 6px;
        font-size: 18px;
    }

    .card .dek {
        margin: 0 0 10px;
        color: var(--sl-text-dim);
    }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 12px;
    padding: 4px 8px;
    background: #0e1731;
    border: 1px solid #1f2a46;
    border-radius: 999px;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width:900px) {
    .sl-header__brand img {
        height: 84px;
    }

    .sl-hero {
        padding: 14px;
        border-radius: 22px;
    }
}

@media (max-width:640px) {
    .sl-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .sl-hero__right {
        justify-content: flex-end;
    }
}
/* Centrera logon-blocket */
.sl-header__brand {
    display: flex;
    justify-content: center;
}

/* ====== HERO: vänsterställd och större titel ====== */
.sl-hero {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.sl-hero__left {
    text-align: left !important;
}

    .sl-hero__left h1 {
        font-size: clamp(32px, 5.0vw, 48px); /* större än tidigare */
        line-height: 1.1;
    }

    .sl-hero__left p {
        font-size: clamp(13px, 2.0vw, 16px);
    }

/* ====== Kategorichips: mindre som i bild 2 ====== */
.catbar {
    max-width: 1200px;
    margin: 8px auto 0;
    gap: 10px;
    padding: 10px 16px 0;
}

    .catbar .chip {
        /* mindre pill */
        --pad-x: 12px;
        padding: 6px var(--pad-x);
        gap: 8px;
        font-size: 14px;
        border-radius: 999px;
        background: var(--sl-chip);
        border: 1px solid var(--sl-chip-border);
    }

        .catbar .chip .dot {
            width: 7px;
            height: 7px;
            box-shadow: 0 0 0 2px rgba(255,255,255,.04) inset, 0 0 10px rgba(255,255,255,.05);
        }

        .catbar .chip .count {
            min-width: 20px;
            height: 20px;
            padding: 0 6px;
            font-size: 11px;
            font-weight: 700;
        }

        /* Aktiv chip – behåll look men i mindre storlek */
        .catbar .chip.active {
            background: linear-gradient(135deg, var(--sl-a), var(--sl-b));
            border-color: transparent;
            color: #0a1022;
            box-shadow: 0 8px 22px rgba(86,125,255,.22);
        }

            .catbar .chip.active .count {
                background: rgba(0,0,0,.12);
                color: #0a1022;
            }

/* Desktop: inga horisontella scrollbars, mobil: vänsterställ + scroll */
@media (min-width: 641px) {
    .catbar {
        overflow: visible;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .catbar {
        overflow: auto hidden;
        justify-content: flex-start;
    }
}
/* Vänsterjustera loggan */
.sl-header__brand {
    display: flex; /* kan även tas bort helt om du vill */
    justify-content: flex-start;
    text-align: left;
}

    .sl-header__brand img {
        display: block; /* tar bort inline-centering */
        margin: 0; /* säkerställ inget auto-marginal */
    }
#slHeading {
    line-height: 1.4;
    text-align: left;
    font-weight: 800;
}
/* Account and administration */
.account-nav{max-width:1200px;margin:0 auto;padding:14px 18px;display:flex;flex-wrap:wrap;align-items:center;gap:14px;color:#dbe3ff}
.account-nav a{color:#c9e3ff;text-decoration:none;font-weight:600}.account-nav button,.admin-area button{cursor:pointer;background:#304b87;border:1px solid #6072b2;border-radius:9px;padding:9px 14px;color:white}.account-nav form{margin:0}.account-nav-spacer{flex:1}.account-user{color:#aebce4}.language-form{display:flex;gap:8px;align-items:center}.language-form select{background:#151f39;color:white;border:1px solid #41547a;border-radius:8px;padding:7px}
.auth-panel{max-width:440px;margin:55px auto;padding:32px;border:1px solid var(--sl-border);border-radius:24px;background:#111b31;box-shadow:0 14px 50px #0003}.auth-panel h1{margin:0 0 12px;color:white}.auth-panel form{display:flex;flex-direction:column;gap:10px}.auth-panel label{font-size:14px;margin-top:9px}.auth-panel input,.admin-area input,.admin-area select{width:100%;box-sizing:border-box;background:#10192d;border:1px solid #425273;color:#f1f5ff;border-radius:10px;padding:12px;min-height:43px}.auth-primary{background:linear-gradient(100deg,#19c4f1,#626ef6);border:0;border-radius:10px;padding:13px;font-weight:700;margin-top:15px;cursor:pointer;color:#061124}.auth-error{color:#ffafb6;margin:14px 0}.admin-area{max-width:1150px;margin:25px auto;padding:0 18px}.admin-card{border:1px solid var(--sl-border);border-radius:20px;background:#111b31;margin:20px 0;padding:24px}.admin-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.admin-form label{display:flex;flex-direction:column;gap:8px}.admin-form p{grid-column:1/-1}.admin-form button{justify-self:start}.admin-inline{display:flex;gap:14px;max-width:600px}.admin-table-scroll{overflow:auto}.admin-table{width:100%;border-collapse:collapse}.admin-table th,.admin-table td{padding:13px;text-align:left;border-bottom:1px solid #33415d}.admin-table th{color:#a9bbdf}@media(max-width:600px){.auth-panel{margin:20px 12px;padding:22px}.account-nav{gap:9px}.account-user{display:none}}

/* Compact language selector with a consistent inline SVG arrow. */
.language-select{position:relative;display:inline-flex;align-items:center;flex:none}
.language-form .language-select select{
    appearance:none;-webkit-appearance:none;-moz-appearance:none;
    width:auto;min-width:62px;height:36px;
    padding:0 25px 0 12px;
    margin:0;border:1px solid #41547a;border-radius:10px;
    background-color:#151f39;color:#f5f8ff;
    font:600 13px/1 Inter,system-ui,sans-serif;
    cursor:pointer;box-shadow:0 1px 2px #0002;
}
.language-form .language-select select::-ms-expand{display:none}
.language-select__chevron{
    position:absolute;right:8px;top:50%;transform:translateY(-50%);
    width:13px;height:13px;color:#d6e2fa;pointer-events:none;
}
.language-form .language-select select:hover{border-color:#7089bb;background-color:#1b2b4c}
.language-form .language-select select:focus-visible{outline:2px solid #85baff;outline-offset:2px}

/* StoryLens form feedback: utility-style, self-hosted CSS (no third-party runtime). */
.sl-form-hint{color:#a9bade;font-size:.9rem;line-height:1.55;margin:0 0 14px}
.sl-field-error{display:block;color:#ff9fae;font-size:.8rem;line-height:1.4;margin-top:2px}
.sl-field-error:empty,.sl-field-error[hidden]{display:none}
.auth-panel input[aria-invalid="true"]{border-color:#fa7185;box-shadow:0 0 0 3px rgb(244 63 94 / 12%)}
.auth-panel input:focus-visible{outline:2px solid #63b3ff;outline-offset:2px}
.sl-dialog{position:fixed;inset:0;max-width:min(420px,calc(100vw - 32px));width:100%;margin:auto;border:1px solid #374966;border-radius:20px;padding:0;background:#121f36;color:#f4f7ff;box-shadow:0 25px 90px #0009}
.sl-dialog::backdrop{background:rgba(2,6,23,.78);backdrop-filter:blur(5px)}
.sl-dialog-content{display:flex;flex-direction:column;align-items:flex-start;gap:13px;padding:28px}
.sl-dialog-icon{display:grid;place-items:center;border-radius:13px;height:44px;width:44px;background:rgb(244 63 94 / 15%);color:#fb7185;font-size:28px;font-weight:750}
.sl-dialog h2{font-size:1.25rem;line-height:1.3;margin:0;color:#f6f8ff}
.sl-dialog p{color:#bfcae1;line-height:1.55;margin:0;white-space:pre-wrap}
.sl-dialog-close{align-self:flex-end;margin-top:12px;border:0;border-radius:10px;background:linear-gradient(110deg,#22bdeb,#626ef6);padding:11px 21px;color:#061124;font-weight:750;cursor:pointer}
.sl-dialog-close:focus-visible{outline:2px solid white;outline-offset:3px}
.sl-server-error{display:none}
@media(prefers-reduced-motion:reduce){.sl-dialog::backdrop{backdrop-filter:none}}

/* StoryLens article editor */
.article-editor{width:min(100% - 36px,880px);margin:34px auto 90px;color:#ecf2ff}
.article-editor__heading{margin-bottom:24px}
.article-editor__back{display:inline-flex;align-items:center;gap:6px;margin-bottom:22px;color:#a9bde5;text-decoration:none;font-size:13px;font-weight:600}
.article-editor__back:hover{color:#69d6ff}
.article-editor__back svg{width:16px;height:16px}
.article-editor__heading h1{font-size:clamp(27px,3.6vw,38px);line-height:1.18;letter-spacing:-.035em;margin:0 0 10px;font-weight:800;color:#eef3ff}
.article-editor__heading p{margin:0;color:#aab9d8;font-size:14px}
.article-editor__form{padding:32px;background:linear-gradient(145deg,#141f38,#10192e);border:1px solid #30405f;border-radius:22px;box-shadow:0 18px 52px #0003}
.article-editor__section-heading{display:flex;gap:14px;align-items:flex-start;margin:0 0 24px}
.article-editor__section-icon{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#183c5c,#353a80);color:#9bdfff;font-size:13px;font-weight:800}
.article-editor__section-heading h2{margin:0 0 5px;color:#f2f6ff;font-size:17px;font-weight:700}
.article-editor__section-heading p{margin:0;color:#9caccc;font-size:13px;line-height:1.6}
.article-editor__field{display:flex;flex-direction:column;gap:8px;margin-bottom:22px;min-width:0}
.article-editor__field label{font-size:13px;font-weight:650;color:#d5e2ff}
.article-editor__required{color:#78cfff}
.article-editor__field input,.article-editor__field textarea{width:100%;box-sizing:border-box;display:block;border-radius:11px;background:#0c162b;color:#f5f8ff;border:1px solid #384a6a;padding:13px 15px;font:inherit;font-size:14px;line-height:1.6;min-height:48px;transition:border-color .15s,box-shadow .15s}
.article-editor__field textarea{resize:vertical;min-height:100px}
.article-editor__field .article-editor__body{min-height:300px}
.article-editor__field input::placeholder,.article-editor__field textarea::placeholder{color:#7285a8}
.article-editor__field input:focus,.article-editor__field textarea:focus{outline:0;border-color:#69bbff;box-shadow:0 0 0 3px #4aa5ff25}
.article-editor__field input[aria-invalid=true],.article-editor__field textarea[aria-invalid=true]{border-color:#ff8497}
.article-editor__validation{display:block;color:#ff9fb0;font-size:12px}
.article-editor__validation:empty,.article-editor__summary:empty{display:none}
.article-editor__summary{color:#ff9fb0;margin-bottom:20px}
.article-editor__divider{height:1px;background:#2b3954;margin:28px 0}
.article-editor__two-col{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.article-editor__categories{border:0;padding:0;margin:0 0 14px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;min-width:0}
.article-editor__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.article-editor__category{position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:13px 14px;border:1px solid #354764;background:#0d182d;border-radius:12px;cursor:pointer;color:#c9d7f1;font-size:13px;font-weight:600;transition:background .15s,border-color .15s}
.article-editor__category:hover{background:#172643;border-color:#627da9}
.article-editor__category:has(input:checked){border-color:#53b6ff;background:#152b50;color:#f4f8ff}
.article-editor__category:has(input:focus-visible){outline:2px solid #91d5ff;outline-offset:3px}
.article-editor__category input{position:absolute;width:1px;height:1px;opacity:0}
.article-editor__category-name{min-width:0;overflow-wrap:anywhere}
.article-editor__check{flex:none;width:18px;height:18px;color:#62ccff;opacity:0}
.article-editor__category input:checked~.article-editor__check{opacity:1}
.article-editor__footer{display:flex;justify-content:flex-end;gap:12px;align-items:center;margin-top:30px;padding-top:25px;border-top:1px solid #2b3954}
.article-editor__cancel,.article-editor__save{min-height:43px;display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:0 22px;border-radius:10px;font:inherit;font-size:14px;font-weight:700;text-decoration:none;cursor:pointer}
.article-editor__cancel{border:1px solid #455574;background:#18243b;color:#d5e0f8}
.article-editor__cancel:hover{background:#243451}
.article-editor__save{border:0;background:linear-gradient(105deg,#23c4f1,#6176fa);color:#07152a;box-shadow:0 8px 23px #344ffa30}
.article-editor__save:hover{filter:brightness(1.08)}
.article-editor__save svg{width:17px;height:17px}
.article-editor__save:focus-visible,.article-editor__cancel:focus-visible{outline:2px solid #9adcff;outline-offset:3px}
@media(max-width:650px){.article-editor{width:min(100% - 28px,880px);margin-top:20px}.article-editor__form{padding:20px}.article-editor__two-col{grid-template-columns:1fr;gap:0}.article-editor__categories{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:390px){.article-editor__categories{grid-template-columns:1fr}}
