/* Egen kod, idé från affectUI Cited Answer (Pro), ingen kod tagen */
#c-b-cited-answer {
  --ncit-ink: rgba(0,0,0,.88); --ncit-text: rgba(0,0,0,.61);   --ncit-line: rgba(0,0,0,.06); --ncit-wash: rgba(0,0,0,.03); --ncit-fill: rgba(0,0,0,.06);
  --ncit-ember: #D9601C; --ncit-lit: rgba(217,96,28,.10); --ncit-mark: rgba(217,96,28,.18);
  --ncit-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);
  --ncit-ease: cubic-bezier(.22,1,.36,1);
  width: 100%; max-width: 100%; contain: inline-size; font-family: var(--sans); font-size: 13px; line-height: 20px; color: var(--ncit-ink); -webkit-font-smoothing: antialiased;
  --ncit-card: #fff; --ncit-strong: #000; --ncit-solid: rgba(0,0,0,.88); --ncit-on-solid: #fcfcfc; --ncit-raised: #FBFAF8; --ncit-rgb: 0,0,0;
  --ncit-ember-ink: #B4501A; --ncit-del: #A3402C; --ncit-warn-ink: #7A4B05; --ncit-toast: rgba(0,0,0,.86);
  --ncit-te-bg: #F7E3D6; --ncit-te-fg: #9A4310; --ncit-tg-bg: #DDEDE4; --ncit-tg-fg: #1E6A44; --ncit-tn-bg: #ECEBE8; --ncit-ty-bg: #F3E6C9; --ncit-ty-fg: #7A5410;
}

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

.ncit-card { background: var(--ncit-card); border-radius: 10px; box-shadow: var(--ncit-shadow); padding: 16px 18px 0; }
.ncit-head { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 16px; color: var(--grey); }
.ncit-stack { display: inline-flex; }
.ncit-stack i, .ncit-chip-i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-style: normal; font-size: 12px; line-height: 1; font-weight: 600; box-shadow: 0 0 0 1.5px var(--ncit-card); }
.ncit-stack i + i { margin-left: -3px; }
[data-tone="1"] { background: var(--ncit-te-bg); color: var(--ncit-te-fg); }
[data-tone="2"] { background: var(--ncit-tg-bg); color: var(--ncit-tg-fg); }
[data-tone="3"] { background: var(--ncit-tn-bg); color: rgba(var(--ncit-rgb),.66); }
.ncit-headtext { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ncit-dot { width: 2px; height: 2px; border-radius: 50%; background: currentColor; }
.ncit-q { margin: 12px 0 8px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ncit-strong); }

.ncit-body { text-wrap: pretty; }
.ncit-body p { margin: 0 0 12px; line-height: 22px; }
.ncit-nw { white-space: nowrap; }
.ncit-s { border-radius: 3px; padding: 1px 0; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color 180ms ease, color 180ms ease; }
.ncit-body[data-focus] .ncit-s { color: var(--grey); }
.ncit-body[data-focus] .ncit-s[data-lit] { background: var(--ncit-lit); color: var(--ncit-ink); }
.ncit-n { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin: 0 1px; padding: 0 4px; border-radius: 4px; vertical-align: 2px; background: var(--ncit-fill); font-size: 12px; line-height: 1; font-weight: 500; color: var(--ncit-text); font-variant-numeric: tabular-nums; transition: background-color 140ms ease, color 140ms ease; }
.ncit-n:hover, .ncit-n[data-lit], .ncit-n[aria-pressed="true"] { background: var(--ncit-ember); color: #fff; }

/* Källchips längst ner */
.ncit-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 14px; }
.ncit-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 5px; border-radius: 6px; box-shadow: inset 0 0 0 .5px rgba(var(--ncit-rgb),.12); font-size: 12px; font-weight: 500; color: var(--ncit-text); transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, opacity 160ms ease; }
.ncit-chip .ncit-chip-i { box-shadow: none; }
.ncit-chip-n { color: var(--grey); font-variant-numeric: tabular-nums; }
.ncit-chip:hover { background: var(--ncit-wash); color: var(--ncit-ink); }
.ncit-chips[data-focus] .ncit-chip { opacity: .5; }
.ncit-chips[data-focus] .ncit-chip[data-lit] { opacity: 1; color: var(--ncit-ink); box-shadow: inset 0 0 0 1px rgba(217,96,28,.5); background: rgba(217,96,28,.05); }

