.guide-dock.guide-layout-mounted {
  left: 0 !important;
  top: 0;
  right: auto;
  bottom: auto !important;
  z-index: 7;
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translate3d(12px, 48px, 0);
  will-change: transform;
}

.guide-layout-mounted .guide-layout-toggle {
  position: absolute;
  left: 0;
  top: -40px;
  z-index: 4;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(249, 247, 239, .93);
  color: #173c58;
  box-shadow: 0 4px 16px rgba(4, 28, 45, .24);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  white-space: nowrap;
}

.guide-layout-mounted.guide-layout-editing::after {
  content: '';
  position: absolute;
  inset: -8px;
  z-index: 1;
  pointer-events: none;
  border: 2px dashed rgba(113, 222, 235, .96);
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(9, 44, 63, .26);
}

.guide-layout-mounted.guide-layout-editing {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.guide-layout-mounted.guide-layout-dragging {
  cursor: grabbing;
}

.guide-layout-mounted.guide-layout-editing .guide-character {
  pointer-events: none;
}

.guide-layout-controls {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 9;
  width: 230px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 8px;
  background: rgba(249, 247, 239, .97);
  color: #173c58;
  box-shadow: 0 12px 34px rgba(4, 28, 45, .28);
  backdrop-filter: blur(14px);
  cursor: default;
  user-select: none;
  will-change: transform;
}

.guide-layout-size {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.guide-layout-size output {
  color: #56727e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.guide-layout-size input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: #176c89;
  cursor: ew-resize;
}

.guide-layout-hint {
  margin: 10px 0 11px;
  color: #657b83;
  font-size: 10px;
  line-height: 1.55;
}

.guide-layout-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 7px;
}

.guide-layout-actions button {
  min-height: 35px;
  padding: 7px 9px;
  border-radius: 4px;
  background: #e4ecec;
  color: #274e60;
  font-size: 11px;
  font-weight: 700;
}

.guide-layout-actions .guide-layout-lock {
  background: #173c58;
  color: #fff;
}

.guide-layout-mounted .guide-layout-resize {
  position: absolute;
  right: -14px;
  bottom: -14px;
  z-index: 6;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #176c89;
  box-shadow: 0 4px 14px rgba(4, 28, 45, .34);
  cursor: nwse-resize;
  touch-action: none;
}

.guide-layout-mounted .guide-layout-resize::before,
.guide-layout-mounted .guide-layout-resize::after {
  content: '';
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 9px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(-45deg);
  transform-origin: center;
}

.guide-layout-mounted .guide-layout-resize::after {
  right: 5px;
  bottom: 5px;
  width: 15px;
}

@media (max-width: 520px) {
  .guide-layout-controls {
    width: min(230px, calc(100vw - 24px));
  }

  .guide-layout-mounted .guide-layout-toggle {
    top: -36px;
    min-height: 29px;
    padding: 6px 10px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-dock.guide-layout-mounted {
    will-change: auto;
  }
}
