:root {
  /* Brand Theme Tokens (Dynamic via Agent Config) */
  --brand-primary: #FF4B00;
  --brand-accent: #FE9900;
  --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  --brand-gradient-hover: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  --brand-glow: rgba(255, 75, 0, 0.35);

  /* Legacy Backward-Compatibility Tokens */
  --nutech-red: var(--brand-primary);
  --nutech-amber: var(--brand-accent);
  --nutech-gradient: var(--brand-gradient);
  --nutech-gradient-hover: var(--brand-gradient-hover);
  --nutech-glow: var(--brand-glow);

  /* World-Class Zinc Dark Surface Tokens */
  --bg-dark: #09090B;
  --bg-surface: rgba(18, 18, 24, 0.82);
  --bg-card: rgba(24, 24, 32, 0.75);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: var(--brand-primary);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --success: #10B981;
  --danger: #EF4444;
}

/* Custom Minimalist Dark Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Ambient glow background */
.ambient-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--nutech-glow) 0%, rgba(254, 153, 0, 0.04) 45%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  transition: all 0.8s ease;
}

body.in-call .ambient-glow {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 75, 0, 0.22) 0%, rgba(254, 153, 0, 0.12) 50%, transparent 75%);
}

/* App container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 1;
}

/* Top Navigation Bar */
header.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-glass);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--nutech-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.status-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mode Switcher Segmented Control */
.mode-pill-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  outline: none;
}

.mode-btn:hover {
  color: #fff;
}

.mode-btn.active {
  background: var(--nutech-gradient);
  color: #fff;
  box-shadow: 0 2px 8px var(--nutech-glow);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.badge.pulse-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.badge.online.pulse-dot::before {
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(0.95); opacity: 1; }
}

/* Main Interactive Stage */
main.call-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px 20px 110px; /* Generous bottom padding for floating dock */
  overflow-y: auto;
}

/* Canvas container */
.orb-container {
  position: relative;
  width: 320px;
  height: 320px;
  max-width: 80vw;
  max-height: 80vw;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

#orbCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  pointer-events: none;
}

.orb-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(11, 14, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: all 0.4s ease;
}

.orb-center-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--nutech-amber);
  transition: all 0.3s ease;
}

body.in-call .orb-center-icon {
  border-color: rgba(255, 75, 0, 0.4);
  box-shadow: 0 0 30px rgba(255, 75, 0, 0.3);
}

/* State Status Banner */
.state-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 500px;
  margin-bottom: 16px;
}

.state-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--nutech-amber);
  margin-bottom: 6px;
  transition: color 0.3s ease;
}

.state-subtext {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.thinking-spinner {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--nutech-amber);
  margin-right: 8px;
  box-shadow: 0 0 10px var(--nutech-amber);
  animation: thinking-dot-pulse 0.8s infinite alternate ease-in-out;
}

@keyframes thinking-dot-pulse {
  0% { transform: scale(0.7); opacity: 0.4; }
  100% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #FF4B00; }
}

/* Realtime Captions Ticker */
.captions-box {
  width: 100%;
  max-width: 580px;
  min-height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.captions-box.has-text {
  border-color: rgba(255, 75, 0, 0.3);
  box-shadow: 0 8px 24px rgba(255, 75, 0, 0.15);
}

/* Call Duration HUD */
.duration-hud {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 8px;
  display: none;
}

body.in-call .duration-hud {
  display: block;
}

/* Staged Attached Files Bar */
.staged-files-bar {
  position: fixed;
  bottom: calc(max(20px, env(safe-area-inset-bottom, 20px)) + 76px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  z-index: 98;
  pointer-events: none;
}

.staged-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  pointer-events: auto;
}

.staged-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 22, 32, 0.92);
  border: 1px solid rgba(254, 153, 0, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 6px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  color: var(--text-primary);
  animation: file-pill-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes file-pill-pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.staged-file-pill .file-icon {
  font-size: 14px;
}

.staged-file-pill .file-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.staged-file-pill .file-remove {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  transition: color 0.15s;
}

.staged-file-pill .file-remove:hover {
  color: #EF4444;
}

/* Drag and Drop Fullscreen Overlay */
.drag-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.drag-drop-modal {
  background: rgba(18, 22, 32, 0.95);
  border: 2px dashed var(--nutech-red);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 75, 0, 0.25);
  animation: drop-modal-pulse 1.5s infinite alternate ease-in-out;
}

