/* F1 konteksthjelp — to-panel hjelp-vindu (likt LexiCompliance). Mørk modus + blå kode/lenker. */
.lx-help-open { overflow: hidden; }

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

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

.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;
    border-radius: 14px;
    background: var(--lx-surface, #fff);
    color: var(--lx-text, #111827);
    /* Blå ramme rundt hele vinduet (begge moduser) så avgrensningen er tydelig */
    border: 2px solid #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .35), 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: 1px solid transparent; border-radius: 7px;
    background: transparent; color: inherit; font: inherit; cursor: pointer;
    font-family: Oswald, sans-serif; text-transform: uppercase; font-size: .8rem; letter-spacing: .03em;
}
.lx-help-tool:hover:not(:disabled) { border-color: var(--lx-sb-brand, #5e54ee); color: var(--lx-sb-brand, #5e54ee); }
.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; border-radius: 7px;
    background: transparent; color: inherit; cursor: pointer; font: inherit;
}
.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-family: Oswald, sans-serif;
    font-size: clamp(22px, 3vw, 32px); 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 h3 { margin: 20px 0 6px; font-size: 18px; }
.lx-help-body ul, .lx-help-body ol { padding-left: 24px; }

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

/* ── Mørk modus: garantert mørke flater + lys tekst (uavhengig av token-arv) ── */
html[data-theme="dark"] .lx-help-window { background: #131722; color: #f1f4f9; border-color: #60a5fa; box-shadow: 0 0 0 1px rgba(96,165,250,.35), 0 24px 80px rgba(0,0,0,.45); }
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-topic.is-active { color: #fff; }
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 print {
    body.lx-help-printing > *:not(.lx-help-modal) { display: none !important; }
    .lx-help-modal .lx-help-backdrop, .lx-help-toolbar, .lx-help-nav { display: none !important; }
    .lx-help-window { position: static; inset: auto; border: none; box-shadow: none; }
    .lx-help-layout { display: block; }
}

@media (max-width: 720px) {
    .lx-help-window { inset: 0; border-radius: 0; }
    .lx-help-layout { grid-template-columns: 1fr; }
    .lx-help-nav { display: none; }
}
