.doctor-chat {
  --dc-navy:#152e40;
  --dc-blue:#2d7098;
  --dc-coral:#e99b91;
  --dc-light:#f3f8fa;
  --dc-ink:#19374d;
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:99990;
  color:var(--dc-ink);
  font:14px/1.6 Lexend,Arial,sans-serif;
}
.doctor-chat--halsa { --dc-navy:var(--hc-red,#c95552); --dc-blue:#b54c49; --dc-light:#fdf9f7; }
.doctor-chat * { box-sizing:border-box; }
.doctor-chat [hidden] { display:none!important; }
.doctor-chat button,.doctor-chat textarea { font:inherit; }
.doctor-chat button { cursor:pointer; }
.doctor-chat button:disabled { opacity:.5; cursor:wait; }
.doctor-chat :focus-visible { outline:3px solid var(--dc-coral); outline-offset:3px; }
.dc-icon { display:inline-block; width:20px; height:20px; flex-shrink:0; background:currentColor; mask:center/contain no-repeat; -webkit-mask:center/contain no-repeat; }
.dc-cross { mask-image:url('/__chat/assets/icons/close.svg'); -webkit-mask-image:url('/__chat/assets/icons/close.svg'); }
.dc-arrow { mask-image:url('/__chat/assets/icons/send.svg'); -webkit-mask-image:url('/__chat/assets/icons/send.svg'); }
.dc-next { mask-image:url('/__chat/assets/icons/next.svg'); -webkit-mask-image:url('/__chat/assets/icons/next.svg'); }
.dc-reset { mask-image:url('/__chat/assets/icons/reset.svg'); -webkit-mask-image:url('/__chat/assets/icons/reset.svg'); }
.dc-avatar { display:block; width:66px; height:55px; flex-shrink:0; object-fit:contain; }
.dc-launch { display:flex; align-items:center; gap:9px; padding:8px 22px 8px 9px; border:0; border-radius:40px; background:var(--dc-navy); color:white; box-shadow:0 5px 20px #152e4026; font-weight:500; }
.dc-launch .dc-avatar { width:48px; height:40px; }
.dc-launch:hover { background:var(--dc-blue); }
.dc-panel { position:absolute; right:0; bottom:78px; display:flex; flex-direction:column; width:420px; height:min(680px,calc(100dvh - 124px)); overflow:hidden; border-radius:26px; background:var(--dc-light); border:1px solid #dbe6eb; box-shadow:0 15px 45px #152e402b; text-align:left; }
.dc-header { display:flex; align-items:center; gap:10px; flex-shrink:0; padding:18px 20px 18px 15px; color:white; background:var(--dc-navy); }
.dc-identity { flex:1; min-width:0; }
.dc-identity strong { display:block; font-size:22px; line-height:1.3; font-weight:500; letter-spacing:-.5px; }
.dc-ai-label { font-size:13px; color:var(--dc-coral); font-weight:400; margin-left:3px; letter-spacing:0; }
.dc-brand { display:block; font-size:10px; color:#d2e5ee; margin-top:4px; line-height:1.5; }
.dc-close { display:grid; place-items:center; width:36px; height:36px; flex-shrink:0; border:0; border-radius:50%; background:#ffffff16; color:white; }
.dc-close:hover { background:#ffffff28; }
.dc-conversation { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:22px 18px; scrollbar-width:thin; scrollbar-color:#ccdde5 transparent; }
.dc-messages { display:flex; flex-direction:column; gap:16px; }
.dc-message { max-width:94%; padding:16px 18px; border:1px solid #dde7eb; border-radius:20px 20px 20px 5px; background:white; overflow-wrap:anywhere; }
.dc-sender { display:block; font-size:10px; color:var(--dc-blue); margin-bottom:7px; font-weight:500; }
.dc-message p { margin:0; font-size:14px; line-height:1.75; white-space:pre-wrap; }
.dc-introduction .dc-sender { display:none; }
.dc-introduction { position:relative; }
.dc-introduction::before { content:''; display:block; width:26px; height:3px; background:var(--dc-coral); border-radius:2px; margin-bottom:12px; }
.dc-medical-note { margin-top:12px!important; color:#617786; font-size:11px!important; line-height:1.65!important; }
.dc-user { align-self:flex-end; border:0; border-radius:20px 20px 5px 20px; background:var(--dc-navy); color:white; }
.dc-user .dc-sender { color:#cddfe9; }
.dc-message a { display:block; color:var(--dc-blue); font-size:11px; line-height:1.6; margin-top:10px; text-decoration:underline; text-underline-offset:3px; }
.dc-starters { flex-shrink:0; padding:12px 18px 18px; }
.dc-suggestions { display:flex; flex-wrap:wrap; gap:8px; }
.dc-suggestions button { padding:9px 13px; border:1px solid #d5e2e8; border-radius:30px; background:white; color:var(--dc-ink); text-align:left; font-size:12px; line-height:1.5; font-weight:500; }
.dc-suggestions button:hover { border-color:var(--dc-coral); background:#fff6f3; }
.dc-compose { flex-shrink:0; padding:14px 16px 8px; border-top:1px solid #dce7ec; background:white; }
.dc-form { display:flex; align-items:center; gap:9px; }
.dc-form textarea { width:100%; min-width:0; min-height:49px; max-height:100px; padding:14px 17px; border:1px solid #d7e4ea; border-radius:26px; background:var(--dc-light); color:var(--dc-ink); resize:none; font-size:13px; line-height:20px; }
.dc-form textarea::placeholder { color:#738591; }
.dc-send { display:grid; place-items:center; flex-shrink:0; width:49px; height:49px; border:0; border-radius:50%; background:var(--dc-navy); color:white; }
.dc-send:hover { background:var(--dc-blue); }
.dc-send .dc-icon { width:22px; height:22px; }
.dc-bottom { display:flex; justify-content:space-between; align-items:center; padding:7px 6px 0; }
.dc-bottom button,.dc-bottom a { display:flex; align-items:center; gap:5px; padding:5px 0; border:0; background:transparent; color:#617786; font-size:10px; text-decoration:none; }
.dc-bottom .dc-icon { width:13px; height:13px; }
.dc-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.dc-pending p { color:#617786; }
.dc-message.dc-pending:has(.dc-typing) { align-self:flex-start; width:fit-content; padding:10px 14px; }
.dc-message.dc-pending:has(.dc-typing) p { display:flex; line-height:1; }
.dc-typing { display:inline-flex; align-items:center; gap:5px; height:18px; padding:0 2px; }
.dc-typing>span { width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.4; animation:dc-typing-dot 1.3s ease-in-out infinite; }
.dc-typing>span:nth-child(2) { animation-delay:.16s; }
.dc-typing>span:nth-child(3) { animation-delay:.32s; }
@keyframes dc-typing-dot { 0%,60%,100% { opacity:.4; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }
@media(prefers-reduced-motion:reduce) { .dc-typing>span { animation:none; opacity:.65; } }
@media(max-width:480px) {
  .doctor-chat { right:12px; bottom:12px; }
  .dc-launch { padding:7px 17px 7px 8px; }
  .dc-launch .dc-avatar { width:42px; height:35px; }
  .dc-panel { position:fixed; left:10px; right:10px; width:auto; bottom:74px; height:min(720px,calc(100dvh - 90px)); border-radius:23px; }
  .dc-header { padding:16px 14px 16px 10px; gap:8px; }
  .dc-header .dc-avatar { width:55px; height:46px; }
  .dc-identity strong { font-size:21px; }
  .dc-brand { font-size:9px; }
  .dc-conversation { padding:18px 14px; }
  .dc-message { padding:14px 15px; max-width:96%; }
  .dc-message p { font-size:13px; }
  .dc-starters { padding:10px 14px 16px; }
  .dc-suggestions { gap:7px; }
  .dc-suggestions button { font-size:11px; padding:8px 11px; }
  .dc-compose { padding:12px 12px 7px; }
}
/* Enkel chatt enligt användarens referens. */
.dc-introduction::before { display:none; }
.dc-header { padding:16px; gap:10px; }
.dc-header .dc-avatar { width:50px; height:44px; }
.dc-identity strong { font-size:20px; letter-spacing:0; }
.dc-brand { font-size:12px; margin-top:2px; }
.dc-header .dc-clear { display:grid; place-items:center; border:0; background:transparent; color:#c5d8e3; width:30px; height:36px; padding:0; border-radius:50%; }
.dc-header .dc-clear .dc-icon { width:17px; height:17px; }
.dc-compose { padding:14px; }
.dc-panel { border-radius:22px; box-shadow:0 8px 28px #152e4024; }
.dc-message { padding:15px 17px; }
.dc-message p { font-size:14px; line-height:1.65; }
.dc-suggestions button { font-weight:400; }
@media(max-width:480px) { .dc-header { padding:14px 12px; } .dc-brand { font-size:11px; } .dc-message p { font-size:13px; } }
.dc-identity strong { font-size:18px; }
.dc-brand { font-size:11px; }
.dc-message p { font-size:13px; line-height:1.65; }
.dc-suggestions button { font-size:11px; padding:8px 12px; }
.dc-form textarea { font-size:12px; }
.dc-launch { font-size:13px; }
@media(max-width:480px) { .dc-identity strong { font-size:18px; } .dc-brand { font-size:10px; } .dc-message p { font-size:12px; line-height:1.7; } }
.doctor-chat .dc-message p { color:inherit; }
.dc-launch[aria-expanded="true"] { display:none; }
.dc-panel { bottom:0; height:min(620px,calc(100dvh - 44px)); }
.dc-compose { padding:10px 12px; }
.dc-form { gap:8px; }
.dc-form textarea { min-height:38px; padding:9px 14px; line-height:18px; font-size:12px; border-radius:22px; }
.dc-form textarea:focus-visible { outline:1px solid var(--dc-coral); outline-offset:1px; }
.dc-send { width:38px; height:38px; }
.dc-send .dc-icon { width:18px; height:18px; }
@media(max-width:480px) { .dc-panel { bottom:12px; height:min(650px,calc(100dvh - 24px)); } }
.doctor-chat .dc-launch { gap:6px; padding:6px 13px 6px 7px; font-size:11px; border-radius:24px; box-shadow:0 3px 12px #152e4020; }
.doctor-chat .dc-launch .dc-avatar { width:29px; height:25px; }
.dc-assistant-symbol { position:relative; background:none; }
.dc-symbol-main,.dc-symbol-accent { position:absolute; inset:0; background:currentColor; mask:center/contain no-repeat; -webkit-mask:center/contain no-repeat; }
.dc-symbol-main { color:#b9e2f0; mask-image:url('/__chat/assets/icons/alvira-assistant.svg'); -webkit-mask-image:url('/__chat/assets/icons/alvira-assistant.svg'); }
.dc-symbol-accent { color:#e99b91; mask-image:url('/__chat/assets/icons/alvira-assistant-accent.svg'); -webkit-mask-image:url('/__chat/assets/icons/alvira-assistant-accent.svg'); }
.dc-online { width:7px; height:7px; margin-left:5px; flex-shrink:0; border-radius:50%; background:#67d994; box-shadow:0 0 0 2px #67d99418; }
.dc-online.dc-offline { background:#95a4af; box-shadow:none; }
.dc-online:not(.dc-offline) { animation:dc-status-glow 2.8s ease-in-out infinite; }
@keyframes dc-status-glow {
  0%,100% { box-shadow:0 0 3px 1px #67d99465,0 0 0 2px #67d99416; }
  50% { box-shadow:0 0 7px 2px #67d994aa,0 0 0 4px #67d99422; }
}
@media(prefers-reduced-motion:reduce) {
  .dc-online:not(.dc-offline) { animation:none; box-shadow:0 0 4px 1px #67d99480; }
}
.dc-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:13px; }
.doctor-chat .dc-actions button { border:1px solid var(--dc-navy); background:var(--dc-navy); color:white; border-radius:22px; font-size:11px; line-height:1.5; padding:9px 13px; text-align:left; }
.doctor-chat .dc-actions button+button { background:white; color:var(--dc-navy); border-color:#cddde5; }
.doctor-chat .dc-actions button:hover { border-color:var(--dc-coral); }
.dc-help { display:flex; justify-content:center; gap:22px; padding:9px 2px 0; }
.dc-help a { color:var(--dc-ink); font-size:10px; line-height:1.6; text-decoration:none; text-underline-offset:3px; }
.dc-help a:hover { text-decoration:underline; }
.doctor-chat--halsa .dc-header,.doctor-chat--halsa .dc-launch,.doctor-chat--halsa .dc-send,.doctor-chat--halsa .dc-actions button { color:white; }
.doctor-chat--halsa .dc-brand,.doctor-chat--halsa .dc-clear,.doctor-chat--halsa .dc-close { color:white; }
.doctor-chat--halsa .dc-user { background:#f6ddd6; color:var(--dc-ink); }
.doctor-chat--halsa .dc-symbol-main { color:white; }
.doctor-chat--halsa .dc-symbol-accent { color:#fff4ed; }
.doctor-chat--halsa .dc-actions button+button { color:var(--dc-ink); }
.doctor-chat .dc-starters { padding:6px 12px 8px; }
.doctor-chat .dc-suggestions { flex-wrap:nowrap; gap:6px; overflow-x:auto; scrollbar-width:thin; padding:3px; }
.doctor-chat .dc-suggestions button { flex:0 0 auto; white-space:nowrap; font-size:10px; line-height:1.4; padding:6px 10px; }
.doctor-chat--intyg { --dc-navy:#53a1c7; --dc-blue:#3889b1; --dc-coral:#173248; --dc-light:#f2f8fa; --dc-ink:#173248; }
.doctor-chat--intyg .dc-suggestions button:hover { background:#eaf2f7; }
.doctor-chat--intyg .dc-doctor-character { background:url('/__chat/assets/doctor-portrait-color.png') center top/130% auto no-repeat; border-radius:0; }
.doctor-chat--intyg .dc-header {
  overflow:hidden;
  min-height:92px;
  padding:12px 16px 0 12px;
  gap:10px;
  color:#173248;
  background:#f3f9fc url('/__chat/assets/chat-landscape.svg') center bottom/cover no-repeat;
  border-bottom:1px solid #d5e8f0;
}
.doctor-chat--intyg .dc-header .dc-avatar {
  width:76px;
  height:80px;
  align-self:flex-end;
  background-size:100% auto;
  background-position:center bottom -2px;
}
.doctor-chat--intyg .dc-header .dc-identity { padding-bottom:12px; }
.doctor-chat--intyg .dc-header .dc-identity strong { font-size:20px; }
.doctor-chat--intyg .dc-header .dc-brand {
  position:relative;
  display:table;
  padding:6px 10px;
  margin-top:7px;
  border-radius:10px 10px 10px 2px;
  background:#fff;
  color:#244e67;
  font-size:12px;
  line-height:1.4;
}
.doctor-chat--intyg .dc-header .dc-brand::before {
  content:'';
  position:absolute;
  left:-5px;
  bottom:0;
  width:8px;
  height:9px;
  background:#fff;
  clip-path:polygon(100% 0,100% 100%,0 100%);
}
.doctor-chat--intyg .dc-header .dc-clear,
.doctor-chat--intyg .dc-header .dc-close {
  width:32px;
  height:36px;
  margin-bottom:12px;
  color:#244e67;
  background:#ffffff80;
}
.doctor-chat--intyg .dc-header .dc-clear:hover,
.doctor-chat--intyg .dc-header .dc-close:hover { background:#fff; }
@media(max-width:480px) {
  .doctor-chat--intyg .dc-header { gap:6px; padding-left:8px; padding-right:10px; min-height:80px; }
  .doctor-chat--intyg .dc-header .dc-avatar { width:60px; height:68px; }
  .doctor-chat--intyg .dc-header .dc-identity strong { font-size:18px; }
}
.doctor-chat--intyg .dc-launch .dc-avatar { width:28px; height:28px; border-radius:0; }
.doctor-chat--intyg .dc-brand { font-size:10px; }
/* Selected illustrated launcher: one accessible button, with artwork lettering. */
.doctor-chat--intyg .dc-launch {
  position:relative;
  left:14px;
  top:20px;
  width:92px;
  height:92px;
  padding:0;
  border:0;
  border-radius:12px;
  background:transparent url('/__chat/assets/doctor-launcher-contour-v1.png') center/contain no-repeat;
  box-shadow:none;
  transition:transform .16s ease;
}
.doctor-chat--intyg .dc-launch > * { display:none; }
.doctor-chat--intyg .dc-launch:hover { background-color:transparent; transform:translateY(-2px); }
.doctor-chat--intyg .dc-launch:active { transform:scale(.97); }
@media(max-width:760px) {
  .doctor-chat--intyg .dc-launch {
    position:fixed;
    left:auto;
    top:auto;
    right:calc(16px + env(safe-area-inset-right,0px));
    bottom:max(12px,env(safe-area-inset-bottom,0px));
    width:72px;
    height:72px;
  }
}
@media(prefers-reduced-motion:reduce) { .doctor-chat--intyg .dc-launch { transition:none; transform:none; } }
/* Keep the launcher and panel inside rounded screens and the home-indicator area. */
.doctor-chat {
  left:auto;
  right:calc(20px + env(safe-area-inset-right,0px));
  bottom:calc(24px + env(safe-area-inset-bottom,0px));
  max-width:calc(100vw - 40px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));
}
@media(max-width:760px) {
  .doctor-chat .dc-panel {
    position:fixed;
    left:calc(16px + env(safe-area-inset-left,0px));
    right:calc(16px + env(safe-area-inset-right,0px));
    width:auto;
    bottom:calc(24px + env(safe-area-inset-bottom,0px));
    height:min(650px,calc(100dvh - 48px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));
  }
}
/* iOS zooms focused form controls below 16px. Keep pinch zoom enabled. */
@media(max-width:760px),(pointer:coarse) {
  .doctor-chat .dc-form textarea { font-size:16px; line-height:22px; min-height:42px; padding:9px 12px; }
  .doctor-chat .dc-send { width:42px; height:42px; }
}
/* Intyg conversation: readable messages, nearby prompts and a calm composer. */
.doctor-chat--intyg .dc-message p { font-size:14px; line-height:1.65; }
.doctor-chat--intyg .dc-conversation .dc-starters { padding:12px 0 0; }
.doctor-chat--intyg .dc-suggestions { flex-wrap:wrap; overflow:visible; padding:0; gap:7px; }
.doctor-chat--intyg .dc-suggestions button { font-size:12px; padding:9px 12px; white-space:normal; text-align:left; }
.doctor-chat--intyg .dc-form textarea { background:#fff; border-color:#bfd2de; }
.doctor-chat--intyg .dc-send { background:#205b83; }
.doctor-chat--intyg .dc-send:disabled { background:#cbdce5; color:#6e899b; opacity:1; }
.doctor-chat--intyg .dc-compose { padding:12px; }
@media(max-width:760px) {
  .doctor-chat--intyg .dc-panel {
    top:var(--dc-view-top,12px);
    bottom:auto;
    height:var(--dc-view-height,calc(100dvh - 24px));
  }
}
.dc-reset-notice { flex-shrink:0; padding:12px 16px; background:#fff; border-bottom:1px solid #d5e3eb; }
.dc-reset-notice p { margin:0 0 8px; font-size:13px; line-height:1.5; }
.dc-reset-notice>div { display:flex; gap:8px; }
.dc-reset-notice button { border:1px solid #b9cdd9; border-radius:18px; padding:7px 12px; background:#fff; color:#173248; font-size:12px; }
.dc-reset-notice [data-reset-confirm] { background:#205b83; color:#fff; border-color:#205b83; }
.doctor-chat--intyg .dc-message { position:relative; }
.doctor-chat--intyg .dc-assistant:not(.dc-pending) { border-bottom-left-radius:0; }
.doctor-chat--intyg .dc-user { border-bottom-right-radius:0; }
.doctor-chat--intyg .dc-assistant:not(.dc-pending)::after,
.doctor-chat--intyg .dc-user::after {
  content:'';
  position:absolute;
  bottom:0;
  width:10px;
  height:12px;
  pointer-events:none;
}
.doctor-chat--intyg .dc-assistant:not(.dc-pending)::after {
  left:-8px;
  background:#fff;
  clip-path:polygon(100% 0,100% 100%,0 100%);
  filter:drop-shadow(-1px 1px 0 #dde7eb);
}
.doctor-chat--intyg .dc-user::after {
  right:-8px;
  background:var(--dc-navy);
  clip-path:polygon(0 0,100% 100%,0 100%);
}
