/* Public homepage AI assistant widget (marketing pages only).
   Loaded ONLY when config ai.features.public_assist is on — see the include
   snippet at the bottom of index.php / services.php / services/service.php /
   cyber-posture-assessment.php. Styles transcribed from the approved mockup
   (mockups/ai-assistant.html); design-system tokens throughout. */

.assist-launcher {
  position: fixed; right: 26px; bottom: 26px; z-index: 950;
  width: 58px; height: 58px; border-radius: 50%;
  background: #111827; color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 10px 26px rgba(17, 24, 39, .35);
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.assist-launcher .assist-ring { position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.assist-launcher .assist-mono { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.assist-launcher .assist-dot  { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%;
  background: #4ade80; border: 2px solid #111827; }
.assist-launcher:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Fallback state (feature capped/errored after load): plain link, no chrome. */
.assist-fallback {
  position: fixed; right: 26px; bottom: 26px; z-index: 950;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--accent);
  text-decoration: none; box-shadow: 0 6px 18px rgba(17,24,39,.12);
}

.assist-panel {
  position: fixed; right: 26px; bottom: 26px; z-index: 960;
  width: 384px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(17, 24, 39, .16);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: inherit;
}
@media (max-width: 600px) {
  .assist-panel { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

.assist-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); }
.assist-seal { width: 34px; height: 34px; border-radius: 50%; background: #111827; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  flex: none; position: relative; }
.assist-seal::after { content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.assist-title { font-size: 14px; font-weight: 600; color: var(--text); }
.assist-title .assist-tag { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 20px;
  background: var(--accent-bg); color: var(--accent-on-bg); font-size: 10px; font-weight: 700;
  letter-spacing: .4px; vertical-align: 1px; }
.assist-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.assist-close { margin-left: auto; border: 0; background: none; color: var(--text-3);
  font-size: 20px; cursor: pointer; line-height: 1; font-family: inherit; }

.assist-body { padding: 16px; display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto; max-height: 430px; }
@media (max-height: 640px) { .assist-body { max-height: 55vh; } }

.assist-msg { max-width: 86%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: break-word; }
.assist-msg.assist-ai { background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-bottom-left-radius: 4px; align-self: flex-start; }
.assist-msg.assist-me { background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end; }
.assist-msg.assist-typing { color: var(--text-3); font-style: italic; }

.assist-exit-row { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 86%; }
.assist-exit { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); text-decoration: none; font-family: inherit; }
.assist-exit.assist-solid  { background: var(--accent); color: #fff; }
.assist-exit.assist-urgent { border-color: #dc2626; color: #dc2626; }

.assist-input { display: flex; gap: 9px; padding: 12px 14px; border-top: 1px solid var(--border); }
.assist-input input { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px;
  font: inherit; font-size: 13px; color: var(--text); outline: none; background: var(--surface); }
.assist-input input:focus { border-color: var(--accent); }
.assist-input button { width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: #111827; color: #fff; cursor: pointer; font-size: 15px; font-family: inherit; }
.assist-input button:disabled { opacity: .5; cursor: default; }

.assist-foot { padding: 8px 14px 12px; font-size: 10.5px; color: var(--text-3); text-align: center; }
.assist-hidden { display: none !important; }
