:root {
  --amperel-dark: #122b37;
  --amperel-accent: #e67825;
  --amperel-soft: #f3f6f7;
  --amperel-green: #178b55;
}

.amperel-ai { font-family: Arial, sans-serif; color: var(--amperel-dark); }
.amperel-ai[dir="rtl"] { text-align: right; }
.amperel-ai--floating { position: fixed; z-index: 99998; right: 22px; bottom: 22px; }
.amperel-ai__launcher { display: flex; gap: 8px; align-items: center; border: 0; border-radius: 999px; padding: 13px 19px; background: var(--amperel-accent); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 7px 24px #0003; cursor: pointer; }
.amperel-ai__launcher span:first-child { font-size: 21px; }
.amperel-ai__panel { width: min(390px, calc(100vw - 24px)); height: min(650px, calc(100vh - 90px)); background: #fff; border-radius: 18px; box-shadow: 0 16px 50px #0004; overflow: hidden; flex-direction: column; }
.amperel-ai__panel:not([hidden]) { display: flex; }
.amperel-ai--floating .amperel-ai__panel { position: absolute; right: 0; bottom: 62px; }
.amperel-ai--inline .amperel-ai__panel { margin: 20px auto; border: 1px solid #dfe5e8; }
.amperel-ai__header { min-height: 66px; padding: 13px 16px; background: var(--amperel-dark); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.amperel-ai__header strong, .amperel-ai__header small { display: block; }
.amperel-ai__header small { opacity: .8; margin-top: 3px; font-size: 12px; }
.amperel-ai__close { border: 0; background: transparent; color: #fff; font-size: 28px; cursor: pointer; }
.amperel-ai__messages { flex: 1; overflow-y: auto; padding: 14px; background: var(--amperel-soft); }
.amperel-ai__message { display: flex; flex-direction: column; align-items: flex-start; margin: 0 0 11px; }
.amperel-ai__message > div:first-child { max-width: 88%; padding: 10px 12px; border-radius: 14px 14px 4px 14px; background: #fff; white-space: pre-wrap; line-height: 1.45; box-shadow: 0 1px 2px #0001; }
.amperel-ai__message--user { align-items: flex-end; }
.amperel-ai__message--user > div:first-child { background: var(--amperel-dark); color: #fff; border-radius: 14px 14px 14px 4px; }
.amperel-ai__products { width: 100%; margin-top: 8px; display: grid; gap: 7px; }
.amperel-ai__product { display: flex; gap: 9px; padding: 8px; align-items: center; border: 1px solid #dce3e6; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; }
.amperel-ai__product:hover { border-color: var(--amperel-accent); }
.amperel-ai__product img { width: 54px; height: 54px; object-fit: cover; border-radius: 7px; }
.amperel-ai__product span, .amperel-ai__product strong, .amperel-ai__product small { display: block; }
.amperel-ai__product small { margin-top: 4px; color: #59666c; }
.amperel-ai__whatsapp { margin-top: 8px; padding: 9px 12px; border-radius: 8px; background: var(--amperel-green); color: #fff !important; text-decoration: none; font-weight: 700; }
.amperel-ai__quick-actions { display: flex; gap: 6px; padding: 9px 11px 0; overflow-x: auto; background: #fff; }
.amperel-ai__quick-actions button { white-space: nowrap; border: 1px solid #cad4d8; background: #fff; border-radius: 999px; padding: 7px 10px; cursor: pointer; }
.amperel-ai__order { padding: 10px 12px; background: #fff8f1; display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 7px; align-items: end; }
.amperel-ai__order[hidden] { display: none; }
.amperel-ai__order label { font-size: 11px; }
.amperel-ai__order input { width: 100%; display: block; margin-top: 3px; border: 1px solid #b9c5ca; border-radius: 7px; padding: 7px; }
.amperel-ai__order button { border: 0; border-radius: 7px; padding: 8px; background: var(--amperel-dark); color: #fff; cursor: pointer; }
.amperel-ai__composer { display: grid; grid-template-columns: 1fr 42px; gap: 7px; padding: 10px 12px; background: #fff; }
.amperel-ai__composer textarea { resize: none; min-height: 42px; max-height: 100px; border: 1px solid #b9c5ca; border-radius: 12px; padding: 10px; font: inherit; }
.amperel-ai__composer button { border: 0; border-radius: 12px; background: var(--amperel-accent); color: #fff; cursor: pointer; transform: rotate(180deg); }
.amperel-ai footer { display: flex; justify-content: space-between; gap: 10px; padding: 0 12px 9px; background: #fff; font-size: 10px; color: #6b767b; }
.amperel-ai footer button { border: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
.amperel-ai.is-loading .amperel-ai__messages::after { content: 'הסוכן חושב…'; display: block; color: #6b767b; font-size: 12px; }

@media (max-width: 520px) {
  .amperel-ai--floating { right: 12px; bottom: 12px; }
  .amperel-ai--floating .amperel-ai__panel { position: fixed; inset: 8px; width: auto; height: auto; border-radius: 14px; }
  .amperel-ai__order { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .amperel-ai * { scroll-behavior: auto !important; }
}

