/* =====================================================================
   bfs2024.se – sidans egna stilar (flyttade från <style> i index.html)
   Oanvända regler från rapportmallen (innehållsförteckning, tryckmallar,
   Kalla, InfoRuta, Titel1–7 m.fl.) är borttagna.
   ===================================================================== */

/* ---------- Grundtypografi ---------- */
body {
    line-height: 135%;
    font-family: 'Open Sans', sans-serif;
    font-size: 10pt;
    margin: 0;
    padding: 0;
}

sub {
    vertical-align: text-bottom;
    position: relative;
    font-size: 6pt;
    top: .5em;
}

ul { margin-block-start: 0.4em; }

a:link, a:visited, a:active { color: #000000; text-decoration: none; }
a:hover { text-decoration: none; }

h1, h2, h3, h4, h5, h6, p { margin: 0; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans Condensed';
    font-weight: normal;
    font-style: normal;
    color: #000000;
    margin-left: 0;
    page-break-inside: avoid;
    page-break-after: avoid;
}
h1 { margin-bottom: 3pt; line-height: 108%; font-size: 20pt; }
h2 { margin-bottom: 3pt; line-height: 108%; font-size: 16pt; }
h3 { line-height: normal; font-size: 14pt; }
h4 { line-height: normal; font-size: 12pt; }
h5 { margin-top: 2pt; margin-bottom: 1pt; line-height: normal; font-size: 10pt; }
h6 { margin-top: 2pt; line-height: normal; font-size: 8pt; }

figcaption {
    margin-bottom: 12pt;
    line-height: normal;
    font-size: 8pt;
    font-style: italic;
}

/* Hopp via länk (#kap5_para2), kapitelmenyn och sök landar annars under
   den fasta menyraden. */
[id^="kap"], h1, h2, h3, h4 { scroll-margin-top: 90px; }

/* Synlig fokusmarkering för tangentbordsanvändare */
:focus-visible { outline: 2px solid #1565c0; outline-offset: 2px; }

/* ---------- Toppmeny (desktop) ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 900;
    background-color: #fff;
}

.desktop-menu { margin: 70px; }

.TopMenu-dropdown-content { max-width: 100%; }

.TopMenu-item,
.TopMenu-submenu-label,
.TopMenu-dropdown-content a {
    padding: 12px 15px;
    min-height: 48px;
}

/* Menyerna öppnas även med tangentbord (bara tangentbordsfokus, så att en meny
   inte blir hängande öppen efter ett musklick) */
.TopMenu-item:focus-visible > .TopMenu-dropdown-content,
.TopMenu-item:has(:focus-visible) > .TopMenu-dropdown-content { display: block; }
.TopMenu-submenu:has(:focus-visible) > .TopMenu-nested-submenu { display: block; }

.TopMenu-nested-submenu a { padding-left: 30px !important; }
.TopMenu-nested-submenu .TopMenu-submenu-label {
    padding-left: 30px !important;
    font-size: 0.95em;
}
.TopMenu-nested-submenu .TopMenu-nested-submenu a {
    padding-left: 45px !important;
    font-size: 0.9em;
}
.TopMenu-nested-submenu {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Aktuellt kapitel uppe till höger */
#current-heading-box { cursor: pointer; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
#current-chapter-label,
#current-chapter-label-mobile { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#chapter-dropdown {
    scrollbar-width: thin;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1200;
}
#chapter-dropdown a {
    min-height: auto !important;
    padding: 6px 15px !important;
    line-height: 1.3;
    color: #334155;
    text-decoration: none;
    display: block;
}
#chapter-dropdown a:hover { background-color: #f1f5f9; color: #1e293b !important; }
#chapter-dropdown.open-click { display: block; }

#chapter-dropdown-mobile { display: none; }

/* ---------- Mobil ---------- */
.mobile-boarder { display: none !important; }

.mobile-menu {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background-color: #fff;
    color: #555;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px 20px 40px;
    box-sizing: border-box;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { left: 0; }
.mobile-menu h2 { margin-top: 0; }
.mobile-menu ul { list-style-type: none; padding-left: 0; }
.mobile-menu li { margin-bottom: 10px; }
.mobile-menu li a,
.mobile-menu li span {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 8px;
    background-color: #fff;
    border-radius: 4px;
}
.mobile-menu li > span { cursor: pointer; }
.mobile-menu li a:hover,
.mobile-menu li span:hover { background-color: #c0c0c0; }
.mobile-menu .submenu {
    display: none;
    margin-top: 5px;
    margin-left: 10px;
    list-style-type: disc;
    padding-left: 15px;
}
.mobile-menu .submenu.visible { display: block; }
.mobile-menu .submenu ul {
    margin-top: 5px;
    margin-left: 10px;
    list-style-type: disc;
    padding-left: 15px;
}

#close-menu {
    margin-top: 20px;
    padding: 10px;
    width: 100%;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#close-menu:hover { background-color: #222; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 900;
    display: none;
}
.overlay.visible { display: block; }

/* Flytande feedback-knapp */
#floating-feedback-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background-color: #59A4DD;
    color: white;
    border: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: transform 0.2s;
}
#floating-feedback-btn:hover { transform: scale(1.1); }

@media (max-width: 768px) {
    .desktop-menu { display: none !important; }
    .mobile-boarder { display: flex !important; margin-bottom: 150px; }
    .mainSection { margin: 35px; }
    .hamburger {
        transform: translateY(-3px) !important;
        margin-top: 0 !important;
        font-size: 16pt;
        padding: 5px;
        padding-left: 0;
    }
    #current-heading-box-mobile { cursor: pointer; }
    #chapter-dropdown-mobile {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        background: #ffffff;
        border-bottom: 2px solid #e2e8f0;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        z-index: 999999 !important;
        display: none;
    }
    #chapter-dropdown-mobile.open-click { display: block !important; }
    #chapter-dropdown-mobile a {
        display: block;
        padding: 10px 20px;
        color: #334155;
        border-bottom: 1px solid #f1f5f9;
        text-decoration: none;
        min-height: auto !important;
    }
    /* Mindre feedback-knapp som skymmer mindre av texten */
    #floating-feedback-btn { width: 44px; height: 44px; bottom: 16px; right: 16px; font-size: 1.15rem; opacity: 0.9; }
    /* Plats under sista stycket så knappen inte täcker det */
    #content { padding-bottom: 70px; }
}

