/* Styles for the Efraim helper bot (js/efraim-bot.js). Same shapes and layout as the transparency site's bot,
   in this site's own colors (variables from design.css). */
.efraim-av { display: inline-flex; flex: none; color: var(--sage-dark, #14406b); }
.efraim-av svg { width: 100%; height: 100%; }
.av-head { fill: var(--sage-dark, #14406b); }
.av-face { fill: #fff; }
.av-eye { fill: var(--ink, #12202f); }
.av-glint { fill: #fff; }
.av-smile { fill: none; stroke: var(--ink, #12202f); stroke-width: 2.6; stroke-linecap: round; }
.av-cheek { fill: var(--clay, #d98a3d); opacity: .55; }
.av-grain { fill: var(--clay, #d98a3d); }

.efraim-fab {
  position: fixed; left: 16px; bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 1100;
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 800; cursor: pointer;
  background: #fff; color: var(--sage-dark, #14406b);
  border: 2px solid var(--sage-dark, #14406b); border-radius: 999px; padding: 4px 16px 4px 6px;
  box-shadow: 0 6px 20px rgba(18, 32, 47, .18);
}
.efraim-fab .efraim-av { width: 46px; height: 46px; }
.efraim-fab:hover { background: var(--sage-pale, #e6f1fa); }
.efraim-fab:focus-visible, .efraim-form input:focus-visible, .efraim-form button:focus-visible,
.efraim-close:focus-visible, .efraim-go:focus-visible { outline: 2px solid var(--sage, #2f6fa3); outline-offset: 2px; }

.efraim-panel {
  position: fixed; left: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 66px); z-index: 1100; direction: rtl;
  width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 100px));
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--stone-mid, #e1e9f1); border-radius: 14px; padding: 14px;
  box-shadow: 0 12px 36px rgba(18, 32, 47, .28);
}
.efraim-panel > * { flex: none; }
.efraim-panel[hidden] { display: none; }
.efraim-panel header { display: flex; align-items: center; gap: 10px; }
.efraim-panel header .efraim-av { width: 44px; height: 44px; }
.efraim-panel header div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.efraim-panel header small { color: var(--ink-light, #667c8e); font-size: .78rem; }
.efraim-close { font: inherit; font-size: 1.5rem; line-height: 1; background: none; border: 0; color: var(--ink-light, #667c8e); cursor: pointer; padding: 4px 8px; }

.efraim-log {
  flex: 1 1 auto; min-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 14px; border: 1px solid var(--stone-mid, #e1e9f1);
  background: var(--stone, #f4f7fb);
}
.efraim-msg { flex: none; max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: .95rem; box-shadow: 0 1px 2px rgba(18, 32, 47, .08); overflow-wrap: anywhere; }
.efraim-msg.bot { max-height: 260px; overflow-y: auto; }   /* a long answer scrolls inside its bubble */
.efraim-msg strong { display: block; }
.efraim-line + .efraim-line { margin-top: 4px; }
.efraim-note { margin-top: 6px; font-size: .8rem; color: var(--ink-mid, #34495c); }   /* "unanswered questions are kept": quieter than the answer, still readable */
.efraim-go { display: block; }
.efraim-msg.user { align-self: flex-start; background: #fff; border-start-start-radius: 4px; }
.efraim-msg.bot { align-self: flex-end; background: var(--sage-pale, #e6f1fa); border-start-end-radius: 4px; }
.efraim-msg a { color: var(--sage-dark, #14406b); font-weight: 700; }
.efraim-go {
  margin-top: 4px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; padding: 0;
  background: none; border: 0; color: var(--sage-dark, #14406b); white-space: nowrap;
}
.efraim-go:hover { text-decoration: underline; }

.efraim-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.efraim-quick button { font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; color: var(--sage-dark, #14406b); background: var(--sage-pale, #e6f1fa); border: 1px solid var(--stone-mid, #e1e9f1); border-radius: 999px; padding: 6px 12px; }
.efraim-quick button:hover { background: #fff; }
.efraim-quick button:focus-visible { outline: 2px solid var(--sage, #2f6fa3); outline-offset: 2px; }
.efraim-form { display: flex; gap: 8px; }
.efraim-form input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--ink, #12202f); background: var(--stone, #f4f7fb); border: 1px solid var(--stone-mid, #e1e9f1); border-radius: 999px; padding: 8px 14px; }
.efraim-form button { font: inherit; font-weight: 800; cursor: pointer; color: #fff; background: var(--sage-dark, #14406b); border: 0; border-radius: 999px; padding: 8px 16px; }
.efraim-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 640px) {
  body { padding-bottom: 72px; }   /* the button must not cover the last lines of a page */
  .efraim-fab { left: 8px; }
  .efraim-panel { left: 8px; width: calc(100vw - 16px); }
}
