*{box-sizing:border-box}body{margin:0;background:#fff;color:#182536;font:15px/1.5 system-ui,-apple-system,Segoe UI,sans-serif}main{max-width:100%;margin:auto;padding:16px}.widget{border:1px solid #d9e1e9;border-radius:14px;max-width:750px}.admin{max-width:1100px}header{display:flex;gap:12px;align-items:center;justify-content:space-between}header>div:nth-child(2){flex:1}.symbol{font-size:30px}h1{font-size:21px;margin:0}h2{font-size:17px}header p{margin:0;color:#536273;font-size:13px}.badge{white-space:nowrap;background:#eef1f5;border-radius:30px;padding:5px 10px;font-size:12px}.green{background:#e0f6e9;color:#146c3e}.notice{background:#f2f6fa;padding:12px;border-radius:9px}.messages{height:250px;overflow:auto;background:#f5f7fa;border:1px solid #e2e7ee;border-radius:9px;padding:10px;display:flex;flex-direction:column;gap:10px;margin:12px 0}.bubble{max-width:88%;padding:9px 12px;border-radius:11px;overflow-wrap:anywhere;white-space:pre-wrap}.bubble strong{display:block;font-size:12px;margin-bottom:4px}.visitor{background:#dfeaf8;align-self:flex-end}.advisor{background:white;align-self:flex-start;border:1px solid #e2e7ee}label{display:block;font-weight:600;margin-bottom:5px}textarea,input{width:100%;font:inherit;padding:10px;border:1px solid #abb7c4;border-radius:8px}button{font:inherit;cursor:pointer;border:0;border-radius:8px;padding:10px 14px;background:#135d94;color:white;font-weight:600}button:hover{filter:brightness(.94)}button:disabled{opacity:.5;cursor:not-allowed}.secondary{background:#e9edf2;color:#1d3247}.actions,.toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.hint{font-size:12px;color:#617084}#error{color:#a42525}.columns{display:grid;grid-template-columns:1fr 2fr;gap:20px}.conversation{display:block;width:100%;text-align:left;background:#edf2f8;color:#243448;margin:7px 0}.conversation.selected{background:#c8e3f7}@media(max-width:650px){.columns{grid-template-columns:1fr}.widget{border-radius:0}header{flex-wrap:wrap}.actions button{flex:1}}
.badge.orange{background:#fff0cf;color:#8b5100}.badge.red{background:#fde4e4;color:#a21d2b}
/* HSBK modernized interface */
:root{--navy:#153b5e;--blue:#176da4;--ink:#203348;--line:#dce5ee;--soft:#f3f7fb}
body{background:#f7f9fc;color:var(--ink);font-family:system-ui,-apple-system,'Segoe UI',sans-serif}
main.widget,main.admin{background:#fff;box-shadow:0 12px 34px rgba(16,45,76,.07);border:1px solid var(--line);border-radius:18px;margin:16px auto;overflow:hidden}
main.widget{padding:0;max-width:780px}main.admin{padding:22px}
.widget>header{background:linear-gradient(115deg,#153b5e,#246d9c);color:#fff;padding:23px;gap:14px}
.widget header p{color:#dcebf6}.widget .symbol{background:#ffffff22;border-radius:12px;padding:10px;font-size:24px}
.widget>p,.widget>#intro,.widget>#chat{margin:16px 20px}.widget .notice{margin:16px 20px}
.admin>header{padding-bottom:16px;border-bottom:1px solid var(--line)}h1{font-size:24px;letter-spacing:-.02em}h2{font-size:17px;color:var(--navy)}
button{background:var(--blue);border-radius:10px;min-height:41px;transition:filter .15s}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #90c8f0;outline-offset:2px}
.messages{background:#f3f7fb;border:1px solid var(--line);height:310px;border-radius:14px;padding:15px;gap:12px}
.bubble{border-radius:15px;padding:12px 15px;box-shadow:0 2px 8px #1234}.bubble.visitor{background:#dceaf8}.bubble.advisor{background:#fff}
textarea,input{border:1px solid #b8c8d8;border-radius:10px;padding:12px}.badge{font-weight:700}.notice{border-left:4px solid #367eaf;border-radius:8px}
.columns>section{min-width:0}.conversation{border:1px solid var(--line);border-radius:10px;background:#f5f8fc}.conversation.selected{background:#d9eafa;border-color:#6da6d1}
.call-panel{margin:18px 20px;padding:16px;background:#edf4fb;border:1px solid #cfdfed;border-radius:15px}.admin .call-panel{margin:18px 0}.call-heading{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}
.call-videos{position:relative;display:grid;grid-template-columns:1fr 130px;gap:10px;background:#13283b;border-radius:12px;min-height:170px;padding:10px}.call-videos video{width:100%;height:200px;object-fit:cover;border-radius:8px;background:#20384d}.call-videos video#localVideo{height:120px;align-self:end}.audio-only .call-videos{display:none}.call-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
@media(max-width:650px){main.widget,main.admin{border-radius:0;margin:0}.widget>header{padding:18px}.widget>p,.widget>#intro,.widget>#chat{margin:14px}.call-panel{margin:14px}.call-actions button{flex:1}.call-videos{grid-template-columns:1fr 100px}.call-videos video{height:150px}.call-videos video#localVideo{height:90px}}

/* Datenschutzhinweis vor Chatbeginn */
.privacy-box{background:#f3f7fb;border:1px solid #dce5ee;border-radius:12px;padding:15px;margin:15px 0}.privacy-box p{margin:9px 0;font-size:14px}.privacy-box a{color:#135d94;text-decoration:underline}.privacy-check{display:flex;align-items:flex-start;gap:10px;font-size:14px;font-weight:500;cursor:pointer;margin:13px 0 2px}.privacy-check input{width:19px;height:19px;flex:0 0 19px;margin:2px 0 0;accent-color:#176da4}.privacy-check span{flex:1}#intro>button{margin-top:4px}

.bubble a{color:#075d9b;text-decoration:underline;overflow-wrap:anywhere}.bubble a:hover{text-decoration-thickness:2px}

/* Hinweis bei Wiederaufnahme einer pausierten Beratung */
.resume-toast[hidden]{display:none!important}
.resume-toast{position:fixed;z-index:9999;top:18px;left:50%;transform:translateX(-50%);width:min(92vw,480px);display:flex;align-items:flex-start;gap:12px;padding:16px 18px;background:#fff;color:#173c60;border:1px solid #beded2;border-left:5px solid #218564;border-radius:14px;box-shadow:0 12px 40px rgba(18,43,63,.23);font-family:inherit}
.resume-toast-icon{font-size:28px;line-height:1.2}
.resume-toast strong{display:block;font-size:1rem;margin-bottom:4px}
.resume-toast p{margin:0;font-size:.9rem;line-height:1.45}
.resume-toast-close{background:transparent;border:0;box-shadow:none;color:#4d6475;padding:0 4px;margin-left:auto;font-size:24px;cursor:pointer;min-width:auto}
.resume-toast.toast-show{animation:resume-appear .3s ease-out}
@keyframes resume-appear{from{opacity:0;transform:translate(-50%,-12px)}to{opacity:1;transform:translate(-50%,0)}}

/* Beidseitige Bestätigung zur Wiederaufnahme */
.ack-overlay[hidden],.ack-wait[hidden]{display:none!important}.ack-overlay{position:fixed;inset:0;z-index:9999;background:rgba(15,35,57,.56);display:grid;place-items:center;padding:18px;backdrop-filter:blur(3px)}.ack-dialog{width:min(100%,420px);background:#fff;border-radius:20px;padding:28px;text-align:center;box-shadow:0 20px 70px rgba(0,0,0,.25);animation:ack-in .2s ease-out}.ack-dialog h2{font-size:22px;margin:6px 0 12px}.ack-dialog p{line-height:1.6;color:#485d70}.ack-dialog button{width:100%;margin-top:12px;background:#16754e}.ack-emoji{font-size:42px}.ack-wait{background:#fff2d5;border-left:4px solid #b77813;border-radius:8px;padding:12px;margin:12px 0}@keyframes ack-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}

/* Kompakter Schüler-Startbildschirm – ausschließlich vor Gesprächsbeginn */
.widget:has(#intro:not([hidden]))>header{padding:16px 18px;gap:10px;flex-wrap:wrap}
.widget:has(#intro:not([hidden]))>header .symbol{font-size:19px;padding:6px 9px;border-radius:9px}
.widget:has(#intro:not([hidden]))>header h1{font-size:21px;line-height:1.2}
.widget:has(#intro:not([hidden]))>header p{font-size:12px}
.widget:has(#intro:not([hidden]))>header .badge{font-size:11px;padding:5px 9px;margin-left:auto}
.widget:has(#intro:not([hidden]))>.notice{margin:12px 16px 0;padding:9px 11px;font-size:14px}
.widget:has(#intro:not([hidden]))>#intro{margin:12px 16px 18px}
.widget:has(#intro:not([hidden])) .privacy-box{background:transparent;border:0;padding:0;margin:0 0 12px}
.widget:has(#intro:not([hidden])) .privacy-box p{font-size:13px;line-height:1.5;color:#586a7a;margin:0 0 11px}
.widget:has(#intro:not([hidden])) .privacy-check{margin:0;gap:9px;font-size:13px;line-height:1.4}
.widget:has(#intro:not([hidden])) .privacy-check input{width:18px;height:18px;flex-basis:18px;margin-top:1px}
.widget:has(#intro:not([hidden])) #start{width:100%;margin-top:4px}
@media(max-width:650px){.widget:has(#intro:not([hidden]))>header{padding:14px 16px}.widget:has(#intro:not([hidden]))>header .badge{white-space:normal;text-align:center}}

/* Gespräch beenden in allen Schüler-Popups */
.ack-dialog .popup-end{background:#f2f5f9;color:#23435d;border:1px solid #ccd8e2;margin-top:10px;font-weight:650;}
.ack-dialog .popup-end:hover{background:#e4ebf2;}
.ack-dialog .popup-error{color:#a32335;font-size:14px;margin:10px 0 0;}

/* Ein einziges, sauber gestaltetes Bestätigungs-Popup */
.end-dialog{max-width:430px;box-sizing:border-box}
.end-dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}
.end-dialog-actions button{width:100%;margin:0;min-width:0}
.end-dialog-actions #endYes{background:#b73540;color:#fff}
.end-dialog-actions #endCancel{background:#eaf0f5;color:#173c60}
@media(max-width:420px){.end-dialog{padding:22px 18px}.end-dialog-actions{grid-template-columns:1fr}.end-dialog-actions button{min-height:46px}}

/* Gesprächsfarben dienen nur der Zuordnung, nicht dem Beratungsstatus. */
.admin .conversation{border-left:6px solid var(--chat-color,#357db6);padding-left:12px}
.admin .conversation.selected{outline:2px solid var(--chat-color,#357db6);outline-offset:-2px;background:#f1f6fb}
.admin #messages .bubble.visitor{border-left:4px solid var(--chat-color,#357db6);background:#f2f6fb}

/* Kleine Zusatzfunktionen in der Beratungszentrale */
.admin #soundToggle[aria-pressed="true"]{border-color:#237a62;background:#e8f6f0;color:#17634e}
.admin #greeting{white-space:nowrap}
@media(max-width:650px){.admin .toolbar button,.admin .actions button{flex:1 1 100%;width:100%}}

/* Berater-Bestaetigungsdialog: auch ohne Browser-confirm, zentriert und nur einmal */
.hsbk-confirm-overlay{position:fixed;inset:0;z-index:20000;display:grid;place-items:center;padding:18px;background:rgba(13,34,57,.56);backdrop-filter:blur(3px)}
.hsbk-confirm-dialog{box-sizing:border-box;width:min(100%,440px);padding:28px;background:#fff;color:#183c5d;border-radius:20px;box-shadow:0 20px 70px rgba(0,0,0,.24);text-align:center}
.hsbk-confirm-heading{display:flex;flex-direction:column;align-items:center;gap:8px}.hsbk-confirm-symbol{font-size:38px}.hsbk-confirm-dialog h2{font-size:23px;margin:0}.hsbk-confirm-dialog p{margin:15px 0 22px;line-height:1.55;color:#4b6074}
.hsbk-confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hsbk-confirm-actions button{width:100%;min-width:0;margin:0}.hsbk-confirm-cancel{background:#e9eef4;color:#183c5d}.hsbk-confirm-danger{background:#ad3441;color:white}.hsbk-confirm-accept{background:#16754e;color:white}
@media(max-width:430px){.hsbk-confirm-dialog{padding:24px 18px}.hsbk-confirm-actions{grid-template-columns:1fr}}

/* HSBK TYPO3: kompakte Schueleransicht in der schmalen Seitenspalte.
   Absichtlich ausschliesslich .widget: Berateroberflaeche bleibt unveraendert. */
.widget{--hsbk-brand:#4468B4;--navy:#344f85;--blue:#4468B4;--line:#dfe5f0;--soft:#f5f7fb}
body:has(main.widget){background:#fff}
main.widget{margin:0 auto;border:0;border-radius:0;box-shadow:none;max-width:100%;overflow:visible}
.widget>header,.widget:has(#intro:not([hidden]))>header{background:#4468B4;color:#fff;padding:11px 14px;gap:9px;flex-wrap:wrap}
.widget>header .symbol,.widget:has(#intro:not([hidden]))>header .symbol{background:rgba(255,255,255,.14);font-size:18px;line-height:1;padding:7px;border-radius:7px}
.widget>header h1,.widget:has(#intro:not([hidden]))>header h1{font-size:17px;font-weight:500;line-height:1.25;letter-spacing:0}
.widget>header p,.widget:has(#intro:not([hidden]))>header p{font-size:11px;color:#edf1fa;line-height:1.25}
.widget>header .badge,.widget:has(#intro:not([hidden]))>header .badge{font-size:11px;padding:4px 8px;margin-left:auto;white-space:normal;max-width:100%;text-align:center}
.widget>.notice,.widget:has(#intro:not([hidden]))>.notice{margin:10px 12px 0;padding:8px 10px;border-left:3px solid #4468B4;border-radius:4px;background:#f4f6fb;font-size:13px;line-height:1.4}
.widget>#intro,.widget>#chat,.widget:has(#intro:not([hidden]))>#intro{margin:11px 12px 14px}
.widget .privacy-box{padding:10px;margin:8px 0;border-radius:6px}
.widget .privacy-box p{font-size:12px}
.widget .privacy-check{font-size:12px}
.widget .messages{height:190px;margin:9px 0;padding:9px;gap:8px;border-radius:6px;background:#f7f8fc}
.widget .bubble{padding:8px 10px;border-radius:8px;box-shadow:none;font-size:13px;max-width:94%}
.widget .bubble.visitor{background:#e8eefb}
.widget label{font-size:13px;margin-bottom:4px}
.widget textarea{padding:8px 10px;border-radius:6px;min-height:65px;resize:vertical}
.widget button{background:#4468B4;border-radius:6px;padding:8px 11px;min-height:36px;font-size:13px}
.widget button.secondary{background:#e9edf5;color:#263d62}
.widget .actions{gap:7px;margin-top:7px}
.widget .actions button{flex:1 1 140px}
.widget .hint{font-size:11px;line-height:1.4;margin:9px 0;color:#647187}
.widget .ack-dialog button{background:#4468B4}
.widget .ack-dialog .popup-end,.widget .end-dialog-actions #endCancel{background:#e9edf5;color:#263d62}
.widget .end-dialog-actions #endYes{background:#b73540}
.widget .ack-dialog{border-radius:12px;padding:22px 18px}
.widget .ack-dialog h2{font-size:19px}
.widget .ack-emoji{font-size:30px}
@media(max-width:650px){main.widget{margin:0;border-radius:0}.widget>header,.widget:has(#intro:not([hidden]))>header{padding:10px 12px}.widget .actions button{flex:1 1 100%}}
