/* IHK design system · rendered chat output (answers, questions, sources, notes).
   One stylesheet for every place a TalentBot answer is shown, so the text looks the same in the
   public widget, the admin chat log and the studio test chat. Requires ihk-tokens.css first.

   CLASS CONTRACT
   ─ .ihk-answer            wrapper of ONE rendered answer (markdown → HTML). The widget's
                            .assistant-message is an alias, so existing markup needs no change.
     .answer-label          "TalentBot · KI-generierter Inhalt" line at the top of an answer
     a.citation             inline source marker [n]
     details.source-list    "Quellen ansehen (n)" with one <a> per source and an optional <small>
     .followups > button    suggested next questions
     .response-tools        Copy / Helpful / Not helpful (buttons with aria-pressed)
     .context-note          limit, error, stop and status notes inside or after an answer
     .escalation-card       contact / referral card (.escalation-option links, .escalation-note)
     .ihk-person-card       named-adviser variant of the contact card
   ─ .ihk-question          the user's question bubble (alias: .user-message)
   ─ .ihk-answer-print      print/export container (alias: .print-only)

   Values follow the IHK design package's chatbot.css (.messages/.answer/.bot-label/.followups,
   option A, 29.10.2026): 18px/1.5 body (17px ≤760px), Korb 26px headings, 12px muted label with
   a 7px royal-blue mark, plain "Quellen ansehen" details, rounded follow-up buttons. */

.ihk-answer,.assistant-message{
  font-family:var(--ihk-font-body);font-size:18px;line-height:1.5;color:var(--ihk-navy);
  max-width:75ch;overflow-wrap:anywhere;margin:0 0 24px;white-space:normal}
/* read-only chips in the admin views (chat log, goldset): shown as in the widget, not clickable */
.ihk-answer .followups button:disabled{cursor:default;opacity:1;color:inherit}
.ihk-answer>*:first-child,.assistant-message>*:first-child{margin-top:0}

/* label */
.ihk-answer .answer-label,.assistant-message .answer-label{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px;
  font:400 12px/1.5 var(--ihk-font-body);color:var(--ihk-muted)}
.ihk-answer .answer-label:before,.assistant-message .answer-label:before{
  content:'';width:7px;height:7px;flex:none;border-radius:50%;background:var(--ihk-blue);display:inline-block}
.ihk-answer .answer-label small,.assistant-message .answer-label small{font:inherit;color:inherit;margin-left:-4px}
.ihk-answer .answer-label small:before,.assistant-message .answer-label small:before{content:'· '}

/* headings: Korb, one scale */
.ihk-answer h1,.ihk-answer h2,.ihk-answer h3,.ihk-answer h4,
.assistant-message h1,.assistant-message h2,.assistant-message h3,.assistant-message h4{
  font-family:var(--ihk-font-head);font-weight:400;color:var(--ihk-navy);text-wrap:balance;letter-spacing:0}
.ihk-answer h1,.assistant-message h1,.ihk-answer h2,.assistant-message h2{font-size:26px;line-height:1.2;margin:22px 0 12px}
.ihk-answer h3,.assistant-message h3{font-size:20px;line-height:1.3;margin:20px 0 8px}
.ihk-answer h4,.assistant-message h4{font-size:18px;line-height:1.3;margin:16px 0 6px}

/* text */
.ihk-answer p,.assistant-message p{margin:12px 0;max-width:75ch}
.ihk-answer strong,.assistant-message strong{font-weight:700}
.ihk-answer ul,.ihk-answer ol,.assistant-message ul,.assistant-message ol{margin:12px 0;padding-left:23px}
.ihk-answer li,.assistant-message li{margin:7px 0}
.ihk-answer blockquote,.assistant-message blockquote{margin:12px 0;padding:10px 16px;border-left:3px solid var(--ihk-blue);background:var(--ihk-white);color:var(--ihk-navy)}
.ihk-answer hr,.assistant-message hr{border:0;height:2px;background:var(--ihk-rule);margin:20px 0}
.ihk-answer code,.assistant-message code{font:inherit;background:none;padding:0}