/* Utdraget ur dokumentet */
.ncit-fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 420ms var(--ncit-ease), opacity 220ms ease; }
.ncit-fold[data-open] { grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 420ms var(--ncit-ease), opacity 320ms ease 80ms; }
.ncit-clip { min-height: 0; overflow: hidden; margin: -3px; padding: 3px; }
.ncit-passage { margin: 0 0 14px; padding: 10px 12px 12px; border-radius: 8px; background: var(--ncit-raised); box-shadow: inset 0 0 0 .5px rgba(var(--ncit-rgb),.08); }
.ncit-pcap { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--grey); }
.ncit-pdoc { font-weight: 500; color: var(--ncit-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ncit-ppage { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ncit-pclose { display: grid; place-items: center; width: 24px; height: 24px; margin: -4px -6px -4px auto; border-radius: 6px; color: rgba(var(--ncit-rgb), 0.58); }
.ncit-pclose:hover { background: var(--ncit-fill); color: var(--ncit-ink); }
.ncit-pclose svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.ncit-ptext { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid rgba(217,96,28,.45); font-size: 13px; line-height: 21px; color: var(--ncit-text); }
.ncit-ptext mark { background: var(--ncit-mark); color: var(--ncit-ink); border-radius: 3px; padding: 1px 2px; }

.ncit-foot { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 -18px; padding: 8px 10px 8px 18px; border-top: .5px solid var(--ncit-line); }
.ncit-line { flex: 1; min-width: 0; font-size: 12px; line-height: 16px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncit-line b { font-weight: 500; color: var(--ncit-ink); }
.ncit-follow { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 10px; border-radius: 6px; box-shadow: var(--ncit-shadow); font-weight: 500; }
.ncit-follow svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 300ms var(--ncit-ease); }
.ncit-follow:hover { background: var(--ncit-wash); }
.ncit-follow[aria-expanded="true"] svg { transform: rotate(90deg); }
.ncit-ask { display: flex; gap: 6px; margin: 0 -18px; padding: 0 10px 10px 18px; animation: ncit-in 260ms ease both; }
.ncit-ask[hidden] { display: none; }
.ncit-input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; box-shadow: var(--ncit-shadow); background: var(--ncit-card); font: inherit; color: var(--ncit-ink); outline: none; }
.ncit-input::placeholder { color: var(--grey); }
.ncit-send { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--ncit-solid); color: var(--ncit-on-solid); transition: opacity 160ms ease; }
.ncit-send:disabled { opacity: .25; cursor: default; }
.ncit-send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ncit-ask[data-sent] .ncit-input { color: var(--ncit-ok); }
@keyframes ncit-in { from { opacity: 0; transform: translateY(-3px); } }

@media (pointer: coarse) { .ncit-n { min-width: 22px; height: 20px; } .ncit-chip, .ncit-follow { height: 34px; } }
@media (prefers-reduced-motion: reduce) {
  #c-b-cited-answer *, #c-b-cited-answer *::before, #c-b-cited-answer *::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-cited-answer {
  --ncit-ink: rgba(255,255,255,.9); --ncit-text: rgba(255,255,255,.64);   --ncit-line: rgba(255,255,255,.08); --ncit-wash: rgba(255,255,255,.04); --ncit-fill: rgba(255,255,255,.08);
  --ncit-card: #1C1B1A; --ncit-strong: #fff; --ncit-solid: rgba(255,255,255,.9); --ncit-on-solid: #161615; --ncit-raised: #232220; --ncit-rgb: 255,255,255;
  --ncit-ember-ink: #F08A4B; --ncit-del: #FF8A73; --ncit-warn-ink: #F0B232; --ncit-ok: #3EC27A; --ncit-toast: #2C2B29; --ncit-wait: #F0B232;
  --ncit-te-bg: rgba(217,96,28,.2); --ncit-te-fg: #F5A06C; --ncit-tg-bg: rgba(62,194,122,.15); --ncit-tg-fg: #6FD49C; --ncit-tn-bg: rgba(255,255,255,.1); --ncit-ty-bg: rgba(240,178,50,.15); --ncit-ty-fg: #F0B232;
  --ncit-shadow: 0 0 0 .5px rgba(255,255,255,.1), 0 1px 2px rgba(0,0,0,.4);
  --ncit-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-cited-answer { --ncit-te-bg: #4A2B1B; --ncit-tg-bg: #1F3A2B; --ncit-tn-bg: #333230; }

/* Inga bokstavsavatarer: namnet står som text */
.ncit-stack, .ncit-chip-i { display: none !important; }
