.ai-dock { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; justify-items: end; gap: 12px; pointer-events: none; }
.ai-dock > * { pointer-events: auto; }
.ai-dock-launcher { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: grid; place-items: center; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.ai-dock-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0, 0, 0, .3); }
.ai-dock-launcher:focus-visible { outline: none; box-shadow: var(--focus); }
.ai-dock.is-open .ai-dock-launcher { transform: scale(.92); }
.ai-dock-badge { position: absolute; right: -4px; top: -4px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 1; box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }
.ai-dock-panel { width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 120px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); overflow: hidden; }
.ai-dock-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border-bottom: 1px solid var(--line); background-image: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.ai-dock-titles { display: grid; min-width: 0; flex: 1; }
.ai-dock-titles strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-dock-tools { display: flex; gap: 2px; align-items: center; }
.ai-dock-tools .btn { padding-inline: 6px; }
.ai-dock-log { overflow-y: auto; padding: var(--sp-3); display: grid; gap: var(--sp-3); align-content: start; }
.ai-turn { display: grid; gap: var(--sp-2); }
.ai-bubble { margin: 0; padding: 10px 12px; border-radius: 14px; line-height: 1.5; max-width: 92%; overflow-wrap: anywhere; }
.ai-bubble.is-user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ai-bubble.is-assistant { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; display: grid; gap: var(--sp-2); }
.ai-reply { margin: 0; white-space: pre-wrap; }
.ai-error { margin: 0; color: var(--critical); }
.ai-typing { display: inline-flex; gap: 4px; margin: 0; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: ai-bounce 1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-dock-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 var(--sp-3) var(--sp-2); }
.ai-dock-chip { cursor: pointer; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-xs); }
.ai-dock-chip:hover { border-color: var(--accent); }
.ai-dock-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2); align-items: end; padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--line); }
.ai-dock-input { resize: none; min-height: 44px; }
.ai-dock-safety { margin: 0; padding: 0 var(--sp-3) var(--sp-2); }
.ai-dock .assistant-action { padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 4px; }
.ai-mascot .ai-mascot-spark { animation: ai-spark 2.4s infinite ease-in-out; transform-origin: 20px 4px; }
.ai-mascot .ai-mascot-eye { animation: ai-blink 5s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes ai-spark { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes ai-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@media (max-width: 560px) { .ai-dock { right: 12px; bottom: 12px; } .ai-dock-badge { display: none; } .ai-dock-panel { height: calc(100dvh - 100px); } }
@media (prefers-reduced-motion: reduce) { .ai-mascot *, .ai-typing span { animation: none !important; } .ai-dock-launcher { transition: none; } }
@media print { .ai-dock { display: none !important; } }
.ai-goal { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.ai-goal p { margin: 2px 0 0; }
body:has(.overlay) .ai-dock, body:has(.drawer-root[data-open="1"]) .ai-dock { opacity: 0; visibility: hidden; transition: opacity .15s, visibility 0s .15s; }
.ai-dock-launcher { touch-action: none; cursor: grab; }
.ai-dock.is-dragging .ai-dock-launcher { cursor: grabbing; transform: scale(1.05); transition: none; }
.ai-dock.is-dragging { transition: none; }
.ai-dock.is-left { justify-items: start; }
.ai-dock.is-top .ai-dock-launcher { order: -1; }
.ai-dock.is-left .ai-dock-badge { right: auto; left: 64px; }
.ai-dock-panel { max-width: var(--dock-room-x, none); max-height: var(--dock-room-y, none); }
.ai-dock-launcher { user-select: none; -webkit-user-select: none; }
.ai-guide { position: fixed; left: 0; top: 0; z-index: 80; width: 300px; display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: start; transition: transform .7s cubic-bezier(.2, .8, .2, 1); will-change: transform; pointer-events: none; }
.ai-guide-bot { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); animation: ai-guide-bob 2.4s ease-in-out infinite; }
.ai-guide-bubble { min-width: 0; overflow-wrap: anywhere; pointer-events: auto; padding: 10px 12px; border-radius: 14px; border-top-left-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, .3); display: grid; gap: var(--sp-2); line-height: 1.5; font-size: var(--fs-sm); }
.ai-guide-bubble p { margin: 0; }
.ai-guide-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-guide-actions .btn { white-space: normal; text-align: left; max-width: 100%; height: auto; }
.ai-guide-spot { position: fixed; left: 0; top: 0; z-index: 79; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(5, 6, 12, .45); transition: transform .5s ease, width .5s ease, height .5s ease; animation: ai-guide-pulse 1.6s ease-in-out infinite; }
@keyframes ai-guide-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ai-guide-pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(5, 6, 12, .45); } 50% { box-shadow: 0 0 0 6px var(--accent-soft), 0 0 0 9999px rgba(5, 6, 12, .45); } }
@media (prefers-reduced-motion: reduce) { .ai-guide, .ai-guide-spot { transition: none; } .ai-guide-bot, .ai-guide-spot { animation: none; } }
@media (max-width: 560px) { .ai-guide { width: calc(100vw - 16px); } }
@media (max-width: 640px) { .ai-dock { right: 12px; bottom: 12px; } .ai-dock-launcher { width: 44px; height: 44px; } .ai-dock-launcher svg { width: 28px; height: 28px; } }
