/*
 * Promsys.Chatbot v2 — Faffa 2.0 design system.
 * Dependency-free, tokenised (--fw-*), multi-tenant: one --fw-brand per tenant, every other brand
 * tone derives via color-mix. Light/dark via .pc-dark on the scope root (resolved by chatbot.js).
 * House rule: NO decorative accent left-borders anywhere.
 */

/* ---------- tokens ---------- */
.pc-scope {
  --fw-brand: #1E6E49;
  --fw-on-brand: #FFFFFF;
  --fw-surface: #FFFFFF;
  --fw-surface-2: #F4F6F5;
  --fw-zebra: #F8FAF9;
  --fw-text: #1B1F1D;
  --fw-muted: #5D6763;
  --fw-border: #E3E7E4;
  --fw-border-strong: #C7CFCA;
  --fw-shadow: 0 18px 48px rgba(12, 24, 18, .24);
  --fw-brand-soft: color-mix(in oklab, var(--fw-brand) 9%, var(--fw-surface));
  --fw-brand-tint: color-mix(in oklab, var(--fw-brand) 16%, var(--fw-surface));
  --fw-brand-strong: color-mix(in oklab, var(--fw-brand) 82%, #000);
  --fw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-family: var(--fw-font);
  color: var(--fw-text);
  box-sizing: border-box;
}
.pc-scope *, .pc-scope *::before, .pc-scope *::after { box-sizing: inherit; }
.pc-scope.pc-dark {
  --fw-surface: #1C1F1E;
  --fw-surface-2: #252927;
  --fw-zebra: #212524;
  --fw-text: #ECEFED;
  --fw-muted: #9BA5A0;
  --fw-border: #343A36;
  --fw-border-strong: #4A544E;
  --fw-shadow: 0 18px 48px rgba(0, 0, 0, .55);
  --fw-brand-strong: color-mix(in oklab, var(--fw-brand) 52%, #fff);
}

.pc-scope button { font-family: var(--fw-font); }
.pc-scope :focus-visible { outline: 2px solid var(--fw-brand); outline-offset: 2px; }

/* thin scrollbars */
.pc-scope ::-webkit-scrollbar { width: 8px; height: 8px; }
.pc-scope ::-webkit-scrollbar-thumb { background: var(--fw-border-strong); border-radius: 99px; }
.pc-scope ::-webkit-scrollbar-track { background: transparent; }

/* ---------- launcher ---------- */
.pc-bubble-root { position: fixed; z-index: 2147483000; }
.pc-pos-bottom-right { right: 24px; bottom: 24px; }
.pc-pos-bottom-left  { left: 24px;  bottom: 24px; }
.pc-pos-top-right    { right: 24px; top: 24px; }
.pc-pos-top-left     { left: 24px;  top: 24px; }

.pc-launcher {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--fw-brand); color: var(--fw-on-brand);
  display: grid; place-items: center; font-size: 24px;
  box-shadow: 0 10px 28px color-mix(in oklab, var(--fw-brand) 45%, transparent);
  transition: transform .18s ease; overflow: hidden; position: relative;
}
.pc-launcher:hover { transform: scale(1.05); }
.pc-launcher-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Image + no colour → the image fills the whole bubble, no brand background. */
.pc-launcher-fill { background: transparent; box-shadow: 0 10px 28px rgba(0, 0, 0, .28); }
.pc-launcher .pc-launcher-close { display: none; font-size: 20px; line-height: 1; }
.pc-open .pc-launcher .pc-launcher-open  { display: none; }
.pc-open .pc-launcher .pc-launcher-close { display: block; }
.pc-grown .pc-launcher { display: none; }

/* ---------- panel ---------- */
.pc-panel {
  position: fixed; right: 24px; bottom: 100px;
  width: min(404px, 100vw - 32px); height: min(660px, 100vh - 130px);
  background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: 16px;
  box-shadow: var(--fw-shadow); display: none; flex-direction: column; overflow: hidden;
  transition: width .32s cubic-bezier(.2, .8, .3, 1), height .32s cubic-bezier(.2, .8, .3, 1),
              right .32s cubic-bezier(.2, .8, .3, 1), bottom .32s cubic-bezier(.2, .8, .3, 1);
}
.pc-pos-bottom-left .pc-panel { right: auto; left: 24px; }
.pc-open .pc-panel { display: flex; animation: pc-pop .28s ease; }
@keyframes pc-pop { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pc-grown .pc-panel { right: 20px; bottom: 20px; width: min(920px, 100vw - 40px); height: calc(100vh - 40px); }
.pc-pos-bottom-left.pc-grown .pc-panel { left: 20px; }
@media (max-width: 480px) {
  .pc-panel { right: 16px; left: 16px; width: auto; }
  .pc-pos-bottom-left .pc-panel { left: 16px; }
}

/* ---------- teaser (link mode — CTA to the site's full-view chat page) ---------- */
.pc-teaser {
  position: fixed; right: 24px; bottom: 100px;
  width: min(348px, 100vw - 32px);
  background: var(--fw-surface); border: 1px solid var(--fw-border); border-radius: 16px;
  box-shadow: var(--fw-shadow); overflow: hidden; text-align: center;
  display: none; flex-direction: column;
}
.pc-pos-bottom-left .pc-teaser { right: auto; left: 24px; }
.pc-open .pc-teaser { display: flex; animation: pc-pop .28s ease; }
.pc-teaser-close {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  width: 32px; height: 32px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--fw-muted); display: grid; place-items: center;
}
.pc-teaser-close:hover { background: rgba(0, 0, 0, .08); color: var(--fw-text); }
.pc-teaser-close svg { width: 17px; height: 17px; }
.pc-teaser-media { background: var(--fw-surface-2); padding: 34px 20px 10px; }
.pc-teaser-img { max-width: 210px; max-height: 240px; object-fit: contain; }
.pc-teaser-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.pc-teaser-text { font-size: 13.5px; color: var(--fw-muted); line-height: 1.55; }
.pc-teaser-cta { display: block; width: 100%; text-align: center; text-decoration: none; padding: 10px 14px; font-size: 13px; }
.pc-teaser-custom { text-align: initial; }

/* ---------- header ---------- */
.pc-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--fw-brand); color: var(--fw-on-brand); flex: 0 0 auto;
}
.pc-head-avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--fw-on-brand) 35%, transparent);
  background: var(--fw-surface-2); display: grid; place-items: center; font-size: 18px;
}
.pc-head-titles { min-width: 0; }
.pc-head-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.pc-head-sub   { font-size: 12px; opacity: .82; line-height: 1.2; }
.pc-head-actions { margin-left: auto; display: flex; gap: 4px; }
.pc-head-btn {
  width: 34px; height: 34px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--fw-on-brand); display: grid; place-items: center;
}
.pc-head-btn:hover { background: rgba(0, 0, 0, .14); }
a.pc-head-btn { text-decoration: none; }
.pc-head-btn svg { width: 18px; height: 18px; }
.pc-head-btn:focus-visible { outline-color: var(--fw-on-brand); }