@keyframes drop-modal-pulse {
  0% { border-color: rgba(255, 75, 0, 0.6); }
  100% { border-color: rgba(254, 153, 0, 1); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 40px rgba(254, 153, 0, 0.35); }
}

.drag-drop-modal svg {
  width: 56px;
  height: 56px;
  fill: var(--nutech-amber);
  margin-bottom: 16px;
}

.drag-drop-modal h4 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.drag-drop-modal p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Floating Bottom Control Dock (100% Mobile Optimized) */
footer.control-dock {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 20px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 0;
  margin: 0;
  z-index: 99;
  pointer-events: none;
}

.dock-pill {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(18, 22, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 10px 14px;
  border-radius: 44px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 75, 0, 0.12);
  pointer-events: auto;
}

.btn-circle {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.btn-circle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-circle:active {
  transform: scale(0.94);
}

.btn-circle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-circle.active {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-circle.active svg {
  fill: var(--danger);
}

.btn-circle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Primary Call Button */
.btn-call-primary {
  height: 50px;
  flex: 1;
  min-width: 140px;
  padding: 0 16px;
  border-radius: 30px;
  border: none;
  background: var(--nutech-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 8px 24px var(--nutech-glow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  white-space: nowrap;
}

.btn-call-primary:hover {
  background: var(--nutech-gradient-hover);
  box-shadow: 0 10px 28px rgba(255, 75, 0, 0.5);
}

.btn-call-primary:active {
  transform: scale(0.97);
}

.btn-call-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-call-primary svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

body.in-call .btn-call-primary {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

body.in-call .btn-call-primary:hover {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.5);
}

body.in-call #callIcon {
  transform: rotate(135deg);
}

/* ===================================================
   ADAPTIVE DOCK STATES (Eliminates mobile overflow)
   =================================================== */

/* 1. Standby: Only 3 essential buttons shown */
body:not(.in-call) #muteBtn,
body:not(.in-call) #interruptBtn,
body:not(.in-call) #pttHoldBtn {
  display: none !important;
}

/* 2. In-Call Handsfree: show call controls, hide PTT */
body.in-call:not(.mode-ptt) #pttHoldBtn {
  display: none !important;
}

body.in-call:not(.mode-ptt) #muteBtn,
body.in-call:not(.mode-ptt) #interruptBtn,
body.in-call:not(.mode-ptt) #attachFileBtn,
body.in-call:not(.mode-ptt) #drawerToggleBtn {
  display: flex !important;
}

/* 3. In-Call PTT Mode: hide mute and interrupt, make callBtn compact hangup, expand PTT */
body.in-call.mode-ptt #muteBtn,
body.in-call.mode-ptt #interruptBtn {
  display: none !important;
}

body.in-call.mode-ptt #pttHoldBtn {
  display: flex !important;
  flex: 1;
  min-width: 0;
}

body.in-call.mode-ptt .btn-call-primary {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  min-width: 50px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}

body.in-call.mode-ptt .btn-call-primary #callBtnText {
  display: none !important;
}

/* Dedicated Push-to-Talk Button */
.btn-ptt {
  height: 50px;
  flex: 1.2;
  min-width: 140px;
  padding: 0 18px;
  border-radius: 30px;
  border: 1px solid var(--nutech-amber);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, var(--nutech-glow) 100%);
  color: var(--nutech-amber);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  outline: none;
  white-space: nowrap;
}

.btn-ptt svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.15s;
}

.btn-ptt:hover {
  border-color: rgba(254, 153, 0, 0.8);
  color: #fff;
}

.btn-ptt.pressing {
  background: linear-gradient(135deg, #FF4B00 0%, #DC2626 100%) !important;
  border-color: #EF4444 !important;
  color: #fff !important;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.7), inset 0 0 12px rgba(0, 0, 0, 0.3) !important;
  transform: scale(0.96);
  animation: ptt-pulse 1s infinite alternate;
}

.btn-ptt.pressing svg {
  transform: scale(1.15);
  fill: #fff;
}

@keyframes ptt-pulse {
  0% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.6); }
  100% { box-shadow: 0 0 28px rgba(239, 68, 68, 0.9); }
}

