/* ── DFB Ord Farver 2.0 ───────────────────────────────────────────── */

#dfb-of2-widget,
#dfb-of2-faelles {
    font-size: 0.85rem;
    font-family: Georgia, serif;
}

/* Farvesæt-pills */
.dfb-of2-sets {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.dfb-of2-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px 2px 10px;
    border-radius: 12px;
    border: 1.5px solid #c8b99a;
    background: #fffdf9;
    color: #5a3e28;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s;
    line-height: 1.6;
}
.dfb-of2-pill:hover          { border-color: #8b6a3e; }
.dfb-of2-pill.dfb-of2-active { background: #8b1a1a; border-color: #8b1a1a; color: #fff; }
.dfb-of2-pill-del {
    font-size: 0.9rem; opacity: .5; cursor: pointer; padding: 0 1px;
}
.dfb-of2-pill-del:hover { opacity: 1; }
.dfb-of2-new-pill {
    background: none;
    border: 1.5px dashed #c8b99a;
    border-radius: 12px;
    color: #8b6a3e;
    font-size: 0.78rem;
    font-family: Georgia, serif;
    padding: 2px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}
.dfb-of2-new-pill:hover { border-color: #8b1a1a; color: #8b1a1a; }

/* Gem-bjælke */
.dfb-of2-gem-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px 8px;
    background: #f9f6f0;
    border: 1px solid #e5ddd0;
    border-radius: 4px;
}
.dfb-of2-gem-bar label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #5a3e28;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}
.dfb-of2-gem-btn {
    background: #8b1a1a;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: Georgia, serif;
    font-size: 0.78rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.dfb-of2-gem-btn:hover    { background: #6e1414; }
.dfb-of2-gem-status {
    font-size: 0.72rem;
    color: #4a7c4a;
    min-width: 24px;
}

/* Tekst-filter */
.dfb-of2-filter { margin-bottom: 10px; }
.dfb-of2-filter > label {
    display: block;
    font-size: 0.72rem;
    color: #999;
    margin-bottom: 3px;
    letter-spacing: .03em;
}
.dfb-of2-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.dfb-of2-filter-input {
    flex: 1; min-width: 0;
    font-family: Georgia, serif;
    font-size: 0.82rem;
    padding: 4px 7px;
    border: 1px solid #d0c4b0;
    border-radius: 3px;
    background: #fffdf9;
    color: #1a1a1a;
}
.dfb-of2-filter-input:focus { outline: none; border-color: #8b1a1a; }
.dfb-of2-filter-hint { font-size: 0.7rem; color: #767676; margin-top: 2px; font-style: italic; }
.dfb-of2-fstatus {
    font-size: 0.72rem; padding: 2px 7px; border-radius: 10px;
    font-weight: 600; white-space: nowrap;
}
.dfb-of2-fstatus.ok  { background: #e8f4e8; color: #2e6b2e; }
.dfb-of2-fstatus.nej { background: #f4e8e8; color: #8b1a1a; }

/* Ord-rækker */
.dfb-of2-rows { display: flex; flex-direction: column; gap: 5px; margin-bottom: 7px; }
.dfb-of2-row  { display: flex; align-items: center; gap: 5px; }
.dfb-of2-row input[type="text"] {
    flex: 1; min-width: 0;
    font-family: Georgia, serif; font-size: 0.82rem;
    padding: 4px 7px;
    border: 1px solid #d0c4b0; border-radius: 3px;
    background: #fffdf9; color: #1a1a1a;
}
.dfb-of2-row input[type="text"]:focus { outline: none; border-color: #8b1a1a; }
/* Farvevælger: 5 standardfarver | egen farve */
.dfb-of2-swatches {
    display: flex; align-items: center; gap: 3px; flex-shrink: 0;
}
.dfb-of2-swatch {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid transparent; cursor: pointer;
    padding: 0; flex-shrink: 0;
    transition: border-color .12s, transform .1s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}
.dfb-of2-swatch:hover { transform: scale(1.15); }
.dfb-of2-swatch.dfb-of2-swatch-active {
    border-color: #5a3e28;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.1), 0 0 0 1px #5a3e28;
}
/* Lille lodret streg mellem standard og egen */
.dfb-of2-swatch-divider {
    display: block; width: 1px; height: 16px;
    background: #d0c4b0; margin: 0 2px; flex-shrink: 0;
}
/* "Egen farve"-wrap: regnbue-cirkel med usynligt color-input ovenpå */
.dfb-of2-swatch-custom-wrap {
    position: relative; width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 50%;
    border: 2.5px solid transparent;
    transition: border-color .12s, transform .1s;
}
.dfb-of2-swatch-custom-wrap:hover { transform: scale(1.15); }
.dfb-of2-swatch-custom-wrap.dfb-of2-swatch-custom-active {
    border-color: #5a3e28;
    box-shadow: 0 0 0 1px #5a3e28;
}
.dfb-of2-swatch-custom-input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; border: none; padding: 0;
}
.dfb-of2-swatch-custom-dot {
    display: block; width: 100%; height: 100%; border-radius: 50%;
    pointer-events: none;
    background: conic-gradient(#e66,#ee6,#6e6,#6ee,#66e,#e6e,#e66);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}
/* Når en egen farve er valgt: vis den valgte farve i stedet for regnbuen */
.dfb-of2-swatch-custom-active .dfb-of2-swatch-custom-dot {
    background: currentColor; /* overskrevet af inline style */
}
.dfb-of2-row-del {
    width: 20px; height: 20px; border: none; background: none;
    color: #ccc; font-size: 1rem; cursor: pointer; padding: 0;
    border-radius: 3px; transition: color .15s; flex-shrink: 0; line-height: 1;
}
.dfb-of2-row-del:hover { color: #8b1a1a; }

/* Række-tæller: lille badge der viser antal fund pr. række */
.dfb-of2-row-count {
    font-size: 0.65rem;
    min-width: 16px; height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    flex-shrink: 0;
    padding: 0 3px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: background .2s, color .2s;
}
.dfb-of2-row-count-zero {
    background: none;
    color: #ccc;
}
.dfb-of2-row-count-hit {
    background: #e8f4e8;
    color: #2e6b2e;
}

/* Aktiv/inaktiv-toggle pr. række (øje-ikon) */
.dfb-of2-eye {
    width: 22px; height: 22px; border: none; background: none;
    color: #8b6a3e; font-size: 0.85rem; cursor: pointer; padding: 0;
    flex-shrink: 0; line-height: 1; opacity: .7;
    transition: opacity .15s, color .15s;
    display: flex; align-items: center; justify-content: center;
}
.dfb-of2-eye:hover { opacity: 1; }
.dfb-of2-eye.dfb-of2-eye-off { opacity: .35; color: #bbb; }
/* Solo-knap: "kun denne" — ved siden af øjet */
.dfb-of2-solo {
    width: 18px; height: 18px; border: 1.5px solid #d0c4b0; background: none;
    color: #bbb; font-size: 0.6rem; cursor: pointer; padding: 0;
    flex-shrink: 0; line-height: 1; border-radius: 50%;
    transition: background .15s, color .15s, border-color .15s;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.dfb-of2-solo:hover { border-color: #8b1a1a; color: #8b1a1a; }
.dfb-of2-solo.dfb-of2-solo-on {
    background: #8b1a1a; border-color: #8b1a1a; color: #fff;
}
.dfb-of2-row.dfb-of2-row-off {
    opacity: .40;
    pointer-events: auto;
}
.dfb-of2-row.dfb-of2-row-off input[type="text"] { color: #aaa; }
.dfb-of2-row.dfb-of2-row-off .dfb-of2-swatch,
.dfb-of2-row.dfb-of2-row-off .dfb-of2-swatch-custom-wrap,
.dfb-of2-row.dfb-of2-row-off .dfb-of2-br-select,
.dfb-of2-row.dfb-of2-row-off .dfb-of2-indryk-tag,
.dfb-of2-row.dfb-of2-row-off .dfb-of2-br-toggle,
.dfb-of2-row.dfb-of2-row-off .dfb-of2-indryk-toggle { pointer-events: none; }

/* Linjeskift: toggle-knap (farve ⇄ linjeskift) og position-select */
.dfb-of2-br-toggle {
    width: 26px; height: 26px; flex-shrink: 0;
    border: 1px solid #d0c4b0; border-radius: 3px;
    background: #fffdf9; color: #aaa;
    font-size: 0.85rem; line-height: 1; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.dfb-of2-br-toggle:hover { border-color: #8b1a1a; color: #8b1a1a; }
.dfb-of2-br-toggle[aria-pressed="true"] {
    background: #8b1a1a; border-color: #8b1a1a; color: #fff;
}
.dfb-of2-row-br input[type="text"] { border-color: #c8946a; }
.dfb-of2-br-select {
    flex-shrink: 0;
    font-family: Georgia, serif; font-size: 0.76rem;
    padding: 3px 5px;
    border: 1px solid #d0c4b0; border-radius: 3px;
    background: #fffdf9; color: #5a3e28; cursor: pointer;
    max-width: 108px;
}
.dfb-of2-row-indryk input[type="text"] { border-color: #6a8fc8; }
.dfb-of2-indryk-tag {
    flex-shrink: 0;
    font-family: Georgia, serif; font-size: 0.76rem;
    padding: 4px 8px;
    border: 1px solid #6a8fc8; border-radius: 3px;
    background: #eef2fa; color: #2e4a7a;
    white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.dfb-of2-indryk-tag:hover { background: #dfe8f7; }
/* Relativ indryk (grøn): klik på "» 10px"-tagget cykler Blå → Grøn → Fra,
   for at signalere at indrykningen lægger sig oven i en evt. forudgående
   indrykning i samme vers. */
.dfb-of2-indryk-tag-rel {
    border-color: #4a8b4a; background: #ecf5ec; color: #2e6b2e;
}
.dfb-of2-indryk-tag-rel:hover { background: #ddeedd; }
/* Lille til-knap: vises KUN når rækken ikke er i indryk-tilstand endnu. */
.dfb-of2-indryk-toggle {
    width: 26px; height: 26px; flex-shrink: 0;
    border: 1px solid #d0c4b0; border-radius: 3px;
    background: #fffdf9; color: #aaa;
    font-size: 0.95rem; font-weight: 700; line-height: 1; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.dfb-of2-indryk-toggle:hover { border-color: #6a8fc8; color: #2e4a7a; }

/* Tilføj-knap */
.dfb-of2-add {
    width: 100%; background: none;
    border: 1px dashed #c8b99a; border-radius: 3px;
    color: #8b6a3e; font-family: Georgia, serif; font-size: 0.8rem;
    padding: 4px; cursor: pointer; margin-bottom: 8px;
    transition: border-color .15s, color .15s;
}
.dfb-of2-add:hover { border-color: #8b1a1a; color: #8b1a1a; }

/* Handlingsbjælke */
.dfb-of2-actions {
    display: flex; gap: 6px; align-items: center;
    border-top: 1px solid #f0ebe2; padding-top: 7px;
}
.dfb-of2-apply {
    flex: 1; background: #8b1a1a; color: #fff; border: none;
    border-radius: 3px; font-family: Georgia, serif; font-size: 0.82rem;
    padding: 5px 10px; cursor: pointer; transition: background .15s;
}
.dfb-of2-apply:hover { background: #6e1414; }
.dfb-of2-clear {
    background: none; border: 1px solid #d0c4b0; border-radius: 3px;
    color: #888; font-family: Georgia, serif; font-size: 0.82rem;
    padding: 5px 10px; cursor: pointer; transition: border-color .15s, color .15s;
}
.dfb-of2-clear:hover { border-color: #8b1a1a; color: #8b1a1a; }
.dfb-of2-count { font-size: 0.72rem; color: #4a7c4a; min-width: 30px; text-align: right; }

/* Tom */
.dfb-of2-empty { font-size: 0.78rem; color: #767676; font-style: italic; text-align: center; padding: 6px 0; }

/* ── Fælles farvesæt widget ──────────────────────────────────────── */
.dfb-of2-faelles-list { display: flex; flex-direction: column; gap: 8px; }
.dfb-of2-faelles-item {
    border: 1px solid #e5ddd0;
    border-radius: 4px;
    padding: 7px 9px;
    background: #fffdf9;
}
.dfb-of2-faelles-head {
    display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px;
}
.dfb-of2-faelles-navn {
    font-size: 0.85rem; font-weight: 700; color: #1a1a1a; flex: 1;
}
.dfb-of2-faelles-meta {
    font-size: 0.7rem; color: #aaa; font-style: italic; white-space: nowrap;
}
.dfb-of2-faelles-filter {
    font-size: 0.72rem; color: #8b6a3e;
    background: #f5ede0; border-radius: 10px;
    padding: 1px 7px; display: inline-block; margin-bottom: 4px;
}
.dfb-of2-faelles-ord { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.dfb-of2-faelles-tag {
    font-size: 0.75rem; padding: 1px 8px; border-radius: 10px;
    color: #000; border: 1.5px solid;
}
.dfb-of2-faelles-tag-br {
    border-color: #c8946a; background: #f5ede0; color: #5a3e28;
}
.dfb-of2-faelles-tag-indryk {
    border-color: #6a8fc8; background: #eef2fa; color: #2e4a7a;
}
.dfb-of2-faelles-tag-indryk-rel {
    border-color: #4a8b4a; background: #ecf5ec; color: #2e6b2e;
}
.dfb-of2-kopier {
    background: none; border: 1px solid #8b1a1a; border-radius: 3px;
    color: #8b1a1a; font-family: Georgia, serif; font-size: 0.75rem;
    padding: 3px 9px; cursor: pointer; transition: background .15s, color .15s;
}
.dfb-of2-kopier:hover { background: #8b1a1a; color: #fff; }
.dfb-of2-kopier:disabled { opacity: .5; cursor: default; }
.dfb-of2-faelles-loading { font-size: 0.78rem; color: #aaa; font-style: italic; }

/* Highlight i teksten */
mark.dfb-of2-mark {
    border-radius: 2px; padding: 0 1px;
    font-weight: inherit; font-style: inherit;
    color: #000000;
}

/* Linjeskift indsat af "Linjeskift før/efter" — rent strukturelt, ingen synlig styling nødvendig */
br.dfb-of2-br { }

/* Indryk: ren visuel forskydning af teksten fra ordet og frem, intet linjeskift.
   margin-left sættes som FALLBACK her (10px), men JS sætter altid den
   faktiske værdi som inline style (level * 10px), da niveauet beregnes på
   tværs af alle vers — ikke kun ud fra DOM-indlejring inden for ét vers. */
span.dfb-of2-indent {
    display: inline-block;
    margin-left: 10px;
}
/* Relativ indryk (grøn »): markerer visuelt at niveauet er sat dynamisk
   af JS (level > 1) — selve pixel-værdien styres af inline style. */
span.dfb-of2-indent-rel {
}

/* ── Modal: Nyt farvesæt ─────────────────────────────────────────── */
.dfb-of2-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999990;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
}
.dfb-of2-modal.show {
    display: flex;
}
.dfb-of2-modal-content {
    background: #fdfbf6;
    width: 90%;
    max-width: 420px;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid #d0c9bb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dfb-of2-modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e6dfce;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #f5ede0;
}
.dfb-of2-modal-body {
    padding: 1.2em;
}
.dfb-of2-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.6em;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e6dfce;
    background: #faf6ec;
}
.dfb-of2-btn-primary,
.dfb-of2-btn-secondary {
    font-family: Georgia, serif;
    font-size: 0.92rem;
    padding: 0.45em 1.1em;
    border-radius: 3px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.dfb-of2-btn-primary {
    background: #8b1a1a;
    color: #fff;
    border: 1px solid #8b1a1a;
}
.dfb-of2-btn-primary:hover {
    background: #6e1414;
    border-color: #6e1414;
}
.dfb-of2-btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}
.dfb-of2-btn-secondary {
    background: transparent;
    color: #555;
    border: 1px solid #c9bfa8;
}
.dfb-of2-btn-secondary:hover {
    background: #f0e8d6;
    color: #1a1a1a;
}

/* ──────────────────────────────────────────────────────────────
   "Brug"-toggle paa offentlige saet (read-only laan) — model A
   Matcher toggle-stilen i "Læseværktøjer".
────────────────────────────────────────────────────────────────── */
.dfb-of2-faelles-actions {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 8px;
}
.dfb-of2-faelles-inuse {
    border-color: #8b1a1a;
    box-shadow: inset 0 0 0 1px #8b1a1a;
    background: #fff7f4;
}
.dfb-of2-brug-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.75rem; color: #5a4632; cursor: pointer; user-select: none;
}
.dfb-of2-faelles-inuse .dfb-of2-brug-label { color: #8b1a1a; font-weight: 700; }

.dfb-of2-toggle {
    position: relative; display: inline-block;
    width: 36px; height: 20px; flex: 0 0 auto;
}
.dfb-of2-toggle input {
    opacity: 0; width: 0; height: 0; position: absolute;
}
.dfb-of2-toggle-track {
    position: absolute; inset: 0; cursor: pointer;
    background: #d8d0c2; border-radius: 999px; transition: background .15s;
}
.dfb-of2-toggle-track::before {
    content: ''; position: absolute; left: 2px; top: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform .15s;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.dfb-of2-toggle input:checked + .dfb-of2-toggle-track {
    background: #8b1a1a;
}
.dfb-of2-toggle input:checked + .dfb-of2-toggle-track::before {
    transform: translateX(16px);
}
.dfb-of2-toggle input:focus-visible + .dfb-of2-toggle-track {
    outline: 2px solid #8b1a1a; outline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────
   "Se alle farvesæt"-knap i fælles widget
────────────────────────────────────────────────────────────────── */
.dfb-of2-browse-faelles-btn {
    width: 100%;
    margin-top: 8px;
    background: none;
    border: 1px dashed #8b1a1a;
    border-radius: 3px;
    color: #8b1a1a;
    font-family: Georgia, serif;
    font-size: 0.78rem;
    padding: 5px 8px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.dfb-of2-browse-faelles-btn:hover {
    background: #8b1a1a;
    color: #fff;
}

/* ──────────────────────────────────────────────────────────────
   Modal: Fælles farvesæt browser
────────────────────────────────────────────────────────────────── */
.dfb-of2-faelles-browser-modal {
    position: fixed;
    inset: 0;
    z-index: 999991;
    display: none;
}
.dfb-of2-faelles-browser-modal.dfb-of2-faelles-browser-show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dfb-of2-faelles-browser-modal .dfb-of2-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.dfb-of2-faelles-browser-modal .dfb-of2-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: #fdfbf6;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid #d0c9bb;
    display: flex;
    flex-direction: column;
}

.dfb-of2-faelles-modal-content .dfb-of2-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 1rem 1rem;
}

.dfb-of2-faelles-modal-content .dfb-of2-faelles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

