.lx-help-open {
    overflow: hidden;
}

.lx-help-modal[hidden] {
    display: none !important;
}

.lx-help-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.lx-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .38);
}

.lx-help-window {
    position: absolute;
    inset: 5vh 5vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--lx-surface, #fff);
    color: var(--lx-text, #111827);
    /* Tydelig blaa ramme i begge moduser - viser vinduets avgrensning */
    border: 2px solid #2563eb;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.lx-help-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--lx-border, #d1d5db);
    background: var(--lx-surface-2, #f0f2f7);
}

.lx-help-tool {
    min-width: 72px;
    height: 32px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.lx-help-tool:disabled {
    opacity: .45;
    cursor: default;
}

.lx-help-layout {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    min-height: 0;
    flex: 1;
}

.lx-help-nav {
    min-width: 0;
    overflow: auto;
    border-right: 1px solid var(--lx-border, #d1d5db);
    background: var(--lx-surface, #fff);
}

.lx-help-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--lx-border, #d1d5db);
    font-size: 14px;
}

.lx-help-tab {
    padding: 8px 6px;
    text-align: center;
    border: 0;
    border-right: 1px solid var(--lx-border, #d1d5db);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.lx-help-tab:last-child {
    border-right: 0;
}

.lx-help-tab.is-active {
    font-weight: 700;
    color: var(--lx-sb-brand, #5e54ee);
    box-shadow: inset 0 -2px 0 var(--lx-sb-brand, #5e54ee);
}

.lx-help-search {
    padding: 8px 7px;
    border-bottom: 1px solid var(--lx-border, #d1d5db);
}

.lx-help-search-input {
    width: 100%;
    height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--lx-border, #d1d5db);
    border-radius: 6px;
    background: var(--lx-surface, #fff);
    color: var(--lx-text, #111827);
    font: inherit;
    outline: none;
}

.lx-help-search-input:focus {
    border-color: var(--lx-sb-brand, #5e54ee);
    box-shadow: 0 0 0 3px rgba(94, 84, 238, .15);
}

.lx-help-list {
    padding: 4px 0 12px;
}

.lx-help-group {
    padding: 10px 14px 4px;
    color: var(--lx-text-muted, #6b7280);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.lx-help-hint {
    padding: 12px 14px;
    color: var(--lx-text-muted, #6b7280);
    font-size: 13px;
}

.lx-help-topic {
    width: calc(100% - 14px);
    margin: 8px 7px;
    padding: 6px 8px;
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.lx-help-topic:hover {
    background: var(--lx-sidebar-hover, rgba(15,21,37,.04));
}

.lx-help-topic.is-active {
    border-color: var(--lx-sb-brand, #5e54ee);
    background: var(--lx-sb-brand, #5e54ee);
    color: #fff;
}

.lx-help-article {
    overflow: auto;
    padding: 0 0 36px;
}

.lx-help-article h1 {
    margin: 0;
    padding: 16px 22px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.15;
    background: var(--lx-surface-2, #f0f2f7);
}

.lx-help-status {
    padding: 8px 22px 0;
    color: var(--lx-text-muted, #6b7280);
    font-size: 13px;
}

.lx-help-body {
    max-width: 900px;
    padding: 18px 22px;
    font-size: 16px;
    line-height: 1.65;
}

.lx-help-body h2 {
    margin: 28px 0 8px;
    font-size: 22px;
}

.lx-help-body ul,
.lx-help-body ol {
    padding-left: 24px;
}

.lx-help-body code,
.lx-help-body kbd {
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--lx-surface-2, #f0f2f7);
    /* Inline kode/snarvel-tekst (f.eks. /developer, Ctrl+F, F1) blaa i begge moduser */
    color: #2563eb;
    font-family: var(--font-mono, ui-monospace, monospace);
}

.lx-help-body a {
    color: #2563eb;
}

/* ── Dark mode: garantert morke flater + lys tekst (uavhengig av token-arv) ── */
html[data-theme="dark"] .lx-help-window {
    background: #131722;
    color: #f1f4f9;
    border-color: #60a5fa;
}
html[data-theme="dark"] .lx-help-toolbar {
    background: #1c2030;
    border-bottom-color: #232838;
}
html[data-theme="dark"] .lx-help-nav {
    background: #131722;
    border-right-color: #232838;
}
html[data-theme="dark"] .lx-help-tabs { border-bottom-color: #232838; }
html[data-theme="dark"] .lx-help-tab {
    color: #c5cdda;
    border-right-color: #232838;
}
html[data-theme="dark"] .lx-help-search { border-bottom-color: #232838; }
html[data-theme="dark"] .lx-help-search-input {
    background: #1c2030;
    color: #f1f4f9;
    border-color: #232838;
}
html[data-theme="dark"] .lx-help-topic { color: #c5cdda; }
html[data-theme="dark"] .lx-help-topic:hover { background: rgba(255,255,255,.05); }
html[data-theme="dark"] .lx-help-group { color: #9ba5b8; }
html[data-theme="dark"] .lx-help-hint { color: #9ba5b8; }
html[data-theme="dark"] .lx-help-article h1 {
    background: #1c2030;
    color: #f1f4f9;
}
html[data-theme="dark"] .lx-help-status { color: #9ba5b8; }
html[data-theme="dark"] .lx-help-body { color: #e5e7eb; }
html[data-theme="dark"] .lx-help-body code,
html[data-theme="dark"] .lx-help-body kbd {
    background: #1c2030;
    color: #60a5fa;
}
html[data-theme="dark"] .lx-help-body a { color: #60a5fa; }

@media (max-width: 720px) {
    .lx-help-window {
        inset: 0;
    }

    .lx-help-layout {
        grid-template-columns: 1fr;
    }

    .lx-help-nav {
        display: none;
    }
}