/* Slide-over Transcripts Panel */
.drawer-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.drawer-panel.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-glass);
}

.drawer-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--nutech-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.hermes {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-bubble .sender {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
  text-transform: uppercase;
}

/* Settings Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  border-color: var(--nutech-red);
}

/* ===================================================
   ADAPTIVE STAGE MORPHING & DYNAMIC WIDGET CARDS
   =================================================== */

/* When stage has active widget */
main.call-stage.has-widget {
  justify-content: flex-start;
  padding-top: 10px;
}

main.call-stage.has-widget .orb-container {
  width: 76px !important;
  height: 76px !important;
  margin-bottom: 8px !important;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

main.call-stage.has-widget .orb-center-icon {
  width: 38px !important;
  height: 38px !important;
}

main.call-stage.has-widget .orb-center-icon svg {
  width: 18px !important;
  height: 18px !important;
}

main.call-stage.has-widget .state-banner {
  margin-bottom: 10px;
}

main.call-stage.has-widget .state-label {
  font-size: 11px;
  margin-bottom: 2px;
}

main.call-stage.has-widget .state-subtext {
  font-size: 13px;
  min-height: 18px;
}

main.call-stage.has-widget .captions-box {
  display: none; /* Hide floating ticker so widget takes visual priority */
}

/* Dynamic Widget Container */
.widget-stage-container {
  width: 100%;
  max-width: 820px;
  display: none;
  animation: widgetSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  margin-bottom: 16px;
}

main.call-stage.has-widget .widget-stage-container {
  display: block;
}

@keyframes widgetSlideUp {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dynamic-widget-card {
  background: rgba(18, 22, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 35px rgba(255, 75, 0, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 58vh;
  position: relative;
}

/* Widget Header */
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.widget-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-title-area .type-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--nutech-gradient);
  color: #fff;
}

.widget-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-btn-mini {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.widget-btn-mini:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* Widget Body */
.widget-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

/* KPI Chips Bar */
.kpi-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.kpi-chip {
  flex: 1;
  min-width: 120px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.kpi-chip-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-chip-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--nutech-amber);
}

/* Chart Canvas Wrapper */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  min-height: 200px;
}

.radial-chart-wrapper {
  max-width: 360px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Universal Dynamic Artifact Container (Tailwind GenUI Canvas) */
.dynamic-artifact-wrapper {
  width: 100%;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  border: none;
}

.dynamic-artifact-wrapper svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Rich Dark Table */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rich-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.rich-data-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rich-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.rich-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.table-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.table-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.table-badge.warning {
  background: rgba(254, 153, 0, 0.15);
  color: #FE9900;
  border: 1px solid rgba(254, 153, 0, 0.3);
}

.table-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.table-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Report / Summary Box */
.report-content-box {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.report-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--nutech-amber);
  text-transform: uppercase;
  margin: 14px 0 6px;
}

.report-highlight-card {
  background: rgba(255, 75, 0, 0.08);
  border-left: 3px solid var(--nutech-red);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  margin: 10px 0;
  font-size: 13px;
}

/* Curated Verified Knowledge Card */
.knowledge-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.knowledge-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.knowledge-verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.knowledge-topic-title {
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.4;
}

.knowledge-answer-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
}

.knowledge-answer-text {
  font-size: 14px;
  line-height: 1.6;
  color: #F1F5F9;
  font-weight: 400;
}

.knowledge-key-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(254, 153, 0, 0.05);
  border: 1px solid rgba(254, 153, 0, 0.18);
  border-radius: 12px;
  padding: 12px 16px;
}

.knowledge-points-label {
  font-size: 11px;
  font-weight: 700;
  color: #FE9900;
  letter-spacing: 0.5px;
}

.knowledge-point-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #CBD5E1;
}

.knowledge-point-bullet {
  color: #FE9900;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
}

