/* ICG Orderassistent — gebruikt de kleuren van het Inner Circle-thema, met vaste waarden als terugval. */
#icgoa{
  --icgoa-bg: var(--wp--preset--color--base, #0a0a0a);
  --icgoa-surface: var(--wp--preset--color--base-2, #141414);
  --icgoa-surface-2: var(--wp--preset--color--surface, #1d1d1d);
  --icgoa-line: var(--wp--preset--color--border, #2e2e2e);
  --icgoa-text: var(--wp--preset--color--contrast, #ffffff);
  --icgoa-muted: var(--wp--preset--color--muted, #a8a8a8);
  --icgoa-accent: var(--wp--preset--color--accent, #ee9441);
  --icgoa-accent-hi: #f7ad66;
  --icgoa-ok: var(--wp--preset--color--accent-2, #3ed660);
  --icgoa-warn: #f0b878;
  --icgoa-info: #7fb6e6;
  --icgoa-bad: #f07a6e;
  --icgoa-font: var(--wp--preset--font-family--body, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --icgoa-display: var(--wp--preset--font-family--display, Newsreader, Georgia, "Times New Roman", serif);
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 99990;
  font-family: var(--icgoa-font); font-size: 15px; line-height: 1.5; color: var(--icgoa-text);
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
}
#icgoa *, #icgoa *::before, #icgoa *::after { box-sizing: border-box; }
#icgoa [hidden] { display: none !important; }
#icgoa button { font-family: inherit; margin: 0; }

/* Knop rechtsonder */
#icgoa .icgoa-launcher{
  width: 60px; height: 60px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: var(--icgoa-accent); color: var(--icgoa-bg);
  display: grid; place-items: center;
  box-shadow: 0 10px 50px -10px rgba(238,148,65,.55), 0 6px 20px -6px rgba(0,0,0,.6);
  transition: background-color .2s ease, transform .2s ease;
}
#icgoa .icgoa-launcher:hover { background: var(--icgoa-accent-hi); transform: translateY(-2px); }

/* Paneel */
#icgoa .icgoa-panel{
  width: 380px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 120px);
  background: var(--icgoa-surface); border-radius: 16px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--icgoa-line), 0 20px 60px -20px rgba(0,0,0,.7), 0 10px 50px -10px rgba(238,148,65,.18);
  display: flex; flex-direction: column;
  animation: icgoa-in .22s ease-out;
}
@keyframes icgoa-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#icgoa .icgoa-head{
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--icgoa-line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
}
#icgoa .icgoa-logo { width: 40px; height: auto; display: block; flex: none; }
#icgoa .icgoa-who { min-width: 0; flex: 1; }
#icgoa .icgoa-who strong { display: block; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--icgoa-text); }
#icgoa .icgoa-who small { display: flex; align-items: center; gap: 6px; color: var(--icgoa-muted); font-size: 12px; }
#icgoa .icgoa-who small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--icgoa-ok); }
#icgoa .icgoa-test { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--icgoa-bg); background: var(--icgoa-warn); padding: 3px 8px; border-radius: 999px; }
#icgoa .icgoa-icon { background: transparent; border: 0; color: var(--icgoa-muted); width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; cursor: pointer; padding: 0; }
#icgoa .icgoa-icon:hover { color: var(--icgoa-text); background: var(--icgoa-surface-2); }

#icgoa .icgoa-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
#icgoa .icgoa-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
#icgoa .icgoa-bot { background: var(--icgoa-surface-2); box-shadow: inset 0 0 0 1px var(--icgoa-line); border-bottom-left-radius: 4px; align-self: flex-start; color: var(--icgoa-text); }
#icgoa .icgoa-me { background: var(--icgoa-accent); color: var(--icgoa-bg); font-weight: 500; border-bottom-right-radius: 4px; align-self: flex-end; }
#icgoa .icgoa-bot b { color: var(--icgoa-accent-hi); font-weight: 700; }

#icgoa .icgoa-typing { display: flex; gap: 5px; padding: 14px 16px; }
#icgoa .icgoa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--icgoa-muted); animation: icgoa-dot 1.2s infinite ease-in-out; }
#icgoa .icgoa-typing span:nth-child(2) { animation-delay: .15s; }
#icgoa .icgoa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes icgoa-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

/* Orderkaartje */
#icgoa .icgoa-card { margin-top: 10px; border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; font-size: 13px; white-space: normal; background: var(--icgoa-bg); box-shadow: inset 0 0 0 1px var(--icgoa-line); justify-items: start; }
#icgoa .icgoa-k { color: var(--icgoa-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#icgoa .icgoa-st { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; color: var(--icgoa-muted); }
#icgoa .icgoa-st-processing { color: var(--icgoa-info); }
#icgoa .icgoa-st-on-hold, #icgoa .icgoa-st-pending { color: var(--icgoa-warn); }
#icgoa .icgoa-st-completed { color: var(--icgoa-ok); }
#icgoa .icgoa-st-cancelled, #icgoa .icgoa-st-failed, #icgoa .icgoa-st-refunded { color: var(--icgoa-bad); }
#icgoa .icgoa-uitleg { font-family: var(--icgoa-display); font-style: italic; font-size: 15px; line-height: 1.35; }
#icgoa .icgoa-items { color: var(--icgoa-muted); }
#icgoa .icgoa-track { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* Snelkeuzes */
#icgoa .icgoa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
#icgoa .icgoa-chip { background: transparent; border: 0; box-shadow: inset 0 0 0 1px var(--icgoa-line); color: var(--icgoa-text); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: color .2s, box-shadow .2s; }
#icgoa .icgoa-chip:hover { box-shadow: inset 0 0 0 1px var(--icgoa-accent); color: var(--icgoa-accent); }

/* Invoer */
#icgoa .icgoa-compose { display: flex; gap: 8px; padding: 12px; margin: 0; border-top: 1px solid var(--icgoa-line); background: var(--icgoa-bg); }
#icgoa .icgoa-compose input { flex: 1; min-width: 0; margin: 0; background: var(--icgoa-surface); border: 0; box-shadow: inset 0 0 0 1px var(--icgoa-line); color: var(--icgoa-text); border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 16px; /* 16px voorkomt inzoomen op iPhone */ }
#icgoa .icgoa-compose input::placeholder { color: var(--icgoa-muted); }
#icgoa .icgoa-compose input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--icgoa-accent); }
#icgoa .icgoa-send { background: var(--icgoa-accent); color: var(--icgoa-bg); border: 0; border-radius: 999px; padding: 0 20px; font-weight: 800; font-size: 14px; cursor: pointer; transition: background-color .2s; }
#icgoa .icgoa-send:hover { background: var(--icgoa-accent-hi); }
#icgoa .icgoa-send:disabled { opacity: .35; cursor: default; }
#icgoa .icgoa-foot { margin: 0; font-size: 11px; color: var(--icgoa-muted); text-align: center; padding: 0 12px 10px; background: var(--icgoa-bg); }
#icgoa .icgoa-foot a { color: var(--icgoa-muted); text-decoration: underline; }
#icgoa .icgoa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#icgoa button:focus-visible, #icgoa input:focus-visible, #icgoa a:focus-visible { outline: 2px solid var(--icgoa-accent-hi); outline-offset: 2px; }

/* Mobiel: volledig scherm als de chat open is */
@media (max-width: 560px){
  #icgoa { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  #icgoa.icgoa-is-open { inset: 0; padding: 0; gap: 0; }
  #icgoa.icgoa-is-open .icgoa-launcher { display: none; }
  #icgoa .icgoa-panel { width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); }
  #icgoa .icgoa-compose { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce){
  #icgoa .icgoa-panel, #icgoa .icgoa-typing span { animation: none; }
  #icgoa .icgoa-launcher { transition: none; }
}
