/* Egen kod, idé från affectUI Agent Chat (Pro), ingen kod tagen */
/* Appram: sidomeny och huvudyta, delas av skärmarna men med eget prefix */
.nsac-root {
  --nsac-k: 0, 0, 0;
  --nsac-card: #ffffff;
  --nsac-soft: #FAFAF8;
  --nsac-strong: #000000;
  --nsac-ink: rgba(0, 0, 0, 0.88);
  --nsac-text: rgba(0, 0, 0, 0.61);
      --nsac-line: rgba(0, 0, 0, 0.06);
  --nsac-wash: rgba(0, 0, 0, 0.03);
  --nsac-side: #F2F1EE;
  --nsac-ember: #D9601C;
  --nsac-ember-ink: #A8460F;
  --nsac-ember-tint: rgba(217, 96, 28, 0.10);
  --nsac-ok: #1E7A4C;
  --nsac-ok-tint: rgba(30, 122, 76, 0.10);
  --nsac-wait: #8A5200;
  --nsac-wait-tint: rgba(178, 106, 0, 0.10);
  --nsac-bad: #B3261E;
  --nsac-solid: rgba(0, 0, 0, 0.88);
  --nsac-on-solid: #fcfcfc;
  --nsac-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 1px -1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(var(--nsac-k), 0.05);
  --nsac-shadow-hover: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 1px 1px -1px rgba(0, 0, 0, 0.12), 0 1px 3px 0 rgba(var(--nsac-k), 0.07);
  --nsac-focus: rgba(217, 96, 28, 0.4);
  --nsac-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--nsac-ink);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* Mörkt läge, samma konvention som affectUI */
:where(.dark, [data-theme="dark"]) .nsac-root {
  --nsac-k: 255, 255, 255;
  --nsac-card: #1C1B1A;
  --nsac-soft: #201F1E;
  --nsac-strong: rgba(255, 255, 255, 0.94);
  --nsac-ink: rgba(255, 255, 255, 0.9);
  --nsac-text: rgba(255, 255, 255, 0.64);
      --nsac-line: rgba(255, 255, 255, 0.08);
  --nsac-wash: rgba(255, 255, 255, 0.04);
  --nsac-side: #161615;
  --nsac-ember: #D9601C;
  --nsac-ember-ink: #F08A4B;
  --nsac-ember-tint: rgba(240, 138, 75, 0.14);
  --nsac-ok: #3EC27A;
  --nsac-ok-tint: rgba(62, 194, 122, 0.13);
  --nsac-wait: #F0B232;
  --nsac-wait-tint: rgba(240, 178, 50, 0.13);
  --nsac-bad: #F07A6E;
  --nsac-solid: rgba(255, 255, 255, 0.9);
  --nsac-on-solid: #161615;
  --nsac-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.4);
  --nsac-shadow-hover: 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 1px 3px rgba(0, 0, 0, 0.5);
  --nsac-focus: rgba(240, 138, 75, 0.55);
  color-scheme: dark;
}
.nsac-root *, .nsac-root *::before, .nsac-root *::after { box-sizing: border-box; }
.nsac-root [hidden] { display: none !important; }
:where(.nsac-root) button { margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:where(.nsac-root) input, :where(.nsac-root) textarea, :where(.nsac-root) select { font: inherit; color: inherit; margin: 0; }
:where(.nsac-root) svg { display: block; flex: none; }
:where(.nsac-root) h2, :where(.nsac-root) h3, :where(.nsac-root) p, :where(.nsac-root) ul, :where(.nsac-root) ol, :where(.nsac-root) dl, :where(.nsac-root) dd { margin: 0; padding: 0; }
:where(.nsac-root) ul, :where(.nsac-root) ol { list-style: none; }
.nsac-root button:focus-visible, .nsac-root input:focus-visible, .nsac-root textarea:focus-visible, .nsac-root [tabindex]:focus-visible { outline: 2px solid var(--nsac-focus); outline-offset: 1px; }
.nsac-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.nsac-app {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  height: 540px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--nsac-side);
  box-shadow: var(--nsac-shadow);
}

/* Sidomeny */
.nsac-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px 8px; }
.nsac-ws { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px; font-weight: 500; color: var(--nsac-strong); }
.nsac-ws-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nsac-ws-mark {
  display: grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--nsac-solid); color: var(--nsac-on-solid);
  font-size: 12px; font-weight: 600; line-height: 1;
}
.nsac-nav { display: flex; flex-direction: column; gap: 1px; }
.nsac-nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 30px; padding: 0 8px; border-radius: 6px;
  color: var(--nsac-text); text-align: left;
  transition: background-color 140ms ease, color 140ms ease;
}
.nsac-nav-item:hover { background: rgba(var(--nsac-k), 0.04); color: var(--nsac-ink); }
.nsac-nav-item[aria-current="page"] { background: var(--nsac-card); color: var(--nsac-strong); font-weight: 500; box-shadow: var(--nsac-shadow); }
.nsac-nav-item[aria-current="page"] .nsac-ico { color: var(--nsac-ember); }
.nsac-nav-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nsac-badge { font-size: 12px; line-height: 16px; color: var(--grey); font-variant-numeric: tabular-nums; }
.nsac-me { display: flex; align-items: center; gap: 8px; margin-top: auto; height: 32px; padding: 0 6px; color: var(--nsac-ink); font-weight: 500; }
.nsac-av {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(var(--nsac-k), 0.07); color: var(--nsac-text);
  font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: 0.02em;
}