.knowledge-source-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748B;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Chat Transcript Mini Widget Pill */
.chat-widget-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--nutech-amber);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-widget-button:hover {
  background: var(--nutech-gradient);
  color: #fff;
  border-color: transparent;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  header.top-bar {
    padding: 12px 16px;
  }
  .brand-title {
    font-size: 16px;
  }
  .orb-container {
    width: 250px;
    height: 250px;
    margin-bottom: 16px;
  }
  .orb-center-icon {
    width: 56px;
    height: 56px;
  }
  .orb-center-icon svg {
    width: 24px;
    height: 24px;
  }
  .state-subtext {
    font-size: 14px;
  }
  .captions-box {
    font-size: 13px;
    padding: 10px 14px;
  }

  main.call-stage.has-widget {
    padding-top: 6px;
  }
  main.call-stage.has-widget .dynamic-widget-card {
    max-height: 52vh;
  }
  .widget-header {
    padding: 10px 14px;
  }
  .widget-title {
    font-size: 14px;
  }
  .widget-body {
    padding: 12px 14px;
  }
  .chart-wrapper {
    height: 190px;
  }
  .kpi-chip {
    min-width: 90px;
    padding: 8px 10px;
  }
  .kpi-chip-value {
    font-size: 15px;
  }

  footer.control-dock {
    width: calc(100% - 20px);
    max-width: 420px;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }
  .staged-files-bar {
    bottom: calc(max(16px, env(safe-area-inset-bottom, 16px)) + 62px);
    width: calc(100% - 20px);
    max-width: 420px;
  }
  .dock-pill {
    padding: 7px 10px;
    gap: 6px;
  }
  .btn-circle {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }
  .btn-circle svg {
    width: 20px;
    height: 20px;
  }
  .btn-call-primary {
    height: 42px;
    font-size: 13px;
    padding: 0 12px;
    min-width: 76px;
    gap: 6px;
  }
  .btn-call-primary svg {
    width: 18px;
    height: 18px;
  }
  body.in-call.mode-ptt .btn-call-primary {
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex: 0 0 42px;
  }
  .btn-ptt {
    height: 42px;
    font-size: 13px;
    padding: 0 12px;
    min-width: 0;
    gap: 6px;
  }
  .btn-ptt svg {
    width: 18px;
    height: 18px;
  }
  .drawer-panel {
    width: 100%;
    right: -100%;
  }
}

@media (max-width: 380px) {
  .dock-pill {
    padding: 6px 8px;
    gap: 4px;
  }
  .btn-circle {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .btn-circle svg {
    width: 18px;
    height: 18px;
  }
  .btn-call-primary {
    height: 38px;
    font-size: 12px;
    padding: 0 8px;
    min-width: 68px;
  }
  body.in-call.mode-ptt .btn-call-primary {
    width: 38px;
    height: 38px;
    min-width: 38px;
    flex: 0 0 38px;
  }
  .btn-ptt {
    height: 38px;
    font-size: 12px;
    padding: 0 8px;
  }
}

/* Embed Mode (Inside Widget Popup iframe) */
body.is-embed {
  background: var(--bg-dark);
}

body.is-embed header.top-bar {
  padding: 10px 14px;
}

body.is-embed .brand-title {
  font-size: 15px;
}

body.is-embed main.call-stage {
  padding-bottom: 90px;
}

body.is-embed footer.control-dock {
  width: calc(100% - 16px);
  max-width: 380px;
  bottom: 12px;
}

body.is-embed .staged-files-bar {
  bottom: 74px;
  width: calc(100% - 16px);
  max-width: 380px;
}

/* ===================================================
   MODERN TOAST NOTIFICATION SYSTEM
   =================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 40px);
}

.toast-item {
  pointer-events: auto;
  background: rgba(18, 18, 24, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-icon.success { color: #10B981; }
.toast-icon.error { color: #EF4444; }
.toast-icon.info { color: #38BDF8; }
.toast-icon.warning { color: #FE9900; }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  line-height: 1.3;
}

.toast-message {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  color: #64748B;
  cursor: pointer;
  padding: 2px;
  margin-left: 4px;
  font-size: 16px;
  line-height: 1;
  transition: color 0.15s;
}

.toast-close:hover {
  color: #fff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--brand-primary, #FF4B00);
  width: 100%;
  transform-origin: left;
  animation: toastProgress 3.5s linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ===================================================
   LIVE TOOL EXECUTION STATUS PILL
   =================================================== */
.tool-active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(254, 153, 0, 0.12);
  border: 1px solid rgba(254, 153, 0, 0.3);
  color: #FE9900;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(254, 153, 0, 0.15);
  animation: toolPulse 1.8s infinite ease-in-out;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

@keyframes toolPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
}