/* ---------- feed ---------- */
.pc-feed { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; background: var(--fw-surface); }
.pc-feed-inner { padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.pc-grown .pc-feed-inner { max-width: 760px; margin: 0 auto; width: 100%; }

/* intro */
.pc-intro { text-align: center; padding: 28px 12px 8px; }
.pc-intro-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.pc-intro-title { font-size: 16px; font-weight: 700; margin: 12px 0 6px; }
.pc-intro-text { font-size: 13px; color: var(--fw-muted); margin: 0 auto 16px; max-width: 320px; line-height: 1.5; }
.pc-starters { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.pc-starter {
  border: 1px solid var(--fw-border-strong); background: var(--fw-surface); color: var(--fw-text);
  border-radius: 999px; padding: 9px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  text-align: center; transition: background .15s ease, border-color .15s ease;
}
.pc-starter:hover { background: var(--fw-brand-soft); border-color: var(--fw-brand); }

/* ---------- "andre assistenter" switcher (multi-bot, opt-in) ---------- */
.pc-otherbots { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--fw-border); }
.pc-otherbots-label {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fw-muted); margin-bottom: 8px;
}
.pc-otherbots-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pc-otherbot {
  display: inline-flex; align-items: center; border: 1px solid var(--fw-border-strong);
  background: var(--fw-surface); color: var(--fw-text); text-decoration: none;
  border-radius: 999px; padding: 7px 13px; font-size: 12px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}
.pc-otherbot:hover { background: var(--fw-brand-soft); border-color: var(--fw-brand); color: var(--fw-text); }