@media (max-width: 650px) {
    .ce-block__content, .paragraph-comment-section {
        max-width: 100% !important;
        padding: 0 10px !important;
    }
    .ce-toolbar__content { max-width: 100% !important; }
}

/* ---------- Modaler ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1100;
    justify-content: center;
    align-items: center;
}
.modal-content { background: white; padding: 30px; border-radius: 12px; width: 100%; max-width: 400px; position: relative; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); box-sizing: border-box; }
.modal-content input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 6px; box-sizing: border-box; font-family: inherit; }
.close-modal { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }
.modal-body { font-size: 12pt; padding: 20px; }
.hide { display: none !important; }

/* Räddningstjänstkartan */
.rtmap-content {
    background: #fdf9f4;
    border-radius: 12px;
    width: 95vw;
    height: 90vh;
    max-width: 1500px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    overflow: hidden;
}
.rtmap-content iframe { width: 100%; height: 100%; border: none; display: block; }
.rtmap-close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 5;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
}
.rtmap-close:hover { color: #111827; }
@media (max-width: 768px) {
    .rtmap-content { width: 100vw; height: 100vh; border-radius: 0; }
}

/* Sökfönstrets lägesknappar */
.hide-radio { display: none; }
#search-comments-modal input[type="checkbox"].filled-in { width: 0; left: 0; position: absolute; }
.search-mode-pill {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    user-select: none;
}
.hide-radio:checked + .search-mode-pill { background-color: #1e293b; color: white; border-color: #1e293b; }
.hide-radio:focus-visible + .search-mode-pill { outline: 2px solid #1565c0; outline-offset: 2px; }
.search-mode-pill:hover { border-color: #94a3b8; }

/* ---------- Editor.js ---------- */
.toggle-block__input { font-weight: bold; }
.toggle-block__item div {
    padding-left: 5px;
    padding-right: 5px;
    background-color: #cbe4f6;
}
.codex-editor__redactor { padding-bottom: 5px !important; }
.codex-editor { z-index: unset; }
.codex-editor:has(.ce-popover--opened) { z-index: 1001; }

.simple-image { padding: 20px 0; }
.simple-image img { max-width: 100%; margin-bottom: 15px; }
.simple-image.withBorder img { border: 1px solid #e8e8eb; }
.simple-image.withBackground { background: #eff2f5; padding: 10px; }
.simple-image.withBackground img { display: block; max-width: 60%; margin: 0 auto 15px; }

/* ---------- Ordlista och verktygslänkar ---------- */
.gl-term {
    border-bottom: 1px dotted #64748b;
    cursor: help;
}
.gl-term:hover { background-color: #f1f5f9; }
.gl-off .gl-term { border-bottom: none; cursor: inherit; background: none; }

#gl-tooltip {
    position: fixed;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    padding: 10px 12px;
    font-size: 9.5pt;
    line-height: 1.45;
    color: #1e293b;
    box-sizing: border-box;
}
#gl-tooltip[hidden] { display: none; }
.gl-tip-term { font-family: 'Open Sans Condensed'; font-size: 12pt; margin-bottom: 4px; color: #0f172a; }
.gl-tip-def { margin-bottom: 6px; }
.gl-cp-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 8px 0 6px; }
.gl-cp-scale span { background: #eef2f6; border: 1px solid #e2e8f0; border-radius: 4px; padding: 0 4px; font-size: 8pt; font-variant-numeric: tabular-nums; }
.gl-cp-scale i { font-size: 7pt; color: #94a3b8; }
.gl-cp-ex { color: #475569; font-size: 8.5pt; margin-bottom: 6px; }
#gl-tooltip a.gl-tip-src { font-size: 8pt; color: #1565c0; text-decoration: underline; }

/* ---------- Relevanta länkar (chips) ---------- */
.paragraph-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.link-chip-wrap { position: relative; display: inline-flex; }
a.link-chip, a.link-chip:link, a.link-chip:visited, button.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    max-width: 300px;
    padding: 0 12px 0 4px;
    border-radius: 14px;
    background: #eef2f6;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
a.link-chip:hover, button.link-chip:hover { background: #e2e8f0; border-color: #cbd5e1; }
.link-chip > .link-chip-icon {
    width: 16px;
    height: 16px;
    margin: 0 2px 0 4px;
    flex-shrink: 0;
}
.link-chip > img.link-chip-icon { border-radius: 3px; object-fit: contain; }
.link-chip > i.link-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1565c0;
    font-size: 0.78rem;
}
.link-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.link-chip-add { background: transparent; border-style: dashed; color: #64748b; }
.link-chip-wrap--hidden .link-chip { border-style: dashed; opacity: 0.8; }
.link-chip-edit {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1565c0;
    font-size: 8px;
    line-height: 16px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    cursor: pointer;
    display: none;
}
.link-chip-wrap:hover .link-chip-edit, .link-chip-edit:focus-visible { display: block; }
@media (hover: none) { .link-chip-edit { display: block; } }

/* Förhandsvisning av länk vid hovring */
#link-preview {
    position: fixed;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    padding: 0;
    overflow: hidden;
    font-size: 9.5pt;
    line-height: 1.45;
    color: #1e293b;
    box-sizing: border-box;
    pointer-events: auto;
}
#link-preview .lp-body { padding: 10px 12px; }
#link-preview[hidden] { display: none; }
#link-preview .lp-head { display: flex; align-items: center; gap: 6px; color: #64748b; font-size: 8pt; margin-bottom: 4px; }
#link-preview .lp-icon { width: 14px; height: 14px; border-radius: 2px; font-size: 11px; color: #1565c0; display: inline-flex; align-items: center; justify-content: center; }
#link-preview a.lp-title { display: block; font-weight: 600; color: #0f172a; margin-bottom: 4px; text-decoration: none; }
#link-preview a.lp-title:hover { text-decoration: underline; }
#link-preview .lp-desc {
    color: #334155;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#link-preview a.lp-url { display: block; color: #1565c0; font-size: 8pt; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
#link-preview a.lp-url:hover { text-decoration: underline; }
#link-preview a.lp-url i { font-size: 0.85em; margin-left: 2px; }

/* Redigeringsfönster för länkar (admin) */
.le-content { max-width: 520px !important; max-height: 92vh; overflow-y: auto; }
.le-heading { margin: 0; font-family: 'Open Sans Condensed'; }
.le-para { margin: 2px 0 14px; color: #64748b; font-size: 0.85rem; }
.le-label { display: block; font-size: 0.8rem; font-weight: 600; color: #475569; margin: 10px 0 4px; }
.le-hint { font-weight: normal; color: #94a3b8; font-size: 0.78rem; }
#link-edit-modal input[type="text"], #link-edit-modal input[type="url"], #link-edit-modal textarea, #link-edit-modal select {
    width: 100%; box-sizing: border-box; padding: 8px 10px; margin: 0; height: auto;
    border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 0.9rem; background: #fff;
}
#link-edit-modal select { display: block; }
#link-edit-modal textarea { resize: vertical; min-height: 80px; }
.le-row { display: flex; gap: 8px; align-items: center; }
.le-row > input, .le-row > select { flex: 1; }
.le-btn {
    white-space: nowrap; padding: 8px 12px; border-radius: 6px; border: 1px solid #cbd5e1;
    background: #f8fafc; color: #1e293b; font-family: inherit; font-size: 0.85rem; cursor: pointer;
}
.le-btn:hover { background: #e2e8f0; }
.le-primary { background: #1565c0; border-color: #1565c0; color: #fff; font-weight: 600; }
.le-primary:hover { background: #0d47a1; }
.le-danger { color: #dc2626; border-color: #fecaca; background: #fff; }
.le-danger:hover { background: #fef2f2; }
.le-status { margin: 6px 0 0; font-size: 0.8rem; color: #64748b; min-height: 1em; }
.le-status--ok { color: #15803d; }
.le-status--error { color: #dc2626; }
.le-status--warn { color: #b45309; }
.le-icon-preview { width: 34px; height: 34px; border: 1px solid #e2e8f0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.le-icon-preview .le-icon-img { width: 20px; height: 20px; font-size: 16px; color: #1565c0; object-fit: contain; display: inline-flex; align-items: center; justify-content: center; }
.le-image-box { border: 1px dashed #cbd5e1; border-radius: 6px; padding: 8px; text-align: center; }
.le-image-box .le-image { display: block; max-width: 100%; max-height: 160px; margin: 0 auto 6px; border-radius: 4px; }
.le-link-btn { background: none; border: none; color: #dc2626; font-size: 0.8rem; cursor: pointer; text-decoration: underline; }
.le-check { display: block; margin: 14px 0 4px; font-size: 0.85rem; }
.le-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; }

/* ---------- Dolda funktioner (visas efter Konamikoden) ---------- */
body:not(.tools-revealed) .hidden-feature { display: none !important; }

/* ---------- Byggnadsguide ---------- */
.bg-content { max-width: 1100px !important; width: 96vw !important; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; padding: 22px 26px !important; }
.bg-heading { margin: 0; font-family: 'Open Sans Condensed'; font-size: 18pt; }
.bg-heading i { color: #1565c0; font-size: 0.8em; margin-right: 4px; }
.bg-beta { font-family: 'Open Sans', sans-serif; font-size: 8pt; background: #fef3c7; color: #92400e; border-radius: 10px; padding: 1px 8px; vertical-align: middle; }
.bg-intro { margin: 4px 0 14px; color: #64748b; font-size: 0.85rem; }
.bg-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 22px; min-height: 0; flex: 1; }
.bg-form, .bg-results { overflow-y: auto; min-height: 0; padding-right: 6px; }
.bg-form fieldset { border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px 12px; margin: 0 0 12px; }
.bg-form legend { font-weight: 600; color: #334155; font-size: 0.85rem; padding: 0 4px; }
.bg-form label { display: block; font-size: 0.8rem; color: #475569; margin-top: 8px; }
#guide-modal input[type="number"], #guide-modal select {
    display: block; width: 100%; box-sizing: border-box; height: auto; margin: 3px 0 0; padding: 6px 8px;
    border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 0.88rem; background: #fff;
}
#guide-modal input[type="checkbox"] { position: static; opacity: 1; pointer-events: auto; width: auto; height: auto; margin: 0 6px 0 0; vertical-align: -1px; }
.bg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bg-check, .bg-check-inline { display: flex !important; align-items: center; cursor: pointer; }
.bg-row { border-top: 1px dashed #e2e8f0; padding-top: 8px; margin-top: 8px; }
.bg-row:first-of-type { border-top: none; margin-top: 0; }
.bg-row-extra { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 10px; }
.bg-row-extra .bg-inline { flex: 0 0 110px; }
.bg-row-extra .bg-inline--wide { flex: 1 1 100%; }
.bg-row-top { display: flex; align-items: center; gap: 4px; }
.bg-row-top select { flex: 1; min-width: 0; }
.bg-row-extra:empty { display: none; }
.bg-remove { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 1rem; padding: 4px; }
.bg-remove:hover { color: #dc2626; }
.bg-add { margin-top: 10px; background: none; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 6px 10px; color: #1565c0; cursor: pointer; font-family: inherit; font-size: 0.82rem; width: 100%; }
.bg-form-actions { text-align: right; }
.bg-summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; position: sticky; top: 0; background: #fff; padding-bottom: 8px; z-index: 1; }
.bg-badge { background: #e0ecfa; color: #0d47a1; font-weight: 700; border-radius: 6px; padding: 4px 10px; font-size: 0.9rem; }
.bg-badge--br { background: #0d47a1; color: #fff; }
.bg-badge--warn { background: #fee2e2; color: #b91c1c; }
.bg-sec { margin-bottom: 14px; }
.bg-sec h4 { font-family: 'Open Sans Condensed'; font-size: 13pt; margin: 6px 0 4px; border-bottom: 1px solid #e2e8f0; padding-bottom: 2px; }
.bg-sec dl { margin: 0; }
.bg-item { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.84rem; }
.bg-item dt { color: #475569; }
.bg-item dd { margin: 0; color: #0f172a; }
.bg-note { color: #64748b; font-size: 0.76rem; margin-top: 2px; }
.bg-warning { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 6px; padding: 8px 10px; font-size: 0.82rem; margin: 6px 0; }
a.bg-ref, a.bg-ref:link, a.bg-ref:visited {
    display: inline-block; font-size: 0.72rem; color: #1565c0; background: #eef4fc; border: 1px solid #d6e4f7;
    border-radius: 10px; padding: 0 6px; margin: 1px 2px 1px 0; text-decoration: none; font-variant-numeric: tabular-nums; vertical-align: 1px;
}
a.bg-ref:hover { background: #1565c0; color: #fff; }
.bg-disclaimer { color: #94a3b8; font-size: 0.74rem; margin: 10px 0 0; }
@media (max-width: 800px) {
    .bg-content { width: 100vw !important; max-height: 100vh; height: 100vh; border-radius: 0 !important; padding: 16px !important; overflow-y: auto; display: block; }
    .bg-grid { display: block; }
    .bg-form, .bg-results { overflow: visible; min-height: auto; padding-right: 0; }
    .bg-summary { position: static; }
    .bg-item { grid-template-columns: 1fr; gap: 2px; }
}

/* Markerade paragrafer från guiden */
.ce-block.guide-hit { box-shadow: inset 3px 0 0 #1565c0; background: linear-gradient(90deg, #eef4fc, rgba(238,244,252,0) 60%); }
#guide-markbar {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1000;
    background: #0f172a; color: #fff; border-radius: 24px; padding: 6px 8px 6px 16px; display: flex; align-items: center; gap: 4px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25); font-size: 0.85rem;
}
#guide-markbar[hidden] { display: none; }
#guide-markbar span { margin-right: 6px; }
#guide-markbar button { background: transparent; border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
#guide-markbar button:hover { background: rgba(255,255,255,0.15); }

/* ---------- Super-user ---------- */
body:not(.su-admin) .su-only { display: none !important; }
#su-basic-pill {
    position: fixed; left: 14px; bottom: 18px; z-index: 1001; border: none; cursor: pointer;
    background: #0f172a; color: #fff; border-radius: 20px; padding: 7px 14px; font-family: inherit; font-size: 0.8rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
#su-basic-pill span { color: #93c5fd; }

/* Taggar per paragraf (endast admin) */
.ptag-row { display: none; }
body.su-admin.su-tags .ptag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 2px 0 10px; font-size: 0.75rem; }
.ptag-icon { color: #94a3b8; margin-right: 2px; }
.ptag { display: inline-flex; align-items: center; gap: 2px; border-radius: 10px; padding: 1px 4px 1px 8px; background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.ptag--br { background: #e0ecfa; border-color: #c7dbf5; color: #0d47a1; }
.ptag--vk { background: #ecfdf5; border-color: #c6eedb; color: #065f46; }
.ptag--villkor { background: #fff7ed; border-color: #fde2c4; color: #9a3412; }
.ptag--special { background: #f5f3ff; border-color: #e0dafc; color: #5b21b6; }
.ptag button { border: none; background: none; cursor: pointer; color: inherit; opacity: 0.55; font-size: 0.95rem; line-height: 1; padding: 0 2px; }
.ptag button:hover { opacity: 1; }
.ptag-empty { color: #94a3b8; font-style: italic; }
.ptag-add { border: 1px dashed #cbd5e1; background: #fff; color: #64748b; border-radius: 10px; padding: 1px 7px; cursor: pointer; font-size: 0.7rem; }
.ptag-add:hover { color: #1565c0; border-color: #1565c0; }
.ptag-pop {
    position: fixed; z-index: 1002; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 10px 28px rgba(15,23,42,0.18);
    padding: 10px 12px; width: min(520px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto; font-size: 0.8rem;
}
.ptag-pop-head { font-weight: 600; margin-bottom: 6px; }
.ptag-pop-warn { color: #b45309; margin-bottom: 6px; }
.ptag-pop-group { margin: 6px 0; }
.ptag-pop-label { color: #64748b; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.ptag-pop-opt { display: inline-flex; align-items: center; gap: 4px; margin: 2px 10px 2px 0; cursor: pointer; white-space: nowrap; }
.ptag-pop input[type="checkbox"] { position: static; opacity: 1; pointer-events: auto; width: auto; height: auto; margin: 0; }

/* Kortare regelverk */
.ce-block.kv-hidden { display: none !important; }
#guide-markbar button[hidden] { display: none; }
#guide-markbar button.is-on { background: #1565c0; }

/* ---------- Statistik ---------- */
.st-content { max-width: 980px !important; width: 96vw !important; max-height: 92vh; overflow-y: auto; padding: 22px 26px !important; }
.st-content .bg-heading i { color: #1565c0; }
.st-periods { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; margin: 10px 0 14px; }
.st-period { border: none; background: #fff; padding: 6px 12px; font-family: inherit; font-size: 0.82rem; cursor: pointer; color: #334155; }
.st-period + .st-period { border-left: 1px solid #cbd5e1; }
.st-period.is-on { background: #1565c0; color: #fff; }
.st-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.st-tile { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; }
.st-k { color: #64748b; font-size: 0.75rem; }
.st-v { font-size: 1.6rem; font-weight: 600; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.3; }
.st-v small { font-size: 0.8rem; font-weight: 400; color: #64748b; }
.st-v--text { font-size: 1.05rem; padding-top: 6px; }
.st-s { color: #64748b; font-size: 0.75rem; }
.st-h { font-family: 'Open Sans Condensed'; font-size: 13pt; margin: 18px 0 6px; }
.st-chart { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid #cbd5e1; padding-bottom: 0; margin-bottom: 22px; }
.st-chart--hours { height: 90px; }
.st-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; outline: none; }
.st-bar span { display: block; width: 100%; background: #1565c0; border-radius: 4px 4px 0 0; min-height: 0; }
.st-bar:hover span, .st-bar:focus span { background: #0d47a1; }
.st-bar em { position: absolute; top: 100%; left: 0; margin-top: 4px; font-style: normal; font-size: 0.68rem; color: #64748b; white-space: nowrap; }
#st-tip { position: fixed; z-index: 1000001; background: #0f172a; color: #fff; font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
#st-tip[hidden] { display: none; }
.st-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.st-table th { text-align: left; color: #64748b; font-weight: 400; font-size: 0.72rem; border-bottom: 1px solid #e2e8f0; padding: 4px 6px; }
.st-table td { border-bottom: 1px solid #f1f5f9; padding: 6px; vertical-align: top; }
.st-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-meter { width: 22%; }
.st-meter span { display: block; height: 8px; margin-top: 5px; background: #1565c0; border-radius: 0 4px 4px 0; }
.st-det { color: #64748b; font-size: 0.72rem; margin-top: 2px; }
.st-det b { color: #334155; font-weight: 600; }
.st-muted { color: #64748b; }
.st-error { color: #b91c1c; }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.st-foot { font-size: 0.74rem; margin-top: 14px; }
@media (max-width: 700px) {
    .st-content { width: 100vw !important; max-height: 100vh; height: 100vh; border-radius: 0 !important; padding: 16px !important; }
    .st-tiles { grid-template-columns: 1fr 1fr; }
    .st-two { grid-template-columns: 1fr; }
    .st-meter { display: none; }
}
