/* Evelyn consultation: the transcript owns the available dialog space. */
[data-studio-booking="1"] [hidden] { display: none !important; }
#studio-chat-root { font-family: inherit; }
#studio-chat-root :is(button, input, select, textarea) { font-family: inherit; }
#studio-chat-root, #studio-chat-root * { box-sizing: border-box; }
.studio-chat-launcher { position: fixed; z-index: 80; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: .55rem; width: auto; max-width: calc(100vw - 2rem); min-height: 4rem; border: 1px solid #f26522; border-radius: 1rem; padding: .375rem .625rem; background: #111827; color: #fff; box-shadow: 0 6px 24px #0004; text-align: left; cursor: pointer; }
.studio-chat-launcher:hover { background: #253044; }
.studio-chat-launcher[hidden], .studio-chat-backdrop[hidden], .studio-chat-panel[hidden] { display: none; }
body[data-navigation-open="true"] .studio-chat-launcher { display: none; }
.studio-chat-launcher:focus-visible, .studio-chat-panel :focus-visible { outline: 3px solid #f26522; outline-offset: 3px; }
.studio-chat-launcher-icon { display: none; }
.studio-chat-launcher-portrait, .studio-chat-head-portrait { display: block; flex: none; width: 2rem; height: 2rem; overflow: hidden; border-radius: 50%; background: #e1dfdc; }
.studio-chat-launcher-avatar, .studio-chat-head-avatar { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: translateY(2px) scale(1.25); transform-origin: center top; }
.studio-chat-launcher-portrait { width: 3rem; height: 3rem; border: 1px solid #fff; }
.studio-chat-launcher-copy { min-width: 0; }
.studio-chat-launcher-copy strong { font-size: .875rem; line-height: 1.3; }
.studio-chat-launcher-copy small { display: none; }
.studio-chat-backdrop { position: fixed; inset: 0; z-index: 80; background: #11182766; touch-action: none; }
.studio-chat-panel { position: fixed; z-index: 81; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; width: min(31.25rem, calc(100vw - 2rem)); height: min(50rem, calc(100dvh - 2rem)); min-height: 0; overflow: hidden; border: 1px solid #ded7d1; border-radius: 1rem; background: #fff; box-shadow: 0 20px 60px #0004; color: #111827; }
.studio-chat-panel[data-visual-viewport] { top: calc(var(--studio-chat-viewport-top) + var(--studio-chat-viewport-height) - min(50rem, calc(var(--studio-chat-viewport-height) - 2rem)) - 1rem); bottom: auto; height: min(50rem, calc(var(--studio-chat-viewport-height) - 2rem)); max-height: calc(var(--studio-chat-viewport-height) - 2rem); }
.studio-chat-head { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) 2.75rem; flex: none; align-items: center; gap: .625rem; min-height: 4.25rem; padding: .375rem .5rem; background: #111827; color: #fff; }
.studio-chat-head-portrait { width: 3.25rem; height: 3.25rem; border: 1px solid #f26522; }
.studio-chat-head-avatar { transform: translateY(2px) scale(1.25); }
.studio-chat-head-copy { min-width: 0; }
.studio-chat-head strong, .studio-chat-head small { display: block; }
.studio-chat-head strong { font-size: .9375rem; line-height: 1.25; }
.studio-chat-head small { margin-top: .1rem; color: #e5e7eb; font-size: .6875rem; line-height: 1.25; }
.studio-chat-close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: .5rem; padding: 0; background: transparent; color: #fff; font-size: 1.75rem; line-height: 1; cursor: pointer; }
.studio-chat-close:hover { background: #253044; }
.studio-chat-log { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; flex: 1 1 0; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 1rem; scroll-padding-block: 1rem; background: #f8f6f3; -webkit-overflow-scrolling: touch; }
.studio-chat-log > * { flex-shrink: 0; }
.studio-chat-bubble { max-width: 94%; margin: 0; border-radius: .85rem; padding: .75rem .875rem; background: #fff; box-shadow: 0 1px 4px #0001; font-size: .9375rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.studio-chat-visitor { align-self: flex-end; max-width: 90%; background: #fff0e9; }
.studio-chat-source { align-self: flex-start; font-size: .75rem; color: #85400d; text-decoration: underline; }
.studio-chat-work { flex: 0 1 auto; min-height: 0; min-width: 0; max-height: 62%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-top: 1px solid #e5e1dc; padding: .75rem; background: #fff; }
.studio-chat-work[data-phase="conversation"] { flex: 0 0 auto; max-height: min(15rem, 50%); padding: .5rem .75rem .625rem; }
.studio-chat-form, .studio-chat-actions { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.studio-chat-work[data-phase="conversation"] .studio-chat-form { gap: .375rem; }
.studio-chat-actions { flex-direction: row; flex-wrap: wrap; margin-top: .2rem; }
.studio-chat-heading { margin: 0 0 .65rem; padding: 0; color: #111827; font-size: 1rem; line-height: 1.35; font-weight: 700; letter-spacing: normal; text-transform: none; }
.studio-chat-label { display: flex; flex-direction: column; gap: .3rem; min-width: 0; font-size: .8125rem; font-weight: 700; }
.studio-chat-input { width: 100%; min-width: 0; min-height: 2.75rem; border: 1px solid #818a8d; border-radius: .5rem; padding: .55rem .65rem; background: #fff; color: #111827; font: inherit; font-size: .9375rem; line-height: 1.4; font-weight: 400; }
textarea.studio-chat-input { min-height: 3.5rem; resize: vertical; }
.studio-chat-input, .studio-chat-button { scroll-margin-block: .75rem; }
.studio-chat-button { min-height: 2.75rem; border: 1px solid #111827; border-radius: .5rem; padding: .55rem .75rem; background: #fff; color: #111827; font-size: .8125rem; font-weight: 700; overflow-wrap: anywhere; cursor: pointer; }
.studio-chat-button:hover { background: #fff0e9; }
.studio-chat-button:disabled { opacity: .6; cursor: not-allowed; }
.studio-chat-primary { border-color: #c94a12; background: #c94a12; color: #fff; }
.studio-chat-primary:hover { background: #a93a0a; color: #fff; }
.studio-chat-status, .studio-chat-note { margin: .35rem 0; color: #4b5563; font-size: .75rem; line-height: 1.4; overflow-wrap: anywhere; }
.studio-chat-status { border-radius: .5rem; padding: .65rem; background: #fff0e9; color: #111827; }
.studio-chat-error { background: #fff0eb; color: #8c2b10; }
.studio-chat-consent { display: flex; align-items: center; min-height: 1.5rem; gap: .45rem; margin: 0; color: #4b5563; font-size: .75rem; line-height: 1.4; }
.studio-chat-consent input { flex: none; width: 1rem; height: 1rem; margin: 0; accent-color: #c94a12; }
.studio-chat-consent span { min-width: 0; flex: 1; }
.studio-chat-consent a, .studio-chat-booking-confirm a { color: #85400d; text-decoration: underline; }
.studio-chat-group { display: flex; flex-direction: column; gap: .7rem; min-width: 0; margin: 0; border: 1px solid #ded7d1; border-radius: .65rem; padding: .8rem; }
.studio-chat-group legend { max-width: 100%; padding: 0 .25rem; color: #111827; font-size: .8125rem; line-height: 1.4; font-weight: 700; }
.studio-chat-group p { overflow-wrap: anywhere; }
.studio-chat-summary { padding-right: .1rem; }
.studio-chat-summary .studio-chat-note { font-weight: 400; }
.studio-chat-pending { padding: .65rem; border: 1px solid #ded7d1; border-radius: .5rem; white-space: pre-wrap; }
.studio-chat-draft-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .45rem .65rem; margin: .8rem 0; font-size: .8125rem; line-height: 1.45; overflow-wrap: anywhere; }
.studio-chat-draft-list dt { font-weight: 700; }
.studio-chat-draft-list dd { margin: 0; white-space: pre-wrap; }
.studio-chat-slot-area, .studio-chat-booking-confirm { display: flex; flex-direction: column; gap: .5rem; }
.studio-chat-booking-confirm { border: 1px solid #d5ddd8; border-radius: .65rem; padding: .7rem; }
.studio-chat-booking-confirm p { margin: 0; font-size: .8125rem; line-height: 1.4; overflow-wrap: anywhere; }

/* One growing message field and three integrated, full-size touch controls. */
.studio-chat-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .25rem; min-width: 0; border: 1px solid #818a8d; border-radius: .85rem; padding: .25rem; background: #fff; }
.studio-chat-message-label { display: block; min-width: 0; font-size: 0; }
textarea.studio-chat-message { display: block; width: 100%; height: 2.75rem; min-height: 2.75rem; max-height: 5.5rem; overflow-y: auto; border: 0; border-radius: .5rem; padding: .55rem .375rem; background: #fff; color: #111827; font: inherit; font-size: 1rem; line-height: 1.45; resize: none; }
.studio-chat-message::placeholder { color: #6b7280; opacity: 1; }
.studio-chat-composer-controls { display: flex; flex: none; align-items: center; gap: 0; min-width: 0; }
.studio-chat-icon-button { display: inline-grid; flex: none; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: .6rem; padding: .6rem; color: #394251; background: transparent; cursor: pointer; }
.studio-chat-icon-button svg { width: 1.3rem; height: 1.3rem; }
.studio-chat-icon-button:hover { background: #fff0e9; }
.studio-chat-icon-button:disabled { opacity: .45; cursor: not-allowed; }
.studio-chat-send-arrow { margin-left: .125rem; color: #fff; background: #c94a12; }
.studio-chat-send-arrow:hover { color: #fff; background: #a93a0a; }
.studio-chat-file-limits { margin: 0; color: #4b5563; font-size: .6875rem; }
.studio-chat-attachment-list { display: flex; flex-direction: column; gap: .3rem; min-width: 0; max-height: 9.5rem; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.studio-chat-attachment-list:empty, .studio-chat-website-action:empty { display: none; }
.studio-chat-attachment { display: flex; flex: none; align-items: center; gap: .45rem; min-width: 0; min-height: 2.75rem; border: 1px solid #e5e1dc; border-radius: .6rem; padding: .15rem .25rem .15rem .4rem; background: #faf9f7; }
.studio-chat-attachment-preview, .studio-chat-file-icon { flex: none; width: 2rem; height: 2rem; border-radius: .35rem; object-fit: cover; }
.studio-chat-file-icon { display: grid; place-items: center; border: 1px solid #e5d3c8; background: #fff0e9; color: #85400d; font-size: .6rem; font-weight: 700; }
.studio-chat-attachment-details { flex: 1; min-width: 0; }
.studio-chat-attachment-details strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .75rem; line-height: 1.3; }
.studio-chat-attachment-details small { display: block; margin-top: .125rem; overflow-wrap: anywhere; font-size: .6875rem; line-height: 1.3; }
.studio-chat-remove-file { width: 2.75rem; height: 2.75rem; padding: .2rem; font-size: 1.3rem; }
.studio-chat-upload-progress { width: 100%; height: .4rem; margin-top: .2rem; accent-color: #c94a12; }
.studio-chat-file-summary { margin: .3rem 0 0; font-size: .75rem; line-height: 1.45; overflow-wrap: anywhere; }
.studio-chat-file-analysis { margin-top: .25rem; font-size: .6875rem; line-height: 1.4; }
.studio-chat-file-analysis summary, .studio-chat-analysis-details summary { padding-block: .25rem; color: #85400d; cursor: pointer; text-decoration: underline; }
.studio-chat-sent-files { display: block; margin-top: .35rem; border-top: 1px solid #e5d3c8; padding-top: .3rem; font-size: .75rem; }
.studio-chat-website-action { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.studio-chat-website-domain { color: #4b5563; font-size: .75rem; overflow-wrap: anywhere; }

/* Real work status stays small; full bounded results are available in details. */
.studio-chat-analysis-card { position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); align-items: start; gap: .35rem .625rem; width: 94%; max-width: 100%; min-height: 0; border: 1px solid #e5d3c8; border-radius: .8rem; padding: .65rem; background: #fff; overflow: hidden; }
.studio-chat-analysis-graphic { position: relative; display: block; width: 2.25rem; height: 2.75rem; perspective: 12rem; }
.studio-chat-analysis-page { position: absolute; inset: .2rem .1rem .1rem .35rem; border: 1px solid #a78e7b; border-radius: .25rem; background: repeating-linear-gradient(to bottom, #fff 0, #fff .4rem, #ebded3 .4rem, #ebded3 .45rem); transform-origin: left center; }
.studio-chat-analysis-page-back { transform: translate(-.25rem, -.15rem) rotate(-6deg); background: #f1e8e0; }
.studio-chat-analysis-page-middle { transform: translate(-.125rem, -.075rem) rotate(-3deg); background: #faf4ee; }
.studio-chat-analysis-page-front { animation: studio-chat-review-flip 1.8s ease-in-out infinite; }
.studio-chat-analysis-scan { position: absolute; top: .3rem; left: .2rem; right: .1rem; height: 2px; background: #d65a20; box-shadow: 0 0 .5rem #f2652277; animation: studio-chat-review-scan 1.6s ease-in-out infinite alternate; }
.studio-chat-analysis-copy { display: flex; min-width: 0; flex-direction: column; gap: .15rem; font-size: .8125rem; line-height: 1.35; }
.studio-chat-analysis-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #4b5563; font-size: .6875rem; }
.studio-chat-analysis-phase { color: #85400d; font-size: .6875rem; }
.studio-chat-analysis-details { grid-column: 1 / -1; min-width: 0; font-size: .75rem; line-height: 1.45; }
.studio-chat-analysis-summary { grid-column: 1 / -1; margin: .35rem 0 0; font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.studio-chat-analysis-card[data-state="done"] .studio-chat-analysis-scan, .studio-chat-analysis-card[data-state="error"] .studio-chat-analysis-scan { animation: none; opacity: 0; }
.studio-chat-analysis-card[data-state="done"] .studio-chat-analysis-page-front, .studio-chat-analysis-card[data-state="error"] .studio-chat-analysis-page-front { animation: none; transform: none; }
.studio-chat-analysis-card[data-state="error"] { background: #fff0eb; }
.studio-chat-sr-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.studio-chat-typing { display: flex; align-items: center; gap: .6rem; min-height: 2.65rem; min-width: 11rem; }
.studio-chat-typing-text { animation: studio-chat-typing-pulse 1.2s ease-in-out infinite; }
.studio-chat-typing-dots { display: inline-flex; align-items: center; gap: .22rem; height: .7rem; }
.studio-chat-typing-dot { width: .25rem; height: .25rem; border-radius: 50%; background: currentColor; animation: studio-chat-typing-bounce 1.2s ease-in-out infinite; }
.studio-chat-typing-dot:nth-child(2) { animation-delay: .15s; }
.studio-chat-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes studio-chat-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-2px); opacity: 1; } }
@keyframes studio-chat-typing-pulse { 0%, 100% { opacity: .65; } 40% { opacity: 1; } }
@keyframes studio-chat-review-scan { from { transform: translateY(0); } to { transform: translateY(2rem); } }
@keyframes studio-chat-review-flip { 0%, 100% { transform: rotateY(0deg); } 45% { transform: rotateY(-35deg) translateX(-.08rem); } 65% { transform: rotateY(-8deg); } }

@media (max-width: 600px) {
  .studio-chat-launcher { right: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom)); width: auto; max-width: calc(100vw - 1.5rem); min-height: 3.5rem; border-radius: .85rem; padding: .375rem .5rem; }
  .studio-chat-launcher-portrait { width: 2.5rem; height: 2.5rem; }
  .studio-chat-launcher-copy strong { font-size: .8125rem; }
  .studio-chat-panel, .studio-chat-panel[data-visual-viewport] { inset: 0; top: var(--studio-chat-viewport-top, 0px); bottom: auto; width: 100%; height: var(--studio-chat-viewport-height, 100dvh); max-height: var(--studio-chat-viewport-height, 100dvh); border: 0; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-bottom: clamp(0px, calc(env(safe-area-inset-bottom, 0px) - (100svh - var(--studio-chat-viewport-height, 100svh))), env(safe-area-inset-bottom, 0px)); }
  .studio-chat-head { padding-inline: .375rem; }
  .studio-chat-log { gap: .625rem; padding: .75rem; scroll-padding-block: .75rem; }
  .studio-chat-bubble { font-size: 1rem; line-height: 1.5; }
  .studio-chat-work { padding: .625rem; }
  .studio-chat-work[data-phase="conversation"] { padding: .5rem .625rem; }
  .studio-chat-input { font-size: 1rem; }
  .studio-chat-group { padding: .65rem; }
  .studio-chat-analysis-card { width: 96%; }
}
.studio-chat-panel[data-compact-viewport] .studio-chat-log { gap: .5rem; padding-block: .5rem; }
.studio-chat-panel[data-compact-viewport] .studio-chat-work[data-phase="conversation"] { max-height: 50%; padding-block: .375rem; }
.studio-chat-panel[data-compact-viewport] .studio-chat-attachment-list { max-height: 3.25rem; }
.studio-chat-panel[data-compact-viewport] textarea.studio-chat-message { max-height: 4rem; }
@media (max-height: 400px) {
  .studio-chat-panel:not([data-visual-viewport]) { bottom: .5rem; height: calc(100dvh - 1rem); }
  .studio-chat-work[data-phase="conversation"] { padding-block: .375rem; }
  textarea.studio-chat-message { max-height: 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-chat-panel, .studio-chat-button { scroll-behavior: auto; }
  .studio-chat-typing-dot, .studio-chat-typing-text { animation: none; transform: none; opacity: 1; }
  .studio-chat-analysis-scan { animation: none; top: 1.4rem; opacity: .7; }
  .studio-chat-analysis-page-front { animation: none; transform: none; }
}

.studio-chat-launcher[data-enquiry-avoidance="hidden"] { display: none; }