/* ---------- turn ---------- */
.pc-turn { display: flex; flex-direction: column; gap: 10px; }
.pc-q {
  align-self: flex-end; max-width: 85%;
  background: var(--fw-brand-tint); color: var(--fw-text);
  border-radius: 14px 14px 4px 14px; padding: 9px 13px; font-size: 13.5px; line-height: 1.5;
  overflow-wrap: break-word;
}

/* Tidspunkt for spørsmålet. Høyrestilt fordi det hører til spørsmålsboblen, som også er høyrestilt. */
.pc-time { align-self: flex-end; font-size: 11px; color: var(--fw-muted); margin: 2px 2px 0 0; }

/* status / phase line — fades and collapses smoothly when the answer completes */
.pc-phase {
  display: flex; align-items: center; gap: 8px; max-height: 24px; overflow: hidden;
  transition: opacity .2s ease, max-height .25s ease .1s, margin .25s ease .1s;
}
.pc-phase-done { opacity: 0; max-height: 0; margin: 0; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fw-brand); animation: pc-pulse 1.1s ease-in-out infinite; flex: 0 0 auto; }
@keyframes pc-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
.pc-spec {
  background: var(--fw-brand-soft); color: var(--fw-brand-strong);
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px;
}
.pc-ptxt { font-size: 12.5px; color: var(--fw-muted); }

/* streaming answer (markdown renders progressively while streaming) */
.pc-answer { font-size: 13.5px; line-height: 1.6; overflow-wrap: break-word; }
.pc-caret { display: inline-block; width: 3px; height: 15px; background: var(--fw-brand); vertical-align: text-bottom; margin-left: 1px; animation: pc-blink 1s steps(2, start) infinite; }
@keyframes pc-blink { to { visibility: hidden; } }
.pc-answer p { margin: 0 0 10px; }
.pc-answer p:last-child { margin-bottom: 0; }
.pc-answer ul { margin: 0 0 10px; padding-left: 20px; }
.pc-answer li { margin: 3px 0; }
.pc-answer h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
.pc-answer a { color: var(--fw-brand-strong); text-decoration: underline; text-underline-offset: 2px; }
.pc-answer strong { font-weight: 700; }

/* error */
.pc-error {
  background: var(--fw-surface-2); border: 1px solid var(--fw-border); border-radius: 10px;
  padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px;
}
.pc-error svg { width: 18px; height: 18px; color: #B4552D; flex: 0 0 auto; margin-top: 1px; }
.pc-error-text { color: var(--fw-text); line-height: 1.5; }
.pc-retry {
  margin-top: 8px; display: inline-block; border: 1px solid var(--fw-border-strong); background: var(--fw-surface);
  color: var(--fw-text); border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pc-retry:hover { background: var(--fw-brand-soft); border-color: var(--fw-brand); }

/* ---------- per-turn tabs ---------- */
.pc-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--fw-border); }
.pc-tab {
  border: 0; background: transparent; cursor: pointer; padding: 8px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--fw-muted); display: flex; align-items: center; gap: 5px;
}
.pc-tab.pc-active { color: var(--fw-text); box-shadow: inset 0 -2px 0 var(--fw-brand); }
.pc-tab-count {
  background: var(--fw-surface-2); color: var(--fw-muted); border-radius: 999px;
  font-size: 10.5px; font-weight: 700; padding: 1px 6px; line-height: 1.4;
}
.pc-tab.pc-active .pc-tab-count { background: var(--fw-brand-soft); color: var(--fw-brand-strong); }
/* pending (loading) tab — reserved spot with a shimmer badge until content resolves */
.pc-tab-pending { opacity: .6; cursor: default; }
.pc-tab-count-skel { display: inline-block; width: 16px; height: 12px; padding: 0; vertical-align: middle; }
.pc-pane { display: none; }
.pc-pane.pc-active { display: block; }
.pc-panes > .pc-pane { padding-top: 10px; }

