/* AI Admin Assistant — mobile-first panel */
.ai-admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100dvh;
  max-height: 100vh;
  background: #0b1220;
  border-left: 1px solid #334155;
  z-index: 10250;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.45);
  -webkit-overflow-scrolling: touch;
}

.ai-admin-panel.open {
  transform: translateX(0);
}

.ai-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid #334155;
  gap: 10px;
}

.ai-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #1e293b;
}

.ai-tab {
  flex: 1;
  min-width: 70px;
  padding: 8px 6px;
  border: none;
  border-radius: 8px;
  background: #1e293b;
  color: #94a3b8;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
}

.ai-tab.active {
  background: #7c3aed;
  color: #fff;
}

.ai-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.ai-admin-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid #334155;
  background: #0f172a;
}

.ai-draft-area {
  max-height: 45vh;
  overflow-y: auto;
}

.ai-tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-tool-row .ai-tool-btn {
  flex: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

#aiMicBtn {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 50%;
  background: #e94560;
  color: #fff;
  font-size: 18px;
}

#aiMicBtn.listening {
  animation: ai-pulse 1s infinite;
  background: #b91645;
}

#aiCameraBtn {
  background: #0ea5e9;
  color: #fff;
}

.ai-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: stretch;
}

.ai-input-row textarea {
  flex: 1;
  min-height: 72px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
}

.ai-settings-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #1e293b;
  border-radius: 10px;
  border: 1px solid #334155;
}

.ai-setting-row label {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}

.ai-setting-row input[type="checkbox"] {
  width: 44px;
  height: 26px;
  accent-color: #7c3aed;
  cursor: pointer;
}

.ai-camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 10300;
  background: #000;
  display: none;
  flex-direction: column;
}

.ai-camera-overlay.open {
  display: flex;
}

.ai-camera-overlay video {
  flex: 1;
  width: 100%;
  object-fit: cover;
  background: #111;
}

.ai-camera-bar {
  display: flex;
  gap: 10px;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.95);
}

.ai-camera-bar button {
  flex: 1;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(233, 69, 96, 0); }
}

@media (max-width: 480px) {
  .ai-admin-panel {
    width: 100vw;
  }
  .ai-admin-footer button {
    flex: 1 1 45%;
  }
}
