.ck-ai-visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.ck-ai-panel[hidden], .ck-ai-guide-ring[hidden], .ck-ai-guide-note[hidden] { display:none !important; }
.ck-ai-panel { position:fixed; z-index:8505; top:76px; right:18px; bottom:18px; width:min(400px,calc(100vw - 104px)); display:flex; flex-direction:column; overflow:hidden; border:1px solid #d9d0ff; border-radius:20px; background:var(--bg-card); color:var(--text-main); box-shadow:0 20px 60px rgba(25,25,68,.2); }
.ck-ai-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 14px; background:linear-gradient(110deg,#e9f7ff,#f5e9ff 70%,#ffeaf6); border-bottom:1px solid #e5dcf7; }
.ck-ai-panel-head strong { display:block; color:#172048; font-size:1rem; }
.ck-ai-panel-head small { display:block; margin-top:2px; color:#65607e; font-size:.72rem; }
.ck-ai-panel-controls { display:flex; gap:5px; }
.ck-ai-panel-controls button { display:grid; place-items:center; width:32px; height:32px; border:1px solid #dcd3ef; border-radius:9px; background:#fff; color:#514579; cursor:pointer; font-size:1.2rem; }
.ck-ai-panel-controls button:hover, .ck-ai-panel-controls button:focus-visible { background:#eee8ff; }
.ck-ai-panel-body { display:flex; flex:1; flex-direction:column; min-height:0; padding:12px; }
.ck-ai-history { display:flex; flex:1; flex-direction:column; gap:9px; overflow-y:auto; min-height:0; padding:3px 3px 12px; }
.ck-ai-message { max-width:92%; padding:10px 12px; border-radius:14px; font-size:.86rem; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.ck-ai-message.assistant { align-self:flex-start; background:#f2efff; color:#29234b; }
.ck-ai-message.user { align-self:flex-end; background:#e8f6ff; color:#172d49; }
.ck-ai-starters { display:flex; flex-wrap:wrap; gap:6px; padding:5px 0 9px; }
.ck-ai-starters button { padding:6px 9px; border:1px solid #d9d3f3; border-radius:999px; background:#faf8ff; color:#594ba0; cursor:pointer; font-size:.71rem; }
.ck-ai-status { min-height:20px; padding:2px 3px; color:#625977; font-size:.74rem; }
.ck-ai-status.error { color:#b32945; }
.ck-ai-token-total { position:absolute; right:-70px; bottom:-20px; padding:4px 8px; border:1px solid #ded7ef; border-radius:999px; background:linear-gradient(110deg,#fff,#f6f0ff); color:#514579; box-shadow:0 4px 14px #45329b18; font-size:.68rem; font-weight:700; line-height:1.2; white-space:nowrap; pointer-events:none; }
.ck-ai-token-total[hidden] { display:none !important; }
.ck-ai-form { display:flex; align-items:end; gap:7px; padding:8px; border:1px solid #ddd7ee; border-radius:14px; background:#fff; }
.ck-ai-form:focus-within { border-color:#8074db; box-shadow:0 0 0 3px #8578ed22; }
.ck-ai-form textarea { flex:1; min-width:0; max-height:110px; resize:vertical; border:0; outline:0; background:transparent; color:#273148; font:inherit; font-size:.84rem; line-height:1.4; }
.ck-ai-form button { min-width:45px; height:36px; padding:0 8px; border:0; border-radius:10px; background:#6654d5; color:#fff; cursor:pointer; font:inherit; font-size:.8rem; font-weight:700; }
.ck-ai-form button:disabled { opacity:.55; cursor:wait; }
.ck-ai-panel.is-minimized { top:auto; bottom:16px; height:auto; width:260px; }
.ck-ai-panel.is-minimized .ck-ai-panel-body { display:none; }
.ck-ai-guide-ring { position:fixed; z-index:8501; pointer-events:none; border:3px solid #7754eb; border-radius:12px; box-shadow:0 0 0 5px #fff9,0 0 0 9px #aa87fa55,0 8px 24px #45329b35; }
.ck-ai-guide-note { position:fixed; z-index:8502; display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px; border:1px solid #d7c9f6; border-radius:11px; background:#fff; color:#362663; box-shadow:0 9px 28px #29234b30; font-size:.78rem; }
.ck-ai-guide-note button { padding:5px 7px; border:0; border-radius:7px; background:#eee7ff; color:#5035a0; cursor:pointer; font-size:.7rem; }
.ck-ai-panel, .ck-ai-panel.is-minimized { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
@media (max-width:768px) {
  .ck-ai-token-total { right:0; bottom:-20px; }
  .ck-ai-panel { top:auto; right:0; bottom:calc(208px + env(safe-area-inset-bottom,0px)); left:0; width:100%; height:min(60dvh,540px,calc(100dvh - 224px)); border-radius:20px 20px 0 0; }
  .ck-ai-panel.is-expanded { bottom:0; height:100dvh; border-radius:0; padding-bottom:env(safe-area-inset-bottom,0px); }
  .ck-ai-panel.is-minimized { left:auto; right:12px; bottom:calc(208px + env(safe-area-inset-bottom,0px)); width:230px; border-radius:16px; }
}
@media (min-width:769px) { #ck-ai-expand { display:none; } }
@media (prefers-reduced-motion:reduce) { .ck-ai-guide-ring { transition:none; } }
@media print { .ck-ai-panel,.ck-ai-guide-note,.ck-ai-guide-ring { display:none !important; } }
