:root {
  --assist-panel: #0b101a;
  --assist-border: rgba(255, 255, 255, 0.12);
  --assist-text: #e7f0ff;
  --assist-muted: #9fb5d6;
}

.assist-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: linear-gradient(135deg, rgba(0, 224, 164, 0.25), rgba(77, 196, 255, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--assist-text);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 90;
}

.assist-widget {
  position: fixed;
  right: 18px;
  bottom: 76px;
  width: min(280px, calc(100vw - 36px));
  max-height: 420px;
  background: var(--assist-panel);
  border: 1px solid var(--assist-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 95;
}

.assist-widget,
.assist-widget * {
  box-sizing: border-box;
}

.assist-widget.open {
  display: grid;
  grid-template-rows: auto 1fr;
}

.assist-widget.minimized .widget-body {
  display: none;
}

.assist-widget.minimized .widget-header {
  border-bottom: none;
}

.assist-widget.expanded {
  top: 18px;
  bottom: 18px;
  height: calc(100vh - 36px);
  max-height: none;
  width: 280px;
}

.assist-widget.expanded .assist-video-frame {
  max-height: 220px;
  height: auto;
}

.assist-widget.expanded .widget-body {
  grid-template-rows: auto 1fr;
  align-items: start;
}

.assist-widget.expanded .assist-chat-log {
  max-height: none;
  height: 100%;
}

.assist-widget.expanded-left {
  left: 18px;
  right: auto;
  bottom: 18px;
  top: auto;
  width: clamp(420px, 60vw, 720px);
  height: clamp(260px, 33vh, 420px);
  max-height: none;
  max-width: calc(100vw - 36px);
}

.assist-widget.expanded-left .assist-video-frame {
  height: 100%;
  max-height: none;
}

.assist-widget.expanded-left .widget-body {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: stretch;
  min-height: 0;
}

.assist-widget.expanded-left .assist-chat-log {
  max-height: none;
  height: 100%;
  min-height: 0;
}

.assist-widget.expanded-left .widget-header {
  cursor: move;
  touch-action: none;
}

.assist-widget.expanded-left .assist-chat-stack {
  height: 100%;
  min-height: 0;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #0f1624;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.widget-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #00e0a4;
  box-shadow: 0 0 10px rgba(0, 224, 164, 0.6);
}

.assistant-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--assist-muted);
  font-weight: 700;
}

.widget-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111a2c;
  color: #dfe7ff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover {
  background: #142034;
}

.icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.widget-body {
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.assist-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 180px;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(0, 224, 164, 0.18), transparent 45%),
    radial-gradient(circle at 70% 10%, rgba(77, 196, 255, 0.2), transparent 50%),
    #0b101a;
}

.assist-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #05070d;
}

.assist-video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #9fb5d6;
  font-size: 13px;
  text-align: center;
  padding: 12px;
  background: rgba(5, 9, 16, 0.35);
}

.assist-video-overlay.hidden {
  display: none;
}

.video-name-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #e6f5ff;
  background: linear-gradient(180deg, rgba(5, 9, 16, 0), rgba(5, 9, 16, 0.72));
  z-index: 2;
  pointer-events: none;
}

.assist-chat-stack {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 6px;
  min-height: 0;
  width: 100%;
}

.assist-chat-log {
  display: grid;
  gap: 8px;
  padding: 8px 0 0;
  max-height: 130px;
  overflow: auto;
  width: 100%;
  min-height: 90px;
}

.assist-bubble {
  font-size: 12px;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.assist-bubble.bot {
  background: rgba(77, 196, 255, 0.16);
  color: #e6f5ff;
}

.assist-bubble.user {
  background: rgba(0, 224, 164, 0.14);
  color: #d9fff3;
  justify-self: end;
}

.assist-chat-input {
  display: flex;
  gap: 6px;
  padding: 8px 0 0;
  width: 100%;
}

.assist-chat-input input {
  flex: 1;
  min-width: 0;
  background: #0b101a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 7px 8px;
  color: #e7f0ff;
  font-size: 12px;
}

.assist-chat-input button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111a2c;
  color: #dfe7ff;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.assist-chat-input button:hover {
  background: #142034;
}