/* links */
.ihk-answer a,.assistant-message a{color:var(--ihk-hover);text-decoration:underline;text-underline-offset:3px}
.ihk-answer a:hover,.assistant-message a:hover{color:var(--ihk-navy)}
.ihk-answer a:focus-visible,.assistant-message a:focus-visible{outline:3px solid var(--ihk-blue);outline-offset:2px;border-radius:2px}
.ihk-answer a.citation,.assistant-message a.citation{
  font-size:12px;white-space:nowrap;color:var(--ihk-hover);text-underline-offset:3px}

/* tables (fee overviews and the like) */
.ihk-answer .table-wrap,.assistant-message .table-wrap{overflow-x:auto;margin:12px 0 18px}
.ihk-answer table,.assistant-message table{border-collapse:collapse;width:100%;font-size:14px;line-height:1.45;table-layout:fixed}
/* cells wrap at word boundaries (hyphenated in the page language), never mid-word */
.ihk-answer table,.assistant-message table{overflow-wrap:normal;word-break:normal}
.ihk-answer th,.ihk-answer td,.assistant-message th,.assistant-message td{hyphens:auto;-webkit-hyphens:auto}
.ihk-answer th,.ihk-answer td,.assistant-message th,.assistant-message td{
  text-align:left;vertical-align:top;padding:8px;border-bottom:1px solid var(--ihk-border)}
.ihk-answer th,.assistant-message th{font-weight:600;color:var(--ihk-navy)}

/* sources: the package's plain details */
.ihk-answer .source-list,.assistant-message .source-list{margin:16px 0 0;padding:0;border:0;font-size:13px;color:var(--ihk-muted)}
.ihk-answer .source-list summary,.assistant-message .source-list summary{min-height:32px;color:var(--ihk-muted)}
.ihk-answer .source-list a,.assistant-message .source-list a{display:block;margin:8px 0;color:var(--ihk-hover);text-underline-offset:3px}
.ihk-answer .source-list small,.assistant-message .source-list small{display:block;margin:4px 0 8px;color:var(--ihk-muted);font-size:12px}

/* tools */
.ihk-answer .response-tools,.assistant-message .response-tools{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0 0}
.ihk-answer .response-tools button,.assistant-message .response-tools button{
  min-height:36px;padding:6px 10px;border:1px solid transparent;border-radius:var(--ihk-action-radius);
  background:none;color:var(--ihk-muted);font:14px var(--ihk-font-body);cursor:pointer}
.ihk-answer .response-tools button:hover,.assistant-message .response-tools button:hover{color:var(--ihk-navy);border-color:var(--ihk-border)}
.ihk-answer .response-tools [aria-pressed=true],.assistant-message .response-tools [aria-pressed=true]{color:var(--ihk-navy);border-color:var(--ihk-navy)}

/* suggested next questions (package .followups) */
.ihk-answer .followups,.assistant-message .followups{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}
.ihk-answer .followups button,.assistant-message .followups button{
  border:1px solid var(--ihk-border);background:var(--ihk-white);color:var(--ihk-navy);border-radius:18px;padding:10px 14px;
  font:15px/1.35 var(--ihk-font-body);min-height:44px;text-align:left;cursor:pointer}
.ihk-answer .followups button:after,.assistant-message .followups button:after{content:' →'}
.ihk-answer .followups button:hover,.assistant-message .followups button:hover{border-color:var(--ihk-blue)}
/* the closing question heads the suggestions that answer it (09.11.2026) */
.ihk-answer .followups-label,.assistant-message .followups-label{flex-basis:100%;margin:0 0 4px;font:600 16px/1.4 var(--ihk-font-body);color:var(--ihk-navy)}

