/* Egen kod, idé från affectUI Inline Diff (Pro), ingen kod tagen */
#c-b-inline-diff {
  --ndf-ink: rgba(0,0,0,.88); --ndf-text: rgba(0,0,0,.61);   --ndf-line: rgba(0,0,0,.06); --ndf-wash: rgba(0,0,0,.03); --ndf-fill: rgba(0,0,0,.06);
  --ndf-ember: #D9601C; --ndf-ok: #1E7A4C; --ndf-ok-tint: rgba(30,122,76,.10);
  --ndf-del: #A3402C; --ndf-del-tint: rgba(196,72,48,.07);
  --ndf-shadow: 0 0 0 .5px rgba(0,0,0,.06), 0 1px 1px -1px rgba(0,0,0,.1), 0 1px 2px 0 rgba(0,0,0,.05);
  --ndf-ease: cubic-bezier(.22,1,.36,1);
  width: 100%; max-width: 100%; contain: inline-size; container-type: inline-size; font-family: var(--sans); font-size: 13px; line-height: 20px; color: var(--ndf-ink); -webkit-font-smoothing: antialiased;
  --ndf-card: #fff; --ndf-strong: #000; --ndf-solid: rgba(0,0,0,.88); --ndf-on-solid: #fcfcfc; --ndf-raised: #FBFAF8; --ndf-rgb: 0,0,0;
  --ndf-ember-ink: #B4501A; --ndf-del: #A3402C; --ndf-warn-ink: #7A4B05; --ndf-toast: rgba(0,0,0,.86);
  --ndf-te-bg: #F7E3D6; --ndf-te-fg: #9A4310; --ndf-tg-bg: #DDEDE4; --ndf-tg-fg: #1E6A44; --ndf-tn-bg: #ECEBE8; --ndf-ty-bg: #F3E6C9; --ndf-ty-fg: #7A5410;
}

#c-b-inline-diff *, #c-b-inline-diff *::before, #c-b-inline-diff *::after { box-sizing: border-box; }
:where(#c-b-inline-diff) button { margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#c-b-inline-diff button:focus-visible, #c-b-inline-diff .ndf-ch:focus-visible { outline: 2px solid rgba(217,96,28,.4); outline-offset: 1px; }
#c-b-inline-diff svg { display: block; flex: none; }
.ndf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ndf-card { position: relative; background: var(--ndf-card); border-radius: 10px; box-shadow: var(--ndf-shadow); }
.ndf-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; font-size: 12px; line-height: 16px; color: var(--grey); }
.ndf-head svg { width: 14px; height: 14px; fill: var(--ndf-ember); }
.ndf-dot { display: inline-block; width: 2px; height: 2px; margin: 0 6px 3px; border-radius: 50%; background: currentColor; }
.ndf-text { margin: 0; padding: 10px 16px 16px; font-size: 14px; line-height: 26px; color: var(--ndf-ink); text-wrap: pretty; outline: none; }

.ndf-ch { border-radius: 4px; cursor: pointer; outline-offset: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ndf-ch del, .ndf-ch ins { text-decoration: none; border-radius: 4px; padding: 1px 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color 200ms ease, color 200ms ease; }
.ndf-ch del { color: var(--grey); background: var(--ndf-del-tint); text-decoration: line-through; text-decoration-color: var(--ndf-del); text-decoration-thickness: 1px; }
.ndf-ch ins { color: var(--ndf-ok); background: var(--ndf-ok-tint); margin-left: 2px; }
.ndf-ch:hover del { background: rgba(196,72,48,.14); color: var(--ndf-del); }
.ndf-ch:hover ins { background: rgba(30,122,76,.16); }
.ndf-ch[data-cur] del { color: var(--ndf-del); }
.ndf-ch[data-cur] del { box-shadow: 0 0 0 1px rgba(163,64,44,.4); }
.ndf-ch[data-cur] ins { box-shadow: 0 0 0 1px rgba(30,122,76,.45); }
.ndf-ch[data-s="yes"], .ndf-ch[data-s="no"] { cursor: default; }
.ndf-ch[data-s="yes"] del, .ndf-ch[data-s="no"] ins { display: none; }
.ndf-ch[data-s="yes"] ins, .ndf-ch[data-s="no"] del { color: inherit; background: transparent; text-decoration: none; box-shadow: none; margin: 0; padding: 0; }
.ndf-ch[data-flash] ins, .ndf-ch[data-flash] del { animation: ndf-flash 900ms ease; }
@keyframes ndf-flash { from { background: rgba(217,96,28,.16); } }

.ndf-pop { position: absolute; z-index: 5; display: flex; gap: 4px; padding: 4px; border-radius: 9px; background: var(--ndf-card); box-shadow: 0 0 0 .5px rgba(var(--ndf-rgb),.08), 0 12px 28px -10px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.05); animation: ndf-pop 200ms var(--ndf-ease) both; }
.ndf-pop[hidden] { display: none; }
@keyframes ndf-pop { from { opacity: 0; transform: translateY(3px); } }
.ndf-pop button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 8px; border-radius: 6px; font-weight: 500; white-space: nowrap; transition: background-color 140ms ease; }
.ndf-yes { background: var(--ndf-solid); color: var(--ndf-on-solid); }
.ndf-yes:hover { background: rgba(var(--ndf-rgb),.78); }
.ndf-no:hover { background: var(--ndf-wash); }
.ndf-pop svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ndf-pop kbd { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; font-family: var(--sans); font-size: 12px; line-height: 1; }
.ndf-yes kbd { background: color-mix(in srgb, var(--ndf-on-solid) 16%, transparent); color: color-mix(in srgb, var(--ndf-on-solid) 80%, transparent); }
.ndf-no kbd { background: var(--ndf-fill); color: var(--grey); }

