/* GrL'Ca Chat — visitor widget */
.gcch { --gcch-color: #2563eb; --gcch-z: 99999; position: fixed; bottom: 20px; z-index: var(--gcch-z); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #111827; -webkit-font-smoothing: antialiased; }
.gcch--right { right: 20px; }
.gcch--left  { left: 20px; }
.gcch *, .gcch *::before, .gcch *::after { box-sizing: border-box; }
.gcch [hidden] { display: none !important; }
.gcch button { font: inherit; cursor: pointer; }

/* Launcher pill */
.gcch-bubble { position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 26px; border: 0; background: var(--gcch-color); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.22); transition: transform .15s; text-align: left; }
.gcch-bubble:hover { transform: translateY(-1px); }
.gcch-bubble svg { width: 24px; height: 24px; flex: none; }
.gcch-bubble__close { display: none; }
.gcch-bubble.is-open .gcch-bubble__icon { display: none; }
.gcch-bubble.is-open .gcch-bubble__close { display: block; }
.gcch-bubble__text { display: flex; flex-direction: column; line-height: 1.15; }
.gcch-bubble__label { font-weight: 700; font-size: 14px; white-space: nowrap; }
.gcch-bubble__state { display: flex; align-items: center; gap: 5px; font-size: 11px; opacity: .92; }
.gcch-bubble.is-open .gcch-bubble__state { display: none; }
.gcch-bubble__dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; flex: none; }
.gcch-bubble__dot--on { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.gcch-bubble__badge { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; border: 2px solid #fff; }

/* Panel */
.gcch-panel { position: absolute; bottom: 66px; width: 380px; max-width: calc(100vw - 40px); height: 600px; max-height: calc(100vh - 110px); background: #fff; border-radius: 16px; box-shadow: 0 12px 48px rgba(0,0,0,.24); display: flex; flex-direction: column; overflow: hidden; animation: gcch-in .18s ease-out; }
.gcch--right .gcch-panel { right: 0; }
.gcch--left  .gcch-panel { left: 0; }
@keyframes gcch-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.gcch-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; background: var(--gcch-color); color: #fff; }
.gcch-head__avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; flex: none; }
.gcch-head__avatar svg { width: 22px; height: 22px; }
.gcch-head__text { flex: 1; min-width: 0; }
.gcch-head__title { font-weight: 700; font-size: 16px; }
.gcch-head__status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcch-head__status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex: none; }
.gcch-head__status--on::before { background: #4ade80; }
.gcch-head__btn { width: 34px; height: 34px; border: 0; background: transparent; color: #fff; border-radius: 8px; font-size: 18px; line-height: 1; opacity: .9; }
.gcch-head__btn:hover { background: rgba(255,255,255,.18); opacity: 1; }
.gcch-menu { position: absolute; top: 56px; right: 12px; background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; z-index: 2; min-width: 190px; }
.gcch-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 6px; color: #111827; font-size: 14px; }
.gcch-menu button:hover { background: #f3f4f6; }

.gcch-body { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #f8fafc; display: flex; flex-direction: column; gap: 10px; }
.gcch-day { text-align: center; font-size: 11px; color: #9ca3af; margin: 4px 0; }
.gcch-sys { text-align: center; font-size: 12px; color: #6b7280; background: #eef2f7; border-radius: 8px; padding: 6px 10px; align-self: center; max-width: 90%; }
.gcch-note { font-size: 13px; color: #374151; background: #fef3c7; border-radius: 10px; padding: 10px 12px; }

.gcch-msg { display: flex; flex-direction: column; max-width: 84%; }
.gcch-msg--agent { align-self: flex-start; align-items: flex-start; }
.gcch-msg--me { align-self: flex-end; align-items: flex-end; }
.gcch-msg__bubble { padding: 10px 13px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); word-wrap: break-word; overflow-wrap: anywhere; }
.gcch-msg--agent .gcch-msg__bubble { border-bottom-left-radius: 4px; }
.gcch-msg--me .gcch-msg__bubble { background: var(--gcch-color); color: #fff; border-bottom-right-radius: 4px; }
.gcch-msg__text { white-space: pre-wrap; }
.gcch-msg__text a { color: inherit; text-decoration: underline; }
.gcch-msg__meta { font-size: 11px; color: #9ca3af; margin: 3px 6px 0; }
.gcch-att-img img { display: block; max-width: 240px; max-height: 240px; border-radius: 10px; }
.gcch-att-file { display: inline-block; color: inherit; text-decoration: underline; }

/* Forms */
.gcch-form { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 10px; }
.gcch-form__intro { margin: 0; font-size: 13px; color: #374151; }
.gcch-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #6b7280; }
.gcch-field input, .gcch-field textarea { font: inherit; font-size: 15px; color: #111827; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; width: 100%; }
.gcch-field input:focus, .gcch-field textarea:focus, .gcch-input:focus { outline: none; border-color: var(--gcch-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gcch-color) 20%, transparent); }
.gcch-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #6b7280; }
.gcch-consent input { margin-top: 3px; }
.gcch-hp { position: absolute; left: -9999px; }
.gcch-btn { border: 0; background: var(--gcch-color); color: #fff; padding: 11px 16px; border-radius: 9px; font-weight: 600; font-size: 15px; }
.gcch-btn:disabled { opacity: .5; cursor: default; }
.gcch-form__err { color: #b91c1c; font-size: 13px; }
.gcch-center { text-align: center; }
.gcch-stars { display: flex; gap: 4px; justify-content: center; }
.gcch-star { border: 0; background: none; font-size: 30px; color: #d1d5db; padding: 0 2px; line-height: 1; }
.gcch-star.is-on { color: #f59e0b; }

/* Composer */
.gcch-foot { display: flex; align-items: flex-end; gap: 6px; padding: 10px 10px 10px 8px; border-top: 1px solid #e5e7eb; background: #fff; }
.gcch-attach { width: 38px; height: 40px; display: flex; align-items: center; justify-content: center; color: #6b7280; cursor: pointer; border-radius: 8px; flex: none; }
.gcch-attach:hover { background: #f3f4f6; color: #111827; }
.gcch-attach svg { width: 22px; height: 22px; }
.gcch-input { flex: 1; resize: none; font: inherit; font-size: 15px; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 12px; max-height: 120px; min-height: 40px; line-height: 1.4; }
.gcch-send { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--gcch-color); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.gcch-send svg { width: 20px; height: 20px; margin-left: 2px; }

.gcch-flash { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); background: #111827; color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 8px; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }

/* Phone: full screen */
@media (max-width: 640px) {
    .gcch.is-open { bottom: 0; right: 0; left: 0; }
    .gcch-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
    .gcch.is-open .gcch-bubble { display: none; }
    .gcch-head { padding-top: max(14px, env(safe-area-inset-top)); }
    .gcch-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
