
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f3f5f9;
}

body {
    position: relative;
}

.canva-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #f6f7fb;
}

.canva-embed-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    margin: 0;
    background: #ffffff;
    overflow: hidden;
}

#canvaFrame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: white;
}

.canva-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #f3f6ff, #eafaf0);
    color: #1f2937;
    padding: 24px;
    box-sizing: border-box;
    z-index: 2;
}

.canva-fallback p {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 600;
}

.canva-fallback a {
    display: inline-block;
    padding: 10px 18px;
    background: #4285F4;
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.chat-widget {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    left: auto;
    z-index: 9999;
    width: 72px;
    height: 72px;
    pointer-events: auto;
    transition: width 0.18s ease, height 0.18s ease;
}

.chat-widget.open {
    width: min(360px, calc(100vw - 28px));
    height: 480px;
}

.chat-toggle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 72px;
    height: 72px;
    padding: 7px;
    border: 2px solid rgba(255, 255, 255, 0.96);
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.32), 0 10px 28px rgba(15, 23, 42, 0.34);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.18s ease, visibility 0.18s ease;
    opacity: 1;
    visibility: visible;
}

.chat-widget.open .chat-toggle {
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transform: scale(0.9);
    filter: none;
    z-index: 0;
}

.chat-toggle:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35), 0 14px 32px rgba(15, 23, 42, 0.4);
}

.chat-icon {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: chatbot-float 3.2s ease-in-out infinite;
}

.chat-badge {
    position: absolute;
    left: -118px;
    top: 8px;
    background: rgba(17, 24, 39, 0.96);
    color: #ffffff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.24);
}

.chat-outside-badge {
    z-index: 2;
}

.bot-antenna {
    fill: none;
    stroke: #e0f2fe;
    stroke-width: 4;
    stroke-linecap: round;
}

.bot-antenna-light {
    fill: #fef08a;
    stroke: #ffffff;
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    animation: chatbot-signal 1.8s ease-in-out infinite;
}

.bot-ear {
    fill: url(#botEarGradient);
    stroke: #ffffff;
    stroke-width: 2.5;
}

.bot-head {
    fill: url(#botShellGradient);
    stroke: #ffffff;
    stroke-width: 3;
}

.bot-face-shine {
    fill: none;
    stroke: rgba(255, 255, 255, 0.62);
    stroke-width: 2;
    stroke-linecap: round;
}

.bot-eye {
    fill: #111827;
    stroke: #ffffff;
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    animation: chatbot-blink 5s ease-in-out infinite;
}

.bot-smile {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linecap: round;
}

.bot-cheek {
    fill: #fda4af;
    opacity: 0.95;
}

@keyframes chatbot-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes chatbot-signal {
    0%, 100% { transform: scale(0.88); opacity: 0.78; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes chatbot-blink {
    0%, 44%, 48%, 100% { transform: scaleY(1); }
    46% { transform: scaleY(0.12); }
}

.chat-notification {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 19px;
    height: 19px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
}

.chat-notification:not([hidden]) {
    display: block;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-minimize,
.chat-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-size: 1.7rem;
}

.chat-minimize {
    font-size: 1.8rem;
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .chat-icon,
    .bot-antenna-light,
    .bot-eye {
        animation: none;
    }
}

.chat-container {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(360px, calc(100vw - 28px));
    max-height: min(72vh, 560px);
    height: 480px;
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.chat-widget.open .chat-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-header {
    background: linear-gradient(135deg, #1f6dff, #34a853);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    box-sizing: border-box;
}

.chat-messages {
    flex: 1;
    padding: 16px 14px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, #f8faff, #f2f5fb);
}

.msg {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 78%;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.45;
    box-sizing: border-box;
}

.user-msg {
    background: linear-gradient(135deg, #4f8cff, #2e6af2);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.bot-msg {
    background: #ffffff;
    color: #1f2937;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: white;
}

.chat-input-area input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #dfe6ee;
    border-radius: 999px;
    outline: none;
    font-size: 0.95rem;
    background: #f8fafc;
}

.chat-input-area input:focus {
    border-color: #4f8cff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
}

.chat-input-area button {
    background: linear-gradient(135deg, #1f6dff, #2f7cf6);
    color: white;
    border: none;
    padding: 0 18px;
    height: 40px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.chat-input-area button:hover {
    opacity: 0.95;
}

@media (max-width: 640px) {
    .chat-container {
        width: min(92vw, 340px);
        height: min(70vh, 460px);
    }

    .chat-toggle {
        width: 66px;
        height: 66px;
    }
}

