.gka-panel, .gka-fab {
  --gka-surface: #fff;
  --gka-muted-surface: #f7f9fc;
  --gka-text: #1e293b;
  --gka-muted: #64748b;
  --gka-border: #e5eaf2;
  --gka-primary: #344054;
  --gka-primary-soft: #f2f4f7;
  --gka-on-primary: #fff;
  font-family: var(--font-body);
  color: var(--gka-text);
}
.gka-brand-icon { width: 22px !important; height: 22px !important; object-fit: contain; display: block; }
.gka-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 900;
  display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border-radius: 24px; border: 1px solid var(--gka-border); background: var(--gka-surface);
  box-shadow: 0 5px 22px rgba(26, 47, 88, .12); font-size: 13px; font-weight: 600;
  user-select: none; touch-action: none; transition: box-shadow .18s;
}
.gka-fab:hover { box-shadow: 0 8px 28px rgba(26, 47, 88, .2); }
.gka-fab.dragging { cursor: grabbing; transition: none; }
.gka-panel {
  position: fixed; right: 24px; bottom: 82px; z-index: 901; width: 400px;
  height: 720px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--gka-surface); border: 1px solid var(--gka-border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(19, 36, 71, .12);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .18s, transform .18s;
}
.gka-panel.open { opacity: 1; pointer-events: auto; transform: none; }
.gka-panel.is-expanded { width: 680px; }
.gka-panel [hidden] { display: none !important; }
.gka-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; flex-shrink: 0; }
.gka-header-left { display: flex; gap: 10px; align-items: center; min-width: 0; }
.gka-header-left h2 { font-size: 14px; font-weight: 650; line-height: 1.5; margin: 0; white-space: nowrap; }
.gka-header-left p { margin: 3px 0 0; color: var(--gka-muted); font-size: 11px; }
.gka-avatar-box { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--gka-border); border-radius: 12px; background: var(--gka-primary-soft); }
.gka-header-actions { display: flex; gap: 2px; }
.gka-btn-icon { display: grid; place-items: center; width: 34px; height: 36px; border-radius: 8px; color: var(--gka-muted); background: transparent; font-size: 20px; }
.gka-btn-icon:not(:disabled):hover { background: var(--gka-muted-surface); color: var(--gka-primary); }
.gka-btn-icon:disabled { cursor: not-allowed; opacity: .45; }
.gka-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 18px; background: var(--gka-surface); scrollbar-width: thin; }
.gka-welcome-box { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 24px 0 60px; }
.gka-welcome-box h3 { font-size: 20px; line-height: 1.5; font-weight: 500; letter-spacing: -.3px; margin: 0; }
.gka-features-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 300px; margin-top: 22px; }
.gka-feature-card { padding: 7px 11px; border: 1px solid var(--gka-border); border-radius: 16px; background: transparent; color: var(--gka-muted); font-size: 13px; line-height: 1.6; }
.gka-feature-card:hover { background: var(--gka-muted-surface); color: var(--gka-text); }
.gka-messages { display: flex; flex-direction: column; gap: 24px; }
.gka-message-row { display: flex; gap: 9px; align-items: flex-start; }
.gka-message-row.user { flex-direction: row-reverse; }
.gka-msg-avatar { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; background: var(--gka-primary-soft); color: var(--gka-primary); }
.gka-msg-avatar img { width: 18px !important; height: 18px !important; }
.gka-message-row.user .gka-msg-avatar { background: var(--gka-primary); color: var(--gka-on-primary); }
.gka-bubble-wrap { display: flex; flex-direction: column; gap: 7px; min-width: 0; max-width: 100%; }
.gka-message-row.user .gka-bubble-wrap { align-items: flex-end; }
.gka-msg-time { color: var(--gka-muted); font-size: 12px; }
.gka-bubble { min-width: 0; max-width: 100%; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.gka-message-row.user .gka-bubble { padding: 9px 13px; background: var(--gka-muted-surface); border-radius: 12px; }
.gka-message-row.user .gka-message-text { white-space: pre-wrap; }
.gka-message-row.is-error .gka-bubble { padding: 10px 12px; border-radius: 10px; color: #a02b2b; border: 1px solid #f1cdcd; background: #fff6f6; }
.gka-bubble h4 { font-size: 14px; font-weight: 600; margin: 12px 0 5px; }
.gka-bubble h4:first-child { margin-top: 0; }
.gka-bubble blockquote { padding: 7px 10px; margin: 8px 0; border-left: 3px solid var(--gka-primary); background: var(--gka-muted-surface); color: var(--gka-muted); }
.gka-bubble code { font-family: Consolas, monospace; padding: 2px 4px; border-radius: 4px; background: var(--gka-muted-surface); font-size: 12px; }
.gka-bubble pre { max-width: 100%; overflow: auto; padding: 12px; border: 1px solid var(--gka-border); border-radius: 9px; margin: 8px 0; background: var(--gka-muted-surface); }
.gka-bubble pre code { padding: 0; white-space: pre; }
.gka-copy-button { align-self: flex-start; min-height: 30px; color: var(--gka-muted); font-size: 11px; padding: 2px 6px; border-radius: 6px; }
.gka-copy-button:hover { background: var(--gka-muted-surface); color: var(--gka-primary); }
@media (hover: hover) { .gka-copy-button { opacity: 0; } .gka-message-row:hover .gka-copy-button, .gka-copy-button:focus-visible { opacity: 1; } }
.gka-action-card { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--gka-border); border-radius: 10px; background: var(--gka-muted-surface); }
.gka-action-card p { width: 100%; margin: 0 0 4px; font-size: 12px; }
.gka-action-btn { padding: 7px 11px; min-height: 36px; border-radius: 7px; font-size: 12px; border: 1px solid var(--gka-border); }
.gka-action-btn.primary { background: var(--gka-primary); color: #fff; border-color: var(--gka-primary); }
.gka-action-btn.secondary { background: var(--gka-surface); color: var(--gka-primary); }
.gka-action-btn:disabled { opacity: .5; cursor: not-allowed; }
.gka-result-image { max-width: 100%; height: auto; border-radius: 8px; }
.gka-msg-attach-img { width: 88px; height: 88px; object-fit: cover; border: 1px solid var(--gka-border); border-radius: 9px; margin: 0 5px 8px 0; display: inline-block; }
.gka-file-label { color: var(--gka-muted); font-size: 11px; margin-bottom: 6px; }
.gka-footer { flex-shrink: 0; padding: 12px 16px; background: var(--gka-surface); }
.gka-composer { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: end; gap: 8px; padding: 8px; border: 1px solid var(--gka-border); border-radius: 12px; background: var(--gka-surface); transition: border-color .15s; }
.gka-composer:focus-within { border-color: var(--gka-muted); }
#geekOzonAgentPanel .gka-textarea,
#geekOzonAgentPanel .gka-textarea:focus,
#geekOzonAgentPanel .gka-textarea:focus-visible { display: block; width: 100%; min-width: 0; min-height: 32px; max-height: 132px; resize: none; margin: 0; padding: 4px 0; border: 0; outline: none; box-shadow: none; background: transparent !important; color: var(--gka-text) !important; font-size: 16px; line-height: 24px; }
#geekOzonAgentPanel .gka-textarea::placeholder { color: var(--gka-muted) !important; }
.gka-action-pill-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 7px; color: var(--gka-muted); }
.gka-action-pill-btn:not(:disabled):hover { color: var(--gka-primary); background: var(--gka-primary-soft); }
.gka-action-pill-btn:disabled { cursor: not-allowed; opacity: .5; }
.gka-send-circle-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--gka-muted-surface); color: var(--gka-muted); }
.gka-send-circle-btn.active { background: var(--gka-primary); color: #fff; }
.gka-send-circle-btn:disabled { cursor: not-allowed; opacity: .65; }
.gka-send-circle-btn[aria-busy="true"] > svg { display: none; }
.gka-send-circle-btn[aria-busy="true"]::after { content: ''; width: 16px; height: 16px; border: 2px solid var(--gka-muted); border-top-color: transparent; border-radius: 50%; animation: gka-spin .8s linear infinite; }
@keyframes gka-spin { to { transform: rotate(360deg); } }
.gka-status { margin-top: 8px; color: var(--gka-muted); font-size: 12px; min-height: 18px; }
.gka-attach-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; max-height: 100px; overflow-y: auto; }
.gka-attach-item { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 8px; font-size: 11px; border: 1px solid var(--gka-border); border-radius: 7px; background: var(--gka-muted-surface); }
.gka-attach-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.gka-attach-thumb { width: 24px; height: 24px; object-fit: cover; border-radius: 4px; }
.gka-attach-del { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; color: var(--gka-muted); flex-shrink: 0; }
.gka-attach-del:hover { color: #b42318; background: var(--gka-surface); }
.gka-clear-confirmation { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: var(--gka-primary-soft); font-size: 12px; border-bottom: 1px solid var(--gka-border); }
.gka-clear-confirmation > span { flex: 1; }
.gka-clear-confirmation > button { min-height: 32px; padding: 3px 6px; border-radius: 5px; color: var(--gka-primary); }
.gka-clear-confirmation > button:last-child { font-weight: 600; }
.gka-panel.gka-dragging { outline: 2px dashed var(--gka-primary); outline-offset: -5px; }
.gka-panel button:focus-visible, .gka-fab:focus-visible { outline: 2px solid var(--gka-primary); outline-offset: 3px; }
[data-theme="dark"] .gka-panel, [data-theme="dark"] .gka-fab {
  color-scheme: dark; --gka-surface: var(--ui-surface); --gka-muted-surface: var(--ui-surface-soft); --gka-text: var(--ui-text);
  --gka-muted: var(--ui-text-muted); --gka-border: var(--ui-border-strong); --gka-primary: var(--ui-primary); --gka-primary-soft: var(--ui-primary-soft); --gka-on-primary: var(--ui-on-primary);
}
[data-theme="dark"] .gka-action-btn.primary, [data-theme="dark"] .gka-send-circle-btn.active { background: var(--gka-primary); color: var(--gka-on-primary); border-color: var(--gka-primary); }
[data-theme="dark"] .gka-message-row.is-error .gka-bubble { background: #36252d; color: #ffcaca; border-color: #72434d; }
[data-theme="dark"] :is(.gka-msg-time, .gka-status, .gka-file-label, .gka-copy-button) { font-size: 12px; }
@media (max-width: 600px) {
  .gka-fab { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .gka-panel, .gka-panel.is-expanded { right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: calc(100vw - 16px); max-width: none; height: min(760px, calc(var(--gka-viewport-height, 100dvh) - 16px)); max-height: calc(var(--gka-viewport-height, 100dvh) - 16px); border-radius: 16px; }
  .gka-header { padding: 12px; gap: 6px; }
  .gka-header-left { gap: 8px; }
  .gka-header-actions { gap: 0; }
  .gka-btn-icon { width: 32px; height: 40px; }
  #gkaExpand { display: none; }
  .gka-body { padding: 20px 14px; }
  #geekOzonAgentPanel .gka-textarea,
  #geekOzonAgentPanel .gka-textarea:focus,
  #geekOzonAgentPanel .gka-textarea:focus-visible { font-size: 16px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .gka-welcome-box h3 { font-size: 20px; }
  .gka-footer { padding: 10px 12px 12px; }
  .gka-composer { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; }
  .gka-send-circle-btn, .gka-action-pill-btn { width: 36px; height: 36px; }
  .gka-attach-item > span { max-width: 170px; }
}
@media (max-width: 360px) {
  .gka-features-grid { gap: 6px; }
  .gka-feature-card { padding: 7px 10px; }
  .gka-header-left h2 { font-size: 13px; }
  .gka-header-left p { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .gka-panel, .gka-panel *, .gka-fab { transition: none; animation: none !important; }
}