/* ---------- kilder cards ---------- */
.pc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-grown .pc-cards { grid-template-columns: 1fr 1fr 1fr; }
.pc-src {
  display: block; border: 1px solid var(--fw-border); border-radius: 10px; padding: 10px 11px;
  text-decoration: none; color: var(--fw-text); background: var(--fw-surface);
  transition: background .15s ease, border-color .15s ease;
}
.pc-src:hover { border-color: var(--fw-brand); background: var(--fw-brand-soft); }
.pc-src-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-src-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.pc-src-n {
  width: 16px; height: 16px; border-radius: 4px; background: var(--fw-surface-2); color: var(--fw-muted);
  font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto;
}
.pc-src-host { font-size: 11px; color: var(--fw-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- lenker rows ---------- */
.pc-linkrows { display: flex; flex-direction: column; }
.pc-linkrow {
  display: flex; align-items: center; gap: 9px; padding: 9px 6px; text-decoration: none;
  color: var(--fw-text); border-top: 1px solid var(--fw-border); font-size: 13px;
}
.pc-linkrow:first-child { border-top: 0; }
.pc-linkrow:hover { background: var(--fw-brand-soft); }
.pc-linkrow svg { width: 15px; height: 15px; color: var(--fw-muted); flex: 0 0 auto; }
.pc-linkrow-host { margin-left: auto; font-size: 11px; color: var(--fw-muted); flex: 0 0 auto; }

/* ---------- actions ---------- */
.pc-actions { display: flex; gap: 4px; }
.pc-act {
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: var(--fw-muted); display: grid; place-items: center;
}
.pc-act svg { width: 16px; height: 16px; }
.pc-act:hover { background: var(--fw-surface-2); color: var(--fw-text); }
.pc-act.pc-on { background: var(--fw-brand-soft); color: var(--fw-brand-strong); }
/* ghosted action bar while the answer streams — activated (full opacity) on completion */
.pc-actions { transition: opacity .25s ease; }
.pc-actions.pc-ghost { opacity: .3; pointer-events: none; }

/* ---------- follow-ups (list rows, Perplexity style) ---------- */
.pc-followups-label {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--fw-muted); margin: 4px 0 2px;
}
.pc-followups { display: flex; flex-direction: column; border-bottom: 1px solid var(--fw-border); }
.pc-fu {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: transparent;
  border: 0; border-top: 1px solid var(--fw-border); cursor: pointer; padding: 9px 6px;
  font-size: 13px; color: var(--fw-text); transition: background .15s ease, color .15s ease;
}
.pc-fu:hover { background: var(--fw-brand-soft); color: var(--fw-brand-strong); }
.pc-fu svg { width: 14px; height: 14px; color: var(--fw-muted); flex: 0 0 auto; }
.pc-fu .pc-fu-plus { margin-left: auto; }
.pc-fu:hover svg { color: var(--fw-brand-strong); }

/* ---------- tables ---------- */
.pc-table-card { border: 1px solid var(--fw-border); border-radius: 10px; overflow: hidden; background: var(--fw-surface); }
.pc-table-bar {
  display: flex; align-items: center; gap: 6px; background: var(--fw-surface-2);
  border-bottom: 1px solid var(--fw-border); padding: 7px 8px 7px 12px;
}
.pc-table-title {
  font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.pc-table-bar-actions { margin-left: auto; display: flex; gap: 2px; }
.pc-tbtn {
  width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  color: var(--fw-muted); display: grid; place-items: center;
}
.pc-tbtn svg { width: 15px; height: 15px; }
.pc-tbtn:hover { background: var(--fw-border); color: var(--fw-text); }

.pc-table-scroll { overflow: auto; max-height: 318px; }
.pc-grown .pc-table-scroll { max-height: 380px; }
.pc-pane-tabell .pc-table-scroll, .pc-overlay .pc-table-scroll { max-height: none; }

.pc-table-card table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.pc-table-card th {
  position: sticky; top: 0; z-index: 2; background: var(--fw-surface-2); color: var(--fw-muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 8px 12px; border-bottom: 1px solid var(--fw-border-strong); white-space: nowrap; text-align: left;
}
.pc-table-card th.pc-first { left: 0; z-index: 3; border-right: 1px solid var(--fw-border-strong); }
.pc-table-card td {
  padding: 7px 12px; font-size: 13px; color: var(--fw-text); white-space: nowrap;
  border-bottom: 1px solid var(--fw-border); text-align: left;
}
.pc-table-card td.pc-first { position: sticky; left: 0; z-index: 1; font-weight: 600; border-right: 1px solid var(--fw-border); }
.pc-table-card th.pc-num, .pc-table-card td.pc-num { text-align: right; }
.pc-table-card td.pc-num { font-variant-numeric: tabular-nums; }
/* sticky cells need explicit backgrounds (zebra alternation) */
.pc-table-card tr:nth-child(odd) td { background: var(--fw-surface); }
.pc-table-card tr:nth-child(even) td { background: var(--fw-zebra); }
.pc-sortable th { cursor: pointer; user-select: none; }
.pc-sortable th:hover { color: var(--fw-text); }

.pc-table-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--fw-surface-2); border-top: 1px solid var(--fw-border); padding: 7px 12px;
  font-size: 11.5px; color: var(--fw-muted);
}
.pc-linkbtn {
  border: 0; background: transparent; cursor: pointer; padding: 2px 0;
  font-size: 11.5px; font-weight: 600; color: var(--fw-brand-strong); text-decoration: underline; text-underline-offset: 2px;
}
.pc-linkbtn:hover { text-decoration: none; }

/* ---------- full-view overlay ---------- */
.pc-overlay {
  position: fixed; inset: 0; z-index: 2147483200; background: rgba(8, 14, 11, .5);
  display: grid; place-items: center; padding: 20px;
}
.pc-sheet {
  width: min(1120px, 100vw - 40px); height: min(760px, 100vh - 40px);
  background: var(--fw-surface); border-radius: 16px; box-shadow: var(--fw-shadow);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--fw-border);
}
.pc-sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--fw-border); }
.pc-sheet-titles { min-width: 0; }
.pc-sheet-title { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-sheet-src { font-size: 11.5px; color: var(--fw-muted); margin-top: 2px; }
.pc-sheet-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pc-pill {
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--fw-border-strong); background: var(--fw-surface); color: var(--fw-text);
}
.pc-pill:hover { background: var(--fw-surface-2); }
.pc-pill-brand { background: var(--fw-brand); border-color: var(--fw-brand); color: var(--fw-on-brand); }
.pc-pill-brand:hover { background: color-mix(in oklab, var(--fw-brand) 88%, #000); }
.pc-sheet-close {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: var(--fw-muted); display: grid; place-items: center;
}
.pc-sheet-close:hover { background: var(--fw-surface-2); color: var(--fw-text); }
.pc-sheet-close svg { width: 17px; height: 17px; }
.pc-sheet-toolbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--fw-surface-2); border-bottom: 1px solid var(--fw-border);
}
.pc-search {
  flex: 0 1 280px; border: 1px solid var(--fw-border-strong); border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; font-family: var(--fw-font); background: var(--fw-surface); color: var(--fw-text);
}
.pc-search:focus { border-color: var(--fw-brand); box-shadow: 0 0 0 3px var(--fw-brand-soft); outline: none; }
.pc-sheet-count { font-size: 11.5px; color: var(--fw-muted); }
.pc-sheet-hint { font-size: 11.5px; color: var(--fw-muted); margin-left: auto; }
.pc-sheet-body { flex: 1 1 auto; overflow: hidden; display: flex; }
.pc-sheet-body .pc-table-card { border: 0; border-radius: 0; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pc-sheet-body .pc-table-scroll { flex: 1; }

/* ---------- gentle entrance for everything appended after the answer (no "snap") ---------- */
.pc-tabs, .pc-tab, .pc-actions, .pc-table-card, .pc-followups, .pc-followups-label,
.pc-skel-group, .pc-src, .pc-linkrows, .pc-fu {
  animation: pc-fadein .25s ease;
}
@keyframes pc-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .pc-tabs, .pc-tab, .pc-actions, .pc-table-card, .pc-followups, .pc-followups-label,
  .pc-skel-group, .pc-src, .pc-linkrows, .pc-fu { animation: none; }
}

