/* Scoped companion styling; no shared portal or assistant theme changes. */
.ac-float, .ac-panel {
  --ac-ink: #102a35;
  --ac-muted: #53676e;
  --ac-accent: #11695f;
  --ac-surface: #f8fbfa;
  --ac-hair: #d9e3e1;
  --ac-sm: .875rem;
  --ac-xs: .75rem;
  --ac-base: 1rem;
  --ac-space: 1rem;
  font-family: var(--font-body, "Inter", sans-serif);
  color: var(--ac-ink);
  -webkit-font-smoothing: antialiased;
}
.ac-float { position: fixed; right: 100px; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 62; }
.ac-launch { width: 64px; height: 64px; padding: 0; border: 0; background: transparent; cursor: pointer; display: grid; justify-items: center; gap: 0; }
.ac-name { font-size: var(--ac-xs); font-weight: 600; letter-spacing: .04em; color: #53676e; padding: 0; background: transparent; line-height: 14px; }
.ac-robot {
  display: grid; place-items: center; position: relative; width: 46px; height: 40px; margin-top: 5px;
  border-radius: 17px 17px 14px 14px; border: 1px solid #bacbc8;
  background: linear-gradient(140deg, #fff 15%, #edf4f2 55%, #b6c9c4);
  box-shadow: inset 0 2px 2px #fff, 0 6px 15px #102a3526;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.ac-antenna { position: absolute; top: -7px; left: 21px; width: 3px; height: 7px; background: #729b92; border-radius: 2px; }
.ac-antenna::before { content: ""; position: absolute; width: 6px; height: 6px; top: -3px; left: -1.5px; border-radius: 50%; background: #11695f; }
.ac-visor { display: flex; align-items: center; justify-content: center; gap: 10px; width: 32px; height: 20px; background: #102a35; border-radius: 9px; box-shadow: inset 0 1px 2px #0004; }
.ac-visor i { width: 5px; height: 10px; background: #bce9db; border-radius: 3px; animation: ac-blink 7s 2; }
.ac-launch:hover .ac-robot, .ac-active .ac-robot { transform: translateY(-3px); box-shadow: inset 0 2px 2px #fff, 0 9px 20px #102a352e; }
.ac-launch:focus-visible, .ac-panel :is(a,button):focus-visible { outline: 3px solid #11695f; outline-offset: 4px; }
.ac-panel {
  position: fixed; inset: auto 22px max(106px, calc(env(safe-area-inset-bottom) + 90px)) auto;
  width: min(392px, calc(100vw - 32px)); max-height: calc(100dvh - 138px);
  margin: 0; padding: 0; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--ac-hair); border-radius: 24px; background: var(--ac-surface);
  box-shadow: 0 20px 70px #102a3538; text-align: left;
}
.ac-panel[open] { animation: ac-reveal 180ms ease-out; }
.ac-panel::backdrop { background: #102a3529; }
.ac-panel [hidden] { display: none !important; }
.ac-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ac-space); padding: 24px 20px 0; }
.ac-kicker { margin: 0 0 8px; font-size: var(--ac-xs); font-weight: 700; letter-spacing: .1em; color: var(--ac-accent); }
.ac-head h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.025em; color: var(--ac-ink); }
.ac-close { flex-shrink: 0; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #102a3508; color: inherit; font-size: 1.5rem; cursor: pointer; margin-top: -8px; }
.ac-content { padding: 20px; }
.ac-status { font-size: var(--ac-sm); font-weight: 700; margin: 0 0 8px; }
.ac-status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 8px; }
.ac-content[aria-busy="true"] .ac-status { opacity: .65; }
.ac-detail { font-size: var(--ac-sm); line-height: 1.6; color: var(--ac-muted); margin: 0; }
.ac-metrics { margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--ac-hair); padding-top: 16px; }
.ac-metrics dt { font-size: var(--ac-xs); color: var(--ac-muted); }
.ac-metrics dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ac-latest { margin-top: 16px; border-top: 1px solid var(--ac-hair); padding-top: 16px; }
.ac-latest span { display: block; color: var(--ac-muted); font-size: var(--ac-xs); margin-bottom: 4px; }
.ac-latest strong { display: block; font-size: var(--ac-sm); overflow-wrap: anywhere; }
.ac-latest p { margin: 4px 0 0; font-size: var(--ac-xs); color: var(--ac-muted); }
.ac-actions { display: grid; padding: 0 20px 12px; gap: 4px; }
.ac-actions a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 46px; padding: 10px 12px; color: var(--ac-ink); font-size: var(--ac-sm); font-weight: 600; text-decoration: none; border-radius: 10px; }
.ac-actions a:hover { background: #102a3508; }
.ac-actions a.ac-primary { background: var(--ac-accent); color: #fff; margin-bottom: 4px; }
.ac-actions a.ac-primary:hover { background: #0a5149; }
.ac-foot { border-top: 1px solid var(--ac-hair); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 20px; }
.ac-foot span { font-size: var(--ac-xs); color: var(--ac-muted); max-width: 170px; line-height: 1.5; }
.ac-foot button { min-height: 44px; flex-shrink: 0; background: none; border: 0; color: var(--ac-accent); font: 600 var(--ac-xs) var(--font-body, sans-serif); cursor: pointer; }
.ac-foot button:disabled { cursor: wait; opacity: .55; }
@keyframes ac-blink { 0%, 43%, 47%, 100% { transform: scaleY(1); } 45% { transform: scaleY(.15); } }
@keyframes ac-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .ac-float { right: 92px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .ac-panel { right: 16px; bottom: max(98px, calc(env(safe-area-inset-bottom) + 82px)); max-height: calc(100dvh - 122px); }
}
@media (prefers-color-scheme: dark) {
  .ac-panel { --ac-ink: #edf5f2; --ac-muted: #b7c9c4; --ac-accent: #bce9db; --ac-surface: #152e36; --ac-hair: #395159; }
  .ac-panel .ac-actions a.ac-primary { color: #102a35; }
  .ac-actions a.ac-primary:hover { background: #d5f4e9; }
  .ac-close, .ac-actions a:hover { background: #ffffff0d; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-panel, .ac-robot, .ac-visor i { animation: none !important; transition: none !important; }
  .ac-launch:hover .ac-robot, .ac-active .ac-robot { transform: none; }
}
@media print { .ac-float, .ac-panel { display: none !important; } }