.ndf-foot { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 16px; border-top: .5px solid var(--ndf-line); }
.ndf-count { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--ndf-text); white-space: nowrap; }
.ndf-num { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--ndf-fill); font-size: 12px; font-weight: 500; color: var(--ndf-ink); font-variant-numeric: tabular-nums; }
.ndf-card[data-done] .ndf-num { display: none; }
.ndf-card[data-done] .ndf-count-text { color: var(--ndf-ok); font-weight: 500; }
.ndf-nav { display: inline-flex; }
.ndf-step { display: grid; place-items: center; width: 26px; height: 28px; border-radius: 6px; color: rgba(var(--ndf-rgb), 0.58); transition: background-color 140ms ease, color 140ms ease; }
.ndf-step:hover:not(:disabled) { background: var(--ndf-wash); color: var(--ndf-ink); }
.ndf-step:disabled { opacity: .35; cursor: default; }
.ndf-step svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ndf-all-no, .ndf-all-yes, .ndf-undo { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 6px; font-weight: 500; white-space: nowrap; transition: background-color 140ms ease, opacity 140ms ease; }
.ndf-all-no, .ndf-undo { box-shadow: var(--ndf-shadow); }
.ndf-all-no:hover, .ndf-undo:hover { background: var(--ndf-wash); }
.ndf-all-yes { background: var(--ndf-solid); color: var(--ndf-on-solid); }
.ndf-all-yes:hover { background: rgba(var(--ndf-rgb),.78); }
.ndf-undo svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ndf-undo[hidden], .ndf-all-no[hidden], .ndf-all-yes[hidden], .ndf-nav[hidden] { display: none; }

@container (max-width: 420px) {
  .ndf-foot { padding-left: 12px; gap: 4px; }
  .ndf-nav { display: none; }
}
@container (max-width: 330px) { .ndf-count-text { display: none; } }
@media (pointer: coarse) { .ndf-pop button, .ndf-all-no, .ndf-all-yes, .ndf-undo { height: 36px; } .ndf-step { width: 36px; height: 36px; } }
@media (prefers-reduced-motion: reduce) {
  #c-b-inline-diff *, #c-b-inline-diff *::before, #c-b-inline-diff *::after { animation: none !important; transition: none !important; }
}

/* Mörkt läge, samma konvention som affectUI: data-theme="dark" eller .dark på en förälder */
:where(.dark, [data-theme="dark"]) #c-b-inline-diff {
  --ndf-ink: rgba(255,255,255,.9); --ndf-text: rgba(255,255,255,.64);   --ndf-line: rgba(255,255,255,.08); --ndf-wash: rgba(255,255,255,.04); --ndf-fill: rgba(255,255,255,.08);
  --ndf-card: #1C1B1A; --ndf-strong: #fff; --ndf-solid: rgba(255,255,255,.9); --ndf-on-solid: #161615; --ndf-raised: #232220; --ndf-rgb: 255,255,255;
  --ndf-ember-ink: #F08A4B; --ndf-del: #FF8A73; --ndf-warn-ink: #F0B232; --ndf-ok: #3EC27A; --ndf-toast: #2C2B29; --ndf-wait: #F0B232;
  --ndf-te-bg: rgba(217,96,28,.2); --ndf-te-fg: #F5A06C; --ndf-tg-bg: rgba(62,194,122,.15); --ndf-tg-fg: #6FD49C; --ndf-tn-bg: rgba(255,255,255,.1); --ndf-ty-bg: rgba(240,178,50,.15); --ndf-ty-fg: #F0B232;
  --ndf-shadow: 0 0 0 .5px rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.4);
  --ndf-pop: 0 0 0 .5px rgba(255,255,255,.12), 0 12px 28px -10px rgba(0,0,0,.6), 0 1px 2px rgba(0,0,0,.4);
}
:where(.dark, [data-theme="dark"]) #c-b-inline-diff { --ndf-del-tint: rgba(255,120,95,.1); --ndf-ok-tint: rgba(62,194,122,.13); }
