/*
 * FloatingPanel: a `raised` window sized by zag through `--width`/`--height` on its positioner; a column whose header
 * keeps its block height while the body takes (and clips) the rest, so a minimized panel, which zag shrinks to the
 * header, cannot be pushed open by its body. zag places and cursors the resize handles; only their thickness is set
 * here.
 */

@layer dx-components {
  .dx-floating-panel {
    /* Publishes its rung like the other absolute levels, so a `+1` Card inside resolves from it. */
    --dx-level: 3;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-separator);
    border-radius: var(--radius-sm, 0.25rem);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
    font-size: var(--dx-font-size);
    line-height: var(--dx-line-height);
  }
  .dx-floating-panel[data-behind] {
    opacity: 0.95;
  }
  /* An overlay ring, not an outline: the window's positioned panes paint over its own outline. */
  .dx-floating-panel:focus-visible {
    outline: none;
  }
  .dx-floating-panel:focus-visible::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 10;
    border-radius: inherit;
    box-shadow: inset 0 0 0 var(--dx-focus-ring-width) var(--dx-focus-ring-color);
    pointer-events: none;
  }
  /* Each part is its own stacking context (a flex item with a z-index), so no layer inside one can rise above the ring. */
  .dx-floating-panel > * {
    z-index: 0;
  }

  /* A block row plus its separator; the trailing Control's inset cells end at the panel edge. */
  .dx-floating-panel-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    min-height: var(--dx-block-size);
    padding-inline-start: var(--dx-gap-size);
    border-bottom: 1px solid var(--color-separator);
    user-select: none;
  }

  .dx-floating-panel-drag-trigger {
    display: flex;
    flex: 1;
    align-self: stretch;
    align-items: center;
    min-width: 0;
  }

  .dx-floating-panel-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--dx-font-size);
    font-weight: 500;
  }

  .dx-floating-panel-control {
    display: flex;
    flex-shrink: 0;
    align-items: center;
  }

  .dx-floating-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .dx-floating-panel-resize-trigger:is([data-axis='n'], [data-axis='s']) {
    height: 0.25rem;
  }
  .dx-floating-panel-resize-trigger:is([data-axis='e'], [data-axis='w']) {
    width: 0.25rem;
  }
  .dx-floating-panel-resize-trigger:is([data-axis='ne'], [data-axis='nw'], [data-axis='se'], [data-axis='sw']) {
    width: 0.5rem;
    height: 0.5rem;
  }
  .dx-floating-panel-resize-trigger[data-disabled] {
    display: none;
  }
}
