.ecoffee-ai-root{--eco-brown:#3b2418;--eco-green:#1d6547;--eco-text:#1e201e;--eco-muted:#616965;--eco-border:#e7e8e4;font-family:system-ui,-apple-system,'Segoe UI',Arial,sans-serif;color:var(--eco-text);font-size:14px;line-height:1.45;box-sizing:border-box;z-index:999990}
.ecoffee-ai-root *{box-sizing:border-box}
.ecoffee-ai-launcher{position:fixed;right:22px;bottom:20px;background:var(--eco-brown);border:1px solid rgba(255,255,255,.17);border-radius:999px;color:#fff;font-weight:700;padding:12px 17px;display:flex;align-items:center;gap:8px;box-shadow:0 8px 25px #0003;cursor:pointer;z-index:999990}
.ecoffee-ai-launcher:hover{background:#53352a;color:#fff}.ecoffee-ai-cup{font-size:20px}
.ecoffee-ai-panel[hidden]{display:none!important}
.ecoffee-ai-panel{position:fixed;right:22px;bottom:80px;width:360px;max-width:calc(100vw - 28px);height:min(590px,calc(100dvh - 110px));background:#fff;border:1px solid var(--eco-border);border-radius:18px;box-shadow:0 14px 48px #0003;display:flex;flex-direction:column;overflow:hidden;z-index:999991;text-align:left}
.ecoffee-ai-header{flex-shrink:0;background:var(--eco-brown);color:#fff;padding:13px 15px;display:flex;justify-content:space-between;align-items:center;gap:12px}
.ecoffee-ai-header>div{display:flex;flex-direction:column;gap:2px}.ecoffee-ai-header strong{font-size:16px;color:#fff}.ecoffee-ai-header span{font-size:11px;color:#fffe}
.ecoffee-ai-close{border:none;background:#ffffff20;color:#fff;width:30px;height:30px;border-radius:50%;font-size:23px;line-height:1;cursor:pointer}
.ecoffee-ai-messages{padding:15px;overflow-y:auto;flex:1;background:#f8f7f5;display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-height:0}
.ecoffee-ai-message{background:#fff;padding:11px 12px;border-radius:13px;white-space:pre-wrap;overflow-wrap:anywhere;max-width:96%;box-shadow:0 1px 3px #0001;font-size:13px;color:#242424}
.ecoffee-ai-user-msg{background:#e5f1e9;align-self:flex-end}.ecoffee-ai-assistant-msg{align-self:flex-start}
.ecoffee-ai-products{display:flex;flex-direction:column;gap:8px;margin-top:10px;white-space:normal}
.ecoffee-ai-product{display:flex;flex-direction:column;align-items:flex-start;padding:9px 10px;background:#f9f7f3;border:1px solid #e4e0d9;border-radius:9px;gap:5px}
.ecoffee-ai-product strong{font-size:12px;font-weight:650;color:#32271f}
.ecoffee-ai-price{color:#1c674b;font-size:13px;font-weight:750}
.ecoffee-ai-product a{display:inline-block;padding:6px 10px;border-radius:8px;background:#1d6547;text-decoration:none;color:white!important;font-weight:650;font-size:12px}
.ecoffee-ai-suggestions{padding:10px 10px 4px;display:flex;gap:5px;flex-wrap:wrap;background:#fff}
.ecoffee-ai-suggestions button{background:#f4f3ef;border:1px solid #e5e2db;color:#4a352b;font-size:11px;padding:6px 9px;border-radius:20px;cursor:pointer}
.ecoffee-ai-contact{padding:6px 10px;display:flex;flex-wrap:wrap;gap:7px;background:#fff}
.ecoffee-ai-contact a{font-size:11px;color:var(--eco-green);text-decoration:none;border-bottom:1px solid #ddd;padding:3px 0}
.ecoffee-ai-form{padding:8px 10px 5px;background:#fff;display:flex;gap:6px;align-items:center;flex-shrink:0}
.ecoffee-ai-form input{min-width:0;flex:1;border:1px solid #d9dcd7!important;border-radius:10px!important;font-size:13px!important;padding:10px!important;line-height:1.25!important;height:auto!important;box-shadow:none!important;background:#fff;color:#161616}
.ecoffee-ai-form button{border:0;border-radius:10px;padding:10px 12px;background:#1d6547;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.ecoffee-ai-form button:disabled{opacity:.55;cursor:wait}
.ecoffee-ai-privacy{font-size:10px;color:#606963;padding:0 11px 11px;line-height:1.3;background:#fff}
.ecoffee-admin-preview{max-width:490px;padding:20px 0}.ecoffee-admin-preview .ecoffee-ai-root{position:relative;z-index:1}.ecoffee-admin-preview .ecoffee-ai-launcher{position:relative;bottom:auto;right:auto;margin-bottom:10px;width:max-content}.ecoffee-admin-preview .ecoffee-ai-panel{position:relative;right:auto;bottom:auto;width:410px;max-width:100%;height:500px;box-shadow:0 3px 15px #0001}
@media(max-width:600px){.ecoffee-ai-launcher{right:12px;bottom:13px;padding:11px 14px}.ecoffee-ai-panel{right:8px;bottom:68px;width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:min(600px,calc(100dvh - 83px));border-radius:14px}}

/* V1.3: chỉ hiển thị trong câu trả lời khi khách muốn gặp nhân viên. */
.ecoffee-ai-handoff{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;background:#f5f8f5;border:1px solid #d4e4d8;border-radius:12px;white-space:normal}
.ecoffee-ai-handoff>strong{font-size:13px;color:#244c3b}
.ecoffee-ai-handoff p{font-size:12px;line-height:1.4;margin:0;color:#343e38}
.ecoffee-ai-handoff-preview{font-size:12px;line-height:1.45;padding:8px 9px;white-space:pre-wrap;background:white;border:1px solid #d7dfd9;border-radius:8px;overflow-wrap:anywhere;user-select:text}
.ecoffee-ai-handoff-copy{border:1px solid #b6cbbc;background:#fff;color:#20513a;padding:9px;border-radius:9px;font-weight:700;font-size:12px;cursor:pointer;text-align:center}
.ecoffee-ai-handoff-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.ecoffee-ai-handoff-actions a{display:flex;align-items:center;justify-content:center;min-height:38px;border-radius:9px;padding:8px 5px;font-size:12px;font-weight:700;text-decoration:none!important;text-align:center;color:#fff!important}
.ecoffee-ai-handoff-zalo{background:#1676e8}.ecoffee-ai-handoff-messenger{background:#3b5ebd}
.ecoffee-ai-handoff small{font-size:10px;color:#65746d}
@media(max-width:380px){.ecoffee-ai-handoff-actions{grid-template-columns:1fr}}

/* V1.4 — responsive and uncluttered handoff/checkout UX */
.ecoffee-ai-root button,.ecoffee-ai-root input,.ecoffee-ai-root a{font-family:inherit}
.ecoffee-ai-root button:focus-visible,.ecoffee-ai-root a:focus-visible,.ecoffee-ai-root input:focus-visible{outline:3px solid #ed8a44;outline-offset:2px}
.ecoffee-ai-contact{padding:6px 12px 8px;align-items:center;justify-content:space-between;gap:5px}
.ecoffee-ai-contact a{font-size:12px;font-weight:700;color:#1d6547;text-decoration:underline;text-underline-offset:2px;border:none}
.ecoffee-ai-contact small{font-size:10px;color:#65736d;text-align:right}
.ecoffee-ai-suggestions{overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin;white-space:nowrap;gap:8px;padding:9px 11px}
.ecoffee-ai-suggestions button{flex-shrink:0;font-size:12px;min-height:35px;padding:7px 11px}
.ecoffee-ai-form button{min-height:43px;min-width:48px}
.ecoffee-ai-form input{min-height:43px}
.ecoffee-ai-handoff-copy,.ecoffee-ai-handoff-actions a{min-height:44px}
.ecoffee-ai-product a{padding:9px 11px;min-height:38px;line-height:20px}
.ecoffee-ai-messages{overscroll-behavior:contain;scrollbar-gutter:stable}
@media(max-width:600px){
 .ecoffee-ai-launcher{right:max(10px,env(safe-area-inset-right));bottom:calc(10px + env(safe-area-inset-bottom));min-height:44px}
 .ecoffee-ai-panel{right:6px;left:6px;bottom:calc(65px + env(safe-area-inset-bottom));width:auto;max-width:none;height:min(660px,calc(100dvh - 90px - env(safe-area-inset-bottom)));border-radius:15px}
 .ecoffee-ai-header{padding:11px 13px}
 .ecoffee-ai-messages{padding:10px;gap:9px}
 .ecoffee-ai-contact small{display:none}
 .ecoffee-ai-form{padding:7px 10px}
 .ecoffee-ai-privacy{padding:0 10px 7px;font-size:9.5px}
 .ecoffee-ai-handoff-actions{grid-template-columns:1fr 1fr}
 .ecoffee-admin-preview .ecoffee-ai-panel{width:100%;height:500px;max-width:100%;right:auto;left:auto;bottom:auto}
}
@media(max-width:380px){.ecoffee-ai-handoff-actions{grid-template-columns:1fr}.ecoffee-ai-handoff-actions a{min-height:40px}}
@media(prefers-reduced-motion:reduce){.ecoffee-ai-root *{scroll-behavior:auto!important}}


/* E-Coffee AI 1.4.2 — Mobile form containment hotfix.
   Prevent AMAYA/theme input width and min-width declarations from pushing Send out.
   Scope strictly to the widget and phone sizes; do not modify other forms. */
@media (max-width: 600px) {
  .ecoffee-ai-root .ecoffee-ai-panel {
    box-sizing: border-box !important;
    position: fixed !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 16px) !important;
    overflow: hidden !important;
  }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-form {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 8px !important;
    align-items: center !important;
    margin: 0 !important;
  }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-form input {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: none !important;
    font-size: 16px !important; /* prevent iOS Safari zoom on focus */
  }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-form button {
    box-sizing: border-box !important;
    display: block !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    padding: 10px 4px !important;
    white-space: nowrap !important;
  }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-messages,
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-handoff,
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-products {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-messages { scrollbar-gutter: auto; }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-suggestions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 6px !important;
    overflow-x: hidden !important;
    white-space: normal !important;
  }
  .ecoffee-ai-root .ecoffee-ai-panel .ecoffee-ai-suggestions button {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 40px !important;
    white-space: normal !important;
    text-align: center !important;
  }
}