/* ---------- skeletons ---------- */
.pc-skel {
  background: linear-gradient(100deg, var(--fw-surface-2) 40%, var(--fw-border) 50%, var(--fw-surface-2) 60%);
  background-size: 200% 100%; animation: pc-shimmer 1.4s linear infinite; border-radius: 8px;
}
@keyframes pc-shimmer { to { background-position: -200% 0; } }
.pc-skel-line  { height: 12px; }
.pc-skel-card  { height: 58px; border-radius: 10px; }
.pc-skel-row   { height: 34px; }
.pc-skel-group { display: flex; flex-direction: column; gap: 8px; }

/* ---------- composer ---------- */
.pc-composer { flex: 0 0 auto; padding: 10px 12px 8px; background: var(--fw-surface); border-top: 1px solid var(--fw-border); }
.pc-box { display: flex; gap: 8px; align-items: center; }
.pc-box input {
  flex: 1; border: 1px solid var(--fw-border-strong); border-radius: 12px; padding: 10px 14px;
  font-size: 13.5px; font-family: var(--fw-font); background: var(--fw-surface); color: var(--fw-text); min-width: 0;
}
.pc-box input:focus { border-color: var(--fw-brand); box-shadow: 0 0 0 3px var(--fw-brand-soft); outline: none; }
.pc-box input::placeholder { color: var(--fw-muted); }
.pc-send {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; flex: 0 0 auto;
  background: var(--fw-brand); color: var(--fw-on-brand); display: grid; place-items: center;
}
.pc-send svg { width: 18px; height: 18px; }
.pc-send:disabled { opacity: .45; cursor: default; }
.pc-attribution { font-size: 10.5px; color: var(--fw-muted); text-align: center; margin-top: 7px; }
.pc-attribution a { color: inherit; }
.pc-disclaimer { font-size: 10.5px; color: var(--fw-muted); text-align: center; margin-top: 7px; }
.pc-disclaimer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.pc-composer-spacer { height: 10px; }
/* Optional full-page banner slot (backoffice-authored HTML) */
.pc-banner { margin-bottom: 4px; }

