.spt-floating-window {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 260px;
  width: min(432px, calc(100vw - 44px));
  max-height: none;
  overflow: hidden;
  color: var(--spt-ink);
  background: var(--spt-surface-raised);
  border: 1px solid var(--spt-border-strong);
  border-radius: var(--spt-radius);
  box-shadow: var(--spt-shadow-soft);
  pointer-events: auto;
}

.spt-floating-window[hidden] {
  display: none;
}

.spt-floating-window__header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 8px 0 12px;
  background: var(--spt-surface);
  border-bottom: 1px solid var(--spt-border);
  cursor: move;
  touch-action: none;
  user-select: none;
}

.spt-floating-window__title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.spt-floating-window__title-wrap--custom {
  flex: 1 1 auto;
}

.spt-floating-window__icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.78;
}

.spt-floating-window__title {
  overflow: hidden;
  margin: 0;
  color: var(--spt-ink);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spt-floating-window__title--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.spt-floating-window__close {
  position: relative;
  z-index: 4;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: var(--spt-ink-soft);
  font-size: 14px;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--spt-radius);
  cursor: default;
}

.spt-floating-window__close:hover {
  color: var(--spt-ink);
  background: var(--spt-menu-hover);
  border-color: var(--spt-border);
}

.spt-floating-window__close:focus-visible {
  outline: 2px solid var(--spt-focus);
  outline-offset: 2px;
}

.spt-floating-window__body {
  container-type: inline-size;
  flex: 1 1 auto;
  max-height: none;
  overflow: auto;
}

.spt-floating-window__resize {
  position: absolute;
  z-index: 2;
  background: transparent;
  touch-action: none;
}

.spt-floating-window__resize.is-n,
.spt-floating-window__resize.is-s {
  left: 28px;
  width: calc(100% - 56px);
  height: 18px;
}

.spt-floating-window__resize.is-n {
  top: 0;
  cursor: n-resize;
}

.spt-floating-window__resize.is-s {
  bottom: 0;
  cursor: s-resize;
}

.spt-floating-window__resize.is-e,
.spt-floating-window__resize.is-w {
  top: 28px;
  width: 18px;
  height: calc(100% - 56px);
}

.spt-floating-window__resize.is-e {
  right: 0;
  cursor: e-resize;
}

.spt-floating-window__resize.is-w {
  left: 0;
  cursor: w-resize;
}

.spt-floating-window__resize.is-ne,
.spt-floating-window__resize.is-nw,
.spt-floating-window__resize.is-se,
.spt-floating-window__resize.is-sw {
  width: 28px;
  height: 28px;
}

.spt-floating-window__resize.is-ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
}

.spt-floating-window__resize.is-nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
}

.spt-floating-window__resize.is-se {
  right: 0;
  bottom: 0;
  cursor: se-resize;
}

.spt-floating-window__resize.is-sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
}

.spt-floating-window.is-moving {
  user-select: none;
}

.spt-window-pointer-active,
.spt-window-pointer-active * {
  cursor: inherit;
  user-select: none;
}

.spt-app-dialog-layer {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(0, 0, 0, 0.16);
  pointer-events: auto;
}

.spt-app-dialog-layer[hidden] {
  display: none;
}

.spt-app-dialog {
  width: min(420px, 100%);
  padding: 14px;
  color: var(--spt-ink);
  background: var(--spt-surface-raised);
  border: 1px solid var(--spt-border-strong);
  border-radius: var(--spt-radius);
  box-shadow: var(--spt-shadow-soft);
}

.spt-app-dialog__title {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.2;
}

.spt-app-dialog__message {
  margin: 0;
  color: var(--spt-ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.spt-app-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

.spt-app-dialog__button {
  min-height: 30px;
  padding: 0 14px;
  color: var(--spt-ink);
  font: inherit;
  font-weight: 700;
  background: var(--spt-surface);
  border: 1px solid var(--spt-border-strong);
  border-radius: var(--spt-radius);
}

.spt-app-dialog__button:hover {
  background: var(--spt-selected-bg);
}

.spt-app-dialog__button:focus-visible {
  outline: 2px solid var(--spt-focus);
  outline-offset: 2px;
}

.spt-app-dialog__button--primary {
  background: var(--spt-selected-bg);
}

@media (max-width: 520px) {
  .spt-floating-window {
    top: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    max-height: none;
  }
}