/* notes: limit, error, stopped, status */
.context-note,.ihk-answer .loading,.assistant-message .loading{
  display:block;margin:12px 0;padding:10px 14px;border:1px solid var(--ihk-navy);border-radius:var(--ihk-card-radius);
  background:var(--ihk-white);color:var(--ihk-navy);font-size:15px;line-height:1.45}
.ihk-answer .live-body .loading,.assistant-message .live-body .loading{border:0;padding:4px 0;color:var(--ihk-muted)}

/* the user's question */
.ihk-question,.user-message{
  width:fit-content;max-width:min(85%,75ch);margin:0 0 24px auto;padding:12px 17px;
  background:var(--ihk-navy);color:var(--ihk-white);border-radius:12px 12px 0 12px;
  font:18px/1.5 var(--ihk-font-body);white-space:pre-wrap;overflow-wrap:anywhere}

/* contact and referral cards */
.escalation-card{margin:18px 0 12px;padding:20px;background:var(--ihk-surface);border:0;border-radius:var(--ihk-card-radius);color:var(--ihk-navy);position:relative;overflow:hidden}
.escalation-card .escalation-label{margin:0 0 12px;font:20px/1.25 var(--ihk-font-head);color:var(--ihk-navy)}
.escalation-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.escalation-option{position:relative;display:flex;flex-direction:column;gap:4px;min-width:0;min-height:78px;padding:14px 16px 18px;
  background:var(--ihk-white);border:0;border-radius:var(--ihk-card-radius);color:var(--ihk-navy);text-decoration:none;overflow:hidden}
.escalation-option:after{content:'';position:absolute;left:0;right:0;bottom:0;height:4px;background:var(--ihk-blue)}
.escalation-option:hover:after{height:6px}
.escalation-option>span{display:flex;justify-content:space-between;gap:12px;font-weight:600}
.escalation-option small{font-size:15px;overflow-wrap:anywhere;color:var(--ihk-muted)}
.escalation-card .escalation-note{margin:14px 0 6px;font-size:14px;line-height:1.45;color:var(--ihk-muted)}
.escalation-source{display:inline-block;padding:6px 0;font-size:14px;color:var(--ihk-hover);text-underline-offset:3px}
/* the matched contact (05.11.2026): the IHK website's contact card — pale ground, blue lower edge, landscape portrait
   beside name and pill actions above 760 px, stacked below; a text card without an approved portrait */
.ihk-person-card{max-width:730px;padding:24px 26px 22px;border-radius:16px}
.ihk-person-card:after{content:'';position:absolute;left:0;right:0;bottom:0;height:4px;background:var(--ihk-blue)}
.ihk-person-card .ihk-contact-heading{margin:0 0 18px;font:25px/1.2 var(--ihk-font-head);color:var(--ihk-navy)}
.ihk-person-layout{display:grid;grid-template-columns:minmax(0,252px) minmax(0,1fr);gap:26px;align-items:start}
.ihk-no-photo .ihk-person-layout{grid-template-columns:minmax(0,1fr)}
.ihk-person-photo{display:block;width:100%;max-width:252px;height:auto;aspect-ratio:3/2;object-fit:cover;border-radius:4px}
.ihk-person-card .ihk-person-name{margin:0 0 6px;font:600 21px/1.3 var(--ihk-font-body)}
.ihk-person-card .ihk-person-role{margin:0 0 16px;font-size:15px;line-height:1.45}
.ihk-person-actions{display:flex;flex-direction:column;align-items:flex-start;gap:9px}
.ihk-contact-action{display:inline-flex;align-items:center;gap:10px;max-width:100%;min-height:44px;padding:9px 16px;
  background:var(--ihk-white);border:0;border-radius:24px;color:var(--ihk-navy);text-decoration:none;font:16px/1.3 var(--ihk-font-body);overflow-wrap:anywhere;cursor:pointer}