/* ---------- report modal ---------- */
.pc-modal-overlay {
  position: fixed; inset: 0; z-index: 2147483300; background: rgba(8, 14, 11, .5);
  display: grid; place-items: center; padding: 20px;
}
.pc-modal {
  width: min(420px, 100%); background: var(--fw-surface); border-radius: 16px; border: 1px solid var(--fw-border);
  box-shadow: var(--fw-shadow); padding: 20px;
}
.pc-modal-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.pc-modal-text { font-size: 13px; color: var(--fw-muted); margin: 0 0 12px; }
.pc-modal-input {
  width: 100%; border: 1px solid var(--fw-border-strong); border-radius: 12px; padding: 10px 12px;
  font-size: 13px; font-family: var(--fw-font); background: var(--fw-surface); color: var(--fw-text); resize: vertical;
}
.pc-modal-input:focus { border-color: var(--fw-brand); box-shadow: 0 0 0 3px var(--fw-brand-soft); outline: none; }
.pc-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- toast ---------- */
.pc-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2147483400;
  background: color-mix(in oklab, #1B1F1D 92%, transparent); color: #ECEFED;
  border-radius: 999px; padding: 9px 18px; font-size: 12.5px; font-weight: 600; font-family: var(--fw-font);
  animation: pc-toast-in .2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
@keyframes pc-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- full-page surface (history sidebar + roomier conversation) ---------- */
.pc-page { height: 100%; }
.pc-page-wrap { display: flex; height: 100%; min-height: 480px; background: var(--fw-surface); }
.pc-page-side {
  width: 248px; flex: 0 0 auto; border-right: 1px solid var(--fw-border);
  display: flex; flex-direction: column; gap: 10px; padding: 14px 12px;
}
.pc-newchat {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--fw-border-strong); background: var(--fw-surface); color: var(--fw-text);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pc-newchat:hover { background: var(--fw-brand-soft); border-color: var(--fw-brand); }
.pc-newchat svg { width: 15px; height: 15px; }
.pc-side-label {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--fw-muted); margin-top: 4px;
}
.pc-side-list { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.pc-side-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--fw-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-side-item:hover { background: var(--fw-surface-2); }
.pc-side-item.pc-active { background: var(--fw-brand-soft); color: var(--fw-brand-strong); font-weight: 600; }
.pc-side-empty { font-size: 12.5px; color: var(--fw-muted); padding: 8px 10px; }
.pc-side-foot { font-size: 11px; color: var(--fw-muted); padding-top: 10px; border-top: 1px solid var(--fw-border); line-height: 1.5; }
.pc-page-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
/* roomier conversation on the page (mirrors the grown panel) */
.pc-page .pc-feed-inner { max-width: 860px; margin: 0 auto; width: 100%; padding: 20px; }
.pc-page .pc-cards { grid-template-columns: 1fr 1fr 1fr; }
.pc-page .pc-table-scroll { max-height: 380px; }
.pc-page .pc-pane-tabell .pc-table-scroll { max-height: none; }
.pc-page .pc-composer { padding: 12px 20px 10px; }
.pc-page .pc-box { max-width: 860px; margin: 0 auto; }
.pc-page .pc-attribution, .pc-page .pc-disclaimer { max-width: 860px; margin-left: auto; margin-right: auto; }
@media (max-width: 720px) { .pc-page-side { display: none; } }

/* ---------- full-height mount + history (member surface) ---------- */
.pc-root { display: flex; flex-direction: column; height: 100%; background: var(--fw-surface); }
.pc-empty { text-align: center; color: var(--fw-muted); font-size: 13px; padding: 24px 12px; }
.pc-history { display: flex; height: 100%; }
.pc-hist-list { width: 248px; flex: 0 0 auto; border-right: 1px solid var(--fw-border); overflow-y: auto; }
.pc-hist-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 10px 14px; font-family: var(--fw-font);
}
.pc-hist-item:hover { background: var(--fw-surface-2); }
.pc-hist-item.pc-active { background: var(--fw-brand-soft); }
.pc-hist-item.pc-active .pc-hist-title { color: var(--fw-brand-strong); }
.pc-hist-title { font-size: 13px; font-weight: 600; color: var(--fw-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-hist-date { font-size: 11px; color: var(--fw-muted); margin-top: 2px; }
.pc-hist-view { flex: 1; overflow-y: auto; padding: 16px; }
.pc-msg { max-width: 720px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; }
.pc-msg-human { background: var(--fw-brand-tint); border-radius: 14px 14px 4px 14px; padding: 9px 13px; margin-left: auto; max-width: 85%; }
.pc-msg-ai p { margin: 0 0 8px; }
.pc-msg-ai a { color: var(--fw-brand-strong); }

/* ---------------- label photos ----------------
   Thumbnails sit ABOVE the input, inside the composer: an attachment belongs to the message being
   written, and putting it below would push it away from the words it belongs to. */
.pc-thumbs { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 4px 8px; }
.pc-thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--fw-border); background: var(--fw-surface-2); flex: 0 0 auto; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The remove button sits ON the thumbnail and is always visible — a control that appears on hover is a
   control a touch screen does not have. */
.pc-thumb-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0;
  border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.pc-thumb-x:hover { background: rgba(0, 0, 0, .82); }

.pc-attach { background: transparent; border: 0; padding: 6px; cursor: pointer; color: var(--fw-muted);
  display: flex; align-items: center; border-radius: 8px; flex: 0 0 auto; }
.pc-attach:hover { color: var(--fw-brand-strong); background: var(--fw-surface-2); }
.pc-attach svg { width: 18px; height: 18px; }

/* Attached photos under the question, so the transcript shows what was asked about what. Clickable,
   because a label is the one thing here the reader may need to check for themselves. */
.pc-qthumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; justify-content: flex-end; }
.pc-qthumb { width: 92px; height: 92px; padding: 0; border: 1px solid var(--fw-border); border-radius: 10px;
  overflow: hidden; background: var(--fw-surface-2); cursor: zoom-in; display: block; flex: 0 0 auto; }
.pc-qthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-qthumb:hover { border-color: var(--fw-brand); }
/* Gone, not broken: an image past its retention says so in words. A torn-page icon reads as a fault. */
.pc-qthumb-gone { cursor: default; display: flex; align-items: center; justify-content: center;
  text-align: center; border-style: dashed; }
.pc-qthumb-gone .pc-gone-t { font-size: 10.5px; line-height: 1.3; color: var(--fw-muted); padding: 4px; }

/* Full size over the conversation. Plain on purpose — zoom and pan are the browser's job. */
.pc-lightbox { position: fixed; inset: 0; z-index: 2147483000; background: rgba(0, 0, 0, .82);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.pc-lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 6px;
  cursor: default; background: #fff; }
.pc-lightbox-x { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0;
  border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.pc-lightbox-x:hover { background: rgba(255, 255, 255, .3); }
.pc-lightbox-x svg { width: 18px; height: 18px; }

/* Drop target. An outline on the whole panel, because the drop is accepted anywhere on it — an affordance
   that only lit up over a small button would be a worse lie than none. */
.pc-dropping { outline: 2px dashed var(--fw-brand); outline-offset: -6px; }
