/* ============================================================
   Kameleongruppen brand system — tokens & font pulled directly
   from kameleon-dev.shared.css (the live site's stylesheet).
   ============================================================ */

/* Real brand typeface — Haffer XH variable font, served from Kameleon's CDN */
@font-face {
  font-family: "Haffer XH";
  src: url(https://cdn.prod.website-files.com/6830856c38fbffa4f4f66cb1/68342cd45c4268e8737205a6_HafferStandardUprights-VF.woff2) format("woff2");
  font-weight: 100 1000; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Haffer XH";
  src: url(https://cdn.prod.website-files.com/6830856c38fbffa4f4f66cb1/68342cd4b33578596406e5f4_HafferStandardItalics-VF.woff2) format("woff2");
  font-weight: 100 1000; font-style: italic; font-display: swap;
}

:root {
  /* --colors-- tokens, verbatim from the brand stylesheet */
  --kameleon-green: #02423d;
  --green-dark:     #001513;  /* --colors--dark */
  --green-black:    #000a09;
  --bright-green:   #00f0aa;
  --light-green:    #009a74;
  --greenish:       #f3fff5;
  --whiteish:       #f8f8f8;  /* page background */
  --grayish:        #445959;
  --light-gray:     #acbab9;
  --lighter-gray:   #ebebeb;
  --white:          #fff;
  --red:            #ff3827;

  /* Hairlines — kept lighter than --light-gray for a clean, airy feel */
  --line:        #e9eeec;
  --line-strong: #dfe6e3;

  /* --radius-- tokens from the brand: standard 10, large 30, small 4, round=pill */
  --radius:     10px;
  --radius-lg:  30px;
  --radius-sm:  4px;
  --pill:       2000px;

  --shadow-sm: 0 1px 2px rgba(0,21,19,.04);
  --shadow:    0 1px 3px rgba(0,21,19,.05), 0 18px 40px -24px rgba(2,66,61,.22);
  --shadow-lg: 0 24px 60px -20px rgba(0,21,19,.22);

  --ease: cubic-bezier(.19,1,.22,1); /* brand uses this curve for nav transitions */
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  /* body{} from brand: whiteish bg, dark text, Haffer XH, line-height 140%, wght 480 */
  background: var(--whiteish);
  color: var(--green-dark);
  font: 16px/1.4 "Haffer XH", Arial, sans-serif;
  font-variation-settings: "wght" 480;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex; flex-direction: column;
}

/* ---------- Top navigation (white-on-green, brand pattern) ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--kameleon-green); color: #fff;
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 0 40px; height: 80px;   /* --80px brand navbar height, --40px global padding */
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.logo {
  width: 38px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.logo svg { width: 22px; height: 20px; display: block; }
.brand-name { font-size: 18px; font-weight: 600; }
.nav-links { display: flex; gap: 4px; margin-left: 14px; }
.nav-links a {
  color: rgba(255,255,255,.72); text-decoration: none;
  font-size: 15px; font-weight: 500; padding: 8px 14px; border-radius: var(--pill);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.active { color: var(--green-dark); background: var(--bright-green); font-weight: 600; }
.nav-right { margin-left: auto; }
.status {
  font-size: 13px; font-weight: 600; color: #fff; text-decoration: none;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  padding: 7px 16px; border-radius: var(--pill);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.status:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.32); }

/* ---------- Support view: green band, intro left + chat right ---------- */
#view-support {
  background:
    radial-gradient(820px 360px at 86% -30%, rgba(0,240,170,.20), transparent 60%),
    radial-gradient(620px 300px at 4% 130%, rgba(0,154,116,.10), transparent 60%),
    var(--kameleon-green);
}
/* Two-column split that fills the viewport below the navbar (no page scroll). */
.split {
  flex: 1; min-height: 0;
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 40px 40px 44px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 56px; align-items: stretch;
}
.split-intro { color: #fff; align-self: center; max-width: 52ch; }
.eyebrow {
  display: inline-block;
  text-transform: uppercase; letter-spacing: 2px; font-size: 13px; font-weight: 600;
  color: var(--bright-green);
  border: 1px solid rgba(0,240,170,.32); border-radius: var(--pill);
  padding: 7px 16px; margin: 0 0 24px;
}
.split-intro h1 {
  /* brand h1: 65px, line-height 110%, wght 499, NO letter-spacing.
     Capped a touch smaller than the full-width hero since it now lives in a column. */
  font-size: clamp(34px, 4vw, 56px); line-height: 1.08; font-weight: 500;
  font-variation-settings: "wght" 520;
  letter-spacing: -.5px; margin: 0; max-width: 17ch;
}
.lede {
  margin: 24px 0 0; max-width: 58ch;
  font-size: 19px; line-height: 1.5;   /* --font-sizes--large 19px */
  color: rgba(255,255,255,.78);
}

/* ---------- Views ---------- */
.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.view[hidden] { display: none; }

/* ---------- Layout ---------- */
.layout {
  flex: 1; width: 100%; max-width: 1280px; margin: -56px auto 0;
  padding: 0 40px 48px;
  display: grid; gap: 24px;
  align-items: start; min-height: 0;
}
/* Knowledge base page has no hero, so it doesn't pull up under the navbar. */
.layout-kb { margin-top: 32px; }

/* ---------- Cards (shared surface, brand --radius--large) ---------- */
.kb-page, .chat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------- Knowledge base page ---------- */
.kb-page { padding: 32px; }
.kb-page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.kb-title { font-size: 28px; font-weight: 600; margin: 0; font-variation-settings: "wght" 540; }
.kb-sub { margin: 8px 0 0; color: var(--grayish); font-size: 15px; line-height: 1.5; max-width: 60ch; }
.kb-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; align-items: start;
}
.kb-grid .panel { margin-bottom: 0; }
.count {
  background: var(--kameleon-green); color: #fff; font-size: 12px; font-weight: 600;
  min-width: 24px; text-align: center; padding: 4px 10px; border-radius: var(--pill);
  flex-shrink: 0;
}

/* Panels: white surface separated by space + hairline (no heavy tinted blocks) */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.panel:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.field-label { display: block; font-size: 15px; font-weight: 600; color: var(--green-dark); margin-bottom: 4px; }
.hint { margin: 0 0 12px; font-size: 13px; color: var(--grayish); }
.or { display: flex; align-items: center; text-align: center; color: var(--light-gray); font-size: 12px; margin: 14px 0; gap: 10px; text-transform: uppercase; letter-spacing: .5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

input[type=text], textarea, input[type=file] {
  width: 100%; background: var(--whiteish); border: 1px solid var(--line);
  color: var(--green-dark); border-radius: var(--radius); padding: 11px 13px;
  font: inherit; font-size: 15px; margin-bottom: 10px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
input[type=file] { padding: 10px 13px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: #93a3a1; }
textarea { resize: vertical; }
input:focus, textarea:focus {
  outline: none; background: var(--white); border-color: var(--light-green);
  box-shadow: 0 0 0 3px rgba(0,240,170,.18);
}

/* Buttons — brand CTA: pill, bright-green bg, dark text, wght 530 */
.btn {
  width: 100%; cursor: pointer; border: 1px solid var(--line-strong);
  background: var(--white); color: var(--kameleon-green);
  min-height: 44px; padding: 10px 18px; border-radius: var(--pill);
  font: inherit; font-size: 15px; font-variation-settings: "wght" 530; font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .08s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--kameleon-green); color: #fff; border-color: var(--kameleon-green); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--bright-green); color: var(--green-dark); border-color: var(--bright-green);
  width: auto; padding: 0 28px;
}
.btn.primary:hover { background: #00d896; border-color: #00d896; color: var(--green-dark); box-shadow: 0 8px 22px -8px rgba(0,240,170,.7); }
.btn.ghost { background: transparent; border-style: dashed; border-color: var(--light-gray); color: var(--grayish); }
.btn.ghost:hover { color: #fff; background: var(--kameleon-green); border-color: var(--kameleon-green); border-style: solid; }
.btn:disabled { opacity: .5; cursor: progress; }

/* Sources */
.sources-head { margin: 24px 0 12px; }
.sources-head h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--light-gray); font-weight: 600; margin: 0; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.doc-item {
  background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.doc-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.doc-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; }
.doc-item.has-body .doc-head { cursor: pointer; }
.doc-item .type { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; }
.type.pdf { background: #ffe7e3; color: #c4291a; }
.type.jobcase { background: #d4fbe9; color: var(--light-green); }
.type.text { background: var(--greenish); color: var(--kameleon-green); }
.doc-item .name { flex: 1; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item .chev { color: var(--light-gray); font-size: 12px; transition: transform .2s var(--ease); }
.doc-item.expanded .chev { transform: rotate(180deg); }
.doc-item .del { background: none; border: none; color: var(--light-gray); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 6px; transition: color .2s var(--ease), background .2s var(--ease); }
.doc-item .del:hover { color: var(--red); background: #fff0ef; }
.doc-body {
  display: none; padding: 0 13px 13px; margin-top: -2px;
  font-size: 13.5px; line-height: 1.55; color: var(--grayish);
  white-space: pre-wrap; word-break: break-word;
  border-top: 1px solid var(--line);
}
.doc-item.expanded .doc-body { display: block; padding-top: 11px; }

/* ---------- Chat ---------- */
.chat {
  display: flex; flex-direction: column;
  /* Fill whatever the support view has left after navbar + hero, instead of
     demanding a full viewport of its own (which used to push the composer
     below the fold on short laptop screens). */
  height: 100%; min-height: 0; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.chat-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--green-dark); }
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--bright-green);
  animation: pulse-live 2.2s infinite;
}
@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(0,240,170,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(0,240,170,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,240,170,0); }
}
.btn-newchat {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--white); border: 1px solid var(--line-strong); color: var(--kameleon-green);
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 15px; border-radius: var(--pill);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn-newchat:hover { background: var(--kameleon-green); color: #fff; border-color: var(--kameleon-green); box-shadow: var(--shadow-sm); }
.btn-newchat:active { transform: translateY(1px); }
.btn-newchat .plus { font-size: 16px; line-height: 0; margin-top: -1px; }

.messages { flex: 1; overflow-y: auto; padding: 32px; display: flex; flex-direction: column; gap: 20px; }

/* Modern "thinking" indicator — animated brand-mint dots + shimmer label */
.thinking { display: flex; align-items: center; gap: 12px; }
.dots { display: inline-flex; gap: 5px; }
.dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--light-green);
  animation: dot-pulse 1.2s infinite ease-in-out both;
}
.dots span:nth-child(2) { animation-delay: .16s; }
.dots span:nth-child(3) { animation-delay: .32s; }
@keyframes dot-pulse {
  0%, 70%, 100% { transform: scale(.55); opacity: .35; }
  35%           { transform: scale(1);   opacity: 1; }
}
.thinking-label {
  font-size: 14.5px; font-weight: 500;
  background: linear-gradient(90deg, var(--grayish) 30%, var(--bright-green) 50%, var(--grayish) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Blinking caret shown at the tail of the answer while tokens stream in */
.caret {
  display: inline-block; width: 7px; height: 1.05em; margin-left: 2px;
  vertical-align: text-bottom; background: var(--light-green); border-radius: 1px;
  animation: caret-blink 1s steps(2, start) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.empty-state { margin: auto; text-align: center; max-width: 440px; }
.empty-icon {
  display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 18px;
  border-radius: 20px; background: var(--greenish);
  border: 1px solid var(--line-strong);
}
.empty-icon svg { width: 30px; height: 27px; display: block; }
.empty-icon svg path { fill: var(--kameleon-green); }
.empty-title { margin: 0 0 8px; font-size: 22px; font-weight: 600; font-variation-settings: "wght" 540; color: var(--green-dark); }
.muted { color: var(--grayish); font-size: 15px; line-height: 1.5; }

.msg { max-width: 860px; }
.msg.user {
  align-self: flex-end; background: var(--kameleon-green); color: #fff;
  padding: 12px 17px; border-radius: 16px 16px 5px 16px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.msg.assistant { align-self: flex-start; width: 100%; }
.bubble {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 5px 16px 16px 16px; padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.answer { white-space: pre-wrap; line-height: 1.62; }
.answer .cite { color: var(--light-green); font-weight: 700; font-size: 12px; vertical-align: super; cursor: default; }

.meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: var(--pill); text-transform: uppercase; letter-spacing: .5px; }
.badge.high { background: #d4fbe9; color: var(--light-green); border: 1px solid #a6f0d2; }
.badge.medium { background: #fbf3eb; color: #b5781a; border: 1px solid #f0dcc0; }
.badge.low { background: #ffe7e3; color: #c4291a; border: 1px solid #f6c4bd; }
.confnum { font-size: 13px; color: var(--grayish); }

.sources { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.sources h4 { margin: 0 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--light-gray); font-weight: 600; }

/* Distinct files this answer used — the at-a-glance grounding signal */
.files-used { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.files-label { font-size: 13px; font-weight: 600; color: var(--grayish); }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--kameleon-green);
  background: var(--greenish); border: 1px solid #cdeede;
  padding: 4px 11px; border-radius: var(--pill); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-chip::before { content: "◆"; font-size: 9px; color: var(--light-green); }
.source { display: flex; gap: 12px; margin-bottom: 14px; font-size: 15px; }
.source .num { color: var(--light-green); font-weight: 700; min-width: 22px; }
.source .body { flex: 1; }
.source .quote { color: var(--green-dark); border-left: 3px solid var(--bright-green); padding-left: 13px; line-height: 1.55; }
.source .ref { color: var(--grayish); font-size: 13px; margin-top: 6px; }
.source .ref b { color: var(--kameleon-green); font-weight: 600; }

.composer {
  display: flex; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--line);
  background: rgba(248,248,248,.7);
}
.composer input { margin: 0; background: var(--white); }

.typing { color: var(--grayish); font-style: italic; }
.toast {
  position: fixed; bottom: 22px; right: 22px; background: var(--kameleon-green); color: #fff;
  padding: 13px 18px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 100;
  animation: toast-in .25s var(--ease);
}
.toast.err { background: #fff; border: 1px solid var(--red); color: #c4291a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-inner { gap: 16px; }
  .nav-links { margin-left: 0; }
  .nav-links .muted-link { display: none; }
  .nav-inner, .split, .layout { padding-left: 24px; padding-right: 24px; }
  /* Stack: intro on top, chat below. */
  .split {
    grid-template-columns: 1fr; gap: 24px;
    padding-top: 28px; padding-bottom: 28px; align-items: start;
  }
  .split-intro { align-self: start; }
  .chat { height: 70vh; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4dddb; border-radius: var(--pill); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--light-gray); background-clip: content-box; }