.nsac-sec { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.nsac-sec-l { padding: 0 8px 4px; font-size: 12px; line-height: 16px; color: var(--grey); }
.nsac-nav-item--sub { height: 28px; }
.nsac-nav-item--sub .nsac-ico { width: 15px; height: 15px; color: var(--grey); }
.nsac-goal { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding: 10px 10px 12px; border-radius: 9px; background: var(--nsac-card); box-shadow: var(--nsac-shadow); }
.nsac-goal-t { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--nsac-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nsac-goal-s { font-size: 12px; line-height: 16px; color: var(--grey); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nsac-goal-bar { display: block; height: 3px; margin-top: 7px; border-radius: 2px; background: var(--nsac-line); overflow: hidden; }
.nsac-goal-bar i { display: block; height: 100%; border-radius: 2px; background: var(--nsac-ember); }
.nsac-goal + .nsac-me { margin-top: 0; }

/* Huvudyta: ett vitt kort */
.nsac-main {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  margin: 6px 6px 6px 0; border-radius: 10px;
  background: var(--nsac-card); box-shadow: var(--nsac-shadow);
  overflow: hidden;
}
.nsac-top {
  display: flex; align-items: center; gap: 8px; flex: none;
  height: 44px; padding: 0 14px;
  border-bottom: 0.5px solid var(--nsac-line);
}
.nsac-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; color: var(--grey); white-space: nowrap; overflow: hidden; }
.nsac-crumbs strong { font-weight: 500; color: var(--nsac-strong); overflow: hidden; text-overflow: ellipsis; }
.nsac-body { flex: 1; min-height: 0; overflow: auto; }

/* Knappar */
.nsac-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 28px; padding: 4px 10px; border-radius: 6px;
  background: var(--nsac-card); box-shadow: var(--nsac-shadow);
  font-weight: 500; white-space: nowrap; color: var(--nsac-ink);
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 160ms var(--nsac-ease), opacity 140ms ease;
}
.nsac-btn:hover { box-shadow: var(--nsac-shadow-hover); }
.nsac-btn:active { transform: scale(0.97); }
.nsac-btn--solid { background: var(--nsac-solid); color: var(--nsac-on-solid); box-shadow: none; }
.nsac-btn--solid:hover { background: rgba(var(--nsac-k), 0.8); box-shadow: none; }
.nsac-btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.nsac-btn .nsac-ico { width: 14px; height: 14px; }

.nsac-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap;
  background: rgba(var(--nsac-k), 0.05); color: var(--nsac-text);
}
.nsac-pill[data-tone="ok"] { background: var(--nsac-ok-tint); color: var(--nsac-ok); }
.nsac-pill[data-tone="ember"] { background: var(--nsac-ember-tint); color: var(--nsac-ember-ink); }
.nsac-pill[data-tone="wait"] { background: var(--nsac-wait-tint); color: var(--nsac-wait); }
.nsac-sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Smal bredd: sidomenyn blir en rad överst, ramen växer med innehållet */
@container (max-width: 600px) {
  .nsac-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
  .nsac-side { flex-direction: row; align-items: center; gap: 4px; padding: 6px 6px 0; overflow-x: auto; scrollbar-width: none; }
  .nsac-side::-webkit-scrollbar { display: none; }
  .nsac-ws-name, .nsac-me, .nsac-sec, .nsac-goal { display: none; }
  .nsac-ws { padding: 0 4px; }
  .nsac-nav { flex-direction: row; gap: 2px; }
  .nsac-nav-item { width: auto; padding: 0 8px; }
  .nsac-nav-label { overflow: visible; }
  .nsac-main { margin: 6px; }
  .nsac-top { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .nsac-root *, .nsac-root *::before, .nsac-root *::after { transition: none !important; animation: none !important; }
}

/* Agentchatt: chatten till vänster, underlaget till höger */
.nsac-split { display: grid; grid-template-columns: minmax(0, 1fr) 208px; height: 100%; min-height: 0; }
.nsac-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.nsac-brief { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 0.5px solid var(--nsac-line); background: var(--nsac-soft); }

.nsac-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.nsac-msg { display: flex; flex-direction: column; gap: 6px; max-width: 100%; color: var(--nsac-ink); }
.nsac-msg[data-new] { animation: nsac-in 360ms var(--nsac-ease) both; }
.nsac-msg p { overflow-wrap: anywhere; }
.nsac-msg--me { align-self: flex-end; max-width: 82%; }
.nsac-msg--me p { padding: 6px 10px; border-radius: 10px; background: rgba(var(--nsac-k), 0.05); color: var(--nsac-ink); }
.nsac-who { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--nsac-strong); }
.nsac-agent-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--nsac-solid); position: relative; }
.nsac-agent-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 1px; background: var(--nsac-ember); }

