.rizen-agent { position: fixed; z-index: 1200; right: max(100px, calc(env(safe-area-inset-right) + 78px)); bottom: max(88px, calc(env(safe-area-inset-bottom) + 68px)); pointer-events: none; font-family: Inter, system-ui, sans-serif; color: #f8f5ff; }
.rizen-agent *, .rizen-agent *::before, .rizen-agent *::after { box-sizing: border-box; }
.rizen-agent svg { width: 22px; height: 22px; display: block; }
.rizen-agent-launcher { display: flex; align-items: center; gap: 11px; min-height: 58px; padding: 8px 18px 8px 8px; color: #fff; border: 1px solid rgba(187, 116, 255, .42); border-radius: 999px; background: rgba(17, 8, 29, .94); box-shadow: 0 18px 50px rgba(0,0,0,.42), 0 0 32px rgba(142, 45, 226, .16); backdrop-filter: blur(18px); cursor: pointer; pointer-events: auto; transition: transform 180ms ease, border-color 180ms ease, background 180ms ease; }
.rizen-agent-launcher:hover { transform: translateY(-2px); border-color: rgba(205, 151, 255, .72); background: #170b27; }
.rizen-agent-launcher:focus-visible, .rizen-agent button:focus-visible, .rizen-agent a:focus-visible, .rizen-agent textarea:focus-visible { outline: 3px solid rgba(187, 92, 255, .55); outline-offset: 3px; }
.rizen-agent-launcher-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; border-radius: 50%; background: linear-gradient(145deg, #a33df1, #6621b8); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.rizen-agent-launcher-copy { display: grid; text-align: left; line-height: 1.1; }
.rizen-agent-launcher-copy strong { font-size: 14px; font-weight: 750; }
.rizen-agent-launcher-copy small { margin-top: 4px; color: #bdb3c9; font-size: 11px; }
.rizen-agent-panel { position: absolute; right: 0; bottom: 72px; display: grid; grid-template-rows: auto minmax(190px, 1fr) auto auto auto; width: min(390px, calc(100vw - 40px)); max-height: min(680px, calc(100vh - 120px)); overflow: hidden; border: 1px solid rgba(176, 96, 245, .32); border-radius: 22px; background: #0d0812; box-shadow: 0 30px 90px rgba(0,0,0,.62), 0 0 0 1px rgba(255,255,255,.025) inset; pointer-events: auto; transform-origin: bottom right; animation: rizen-agent-in 200ms cubic-bezier(.2,.8,.2,1); }
.rizen-agent-panel[hidden] { display: none; }
.rizen-agent-header { display: grid; grid-template-columns: 42px 1fr 40px; align-items: center; gap: 11px; min-height: 72px; padding: 14px 14px 14px 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: radial-gradient(circle at 20% 0, rgba(139,44,215,.22), transparent 55%), #11091a; }
.rizen-agent-avatar { display: grid; place-items: center; width: 42px; height: 42px; color: #dca9ff; border: 1px solid rgba(195,112,255,.45); border-radius: 13px; background: rgba(126,42,190,.18); }
.rizen-agent-header strong { display: block; font-size: 15px; }
.rizen-agent-header span { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #aea4ba; font-size: 11px; }
.rizen-agent-header i { width: 7px; height: 7px; border-radius: 50%; background: #29d87d; box-shadow: 0 0 10px rgba(41,216,125,.55); }
.rizen-agent-close, .rizen-agent-send { display: grid; place-items: center; border: 0; cursor: pointer; }
.rizen-agent-close { width: 40px; height: 40px; color: #bdb3c9; border-radius: 12px; background: transparent; }
.rizen-agent-close:hover { color: white; background: rgba(255,255,255,.07); }
.rizen-agent-messages { min-height: 190px; padding: 18px 16px 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #553069 transparent; }
.rizen-agent-message { display: flex; margin: 0 0 11px; }
.rizen-agent-message > div { max-width: 88%; padding: 11px 13px; border-radius: 16px 16px 16px 5px; color: #e9e3ee; background: #191120; font-size: 13px; line-height: 1.5; white-space: pre-line; }
.rizen-agent-message-user { justify-content: flex-end; }
.rizen-agent-message-user > div { color: #fff; border-radius: 16px 16px 5px 16px; background: linear-gradient(135deg, #8431cc, #5d1ea2); }
.rizen-agent-message-typing > div { color: #a99caf; font-size: 12px; animation: rizen-agent-pulse 1.2s ease-in-out infinite; }
.rizen-agent-suggestions { display: flex; gap: 7px; padding: 4px 16px 12px; overflow-x: auto; scrollbar-width: none; }
.rizen-agent-suggestions::-webkit-scrollbar { display: none; }
.rizen-agent-suggestions button { flex: 0 0 auto; min-height: 34px; padding: 7px 11px; color: #ded5e7; border: 1px solid rgba(177,93,240,.28); border-radius: 999px; background: rgba(104,34,158,.1); font: inherit; font-size: 11px; cursor: pointer; }
.rizen-agent-suggestions button:hover { color: white; border-color: rgba(191,111,248,.58); background: rgba(122,42,181,.2); }
.rizen-agent-form { display: grid; grid-template-columns: 1fr 42px; align-items: end; gap: 8px; margin: 0 12px; padding: 8px 8px 8px 13px; border: 1px solid rgba(255,255,255,.11); border-radius: 17px; background: #15101a; }
.rizen-agent-form:focus-within { border-color: rgba(189,108,246,.54); box-shadow: 0 0 0 3px rgba(150,58,214,.1); }
.rizen-agent-form textarea { width: 100%; max-height: 112px; min-height: 30px; resize: none; padding: 6px 0; overflow-y: auto; color: #fff; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; line-height: 1.45; }
.rizen-agent-form textarea::placeholder { color: #7f7489; }
.rizen-agent-send { width: 42px; height: 42px; color: white; border-radius: 13px; background: #7e2bc2; transition: transform 160ms ease, background 160ms ease; }
.rizen-agent-send:hover { transform: translateY(-1px); background: #9436dc; }
.rizen-agent-send:disabled { opacity: .45; cursor: wait; }
.rizen-agent-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 15px 13px; color: #766c7d; font-size: 9px; }
.rizen-agent-footer a { display: flex; align-items: center; gap: 5px; color: #64df99; text-decoration: none; font-size: 10px; font-weight: 700; }
.rizen-agent-footer a svg { width: 15px; height: 15px; }
.rizen-agent-footer a:hover { color: #8df2b8; }
@keyframes rizen-agent-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes rizen-agent-pulse { 50% { opacity: .5; } }
@media (max-width: 640px) {
  .rizen-agent { right: auto; left: max(12px, env(safe-area-inset-left)); bottom: max(82px, calc(env(safe-area-inset-bottom) + 70px)); }
  .rizen-agent-launcher { margin-right: 0; padding-right: 14px; }
  .rizen-agent-launcher-copy small { display: none; }
  .rizen-agent-panel { position: fixed; right: 10px; bottom: 10px; left: 10px; width: auto; max-height: min(720px, calc(100dvh - 20px)); border-radius: 20px; transform-origin: bottom center; }
  .rizen-agent-header { min-height: 68px; }
  .rizen-agent-footer span { display: none; }
  .rizen-agent-footer { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .rizen-agent-panel, .rizen-agent-message-typing > div { animation: none; } }

/* Mobile-first dock: the compact bot control never competes with the quick-action rail. */
.rizen-agent {
  right: auto;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
}

.rizen-agent-launcher {
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 8px;
  justify-content: center;
  border-radius: 50%;
}

.rizen-agent-launcher-copy { display: none; }

.rizen-agent-panel {
  position: fixed;
  right: 10px;
  top: calc(var(--rizen-agent-viewport-top, 0px) + 10px);
  bottom: auto;
  left: 10px;
  width: auto;
  height: calc(var(--rizen-agent-viewport-height, 100dvh) - 20px);
  max-height: 720px;
  transform-origin: bottom center;
}

.rizen-agent-open .rizen-agent-launcher { visibility: hidden; }

@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
  .rizen-agent {
    right: auto;
    left: max(24px, env(safe-area-inset-left));
    bottom: max(24px, env(safe-area-inset-bottom));
  }

  .rizen-agent-launcher {
    width: auto;
    height: auto;
    padding: 8px 18px 8px 8px;
    justify-content: flex-start;
    border-radius: 999px;
  }

  .rizen-agent-launcher-copy { display: grid; }

  .rizen-agent-panel {
    position: absolute;
    right: auto;
    top: auto;
    bottom: 72px;
    left: 0;
    width: min(390px, calc(100vw - 40px));
    height: auto;
    max-height: min(680px, calc(100vh - 120px));
    transform-origin: bottom left;
  }
}

@media (max-width: 640px) {
  .rizen-agent {
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}
