  /* :root {
      --bg-panel: #18181b;
      --bg-header: #27272a;
      --border-color: #3f3f46;
      --text-main: #f4f4f5;
      --text-muted: #a1a1aa;
    } */
    /* * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }  */
.floating-panel {
      --bg-panel: #18181b;
      --bg-header: #27272a;
      --border-color: #3f3f46;
      --text-main: #f4f4f5;
      --text-muted: #a1a1aa;

      position: fixed;
      width: 380px;
      height: 260px;
      min-width: 260px;
      min-height: 140px;
      background-color: var(--bg-panel);
      border: 1px solid var(--border-color);
      border-radius: 10px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
      display: flex;
      flex-direction: column;
      z-index: 1000;
      overflow: hidden;
      /* opacity: 0; */
      visibility: hidden;
      transform: scale(0.95);
      transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    }

.floating-panel.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.floating-panel.animating {
    transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease, opacity 0.15s ease, transform 0.15s ease;
}

.floating-panel.minimized {
    height: 42px !important;
    min-height: 42px !important;
    resize: none;
}

.floating-panel.minimized .panel-body,
.floating-panel.minimized .resize-handle {
    display: none !important;
}

.floating-panel.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
}

.floating-panel.maximized .panel-header {
    cursor: default;
}

.floating-panel.maximized .resize-handle {
    display: none !important;
}

.panel-header {
    height: 42px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    touch-action: none; /* Prevent browser scrolling while dragging */
}

.panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.ctrl-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.ctrl-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.panel-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.resize-handle {
    position: absolute;
    z-index: 10;
    touch-action: none; /* Prevent browser scrolling while resizing */
}

.resize-handle.n  { 
    top: 0; 
    left: 8px; 
    right: 8px; 
    height: 6px; 
    cursor: ns-resize; 
}
.resize-handle.s  { 
    bottom: 0; 
    left: 8px; 
    right: 8px; 
    height: 6px; 
    cursor: ns-resize; 
}
.resize-handle.e  { 
    top: 8px; 
    bottom: 8px; 
    right: 0; 
    width: 6px; 
    cursor: ew-resize; 
}
.resize-handle.w  { 
    top: 8px; 
    bottom: 8px; 
    left: 0; 
    width: 6px; 
    cursor: ew-resize; 
}
.resize-handle.ne { 
    top: 0; 
    right: 0; 
    width: 10px; 
    height: 10px; 
    cursor: nesw-resize; 
}
.resize-handle.nw { 
    top: 0; 
    left: 0; 
    width: 10px; 
    height: 10px; 
    cursor: nwse-resize; 
}
.resize-handle.se { 
    bottom: 0; 
    right: 0; 
    width: 10px; 
    height: 10px; 
    cursor: nwse-resize; 
}
.resize-handle.sw { 
    bottom: 0; 
    left: 0; 
    width: 10px; 
    height: 10px; 
    cursor: nesw-resize; 
}