.ihk-contact-action:hover{background:#dce8f6}
.ihk-contact-action:focus-visible{outline:3px solid var(--ihk-blue);outline-offset:3px}
.ihk-notify-status{margin:10px 0 4px;font-size:15px;color:var(--ihk-navy)}
/* phone hours and the callback request (IHK decision 06.11.2026; Nia's demo) */
.ihk-person-card .ihk-person-hours{margin:-8px 0 14px;font-size:14px;color:var(--ihk-muted)}
.ihk-callback-cta{margin:16px 0 4px}
.ihk-callback{display:inline-flex;align-items:center;min-height:44px;padding:10px 20px;border:0;border-radius:24px;background:var(--ihk-navy);color:var(--ihk-white);font:600 16px/1.3 var(--ihk-font-body);cursor:pointer}
.ihk-callback:hover{background:#00264d}
.ihk-callback:focus-visible{outline:3px solid var(--ihk-blue);outline-offset:3px}
.ihk-callback-cta p{margin:6px 0 0;font-size:14px;color:var(--ihk-muted)}
.ihk-callback-sent{margin:14px 0 4px;font-size:15px}
.ihk-callback-sent:before{content:'✓';margin-right:8px;color:var(--ihk-blue);font-weight:600}
.cb{color:var(--ihk-navy);font:16px/1.5 var(--ihk-font-body)}
.cb-mini{display:flex;gap:14px;align-items:center;padding:12px 14px;margin:0 0 14px;background:var(--ihk-surface);border-radius:10px;font-size:14px;line-height:1.45}
.cb-mini img{width:96px;height:64px;object-fit:cover;border-radius:4px;flex:0 0 96px}
.cb-lead{margin:0 0 10px}
.cb form label,.cb legend{display:block;margin:14px 0 6px;font-weight:600;font-size:15px}
.cb input[type=text],.cb input[type=email],.cb input[type=tel],.cb input[type=date],.cb select,.cb textarea{width:100%;box-sizing:border-box;min-height:44px;padding:10px 12px;border:1px solid var(--ihk-border);border-radius:8px;font:16px/1.4 var(--ihk-font-body);color:var(--ihk-navy);background:var(--ihk-white)}
.cb textarea{min-height:110px;resize:vertical}
.cb [aria-invalid=true]{border-color:#b91c1c;box-shadow:0 0 0 1px #b91c1c}
.cb input:focus-visible,.cb select:focus-visible,.cb textarea:focus-visible{outline:3px solid var(--ihk-blue);outline-offset:1px}
.cb-member{border:0;padding:0;margin:0}
.cb .cb-member label{display:inline-flex;align-items:center;gap:6px;margin:4px 18px 0 0;font-weight:400;min-height:36px}
.cb-row{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
@media (max-width:520px){.cb-row{grid-template-columns:1fr}}
.cb-hint{margin:8px 0 0;font-size:14px;color:var(--ihk-muted)}
.cb-err{margin:6px 0 0;color:#b91c1c;font-size:14px}
.cb-dl{display:grid;grid-template-columns:minmax(120px,200px) minmax(0,1fr);gap:8px 16px;margin:14px 0;padding:14px 16px;background:var(--ihk-surface);border-radius:10px}
.cb .cb-dl dt{color:var(--ihk-muted);margin:0;padding:0;align-self:start;font-weight:600;line-height:1.5}.cb .cb-dl dd{margin:0;padding:0;align-self:start;line-height:1.5;overflow-wrap:anywhere}
@media (max-width:520px){.cb-dl{grid-template-columns:1fr}.cb-dl dt{margin-top:6px}}
.cb-done .cb-check{width:44px;height:44px;border-radius:50%;background:var(--ihk-surface);display:grid;place-items:center;font-size:22px;color:var(--ihk-blue);margin:0 0 10px}
.cb-dl-plain p{margin:6px 0}
.ihk-notify-status:before{content:'✓';margin-right:8px;color:var(--ihk-blue);font-weight:600}
.ihk-notify-failed:before{content:'!'}
.ihk-contact-action svg{flex:0 0 20px;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.referral{display:inline-flex;align-items:center;min-height:44px;padding:10px 16px;border:1px solid var(--ihk-navy);border-radius:var(--ihk-action-radius);color:var(--ihk-navy);text-decoration:none;margin:4px 0 12px}

@media (max-width:760px){
  .ihk-answer,.assistant-message{font-size:17px}
  .ihk-answer h1,.ihk-answer h2,.assistant-message h1,.assistant-message h2{font-size:24px}
  .ihk-answer h3,.assistant-message h3{font-size:19px}
  .ihk-question,.user-message{max-width:93%;font-size:17px}
  .ihk-answer .followups,.assistant-message .followups{flex-direction:column}
  .escalation-options{grid-template-columns:1fr;gap:10px}
  .ihk-person-card{padding:20px}
  .ihk-person-layout{grid-template-columns:1fr;gap:18px}
  .ihk-person-photo{max-width:100%}
}
@media (forced-colors:active){
  .ihk-question,.user-message{border:1px solid CanvasText}
  .escalation-option:after,.ihk-person-card:after{background:CanvasText}
  .ihk-contact-action{border:1px solid CanvasText}
}

/* export container rendered on screen (runtime.js exportPDF draws it off-screen with html2canvas) */
.ihk-answer-print{font-family:var(--ihk-font-body);color:var(--ihk-navy)}
.ihk-answer-print h1,.ihk-answer-print h2,.ihk-answer-print h3,.ihk-answer-print h4{font-family:var(--ihk-font-head);font-weight:400;color:var(--ihk-navy);margin:10px 0 4px}
.ihk-answer-print h1,.ihk-answer-print h2{font-size:14pt}.ihk-answer-print h3,.ihk-answer-print h4{font-size:12pt}
.ihk-answer-print p{margin:0 0 6px}
.ihk-answer-print a{color:var(--ihk-navy);word-break:break-word}
.ihk-answer-print table{border-collapse:collapse;width:100%}
.ihk-answer-print th,.ihk-answer-print td{text-align:left;vertical-align:top;padding:4px 8px 4px 0;border-bottom:1px solid var(--ihk-border)}

/* print / export */
@media print{
  .ihk-answer-print,.print-only{font:11pt/1.5 "Source Sans Pro",Arial,sans-serif;color:#003366}
  .ihk-answer-print h1,.print-only h1{font:24pt/1.2 Korb,Arial,sans-serif}
  .ihk-answer-print h2,.ihk-answer-print h3,.print-only h2,.print-only h3{font-family:Korb,Arial,sans-serif;font-weight:400}
  .ihk-answer-print a,.print-only a{color:#003366;word-break:break-word}
  .ihk-answer-print table,.print-only table{border-collapse:collapse;width:100%}
  .ihk-answer-print th,.ihk-answer-print td,.print-only th,.print-only td{padding:6px;border:1px solid #ccd7e6}
  .response-tools,.followups{display:none!important}
}

/* Export/PDF (IHK test round 06.11.2026): html2canvas lays out blocks reliably, not <details>. exportPDF turns every
   <details> into section.export-more + h4; here: no absolute positioning, explicit line boxes, numbers inside. */
.ihk-answer-print,.ihk-answer-print *{position:static;float:none}
.ihk-answer-print{line-height:1.45}
.ihk-answer-print p,.ihk-answer-print li,.ihk-answer-print td,.ihk-answer-print th{line-height:1.45}
.ihk-answer-print ol,.ihk-answer-print ul{margin:4px 0 8px;padding-left:0;list-style-position:inside}
.ihk-answer-print li{margin:0 0 3px;overflow:visible}
.ihk-answer-print li>p{display:inline;margin:0}
.ihk-answer-print section.export-more{display:block;margin:6px 0 8px;padding:0}
.ihk-answer-print section.export-more>h4{display:block;margin:6px 0 3px;font-size:11pt;line-height:1.35}
.ihk-answer-print details>summary{display:block;list-style:none}
.ihk-answer-print details>summary::-webkit-details-marker{display:none}
/* Soft name hint (not a send block): same slot as #pii, calmer colour */
.pii.pii-name{border-color:var(--ihk-border,#ccd7e6);color:var(--ihk-navy,#003366);background:#f5f8fc}

/* step progress card (09.11.2026): the five steps and the current step's checklist */
.step-progress{border:1px solid var(--ihk-border);border-radius:var(--ihk-card-radius);background:var(--ihk-surface);padding:14px 16px;margin:16px 0}
/* the bar is a reading, not a control (IHK 16.11.2026, So Young: „hatte ich den Eindruck, dass die Grafik interaktiv ist …
   frustriert, als ich auf keinen der ‚Buttons' klicken konnte"): flat segments with a coloured line, no pill borders —
   only the open checklist items below are buttons */
.step-progress .step-bar{display:flex;gap:4px;list-style:none;margin:0 0 8px;padding:0}
.step-progress .step-bar li{flex:1;display:flex;align-items:center;justify-content:flex-start;padding:5px 0 0;border:0;border-top:4px solid var(--ihk-border);border-radius:0;background:none;font:600 12px/1.2 var(--ihk-font-body);color:var(--ihk-muted);cursor:default}
.step-progress .step-bar li.done{border-top-color:var(--ihk-success);color:var(--ihk-success)}
.step-progress .step-bar li.current{border-top-color:var(--ihk-navy);color:var(--ihk-navy)}
/* a step behind the case that is still open (e.g. the recognition while the title is clarified first) and a step this case
   does not need („entfällt") — scenario check 11.11.2026: never ✓ by position alone */
.step-progress .step-bar li.open{border-top-style:dashed;border-top-color:var(--ihk-navy);color:var(--ihk-navy)}
.step-progress .step-bar li.skip{border-top-style:dotted;color:var(--ihk-muted)}
.step-progress .step-hint{margin:0 0 8px;font-size:14px;line-height:1.4;color:var(--ihk-muted)}
.step-progress .step-head{margin:0 0 6px;color:var(--ihk-navy)}
.step-progress .step-next{margin:8px 0 0}
.step-progress .ck-title{margin:8px 0 6px;font-weight:600;color:var(--ihk-navy);display:flex;justify-content:space-between;gap:12px}
.step-progress .ck-title span{font-weight:400;color:var(--ihk-muted)}
.step-progress .ck-bar{height:8px;border-radius:4px;background:var(--ihk-white);border:1px solid var(--ihk-border);overflow:hidden}
.step-progress .ck-bar span{display:block;height:100%;background:var(--ihk-success);transition:width .6s ease}
.step-progress .ck-items{list-style:none;margin:10px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:4px 16px}
.step-progress .ck-items li.done{color:var(--ihk-success)}
.step-progress .ck-items li.open{color:var(--ihk-muted)}
/* the open items as „+ Qualifikation" buttons: ihk-widget.css (IHK meeting 19.11.2026) */
.step-progress .ck-complete .ck-title{color:var(--ihk-success)}
@media (prefers-reduced-motion:reduce){.step-progress .ck-bar span{transition:none}}
@media print{.step-progress{break-inside:avoid}.step-progress .ck-add{color:inherit;border:0;padding:0;background:none}.step-progress .ck-add .ck-plus{display:none}.step-progress .step-hint{display:none}}

/* links at the end (IHK 16.11.2026, So Young: „zunächst die eigentliche Antwort zu geben, weiterführende Links erst am Ende
   der Antwort oder in einem separaten Abschnitt"): the backend collects them under „Weiterführende Links:"; a quiet block */
.assistant-message p.further-links-head,.ihk-answer p.further-links-head{margin:20px 0 4px;padding-top:12px;border-top:1px solid var(--ihk-border);font-size:15px;color:var(--ihk-muted)}
.assistant-message ul.further-links,.ihk-answer ul.further-links{margin:0 0 12px;font-size:15px;line-height:1.45}
.assistant-message ul.further-links li,.ihk-answer ul.further-links li{margin:2px 0}
