*{box-sizing:border-box}body{margin:0;background:#eef3f5;color:#192f35;font:16px/1.6 system-ui,sans-serif}header{padding:24px max(20px,calc((100vw - 880px)/2));background:#173c44;color:white;display:flex;flex-wrap:wrap;gap:8px 24px}header span{opacity:.8}main{max-width:920px;margin:32px auto;padding:0 20px}section{background:white;padding:32px;border-radius:18px;margin:20px 0;box-shadow:0 8px 35px #173c4409}h1{font-size:clamp(26px,4vw,36px);line-height:1.2;margin:10px 0 18px}h2{font-size:22px}h3{font-size:18px}form{max-width:560px}label{display:block;font-weight:600;margin:18px 0}input,textarea{display:block;width:100%;margin-top:7px;padding:13px;border:1px solid #81969c;border-radius:8px;font:inherit;color:inherit;background:white}button{padding:13px 22px;border:0;border-radius:8px;background:#17695f;color:white;font:600 16px system-ui;cursor:pointer}.secondary{background:#e9eff0;color:#173c44}.notice,.error,.success{padding:16px;border-radius:10px;background:#dfeaf0}.error{background:#ffe5e5;color:#761b1b}.success{background:#dbf4e7;color:#174733}.eyebrow{font-weight:700;color:#17695f}.top{display:flex;justify-content:space-between;flex-wrap:wrap;gap:16px}article{border:1px solid #d1dfe1;padding:20px;border-radius:10px}.note{white-space:pre-wrap;overflow-wrap:anywhere}.muted,footer{color:#506970}footer{text-align:center;padding:25px}summary{cursor:pointer;font-weight:600}:focus-visible{outline:3px solid #dc9200;outline-offset:3px}@media(max-width:600px){section{padding:22px}main{padding:0 12px;margin-top:18px}}
.portal{max-width:1120px}nav{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}nav a,.clients a{display:inline-block;padding:12px 16px;background:#fff;border:1px solid #bfd1cd;border-radius:8px;color:#185b50;text-decoration:none}nav a.active{background:#185b50;color:white}select{display:block;width:100%;padding:12px;border:1px solid #8ca4aa;border-radius:8px;background:white;font:inherit}input[type=checkbox]{display:inline;width:auto}article{border-bottom:1px solid #dce5e2;padding:16px 0}.note{white-space:pre-wrap;overflow-wrap:anywhere}@media print{header,nav,form,.notice,.clients,.portal>p,.top{display:none!important}body,main,section{background:white!important;color:black!important;box-shadow:none!important;margin:0!important;padding:0!important;max-width:100%!important}article{break-inside:avoid}}
fieldset{border:1px solid #cad8d7;border-radius:12px;margin:18px 0;padding:16px}.check{display:flex;align-items:flex-start;gap:10px;margin:10px 0}.check input{width:auto;flex:0 0 auto}.calendar{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:10px}.calendar article{padding:12px;margin:0}.calendar p{margin:5px 0}audio{max-width:100%}details{padding:16px;border:1px solid #ccd6d6;border-radius:12px;margin:16px 0}summary{cursor:pointer;font-weight:bold}button:disabled{opacity:.5}nav{overflow-x:auto}input[type=time]{max-width:180px;display:inline-block;margin:4px}h3{line-height:1.4}@media print{button,details,fieldset,audio,#audio-download{display:none}}

.slot{display:block;width:100%;padding:8px;margin:6px 0;min-height:44px}

.qa-pair{display:grid;grid-template-columns:1fr 1fr;gap:18px;border-top:1px solid #ccdadd;padding-top:16px;margin-top:20px}.qa-pair>section{min-width:0;padding:0}.qa-pair textarea{width:100%;min-height:180px}@media(max-width:720px){.qa-pair{grid-template-columns:1fr}}

main.portal:has(.advisor-workbench){max-width:1440px}.advisor-workbench{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:28px;align-items:start}.advisor-tools,.conversation{min-width:0}.advisor-tools{padding:18px;background:#eef4f5;border-radius:12px}.advisor-tools details{margin:12px 0}.advisor-tools summary{cursor:pointer}.advisor-tools textarea{width:100%}@media(max-width:800px){.advisor-workbench{grid-template-columns:1fr}}

.password-control{display:flex;gap:8px;align-items:center}.password-control input{flex:1;min-width:0}.password-control .password-toggle{flex:none;width:auto;margin:0;padding:10px;font-size:14px}

/* Client conversation: customer left, advisor right. */
.chat-bubble{width:fit-content;max-width:82%;padding:14px 18px;margin-top:14px;margin-bottom:14px;border:1px solid #d3e0e2;border-radius:16px;overflow-wrap:anywhere;box-sizing:border-box}
.chat-bubble.chat-customer{margin-left:0;margin-right:auto;background:#eef3f8;color:#193b42;border-top-left-radius:4px}
.chat-bubble.chat-advisor{margin-left:auto;margin-right:0;background:#d9f2e5;color:#173d32;border-color:#b8ddc9;border-top-right-radius:4px}
.chat-bubble.chat-ai{margin-left:auto;margin-right:auto;background:#fff4d9;color:#493b1c}
.chat-bubble .note{margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}.chat-bubble small{display:block;color:#4b6267;font-size:12px}
@media(max-width:600px){.chat-bubble{max-width:90%;padding:12px}.chat-bubble strong{font-size:14px}}
.voice-box{margin-top:24px;padding:18px;border:1px solid #c6dadd;background:#f3f8f8;border-radius:12px;color:#193b42}.voice-buttons{display:flex;gap:10px;flex-wrap:wrap}.voice-buttons button{width:auto}.voice-player{max-width:100%;width:100%;margin:12px 0}.voice-save{display:block;margin-bottom:12px}.voice-save[hidden],.voice-player[hidden]{display:none}.voice-status{overflow-wrap:anywhere}.voice-box textarea{width:100%;box-sizing:border-box}.voice-box input[type=file]{max-width:100%}

/* Recording remains reachable while scrolling; safe area for mobile devices. */
.recording-dock{position:fixed;bottom:0;left:0;right:0;z-index:1000;display:flex;justify-content:center;gap:12px;flex-wrap:wrap;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:#fff;border-top:1px solid #ccdcd8;box-shadow:0 -3px 16px #12342b18}
.recording-dock button{margin:0;min-height:44px;white-space:normal}
.unified-customer-form textarea{scroll-margin-bottom:150px}
@media(max-width:480px){.recording-dock{gap:8px;padding-left:8px;padding-right:8px}.recording-dock button{flex:1;padding:10px 8px;font-size:14px}}


/* 2026-10 OS-Master V1: calmer customer view and structured advisor workspace */
.client-portal{max-width:980px}.client-menu{background:#fff;border:1px solid #d3e1df;border-radius:14px;padding:0;margin:18px 0}.client-menu>summary{padding:14px 18px;color:#17695f}.client-menu nav{padding:0 14px 14px;margin:0}.client-chat-head{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:12px 0 18px;border-bottom:1px solid #dce7e5}.client-chat-head>div{display:flex;flex-direction:column}.client-chat-head small{color:#60777b}.client-chat-head form{margin:0;max-width:none}.compact-language{display:flex;align-items:center;gap:7px;margin:0;font-weight:600}.compact-language select{width:auto;min-width:135px;margin:0;padding:9px 32px 9px 10px}.client-chat-stream{min-height:120px}.speak-message{padding:7px 10px;font-size:13px;margin:2px 0 8px}.os-master-bar{display:flex;flex-direction:column;gap:3px;background:#e3f2ee;border:1px solid #bad9d0;padding:14px 18px;border-radius:12px;margin:0 0 18px}.os-master-bar strong{color:#145d53}.advisor-tools fieldset{max-height:340px;overflow:auto;background:white}.advisor-tools .check{padding:7px 9px;border-radius:8px}.advisor-tools .check:has(input:checked){background:#dff2ea}.advisor-portal .clients{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}.advisor-portal .main-nav{position:sticky;top:0;z-index:20;background:#eef3f5;padding:10px 0}
@media(max-width:600px){.client-chat-head{align-items:flex-start}.compact-language select{min-width:118px}.client-portal section{padding:18px}.client-menu nav{display:grid;grid-template-columns:1fr 1fr}.advisor-portal .main-nav{position:static}}

/* New-message control: do not force the reader back to the bottom. */
.new-chat-message{position:fixed;right:22px;bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:1100;border-radius:999px;box-shadow:0 5px 20px #173c4430;padding:10px 16px}
@media(max-width:480px){.new-chat-message{right:12px;bottom:calc(86px + env(safe-area-inset-bottom,0px));font-size:14px}}

/* 2026-10 Client drawer menu matching approved mobile concept */
.client-menu-open{display:inline-flex;align-items:center;gap:9px;margin:14px 0 4px;padding:11px 16px;border-radius:12px;background:#173f43;color:#fff}
.client-menu-backdrop{position:fixed;inset:0;z-index:1190;background:rgba(10,30,32,.42);backdrop-filter:blur(2px)}
.client-menu-backdrop[hidden]{display:none}
.client-drawer{position:fixed;z-index:1200;top:0;bottom:0;right:0;width:min(420px,92vw);display:flex;flex-direction:column;background:#f7faf9;box-shadow:-12px 0 38px rgba(12,42,44,.22);transform:translateX(105%);transition:transform .22s ease;overflow-y:auto}
.client-drawer.open{transform:translateX(0)}
.client-drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:23px 20px;background:#173f43;color:#fff}
.client-drawer-head>div{display:flex;flex-direction:column}.client-drawer-head strong{font-size:20px}.client-drawer-head span{font-size:13px;opacity:.78}
.client-menu-close{padding:0;width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.12);font-size:30px;line-height:1;color:#fff}
.client-drawer-user{display:flex;align-items:center;gap:13px;margin:18px 16px 10px;padding:14px;background:#fff;border:1px solid #dbe7e4;border-radius:15px}
.client-avatar{display:grid;place-items:center;width:44px;height:44px;flex:none;border-radius:50%;background:#dcefeb;color:#145e57;font-size:20px;font-weight:800}.client-drawer-user>div{display:flex;flex-direction:column}.client-drawer-user small{color:#687c7d}
.client-drawer-nav{display:flex;flex-direction:column;gap:6px;margin:0;padding:6px 12px 18px;overflow:visible}
.client-drawer-nav a{display:grid;grid-template-columns:38px minmax(0,1fr) 20px;align-items:center;gap:10px;width:100%;padding:12px 11px;border:0;border-radius:13px;background:transparent;color:#173c44;text-decoration:none}
.client-drawer-nav a:hover,.client-drawer-nav a.active{background:#e1f1ed;color:#145d53}.client-drawer-nav a>span:nth-child(2){display:flex;min-width:0;flex-direction:column}.client-drawer-nav strong{font-size:15px;line-height:1.25}.client-drawer-nav small{margin-top:3px;color:#6a7c7e;font-size:12px;line-height:1.3}.menu-icon{font-size:21px;text-align:center}.menu-chevron{font-size:25px;color:#78908f}
.client-drawer-foot{margin-top:auto;padding:15px 16px 22px;border-top:1px solid #dce7e4;background:#fff}.client-drawer-foot>a{display:flex;gap:9px;padding:10px 4px;color:#315a5d;text-decoration:none}.client-drawer-foot form{max-width:none;margin:6px 0 0}.client-drawer-foot button{width:100%;background:#e9efef;color:#173c44}
body.client-menu-is-open{overflow:hidden}
@media(max-width:600px){.client-menu-open{margin-left:0}.client-drawer{width:100vw}.client-drawer-head{padding-top:calc(20px + env(safe-area-inset-top,0px))}.client-drawer-nav{padding-left:10px;padding-right:10px}.client-drawer-nav a{padding:13px 10px}}

.learning-card{padding:20px;border:1px solid #cfe0dc;border-radius:16px;background:#f7fbfa}.learning-timer{font-size:clamp(34px,7vw,56px);font-weight:800;letter-spacing:.04em;color:#145d53;margin:18px 0}.new-chat-message{position:fixed;right:20px;bottom:110px;z-index:1100;box-shadow:0 6px 20px #173c4433}
.learning-consent{display:flex;gap:10px;align-items:flex-start;margin:18px 0;padding:14px;border:1px solid #cfe0dc;border-radius:12px;background:#fff}.learning-consent input{width:auto;margin-top:4px}.learning-enabled{padding:12px 14px;border-radius:12px;background:#e8f5f1;color:#145d53}.learning-card form+form{margin-top:12px}

/* V8: transparent live learning time and cost display inside customer chat. */
.chat-learning-live{position:sticky;top:10px;z-index:30;margin:0 0 18px;padding:14px 16px;border:1px solid #b9d9d0;border-radius:16px;background:rgba(240,249,246,.97);box-shadow:0 8px 24px #173c4414;backdrop-filter:blur(8px)}
.chat-learning-live>div:first-child{display:flex;flex-direction:column;gap:2px}.chat-learning-live>div:first-child strong{color:#145d53}.chat-learning-live>div:first-child small{color:#587275}
.chat-learning-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}.chat-learning-stats span{display:block;padding:9px 10px;border-radius:10px;background:#fff;border:1px solid #d9e8e4;font-size:13px}.chat-learning-stats strong{display:block;margin-top:2px;font-size:15px;color:#173c44}
.chat-learning-live form{display:inline-block;margin:0}.chat-learning-live form.learning-auto-pause{display:none}.chat-learning-live button{padding:9px 13px;font-size:14px}
@media(max-width:700px){.chat-learning-live{top:6px;padding:12px}.chat-learning-stats{grid-template-columns:1fr}.chat-learning-stats span{display:flex;justify-content:space-between;gap:10px;align-items:center}.chat-learning-stats strong{display:inline;margin:0;text-align:right}}

/* V9: menu trigger belongs on the right because the customer drawer opens from the right. */
.client-portal .client-menu-open{display:flex;width:max-content;margin:14px 0 4px auto;justify-content:center}
@media(max-width:600px){.client-portal .client-menu-open{margin-left:auto;margin-right:0}}


/* V11: Live-Selbstlernen im Chat kompakter in der Höhe, Breite unverändert. */
.client-learning-live,
.learning-live-bar,
.chat-learning-live {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    margin-top: 8px !important;
    margin-bottom: 10px !important;
    min-height: 0 !important;
    line-height: 1.25 !important;
}
.client-learning-live p,
.learning-live-bar p,
.chat-learning-live p {
    margin: 2px 0 !important;
    line-height: 1.25 !important;
}
.client-learning-live h3,
.learning-live-bar h3,
.chat-learning-live h3 {
    margin: 0 0 3px !important;
    line-height: 1.2 !important;
    font-size: 15px !important;
}
.client-learning-live form,
.learning-live-bar form,
.chat-learning-live form {
    margin: 3px 0 0 !important;
}
.client-learning-live button,
.learning-live-bar button,
.chat-learning-live button {
    min-height: 32px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
}
.client-learning-live .learning-timer,
.learning-live-bar .learning-timer,
.chat-learning-live .learning-timer {
    margin: 2px 0 !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
}
@media(max-width:600px){
    .client-learning-live,
    .learning-live-bar,
    .chat-learning-live {
        padding: 6px 9px !important;
    }
}


/* V12: paused self-learning is clearly yellow and non-chargeable. */
.chat-learning-paused,
.learning-paused-yellow{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 12px;
  margin:0 0 10px;
  border:1px solid #e2c45d;
  border-radius:12px;
  background:#fff4c7;
  color:#5a4710;
  line-height:1.25;
}
.chat-learning-paused>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.chat-learning-paused small{font-size:12px;color:#6b5719}
.chat-learning-paused form{margin:0;max-width:none;flex:none}
.chat-learning-paused button{min-height:32px;padding:6px 11px;font-size:13px;background:#8a6a08;color:#fff}
@media(max-width:600px){
  .chat-learning-paused{align-items:stretch;flex-direction:column;padding:7px 9px}
  .chat-learning-paused form,.chat-learning-paused button{width:100%}
}


/* V13: clean customer chat footer and stable scrolling. */
.customer-hidden-audio,.customer-process-button[hidden]{display:none!important}
.customer-voice-status:empty{display:none}
.client-portal{scroll-anchor:none}
.client-chat-stream{overflow-anchor:none}
.chat-learning-live.learning-paused-yellow{
  background:#fff4c7!important;
  border-color:#e2c45d!important;
  color:#5a4710!important;
}
.chat-learning-live.learning-paused-yellow small{color:#6b5719!important}
.menu-pause-note{display:block;margin:0 0 3px;font-weight:700}


/* V14: live values sit compactly at the lower-right of the full-width bar. */
.chat-learning-live{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-areas:"title stop" "stats stats"!important;
  align-items:center!important;
  column-gap:12px!important;
  row-gap:2px!important;
  padding:7px 11px!important;
}
.chat-learning-live>div:first-child{grid-area:title!important}
.chat-learning-live>.chat-learning-stats{
  grid-area:stats!important;
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:6px 14px!important;
  margin:0!important;
  text-align:right!important;
}
.chat-learning-live>.chat-learning-stats span{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  font-size:12px!important;
}
.chat-learning-live>.chat-learning-stats strong{
  display:inline!important;
  margin:0!important;
  font-size:13px!important;
}
.chat-learning-live>form:not(.learning-auto-pause){
  grid-area:stop!important;
  justify-self:end!important;
}
.chat-learning-live>form:not(.learning-auto-pause) button{
  min-height:30px!important;
  padding:5px 10px!important;
  font-size:12px!important;
}

/* Paused = yellow, stopped = neutral grey. */
.chat-learning-paused,.chat-learning-stopped{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:7px 11px;
  margin:0 0 10px;
  border-radius:12px;
  line-height:1.25;
}
.chat-learning-paused{border:1px solid #e2c45d;background:#fff4c7;color:#5a4710}
.chat-learning-stopped{border:1px solid #cfd9da;background:#f1f4f4;color:#42585c}
.chat-learning-paused>div:first-child,.chat-learning-stopped>div:first-child{display:flex;flex-direction:column;gap:2px}
.chat-learning-paused small{font-size:12px;color:#6b5719}
.chat-learning-stopped small{font-size:12px;color:#65777a}
.paused-learning-stats,.stopped-learning-stats{display:flex;gap:12px;white-space:nowrap;font-size:12px;font-weight:700;margin-left:auto}
.chat-learning-paused form{margin:0;max-width:none;flex:none}
.chat-learning-paused button{min-height:30px;padding:5px 10px;font-size:12px;background:#8a6a08;color:#fff}

@media(max-width:600px){
  .chat-learning-live>.chat-learning-stats{justify-content:flex-end!important;gap:5px 9px!important}
  .chat-learning-paused,.chat-learning-stopped{align-items:flex-start;flex-wrap:wrap}
  .paused-learning-stats,.stopped-learning-stats{margin-left:auto}
}


/* V15: learning-state legend lives inside the fixed customer chat footer. */
.customer-chat-dock{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:10px 16px!important;
}
.learning-status-legend{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  min-width:0;
  font-size:11px;
  line-height:1.15;
}
.learning-status-legend>span{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 7px;
  border:1px solid #d8e1e1;
  border-radius:999px;
  background:#f7f9f9;
  color:#617275;
  white-space:nowrap;
}
.learning-status-legend small{font-size:10px;color:inherit}
.customer-chat-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.customer-chat-actions button{margin:0;min-height:38px;padding:8px 13px}

/* Highlight the current learning state when one exists on the chat page. */
body:has(.chat-learning-live) .learning-status-legend .legend-active{
  background:#e4f4ec;border-color:#9fcdb7;color:#185c45;font-weight:700;
}
body:has(.chat-learning-paused) .learning-status-legend .legend-paused,
body:has(.learning-paused-yellow) .learning-status-legend .legend-paused{
  background:#fff1b8;border-color:#d9b84a;color:#604b08;font-weight:700;
}
body:has(.chat-learning-stopped) .learning-status-legend .legend-stopped{
  background:#e7ebeb;border-color:#aebabb;color:#344a4e;font-weight:700;
}

@media(max-width:720px){
  .customer-chat-dock{grid-template-columns:1fr!important;gap:6px!important}
  .learning-status-legend{justify-content:center;gap:4px;width:100%;overflow-x:auto}
  .learning-status-legend>span{padding:3px 5px;font-size:10px}
  .learning-status-legend small{display:none}
  .customer-chat-actions{width:100%;display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
  .customer-chat-actions button{width:100%;padding:8px 5px;font-size:13px}
}

/* V17: Lernzeit komplett in der festen Fußleiste; Chat-Tasten mittig. */
.customer-chat-dock{display:grid!important;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;grid-template-areas:"learning actions spacer"!important;align-items:center!important;gap:10px 18px!important}
.footer-learning-panel{grid-area:learning;justify-self:start;display:grid;gap:2px;padding:6px 9px;border:1px solid #aebabb;border-radius:10px;background:#e7ebeb;color:#344a4e;line-height:1.15}
.footer-learning-main{display:flex;align-items:baseline;gap:7px}.footer-learning-title{font-size:12px;white-space:nowrap}.footer-learning-note{font-size:10px;white-space:nowrap}.footer-learning-values{display:flex;gap:10px;flex-wrap:wrap;font-size:10px}.footer-learning-values strong{font-size:11px}.footer-learning-control form{margin:2px 0 0}.footer-learning-control button{min-height:29px!important;padding:4px 9px!important;font-size:11px!important}
.customer-chat-actions{grid-area:actions!important;justify-self:center!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important}.customer-chat-actions button{min-width:92px}.customer-chat-dock:after{content:"";grid-area:spacer}
.customer-chat-dock.learning-state-active .footer-learning-panel{background:#e4f4ec;border-color:#9fcdb7;color:#185c45}.customer-chat-dock.learning-state-paused .footer-learning-panel{background:#fff1b8;border-color:#d9b84a;color:#604b08}.customer-chat-dock.learning-state-stopped .footer-learning-panel{background:#e7ebeb;border-color:#aebabb;color:#344a4e}
@media(max-width:900px){.customer-chat-dock{grid-template-columns:1fr!important;grid-template-areas:"learning" "actions"!important;gap:6px!important}.footer-learning-panel{justify-self:stretch;width:100%}.footer-learning-main,.footer-learning-values,.footer-learning-control{justify-content:center;text-align:center}.customer-chat-actions{justify-self:center!important}.customer-chat-dock:after{display:none}}

/* V19: customer can explicitly choose Active / Pause / Stop in the footer. */
.footer-state-buttons{display:flex;align-items:center;gap:5px;margin-top:4px;flex-wrap:wrap}
.footer-state{min-height:27px!important;padding:3px 7px!important;border-radius:999px!important;font-size:10px!important;background:#f5f7f7!important;color:#536568!important;border:1px solid #ccd6d7!important}
.footer-state.current{font-weight:800!important;box-shadow:0 0 0 2px rgba(23,60,68,.10)}
.customer-chat-dock.learning-state-active .footer-state.active-state{background:#dff2e8!important;border-color:#8fc4a8!important;color:#15583f!important}
.customer-chat-dock.learning-state-paused .footer-state.paused-state{background:#fff0ae!important;border-color:#d3ae31!important;color:#5e4907!important}
.customer-chat-dock.learning-state-stopped .footer-state.stopped-state{background:#dfe5e5!important;border-color:#9caaac!important;color:#31464a!important}
@media(max-width:900px){.footer-state-buttons{justify-content:center}}

/* V20: text sending and voice sending are visually distinct. */
.customer-text-send-row{display:flex;justify-content:flex-end;margin:7px 0 2px}
.text-send-button{background:#173c44!important;border-color:#173c44!important;color:#fff!important;min-height:38px!important;padding:7px 14px!important}
.voice-speak-button{background:#2f7564!important;border-color:#2f7564!important;color:#fff!important}
.voice-stop-button{background:#a35f34!important;border-color:#a35f34!important;color:#fff!important}
.voice-send-button{background:#526ca5!important;border-color:#526ca5!important;color:#fff!important}
.unified-customer-form textarea[name="typed_original"]{border-color:#8eaeb4!important;background:#f8fbfc!important}

/* V20 final: make learning controls unmistakably clickable in footer. */
.footer-state-buttons{display:flex!important;gap:6px!important;align-items:center!important}
.footer-state-buttons .footer-state{cursor:pointer!important;min-width:66px!important}
.footer-state-buttons .footer-state:disabled{cursor:default!important;opacity:.48!important}
.footer-state-buttons .footer-state.current{opacity:1!important;font-weight:800!important}

/* V22: learning controls are buttons, not nested forms inside the chat composer. */
.footer-learning-control .footer-learning-action{min-height:29px!important;padding:4px 9px!important;font-size:11px!important}

/* V23: customer menu button belongs to the active portal window instead of floating fixed on screen. */
.client-portal{position:relative!important}
.client-menu-open{
  position:absolute!important;
  top:14px!important;
  right:16px!important;
  z-index:25!important;
}
@media(max-width:700px){
  .client-menu-open{top:10px!important;right:10px!important}
}

/* V24: clear billing hint in the footer. */
.footer-learning-advice{
  margin-top:4px;
  font-size:10px;
  line-height:1.2;
  font-weight:600;
  color:inherit;
  opacity:.9;
}

/* V24: menu stays visible while scrolling, but remains aligned to the active portal window.
   Sticky, not viewport-fixed. */
.client-portal{position:relative!important}
.client-menu-open{
  position:sticky!important;
  top:10px!important;
  right:auto!important;
  margin-left:auto!important;
  margin-right:12px!important;
  display:flex!important;
  width:max-content!important;
  z-index:80!important;
}
@media(max-width:700px){
  .client-menu-open{top:8px!important;margin-right:8px!important}
}

/* V25: billing explanation stays readable in footer. */
.footer-learning-advice{font-size:10px!important;font-weight:700!important;line-height:1.25!important}

/* V26: clear clickable learning controls */
.footer-state-buttons .footer-state:not(:disabled){cursor:pointer!important;opacity:1!important}
.footer-state-buttons .footer-state:disabled{cursor:not-allowed!important;opacity:.42!important}

/* V27: only the three main self-learning controls; larger touch targets. */
.footer-learning-control{display:none!important}
.footer-state-buttons{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(92px,1fr))!important;
  gap:9px!important;
  width:100%!important;
  margin-top:7px!important;
}
.footer-state-buttons .footer-state{
  min-height:44px!important;
  min-width:92px!important;
  padding:9px 14px!important;
  border-radius:10px!important;
  font-size:13px!important;
  font-weight:800!important;
  line-height:1.1!important;
}
.footer-state-buttons .active-state:not(:disabled){
  background:#dff2e8!important;border-color:#78b596!important;color:#12543c!important;
}
.footer-state-buttons .paused-state:not(:disabled){
  background:#fff0ae!important;border-color:#d0aa25!important;color:#5d4806!important;
}
.footer-state-buttons .stopped-state:not(:disabled){
  background:#e0e5e5!important;border-color:#929fa1!important;color:#304447!important;
}
@media(max-width:700px){
 .footer-state-buttons{grid-template-columns:repeat(3,1fr)!important;gap:6px!important}
 .footer-state-buttons .footer-state{min-width:0!important;padding:8px 5px!important;font-size:12px!important}
}

/* V28: make the active answer field visually obvious after each KI question. */
.unified-customer-form textarea[name="typed_original"]:focus{
  outline:2px solid rgba(23,60,68,.20)!important;
  outline-offset:1px!important;
}

/* V29 customer profile */
.profile-intro{background:#eef7f5;border:1px solid #d6e9e5;border-radius:14px;padding:14px 16px;margin-bottom:14px}
.profile-intro p{margin:6px 0 0;color:#53686c}
.profile-sections{display:grid;gap:14px}.profile-card{border:1px solid #d9e4e5;border-radius:14px;padding:16px;background:#fff}
.profile-card legend{font-weight:800;padding:0 7px;color:#173c44}.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}
.profile-card label{display:flex;flex-direction:column;gap:5px;font-weight:650}.profile-card input,.profile-card select,.profile-card textarea{width:100%;box-sizing:border-box}
.profile-help{margin:0 0 8px;color:#667a7d;font-size:13px}.profile-save{margin-top:14px}
@media(max-width:700px){.profile-grid{grid-template-columns:1fr}}

/* V30 modern compact profile */
.modern-profile{max-width:1120px;margin:0 auto}.modern-profile-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px}.modern-profile-head h2{margin:0;font-size:22px}.modern-profile-head p{margin:4px 0 0;color:#687b7e}
.modern-profile-bottom button{background:#087568!important;color:#fff!important;border-radius:9px!important;padding:9px 16px!important}.mp-card{background:#fff;border:1px solid #e0e8e9;border-radius:13px;padding:14px 16px;margin-bottom:11px;box-shadow:0 1px 3px rgba(20,55,60,.035)}.mp-card h3{font-size:15px;margin:0 0 11px;color:#173c44}.mp-muted{font-size:12px;color:#718285;margin:-5px 0 9px}
.mp-grid{display:grid;gap:9px 12px}.mp-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.mp-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mp-card label:not(.choice-pill):not(.select-chip){font-size:12px;font-weight:700;color:#52666a}.mp-card input,.mp-card select,.mp-card textarea{box-sizing:border-box;width:100%;margin-top:4px;border:1px solid #ccd8da;border-radius:8px;background:#fbfdfd;padding:8px 10px;min-height:36px}.mp-card textarea{resize:vertical}.mp-card small{font-weight:400;color:#849295}
.choice-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:11px}.choice-line>strong{font-size:12px;margin-right:5px}.choice-pill input,.select-chip input{position:absolute;opacity:0;pointer-events:none}.choice-pill span,.select-chip span{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cad7d8;background:#f8fbfb;border-radius:999px;padding:7px 12px;font-size:12px;font-weight:700;cursor:pointer}.choice-pill input:checked+span,.select-chip input:checked+span{background:#087568;color:#fff;border-color:#087568}.chip-set{display:flex;flex-wrap:wrap;gap:7px}.conditional{display:none;margin-top:11px}.conditional.show{display:block}.modern-profile-bottom{display:flex;justify-content:flex-end;margin:13px 0 20px}
@media(max-width:850px){.mp-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.mp-grid-3,.mp-grid-2{grid-template-columns:1fr}.modern-profile-head{align-items:flex-start}.profile-top-save{display:none}.mp-card{padding:13px}}

/* V31 FIX: approved compact profile layout */
.modern-profile{
  width:100%!important;
  max-width:1120px!important;
  margin:0 auto!important;
  box-sizing:border-box!important;
}
.modern-profile .modern-profile-head{
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  height:auto!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
  margin:0 0 14px!important;
  padding:14px 16px!important;
  background:#fff!important;
  color:#173c44!important;
  border:1px solid #e0e8e9!important;
  border-radius:13px!important;
  box-shadow:0 1px 3px rgba(20,55,60,.035)!important;
}
.modern-profile .modern-profile-head>div{
  width:auto!important;
  max-width:none!important;
  flex:1 1 auto!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
}
.modern-profile .modern-profile-head h2{
  display:block!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
  color:#173c44!important;
  font-size:21px!important;
  line-height:1.25!important;
  white-space:nowrap!important;
}
.modern-profile .modern-profile-head p{
  display:block!important;
  width:auto!important;
  max-width:none!important;
  margin:4px 0 0!important;
  padding:0!important;
  color:#687b7e!important;
  font-size:13px!important;
  line-height:1.4!important;
}
.modern-profile .profile-top-save{
  position:static!important;
  float:none!important;
  flex:0 0 auto!important;
  width:auto!important;
  min-width:120px!important;
  height:auto!important;
  margin:0!important;
  padding:9px 16px!important;
  background:#087568!important;
  color:#fff!important;
  border:0!important;
  border-radius:9px!important;
  line-height:1.25!important;
}
.modern-profile .mp-card{
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
}
.modern-profile .mp-grid-3{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
.modern-profile .mp-grid-2{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
@media(max-width:850px){
 .modern-profile .mp-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:600px){
 .modern-profile .modern-profile-head{align-items:flex-start!important;padding:13px!important}
 .modern-profile .modern-profile-head h2{white-space:normal!important}
 .modern-profile .profile-top-save{display:none!important}
 .modern-profile .mp-grid-3,.modern-profile .mp-grid-2{grid-template-columns:1fr!important}
}

/* V33 Delikte & Geschichte */
.delikt-intro{margin-bottom:12px}.delikt-intro h2{margin:0 0 5px;font-size:21px}.delikt-intro p{margin:0;color:#617579}
.delikt-upload-card,.delikt-explain-card{background:#fff;border:1px solid #dce6e7;border-radius:13px;padding:14px 16px;margin-bottom:11px}
.delikt-upload-card h3,.delikt-explain-card h3{margin:0 0 6px;font-size:15px}.delikt-upload-card p,.delikt-explain-card p{font-size:13px;color:#64777a}
.delikt-upload-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.delikt-upload-form>small{width:100%;color:#7a898b}
.delikt-file-picker{position:relative;overflow:hidden;display:inline-flex!important;align-items:center!important;background:#f4f8f8;border:1px solid #cbd8da;border-radius:8px;padding:8px 12px!important;font-weight:700!important;cursor:pointer}
.delikt-file-picker input{position:absolute;inset:0;opacity:0;cursor:pointer}.delikt-file-list{margin-top:12px;border-top:1px solid #edf1f2;padding-top:9px}
.delikt-file-list>div{display:flex;gap:8px;align-items:center;padding:6px 0;font-size:13px}.delikt-file-list>div span{flex:1}.delikt-file-list small{color:#809093}
.story-form:not(.customer-chat-form) textarea[name="typed_original"]{min-height:150px!important;max-height:260px!important}
.delikt-save-button{background:#087568!important;color:#fff!important;font-weight:800!important}
@media(max-width:600px){.delikt-upload-form{align-items:stretch}.delikt-upload-form button,.delikt-file-picker{width:100%;justify-content:center}}

/* V34 Meine Lernunterlagen: freigegebenes, schreibgeschütztes Lernarchiv */
.learning-archive-head{margin-bottom:14px}.learning-archive-head h2{margin:0 0 5px;font-size:21px}.learning-archive-head p{margin:0;color:#617579;max-width:850px}
.learning-empty{background:#fff;border:1px dashed #cbd9da;border-radius:12px;padding:18px;color:#6a7d80}
.learning-archive-card{background:#fff;border:1px solid #dce6e7;border-radius:13px;padding:14px 16px;margin-bottom:11px}
.learning-card-top{display:flex;justify-content:space-between;align-items:center;gap:14px}.learning-card-top h3{margin:5px 0 2px;font-size:16px}.learning-card-top small{color:#7a898b}
.learning-badge{font-size:10px;font-weight:800;letter-spacing:.05em;background:#e8f6ef;color:#187148;border-radius:999px;padding:4px 8px}
.learning-actions{display:flex;gap:7px;flex-wrap:wrap}.learning-actions button{white-space:nowrap}
.learning-document{border-top:1px solid #e8eeee;margin-top:13px;padding-top:13px}.learning-print-title{display:flex;flex-direction:column;margin-bottom:12px}.learning-print-title strong{font-size:18px}.learning-print-title span{color:#64777a;margin-top:3px}
.learning-text{white-space:normal;line-height:1.55;color:#263f44}
@media(max-width:650px){.learning-card-top{align-items:flex-start;flex-direction:column}.learning-actions{width:100%}.learning-actions button{flex:1}}
@media print{
 body *{visibility:hidden!important}
 .learning-archive-card.print-this,.learning-archive-card.print-this *{visibility:visible!important}
 .learning-archive-card.print-this{position:absolute!important;left:0!important;top:0!important;width:100%!important;border:0!important;box-shadow:none!important;padding:0!important}
 .learning-archive-card.print-this .learning-card-top{display:none!important}
 .learning-archive-card.print-this .learning-document{display:block!important;border:0!important;margin:0!important;padding:0!important}
}

/* V35 Meine Termine: reine Terminanfrage ohne Öffnungs-/Slotzeiten */
.appointments-head{margin-bottom:14px}.appointments-head h2{margin:0 0 5px;font-size:21px}.appointments-head p{margin:0;color:#64777a}
.next-appointment{display:flex;gap:14px;align-items:center;background:#fff;border:1px solid #dce6e7;border-radius:14px;padding:16px;margin-bottom:12px}.next-appointment.has-confirmed{border-left:4px solid #23865f}.appointment-icon{font-size:26px}.appointment-label{font-size:10px;font-weight:800;letter-spacing:.07em;color:#6b7e81}.next-appointment h3{margin:3px 0;font-size:18px}.next-appointment p{margin:0;color:#617579}.status-confirmed{color:#187148}
.pending-appointments,.appointment-request{background:#fff;border:1px solid #dce6e7;border-radius:14px;padding:16px;margin-bottom:12px}.pending-appointments h3,.appointment-request h3{margin:0 0 9px}.pending-item{display:flex;flex-direction:column;gap:3px;border-top:1px solid #edf1f2;padding:9px 0}.pending-item:first-of-type{border-top:0}.pending-item span,.pending-item small{color:#66797c}
.appointment-request-title{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:14px}.appointment-request-title p{margin:3px 0 0;color:#687b7e}.price-card{display:flex;flex-direction:column;background:#eef7f5;border-radius:10px;padding:10px 12px;min-width:220px}.price-card span{font-size:13px;margin-top:2px}.price-card small{color:#687b7e;margin-top:2px}
.wish-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.wish-card{border:1px solid #dbe5e6;border-radius:11px;padding:11px;background:#fbfdfd}.wish-card>strong{display:block;margin-bottom:8px}.wish-card label{display:block;font-size:12px;font-weight:700;margin-top:7px}.wish-card input{width:100%;box-sizing:border-box;margin-top:4px;padding:8px;border:1px solid #ccd8da;border-radius:8px;background:#fff}.wish-card small{font-weight:400;color:#829093}
.appointment-mode{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:14px 0}.appointment-mode>strong{font-size:13px;margin-right:5px}.appointment-message{display:block;font-size:13px;font-weight:700}.appointment-message small{font-weight:400;color:#829093}.appointment-message textarea{width:100%;box-sizing:border-box;margin-top:5px;border:1px solid #ccd8da;border-radius:9px;padding:9px}.request-notice{background:#fff8df;border:1px solid #efdf9c;border-radius:9px;padding:10px 12px;margin:12px 0;font-size:13px}
@media(max-width:800px){.wish-grid{grid-template-columns:1fr}.appointment-request-title{flex-direction:column}.price-card{min-width:0;width:100%;box-sizing:border-box}}

/* V36 Berater-Dashboard: Selbstlernen */
.advisor-learning-overview{background:#fff;border:1px solid #dce6e7;border-radius:14px;padding:14px 16px;margin-bottom:12px}
.advisor-learning-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.advisor-learning-head h3{margin:0;font-size:16px}.advisor-learning-head p{margin:3px 0 0;color:#6a7d80;font-size:12px}
.learning-status-summary{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px}.learning-status-summary>span{border:1px solid #dce6e7;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:700}.ls-active{background:#edf8f2}.ls-paused{background:#fff8df}.ls-stopped{background:#f4f6f6}
.advisor-learning-details{margin-top:13px;border-top:1px solid #e8eeee;padding-top:10px;overflow:auto}.advisor-learning-table{min-width:780px}.alt-row{display:grid;grid-template-columns:1.35fr 1.15fr .8fr .8fr .8fr 1.2fr;gap:10px;padding:9px 6px;border-bottom:1px solid #edf1f2;align-items:center;font-size:12px}.alt-head{font-weight:800;color:#52666a;background:#f7fafa;border-radius:8px}
@media(max-width:650px){.advisor-learning-head{align-items:flex-start;flex-direction:column}.advisor-learning-toggle{width:100%}}

/* V37 Punkt 4: Chat bleibt bedienbar, nur Verlauf scrollt */
.client-chat-stream{max-height:48vh!important;overflow-y:auto!important;scroll-behavior:smooth;padding-bottom:8px}
.unified-customer-form{position:sticky!important;bottom:0!important;z-index:35;background:#fff;border-top:1px solid #dce6e7;padding-top:8px}
.chat-day-separator{display:flex;align-items:center;justify-content:center;margin:10px 0}.chat-day-separator span{background:#eef3f3;color:#607477;border-radius:999px;padding:4px 10px;font-size:11px;font-weight:800}
.chat-language-badge{background:#eef7f5;border:1px solid #d3e5e1;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}
.advisor-translation{margin-top:6px;font-size:12px}.advisor-translation summary{cursor:pointer;color:#52666a}
.learning-status-summary .learning-filter{border:1px solid #dce6e7;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:700;cursor:pointer;color:#263f44}.learning-filter.selected{outline:2px solid #087568}

/* V37 Abrechnung */
.billing-head h2{margin:0 0 5px}.billing-head p{margin:0 0 12px;color:#65787b}
.billing-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px}.billing-summary>div{background:#fff;border:1px solid #dce6e7;border-radius:12px;padding:13px}.billing-summary span{display:block;font-size:11px;color:#718285}.billing-summary strong{display:block;font-size:20px;margin-top:4px}.billing-summary .threshold-reached{border-color:#d9b94f;background:#fff9e7}
.invoice-alert{background:#fff4c9;border:1px solid #e7ce6a;border-radius:10px;padding:11px 13px;margin-bottom:12px}
.billing-card{background:#fff;border:1px solid #dce6e7;border-radius:13px;padding:14px 16px;margin-bottom:11px}.billing-card h3{margin:0 0 7px}.billing-card p{color:#607477}
.billing-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.billing-card label{font-size:12px;font-weight:700}.billing-card input{width:100%;box-sizing:border-box;margin-top:4px;border:1px solid #ccd8da;border-radius:8px;padding:8px}
.invoice-row{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;border-top:1px solid #edf1f2;padding:10px 0}.invoice-row:first-of-type{border-top:0}.invoice-row small{display:block;color:#77888a;margin-top:2px}
.invoice-detail{border:1px solid #dce6e7;border-radius:10px;padding:16px;margin:0 0 12px;background:#fcfefe}.invoice-item{display:flex;justify-content:space-between;gap:12px;border-top:1px solid #edf1f2;padding:9px 0}.invoice-item small{display:block;color:#758689}.invoice-total{display:flex;justify-content:space-between;font-size:18px;border-top:2px solid #52666a;padding-top:10px;margin-top:8px}
@media(max-width:700px){.billing-summary,.billing-grid{grid-template-columns:1fr}.invoice-row{grid-template-columns:1fr auto}.invoice-row button{grid-column:1/-1}}
@media print{body.invoice-print-mode *{visibility:hidden!important}body.invoice-print-mode .invoice-detail.print-this,body.invoice-print-mode .invoice-detail.print-this *{visibility:visible!important}body.invoice-print-mode .invoice-detail.print-this{position:absolute;left:0;top:0;width:100%;border:0}}

/* V38 Kunden-Rechnungen: Lernzeit nach Datum und Thema */
.learning-cost-toggle{margin:0 0 12px}
.learning-cost-detail{background:#fff;border:1px solid #dce6e7;border-radius:13px;padding:14px 16px;margin-bottom:12px}
.learning-cost-head h3{margin:0 0 4px}.learning-cost-head p{margin:0 0 10px;color:#687b7e;font-size:12px}
.learning-cost-table{overflow:auto;min-width:0}.lct-row{display:grid;grid-template-columns:1fr 1.5fr 1fr 1fr 1.5fr;gap:10px;align-items:center;padding:9px 7px;border-bottom:1px solid #edf1f2;font-size:12px;min-width:680px}
.lct-head{font-weight:800;background:#f5f9f9;border-radius:8px;color:#52666a}.lct-total{font-weight:800;border-top:2px solid #b8c7c9;border-bottom:0}
@media(max-width:700px){.learning-cost-toggle{width:100%}}

/* V39 Fix: Lernzeit-Übersicht ohne JavaScript-Abhängigkeit */
.learning-cost-details{margin:0 0 12px}
.learning-cost-details>summary{display:inline-flex;align-items:center;gap:6px;cursor:pointer;list-style:none;background:#f3f7f7;border:1px solid #cbd9db;border-radius:9px;padding:9px 13px;font-weight:800;color:#173f44;user-select:none}
.learning-cost-details>summary::-webkit-details-marker{display:none}
.learning-cost-details[open]>summary{margin-bottom:10px;background:#e9f4f2;border-color:#9fc7c0}
.learning-cost-details[open]>summary::after{content:"  ▲"}
.learning-cost-details:not([open])>summary::after{content:"  ▼"}
@media(max-width:700px){.learning-cost-details>summary{display:flex;width:100%;box-sizing:border-box;justify-content:center}}

/* V40 Chat: nur 10 aktuelle Nachrichten offen; ältere nach Datum + Stunde eingeklappt */
.chat-archive{margin-bottom:12px}.chat-archive-title,.chat-recent-title{font-size:11px;font-weight:800;letter-spacing:.04em;color:#607477;margin:8px 2px}
.chat-hour-group{border:1px solid #dce6e7;border-radius:10px;background:#f8fbfb;margin:6px 0;overflow:hidden}
.chat-hour-group>summary{display:flex;justify-content:space-between;align-items:center;gap:12px;cursor:pointer;padding:9px 11px;list-style:none;font-size:12px;color:#344e52}
.chat-hour-group>summary::-webkit-details-marker{display:none}.chat-hour-group>summary strong{font-size:11px;color:#6b7d80;white-space:nowrap}
.chat-hour-group[open]>summary{border-bottom:1px solid #e2eaeb;background:#eef5f4}.chat-hour-messages{padding:8px}

/* V41 Chatarchiv: Jahr > Monat > Woche > Datum/Stunde */
.chat-year-group,.chat-month-group,.chat-week-group{border:1px solid #dce6e7;border-radius:10px;margin:7px 0;background:#fff;overflow:hidden}
.chat-year-group>summary,.chat-month-group>summary,.chat-week-group>summary{display:flex;justify-content:space-between;align-items:center;gap:12px;cursor:pointer;list-style:none;padding:10px 12px;font-size:12px}
.chat-year-group>summary::-webkit-details-marker,.chat-month-group>summary::-webkit-details-marker,.chat-week-group>summary::-webkit-details-marker{display:none}
.chat-year-group>summary{font-size:13px;font-weight:800;background:#eef5f4}
.chat-month-group>summary{font-weight:800;background:#f6f9f9}
.chat-week-group>summary{font-weight:700;background:#fbfcfc}
.chat-year-group summary strong,.chat-month-group summary strong,.chat-week-group summary strong{font-size:11px;color:#6c7e81;white-space:nowrap}
.chat-year-content{padding:7px 9px}.chat-month-content{padding:6px 9px}.chat-week-content{padding:5px 8px}
.chat-year-group[open]>summary,.chat-month-group[open]>summary,.chat-week-group[open]>summary{border-bottom:1px solid #dfe8e9}

/* V42 Lernzeit-Übersicht: bleibt offen, solange Kunde sie nicht selbst schließt */
.learning-cost-wrap{margin:0 0 12px}
.learning-cost-open{margin-bottom:10px}
.persistent-learning-panel{position:relative;background:#fff;border:1px solid #cbd9db;border-radius:13px;padding:0 16px 14px;margin-bottom:12px;box-shadow:0 8px 24px rgba(28,58,63,.08)}
.learning-cost-panelbar{position:sticky;top:0;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#eef7f5;border-bottom:1px solid #d5e4e1;margin:0 -16px 10px;padding:10px 14px;border-radius:13px 13px 0 0}
.learning-cost-close{border:0;background:#fff;border-radius:999px;width:30px;height:30px;cursor:pointer;font-size:15px;box-shadow:0 0 0 1px #ccd9da}
.learning-cost-close:hover{background:#f1f5f5}
.persistent-learning-panel[hidden]{display:none!important}
.persistent-learning-panel:not([hidden]){display:block!important}
.learning-cost-wrap.is-open>.learning-cost-open{display:none}
@media(max-width:700px){.learning-cost-open{width:100%}}

/* V44: stabile Hover-Zone für Lernzeit-Übersicht */
.learning-cost-wrap{position:relative;padding-bottom:2px}
.learning-cost-wrap.is-open{padding-top:1px}
.learning-cost-wrap.is-open .persistent-learning-panel{margin-top:0}

/* V45: Öffnen-Button bleibt stehen, damit sich die Hover-Fläche beim Klick nicht verschiebt */
.learning-cost-wrap.is-open>.learning-cost-open{display:inline-flex!important}
.learning-cost-wrap.is-open>.learning-cost-open{background:#e9f4f2;border-color:#9fc7c0}
.persistent-learning-panel{margin-top:8px!important}

/* V47: Panelzustand bleibt auch bei automatischem Seiten-Refresh erhalten */
.persistent-learning-panel{pointer-events:auto!important}
.learning-cost-wrap.is-open .persistent-learning-panel{display:block!important}

/* V48 Chatarchiv: kompakt, keine Leerflächen aus globalen details-Regeln */
.chat-archive details.chat-year-group,
.chat-archive details.chat-month-group,
.chat-archive details.chat-week-group,
.chat-archive details.chat-hour-group{
  padding:0!important;
  margin:4px 0!important;
  border-radius:9px!important;
  min-height:0!important;
  height:auto!important;
}
.chat-archive details:not([open]) > :not(summary){
  display:none!important;
}
.chat-archive details > summary{
  margin:0!important;
  min-height:0!important;
  line-height:1.25!important;
}
.chat-year-group>summary{padding:9px 11px!important}
.chat-month-group>summary{padding:8px 11px!important}
.chat-week-group>summary{padding:8px 11px!important}
.chat-hour-group>summary{padding:7px 10px!important}
.chat-year-content,.chat-month-content,.chat-week-content,.chat-hour-messages{
  margin:0!important;
  min-height:0!important;
}
.chat-year-content{padding:4px 7px!important}
.chat-month-content{padding:4px 7px!important}
.chat-week-content{padding:3px 6px!important}
.chat-hour-messages{padding:6px!important}
.chat-archive-title{margin:6px 2px!important}

/* V49 Lernzeit: gesamte sichtbare Übersicht ist eine stabile Hover-Zone */
.persistent-learning-panel,
.persistent-learning-panel *{pointer-events:auto}

/* V50 Chatarchiv: keinerlei Leerraum zwischen Monaten/Wochen */
.chat-archive{display:block!important;min-height:0!important;height:auto!important}
.chat-archive .chat-year-content,
.chat-archive .chat-month-content,
.chat-archive .chat-week-content{
  display:block!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
}
.chat-archive details:not([open])>.chat-year-content,
.chat-archive details:not([open])>.chat-month-content,
.chat-archive details:not([open])>.chat-week-content,
.chat-archive details:not([open])>.chat-hour-messages{
  display:none!important;
  height:0!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  overflow:hidden!important;
}
.chat-archive details{box-sizing:border-box!important}
.chat-archive details+details{margin-top:4px!important}
.chat-archive summary{box-sizing:border-box!important}
.chat-archive .chat-year-group>summary,
.chat-archive .chat-month-group>summary,
.chat-archive .chat-week-group>summary,
.chat-archive .chat-hour-group>summary{
  min-height:36px!important;
  height:auto!important;
}
.chat-archive summary span{min-width:0}
.chat-archive summary strong{margin-left:auto}

/* V51: X ist die einzige Schließen-Funktion im Chatarchiv */
.chat-archive-x{
  display:none;
  flex:0 0 auto;
  width:27px;height:27px;
  align-items:center;justify-content:center;
  border:1px solid #cad8da;
  border-radius:50%;
  background:#fff;
  color:#536b6f;
  cursor:pointer;
  font-size:13px;
  line-height:1;
  padding:0;
}
.chat-archive details[open] > summary > .chat-archive-x{display:inline-flex}
.chat-archive-x:hover{background:#f1f5f5;color:#173f44}
.chat-archive summary strong{margin-left:auto!important}

/* V53 endgültig: kleines, ruhiges X */
.chat-archive-x{
 display:none!important;width:16px!important;height:16px!important;min-width:16px!important;min-height:16px!important;
 flex:0 0 16px!important;padding:0!important;margin-left:5px!important;border:0!important;border-radius:50%!important;
 background:transparent!important;box-shadow:none!important;color:#809093!important;font-size:10px!important;font-weight:700!important;
 line-height:16px!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;
}
.chat-archive details[open]>summary>.chat-archive-x{display:inline-flex!important}
.chat-archive-x:hover,.chat-archive-x:focus{background:#e8eeee!important;color:#173f44!important;outline:none!important}

/* V54 Kundenchat: Eingabebereich bleibt IMMER unten sichtbar */
body:has([data-auto-chat="1"]) .customer-chat-composer,
body:has([data-auto-chat="1"]) form:has(textarea[name="chat_text"]),
body:has([data-auto-chat="1"]) form:has(textarea[name="message"]),
body:has([data-auto-chat="1"]) form:has(textarea[placeholder*="Deine Nachricht"]){
  position:fixed!important;
  left:50%!important;
  transform:translateX(-50%)!important;
  bottom:112px!important;
  z-index:980!important;
  width:min(840px,calc(100vw - 32px))!important;
  margin:0!important;
  padding:10px!important;
  box-sizing:border-box!important;
  background:rgba(255,255,255,.98)!important;
  border:1px solid #d7e2e4!important;
  border-radius:14px!important;
  box-shadow:0 -5px 20px rgba(24,55,60,.10)!important;
}
body:has([data-auto-chat="1"]){
  padding-bottom:245px!important;
}
body:has([data-auto-chat="1"]) [data-auto-chat="1"]{
  padding-bottom:18px!important;
}
@media(max-width:700px){
 body:has([data-auto-chat="1"]) .customer-chat-composer,
 body:has([data-auto-chat="1"]) form:has(textarea[name="chat_text"]),
 body:has([data-auto-chat="1"]) form:has(textarea[name="message"]),
 body:has([data-auto-chat="1"]) form:has(textarea[placeholder*="Deine Nachricht"]){
   left:8px!important;right:8px!important;transform:none!important;width:auto!important;
   bottom:128px!important;
 }
 body:has([data-auto-chat="1"]){padding-bottom:275px!important}
}

/* V55: Nachrichtenfeld gehört fest zum normalen Seitenaufbau UNTER den Chat, nicht zum Viewport */
body:has([data-auto-chat="1"]) .customer-chat-composer,
body:has([data-auto-chat="1"]) form:has(textarea[name="chat_text"]),
body:has([data-auto-chat="1"]) form:has(textarea[name="message"]),
body:has([data-auto-chat="1"]) form:has(textarea[placeholder*="Deine Nachricht"]){
  position:static!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  top:auto!important;
  transform:none!important;
  width:100%!important;
  max-width:none!important;
  margin:10px 0 0!important;
  padding:10px!important;
  box-sizing:border-box!important;
  background:#fff!important;
  border:1px solid #d7e2e4!important;
  border-radius:14px!important;
  box-shadow:none!important;
}
body:has([data-auto-chat="1"]){padding-bottom:125px!important}
body:has([data-auto-chat="1"]) [data-auto-chat="1"]{padding-bottom:0!important;margin-bottom:0!important}
@media(max-width:700px){
 body:has([data-auto-chat="1"]) .customer-chat-composer,
 body:has([data-auto-chat="1"]) form:has(textarea[name="chat_text"]),
 body:has([data-auto-chat="1"]) form:has(textarea[name="message"]),
 body:has([data-auto-chat="1"]) form:has(textarea[placeholder*="Deine Nachricht"]){
   position:static!important;left:auto!important;right:auto!important;bottom:auto!important;
   transform:none!important;width:100%!important;margin-top:10px!important;
 }
 body:has([data-auto-chat="1"]){padding-bottom:140px!important}
}

/* V56: Eingabe gehört UNTER das aktive Chatfenster, nicht IN dessen Scrollfläche */
.customer-chat-composer.composer-outside-scroll{
 position:static!important;
 inset:auto!important;
 left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
 transform:none!important;
 display:block!important;
 width:100%!important;
 max-width:none!important;
 margin:12px 0 0!important;
 padding:12px 0 0!important;
 background:transparent!important;
 border:0!important;
 border-top:1px solid #dbe4e6!important;
 border-radius:0!important;
 box-shadow:none!important;
 z-index:auto!important;
}
.customer-chat-composer.composer-outside-scroll textarea{
 width:100%!important;
 min-height:130px!important;
 max-height:220px!important;
 box-sizing:border-box!important;
}

/* V57: Eingabe ist KEIN Bestandteil des aktiven Chatfensters */
.customer-chat-composer.composer-outside-scroll{
 position:relative!important;
 inset:auto!important;
 left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
 transform:none!important;
 width:100%!important;
 margin:14px 0 0!important;
 padding:14px 0 0!important;
 z-index:1!important;
 background:#fff!important;
 border:0!important;
 border-top:1px solid #dbe4e6!important;
 border-radius:0!important;
 box-shadow:none!important;
 overflow:visible!important;
}
.customer-chat-composer.composer-outside-scroll textarea{
 display:block!important;
 width:100%!important;
 min-height:150px!important;
 max-height:220px!important;
 box-sizing:border-box!important;
}

/* V58: der gesamte Archiv-Balken ist klickbar */
.chat-archive details[data-archive-key] > summary{
 cursor:pointer!important;
 user-select:none;
}
.chat-archive details[data-archive-key] > summary:hover{
 background:#edf3f3!important;
}

/* V59 Administration – aktive Kunden im Selbstlernen */
.admin-active-learning{position:relative;margin:12px 0}
.active-learning-count{display:inline-flex;align-items:center;gap:8px;padding:9px 13px;border:1px solid #b8d8ce;border-radius:11px;background:#edf8f3;color:#164f45;cursor:pointer}
.active-dot{width:9px;height:9px;border-radius:50%;background:#22a447;box-shadow:0 0 0 3px rgba(34,164,71,.12);flex:0 0 auto}
.active-learning-chevron{font-size:12px;margin-left:2px}
.active-learning-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:1200;width:min(760px,calc(100vw - 40px));background:#fff;border:1px solid #d9e4e4;border-radius:14px;box-shadow:0 14px 35px rgba(20,55,60,.16);padding:14px}
.active-learning-head{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 10px;border-bottom:1px solid #e6eded}
.active-learning-head div{display:flex;flex-direction:column;gap:2px}.active-learning-head small,.active-learning-row small{color:#718184}
.active-learning-close{width:24px;height:24px;border:0;border-radius:50%;background:transparent;cursor:pointer;color:#687a7d}.active-learning-close:hover{background:#edf2f2}
.active-learning-list{display:flex;flex-direction:column;gap:7px;padding-top:10px}
.active-learning-row{display:grid;grid-template-columns:minmax(190px,1.5fr) 1fr 1fr .7fr;gap:12px;align-items:center;padding:10px;border:1px solid #e2eaea;border-radius:10px}
.active-learning-row>div{display:flex;flex-direction:column;gap:2px}.active-learning-person{flex-direction:row!important;align-items:center;gap:9px!important}
.active-learning-empty{padding:18px 6px;color:#66777a}
@media(max-width:720px){.active-learning-panel{position:fixed;left:12px;right:12px;top:90px;width:auto}.active-learning-row{grid-template-columns:1fr 1fr}.active-learning-person{grid-column:1/-1}}

/* V60 Meine Lernunterlagen */
.learning-archive-head{margin-bottom:14px}.learning-archive-head h2{margin-bottom:5px}.learning-archive-head p{max-width:850px;color:#65777a}
.learning-topic-filters{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 16px}
.learning-filter{border:1px solid #d5e0e1;background:#fff;color:#496064;border-radius:999px;padding:7px 11px;cursor:pointer;font-size:12px}
.learning-filter.active,.learning-filter:hover{background:#eaf5f2;border-color:#9fc9bf;color:#174e45}
.learning-archive-list{display:flex;flex-direction:column;gap:10px}
.learning-archive-card{border:1px solid #dce5e6;border-radius:13px;background:#fff;padding:13px 15px}
.learning-card-top{display:flex;justify-content:space-between;align-items:center;gap:14px}.learning-card-info h3{margin:5px 0 2px}.learning-card-info small{color:#748386}
.learning-badge,.learning-topic-pill{display:inline-flex;border-radius:999px;padding:3px 7px;font-size:10px;font-weight:800;margin-right:5px}
.learning-badge{background:#e8f5ed;color:#267144}.learning-topic-pill{background:#eef3f4;color:#50676b}
.learning-actions{display:flex;gap:7px;flex-wrap:wrap}.learning-document{margin-top:13px;padding:16px;border-top:1px solid #e2e9ea;background:#fbfcfc;border-radius:0 0 10px 10px}
.learning-print-title{display:flex;flex-direction:column;gap:3px;margin-bottom:13px}.learning-text{line-height:1.6}
.learning-empty{padding:22px;border:1px dashed #ccd9db;border-radius:12px;color:#687a7d;background:#fafcfc}
@media(max-width:700px){.learning-card-top{align-items:flex-start;flex-direction:column}.learning-actions{width:100%}.learning-actions button{flex:1}}

/* V61 MPU-Themen – vollständige OS-Master-Struktur */
select[name="topic"]{min-height:44px}
select[name="topic"] optgroup{font-weight:800}
select[name="topic"] option{font-weight:400;padding:4px}

/* V62 Selbstlernen – vollständige MPU-Themenauswahl */
.self-topic-picker{margin:12px 0;padding:12px;border:1px solid #d8e4e4;border-radius:12px;background:#fbfdfd}
.self-topic-picker label{display:flex;flex-direction:column;gap:7px}
.self-topic-picker select{width:100%;min-height:46px;border:1px solid #cbd9db;border-radius:9px;padding:8px 10px;background:#fff}
.self-topic-picker optgroup{font-weight:800}.self-topic-picker option{font-weight:400}
.self-topic-picker small{display:block;margin-top:7px;color:#6c7e81;line-height:1.4}

/* V63 – eigener Kunden-Menüpunkt Lernthema auswählen */
.topic-hub{max-width:900px}.topic-hub>header{margin-bottom:16px}.topic-hub>header h2{margin-bottom:4px}.topic-hub>header p{color:#65777a}
.topic-notice,.current-learning-topic,.topic-start-card{border:1px solid #d7e3e4;border-radius:14px;padding:16px;background:#fbfdfd;margin-bottom:15px}
.topic-notice{display:flex;flex-direction:column;gap:7px}.topic-notice a,.button-like{display:inline-flex;width:max-content;text-decoration:none;background:#174e53;color:#fff;padding:9px 13px;border-radius:9px}
.current-learning-topic{border-left:4px solid #d3ad2f}.current-learning-topic>small,.current-learning-topic>strong,.current-learning-topic>span{display:block}.current-learning-topic>strong{font-size:20px;margin:3px 0}.current-learning-topic>span{color:#6b7b7e}
.topic-current-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:12px 0 7px}.topic-current-actions form{margin:0}
.topic-overview{margin-top:18px}.topic-group{border:1px solid #dbe5e6;border-radius:11px;margin:7px 0;background:#fff;overflow:hidden}.topic-group summary{cursor:pointer;padding:12px 14px;font-weight:800;display:flex;justify-content:space-between;gap:10px}.topic-group summary span{font-size:11px;color:#758487}.topic-group-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:0 12px 12px}.topic-group-items>div{padding:9px 10px;background:#f5f8f8;border-radius:8px;font-size:13px}
@media(max-width:650px){.topic-group-items{grid-template-columns:1fr}}

/* V64 Lernthema direkt im Kunden-Chat */
.chat-topic-box{margin:0 0 14px;border:1px solid #d8e3e4;border-radius:13px;background:#fbfdfd;padding:12px 14px}
.chat-topic-box-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:9px}
.chat-topic-box-head>div{display:flex;flex-direction:column;gap:2px}.chat-topic-box-head small{color:#6d7d80}
.chat-topic-box-head>a,.chat-topic-actions a,.chat-topic-disabled a{font-size:12px;text-decoration:none;color:#176b61;font-weight:700}
.chat-current-topic{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#f2f7f6;border-radius:10px;padding:10px 12px}
.chat-current-topic>div:first-child{display:flex;flex-direction:column}.chat-current-topic small,.chat-current-topic span{font-size:11px;color:#718184}.chat-current-topic strong{font-size:16px;margin:2px 0}
.chat-topic-disabled{display:flex;justify-content:space-between;gap:10px;background:#fff8df;padding:10px;border-radius:9px}
.chat-topic-start>strong{display:block;margin-bottom:7px}.chat-topic-start .self-topic-picker{margin:6px 0}.chat-topic-start form{margin:0}
@media(max-width:650px){.chat-topic-box-head,.chat-current-topic,.chat-topic-disabled{align-items:flex-start;flex-direction:column}}

/* V65: Themenbereich kompakt statt riesiger Hero-Kachel */
.topic-hub>header{
  margin:0 0 14px!important;padding:14px 16px!important;min-height:0!important;height:auto!important;
  background:#17484e!important;border-radius:12px!important;color:#fff!important;
  display:block!important;width:100%!important;box-sizing:border-box!important;
}
.topic-hub>header h2{margin:0 0 4px!important;max-width:none!important;width:auto!important;white-space:normal!important}
.topic-hub>header p{margin:0!important;color:#dce9e9!important;max-width:none!important;width:auto!important;line-height:1.4!important}
.compact-topic-bar{
  position:sticky;top:0;z-index:12;margin:0 0 10px!important;padding:9px 11px!important;
  background:#fff!important;box-shadow:0 3px 10px rgba(17,55,60,.08);
}
.compact-topic-bar .chat-topic-box-head{padding-bottom:6px!important}
.compact-topic-bar .chat-topic-box-head strong{font-size:14px!important}
.compact-topic-bar .chat-topic-box-head small{font-size:11px!important;line-height:1.25!important}
.compact-topic-bar .chat-current-topic{padding:7px 9px!important}
.compact-topic-bar .chat-current-topic strong{font-size:14px!important}
.compact-topic-bar .chat-current-topic small,.compact-topic-bar .chat-current-topic span{font-size:10px!important}
.client-chat-stream{position:relative}

/* V65 NEU: echte auswählbare MPU-Themen */
.selectable-topic-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.topic-quick-start{margin:0!important}.topic-select-button{width:100%;min-height:46px;border:1px solid #d7e3e4;border-radius:9px;background:#f7faf9;padding:9px 11px;display:grid;grid-template-columns:20px 1fr 16px;align-items:center;gap:7px;text-align:left;cursor:pointer;color:#17383c}
.topic-select-button:hover,.topic-select-button:focus{background:#eaf4f1;border-color:#79a99f;outline:none}.topic-select-button .topic-radio{font-size:17px}.topic-select-button strong{font-size:13px}.topic-select-button small{text-align:right;font-size:18px}
@media(max-width:650px){.selectable-topic-items{grid-template-columns:1fr}}

/* V68 – konkrete Beratungssprache statt „in deiner Sprache“ */
.topic-head-row{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;width:100%}
.topic-language-badge{display:inline-flex;align-items:center;white-space:nowrap;border:1px solid #cfe0df;background:#f1f7f6;color:#173f43;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:700}
.topic-hub>header .topic-language-badge{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3);color:#fff}
.chat-topic-head-actions{display:flex;align-items:center;gap:10px}
@media(max-width:650px){.topic-head-row{flex-direction:column}.chat-topic-head-actions{width:100%;justify-content:space-between}}

/* V69 Konsolidierung: zentrale Themen-/Systemlogik; keine absichtliche Layout-Neugestaltung */


/* V70 DOMAIN-MASTERCHECK: Menü darf niemals Lernthema/Chat-Inhalt überdecken. */
.client-portal .client-menu-open{
  position:static!important;
  top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;
  float:none!important;
  display:flex!important;
  width:max-content!important;
  margin:12px 12px 16px auto!important;
  z-index:auto!important;
}
.client-portal .compact-topic-bar{top:0!important;z-index:12!important}
@media(max-width:700px){
  .client-portal .client-menu-open{
    position:static!important;
    margin:10px 8px 14px auto!important;
  }
}
