/* Approved direction 05 · Tumma hiekka. Scoped to the open panel: launcher and host page stay unchanged. */
@font-face{font-family:DentaPlak;src:url('/static/denta-body.woff') format('woff');font-display:swap}
@font-face{font-family:DentaWide;src:url('/static/denta-wide.woff') format('woff');font-weight:600;font-display:swap}
#chat-panel{--sand:#e1d8c4;--paper:#f6f5f1;--taupe:#ccbfb6;--beige:#e6e4d8;--ink:#343229;--muted:#625f53;--line:#b8ad9d;background:var(--sand);border:0;border-radius:0;font-family:DentaPlak,Arial,sans-serif;color:var(--ink);overflow:visible}
.is-embedded #chat-panel{border-radius:0}
#chat-panel button,#chat-panel textarea{font-family:inherit;border-radius:0}
#chat-panel button:focus-visible,#chat-panel a:focus-visible,#chat-panel summary:focus-visible{outline:2px solid currentColor;outline-offset:3px}
#chat-panel header{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;min-height:102px;padding:20px 36px 20px 20px;background:var(--ink);color:var(--paper);border:0}
#chat-panel .chat-brand-logo{display:block;width:118px;height:auto}
#chat-panel header .eyebrow{color:var(--paper);font-size:9px;letter-spacing:.65px;line-height:1.4;margin:8px 0 0}
#chat-panel #chat-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#chat-panel #chat-close{position:absolute;z-index:3;top:-18px;right:-18px;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink);cursor:pointer}
/* Ring in the denta.fi divider colours and proportions: sand 75 %, light 15 %, taupe 10 %. */
#chat-panel #chat-close>span{--close-fill:var(--paper);position:absolute;inset:6px;z-index:0;display:block;border:4px solid transparent;border-radius:50%;background:linear-gradient(var(--close-fill),var(--close-fill)) padding-box,conic-gradient(from 270deg,var(--sand) 0 75%,#edebe3 0 90%,var(--taupe) 0) border-box;font-size:0}
#chat-panel #chat-close:before,#chat-panel #chat-close:after{content:'';position:absolute;z-index:1;left:50%;top:50%;width:12px;height:1.5px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg)}
#chat-panel #chat-close:after{transform:translate(-50%,-50%) rotate(-45deg)}
#chat-panel #chat-close:hover:not(:disabled){background:transparent}
#chat-panel #chat-close:hover:not(:disabled)>span{--close-fill:var(--beige)}
#chat-panel #chat-close:focus-visible{outline:0}
#chat-panel #chat-close:focus-visible>span{outline:2px solid var(--taupe);outline-offset:0}
#chat-panel .chat-header-photo{width:80px;height:62px;background:url('/static/denta-reception.jpg') 70% 50%/cover;border:5px solid var(--taupe);filter:grayscale(1);pointer-events:none}
#chat-panel .chat-info{margin:8px 0 0;border-top:1px solid #f6f5f126;background:transparent;color:var(--paper)}
#chat-panel .chat-info>summary{min-height:32px;padding:8px 0 4px;font-size:11px;line-height:18px;cursor:pointer}
#chat-panel .chat-info>summary:focus-visible{outline-offset:-4px}
#chat-panel .chat-info-content{max-height:min(180px,25dvh);overflow:auto;overscroll-behavior:contain}
#chat-panel .chat-info .widget-warning{padding:4px 0 0;background:transparent;color:var(--paper);font-size:11px}
#chat-panel .chat-info .widget-warning p{margin:0 0 8px}
#chat-panel .chat-info a{color:var(--paper);text-decoration:underline;text-underline-offset:3px}
#chat-panel .chat-info .chat-actions{border:0;padding:0;background:transparent}
#chat-panel .chat-info .chat-actions .sub{color:var(--paper)}
/* 'Uusi keskustelu' stays visible on the privacy row, at the right. */
#chat-panel .chat-footer{position:relative}
#chat-panel .chat-footer #reset{position:absolute;right:0;top:2px;min-height:32px;padding:0 0 0 12px;border:0;background:transparent;color:var(--paper);font-size:11px;line-height:18px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
#chat-panel .chat-footer #reset:hover:not(:disabled){background:transparent;color:#fff}
#chat-panel .chat-tricolor{height:9px;flex:none;background:linear-gradient(to bottom,var(--taupe) 0 33.33%,var(--sand) 33.33% 66.66%,var(--beige) 66.66%)}
#chat-panel .chat-tricolor-bottom{background:linear-gradient(to top,var(--taupe) 0 33.33%,var(--sand) 33.33% 66.66%,var(--beige) 66.66%)}
#chat-panel .visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#chat-panel .widget-warning{padding:12px 20px 0;background:var(--sand);font-size:12px;line-height:1.5}
#chat-panel .widget-warning summary{font-size:12px;min-height:44px;padding:10px 0;text-decoration:underline;text-underline-offset:3px}
#chat-panel .widget-warning details{max-height:190px;overscroll-behavior:contain}
#chat-panel .widget-warning details p{font-size:12px;margin:8px 0 14px}
#chat-panel .chat-actions{padding:0 20px 6px;border-bottom:1px solid var(--line);gap:8px;background:var(--sand)}
#chat-panel .chat-actions .sub{font-size:11px;line-height:1.4;color:var(--ink)}
#chat-panel .chat-actions #reset{padding:8px 0 8px 8px;min-height:44px;font-size:12px;border:0;text-decoration:underline;text-underline-offset:3px}
#chat-panel .chat-actions #reset:hover:not(:disabled){background:var(--beige)}
#chat-panel #messages{padding:22px 20px;min-height:0;background:var(--sand)}
#chat-panel .welcome{padding:0}
#chat-panel .welcome h2{font:600 25px/1.18 DentaWide,Arial,sans-serif;letter-spacing:-.6px;margin:0 0 12px}
#chat-panel .welcome p{font-size:14px;line-height:1.5;color:var(--ink);margin:0}
#chat-panel .suggestions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;margin:18px 0 0}
#chat-panel .suggestions button{background:var(--paper);border:0;text-align:left;padding:12px;font-size:12px;min-height:80px;position:relative;line-height:1.5}
/* Circled arrow glued to the last word (no-break space), like the denta.fi 'VARAA AIKA' links. */
#chat-panel .suggestions button:after{content:'\00a0';display:inline;margin-left:4px;padding:4px 21px 4px 3px;background:url('/static/nuoli.svg') right center/20px 20px no-repeat;transition:padding .2s}
#chat-panel .suggestions button:hover:not(:disabled):after{padding-left:6px}
#chat-panel .suggestions button:last-child{grid-column:1/-1;min-height:48px;background:var(--beige);padding-bottom:12px}
#chat-panel .suggestions button:hover:not(:disabled){background:#d2c6b0}
/* Messages without boxes: answers sit on the sand background, the visitor's own messages are soft bubbles on the right. */
#chat-panel .bubble{max-width:100%;padding:0;font-size:14px;line-height:1.65;border:0;border-radius:0;margin-bottom:18px;overflow-wrap:anywhere;background:transparent}
#chat-panel .bubble .label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#chat-panel .bubble.user{width:fit-content;max-width:82%;margin-left:auto;padding:9px 14px;background:#edebe3;color:var(--ink);border-radius:16px 16px 4px 16px}
#chat-panel .bubble.assistant{color:var(--ink);padding-right:8px}
#chat-panel .bubble.pending{color:var(--muted);font-style:italic}
#chat-panel .bubble.error{color:#775144}
#chat-panel .sources{display:flex;flex-wrap:wrap;gap:0 16px;border:0;margin-top:6px;padding-top:0}
#chat-panel .sources:before{flex-basis:100%;margin-bottom:2px;font-size:10px;letter-spacing:.6px;color:var(--muted)}
#chat-panel .sources a{display:inline-flex;align-items:center;min-height:32px;padding:4px 0;font-size:12px;border:0;border-radius:0;background:transparent;color:var(--ink);text-decoration:underline;text-decoration-color:var(--line);text-underline-offset:4px}
#chat-panel .sources a:hover{text-decoration-color:currentColor}
#chat-panel form{padding:12px 20px 4px;background:var(--ink);color:var(--paper);border:0}
#chat-panel form label{display:block;font-size:12px;font-weight:600;margin:0 0 8px}
#chat-panel .composer{display:grid;grid-template-columns:minmax(0,1fr) 86px;gap:8px}
#chat-panel textarea{width:100%;min-width:0;height:44px;min-height:44px;padding:11px 12px;font-size:16px;line-height:20px;resize:none;background:var(--paper);color:var(--ink);border:1px solid var(--taupe)}
#chat-panel textarea::placeholder{color:#625f53;opacity:1}
#chat-panel textarea:focus-visible{outline:2px solid var(--paper);outline-offset:2px}
#chat-panel .composer button{min-width:0;padding:0 6px;background:#48463f;color:var(--beige);border:2px solid var(--taupe);font:600 12px/1.2 DentaWide,Arial,sans-serif;text-transform:uppercase;cursor:pointer;transition:background-color .3s ease-in-out,color .3s ease-in-out}
#chat-panel .composer button:hover:not(:disabled),#chat-panel .composer button:focus-visible{background:var(--ink);color:#fff}
#chat-panel .composer button:focus-visible{outline:2px solid var(--paper);outline-offset:2px}
#chat-panel .composer button:disabled{opacity:.55;cursor:default}
#chat-panel #state{font-size:11px;line-height:1.5;color:var(--paper);margin:10px 0 0}
#chat-panel .gate{background:var(--beige);color:var(--ink);font-size:12px;padding:12px 20px}
@media(max-width:760px){#chat-panel{border-radius:0;right:12px;top:calc(var(--viewport-top,0px) + 12px);width:calc(100% - 20px);height:calc(var(--viewport-h,100dvh) - 20px)}#chat-panel #chat-close{top:-12px;right:-12px}#chat-panel header{padding:20px 56px 20px 20px;min-height:102px}#chat-panel #messages{padding:22px 20px}#chat-panel form{padding:12px 20px max(4px,env(safe-area-inset-bottom))}}
/* Reduced viewport (including keyboard emulation): retain composer and a scrollable conversation. */
@media(max-height:650px){#chat-panel header{min-height:60px;padding:10px 56px 10px 16px;gap:8px}#chat-panel .chat-brand-logo{width:88px}#chat-panel header .eyebrow{display:none}#chat-panel .chat-header-photo{height:40px;width:68px}#chat-panel .chat-info-content{max-height:90px}#chat-panel .widget-warning{padding:6px 16px 0}#chat-panel .chat-actions{padding:0 16px}#chat-panel #messages{padding:12px 16px}#chat-panel form{padding:8px 16px}#chat-panel textarea{min-height:44px}#chat-panel #state{font-size:10px;margin-top:4px}}
/* Embedded: the loader gives the frame a 12 px transparent gutter at the top and right for the close button. */
.is-embedded #chat-panel{inset:12px 12px auto 0;width:auto;height:calc(var(--viewport-h,100dvh) - 12px)}
.is-embedded #chat-panel #chat-close{top:-12px;right:-12px}
/* Welcome view: Dentå studio photo (children with toothbrushes) behind the lower part of the
   empty conversation area, fading into the sand colour; it disappears once messages exist. */
#chat-panel #messages:has(.welcome){position:relative}
#chat-panel #messages:has(.welcome):before{content:'';position:absolute;left:0;right:0;bottom:0;height:64%;background:url('/static/denta-tervetuloa.jpg') center 22%/cover no-repeat;opacity:.92;-webkit-mask-image:linear-gradient(to top,#000 55%,transparent);mask-image:linear-gradient(to top,#000 55%,transparent);pointer-events:none}
#chat-panel .welcome{position:relative;z-index:1}
/* Launcher: dark square with the Dentå D; a lower beige band runs behind it, inside its height,
   slightly past it on the left and as far right as the 'Chat' label needs. */
#chat-launcher{right:28px;bottom:24px;display:flex;align-items:center;gap:0;min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#343229}
#chat-launcher:hover,#chat-launcher:focus-visible{background:transparent}
#chat-launcher .launcher-back{position:absolute;left:-10px;top:13px;bottom:13px;right:0;background:#e6e4d8;transition:background-color .2s}
#chat-launcher .launcher-mark{position:relative;flex:none;width:68px;height:68px;background:#343229 url('/static/denta-d.png') center/auto 34px no-repeat;transition:background-color .2s}
#chat-launcher .launcher-label{position:relative;max-width:none;opacity:1;overflow:visible;padding:0 20px 0 16px;font:600 14px/1 DentaWide,Arial,sans-serif;letter-spacing:.3px;color:#343229}
#chat-launcher:hover .launcher-mark{background-color:#48463f}
#chat-launcher:hover .launcher-back{background-color:#e1d8c4}
#chat-launcher:focus-visible{outline:2px solid #343229;outline-offset:6px}
@media(max-width:760px){#chat-launcher{right:16px;bottom:max(16px,env(safe-area-inset-bottom))}#chat-launcher .launcher-mark{width:56px;height:56px;background-size:auto 28px}#chat-launcher .launcher-back{top:11px;bottom:11px}#chat-launcher .launcher-label{padding:0 16px 0 14px;font-size:13px}}
/* Booking button under answers that point to booking (denta.fi 'VARAA AIKA' button style). */
#chat-panel .booking-link{display:inline-flex;align-items:center;gap:10px;margin:12px 0 4px;padding:10px 14px;background:#48463f;color:var(--beige);border:2px solid var(--taupe);font:600 13px/1 DentaWide,Arial,sans-serif;text-transform:uppercase;letter-spacing:.3px;text-decoration:none;white-space:nowrap;transition:background-color .3s ease-in-out,color .3s ease-in-out}
#chat-panel .booking-link:after{content:'';flex:none;width:20px;height:20px;background:currentColor;-webkit-mask:url('/static/nuoli.svg') center/contain no-repeat;mask:url('/static/nuoli.svg') center/contain no-repeat}
#chat-panel .booking-link:hover,#chat-panel .booking-link:focus-visible{background:var(--ink);color:#fff}
#chat-panel .booking-link:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
/* Language switch (FI SV EN) beside the photo, level with the logo; the chosen language is underlined in taupe. */
#chat-panel .lang-switch{align-self:start;display:flex;gap:2px;margin:-4px 0 0}
#chat-panel .lang-switch button{min-width:30px;min-height:30px;padding:4px 5px;border:0;background:transparent;color:var(--paper);opacity:.6;font:600 11px/1 DentaWide,Arial,sans-serif;letter-spacing:.6px;cursor:pointer;transition:opacity .2s}
#chat-panel .lang-switch button[aria-pressed=true]{opacity:1;text-decoration:underline;text-decoration-color:var(--taupe);text-decoration-thickness:2px;text-underline-offset:6px}
#chat-panel .lang-switch button:hover:not(:disabled){background:transparent;opacity:1}
#chat-panel .lang-switch button:focus-visible{outline:2px solid var(--taupe);outline-offset:0}
/* Narrow phones: the brand line moves under the logo so the language switch fits beside it. */
@media(max-width:420px){#chat-panel header{grid-template-columns:auto minmax(0,1fr) auto;column-gap:10px;row-gap:0}#chat-panel .chat-brand{display:contents}#chat-panel .chat-brand-logo{grid-column:1;grid-row:1;width:100px}#chat-panel header .eyebrow{grid-column:1/3;grid-row:2}#chat-panel .lang-switch{grid-column:2;grid-row:1;justify-self:end}#chat-panel .lang-switch button{min-width:26px;padding:4px 3px}#chat-panel .chat-header-photo{grid-column:3;grid-row:1/3;width:64px;height:52px}}
@media(max-width:420px) and (max-height:650px){#chat-panel .chat-brand-logo{width:88px}#chat-panel .chat-header-photo{height:40px}}
/* Smallest phones: the decorative photo gives way to the language switch. */
@media(max-width:360px){#chat-panel .chat-header-photo{display:none}}
/* A confirmed source that is not a denta.fi page: same line as the source links, without a link. */
#chat-panel .sources span{display:inline-flex;align-items:center;min-height:32px;padding:4px 0;font-size:12px;color:var(--ink)}
/* Answer actions: booking (dark) and call (outlined) side by side; they wrap on narrow screens. */
#chat-panel .answer-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 4px}
#chat-panel .answer-actions .booking-link{margin:0}
#chat-panel .call-link{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;background:transparent;color:var(--ink);border:2px solid #48463f;font:600 13px/1 DentaWide,Arial,sans-serif;text-transform:uppercase;letter-spacing:.3px;text-decoration:none;white-space:nowrap;transition:background-color .3s ease-in-out,color .3s ease-in-out}
#chat-panel .call-link:after{content:'';flex:none;width:20px;height:20px;background:currentColor;-webkit-mask:url('/static/puhelin.svg') center/contain no-repeat;mask:url('/static/puhelin.svg') center/contain no-repeat}
#chat-panel .call-link:hover,#chat-panel .call-link:focus-visible{background:#48463f;color:var(--beige)}
#chat-panel .call-link:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
#chat-panel .feedback{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-top:10px;font-size:12px;color:var(--muted)}
#chat-panel .feedback-up,#chat-panel .feedback-down{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--ink);cursor:pointer}
#chat-panel .feedback-up:before,#chat-panel .feedback-down:before{content:'';width:18px;height:18px;background:currentColor;-webkit-mask:url('/static/peukku.svg') center/contain no-repeat;mask:url('/static/peukku.svg') center/contain no-repeat}
#chat-panel .feedback-down:before{transform:rotate(180deg)}
#chat-panel .feedback-up:hover:not(:disabled),#chat-panel .feedback-down:hover:not(:disabled){background:var(--beige)}
#chat-panel .feedback button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
#chat-panel .feedback button:disabled{opacity:.5;cursor:default}
#chat-panel .feedback-share{flex-basis:100%;display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--paper);border:1px solid var(--line);color:var(--ink)}
#chat-panel .feedback-share p{margin:0;font-size:12px;line-height:1.5}
#chat-panel .share-buttons{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
#chat-panel .share-send{min-height:40px;padding:8px 14px;background:#48463f;color:var(--beige);border:2px solid #48463f;font:600 12px/1 DentaWide,Arial,sans-serif;text-transform:uppercase;letter-spacing:.3px;cursor:pointer}
#chat-panel .share-send:hover:not(:disabled){background:var(--ink);color:#fff}
#chat-panel .share-decline{min-height:40px;padding:8px 0;border:0;background:transparent;color:var(--ink);font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
#chat-panel .feedback-note{font-size:12px;color:var(--muted)}
/* Free-times card under an availability answer (app.js appendSlots): group buttons like the
   suggestions, the chosen one dark; times by day; 'Later times' outlined like the call button. */
#chat-panel .slots{margin:14px 0 4px;padding:14px 14px 16px;background:var(--paper);border:1px solid var(--line);border-radius:0;color:var(--ink);white-space:normal;line-height:1.5}
#chat-panel .slots [hidden]{display:none}
#chat-panel .slots-title{margin:0 0 10px;font:600 13px/1.2 DentaWide,Arial,sans-serif;letter-spacing:.3px;text-transform:uppercase}
#chat-panel .slots-groups{display:flex;flex-wrap:wrap;gap:6px}
#chat-panel .slots-groups button{flex:1 1 auto;min-height:44px;padding:8px 10px;border:0;background:var(--beige);color:var(--ink);font-size:12px;line-height:1.3;overflow-wrap:normal}
#chat-panel .slots-groups button:hover:not(:disabled){background:#d2c6b0}
#chat-panel .slots-groups button[aria-pressed=true],#chat-panel .slots-groups button[aria-pressed=true]:hover:not(:disabled){background:#48463f;color:var(--beige)}
#chat-panel .slots button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
#chat-panel .slots-results{margin-top:12px;font-size:13px;line-height:1.5}
#chat-panel .slots-results p{margin:0 0 6px}
#chat-panel .slots-visit{font-weight:600}
#chat-panel .slots-loading{color:var(--muted);font-style:italic}
#chat-panel .slots-day{margin:12px 0 2px;font:600 12px/1.4 DentaWide,Arial,sans-serif;letter-spacing:.2px}
#chat-panel .slots-list{margin:0;padding:0;list-style:none}
#chat-panel .slots-list li{padding:4px 0;border-bottom:1px solid var(--beige)}
#chat-panel .slots-results .slots-partial,#chat-panel .slots-results .slots-notice{margin:10px 0 0}
#chat-panel .slots-note{margin:12px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}
#chat-panel .slots-later,#chat-panel .slots-retry{display:inline-flex;align-items:center;gap:10px;margin-top:12px;min-height:44px;padding:10px 14px;background:transparent;color:var(--ink);border:2px solid #48463f;font:600 13px/1 DentaWide,Arial,sans-serif;text-transform:uppercase;letter-spacing:.3px;white-space:nowrap;transition:background-color .3s ease-in-out,color .3s ease-in-out}
#chat-panel .slots-later:after,#chat-panel .slots-retry:after{content:'';flex:none;width:20px;height:20px;background:currentColor;-webkit-mask:url('/static/nuoli.svg') center/contain no-repeat;mask:url('/static/nuoli.svg') center/contain no-repeat}
#chat-panel .slots-later:hover:not([aria-disabled]),#chat-panel .slots-retry:hover:not([aria-disabled]){background:#48463f;color:var(--beige)}
#chat-panel .slots-later[aria-disabled],#chat-panel .slots-retry[aria-disabled]{opacity:.55;cursor:default}