.nsac-worked { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; color: var(--grey); font-size: 12px; border-radius: 4px; }
.nsac-worked:hover { color: var(--nsac-ink); }
.nsac-chev { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 220ms var(--nsac-ease); }
.nsac-worked[aria-expanded="true"] .nsac-chev { transform: rotate(90deg); }
.nsac-steps { margin-left: 6px !important; padding-left: 10px !important; border-left: 1px solid var(--nsac-line); display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--nsac-text); }
.nsac-steps[hidden] { display: none; }

.nsac-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.nsac-choice { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 10px; border-radius: 8px; background: var(--nsac-card); box-shadow: var(--nsac-shadow); text-align: left; transition: box-shadow 140ms ease, background-color 140ms ease; }
.nsac-choice:hover { box-shadow: var(--nsac-shadow-hover); }
.nsac-choice-t { font-weight: 500; }
.nsac-choice-s { font-size: 12px; line-height: 16px; color: var(--grey); }
.nsac-choice[aria-checked="true"] { background: var(--nsac-ember-tint); box-shadow: 0 0 0 1px rgba(217, 96, 28, 0.5); }
.nsac-choices[data-locked] .nsac-choice:not([aria-checked="true"]) { opacity: 0.45; }
.nsac-choices[data-locked] .nsac-choice { cursor: default; }

.nsac-typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.nsac-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--grey); animation: nsac-blink 900ms ease-in-out 2 both; }
.nsac-typing i:nth-child(2) { animation-delay: 150ms; }
.nsac-typing i:nth-child(3) { animation-delay: 300ms; }

.nsac-agents { flex: none; padding: 6px 16px 8px; }
.nsac-agents-h { display: block; font-size: 12px; line-height: 16px; color: var(--grey); margin-bottom: 4px; }
.nsac-agents-row { display: flex; flex-wrap: wrap; gap: 4px; }
.nsac-agent { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; box-shadow: var(--nsac-shadow); font-size: 12px; font-weight: 500; color: var(--nsac-text); background: var(--nsac-card); }
.nsac-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grey); }
.nsac-agent[data-state="done"] .nsac-dot { background: var(--nsac-ok); }
.nsac-agent[data-state="wait"] .nsac-dot { background: var(--nsac-wait); }
.nsac-agent[data-state="busy"] .nsac-dot { background: var(--nsac-ember); box-shadow: 0 0 0 3px var(--nsac-ember-tint); }

.nsac-composer { flex: none; display: flex; align-items: center; gap: 6px; margin: 0 12px 12px; padding: 4px 4px 4px 10px; border-radius: 10px; box-shadow: var(--nsac-shadow), 0 0 0 0.5px rgba(var(--nsac-k), 0.04); background: var(--nsac-card); }
.nsac-input { flex: 1; min-width: 0; height: 28px; border: 0; background: none; outline: none; }
.nsac-input::placeholder { color: var(--grey); }
.nsac-composer:focus-within { box-shadow: 0 0 0 2px var(--nsac-focus); }
.nsac-input:focus-visible { outline: none; }
.nsac-send { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--nsac-solid); color: var(--nsac-on-solid); transition: opacity 140ms ease; }
.nsac-send:disabled { opacity: 0.25; cursor: default; }
.nsac-send svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.nsac-brief-body { flex: 1; min-height: 0; overflow-y: auto; }
.nsac-sec { padding: 12px 14px; border-bottom: 0.5px solid var(--nsac-line); }
.nsac-h { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--grey); margin-bottom: 6px !important; }
.nsac-cust li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.nsac-cust li span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nsac-num { color: var(--nsac-text); white-space: nowrap; }
.nsac-terms div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.nsac-terms dt { color: var(--nsac-text); }
.nsac-terms dd { text-align: right; font-weight: 500; white-space: nowrap; }
.nsac-terms dd[data-empty], .nsac-sum[data-empty] { color: var(--grey); font-weight: 400; }
.nsac-price[data-flash] { animation: nsac-flash 900ms var(--nsac-ease); border-radius: 4px; }
.nsac-brief-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 0.5px solid var(--nsac-line); }
.nsac-foot-note { font-size: 12px; color: var(--grey); white-space: nowrap; }
.nsac-make[data-busy] { pointer-events: none; }
.nsac-spin { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--nsac-on-solid) 35%, transparent); border-top-color: var(--nsac-on-solid); animation: nsac-spin 700ms linear 3; }
.nsac-make[data-done] { background: var(--nsac-ok); }

@keyframes nsac-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes nsac-blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes nsac-spin { to { transform: rotate(360deg); } }
@keyframes nsac-flash { 0% { background: var(--nsac-ember-tint); } 100% { background: transparent; } }

@container (max-width: 600px) {
  .nsac-split { grid-template-columns: minmax(0, 1fr); height: auto; }
  .nsac-log { max-height: 460px; }
  .nsac-brief { border-left: 0; border-top: 0.5px solid var(--nsac-line); }
}

/* Inga bokstavsavatarer: namnet står som text */
.nsac-ws-mark, .nsac-av { display: none !important; }
